35#if defined(__plus4__) || defined(__c16__)
40static RGBi SYSTEM_PALETTE[] = {
41 { 0x00, 0x00, 0x00, 0xff, 0,
"BLACK" },
42 { 0xff, 0xff, 0xff, 0xff, 1,
"WHITE" },
43 { 0xbc, 0x68, 0x59, 0xff, 2,
"RED" },
44 { 0x43, 0x97, 0xa6, 0xff, 3,
"CYAN" },
45 { 0xbc, 0x52, 0xcc, 0xff, 4,
"PURPLE" },
46 { 0x43, 0xad, 0x33, 0xff, 5,
"GREEN" },
47 { 0x80, 0x71, 0xcc, 0xff, 6,
"BLUE" },
48 { 0x80, 0x8e, 0x33, 0xff, 7,
"YELLOW" },
49 { 0xbc, 0x6f, 0x33, 0xff, 8,
"ORANGE" },
50 { 0x9e, 0x7f, 0x33, 0xff, 9,
"BROWN" },
51 { 0x61, 0x9e, 0x33, 0xff, 10,
"YELLOW GREEN" },
52 { 0xbc, 0x61, 0x80, 0xff, 11,
"PINK" },
53 { 0x43, 0x9e, 0x80, 0xff, 12,
"BLUE GREEN" },
54 { 0x43, 0x90, 0xcc, 0xff, 13,
"LIGHT BLUE" },
55 { 0x9e, 0x61, 0xcc, 0xff, 14,
"DARK BLUE" },
56 { 0x43, 0xa6, 0x59, 0xff, 15,
"LIGHT GREEN" }
59static RGBi * commonPalette;
63 0x6000+(0*320),0x6000+(1*320),0x6000+(2*320),0x6000+(3*320),
64 0x6000+(4*320),0x6000+(5*320),0x6000+(6*320),0x6000+(7*320),
65 0x6000+(8*320),0x6000+(9*320),0x6000+(10*320),0x6000+(11*320),
66 0x6000+(12*320),0x6000+(13*320),0x6000+(14*320),0x6000+(15*320),
67 0x6000+(16*320),0x6000+(17*320),0x6000+(18*320),0x6000+(19*320),
68 0x6000+(20*320),0x6000+(21*320),0x6000+(22*320),0x6000+(23*320),
73 (0*8),(1*8),(2*8),(3*8),(4*8),(5*8),(6*8),(7*8),(8*8),(9*8),
74 (10*8),(11*8),(12*8),(13*8),(14*8),(15*8),(16*8),(17*8),(18*8),(19*8),
75 (20*8),(21*8),(22*8),(23*8),(24*8),(25*8),(26*8),(27*8),(28*8),(29*8),
76 (30*8),(31*8),(32*8),(33*8),(34*8),(35*8),(36*8),(37*8),(38*8),(39*8)
80 (0*4),(1*4),(2*4),(3*4),(4*4),(5*4),(6*4),(7*4),(8*4),(9*4),
81 (10*4),(11*4),(12*4),(13*4),(14*4),(15*4),(16*4),(17*4),(18*4),(19*4),
82 (20*4),(21*4),(22*4),(23*4),(24*4),(25*4),(26*4),(27*4),(28*4),(29*4),
83 (30*4),(31*4),(32*4),(33*4),(34*4),(35*4),(36*4),(37*4),(38*4),(39*4),
84 (40*4),(41*4),(42*4),(43*4),(44*4),(45*4),(46*4),(47*4),(48*4),(49*4),
85 (50*4),(51*4),(52*4),(53*4),(54*4),(55*4),(56*4),(57*4),(58*4),(59*4),
86 (60*4),(61*4),(62*4),(63*4),(64*4),(65*4),(66*4),(67*4),(68*4),(69*4),
87 (70*4),(71*4),(72*4),(73*4),(74*4),(75*4),(76*4),(77*4),(78*4),(79*4),
96 int minDistance = 0xffff;
106 return &SYSTEM_PALETTE[colorIndex];
121static void ted_image_converter_tile(
Environment * _environment,
char * _source,
char * _dest,
int _width,
int _depth,
int _source_width ) {
125 memset(colorIndexesCount, 0,
COLOR_COUNT *
sizeof(
int ) );
130 memset( _dest, 0, 9 );
133 for (
int y=0; y<8; ++y) {
134 for (
int x=0; x<8; ++x) {
138 memset( &rgb, 0,
sizeof(
RGBi ) );
145 rgb.
alpha = *(_source + 3);
149 if ( rgb.
alpha == 0 ) {
155 if ( rgb.
alpha < 255 ) {
159 ++colorIndexesCount[systemRgb->
index];
166 source += _depth * ( _source_width - 8 );
170 int colorBackground = 0;
171 int colorBackgroundMax = 0;
172 int colorForeground = 0;
173 int colorForegroundMax = 0;
175 if ( colorIndexesCount[xx] > colorBackgroundMax ) {
176 colorBackground = xx;
177 colorBackgroundMax = colorIndexesCount[xx];
181 colorIndexesCount[colorBackground] = 0;
184 if ( colorIndexesCount[xx] > colorForegroundMax ) {
185 colorForeground = xx;
186 colorForegroundMax = colorIndexesCount[xx];
191 if ( colorForeground == 0 ) {
192 colorForeground = colorBackground;
199 if ( colorForeground == colorBackground ) {
200 colorForeground = ( colorBackground == 0 ) ? 1 : 0;
205 for (
int y=0; y<8; ++y) {
206 for (
int x=0; x<8; ++x) {
210 memset( &rgb, 0,
sizeof(
RGBi ) );
216 rgb.
alpha = *(_source + 3);
220 if ( rgb.
alpha == 0 ) {
228 char bitmask = 1 << ( 7 - ((x) & 0x7) );
230 if ( rgb.
alpha < 255 ) {
231 *( _dest + y ) &= ~bitmask;
234 if ( systemRgb->
index != colorBackground ) {
236 *( _dest + y ) |= bitmask;
240 *( _dest + y ) &= ~bitmask;
249 source += _depth * ( _source_width - 8 );
253 *( _dest + 8 ) = ( colorForeground << 4 ) | colorBackground ;
270static void ted_image_converter_tiles(
Environment * _environment,
char * _source,
char * _dest,
int _width,
int _height,
int _depth,
int _source_width ) {
272 int bitmapSize = ( _width>>3 ) * _height;
273 int colormapSize = ( _width>>3 ) * (_height>>3);
275 memset( _dest, 0, bitmapSize + colormapSize );
279 for(
int y=0; y<_height; y+=8 ) {
280 for(
int x=0; x<_width; x+=8 ) {
282 char *
source = _source + ( ( y * _source_width ) + x ) * _depth;
285 ted_image_converter_tile( _environment,
source, tile, _width, _depth, _source_width );
287 int offset = ((y>>3) * 8 *( _width >> 3 ) ) + ((x>>3) * 8) + ((y) & 0x07);
293 char * destBitmap = _dest +
offset;
294 char * destColormap = _dest + bitmapSize + ( ( ( y >> 3 ) * ( _width >> 3 ) ) + ( x >> 3 ) );
295 for(
int i=0; i<8; ++i ) {
296 *destBitmap = tile[i];
300 *destColormap = tile[8];
321static void ted_image_converter_tile_multicolor(
Environment * _environment,
char * _source,
char * _dest,
int _width,
int _depth,
int _background,
int _source_width ) {
324 memset(colorIndexesCount, 0,
COLOR_COUNT *
sizeof(
int ) );
329 memset( _dest, 0, 10 );
332 for (
int y=0; y<8; ++y) {
333 for (
int x=0; x<4; ++x) {
337 memset( &rgb, 0,
sizeof(
RGBi ) );
344 rgb.
alpha = *(_source + 3);
348 if ( rgb.
alpha == 0 ) {
356 ++colorIndexesCount[systemRgb->
index];
362 source += 3 * ( _source_width - 4 );
366 colorIndexesCount[_background] = 0;
369 int colorFirstMax = 0;
371 int colorSecondMax = 0;
373 int colorThirdMax = 0;
376 if ( colorIndexesCount[xx] > colorFirstMax ) {
378 colorFirstMax = colorIndexesCount[xx];
382 colorIndexesCount[colorFirst] = 0;
385 if ( colorIndexesCount[xx] > colorSecondMax ) {
387 colorSecondMax = colorIndexesCount[xx];
391 colorIndexesCount[colorSecond] = 0;
394 if ( colorIndexesCount[xx] > colorThirdMax ) {
396 colorThirdMax = colorIndexesCount[xx];
400 colorIndexesCount[colorThird] = 0;
404 for (
int y=0; y<8; ++y) {
405 for (
int x=0; x<4; ++x) {
409 memset( &rgb, 0,
sizeof(
RGBi ) );
415 rgb.
alpha = *(_source + 3);
419 if ( rgb.
alpha == 0 ) {
429 if ( rgb.
alpha < 255 ) {
436 if ( systemRgb->
index == colorFirst ) {
439 }
else if ( systemRgb->
index == colorSecond ) {
442 }
else if ( systemRgb->
index == colorThird ) {
451 char bitmask = colorIndex << (6 - ((x & 0x3) * 2));
453 *(_dest + y) |= bitmask;
459 source += 3 * ( _source_width - 4 );
463 *( _dest + 8 ) = ( colorFirst << 4 ) | colorSecond ;
464 *( _dest + 9 ) = ( _background << 4 ) | colorThird;
481static void ted_image_converter_tiles_multicolor(
Environment * _environment,
char * _source,
char * _dest,
int _width,
int _height,
int _depth,
int _source_width,
int _background ) {
483 int bitmapSize = ( _width>>2 ) * _height;
484 int colormap1Size = ( _width>>2 ) * (_height>>3);
485 int colormap2Size = ( _width>>2 ) * (_height>>3);
487 memset( _dest, 0, bitmapSize + colormap1Size + colormap2Size );
491 for(
int y=0; y<_height; y+=8 ) {
492 for(
int x=0; x<_width; x+=4 ) {
494 char *
source = _source + ( ( y * _source_width ) + x ) * _depth;
497 ted_image_converter_tile_multicolor( _environment,
source, tile, _width, _depth, _background, _source_width );
499 int offset = ((y>>3) * 8 *( _width >> 2 ) ) + ((x>>2) * 8) + ((y) & 0x07);
501 char * destBitmap = _dest +
offset;
502 char * destColormap1 = _dest + bitmapSize + ( ( ( y >> 3 ) * ( _width >> 2 ) ) + ( x >> 2 ) );
503 char * destColormap2 = _dest + bitmapSize + colormap1Size + ( ( ( y >> 3 ) * ( _width >> 2 ) ) + ( x >> 2 ) );
504 for(
int i=0; i<8; ++i ) {
505 *destBitmap = tile[i];
508 *destColormap1 = tile[8];
509 *destColormap2 = tile[9];
554 outline1(
"LDA %2.2x", _background_color);
556 outline1(
"STA $FF15+%d", ( _index & 0x03 ) );
574 outline1(
"LDA %s", _background_color );
594 outline1(
"LDA %s", _background_color );
616 outline1(
"STA %s", _background_color );
721static int rgbConverterFunction(
int _red,
int _green,
int _blue ) {
724 unsigned int minDistance = 0xffffffff;
732 for (j = 0; j <
sizeof(SYSTEM_PALETTE)/
sizeof(
RGBi); ++j) {
751 switch( _screen_mode->
id ) {
1008 deploy( tedvars, src_hw_ted_vars_asm );
1009 deploy( tedvarsGraphic, src_hw_ted_vars_graphic_asm );
1012 outline1(
"LDA %2.2x", (_x & 0xff ) );
1014 outline1(
"LDA %2.2x", ( ( _x >> 8 ) & 0xff ) );
1016 outline1(
"LDA %2.2x", ( _y & 0xff ) );
1019 outline1(
"LDA #$%2.2x", ( *_c & 0xff ) );
1047 deploy( tedvars, src_hw_ted_vars_asm );
1048 deploy( tedvarsGraphic, src_hw_ted_vars_graphic_asm );
1079 deploy( tedvars, src_hw_ted_vars_asm );
1080 deploy( tedvarsGraphic, src_hw_ted_vars_graphic_asm );
1205 outline1(
"ORA %s", _displacement );
1214 outline1(
"ORA %s", _displacement );
1268 deploy( clsGraphic, src_hw_ted_cls_graphic_asm );
1271 deploy( clsText, src_hw_ted_cls_text_asm );
1280 deploy( clsBox, src_hw_ted_cls_box_asm );
1303 deploy( vScrollText, src_hw_ted_vscroll_text_asm );
1305 outline1(
"LDA #$%2.2x", ( _overlap & 0xff ) );
1307 if ( _direction > 0 ) {
1318 deploy( tedvars, src_hw_ted_vars_asm);
1320 deploy( textHScroll, src_hw_ted_hscroll_text_asm );
1321 deploy( vScrollText, src_hw_ted_vscroll_text_asm );
1323 outline1(
"LDA #$%2.2x", (
unsigned char)(_dx&0xff) );
1325 outline1(
"LDA #$%2.2x", (
unsigned char)(_dy&0xff) );
1333 deploy( tedvars, src_hw_ted_vars_asm );
1334 deploy( vScrollText, src_hw_ted_vscroll_text_asm );
1335 deploy( textEncodedAt, src_hw_ted_text_at_asm );
1345 deploy( tedvarsGraphic, src_hw_ted_vars_graphic_asm );
1346 deploy( clsGraphic, src_hw_ted_cls_graphic_asm );
1347 deploy_deferred( textEncodedAtGraphic, src_hw_ted_text_at_graphic_asm );
1350 deploy( clsText, src_hw_ted_cls_text_asm );
1359 deploy( tedvars, src_hw_ted_vars_asm );
1426 cpu_label( _environment,
"TEDSTARTUP" );
1428 cpu_label( _environment,
"MUSICPLAYER" );
1433 deploy( clsText, src_hw_ted_cls_text_asm );
1441 copperList = copperList->
next;
1449 deploy( textHScroll, src_hw_ted_hscroll_text_asm );
1452 outline1(
"LDA #$%2.2x", ( _direction & 0xff ) );
1463 deploy( textHScroll, src_hw_ted_hscroll_text_asm );
1465 outline1(
"LDA #$%2.2x", ( _direction & 0xff ) );
1467 outline1(
"LDA #$%2.2x", ( _overlap & 0xff ) );
1486 return 3 + ( ( _width >> 3 ) * _height ) + ( ( _width >> 3 ) * ( _height >> 3 ) );
1490 return 3 + ( ( _width >> 2 ) * _height ) + 2 * ( ( _width >> 2 ) * ( _height >> 3 ) ) + 2;
1502static int calculate_images_size(
Environment * _environment,
int _frames,
int _width,
int _height,
int _mode ) {
1507 return 3 + ( 3 + ( ( _width >> 3 ) * _height ) + ( ( _width >> 3 ) * ( _height >> 3 ) ) ) * _frames;
1511 return 3 + ( 3 + ( ( _width >> 2 ) * _height ) + 2 * ( ( _width >> 2 ) * ( _height >> 3 ) ) + 2 ) * _frames;
1523static int calculate_sequence_size(
Environment * _environment,
int _sequences,
int _frames,
int _width,
int _height,
int _mode ) {
1528 return 3 + ( ( 3 + ( ( _width >> 3 ) * _height ) + ( ( _width >> 3 ) * ( _height >> 3 ) ) ) * _frames ) * _sequences;
1532 return 3 + ( ( 3 + ( ( _width >> 2 ) * _height ) + 2 * ( ( _width >> 2 ) * ( _height >> 3 ) ) + 2 ) * _frames ) * _sequences;
1544static Variable * ted_image_converter_bitmap_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 ) {
1546 image_converter_asserts( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8, 8 );
1550 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
1552 if ( _frame_width % 8 ) {
1553 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
1558 if ( _height % 8 ) {
1559 _height = ( ( ( _height - 1 ) / 8 ) - 1 ) * 8;
1561 if ( _frame_height % 8 ) {
1562 _frame_height = ( ( ( _frame_height - 1 ) / 8 ) - 1 ) * 8;
1570 if (paletteColorCount > 16) {
1576 commonPalette =
palette_match( palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE) /
sizeof(
RGBi) );
1592 char * buffer =
malloc ( bufferSize );
1593 memset( buffer, 0, bufferSize );
1596 int image_x, image_y;
1607 *(buffer) = (_frame_width & 0xff );
1608 *(buffer+1) = (_frame_width >> 8 ) & 0xff;
1609 *(buffer+2) = _frame_height;
1611 _source += ( ( _offset_y * _width ) + _offset_x ) * _depth;
1613 ted_image_converter_tiles( _environment, _source, buffer+3, _frame_width, _frame_height, _depth, _width );
1622static Variable * ted_image_converter_multicolor_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 ) {
1624 image_converter_asserts( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8, 8 );
1628 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
1630 if ( _frame_width % 8 ) {
1631 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
1636 if ( _height % 8 ) {
1637 _height = ( ( ( _height - 1 ) / 8 ) - 1 ) * 8;
1639 if ( _frame_height % 8 ) {
1640 _frame_height = ( ( ( _frame_height - 1 ) / 8 ) - 1 ) * 8;
1648 if (paletteColorCount > 16) {
1654 commonPalette =
palette_match( palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE) /
sizeof(
RGBi) );
1669 char * buffer =
malloc ( bufferSize );
1670 memset( buffer, 0, bufferSize );
1673 int image_x, image_y;
1679 int offset, offsetc, bitmask;
1684 *(buffer) = (_frame_width & 0xff );
1685 *(buffer+1) = (_frame_width >> 8 ) & 0xff;
1686 *(buffer+2) = _frame_height;
1688 _source += ( ( _offset_y * _frame_width ) + _offset_x ) * 3;
1690 ted_image_converter_tiles_multicolor( _environment, _source, buffer+3, _frame_width, _frame_height, _depth, _width, palette[0].index );
1698Variable *
ted_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 ) {
1703 return ted_image_converter_bitmap_mode_standard( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
1707 return ted_image_converter_multicolor_mode_standard( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
1736 if ( strlen(_sequence) == 0 ) {
1739 outline1(
"LDA #<OFFSETS%4.4x", _frame_size * _frame_count );
1741 outline1(
"LDA #>OFFSETS%4.4x", _frame_size * _frame_count );
1757 if ( strlen(_frame) == 0 ) {
1760 outline1(
"LDA #<OFFSETS%4.4x", _frame_size );
1762 outline1(
"LDA #>OFFSETS%4.4x", _frame_size );
1788 if ( strlen(_frame) == 0 ) {
1791 outline1(
"LDA #<OFFSETS%4.4x", _frame_size );
1793 outline1(
"LDA #>OFFSETS%4.4x", _frame_size );
1813static void ted_load_image_address_to_other_register(
Environment * _environment,
char * _register,
char * _source,
char * _sequence,
char * _frame,
int _frame_size,
int _frame_count ) {
1829 if ( strlen(_sequence) == 0 ) {
1832 outline1(
"LDA #<OFFSETS%4.4x", _frame_size * _frame_count );
1834 outline1(
"LDA #>OFFSETS%4.4x", _frame_size * _frame_count );
1850 if ( strlen(_frame) == 0 ) {
1853 outline1(
"LDA #<OFFSETS%4.4x", _frame_size );
1855 outline1(
"LDA #>OFFSETS%4.4x", _frame_size );
1881 if ( strlen(_frame) == 0 ) {
1884 outline1(
"LDA #<OFFSETS%4.4x", _frame_size );
1886 outline1(
"LDA #>OFFSETS%4.4x", _frame_size );
1906static void ted_load_image_address_to_register(
Environment * _environment,
char * _register,
Resource * _source,
char * _sequence,
char * _frame,
int _frame_size,
int _frame_count ) {
1908 if ( !_sequence && !_frame ) {
1942 if ( strlen(_sequence) == 0 ) {
1950 if ( strlen(_frame) == 0 ) {
1969 if ( strlen(_frame) == 0 ) {
1998 deploy( tedvars, src_hw_ted_vars_asm);
1999 deploy( tedvarsGraphic, src_hw_ted_vars_graphic_asm );
2000 deploy( putimage, src_hw_ted_put_image_asm );
2002 if ( _frame_size ) {
2003 ted_load_image_address_to_register( _environment,
"TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
2014 if ( strchr( _flags,
'#' ) ) {
2015 outline1(
"LDA #((%s)&255)", _flags+1 );
2017 outline1(
"LDA #(((%s)>>8)&255)", _flags+1 );
2030void ted_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 ) {
2032 deploy( tedvars, src_hw_ted_vars_asm);
2033 deploy( tedvarsGraphic, src_hw_ted_vars_graphic_asm );
2034 deploy( blitimage, src_hw_ted_blit_image_asm );
2036 if ( _source_count > 2 ) {
2045 outline0(
"STA BLITIMAGEBLITADDR+1" );
2047 outline0(
"STA BLITIMAGEBLITADDR+2" );
2049 if ( _source_count > 0 ) {
2051 resource.
realName = strdup( _sources[0] );
2053 ted_load_image_address_to_register( _environment,
"BLITTMPPTR", &resource, _sequence, _frame, _frame_size, _frame_count );
2060 if ( _source_count > 1 ) {
2062 resource.
realName = strdup( _sources[0] );
2064 ted_load_image_address_to_register( _environment,
"BLITTMPPTR2", &resource, _sequence, _frame, _frame_size, _frame_count );
2079 outline1(
"LDA #$%2.2x", ( _flags & 0xff ) );
2081 outline1(
"LDA #$%2.2x", ( (_flags>>8) & 0xff ) );
2090 deploy( vbl, src_hw_ted_vbl_asm);
2107 memset( buffer, 0,
size );
2109 *(buffer) = ( _width & 0xff );
2110 *(buffer+1) = ( _width >> 8 ) & 0xff;
2111 *(buffer+2) = _height;
2122 int size = calculate_images_size( _environment, _frames, _width, _height, _mode );
2123 int frameSize =
ted_image_size( _environment, _width, _height, _mode );
2132 memset( buffer, 0,
size );
2134 *(buffer) = _frames;
2135 *(buffer+1) = ( _width & 0xff );
2136 *(buffer+2) = ( _width >> 8 ) & 0xff;
2137 for(
int i=0; i<_frames; ++i ) {
2138 *(buffer+3+(i*frameSize)) = ( _width & 0xff );
2139 *(buffer+3+(i*frameSize)+1) = ( ( _width >> 8 ) & 0xff );
2140 *(buffer+3+(i*frameSize)+2) = ( _height & 0xff );
2154 int size2 = calculate_sequence_size( _environment, _sequences, _frames, _width, _height, _mode );
2155 int size = calculate_images_size( _environment, _frames, _width, _height, _mode );
2156 int frameSize =
ted_image_size( _environment, _width, _height, _mode );
2164 char * buffer =
malloc ( size2 );
2165 memset( buffer, 0, size2 );
2167 *(buffer) = _frames;
2168 *(buffer+1) = _width;
2169 *(buffer+2) = _sequences;
2170 for(
int i=0; i<(_frames*_sequences); ++i ) {
2171 *(buffer+3+(i*frameSize)) = ( _width & 0xff );
2172 *(buffer+3+(i*frameSize)+1) = ( ( _width >> 8 ) & 0xff );
2173 *(buffer+3+(i*frameSize)+2) = ( _height & 0xff );
2185void ted_get_image(
Environment * _environment,
char * _image,
char * _x,
char * _y,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
int _palette ) {
2187 deploy( tedvars, src_hw_ted_vars_asm);
2188 deploy( tedvarsGraphic, src_hw_ted_vars_graphic_asm );
2189 deploy( getimage, src_hw_ted_get_image_asm );
2191 ted_load_image_address_to_other_register( _environment,
"TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
2201 outline1(
"LDA #$%2.2x", _palette );
2210 deploy( tedvars, src_hw_ted_vars_asm);
2211 deploy( tiles, src_hw_ted_tiles_asm );
2235 deploy( tedvars, src_hw_ted_vars_asm);
2236 deploy( tiles, src_hw_ted_tiles_asm );
2272 deploy( tedvars, src_hw_ted_vars_asm);
2273 deploy( tiles, src_hw_ted_tiles_asm );
2300 deploy( tedvars, src_hw_ted_vars_asm);
2301 deploy( tiles, src_hw_ted_tiles_asm );
2317 deploy( tedvars, src_hw_ted_vars_asm);
2318 deploy( tiles, src_hw_ted_tiles_asm );
2342static unsigned int SOUND_FREQUENCIES[] = {
2343 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2344 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2345 0, 0, 0, -5816, -5432, -5070, -4728, -4405, -4100, -3812,
2346 -3541, -3285, -3043, -2815, -2599, -2396, -2204, -2026, -1852, -1690,
2347 -1538, -1394, -1258, -1130, -1009, -895, -788, -686, -590, -499,
2348 -414, -333, -257, -185, -117, -53, 7, 64, 118, 169,
2349 217, 262, 305, 345, 383, 419, 453, 485, 516, 544,
2350 571, 597, 621, 643, 665, 685, 704, 722, 739, 755,
2351 770, 784, 798, 810, 822, 834, 844, 854, 864, 873,
2352 881, 889, 897, 904, 911, 917, 923, 929, 934, 939,
2353 944, 948, 953, 957, 960, 964, 967, 971, 974, 976,
2354 979, 982, 984, 986, 988, 990, 992, 994, 996
2359 deploy( tedvars, src_hw_ted_vars_asm );
2362 if ( _channels & 0x01 ) {
2365 if ( _channels & 0x02 ) {
2373 deploy( tedvars, src_hw_ted_vars_asm );
2376 outline1(
"LDX #%2.2x", ( _volume & 0x0f ) );
2381#define FREQTED( f ) ( 1024 - (111841 / (f) ) )
2383#define PROGRAM_FREQUENCY( c, f ) \
2384 outline1("LDX #$%2.2x", ( FREQTED( f ) ) & 0xff ); \
2385 outline1("LDY #$%2.2x", ( ( FREQTED( f ) ) >> 8 ) & 0xff ); \
2386 if ( ( c & 0x01 ) ) \
2387 outline0("JSR TEDPROGFREQ0" ); \
2388 if ( ( c & 0x02 ) ) \
2389 outline0("JSR TEDPROGFREQ1" ); \
2391#define PROGRAM_FREQUENCY_V( c, f ) \
2392 outline1("LDA %s", ( c == NULL ? "#$3" : c ) ); \
2393 outline1("LDX %s", f ); \
2394 outline1("LDY %s", address_displacement(_environment, f, "1") ); \
2395 outline0("JSR TEDFREQ" );
2397#define PROGRAM_FREQUENCY_SV( c, f ) \
2398 outline1("LDX #$%2.2x", ( FREQTED( f ) ) & 0xff ); \
2399 outline1("LDY #$%2.2x", ( ( FREQTED( f ) ) >> 8 ) & 0xff ); \
2400 outline1("LDA %s", ( c == NULL ? "#$3" : c ) ); \
2401 outline0("JSR TEDFREQ2" );
2403#define PROGRAM_DURATION( c, d ) \
2404 outline1("LDX #$%2.2x", ( d ) & 0xff ); \
2405 outline1("LDY #$%2.2x", ( ( d ) >> 8 ) & 0xff ); \
2406 if ( ( c & 0x01 ) ) \
2407 outline0("JSR TEDPROGDUR0" ); \
2408 if ( ( c & 0x02 ) ) \
2409 outline0("JSR TEDPROGDUR1" ); \
2411#define WAIT_DURATION( c ) \
2412 if ( ( c & 0x01 ) ) \
2413 outline0("JSR TEDWAITDUR0" ); \
2414 if ( ( c & 0x02 ) ) \
2415 outline0("JSR TEDWAITDUR1" ); \
2417#define PROGRAM_PITCH( c, f ) \
2418 outline1("LDX #$%2.2x", ( f & 0xff ) ); \
2419 outline1("LDY #$%2.2x", ( ( f >> 8 ) & 0xff ) ); \
2420 if ( ( c & 0x01 ) ) \
2421 outline0("JSR TEDPROGFREQ0" ); \
2422 if ( ( c & 0x02 ) ) \
2423 outline0("JSR TEDPROGFREQ1" ); \
2425#define PROGRAM_PITCH_V( c, f ) \
2426 outline1("LDA %s", ( c == NULL ? "#$3" : c ) ); \
2427 outline1("LDX %s", f ); \
2428 outline1("LDY %s", address_displacement(_environment, f, "1") ); \
2429 outline0("JSR TEDPROGFREQ" );
2431#define PROGRAM_PITCH_SV( c, f ) \
2432 outline1("LDX #$%2.2x", ( f & 0xff ) ); \
2433 outline1("LDY #$%2.2x", ( ( f >> 8 ) & 0xff ) ); \
2434 outline1("LDA %s", ( c == NULL ? "#$3" : c ) ); \
2435 outline0("JSR TEDPROGFREQ" );
2437#define PROGRAM_PULSE( c, p ) \
2438 outline1("LDX #$%2.2x", ( p & 0xff ) ); \
2439 outline1("LDY #$%2.2x", ( ( p >> 8 ) & 0xff ) ); \
2440 if ( ( c & 0x01 ) ) \
2441 outline0("JSR TEDPROGPULSE0" ); \
2442 if ( ( c & 0x02 ) ) \
2443 outline0("JSR TEDPROGPULSE1" ); \
2445#define PROGRAM_PULSE_V( c, p ) \
2446 outline1("LDA %s", ( c == NULL ? "#$3" : c ) ); \
2447 outline1("LDX %s", p ); \
2448 outline1("LDY %s", address_displacement(_environment, p, "1") ); \
2449 outline0("JSR TEDPROGPULSE" );
2451#define PROGRAM_PULSE_SV( c, p ) \
2452 outline1("LDX #$%2.2x", ( p & 0xff ) ); \
2453 outline1("LDY #$%2.2x", ( ( p >> 8 ) & 0xff ) ); \
2454 outline1("LDA %s", ( c == NULL ? "#$3" : c ) ); \
2455 outline0("JSR TEDPROGPULSE" );
2457#define PROGRAM_NOISE( c ) \
2458 outline0("JSR TEDPROGNOISE" );
2460#define PROGRAM_NOISE_V( c, p ) \
2461 outline0("JSR TEDPROGNOISE" );
2463#define PROGRAM_NOISE_SV( c ) \
2464 outline0("JSR TEDPROGNOISE" );
2466#define PROGRAM_SAW( c )
2468#define PROGRAM_SAW_V( c )
2470#define PROGRAM_SAW_SV( c )
2472#define PROGRAM_TRIANGLE( c )
2474#define PROGRAM_TRIANGLE_V( c )
2476#define PROGRAM_TRIANGLE_SV( c )
2478#define PROGRAM_SAW_TRIANGLE( c )
2480#define PROGRAM_SAW_TRIANGLE_V( c )
2482#define PROGRAM_SAW_TRIANGLE_SV( c )
2484#define PROGRAM_ATTACK_DECAY( c, a, d )
2486#define PROGRAM_ATTACK_DECAY_V( c, a, d )
2488#define PROGRAM_ATTACK_DECAY_SV( c, a, d )
2490#define PROGRAM_SUSTAIN_RELEASE( c, s, r )
2492#define PROGRAM_SUSTAIN_RELEASE_V( c, s, r )
2494#define PROGRAM_SUSTAIN_RELEASE_SV( c, s, r )
2496#define STOP_FREQUENCY( c ) \
2497 if ( ( c & 0x01 ) ) \
2498 outline0("JSR TEDSTOP0" ); \
2499 if ( ( c & 0x02 ) ) \
2500 outline0("JSR TEDSTOP1" ); \
2502#define STOP_FREQUENCY_V( c ) \
2503 outline1("LDA %s", ( c == NULL ? "#$3" : c ) ); \
2504 outline0("JSR TEDSTOP" );
2506#define STOP_FREQUENCY_SV( c ) \
2507 outline1("LDA %s", ( c == NULL ? "#$3" : c ) ); \
2508 outline0("JSR TEDSTOP" );
2512 deploy( tedvars, src_hw_ted_vars_asm );
2718 deploy( tedvars, src_hw_ted_vars_asm );
2727 deploy( tedvars, src_hw_ted_vars_asm );
2736 ted_set_pitch( _environment, _channels, SOUND_FREQUENCIES[_note] );
2742 deploy( tedvars, src_hw_ted_vars_asm );
2751 deploy( tedvars, src_hw_ted_vars_asm );
2765 deploy( tedvars, src_hw_ted_vars_asm );
2780 deploy( tedvars, src_hw_ted_vars_asm );
2790 deploy( tedvars, src_hw_ted_vars_asm );
2992 deploy( tedvars, src_hw_ted_vars_asm );
3009 deploy( tedvars, src_hw_ted_vars_asm );
3026 deploy( tedvars, src_hw_ted_vars_asm );
3055 deploy( tedvars, src_hw_ted_vars_asm );
3065 deploy( tedvars, src_hw_ted_vars_asm );
3072 outline0(
"STA TEDTMPPTR_BACKUP+1");
3073 outline1(
"LDA #$%2.2x", ( _size>>8 ) & 0xff);
3075 outline1(
"LDA #$%2.2x", _size & 0xff );
3076 outline0(
"STA TEDLASTBLOCK_BACKUP");
3084void ted_slice_image(
Environment * _environment,
char * _image,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
char * _destination ) {
3092 memcpy( _palette,
palette_match( _palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE) /
sizeof(
RGBi) ), paletteColorCount *
sizeof(
RGBi ) );
3094 int uniquePaletteCount = 0;
3098 return uniquePaletteCount;
3104 deploy( tedvars, src_hw_ted_vars_asm);
3105 deploy( tedvarsGraphic, src_hw_ted_vars_graphic_asm );
3107 if ( strcmp( _direction,
"#FLIPIMAGEDIRECTION0001" ) == 0 || strcmp( _direction,
"#FLIPIMAGEDIRECTION0003" ) == 0 ) {
3108 ted_load_image_address_to_register( _environment,
"TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
3109 deploy( flipimagex, src_hw_ted_flip_image_x_asm );
3115 ted_load_image_address_to_register( _environment,
"TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
3116 deploy( flipimagex, src_hw_ted_flip_image_x_asm );
3125 if ( strcmp( _direction,
"#FLIPIMAGEDIRECTION0002" ) == 0 || strcmp( _direction,
"#FLIPIMAGEDIRECTION0003" ) == 0 ) {
3126 ted_load_image_address_to_register( _environment,
"TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
3127 deploy( flipimagey, src_hw_ted_flip_image_y_asm );
3133 ted_load_image_address_to_register( _environment,
"TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
3134 deploy( flipimagey, src_hw_ted_flip_image_y_asm );
3148 deploy( tedvars, src_hw_ted_vars_asm );
3157 deploy( tedvars, src_hw_ted_vars_asm );
3166 deploy( tedvars, src_hw_ted_vars_asm );
3188 deploy( tedvars, src_hw_ted_vars_asm );
3204 deploy( screen, src_hw_ted_screen_asm);
void cpu_store_16bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 16 bit
void cpu_label(Environment *_environment, char *_label)
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
void cpu_beq(Environment *_environment, char *_label)
CPU 6309: emit code to make long conditional jump
int lastUsedSlotInCommonPalette
#define BITMAP_MODE_STANDARD
Variable * variable_retrieve(Environment *_environment, char *_name)
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.
Variable * variable_import(Environment *_environment, char *_name, VariableType _type, int _size_or_value)
RGBi * malloc_palette(int _size)
Allocate a palette space.
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.
int rgbi_extract_palette(Environment *_environment, unsigned char *_source, int _width, int _height, int _depth, RGBi _palette[], int _palette_size, int _sorted)
Extract the color palette from the given image.
RGBi * palette_remove_duplicates(RGBi *_source, int _source_size, int *_unique_size)
Remove duplicates from a palette.
RGBi * palette_match(RGBi *_source, int _source_size, RGBi *_system, int _system_size)
Make a "palette match".
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)
void back(Environment *_environment, char *_color)
Emit ASM code to fill background color.
void plot(Environment *_environment, char *_x, char *_y, char *_c, int _preserve_color)
#define TILEMAP_MODE_STANDARD
void console_init(Environment *_environment)
Variable * distance(Environment *_environment, char *_x1, char *_y1, char *_x2, char *_y2)
Return the distance between two (screen) positions.
struct _CopperList * next
RgbConverterFunction currentRgbConverterFunction
VestigialConfig vestigialConfig
unsigned char * valueBuffer
RGBi originalPalette[MAX_PALETTE]
void ted_set_note_vars(Environment *_environment, char *_channels, char *_note)
int ted_palette_extract(Environment *_environment, char *_data, int _width, int _height, int _depth, int _flags, RGBi *_palette)
void ted_screen_columns(Environment *_environment, char *_columns)
void ted_sprite_multicolor(Environment *_environment, char *_sprite)
void ted_collision(Environment *_environment, char *_sprite_mask, char *_result)
void ted_wait_duration_vars(Environment *_environment, char *_channels)
void ted_set_pitch_vars(Environment *_environment, char *_channels, char *_pitch)
#define PROGRAM_DURATION(c, d)
#define PROGRAM_TRIANGLE_SV(c)
#define PROGRAM_SAW_SV(c)
void ted_background_color_semivars(Environment *_environment, int _index, char *_background_color)
TED: emit code to change background color
void ted_scroll_text(Environment *_environment, int _direction, int _overlap)
void ted_colormap_at(Environment *_environment, char *_address)
void ted_slice_image(Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
Variable * ted_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 ted_background_color_vars(Environment *_environment, char *_index, char *_background_color)
TED: emit code to change background color
#define PROGRAM_FREQUENCY(c, f)
Variable * ted_new_images(Environment *_environment, int _frames, int _width, int _height, int _mode)
void ted_move_tiles(Environment *_environment, char *_tile, char *_x, char *_y)
void ted_hit(Environment *_environment, char *_sprite_mask, char *_result)
void ted_set_frequency(Environment *_environment, int _channels, int _frequency)
void ted_charset_at(Environment *_environment, char *_address)
void ted_sprite_priority(Environment *_environment, char *_sprite, char *_priority)
void ted_pget_color_vars(Environment *_environment, char *_x, char *_y, char *_result)
void ted_sprite_monocolor(Environment *_environment, char *_sprite)
void ted_cls(Environment *_environment)
#define PROGRAM_NOISE_SV(c)
void ted_text(Environment *_environment, char *_text, char *_text_size, int _raw)
RGBi * ted_image_nearest_system_color(RGBi *_color)
void ted_set_duration(Environment *_environment, int _channels, int _duration)
void ted_stop_vars(Environment *_environment, char *_channels)
void ted_initialization(Environment *_environment)
void ted_bitmap_disable(Environment *_environment)
void ted_set_duration_vars(Environment *_environment, char *_channels, char *_duration)
Variable * ted_new_sequence(Environment *_environment, int _sequences, int _frames, int _width, int _height, int _mode)
void ted_sprite_color(Environment *_environment, char *_sprite, char *_color)
void ted_set_pitch(Environment *_environment, int _channels, int _pitch)
void ted_sprite_data_from(Environment *_environment, char *_sprite, char *_address)
void ted_horizontal_scroll(Environment *_environment, char *_displacement)
void ted_set_note(Environment *_environment, int _channels, int _note)
void ted_pset_vars(Environment *_environment, char *_x, char *_y, char *_c)
void ted_back(Environment *_environment)
void ted_calculate_sequence_frame_offset(Environment *_environment, char *_offset, char *_sequence, char *_frame, int _frame_size, int _frame_count)
void ted_scroll(Environment *_environment, int _dx, int _dy)
void ted_start(Environment *_environment, int _channels)
int ted_screen_mode_enable(Environment *_environment, ScreenMode *_screen_mode)
void ted_sprite_disable(Environment *_environment, char *_sprite)
void ted_vertical_scroll(Environment *_environment, char *_displacement)
#define STOP_FREQUENCY(c)
void ted_hscroll_screen(Environment *_environment, int _direction, int _overlap)
void ted_busy_wait(Environment *_environment, char *_timing)
void ted_start_var(Environment *_environment, char *_channels)
void ted_get_image(Environment *_environment, char *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, int _palette)
void ted_screen_rows(Environment *_environment, char *_rows)
#define PROGRAM_ATTACK_DECAY(c, a, d)
void ted_tiles_get(Environment *_environment, char *_result)
#define PROGRAM_SUSTAIN_RELEASE_SV(c, s, r)
void ted_hscroll_line(Environment *_environment, int _direction, int _overlap)
void ted_sprite_common_color(Environment *_environment, char *_index, char *_common_color)
void ted_set_program(Environment *_environment, int _channels, int _program)
void ted_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 ted_cls_box(Environment *_environment, char *_x1, char *_y1, char *_w, char *_h)
void ted_sprite_expand_vertical(Environment *_environment, char *_sprite)
void ted_bitmap_at(Environment *_environment, char *_address)
void ted_set_program_semi_var(Environment *_environment, char *_channels, int _program)
void ted_set_frequency_vars(Environment *_environment, char *_channels, char *_frequency)
void ted_tilemap_enable(Environment *_environment, int _width, int _height, int _colors, int _tile_width, int _tile_height)
void ted_put_tiles(Environment *_environment, char *_tile, char *_x, char *_y, char *_w, char *_h)
void ted_pset_int(Environment *_environment, int _x, int _y, int *_c)
void ted_background_color_get_vars(Environment *_environment, char *_index, char *_background_color)
TED: emit code to retrieve background color
void ted_sprite_enable(Environment *_environment, char *_sprite)
void ted_stop(Environment *_environment, int _channels)
void ted_charset_uppercase(Environment *_environment)
#define PROGRAM_SUSTAIN_RELEASE(c, s, r)
void ted_screen_on(Environment *_environment)
void ted_finalization(Environment *_environment)
void ted_put_tile(Environment *_environment, char *_tile, char *_x, char *_y)
void ted_background_color(Environment *_environment, int _index, int _background_color)
TED: emit code to change bac_kground color
void console_calculate_vars(Environment *_environment)
#define PROGRAM_PULSE_SV(c, p)
void ted_sprite_at(Environment *_environment, char *_sprite, char *_x, char *_y)
void ted_get_height(Environment *_environment, char *_result)
void ted_textmap_at(Environment *_environment, char *_address)
void ted_sprite_compress_vertical(Environment *_environment, char *_sprite)
void ted_set_parameter(Environment *_environment, int _channels, int _parameter, int _value)
#define PROGRAM_PITCH(c, f)
void ted_next_raster(Environment *_environment)
TED: emit code to wait for next raster irq
void ted_get_width(Environment *_environment, char *_result)
void ted_next_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
TED: emit code to wait for next raster irq at different position
void ted_border_color(Environment *_environment, char *_border_color)
TED: emit code to change border color
void ted_set_volume_vars(Environment *_environment, char *_channels, char *_volume)
void ted_bitmap_enable(Environment *_environment, int _width, int _height, int _colors)
void ted_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
TED: emit code to set raster irq
Variable * ted_new_image(Environment *_environment, int _width, int _height, int _mode)
void ted_use_tileset(Environment *_environment, char *_tileset)
void ted_music(Environment *_environment, char *_music, int _size, int _loop)
void ted_wait_vbl(Environment *_environment, char *_raster_line)
void ted_sprite_expand_horizontal(Environment *_environment, char *_sprite)
void ted_flip_image(Environment *_environment, Resource *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_direction)
void ted_wait_duration(Environment *_environment, int _channels)
void ted_set_volume_semi_var(Environment *_environment, char *_channel, int _volume)
void ted_set_volume(Environment *_environment, int _channels, int _volume)
#define PROGRAM_PULSE(c, p)
Variable * ted_get_raster_line(Environment *_environment)
void ted_screen(Environment *_environment, char *_x, char *_y, char *_c)
void ted_tile_at(Environment *_environment, char *_x, char *_y, char *_result)
void ted_screen_off(Environment *_environment)
void ted_put_image(Environment *_environment, Resource *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_flags)
void ted_charset_lowercase(Environment *_environment)
int ted_image_size(Environment *_environment, int _width, int _height, int _mode)
void ted_tiles_at(Environment *_environment, char *_address)
#define PROGRAM_TRIANGLE(c)
void console_calculate(Environment *_environment)
#define PROGRAM_ATTACK_DECAY_SV(c, a, d)
void ted_sprite_data_set(Environment *_environment, char *_sprite, char *_address)
void ted_bank_select(Environment *_environment, int _bank)
void ted_sprite_compress_horizontal(Environment *_environment, char *_sprite)
#define TILEMAP_MODE_MULTICOLOR
#define TILEMAP_MODE_EXTENDED
#define BITMAP_MODE_MULTICOLOR
struct _ScreenMode ScreenMode
#define IMF_INSTRUMENT_LEAD_8_BASS_LEAD
#define IMF_INSTRUMENT_MARIMBA
#define CRITICAL_IMAGE_CONVERTER_TOO_COLORS(f)
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 IMF_INSTRUMENT_FX_6_GOBLINS
#define adilineendbitmap()
#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
#define deploy_deferred(s, e)
struct _Environment Environment
Structure of compilation environment.
#define adiline3(s, a, b, c)
#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 deploy_preferred(s, e)
#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 CRITICAL_NEW_IMAGES_UNSUPPORTED_MODE(f)
#define IMF_INSTRUMENT_KALIMBA
#define IMF_INSTRUMENT_FIDDLE
#define IMF_INSTRUMENT_PAD_7_HALO
#define IMF_INSTRUMENT_TUBULAR_BELLS
#define CRITICAL_SCREEN_UNSUPPORTED(v)
#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 adilinepalette(s, c, p)
#define adilinebeginbitmap(s)
#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 CRITICAL_BLIT_TOO_MUCH_SOURCES()
#define IMF_INSTRUMENT_VIOLA
#define IMF_INSTRUMENT_TROMBONE
#define IMF_INSTRUMENT_OVERDRIVEN_GUITAR
#define IMF_INSTRUMENT_ELECTRIC_PIANO1
#define IMF_INSTRUMENT_TAIKO_DRUM