38static RGBi SYSTEM_PALETTE[] = {
39 { 0xff, 0xff, 0xff, 0xff, 0,
"WHITE", 0 },
40 { 0xa0, 0xa0, 0xa0, 0xff, 1,
"LIGHT GRAY", 1 },
41 { 0x50, 0x50, 0x50, 0xff, 2,
"DARK GRAY", 2 },
42 { 0x00, 0x00, 0x00, 0xff, 3,
"BLACK", 3 }
53 deploy( joystick, src_hw_gb_joystick_asm );
63 deploy( joystick, src_hw_gb_joystick_asm );
84 deploy( joystick, src_hw_gb_joystick_asm );
93 deploy( joystick, src_hw_gb_joystick_asm );
102 deploy( joystick, src_hw_gb_joystick_asm );
104 outline1(
"LD B, $%2.2x", _release );
111 deploy( joystick, src_hw_gb_joystick_asm );
113 outline1(
"LD B, $%2.2x", _release );
169 outline1(
"CALL $%4.4x", _destination );
175 deploy( timer, src_hw_sm83_timer_asm);
191 deploy( timer, src_hw_sm83_timer_asm);
207 deploy( timer, src_hw_sm83_timer_asm);
231 deploy( timer, src_hw_sm83_timer_asm);
255 deploy( timer, src_hw_sm83_timer_asm);
278void gb_dload(
Environment * _environment,
char * _filename,
char * _offset,
char * _address,
char * _size ) {
282void gb_dsave(
Environment * _environment,
char * _filename,
char * _offset,
char * _address,
char * _size ) {
291static RGBi * commonPalette;
300 unsigned int minDistance = 0xffff;
304 if ( _color->
alpha < 255 ) {
311 if ( SYSTEM_PALETTE[j].alpha < 255 ) {
321 return &SYSTEM_PALETTE[colorIndex];
336static void gb_image_converter_tile(
Environment * _environment,
char * _source,
char * _dest,
int _width,
int _depth,
int _source_width ) {
340 for (
int y=0; y<8; ++y) {
341 for (
int x=0; x<8; ++x) {
345 memset( &rgb, 0,
sizeof(
RGBi ) );
355 if ( rgb.
alpha == 0 ) {
363 char bitmask = 1 << ( 7 - ((x) & 0x7) );
364 int pos0 = ( y * 2 );
365 int pos1 = ( y * 2 + 1 );
367 if ( systemRgb->
index & 0x01 ) {
368 *( _dest + pos0 ) |= bitmask;
370 *( _dest + pos0 ) &= ~bitmask;
373 if ( systemRgb->
index & 0x02 ) {
374 *( _dest + pos1 ) |= bitmask;
376 *( _dest + pos1 ) &= ~bitmask;
385 source += _depth * ( _source_width - 8 );
450 int colorIndex = _index & 0x03;
451 int colorValue = _background_color & 0x03;
453 int raw = ( colorValue ) << ( colorIndex * 2 );
454 int notRaw = ~ ( 3 << ( colorIndex * 2 ) );
497 outline1(
"LD A, (%s)", _background_color);
504 outline1(
"LD A, (%s)", _background_color);
532 int colorIndex = _index & 0x03;
534 int notRaw = ~ ( 3 << ( colorIndex * 2 ) );
536 outline1(
"LD A, (%s)", _background_color);
538 for(
int i=0; i<colorIndex; ++i ) {
597 outline1(
"LD (%s), A", _background_color);
669static int rgbConverterFunction(
int _red,
int _green,
int _blue ) {
672 unsigned int minDistance = 0xffffffff;
680 for (j = 0; j <
sizeof(SYSTEM_PALETTE)/
sizeof(
RGBi); ++j) {
747 int startAddress = 0x9800;
763 outline0(
"CALL CONSOLECALCULATE" );
871 deploy( sprite, src_hw_gb_sprites_asm );
885 deploy( sprite, src_hw_gb_sprites_asm );
890 sprintf(dataLabel,
"%sdata", image->
realName);
900 deploy( sprite, src_hw_gb_sprites_asm );
912 deploy( sprite, src_hw_gb_sprites_asm );
926 deploy( sprite, src_hw_gb_sprites_asm );
976 outline1(
"LD A, (%s)", _displacement);
984 outline1(
"LD A, (%s)", _displacement);
1025 deploy( clsText, src_hw_gb_cls_asm );
1036 if ( _direction > 0 ) {
1037 deploy( vScrollTextDown, src_hw_gb_vscroll_text_down_asm );
1040 deploy( vScrollTextUp, src_hw_gb_vscroll_text_up_asm );
1048 deploy( gbvars, src_hw_gb_vars_asm );
1050 deploy( vScrollTextUp, src_hw_gb_vscroll_text_up_asm );
1055 outline1(
"LD A, (%s)", _text_size);
1063 outline0(
"CALL TEXTATBITMAPMODERAW");
1069 deploy( textEncodedAtGraphic, src_hw_gb_text_at_asm );
1296 copperList = copperList->
next;
1387 int size = ( ( _width >> 3 ) * ( _height >> 3 ) );
1399static int calculate_images_size(
Environment * _environment,
int _frames,
int _width,
int _height,
int _mode ) {
1406 int size = ( ( _width >> 3 ) * ( _height >> 3 ) );
1408 return 3 + ( 3 +
size +
size * 16 ) * _frames;
1418static int calculate_sequence_size(
Environment * _environment,
int _sequences,
int _frames,
int _width,
int _height,
int _mode ) {
1425 int size = ( ( _width >> 3 ) * ( _height >> 3 ) );
1427 return 3 + ( ( 3 +
size +
size * 16 ) * _frames ) * _sequences;
1437static Variable * gb_image_converter_tilemap_mode_standard(
Environment * _environment,
char * _source,
int _width,
int _height,
int _depth,
int _offset_x,
int _offset_y,
int _frame_width,
int _frame_height,
int _transparent_color,
int _flags ) {
1439 image_converter_asserts( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8, 8 );
1443 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
1445 if ( _frame_width % 8 ) {
1446 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
1451 if ( _height % 8 ) {
1452 _height = ( ( ( _height - 1 ) / 8 ) - 1 ) * 8;
1454 if ( _frame_height % 8 ) {
1455 _frame_height = ( ( ( _frame_height - 1 ) / 8 ) - 1 ) * 8;
1469 int size = ( ( _frame_width >> 3 ) * ( _frame_height >> 3 ) );
1471 int bufferSize = 3 +
size +
size * 16;
1473 char * buffer =
malloc ( bufferSize );
1475 memset( buffer, 0, bufferSize );
1478 buffer[1] = ( _frame_width >> 3 );
1483 _source += ( ( _offset_y * _width ) + _offset_x ) * _depth;
1485 for( cy=0; cy<(_frame_height >> 3);++cy) {
1486 for( cx=0; cx<(_frame_width >> 3);++cx) {
1488 int tileDataOffset = 3 +
size + ( (cy * ( _frame_width >> 3 ) ) + cx ) * ( 16 );
1490 char *
source = _source + ( ( cy * 8 * _width ) + cx * 8 ) * _depth;
1492 char convertedTile[16];
1494 gb_image_converter_tile( _environment,
source, convertedTile, _width, _depth, _width );
1496 memcpy( &buffer[tileDataOffset], convertedTile, 16 );
1510 if ( _width != 8 ) {
1514 if ( _height != 8 ) {
1524 int bufferSize = 3 +
size +
size * 16;
1526 char * buffer =
malloc ( bufferSize );
1528 memset( buffer, 0, bufferSize );
1536 int tileDataOffset = 3 +
size;
1540 char convertedTile[16];
1542 gb_image_converter_tile( _environment,
source, convertedTile, _width, _depth, _width );
1544 memcpy( &buffer[tileDataOffset], convertedTile, 16 );
1554Variable *
gb_image_converter(
Environment * _environment,
char * _data,
int _width,
int _height,
int _depth,
int _offset_x,
int _offset_y,
int _frame_width,
int _frame_height,
int _mode,
int _transparent_color,
int _flags ) {
1561 return gb_image_converter_tilemap_mode_standard( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
1572static void gb_load_image_address_to_other_register(
Environment * _environment,
char * _register,
char * _source,
char * _sequence,
char * _frame,
int _frame_size,
int _frame_count ) {
1655static void gb_load_image_address_to_register(
Environment * _environment,
char * _register,
Resource * _source,
char * _sequence,
char * _frame,
int _frame_size,
int _frame_count ) {
1662 sprintf(dataLabel,
"%sdata", _source->
realName);
1666 if ( _frame_size ) {
1668 if ( !_sequence && !_frame ) {
1673 if ( strlen(_sequence) == 0 ) {
1676 outline1(
"LD A, (%s)", _sequence );
1681 if ( strlen(_frame) == 0 ) {
1695 if ( strlen(_frame) == 0 ) {
1711 outline1(
"LD (%s), HL", _register );
1717void gb_blit_image(
Environment * _environment,
char * _sources[],
int _source_count,
char * _blit,
char * _x,
char * _y,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
int _flags ) {
1776void gb_put_image(
Environment * _environment,
Resource * _image,
char * _x,
char * _y,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
char * _flags ) {
1778 deploy( gbvars, src_hw_gb_vars_asm);
1779 deploy( putimage, src_hw_gb_put_image_asm );
1790 gb_load_image_address_to_register( _environment, NULL, _image, _sequence, _frame, _frame_size, _frame_count );
1809 outline1(
"LD A, $%2.2x", _on_off );
1825 memset( buffer, 0,
size );
1828 buffer[1] = ( _width >> 3 );
1907void gb_get_image(
Environment * _environment,
char * _image,
char * _x,
char * _y,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
int _palette ) {
2149void gb_slice_image(
Environment * _environment,
char * _image,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
char * _destination ) {
2285static unsigned int SOUND_FREQUENCIES[] = {
2286 -5969, -5518, -5094, -4693, -4315, -3958, -3621, -3303,
2287 -3002, -2719, -2451, -2199, -1960, -1735, -1523, -1323,
2288 -1134, -955, -787, -627, -477, -336, -202, -76,
2289 44, 156, 262, 362, 457, 546, 630, 710,
2290 785, 856, 923, 986, 1046, 1102, 1155, 1205,
2291 1252, 1297, 1339, 1379, 1416, 1452, 1485, 1517,
2292 1547, 1575, 1601, 1626, 1650, 1672, 1693, 1713,
2293 1732, 1750, 1766, 1782, 1797, 1811, 1824, 1837,
2294 1849, 1860, 1870, 1880, 1890, 1899, 1907, 1915,
2295 1922, 1929, 1936, 1942, 1948, 1954, 1959, 1964,
2296 1969, 1973, 1977, 1981, 1985, 1988, 1992, 1995,
2297 1998, 2001, 2003, 2006, 2008, 2010, 2012, 2014,
2298 2016, 2018, 2020, 2021, 2023, 2024, 2026, 2027,
2299 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2034,
2300 2035, 2036, 2036, 2037, 2038, 2038, 2039, 2039
2305 if ( _channels & 0x01 ) {
2308 if ( _channels & 0x02 ) {
2311 if ( _channels & 0x04 ) {
2314 if ( _channels & 0x08 ) {
2322 outline1(
"LD A, $%2.2x", ( _volume & 0x0f ) );
2324 outline1(
"LD A, $%2.2x", ( _channels & 0x07 ) );
2329#define PROGRAM_FREQUENCY( c, f ) \
2330 outline1("LD A, $%2.2x", ( f & 0xff ) ); \
2331 outline0("LD E, A" ); \
2332 outline1("LD A, $%2.2x", ( ( f >> 8 ) & 0xff ) ); \
2333 outline0("LD D, A" ); \
2334 if ( ( c & 0x01 ) ) \
2335 outline0("CALL GBPROGFREQ0" ); \
2336 if ( ( c & 0x02 ) ) \
2337 outline0("CALL GBPROGFREQ1" ); \
2338 if ( ( c & 0x04 ) ) \
2339 outline0("CALL GBPROGFREQ2" ); \
2340 if ( ( c & 0x08 ) ) \
2341 outline0("CALL GBPROGFREQ3" );
2343#define PROGRAM_FREQUENCY_V( c, f ) \
2344 outline1("LD A, (%s)", f ); \
2345 outline0("LD E, A" ); \
2346 outline1("LD A, (%s)", address_displacement(_environment, f, "1") ); \
2347 outline0("LD D, A" ); \
2348 if ( c == NULL ) { \
2349 outline0("LD A, $3"); \
2351 outline1("LD A, (%s)", c ); \
2353 outline0("CALL GBFREQ" );
2355#define PROGRAM_FREQUENCY_SV( c, f ) \
2356 outline1("LD A, $%2.2x", ( f & 0xff ) ); \
2357 outline0("LD E, A" ); \
2358 outline1("LD A, $%2.2x", ( ( f >> 8 ) & 0xff ) ); \
2359 outline0("LD D, A" ); \
2360 if ( c == NULL ) { \
2361 outline0("LD A, $3"); \
2363 outline1("LD A, (%s)", c ); \
2365 outline0("CALL GBFREQ2" );
2367#define PROGRAM_DURATION( c, d ) \
2368 outline1("LD A, $%2.2x", ( d & 0xff ) ); \
2369 outline0("LD E, A" ); \
2370 outline1("LD A, $%2.2x", ( ( d >> 8 ) & 0xff ) ); \
2371 outline0("LD D, A" ); \
2372 if ( ( c & 0x01 ) ) \
2373 outline0("CALL GBPROGDUR0" ); \
2374 if ( ( c & 0x02 ) ) \
2375 outline0("CALL GBPROGDUR1" ); \
2376 if ( ( c & 0x04 ) ) \
2377 outline0("CALL GBPROGDUR2" ); \
2378 if ( ( c & 0x08 ) ) \
2379 outline0("CALL GBPROGDUR3" );
2381#define WAIT_DURATION( c ) \
2382 if ( ( c & 0x01 ) ) \
2383 outline0("CALL GBWAITDUR0" ); \
2384 if ( ( c & 0x02 ) ) \
2385 outline0("CALL GBWAITDUR1" ); \
2386 if ( ( c & 0x04 ) ) \
2387 outline0("CALL GBWAITDUR2" ); \
2388 if ( ( c & 0x08 ) ) \
2389 outline0("CALL GBWAITDUR3" );
2391#define PROGRAM_PITCH( c, f ) \
2392 outline1("LD A, $%2.2x", ( f & 0xff ) ); \
2393 outline0("LD E, A" ); \
2394 outline1("LD A, $%2.2x", ( ( f >> 8 ) & 0xff ) ); \
2395 outline0("LD D, A" ); \
2396 if ( ( c & 0x01 ) ) \
2397 outline0("CALL GBPROGFREQ0" ); \
2398 if ( ( c & 0x02 ) ) \
2399 outline0("CALL GBPROGFREQ1" ); \
2400 if ( ( c & 0x04 ) ) \
2401 outline0("CALL GBPROGFREQ2" ); \
2402 if ( ( c & 0x08 ) ) \
2403 outline0("CALL GBPROGFREQ3" );
2405#define PROGRAM_PITCH_V( c, f ) \
2406 outline1("LD A, (%s)", f ); \
2407 outline0("LD E, A" ); \
2408 outline1("LD A, (%s)", address_displacement(_environment, f, "1") ); \
2409 outline0("LD D, A" ); \
2410 if ( c == NULL ) { \
2411 outline0("LD A, $3"); \
2413 outline1("LD A, (%s)", c ); \
2415 outline0("CALL GBPROGFREQ" );
2417#define PROGRAM_PITCH_SV( c, f ) \
2418 outline1("LD A, $%2.2x", ( f & 0xff ) ); \
2419 outline0("LD E, A" ); \
2420 outline1("LD A, $%2.2x", ( ( f >> 8 ) & 0xff ) ); \
2421 outline0("LD D, A" ); \
2422 if ( c == NULL ) { \
2423 outline0("LD A, $3"); \
2425 outline1("LD A, (%s)", c ); \
2427 outline0("CALL GBPROGFREQ" );
2429#define PROGRAM_PULSE( c, p ) \
2430 outline1("LD A, $%2.2x", ( p & 0xff ) ); \
2431 outline0("LD E, A" ); \
2432 outline1("LD A, $%2.2x", ( ( p >> 8 ) & 0xff ) ); \
2433 outline0("LD D, A" ); \
2434 if ( ( c & 0x01 ) ) \
2435 outline0("CALL GBPROGPULSE0" ); \
2436 if ( ( c & 0x02 ) ) \
2437 outline0("CALL GBPROGPULSE1" ); \
2438 if ( ( c & 0x04 ) ) \
2439 outline0("CALL GBPROGPULSE2" ); \
2440 if ( ( c & 0x08 ) ) \
2441 outline0("CALL GBPROGPULSE3" );
2443#define PROGRAM_PULSE_V( c, p ) \
2444 outline1("LD A, (%s)", p ); \
2445 outline0("LD E, A" ); \
2446 outline1("LD A, (%s)", address_displacement(_environment, p, "1") ); \
2447 outline0("LD D, A" ); \
2448 if ( c == NULL ) { \
2449 outline0("LD A, $3"); \
2451 outline1("LD A, (%s)", c ); \
2453 outline0("CALL GBPROGPULSE" );
2455#define PROGRAM_PULSE_SV( c, p ) \
2456 outline1("LD A, $%2.2x", ( p & 0xff ) ); \
2457 outline0("LD E, A" ); \
2458 outline1("LD A, $%2.2x", ( ( p >> 8 ) & 0xff ) ); \
2459 outline0("LD D, A" ); \
2460 if ( c == NULL ) { \
2461 outline0("LD A, $3"); \
2463 outline1("LD A, (%s)", c ); \
2465 outline0("CALL GBPROGPULSE" );
2467#define STOP_FREQUENCY( c ) \
2468 if ( ( c & 0x01 ) ) \
2469 outline0("CALL GBSTOP0" ); \
2470 if ( ( c & 0x02 ) ) \
2471 outline0("CALL GBSTOP1" ); \
2472 if ( ( c & 0x04 ) ) \
2473 outline0("CALL GBSTOP2" ); \
2474 if ( ( c & 0x08 ) ) \
2475 outline0("CALL GBSTOP3" );
2477#define STOP_FREQUENCY_V( c ) \
2478 if ( c == NULL ) { \
2479 outline0("LD A, $3"); \
2481 outline1("LD A, (%s)", c ); \
2483 outline0("CALL GBSTOP" );
2485#define STOP_FREQUENCY_SV( c ) \
2486 if ( c == NULL ) { \
2487 outline0("LD A, $3"); \
2489 outline1("LD A, (%s)", c ); \
2491 outline0("CALL GBSTOP" );
2671 gb_set_pitch( _environment, _channels, SOUND_FREQUENCIES[_note] );
2684 outline1(
"LD A, (%s)", _channels );
2701 outline1(
"LD A, (%s)", _channels );
2711 outline1(
"LD A, $%2.2x", _volume );
2884 outline1(
"LD A, (%s)", _frequency );
2889 outline1(
"LD A, (%s)", _channels );
2905 outline1(
"LD A, (%s)", _channels );
2931 outline1(
"LD A, (%s)", _channels );
2942 outline1(
"LD A, (%s)", _channels );
2949 deploy( music, src_hw_gb_music_asm );
2954 outline1(
"LD A, $%2.2x", ( _size>>8 ) & 0xff);
2956 outline1(
"LD A, $%2.2x", _size & 0xff );
2980 outline1(
"LD HL, (%s)", _duration );
3009 deploy( screen, src_hw_gb_screen_asm);
void cpu_store_16bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 16 bit
void cpu_move_16bit(Environment *_environment, char *_source, char *_destination)
CPU 6309: emit code to move 16 bit
void cpu_store_8bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 8 bit
int lastUsedSlotInCommonPalette
Variable * variable_retrieve_or_define(Environment *_environment, char *_name, VariableType _type, int _value)
int rgbi_distance(RGBi *_e1, RGBi *_e2)
Calculate the distance between two colors.
int rgbi_equals_rgb(RGBi *_first, RGBi *_second)
Variable * variable_import(Environment *_environment, char *_name, VariableType _type, int _size_or_value)
void variable_global(Environment *_environment, char *_pattern)
ScreenMode * find_screen_mode_by_suggestion(Environment *_environment, int _bitmap, int _width, int _height, int _colors, int _tile_width, int _tile_height)
Variable * variable_temporary(Environment *_environment, VariableType _type, char *_meaning)
Define a temporary variable.
void font_descriptors_init(Environment *_environment, int _embedded_present)
void image_converter_asserts(Environment *_environment, int _width, int _height, int _offset_x, int _offset_y, int *_frame_width, int *_frame_height, int _modulo_x, int _modulo_y)
char * address_displacement(Environment *_environment, char *_address, char *_displacement)
Variable * variable_store_buffer(Environment *_environment, char *_destination, unsigned char *_buffer, int _size, int _at)
#define TILEMAP_MODE_STANDARD
Variable * distance(Environment *_environment, char *_x1, char *_y1, char *_x2, char *_y2)
Return the distance between two (screen) positions.
void gb_sprite_at(Environment *_environment, char *_sprite, char *_x, char *_y)
void gb_scanshift(Environment *_environment, char *_shifts)
void gb_start_var(Environment *_environment, char *_channels)
void gb_set_duration(Environment *_environment, int _channel, int _duration)
void gb_background_color_get_vars(Environment *_environment, char *_index, char *_background_color)
GB: emit code to retrieve background color
void gb_sprite_monocolor(Environment *_environment, char *_sprite)
int gb_screen_mode_enable(Environment *_environment, ScreenMode *_screen_mode)
void gb_finalization(Environment *_environment)
void gb_get_height(Environment *_environment, char *_result)
#define PROGRAM_DURATION(c, d)
void gb_joy(Environment *_environment, int _port, char *_value)
void gb_text(Environment *_environment, char *_text, char *_text_size, int _raw)
void gb_use_tileset(Environment *_environment, char *_tileset)
void gb_sprite_compress_vertical(Environment *_environment, char *_sprite)
void gb_clear_key(Environment *_environment)
void gb_wait_duration(Environment *_environment, int _channel)
void gb_background_color_vars(Environment *_environment, char *_index, char *_background_color)
GB: emit code to change background color
void gb_keyshift(Environment *_environment, char *_shifts)
void gb_timer_set_status_off(Environment *_environment, char *_timer)
void gb_slice_image_copy(Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
void gb_timer_set_status_on(Environment *_environment, char *_timer)
Variable * gb_image_converter(Environment *_environment, char *_data, int _width, int _height, int _depth, int _offset_x, int _offset_y, int _frame_width, int _frame_height, int _mode, int _transparent_color, int _flags)
void gb_cls_box(Environment *_environment, char *_x1, char *_y1, char *_w, char *_h)
void gb_timer_set_counter(Environment *_environment, char *_timer, char *_counter)
void gb_hscroll_line(Environment *_environment, int _direction, int _overlap)
void gb_cls(Environment *_environment)
#define PROGRAM_FREQUENCY(c, f)
void gb_sprite_multicolor(Environment *_environment, char *_sprite)
void gb_set_volume(Environment *_environment, int _channels, int _volume)
RGBi * gb_image_nearest_system_color(RGBi *_color)
void gb_slice_image(Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
void gb_horizontal_scroll(Environment *_environment, char *_displacement)
void gb_pset_int(Environment *_environment, int _x, int _y, int *_c)
void gb_put_key(Environment *_environment, char *_string, char *_size)
void gb_sprite_data_set(Environment *_environment, char *_sprite, char *_address)
void gb_set_program_semi_var(Environment *_environment, char *_channels, int _program)
void gb_put_image(Environment *_environment, Resource *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_flags)
void gb_set_pitch_vars(Environment *_environment, char *_channels, char *_pitch)
void gb_screen_columns(Environment *_environment, char *_columns)
Variable * gb_new_sequence(Environment *_environment, int _sequences, int _frames, int _width, int _height, int _mode)
void gb_tiles_get(Environment *_environment, char *_result)
void gb_sprite_data_from(Environment *_environment, char *_sprite, char *_image)
void gb_blit_image(Environment *_environment, char *_sources[], int _source_count, char *_blit, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, int _flags)
void gb_screen_on_off(Environment *_environment, int _on_off)
void gb_wait_duration_vars(Environment *_environment, char *_channel)
void gb_set_volume_vars(Environment *_environment, char *_channels, char *_volume)
void gb_initialization(Environment *_environment)
void gb_background_color_semivars(Environment *_environment, int _index, char *_background_color)
GB: emit code to change background color
void gb_bank_select(Environment *_environment, int _bank)
void gb_background_color(Environment *_environment, int _index, int _background_color)
GB: emit code to change background color
void gb_key_pressed(Environment *_environment, char *_scancode, char *_result)
void gb_calculate_sequence_frame_offset(Environment *_environment, char *_offset, char *_sequence, char *_frame, int _frame_size, int _frame_count)
void gb_put_tile(Environment *_environment, char *_tile, char *_x, char *_y)
void gb_wait_fire_semivar(Environment *_environment, char *_port, int _release)
void gb_move_memory_video(Environment *_environment, char *_from, char *_to, char *_size)
void gb_start(Environment *_environment, int _channels)
Variable * gb_new_images(Environment *_environment, int _frames, int _width, int _height, int _mode)
void gb_sprite_priority(Environment *_environment, char *_sprite, char *_priority)
void gb_tile_at(Environment *_environment, char *_x, char *_y, char *_result)
int gb_image_size(Environment *_environment, int _width, int _height, int _mode)
#define STOP_FREQUENCY(c)
void gb_colors_vars(Environment *_environment, char *_foreground_color, char *_background_color)
void gb_vertical_scroll(Environment *_environment, char *_displacement)
void gb_busy_wait(Environment *_environment, char *_timing)
void gb_cline(Environment *_environment, char *_characters)
void gb_move_tiles(Environment *_environment, char *_tile, char *_x, char *_y)
void gb_screen_on(Environment *_environment)
void gb_get_width(Environment *_environment, char *_result)
void gb_next_raster(Environment *_environment)
GB: emit code to wait for next raster irq
void gb_slice_image_extract(Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
void gb_dload(Environment *_environment, char *_filename, char *_offset, char *_address, char *_size)
void gb_set_pitch(Environment *_environment, int _channels, int _pitch)
void gb_tiles_at(Environment *_environment, char *_address)
void gb_set_frequency_vars(Environment *_environment, char *_channels, char *_frequency)
void gb_sprite_color(Environment *_environment, char *_sprite, char *_color)
void gb_colormap_at(Environment *_environment, char *_address)
void gb_bitmap_disable(Environment *_environment)
void gb_sprite_expand_vertical(Environment *_environment, char *_sprite)
void gb_scancode(Environment *_environment, char *_result)
void gb_textmap_at(Environment *_environment, char *_address)
void gb_screen(Environment *_environment, char *_x, char *_y, char *_c)
void gb_wait_fire(Environment *_environment, int _port, int _release)
void gb_get_image(Environment *_environment, char *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, int _palette)
void gb_dsave(Environment *_environment, char *_filename, char *_offset, char *_address, char *_size)
void gb_sprite_expand_horizontal(Environment *_environment, char *_sprite)
int gb_palette_extract(Environment *_environment, char *_data, int _width, int _height, int _depth, int _flags, RGBi *_palette)
void gb_joy_vars(Environment *_environment, char *_port, char *_value)
void gb_inkey(Environment *_environment, char *_key)
void gb_put_tiles(Environment *_environment, char *_tile, char *_x, char *_y, char *_w, char *_h)
void console_calculate_vars(Environment *_environment)
void gb_sprite_compress_horizontal(Environment *_environment, char *_sprite)
void gb_flip_image(Environment *_environment, Resource *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_direction)
void gb_screen_off(Environment *_environment)
Variable * gb_collision(Environment *_environment, char *_sprite)
GB: emit code to check for collision
void gb_set_frequency(Environment *_environment, int _channels, int _frequency)
void gb_asciicode(Environment *_environment, char *_result)
void gb_timer_set_init(Environment *_environment, char *_timer, char *_init)
void gb_scroll_text(Environment *_environment, int _direction, int _overlap)
void gb_stop(Environment *_environment, int _channels)
void gb_set_program(Environment *_environment, int _channels, int _program)
void gb_bitmap_at(Environment *_environment, char *_address)
void gb_scroll(Environment *_environment, int _dx, int _dy)
void gb_set_duration_vars(Environment *_environment, char *_channel, char *_duration)
void gb_key_state(Environment *_environment, char *_scancode, char *_result)
#define PROGRAM_PITCH(c, f)
void gb_pset_vars(Environment *_environment, char *_x, char *_y, char *_c)
void gb_move_video_memory(Environment *_environment, char *_from, char *_to, char *_size)
void gb_back(Environment *_environment)
void gb_sprite_common_color(Environment *_environment, char *_index, char *_common_color)
GB: emit code to change common sprite's color
void gb_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
GB: emit code to set raster irq
void gb_wait_key(Environment *_environment, int _release)
void gb_sprite_disable(Environment *_environment, char *_sprite)
void gb_set_note(Environment *_environment, int _channels, int _note)
void gb_sys_call(Environment *_environment, int _destination)
void gb_music(Environment *_environment, char *_music, int _size, int _loop)
void gb_sprite_enable(Environment *_environment, char *_sprite)
Variable * gb_get_raster_line(Environment *_environment)
void gb_screen_rows(Environment *_environment, char *_rows)
void gb_pget_color_vars(Environment *_environment, char *_x, char *_y, char *_result)
void gb_stop_vars(Environment *_environment, char *_channels)
void gb_set_note_vars(Environment *_environment, char *_channels, char *_note)
Variable * gb_sprite_converter(Environment *_environment, char *_source, int _width, int _height, int _depth, RGBi *_color, int _slot_x, int _slot_y)
void gb_set_volume_semi_var(Environment *_environment, char *_channel, int _volume)
void gb_tilemap_enable(Environment *_environment, int _width, int _height, int _colors, int _tile_width, int _tile_height)
void gb_wait_key_or_fire(Environment *_environment, int _port, int _release)
void gb_bitmap_enable(Environment *_environment, int _width, int _height, int _colors)
void gb_border_color(Environment *_environment, char *_border_color)
GB: emit code to change border color
void gb_wait_vbl(Environment *_environment, char *_raster_line)
void console_calculate(Environment *_environment)
void gb_hscroll_screen(Environment *_environment, int _direction, int _overlap)
void gb_hit(Environment *_environment, char *_sprite_mask, char *_result)
GB: emit code to check for collision
Variable * gb_new_image(Environment *_environment, int _width, int _height, int _mode)
void gb_next_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
GB: emit code to wait for next raster irq at different position
void gb_set_parameter(Environment *_environment, int _channels, int _parameter, int _value)
void gb_timer_set_address(Environment *_environment, char *_timer, char *_address)
void gb_wait_key_or_fire_semivar(Environment *_environment, char *_port, int _release)
struct _CopperList * next
VestigialConfig vestigialConfig
unsigned char * valueBuffer
struct _ScreenMode ScreenMode
#define IMF_INSTRUMENT_LEAD_8_BASS_LEAD
#define IMF_INSTRUMENT_MARIMBA
struct _Resource Resource
#define IMF_INSTRUMENT_LEAD_6_VOICE
#define IMF_INSTRUMENT_DRAWBAR_ORGAN
#define IMF_INSTRUMENT_FRETLESS_BASS
#define IMF_INSTRUMENT_PAD_1_NEW_AGE
#define IMF_INSTRUMENT_VIOLIN
#define IMF_INSTRUMENT_SYNTH_BASS_1
#define IMF_INSTRUMENT_MELODIC_TOM
#define IMF_INSTRUMENT_REVERSE_CYMBAL
#define IMF_INSTRUMENT_ELECTRIC_BASS_FINGER
#define IMF_INSTRUMENT_HARMONICA
struct _RGBi RGBi
Structure to store color components (red, green and blue).
#define IMF_INSTRUMENT_BLOWN_BOTTLE
#define IMF_INSTRUMENT_PAD_3_POLYSYNTH
#define IMF_INSTRUMENT_FX_8_SCI_FI
#define IMF_INSTRUMENT_RECORDER
#define MAX_TEMPORARY_STORAGE
#define IMF_INSTRUMENT_FX_6_GOBLINS
#define IMF_INSTRUMENT_FX_1_RAIN
#define IMF_INSTRUMENT_SYNTH_VOICE
#define IMF_INSTRUMENT_TENOR_SAX
#define IMF_INSTRUMENT_PICCOLO
#define IMF_INSTRUMENT_LEAD_7_FIFTHS
#define IMF_INSTRUMENT_SLAP_BASS_1
#define IMF_INSTRUMENT_MUSIC_BOX
#define IMF_INSTRUMENT_SOPRANO_SAX
#define IMF_INSTRUMENT_TRUMPET
#define IMF_INSTRUMENT_BIRD_TWEET
#define WARNING_SCREEN_MODE(v1)
#define IMF_INSTRUMENT_PAD_8_SWEEP
#define IMF_INSTRUMENT_CHURCH_ORGAN
#define IMF_INSTRUMENT_HELICOPTER
#define IMF_INSTRUMENT_BRIGHT_ACOUSTIC_PIANO
#define IMF_INSTRUMENT_CELESTA
#define IMF_INSTRUMENT_ACOUSTIC_GUITAR_NYLON
#define IMF_INSTRUMENT_GLOCKENSPIEL
#define IMF_INSTRUMENT_ORCHESTRAL_HARP
#define IMF_INSTRUMENT_BREATH_NOISE
#define IMF_INSTRUMENT_BAG_PIPE
#define IMF_INSTRUMENT_ELECTRIC_GUITAR_JAZZ
#define IMF_INSTRUMENT_ELECTRIC_GRAND_PIANO
#define IMF_INSTRUMENT_SITAR
#define IMF_INSTRUMENT_APPLAUSE
struct _Variable Variable
Structure of a single variable.
#define IMF_INSTRUMENT_WHISTLE
#define IMF_INSTRUMENT_PERCUSSIVE_ORGAN
#define IMF_INSTRUMENT_HONKY_TONK_PIANO
#define IMF_INSTRUMENT_CHOIR_AAHS
#define IMF_INSTRUMENT_SHANAI
#define IMF_INSTRUMENT_CELLO
#define IMF_INSTRUMENT_FX_3_CRYSTAL
#define IMF_INSTRUMENT_ELECTRIC_GUITAR_MUTED
#define IMF_INSTRUMENT_HARPSICHORD
#define IMF_INSTRUMENT_BRASS_SECTION
#define IMF_INSTRUMENT_ELECTRIC_BASS_PICK
#define IMF_INSTRUMENT_FX_5_BRIGHTNESS
#define IMF_INSTRUMENT_FLUTE
struct _Environment Environment
Structure of compilation environment.
#define IMF_INSTRUMENT_ELECTRIC_GUITAR_CLEAN
#define IMF_INSTRUMENT_ACOUSTIC_BASS
#define IMF_INSTRUMENT_GUITAR_FRET_NOISE
#define IMF_INSTRUMENT_SYNTHSTRINGS_2
#define IMF_INSTRUMENT_PAD_4_CHOIR
#define IMF_INSTRUMENT_LEAD_2_SAWTOOTH
#define IMF_INSTRUMENT_DULCIMER
#define IMF_INSTRUMENT_KOTO
#define IMF_INSTRUMENT_TUBA
#define IMF_INSTRUMENT_GUITAR_HARMONICS
#define IMF_INSTRUMENT_CLAVI
#define IMF_INSTRUMENT_BANJO
#define IMF_INSTRUMENT_SYNTHBRASS_2
#define IMF_INSTRUMENT_LEAD_4_CHIFF
#define IMF_INSTRUMENT_VOICE_OOHS
#define IMF_INSTRUMENT_TANGO_ACCORDION
#define SCREEN_MODE_DEFINE(_id, _bitmap, _width, _height, _colors, _tile_width, _tile_height, _description)
#define IMF_INSTRUMENT_FX_7_ECHOES
#define IMF_INSTRUMENT_PAD_6_METALLIC
#define IMF_INSTRUMENT_PAD_5_BOWED
#define IMF_INSTRUMENT_GUNSHOT
#define IMF_INSTRUMENT_REED_ORGAN
#define IMF_INSTRUMENT_ORCHESTRA_HIT
#define IMF_INSTRUMENT_SYNTH_DRUM
#define IMF_INSTRUMENT_SEASHORE
#define IMF_INSTRUMENT_OCARINA
#define IMF_INSTRUMENT_TELEPHONE_RING
#define IMF_INSTRUMENT_FX_2_SOUNDTRACK
#define IMF_INSTRUMENT_ACOUSTIC_GUITAR_STEEL
#define IMF_INSTRUMENT_SYNTHSTRINGS_1
#define IMF_INSTRUMENT_MUTED_TRUMPET
#define IMF_INSTRUMENT_PAN_FLUTE
#define IMF_INSTRUMENT_TINKLE_BELL
#define IMF_INSTRUMENT_VIBRAPHONE
#define IMF_INSTRUMENT_KALIMBA
#define IMF_INSTRUMENT_FIDDLE
#define IMF_INSTRUMENT_PAD_7_HALO
#define IMF_INSTRUMENT_TUBULAR_BELLS
#define IMF_INSTRUMENT_LEAD_1_SQUARE
#define IMF_INSTRUMENT_STRING_ENSEMBLE_1
#define IMF_INSTRUMENT_DISTORTION_GUITAR
#define IMF_INSTRUMENT_PAD_2_WARM
#define IMF_INSTRUMENT_ACCORDION
#define IMF_INSTRUMENT_SLAP_BASS_2
#define IMF_INSTRUMENT_LEAD_5_CHARANG
#define IMF_INSTRUMENT_OBOE
#define IMF_INSTRUMENT_STEEL_DRUMS
#define IMF_INSTRUMENT_BASSOON
#define IMF_INSTRUMENT_TIMPANI
#define IMF_INSTRUMENT_ROCK_ORGAN
#define IMF_INSTRUMENT_SHAMISEN
#define IMF_INSTRUMENT_CLARINET
#define IMF_INSTRUMENT_ACOUSTIC_GRAND_PIANO
#define IMF_INSTRUMENT_ALTO_SAX
#define IMF_INSTRUMENT_EXPLOSION
#define IMF_INSTRUMENT_PIZZICATO_STRINGS
#define IMF_INSTRUMENT_WOODBLOCK
#define IMF_INSTRUMENT_XYLOPHONE
#define IMF_INSTRUMENT_AGOGO
#define IMF_INSTRUMENT_SYNTHBRASS_1
#define IMF_INSTRUMENT_LEAD_3_CALLIOPE
#define WARNING_IMAGE_CONVERTER_UNSUPPORTED_MODE(f)
#define FONT_SCHEMA_ASCII
#define IMF_INSTRUMENT_STRING_ENSEMBLE_2
#define IMF_INSTRUMENT_SYNTH_BASS_2
#define IMF_INSTRUMENT_ELECTRIC_PIANO2
struct _CopperList CopperList
#define IMF_INSTRUMENT_FRENCH_HORN
#define IMF_INSTRUMENT_TREMOLO_STRINGS
#define IMF_INSTRUMENT_FX_4_ATMOSPHERE
#define IMF_INSTRUMENT_ENGLISH_HORN
#define IMF_INSTRUMENT_BARITONE_SAX
#define IMF_INSTRUMENT_SHAKUHACHI
#define IMF_INSTRUMENT_CONTRABASS
#define CRITICAL_NEW_IMAGE_UNSUPPORTED_MODE(f)
#define IMF_INSTRUMENT_VIOLA
#define IMF_INSTRUMENT_TROMBONE
#define IMF_INSTRUMENT_OVERDRIVEN_GUITAR
#define IMF_INSTRUMENT_ELECTRIC_PIANO1
#define IMF_INSTRUMENT_TAIKO_DRUM
#define CRITICAL_IMAGE_CONVERTER_INVALID_WIDTH_EXACT(w)