40static RGBi SYSTEM_PALETTE[] = {
41 { 0x00, 0x00, 0x00, 0xff, 0,
"BLACK" },
42 { 0xff, 0xff, 0xff, 0xff, 1,
"WHITE" },
43 { 0x88, 0x00, 0x00, 0xff, 2,
"RED" },
44 { 0xaa, 0xff, 0xe6, 0xff, 3,
"CYAN" },
45 { 0xcc, 0x44, 0xcc, 0xff, 4,
"VIOLET" },
46 { 0x00, 0xcc, 0x55, 0xff, 5,
"GREEN" },
47 { 0x00, 0x00, 0xaa, 0xff, 6,
"BLUE" },
48 { 0xee, 0xee, 0x77, 0xff, 7,
"YELLOW" },
49 { 0xa1, 0x68, 0x3c, 0xff, 8,
"ORANGE" },
50 { 0xdd, 0x88, 0x65, 0xff, 9,
"BROWN" },
51 { 0xff, 0x77, 0x77, 0xff, 10,
"LIGHT_RED" },
52 { 0x33, 0x33, 0x33, 0xff, 11,
"DARK_GREY" },
53 { 0x77, 0x77, 0x77, 0xff, 12,
"GREY" },
54 { 0xaa, 0xff, 0x66, 0xff, 13,
"LIGHT GREEN" },
55 { 0x00, 0x88, 0xff, 0xff, 14,
"LIGHT BLUE" },
56 { 0xbb, 0xbb, 0xbb, 0xff, 15,
"LIGHT GREY" }
65 unsigned int minDistance = 0xffff;
75 return &SYSTEM_PALETTE[colorIndex];
142 outline1(
"LDA #$%2.2x", ( _background_color >> 4 ) );
162 outline1(
"LDA %s", _background_color );
186 outline1(
"LDA %s", _background_color );
216 outline1(
"STA %s", _background_color );
289static int rgbConverterFunction(
int _red,
int _green,
int _blue ) {
292 unsigned int minDistance = 0xffffffff;
300 for (j = 0; j <
sizeof(SYSTEM_PALETTE)/
sizeof(
RGBi); ++j) {
322 switch( _screen_mode->
id ) {
465 outline1(
"LDA #$%2.2x", ( *_c & 0xff ) );
471 outline1(
"LDA %2.2x", (_x & 0xff ) );
473 outline1(
"LDA %2.2x", ( ( _x >> 8 ) & 0xff ) );
475 outline1(
"LDA %2.2x", ( _y & 0xff ) );
679 if ( _direction > 0 ) {
681 outline1(
"LDA #$%2.2x", (
unsigned char)(_overlap&0xff) );
686 outline1(
"LDA #$%2.2x", (
unsigned char)(_overlap&0xff) );
810 cpu_label( _environment,
"VIC1STARTUP" );
812 cpu_label( _environment,
"MUSICPLAYER" );
827 outline1(
"LDA #$%2.2x", ( _direction & 0xff ) );
829 outline1(
"LDA #$%2.2x", ( _overlap & 0xff ) );
842 outline1(
"LDA #$%2.2x", ( _direction & 0xff ) );
844 outline1(
"LDA #$%2.2x", ( _overlap & 0xff ) );
860 deploy( textCline, src_hw_vic1_cline_asm );
883 return 3 + ( _width >> 3 ) * ( _height );
893static int calculate_images_size(
Environment * _environment,
int _frames,
int _width,
int _height,
int _mode ) {
898 return 3 + ( 3 + ( _width >> 3 ) * ( _height ) ) * _frames;
908static int calculate_sequence_size(
Environment * _environment,
int _sequences,
int _frames,
int _width,
int _height,
int _mode ) {
913 return 3 + ( ( 3 + ( _width >> 3 ) * ( _height ) ) * _frames ) * _sequences;
924static Variable * vic1_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 ) {
926 image_converter_asserts( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8, 8 );
930 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
932 if ( _frame_width % 8 ) {
933 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
939 _height = ( ( ( _height - 1 ) / 8 ) - 1 ) * 8;
941 if ( _frame_height % 8 ) {
942 _frame_height = ( ( ( _frame_height - 1 ) / 8 ) - 1 ) * 8;
959 for( i=0; i<colorUsed; ++i ) {
960 int minDistance = 0xffff;
962 for (j = 0; j <
sizeof(SYSTEM_PALETTE)/
sizeof(
RGBi); ++j) {
967 for( k=0; k<i; ++k ) {
968 if ( palette[k].index == SYSTEM_PALETTE[j].index ) {
980 palette[i].
index = SYSTEM_PALETTE[colorIndex].index;
981 strcopy( palette[i].description, SYSTEM_PALETTE[colorIndex].description );
991 char * buffer =
malloc ( bufferSize );
992 memset( buffer, 0, bufferSize );
995 int image_x, image_y;
1006 *(buffer) = _frame_width;
1007 *(buffer+1) = _frame_height;
1009 _source += ( ( _offset_y * _width ) + _offset_x ) * 3;
1012 for (image_y = 0; image_y < _frame_height; ++image_y) {
1013 for (image_x = 0; image_x < _frame_width; ++image_x) {
1017 rgb.
green = *(_source + 1);
1018 rgb.
blue = *(_source + 2);
1020 rgb.
alpha = *(_source + 3);
1025 for( i=0; i<colorUsed; ++i ) {
1034 tile_y = (image_y >> 3);
1035 tile_x = (image_x >> 3);
1039 offset = (tile_y * 8 *( _frame_width >> 3 ) ) + (tile_x * 8) + (image_y & 0x07);
1040 bitmask = 1 << ( 7 - (image_x & 0x7) );
1043 *( buffer +
offset + 2) |= bitmask;
1045 *( buffer +
offset + 2) &= ~bitmask;
1048 offset = tile_y * ( _frame_width >> 3 ) + tile_x;
1049 *( buffer + 2 + ( ( _frame_width >> 3 ) * _frame_height ) +
offset ) = ( palette[1].index << 4 ) | palette[0].
index;
1055 _source += 3 * ( _width - _frame_width );
1071static Variable * vic1_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 ) {
1073 image_converter_asserts( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8, 8 );
1077 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
1079 if ( _frame_width % 8 ) {
1080 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
1085 if ( _height % 8 ) {
1086 _height = ( ( ( _height - 1 ) / 8 ) - 1 ) * 8;
1088 if ( _frame_height % 8 ) {
1089 _frame_height = ( ( ( _frame_height - 1 ) / 8 ) - 1 ) * 8;
1097 if (colorUsed > 4) {
1106 for( i=0; i<colorUsed; ++i ) {
1107 int minDistance = 0xffff;
1109 for (j = 0; j <
sizeof(SYSTEM_PALETTE)/
sizeof(
RGBi); ++j) {
1114 for( k=0; k<i; ++k ) {
1115 if ( palette[k].index == SYSTEM_PALETTE[j].index ) {
1127 palette[i].
index = SYSTEM_PALETTE[colorIndex].index;
1128 strcopy( palette[i].description, SYSTEM_PALETTE[colorIndex].description );
1134 int bufferSize = 3 + ( ( _frame_width >> 2 ) * _frame_height ) + 2 * ( ( _frame_width >> 2 ) * ( _frame_height >> 3 ) ) + 1;
1136 char * buffer =
malloc ( bufferSize );
1137 memset( buffer, 0, bufferSize );
1140 int image_x, image_y;
1146 int offset, offsetc, bitmask;
1152 *(buffer+1) = _height;
1154 _source += ( ( _offset_y * _width ) + _offset_x ) * 3;
1157 for (image_y = _offset_y; image_y < _height; ++image_y) {
1158 for (image_x = _offset_x; image_x < _width; ++image_x) {
1162 rgb.
green = *(_source + 1);
1163 rgb.
blue = *(_source + 2);
1165 rgb.
alpha = *(_source + 3);
1171 tile_y = (image_y >> 3);
1172 tile_x = (image_x >> 2);
1176 offset = (tile_y * 8 *( _frame_width >> 2 ) ) + (tile_x * 8) + (image_y & 0x07);
1177 offsetc = (tile_y * ( _frame_width >> 2 ) ) + (tile_x);
1179 int minDistance = 0xffff;
1182 for( i=0; i<colorUsed; ++i ) {
1192 bitmask = colorIndex << (6 - ((image_x & 0x3) * 2));
1194 switch( colorIndex ) {
1196 *(buffer + 2 + ( ( _frame_width >> 2 ) * _frame_height ) + 2 * ( _frame_width >> 2 ) * ( _frame_height >> 3 ) ) = palette[colorIndex].index;
1199 *(buffer + 2 + ( ( _frame_width >> 2 ) * _frame_height ) + offsetc ) &= 0x0f;
1200 *(buffer + 2 + ( ( _frame_width >> 2 ) * _frame_height ) + offsetc ) |= ( palette[colorIndex].index << 4 );
1203 *(buffer + 2 + ( ( _frame_width >> 2 ) * _frame_height ) + offsetc ) &= 0xf0;
1204 *(buffer + 2 + ( ( _frame_width >> 2 ) * _frame_height ) + offsetc ) |= palette[colorIndex].index;
1207 *(buffer + 2 + ( ( _frame_width >> 2 ) * _frame_height ) + ( _frame_width >> 2 ) * ( _frame_height >> 3 ) + offsetc ) = palette[colorIndex].index;
1212 *(buffer + 2 +
offset) |= bitmask;
1218 _source += ( _width - _frame_width ) * 3;
1250static void vic1_image_converter_tile(
Environment * _environment,
char * _source,
char * _dest,
int _width,
int _depth,
int _source_width ) {
1253 memset(colorIndexesCount, 0,
COLOR_COUNT *
sizeof(
int ) );
1259 memset( _dest, 0, 9 );
1262 for (
int y=0; y<8; ++y) {
1263 for (
int x=0; x<8; ++x) {
1267 memset( &rgb, 0,
sizeof(
RGBi ) );
1274 rgb.
alpha = *(_source + 3);
1278 if ( rgb.
alpha == 0 ) {
1284 if ( rgb.
alpha < 255 ) {
1288 ++colorIndexesCount[systemRgb->
index];
1295 source += _depth * ( _source_width - 8 );
1299 int colorBackground = 0;
1300 int colorBackgroundMax = 0;
1301 int colorForeground = 0;
1302 int colorForegroundMax = 0;
1304 if ( colorIndexesCount[xx] > colorBackgroundMax ) {
1305 colorBackground = xx;
1306 colorBackgroundMax = colorIndexesCount[xx];
1310 colorIndexesCount[colorBackground] = 0;
1313 if ( colorIndexesCount[xx] > colorForegroundMax ) {
1314 colorForeground = xx;
1315 colorForegroundMax = colorIndexesCount[xx];
1319 if ( colorForeground == 0 ) {
1320 colorForeground = colorBackground;
1321 colorBackground = 0;
1325 if ( colorForeground == 0 ) {
1326 colorForeground = colorBackground;
1327 colorBackground = 0;
1329 colorBackground = 0;
1333 if ( colorForeground == colorBackground ) {
1334 colorForeground = ( colorBackground == 0 ) ? 1 : 0;
1339 for (
int y=0; y<8; ++y) {
1340 for (
int x=0; x<8; ++x) {
1344 memset( &rgb, 0,
sizeof(
RGBi ) );
1350 rgb.
alpha = *(_source + 3);
1354 if ( rgb.
alpha == 0 ) {
1362 char bitmask = 1 << ( 7 - ((x) & 0x7) );
1364 if ( rgb.
alpha < 255 ) {
1365 *( _dest + y ) &= ~bitmask;
1368 if ( systemRgb->
index != colorBackground ) {
1370 *( _dest + y ) |= bitmask;
1374 *( _dest + y ) &= ~bitmask;
1383 source += _depth * ( _source_width - 8 );
1387 *( _dest + 8 ) = colorForeground | ( colorBackground << 4 ) ;
1402static void vic1_image_converter_tiles(
Environment * _environment,
char * _source,
char * _dest,
int _width,
int _height,
int _depth,
int _source_width ) {
1404 int bitmapSize = ( _width>>3 ) * _height;
1405 int colormapSize = ( _width>>3 ) * (_height>>3);
1407 memset( _dest, 0, bitmapSize + colormapSize );
1411 for(
int y=0; y<_height; y+=8 ) {
1412 for(
int x=0; x<_width; x+=8 ) {
1414 char *
source = _source + ( ( y * _source_width ) + x ) * _depth;
1417 vic1_image_converter_tile( _environment,
source, tile, _width, _depth, _source_width );
1419 int offset = ((y>>3) * 8 *( _width >> 3 ) ) + ((x>>3) * 8) + ((y) & 0x07);
1425 char * destBitmap = _dest +
offset;
1426 char * destColormap = _dest + bitmapSize + ( ( ( y >> 3 ) * ( _width >> 3 ) ) + ( x >> 3 ) );
1427 for(
int i=0; i<8; ++i ) {
1428 *destBitmap = tile[i];
1432 *destColormap = tile[8];
1442static Variable * OLD__vic1_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 ) {
1444 image_converter_asserts( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8, 8 );
1448 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
1450 if ( _frame_width % 8 ) {
1451 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
1456 if ( _height % 8 ) {
1457 _height = ( ( ( _height - 1 ) / 8 ) - 1 ) * 8;
1459 if ( _frame_height % 8 ) {
1460 _frame_height = ( ( ( _frame_height - 1 ) / 8 ) - 1 ) * 8;
1473 for( i=0; i<colorUsed; ++i ) {
1474 int minDistance = 0xffff;
1476 for (j = 0; j <
sizeof(SYSTEM_PALETTE)/
sizeof(
RGBi); ++j) {
1481 for( k=0; k<i; ++k ) {
1482 if ( palette[k].index == SYSTEM_PALETTE[j].index ) {
1494 palette[i].
index = SYSTEM_PALETTE[colorIndex].index;
1495 strcopy( palette[i].description, SYSTEM_PALETTE[colorIndex].description );
1503 if ( colorUsed == 2 ) {
1504 bufferSize = 3 + ( ( _frame_width >> 3 ) * ( _frame_height >> 3 ) ) + 2;
1506 bufferSize = 3 + 2* ( ( _frame_width >> 3 ) * ( _frame_height >> 3 ) );
1511 char * buffer =
malloc ( bufferSize );
1512 memset( buffer, 0, bufferSize );
1515 int image_x, image_y;
1526 *(buffer) = _frame_width;
1527 *(buffer+1) = _frame_height;
1529 if ( colorUsed > 2 ) {
1537 _source += ( ( _offset_y * _width ) + _offset_x ) * _depth;
1541 for( cy=0; cy<(_frame_height >> 3);++cy) {
1542 for( cx=0; cx<(_frame_width >> 3);++cx) {
1544 char *
source = _source + ( ( cy * 8 * _width ) + cx * 8 ) * _depth;
1545 char convertedTile[9];
1547 vic1_image_converter_tile( _environment,
source, convertedTile, _width, _depth, _width );
1550 memset(&tileData,0,
sizeof(
TileData));
1551 memcpy(&tileData.
data[0], convertedTile, 8 );
1580 *(buffer + 3 + (cy * ( _frame_width >> 3 ) ) + cx ) = tile;
1581 if ( colorUsed > 2 ) {
1583 *(buffer + 3 + ( ( _frame_width >> 3 ) * ( _frame_height >> 3 ) ) + (cy * ( _frame_width >> 3 ) ) + cx ) = ( convertedTile[8] >> 4 ) & 0x7;
1592 if ( colorUsed <= 2 ) {
1593 *(buffer + 3 + ( ( _frame_width >> 3 ) * ( _frame_height >> 3 ) ) ) = palette[1].index;
1594 *(buffer + 3 + ( ( _frame_width >> 3 ) * ( _frame_height >> 3 ) ) + 1 ) = ( palette[0].index << 4 );
1596 *(buffer + 3 + ( ( _frame_width >> 3 ) * ( _frame_height >> 3 ) ) + ( (_frame_height >> 3 ) * ( _frame_width >> 3 ) ) ) = ( palette[0].index << 4 ) & 0xf0;
1608static Variable * vic1_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 ) {
1612 image_converter_asserts( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8, 8 );
1616 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
1618 if ( _frame_width % 8 ) {
1619 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
1624 if ( _height % 8 ) {
1625 _height = ( ( ( _height - 1 ) / 8 ) - 1 ) * 8;
1627 if ( _frame_height % 8 ) {
1628 _frame_height = ( ( ( _frame_height - 1 ) / 8 ) - 1 ) * 8;
1641 int size = ( ( _frame_width >> 3 ) * ( _frame_height >> 3 ) );
1645 char * buffer =
malloc ( bufferSize );
1647 memset( buffer, 0, bufferSize );
1650 buffer[1] = ( _frame_width >> 3 );
1655 _source += ( ( _offset_y * _width ) + _offset_x ) * _depth;
1657 for( cy=0; cy<(_frame_height >> 3);++cy) {
1658 for( cx=0; cx<(_frame_width >> 3);++cx) {
1660 int tileDataOffset = 3 +
size + ( (cy * ( _frame_width >> 3 ) ) + cx ) * ( 8 );
1661 int tileColorOffset = 3 +
size +
size * 8 + ( cy * (_frame_width >> 3) ) + cx;
1663 char *
source = _source + ( ( cy * 8 * _width ) + cx * 8 ) * _depth;
1665 char convertedTile[9];
1667 vic1_image_converter_tile( _environment,
source, convertedTile, _width, _depth, _width );
1669 memcpy( &buffer[tileDataOffset], convertedTile, 8 );
1670 buffer[tileColorOffset] = convertedTile[8];
1682Variable *
vic1_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 ) {
1687 return vic1_image_converter_tilemap_mode_standard( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
1701static void vic1_load_image_address_to_register(
Environment * _environment,
char * _register,
Resource * _source,
char * _sequence,
char * _frame,
int _frame_size,
int _frame_count ) {
1703 if ( !_sequence && !_frame ) {
1737 if ( strlen(_sequence) == 0 ) {
1745 if ( strlen(_frame) == 0 ) {
1764 if ( strlen(_frame) == 0 ) {
1798 deploy( putimage, src_hw_vic1_put_image_asm );
1800 if ( _frame_size ) {
1801 vic1_load_image_address_to_register( _environment,
"TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
1829void vic1_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 ) {
1832 deploy( blitimage, src_hw_vic1_blit_image_asm );
1834 if ( _source_count > 2 ) {
1843 outline0(
"STA BLITIMAGEBLITADDR+1" );
1845 outline0(
"STA BLITIMAGEBLITADDR+2" );
1847 if ( _source_count > 0 ) {
1849 resource.
realName = strdup( _sources[0] );
1851 vic1_load_image_address_to_register( _environment,
"BLITTMPPTR", &resource, _sequence, _frame, _frame_size, _frame_count );
1858 if ( _source_count > 1 ) {
1860 resource.
realName = strdup( _sources[0] );
1862 vic1_load_image_address_to_register( _environment,
"BLITTMPPTR2", &resource, _sequence, _frame, _frame_size, _frame_count );
1879 outline1(
"LDA #$%2.2x", ( _flags & 0xff ) );
1881 outline1(
"LDA #$%2.2x", ( (_flags>>8) & 0xff ) );
1890 deploy( vbl, src_hw_vic1_vbl_asm);
1914 int size = calculate_images_size( _environment, _frames, _width, _height, _mode );
1915 int frameSize =
vic1_image_size( _environment, _width, _height, _mode );
1933 int size2 = calculate_sequence_size( _environment, _sequences, _frames, _width, _height, _mode );
1934 int size = calculate_images_size( _environment, _frames, _width, _height, _mode );
1935 int frameSize =
vic1_image_size( _environment, _width, _height, _mode );
1951void vic1_get_image(
Environment * _environment,
char * _image,
char * _x,
char * _y,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
int _palette ) {
1963 outline1(
"LDA #$%2.2x", (
unsigned char)(_dx&0xff) );
1965 outline1(
"LDA #$%2.2x", (
unsigned char)(_dy&0xff) );
1974 deploy( tiles, src_hw_vic1_tiles_asm );
1999 deploy( tiles, src_hw_vic1_tiles_asm );
2036 deploy( tiles, src_hw_vic1_tiles_asm );
2064 deploy( tiles, src_hw_vic1_tiles_asm );
2081 deploy( tiles, src_hw_vic1_tiles_asm );
2106static unsigned int SOUND_FREQUENCIES[] = {
2107 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
2108 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
2109 19, 19, 19, 19, 19, 19, 32, 45, 57, 68,
2110 78, 88, 98, 106, 115, 123, 130, 137, 144, 150,
2111 156, 161, 167, 172, 176, 181, 185, 189, 193, 196,
2112 199, 202, 205, 208, 211, 213, 216, 218, 220, 222,
2113 224, 226, 227, 229, 230, 232, 233, 234, 235, 236,
2114 237, 238, 239, 240, 241, 242, 243, 243, 244, 245,
2115 245, 246, 246, 247, 247, 248, 248, 248, 249, 249,
2116 249, 250, 250, 250, 251, 251, 251, 251, 252, 252,
2117 252, 252, 252, 252, 253, 253, 253, 253, 253, 253,
2118 253, 253, 253, 254, 254, 254, 254, 254, 254
2126 if ( _channels & 0x01 ) {
2129 if ( _channels & 0x02 ) {
2132 if ( _channels & 0x04 ) {
2141 deploy( vic1startup, src_hw_vic1_startup_asm );
2143 outline1(
"LDX #%2.2x", ( _volume & 0x0f ) );
2148#define PROGRAM_FREQUENCY( c, f ) \
2149 outline1("LDX #$%2.2x", ( ( ( f >> 9 ) & 0xff ) ) ); \
2150 outline1("LDY #$%2.2x", 0 ); \
2151 if ( ( c & 0x01 ) ) \
2152 outline0("JSR VIC1PROGFREQ0" ); \
2153 if ( ( c & 0x02 ) ) \
2154 outline0("JSR VIC1PROGFREQ1" ); \
2155 if ( ( c & 0x04 ) ) \
2156 outline0("JSR VIC1PROGFREQ2" );
2158#define PROGRAM_FREQUENCY_V( c, f ) \
2159 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2160 outline1("LDX %s", f ); \
2161 outline1("LDY %s", address_displacement(_environment, f, "1") ); \
2162 outline0("JSR VIC1FREQ" );
2164#define PROGRAM_FREQUENCY_SV( c, f ) \
2165 outline1("LDX #$%2.2x", ( ( ( f >> 9 ) ) & 0xff ) ); \
2166 outline1("LDY #$%2.2x", 0 ); \
2167 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2168 outline0("JSR VIC1FREQ2" );
2170#define PROGRAM_DURATION( c, d ) \
2171 outline1("LDX #$%2.2x", ( ( d & 0xff ) ) ); \
2172 outline1("LDY #$%2.2x", ( ( ( d >> 9 ) & 0xff ) ) ); \
2173 if ( ( c & 0x01 ) ) \
2174 outline0("JSR VIC1SETDURATION0" ); \
2175 if ( ( c & 0x02 ) ) \
2176 outline0("JSR VIC1SETDURATION1" ); \
2177 if ( ( c & 0x04 ) ) \
2178 outline0("JSR VIC1SETDURATION2" );
2180#define WAIT_DURATION( c ) \
2181 if ( ( c & 0x01 ) ) \
2182 outline0("JSR VIC1WAITDURATION0" ); \
2183 if ( ( c & 0x02 ) ) \
2184 outline0("JSR VIC1WAITDURATION1" ); \
2185 if ( ( c & 0x04 ) ) \
2186 outline0("JSR VIC1WAITDURATION2" );
2188#define PROGRAM_PITCH( c, f ) \
2189 outline1("LDX #$%2.2x", ( f & 0xff ) ); \
2190 outline1("LDY #$%2.2x", 0 ); \
2191 if ( ( c & 0x01 ) ) \
2192 outline0("JSR VIC1PROGFREQ0" ); \
2193 if ( ( c & 0x02 ) ) \
2194 outline0("JSR VIC1PROGFREQ1" ); \
2195 if ( ( c & 0x04 ) ) \
2196 outline0("JSR VIC1PROGFREQ2" );
2198#define PROGRAM_PITCH_V( c, f ) \
2199 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2200 outline1("LDX %s", f ); \
2201 outline1("LDY %s", address_displacement(_environment, f, "1") ); \
2202 outline0("JSR VIC1PROGFREQ" );
2204#define PROGRAM_PITCH_SV( c, f ) \
2205 outline1("LDX #$%2.2x", ( f & 0xff ) ); \
2206 outline1("LDY #$%2.2x", 0 ); \
2207 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2208 outline0("JSR VIC1PROGFREQ" );
2210#define PROGRAM_PULSE( c, p ) \
2211 outline1("LDX #$%2.2x", ( p & 0xff ) ); \
2212 outline1("LDY #$%2.2x", 0 ); \
2213 if ( ( c & 0x01 ) ) \
2214 outline0("JSR VIC1PROGPULSE0" ); \
2215 if ( ( c & 0x02 ) ) \
2216 outline0("JSR VIC1PROGPULSE1" ); \
2217 if ( ( c & 0x04 ) ) \
2218 outline0("JSR VIC1PROGPULSE2" );
2220#define PROGRAM_PULSE_V( c, p ) \
2221 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2222 outline1("LDX %s", p ); \
2223 outline1("LDY %s", address_displacement(_environment, p, "1") ); \
2224 outline0("JSR VIC1PROGPULSE" );
2226#define PROGRAM_PULSE_SV( c, p ) \
2227 outline1("LDX #$%2.2x", ( p & 0xff ) ); \
2228 outline1("LDY #$%2.2x", 0 ); \
2229 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2230 outline0("JSR VIC1PROGPULSE" );
2232#define PROGRAM_NOISE( c ) \
2233 outline0("LDX #$82" ); \
2234 if ( ( c & 0x01 ) ) \
2235 outline0("JSR VIC1PROGCTR0" ); \
2236 if ( ( c & 0x02 ) ) \
2237 outline0("JSR VIC1PROGCTR1" ); \
2238 if ( ( c & 0x04 ) ) \
2239 outline0("JSR VIC1PROGCTR2" );
2241#define PROGRAM_NOISE_V( c, p ) \
2242 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2243 outline0("LDX #$82" ); \
2244 outline0("JSR VIC1PROGCTR" );
2246#define PROGRAM_NOISE_SV( c ) \
2247 outline0("LDX #$82" ); \
2248 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2249 outline0("JSR VIC1PROGCTR" );
2251#define PROGRAM_SAW( c ) \
2252 outline0("LDX #$22" ); \
2253 if ( ( c & 0x01 ) ) \
2254 outline0("JSR VIC1PROGCTR0" ); \
2255 if ( ( c & 0x02 ) ) \
2256 outline0("JSR VIC1PROGCTR1" ); \
2257 if ( ( c & 0x04 ) ) \
2258 outline0("JSR VIC1PROGCTR2" );
2260#define PROGRAM_SAW_V( c) \
2261 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2262 outline0("LDX #$22" ); \
2263 outline0("JSR VIC1PROGCTR" );
2265#define PROGRAM_SAW_SV( c ) \
2266 outline0("LDX #$22" ); \
2267 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2268 outline0("JSR VIC1PROGCTR" );
2270#define PROGRAM_TRIANGLE( c ) \
2271 outline0("LDX #$12" ); \
2272 if ( ( c & 0x01 ) ) \
2273 outline0("JSR VIC1PROGCTR0" ); \
2274 if ( ( c & 0x02 ) ) \
2275 outline0("JSR VIC1PROGCTR1" ); \
2276 if ( ( c & 0x04 ) ) \
2277 outline0("JSR VIC1PROGCTR2" );
2279#define PROGRAM_TRIANGLE_V( c ) \
2280 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2281 outline0("LDX #$12" ); \
2282 outline0("JSR VIC1PROGCTR" );
2284#define PROGRAM_TRIANGLE_SV( c ) \
2285 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2286 outline0("LDX #$12" ); \
2287 outline0("JSR VIC1PROGCTR" );
2289#define PROGRAM_SAW_TRIANGLE( c ) \
2290 outline0("LDX #$32" ); \
2291 if ( ( c & 0x01 ) ) \
2292 outline0("JSR VIC1PROGCTR0" ); \
2293 if ( ( c & 0x02 ) ) \
2294 outline0("JSR VIC1PROGCTR1" ); \
2295 if ( ( c & 0x04 ) ) \
2296 outline0("JSR VIC1PROGCTR2" );
2298#define PROGRAM_SAW_TRIANGLE_V( c ) \
2299 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2300 outline0("LDX #$32" ); \
2301 outline0("JSR VIC1PROGCTR" );
2303#define PROGRAM_SAW_TRIANGLE_SV( c ) \
2304 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2305 outline0("LDX #$32" ); \
2306 outline0("JSR VIC1PROGCTR" );
2308#define PROGRAM_ATTACK_DECAY( c, a, d ) \
2309 outline1("LDX #$%2.2x", ( a & 0x0f ) ); \
2310 outline1("LDY #$%2.2x", ( d & 0x0f ) ); \
2311 if ( ( c & 0x01 ) ) \
2312 outline0("JSR VIC1PROGAD0" ); \
2313 if ( ( c & 0x02 ) ) \
2314 outline0("JSR VIC1PROGAD1" ); \
2315 if ( ( c & 0x04 ) ) \
2316 outline0("JSR VIC1PROGAD2" );
2318#define PROGRAM_ATTACK_DECAY_V( c, a, d ) \
2319 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2320 outline1("LDX %s", a ); \
2321 outline1("LDY %s", d ); \
2322 outline0("JSR VIC1PROGAD" );
2324#define PROGRAM_ATTACK_DECAY_SV( c, a, d ) \
2325 outline1("LDX #$%2.2x", ( a & 0x0f ) ); \
2326 outline1("LDY #$%2.2x", ( d & 0x0f ) ); \
2327 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2328 outline0("JSR VIC1PROGAD" );
2330#define PROGRAM_SUSTAIN_RELEASE( c, s, r ) \
2331 outline1("LDX #$%2.2x", ( s & 0x0f ) ); \
2332 outline1("LDY #$%2.2x", ( r & 0x0f ) ); \
2333 if ( ( c & 0x01 ) ) \
2334 outline0("JSR VIC1PROGSR0" ); \
2335 if ( ( c & 0x02 ) ) \
2336 outline0("JSR VIC1PROGSR1" ); \
2337 if ( ( c & 0x04 ) ) \
2338 outline0("JSR VIC1PROGSR2" );
2340#define PROGRAM_SUSTAIN_RELEASE_V( c, s, r ) \
2341 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2342 outline1("LDX %s", s ); \
2343 outline1("LDY %s", r ); \
2344 outline0("JSR VIC1PROGSR" );
2346#define PROGRAM_SUSTAIN_RELEASE_SV( c, s, r ) \
2347 outline1("LDX #$%2.2x", ( s & 0x0f ) ); \
2348 outline1("LDY #$%2.2x", ( r & 0x0f ) ); \
2349 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2350 outline0("JSR VIC1PROGSR" );
2352#define STOP_FREQUENCY( c ) \
2353 if ( ( c & 0x01 ) ) \
2354 outline0("JSR VIC1STOP0" ); \
2355 if ( ( c & 0x02 ) ) \
2356 outline0("JSR VIC1STOP1" ); \
2357 if ( ( c & 0x04 ) ) \
2358 outline0("JSR VIC1STOP2" );
2360#define STOP_FREQUENCY_V( c ) \
2361 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2362 outline0("JSR VIC1STOP" );
2364#define STOP_FREQUENCY_SV( c ) \
2365 outline1("LDA %s", ( c == NULL ? "#$7" : c ) ); \
2366 outline0("JSR VIC1STOP" );
2371 deploy( vic1startup, src_hw_vic1_startup_asm );
2577 deploy( vic1startup, src_hw_vic1_startup_asm );
2586 deploy( vic1startup, src_hw_vic1_startup_asm );
2594 vic1_set_pitch( _environment, _channels, SOUND_FREQUENCIES[_note] );
2601 deploy( vic1startup, src_hw_vic1_startup_asm );
2610 deploy( vic1startup, src_hw_vic1_startup_asm );
2624 deploy( vic1startup, src_hw_vic1_startup_asm );
2639 deploy( vic1startup, src_hw_vic1_startup_asm );
2649 deploy( vic1startup, src_hw_vic1_startup_asm );
2851 deploy( vic1startup, src_hw_vic1_startup_asm );
2868 deploy( vic1startup, src_hw_vic1_startup_asm );
2885 deploy( vic1startup, src_hw_vic1_startup_asm );
2914 deploy( vic1startup, src_hw_vic1_startup_asm );
2924 deploy( vic1startup, src_hw_vic1_startup_asm );
2930 outline0(
"STA VIC1TMPPTR_BACKUP+1");
2931 outline1(
"LDA #$%2.2x", ( _size>>8 ) & 0xff);
2933 outline1(
"LDA #$%2.2x", _size & 0xff );
2934 outline0(
"STA VIC1LASTBLOCK_BACKUP");
2942void vic1_slice_image(
Environment * _environment,
char * _image,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
char * _destination ) {
2950 memcpy( _palette,
palette_match( _palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE) /
sizeof(
RGBi) ), paletteColorCount *
sizeof(
RGBi ) );
2952 int uniquePaletteCount = 0;
2956 return uniquePaletteCount;
2963 deploy( vic1startup, src_hw_vic1_startup_asm );
2972 deploy( vic1startup, src_hw_vic1_startup_asm );
2981 deploy( vic1startup, src_hw_vic1_startup_asm );
3001 deploy( vic1startup, src_hw_vic1_startup_asm );
3015 deploy( screen, src_hw_vic1_screen_asm);
3035 outline0(
"LDA FLASHREGISTERADDRESSES, X" );
3038 outline0(
"LDA FLASHREGISTERADDRESSES, X" );
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
#define BITMAP_MODE_STANDARD
int calculate_nearest_tile(TileDescriptor *_tile, TileDescriptors *_tiles)
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.
int rgbi_equals_rgba(RGBi *_first, RGBi *_second)
TileDescriptor * calculate_tile_descriptor(TileData *_tileData)
TileDescriptors * precalculate_tile_descriptors_for_font(char *_fontData, int _fontSize)
Variable * variable_import(Environment *_environment, char *_name, VariableType _type, int _size_or_value)
int calculate_exact_tile(TileDescriptor *_tile, TileDescriptors *_tiles)
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.
void font_descriptors_init(Environment *_environment, int _embedded_present)
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 cls(Environment *_environment, char *_paper)
Emit code for CLS.
void plot(Environment *_environment, char *_x, char *_y, char *_c, int _preserve_color)
#define TILEMAP_MODE_STANDARD
void flash(Environment *_environment, char *_index, char *_register)
void console_init(Environment *_environment)
Variable * distance(Environment *_environment, char *_x1, char *_y1, char *_x2, char *_y2)
Return the distance between two (screen) positions.
unsigned int data_font_alpha_bin_len
unsigned char data_font_alpha_bin[]
unsigned int data_font_standard_bin_len
RgbConverterFunction currentRgbConverterFunction
TileDescriptors * descriptors
VestigialConfig vestigialConfig
TileDescriptor * descriptor[512]
unsigned char * valueBuffer
RGBi originalPalette[MAX_PALETTE]
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 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 FONT_SCHEMA_ALPHA
#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 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
struct _TileDescriptor TileDescriptor
#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 adilinebeginbitmap(s)
#define IMF_INSTRUMENT_STRING_ENSEMBLE_2
#define IMF_INSTRUMENT_SYNTH_BASS_2
#define IMF_INSTRUMENT_ELECTRIC_PIANO2
#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_BLIT_TOO_MUCH_SOURCES()
struct _TileData TileData
#define IMF_INSTRUMENT_VIOLA
#define IMF_INSTRUMENT_TROMBONE
#define IMF_INSTRUMENT_OVERDRIVEN_GUITAR
#define IMF_INSTRUMENT_ELECTRIC_PIANO1
#define IMF_INSTRUMENT_TAIKO_DRUM
char * strcopy(char *_dest, char *_source)
void vic1_tiles_get(Environment *_environment, char *_result)
void vic1_sprite_data_set(Environment *_environment, char *_sprite, char *_address)
void vic1_set_frequency_vars(Environment *_environment, char *_channels, char *_frequency)
void vic1_flash_end(Environment *_environment)
void vic1_set_program_semi_var(Environment *_environment, char *_channels, int _program)
#define PROGRAM_DURATION(c, d)
#define PROGRAM_TRIANGLE_SV(c)
#define PROGRAM_SAW_SV(c)
void vic1_slice_image(Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
void vic1_textmap_at(Environment *_environment, char *_address)
void vic1_set_parameter(Environment *_environment, int _channels, int _parameter, int _value)
void vic1_cls_box(Environment *_environment, char *_x1, char *_y1, char *_w, char *_h)
RGBi * vic1_image_nearest_system_color(RGBi *_color)
void vic1_cls(Environment *_environment)
void vic1_tiles_at(Environment *_environment, char *_address)
void vic1_start_var(Environment *_environment, char *_channels)
void vic1_start(Environment *_environment, int _channels)
void vic1_sprite_color(Environment *_environment, char *_sprite, char *_color)
void vic1_hscroll_screen(Environment *_environment, int _direction, int _overlap)
int vic1_image_size(Environment *_environment, int _width, int _height, int _mode)
#define PROGRAM_FREQUENCY(c, f)
void vic1_wait_vbl(Environment *_environment)
void vic1_background_color_vars(Environment *_environment, char *_index, char *_background_color)
VIC: emit code to change background color
void vic1_sprite_expand_horizontal(Environment *_environment, char *_sprite)
void vic1_calculate_sequence_frame_offset(Environment *_environment, char *_offset, char *_sequence, char *_frame, int _frame_size, int _frame_count)
void vic1_sprite_common_color(Environment *_environment, char *_index, char *_common_color)
VIC: emit code to change common sprite's color
#define PROGRAM_NOISE_SV(c)
void vic1_set_duration(Environment *_environment, int _channels, int _duration)
void vic1_get_height(Environment *_environment, char *_result)
void vic1_bitmap_enable(Environment *_environment, int _width, int _height, int _colors)
void vic1_busy_wait(Environment *_environment, char *_timing)
void vic1_scroll(Environment *_environment, int _dx, int _dy)
void vic1_tilemap_enable(Environment *_environment, int _width, int _height, int _colors, int _tile_width, int _tile_height)
void vic1_stop(Environment *_environment, int _channels)
void vic1_get_width(Environment *_environment, char *_result)
Variable * vic1_new_images(Environment *_environment, int _frames, int _width, int _height, int _mode)
int vic1_palette_extract(Environment *_environment, char *_data, int _width, int _height, int _depth, int _flags, RGBi *_palette)
void vic1_put_tile(Environment *_environment, char *_tile, char *_x, char *_y)
void vic1_next_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
VIC: emit code to wait for next raster irq at different position
Variable * vic1_new_image(Environment *_environment, int _width, int _height, int _mode)
void vic1_set_frequency(Environment *_environment, int _channels, int _frequency)
void vic1_music(Environment *_environment, char *_music, int _size, int _loop)
void vic1_screen(Environment *_environment, char *_x, char *_y, char *_c)
void vic1_sprite_data_from(Environment *_environment, char *_sprite, char *_address)
void vic1_hscroll_line(Environment *_environment, int _direction, int _overlap)
void vic1_sprite_monocolor(Environment *_environment, char *_sprite)
void vic1_flash_begin(Environment *_environment, char *_index, char *_register)
void vic1_sprite_at(Environment *_environment, char *_sprite, char *_x, char *_y)
void vic1_bitmap_at(Environment *_environment, char *_address)
void vic1_finalization(Environment *_environment)
void vic1_hit(Environment *_environment, char *_sprite_mask, char *_result)
VIC: emit code to check for collision
void vic1_put_tiles(Environment *_environment, char *_tile, char *_x, char *_y, char *_w, char *_h)
void vic1_set_note_vars(Environment *_environment, char *_channels, char *_note)
void vic1_screen_off(Environment *_environment)
void vic1_scroll_text(Environment *_environment, int _direction, int _overlap)
void vic1_stop_vars(Environment *_environment, char *_channels)
#define STOP_FREQUENCY(c)
void vic1_use_tileset(Environment *_environment, char *_tileset)
void vic1_flash_register(Environment *_environment, char *_index, char *_timer, char *_color)
void vic1_set_pitch_vars(Environment *_environment, char *_channels, char *_pitch)
#define PROGRAM_ATTACK_DECAY(c, a, d)
void vic1_set_volume_semi_var(Environment *_environment, char *_channel, int _volume)
void vic1_sprite_expand_vertical(Environment *_environment, char *_sprite)
void vic1_background_color_get_vars(Environment *_environment, char *_index, char *_background_color)
VIC: emit code to retrieve background color
#define PROGRAM_SUSTAIN_RELEASE_SV(c, s, r)
void vic1_set_duration_vars(Environment *_environment, char *_channels, char *_duration)
void vic1_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
VIC: emit code to set raster irq
void vic1_wait_duration_vars(Environment *_environment, char *_channels)
void vic1_pset_vars(Environment *_environment, char *_x, char *_y, char *_c)
void vic1_vertical_scroll(Environment *_environment, char *_displacement)
void vic1_sprite_disable(Environment *_environment, char *_sprite)
void vic1_text(Environment *_environment, char *_text, char *_text_size, int _raw)
#define PROGRAM_SUSTAIN_RELEASE(c, s, r)
void vic1_colormap_at(Environment *_environment, char *_address)
void console_calculate_vars(Environment *_environment)
#define PROGRAM_PULSE_SV(c, p)
void vic1_sprite_compress_horizontal(Environment *_environment, char *_sprite)
void vic1_wait_duration(Environment *_environment, int _channels)
void vic1_screen_rows(Environment *_environment, char *_rows)
void vic1_set_volume_vars(Environment *_environment, char *_channels, char *_volume)
void vic1_put_image(Environment *_environment, Resource *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_flags)
void vic1_set_program(Environment *_environment, int _channels, int _program)
Variable * vic1_get_raster_line(Environment *_environment)
#define PROGRAM_PITCH(c, f)
void vic1_pset_int(Environment *_environment, int _x, int _y, int *_c)
void vic1_horizontal_scroll(Environment *_environment, char *_displacement)
void vic1_set_volume(Environment *_environment, int _channels, int _volume)
void vic1_sprite_compress_vertical(Environment *_environment, char *_sprite)
int vic1_screen_mode_enable(Environment *_environment, ScreenMode *_screen_mode)
void vic1_move_tiles(Environment *_environment, char *_tile, char *_x, char *_y)
void vic1_sprite_enable(Environment *_environment, char *_sprite)
void vic1_bitmap_disable(Environment *_environment)
void vic1_tile_at(Environment *_environment, char *_x, char *_y, char *_result)
void vic1_get_image(Environment *_environment, char *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, int _palette)
void vic1_collision(Environment *_environment, char *_sprite_mask, char *_result)
VIC: emit code to check for collision
void vic1_back(Environment *_environment)
void vic1_screen_on(Environment *_environment)
#define PROGRAM_PULSE(c, p)
void vic1_sprite_priority(Environment *_environment, char *_sprite, char *_priority)
void vic1_pget_color_vars(Environment *_environment, char *_x, char *_y, char *_result)
void vic1_background_color(Environment *_environment, int _index, int _background_color)
VIC: emit code to change background color
void vic1_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 vic1_flash_off(Environment *_environment, char *_index)
Variable * vic1_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 vic1_sprite_multicolor(Environment *_environment, char *_sprite)
void vic1_bank_select(Environment *_environment, int _bank)
void vic1_background_color_semivars(Environment *_environment, int _index, char *_background_color)
VIC: emit code to change background color
void vic1_cline(Environment *_environment, char *_characters)
void vic1_screen_columns(Environment *_environment, char *_columns)
#define PROGRAM_TRIANGLE(c)
void vic1_next_raster(Environment *_environment)
VIC: emit code to wait for next raster irq
void console_calculate(Environment *_environment)
void vic1_initialization(Environment *_environment)
void vic1_set_pitch(Environment *_environment, int _channels, int _pitch)
#define PROGRAM_ATTACK_DECAY_SV(c, a, d)
Variable * vic1_new_sequence(Environment *_environment, int _sequences, int _frames, int _width, int _height, int _mode)
void vic1_border_color(Environment *_environment, char *_border_color)
VIC: emit code to change border color
void vic1_set_note(Environment *_environment, int _channels, int _note)