35#if defined(__d32__) || defined(__d64__) || defined(__coco__)
40static RGBi SYSTEM_PALETTE_ALTERNATE[][4] = {
42 { 0x00, 0xcc, 0x55, 0xff, 0,
"GREEN" },
43 { 0xee, 0xee, 0x77, 0xff, 1,
"YELLOW" },
44 { 0x00, 0x00, 0xaa, 0xff, 2,
"BLUE" },
45 { 0x88, 0x00, 0x00, 0xff, 3,
"RED" }
48 { 0x00, 0x00, 0x00, 0xff, 0,
"BLACK" },
49 { 0xf0, 0xf0, 0xf0, 0xff, 5,
"BUFF" },
50 { 0xaa, 0xff, 0xe6, 0xff, 6,
"CYAN" },
51 { 0xcc, 0x44, 0xcc, 0xff, 7,
"MAGENTA" }
56static RGBi SYSTEM_PALETTE_SG4[9] =
59 { 0x00, 0x00, 0x00, 0xff, 0,
"BLACK" },
60 { 0x00, 0xff, 0x00, 0xff, 1,
"GREEN" },
61 { 0xff, 0xff, 0x00, 0xff, 2,
"YELLOW" },
62 { 0x00, 0x00, 0xff, 0xff, 3,
"BLUE" },
63 { 0xff, 0x00, 0x00, 0xff, 4,
"RED" },
64 { 0xff, 0xff, 0xff, 0xff, 5,
"BUFF" },
65 { 0x00, 0xff, 0xff, 0xff, 6,
"CYAN" },
66 { 0xff, 0x00, 0xff, 0xff, 7,
"MAGENTA" },
67 { 0xff, 0x80, 0x00, 0xff, 8,
"ORANGE" }
71static RGBi SYSTEM_PALETTE_SG6[4] =
74 { 0x00, 0x00, 0x00, 0xff, 0,
"BLACK" },
75 { 0x00, 0x00, 0x00, 0xff, 1,
"UNUSED" },
76 { 0x00, 0x00, 0xff, 0xff, 2,
"BLUE" },
77 { 0xff, 0x00, 0x00, 0xff, 3,
"RED" }
81static RGBi SYSTEM_PALETTE_SG8[9] =
84 { 0x00, 0x00, 0x00, 0xff, 0,
"BLACK" },
85 { 0x00, 0xff, 0x00, 0xff, 1,
"GREEN" },
86 { 0xff, 0xff, 0x00, 0xff, 2,
"YELLOW" },
87 { 0x00, 0x00, 0xff, 0xff, 3,
"BLUE" },
88 { 0xff, 0x00, 0x00, 0xff, 4,
"RED" },
89 { 0xff, 0xff, 0xff, 0xff, 5,
"BUFF" },
90 { 0x00, 0xff, 0xff, 0xff, 6,
"CYAN" },
91 { 0xff, 0x00, 0xff, 0xff, 7,
"MAGENTA" },
92 { 0xff, 0x80, 0x00, 0xff, 8,
"ORANGE" }
97static RGBi * SYSTEM_PALETTE = &SYSTEM_PALETTE_ALTERNATE[0][0];
99static RGBi * commonPalette;
149 outline1(
"LDA %s", _border_color );
177 outline1(
"LDA %s", _background_color );
257#define SET_VIDEOAT_ZERO SAM_F0_CLR; SAM_F1_CLR; SAM_F2_CLR; SAM_F3_CLR; SAM_F4_CLR; SAM_F5_CLR; SAM_F6_CLR;
259#define SET_VIDEOAT_0400 SET_VIDEOAT_ZERO; SAM_F1_SET;
260#define SET_VIDEOAT_1C00 SET_VIDEOAT_ZERO; SAM_F2_SET; SAM_F3_SET; SAM_F4_SET;
264 int consoleSA = 0x0c00;
335 switch( _screen_mode->
id ) {
783 outline0(
"JSR C6847VIDEOSTARTATB" );
794 outline0(
"JSR C6847VIDEOSTARTATT" );
803 outline1(
"LDX %4.4x", (_x & 0xffff ) );
805 outline1(
"LDD %4.4x", ( _y & 0xffff ) );
808 outline1(
"LDA %2.2x", ( *_c & 0Xff ) );
973 deploy( clsText, src_hw_6847_cls_text_asm );
976 deploy( clsGraphic, src_hw_6847_cls_graphic_asm );
987 deploy( clsBox, src_hw_6847_cls_box_asm );
1005 outline1(
"LDA #$%2.2x", ( _direction & 0xff ) );
1007 outline1(
"LDA #$%2.2x", ( _overlap & 0xff ) );
1012 outline1(
"LDA #$%2.2x", ( _direction & 0xff ) );
1014 outline1(
"LDA #$%2.2x", ( _overlap & 0xff ) );
1024 deploy( textEncodedAt, src_hw_6847_text_at_asm );
1033 deploy( clsText, src_hw_6847_cls_text_asm );
1035 deploy( textEncodedAtTextRaw, src_hw_6847_text_at_text_raw_asm );
1038 deploy( clsGraphic, src_hw_6847_cls_graphic_asm );
1039 deploy( vScroll, src_hw_6847_vscroll_graphic_asm );
1040 deploy( textEncodedAtGraphicRaw, src_hw_6847_text_at_graphic_raw_asm );
1041 outline0(
"JSR TEXTATBITMAPMODERAW");
1045 deploy( clsText, src_hw_6847_cls_text_asm );
1047 deploy( textEncodedAtText, src_hw_6847_text_at_text_asm );
1050 deploy( clsGraphic, src_hw_6847_cls_graphic_asm );
1051 deploy( vScroll, src_hw_6847_vscroll_graphic_asm );
1052 deploy( textEncodedAtGraphic, src_hw_6847_text_at_graphic_asm );
1062 deploy( c6847startup, src_hw_6847_startup_asm );
1158 deploy( clsText, src_hw_6847_cls_text_asm );
1166 copperList = copperList->
next;
1177 outline1(
"LDA #$%2.2x", ( _direction & 0xff ) );
1179 outline1(
"LDA #$%2.2x", ( _overlap & 0xff ) );
1192 outline1(
"LDA #$%2.2x", ( _direction & 0xff ) );
1194 outline1(
"LDA #$%2.2x", ( _overlap & 0xff ) );
1210 if ( _characters ) {
1222 deploy( textCline, src_hw_6847_cline_text_asm );
1225 deploy( textClineGraphic, src_hw_6847_cline_graphic_asm );
1239 return 3 + ( ( _width >> 3 ) * ( _height / 12 ) );
1249 return 3 + ( ( _width >> 2 ) * _height );
1251 return 2 + ( ( _width >> 2 ) * _height );
1258 if ( _transparent ) {
1259 return 3 + 2*( ( _width >> 3 ) * _height );
1261 return 3 + ( ( _width >> 3 ) * _height );
1264 return 2 + ( ( _width >> 3 ) * _height );
1273static int calculate_images_size(
Environment * _environment,
int _frames,
int _width,
int _height,
int _mode,
int _transparent ) {
1281 return 3 + ( 3 + ( ( _width >> 3 ) * ( _height / 12 ) ) ) * _frames;
1291 return 3 + ( 3 + ( ( _width >> 2 ) * _height ) ) * _frames;
1293 return 3 + ( 2 + ( ( _width >> 2 ) * _height ) ) * _frames;
1300 if ( _transparent ) {
1301 return 3 + ( 3 + 2* ( ( _width >> 3 ) * _height ) ) * _frames;
1303 return 3 + ( 3 + ( ( _width >> 3 ) * _height ) ) * _frames;
1306 return 3 + ( 2 + ( ( _width >> 3 ) * _height ) ) * _frames;
1315static int calculate_sequence_size(
Environment * _environment,
int _sequences,
int _frames,
int _width,
int _height,
int _mode,
int _transparent ) {
1323 return 3 + ( ( 3 + ( ( _width >> 3 ) * ( _height / 12 ) ) ) * _frames ) * _sequences;
1333 return 3 + ( ( 3 + ( ( _width >> 2 ) * _height ) ) * _frames ) * _sequences;
1335 return 3 + ( ( 2 + ( ( _width >> 2 ) * _height ) ) * _frames ) * _sequences;
1342 if ( _transparent ) {
1343 return 3 + ( ( 3 + 2 * ( ( _width >> 3 ) * _height ) ) * _frames ) * _sequences;
1345 return 3 + ( ( 3 + ( ( _width >> 3 ) * _height ) ) * _frames ) * _sequences;
1348 return 3 + ( ( 2 + ( ( _width >> 3 ) * _height ) ) * _frames ) * _sequences;
1357static Variable * c6847_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 ) {
1360 (void)!_transparent_color;
1362 RGBi white = { 0xff, 0xff, 0xff, 0xff };
1363 RGBi black = { 0x00, 0x00, 0x00, 0xff };
1366 (void)!_transparent_color;
1372 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
1374 if ( _frame_width % 8 ) {
1375 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
1383 if (paletteColorCount > 3) {
1387 if ( _transparent_color == 0 ) {
1388 for(
int i=0; i<3; ++i ) {
1389 if ( palette[i].alpha < 255 ) {
1390 _transparent_color = 0x0f0000;
1398 SYSTEM_PALETTE = &SYSTEM_PALETTE_ALTERNATE[_environment->
paletteSelected][0];
1400 commonPalette =
palette_match( palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE_ALTERNATE[0]) /
sizeof(
RGBi) );
1405 adilinepalette(
"CPMS:%d", (
int)(
sizeof(SYSTEM_PALETTE_ALTERNATE[0]) /
sizeof(
RGBi)), SYSTEM_PALETTE );
1416 char * buffer =
malloc ( bufferSize );
1417 memset( buffer, 0, bufferSize );
1420 int image_x, image_y;
1431 *(buffer) = _frame_width;
1432 *(buffer+1) = _frame_height;
1434 *(buffer+2) = (_transparent_color & 0x0f0000) ? 0x01 : 0x00;
1437 _source += ( ( _offset_y * _width ) + _offset_x ) * _depth;
1444 for (image_y = 0; image_y < _frame_height; ++image_y) {
1445 for (image_x = 0; image_x < _frame_width; ++image_x) {
1449 rgb.
green = *(_source + 1);
1450 rgb.
blue = *(_source + 2);
1452 rgb.
alpha = *(_source + 3);
1456 if ( rgb.
alpha == 0 ) {
1467 int minDistance = 9999;
1468 for(
int i=0; i<2; ++i ) {
1482 offset = ( image_y * ( _frame_width >> 3 ) ) + ( image_x >> 3 );
1483 bitmask = 1 << ( 7 - (image_x & 0x7) );
1485 if ( colorIndex > 0) {
1487 *( buffer +
offset + 3) |= bitmask;
1489 *( buffer +
offset + 2) |= bitmask;
1494 *( buffer +
offset + 3) &= ~bitmask;
1496 *( buffer +
offset + 2) &= ~bitmask;
1501 if ( _transparent_color & 0x0f0000 ) {
1502 if ( rgb.
alpha == 0 ) {
1504 *( buffer + ( _frame_height * ( _frame_width >> 3 ) ) +
offset + 3) |= bitmask;
1506 *( buffer + ( _frame_height * ( _frame_width >> 3 ) ) +
offset + 2) |= bitmask;
1511 *( buffer + ( _frame_height * ( _frame_width >> 3 ) ) +
offset + 3) &= ~bitmask;
1513 *( buffer + ( _frame_height * ( _frame_width >> 3 ) ) +
offset + 2) &= ~bitmask;
1525 _source += ( _width - _frame_width ) * _depth;
1543static Variable * c6847_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 ) {
1545 RGBi white = { 0xff, 0xff, 0xff, 0xff };
1546 RGBi black = { 0x00, 0x00, 0x00, 0x00 };
1549 (void)!_transparent_color;
1555 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
1557 if ( _frame_width % 8 ) {
1558 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
1566 if (paletteColorCount > 4) {
1572 SYSTEM_PALETTE = &SYSTEM_PALETTE_ALTERNATE[_environment->
paletteSelected][0];
1574 commonPalette =
palette_match( palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE_ALTERNATE[0]) /
sizeof(
RGBi) );
1579 adilinepalette(
"CPMS:%d", (
int)(
sizeof(SYSTEM_PALETTE_ALTERNATE[0]) /
sizeof(
RGBi)), SYSTEM_PALETTE );
1589 char * buffer =
malloc ( bufferSize );
1590 memset( buffer, 0, bufferSize );
1593 int image_x, image_y;
1599 int offset, offsetc, bitmask;
1604 *(buffer) = _frame_width;
1605 *(buffer+1) = _frame_height;
1608 _source += ( ( _offset_y * _width ) + _offset_x ) * _depth;
1613 for (image_y = 0; image_y < _frame_height; ++image_y) {
1614 for (image_x = 0; image_x < _frame_width; ++image_x) {
1618 rgb.
green = *(_source + 1);
1619 rgb.
blue = *(_source + 2);
1621 rgb.
alpha = *(_source + 3);
1625 if ( rgb.
alpha == 0 ) {
1631 offset = ( image_y * ( _frame_width >> 2 ) ) + ( image_x >> 2 );
1635 if ( rgb.
alpha < 255 ) {
1638 int minDistance = 9999;
1643 colorIndex = commonPalette[i].index;
1652 bitmask = colorIndex << (6 - ((image_x & 0x3) * 2));
1654 *(buffer + 3 +
offset) |= bitmask;
1660 _source += ( _width - _frame_width ) * _depth;
1681static int sg4_blocks[128][4] = {
1682 {0,0,0,0}, {1,0,0,0}, {0,1,0,0}, {1,1,0,0}, {0,0,1,0}, {1,0,1,0}, {0,1,1,0}, {1,1,1,0}, {0,0,0,1}, {1,0,0,1}, {0,1,0,1}, {1,1,0,1}, {0,0,1,1}, {1,0,1,1}, {0,1,1,1}, {1,1,1,1},
1683 {0,0,0,0}, {2,0,0,0}, {0,2,0,0}, {2,2,0,0}, {0,0,2,0}, {2,0,2,0}, {0,2,2,0}, {2,2,2,0}, {0,0,0,2}, {2,0,0,2}, {0,2,0,2}, {2,2,0,2}, {0,0,2,2}, {2,0,2,2}, {0,2,2,2}, {2,2,2,2},
1684 {0,0,0,0}, {3,0,0,0}, {0,3,0,0}, {3,3,0,0}, {0,0,3,0}, {3,0,3,0}, {0,3,3,0}, {3,3,3,0}, {0,0,0,3}, {3,0,0,3}, {0,3,0,3}, {3,3,0,3}, {0,0,3,3}, {3,0,3,3}, {0,3,3,3}, {3,3,3,3},
1685 {0,0,0,0}, {4,0,0,0}, {0,4,0,0}, {4,4,0,0}, {0,0,4,0}, {4,0,4,0}, {0,4,4,0}, {4,4,4,0}, {0,0,0,4}, {4,0,0,4}, {0,4,0,4}, {4,4,0,4}, {0,0,4,4}, {4,0,4,4}, {0,4,4,4}, {4,4,4,4},
1686 {0,0,0,0}, {5,0,0,0}, {0,5,0,0}, {5,5,0,0}, {0,0,5,0}, {5,0,5,0}, {0,5,5,0}, {5,5,5,0}, {0,0,0,5}, {5,0,0,5}, {0,5,0,5}, {5,5,0,5}, {0,0,5,5}, {5,0,5,5}, {0,5,5,5}, {5,5,5,5},
1687 {0,0,0,0}, {6,0,0,0}, {0,6,0,0}, {6,6,0,0}, {0,0,6,0}, {6,0,6,0}, {0,6,6,0}, {6,6,6,0}, {0,0,0,6}, {6,0,0,6}, {0,6,0,6}, {6,6,0,6}, {0,0,6,6}, {6,0,6,6}, {0,6,6,6}, {6,6,6,6},
1688 {0,0,0,0}, {7,0,0,0}, {0,7,0,0}, {7,7,0,0}, {0,0,7,0}, {7,0,7,0}, {0,7,7,0}, {7,7,7,0}, {0,0,0,7}, {7,0,0,7}, {0,7,0,7}, {7,7,0,7}, {0,0,7,7}, {7,0,7,7}, {0,7,7,7}, {7,7,7,7},
1689 {0,0,0,0}, {8,0,0,0}, {0,8,0,0}, {8,8,0,0}, {0,0,8,0}, {8,0,8,0}, {0,8,8,0}, {8,8,8,0}, {0,0,0,8}, {8,0,0,8}, {0,8,0,8}, {8,8,0,8}, {0,0,8,8}, {8,0,8,8}, {0,8,8,8}, {8,8,8,8}
1692static int pow2(
int _value ) {
1693 return _value*_value;
1696static int c6847_image_converter_sg4_block(
Environment * _environment,
char * _source,
int _width,
int _depth ) {
1701 int sampled_block[2][2];
1702 int sg4_blocks_distance[128];
1704 memset(block, 0, 8 * 12 *
sizeof(
int));
1706 for (y = 0; y < 12; ++y) {
1707 for (x = 0; x < 8; ++x) {
1713 rgb.
green = *(_source + 1);
1714 rgb.
blue = *(_source + 2);
1716 rgb.
alpha = *(_source + 3);
1720 if ( rgb.
alpha == 0 ) {
1730 if ( rgb.
alpha < 255 ) {
1733 int minDistance = 9999;
1734 for(
int i=0; i<
sizeof(SYSTEM_PALETTE_SG4)/
sizeof(
RGBi); ++i ) {
1739 colorIndex = SYSTEM_PALETTE_SG4[i].index;
1744 block[x][y] = colorIndex;
1754 _source += ( _width - 8 ) * _depth;
1758 for (y = 0; y < 2; ++y) {
1759 for (x = 0; x < 2; ++x) {
1764 memset( colorCount, 0, 9 *
sizeof(
int ) );
1766 for( y2 = 0; y2 < 6; ++y2 ) {
1767 for( x2 = 0; x2 < 4; ++x2 ) {
1768 colorCount[block[4*x+x2][6*y+y2]]++;
1772 int colorCountMax = 0;
1775 for( i = 0; i<9; ++i ) {
1776 if ( colorCount[i] > colorCountMax ) {
1777 colorCountMax = colorCount[i];
1782 sampled_block[x][y] = colorIndex;
1792 int min_sg4_block_distance = 9999;
1793 int min_sg4_block_number = 0;
1795 for( i=0; i<128; ++i ) {
1796 int absoluteDistance =
1798 pow2( sampled_block[0][0] - sg4_blocks[i][3] ) +
1799 pow2( sampled_block[1][0] - sg4_blocks[i][2] ) +
1800 pow2( sampled_block[0][1] - sg4_blocks[i][1] ) +
1801 pow2( sampled_block[1][1] - sg4_blocks[i][0] )
1804 int diagonalDistance =
1806 pow2( sampled_block[0][0] - sg4_blocks[i][3] ) +
1807 pow2( sampled_block[1][1] - sg4_blocks[i][0] )
1810 pow2( sampled_block[1][0] - sg4_blocks[i][2] ) +
1811 pow2( sampled_block[0][1] - sg4_blocks[i][1] )
1817 if ( (absoluteDistance * diagonalDistance) < min_sg4_block_distance ) {
1818 min_sg4_block_distance = (absoluteDistance * diagonalDistance);
1819 min_sg4_block_number = i;
1826 return 0x80 | ( min_sg4_block_number & 0x7f );
1830static Variable * c6847_image_converter_sg4(
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 ) {
1833 (void)!_transparent_color;
1837 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
1839 if ( _frame_width % 2 ) {
1840 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
1845 if ( _height % 2 ) {
1846 _height = ( ( ( _height - 1 ) / 12 ) - 1 ) * 12;
1848 if ( _frame_height % 2 ) {
1849 _frame_height = ( ( ( _frame_height - 1 ) / 12 ) - 1 ) * 12;
1853 image_converter_asserts( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8, 12 );
1859 if (paletteColorCount > 9) {
1865 SYSTEM_PALETTE = &SYSTEM_PALETTE_SG4[0];
1867 commonPalette =
palette_match( palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE_SG4) /
sizeof(
RGBi) );
1872 adilinepalette(
"CPMS:%d", (
int)(
sizeof(SYSTEM_PALETTE_SG4) /
sizeof(
RGBi)), SYSTEM_PALETTE );
1882 char * buffer =
malloc ( bufferSize );
1883 memset( buffer, 0, bufferSize );
1886 int image_x, image_y;
1892 int offset, offsetc, bitmask;
1897 *(buffer) = _frame_width;
1898 *(buffer+1) = _frame_height / 12;
1901 _source += ( ( _offset_y * (_width>>3) ) + _offset_x ) * _depth;
1906 for (image_y = 0; image_y < _frame_height; image_y+=12) {
1907 for (image_x = 0; image_x < _frame_width; image_x+=8) {
1911 offset = ( ( image_y / 12 ) * ( _frame_width >> 3 ) ) + ( image_x >> 3 );
1913 int colorIndex = c6847_image_converter_sg4_block( _environment, _source, _width, _depth );
1916 *(buffer + 3 +
offset) = colorIndex;
1920 _source += 8 * _depth;
1924 _source += 12 * _width * _depth;
1925 _source -= _frame_width * _depth;
1945static int sg6_blocks[256][6] = {
1946{0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0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,0,3,0}, {3,0,0,0,3,0}, {0,3,0,0,3,0}, {3,3,0,0,3,0}, {0,0,3,0,3,0}, {3,0,3,0,3,0}, {0,3,3,0,3,0}, {3,3,3,0,3,0}, {0,0,0,3,3,0}, {3,0,0,3,3,0}, {0,3,0,3,3,0}, {3,3,0,3,3,0}, {0,0,3,3,3,0}, {3,0,3,3,3,0}, {0,3,3,3,3,0}, {3,3,3,3,3,0}, {0,0,0,0,0,3}, {3,0,0,0,0,3}, {0,3,0,0,0,3}, {3,3,0,0,0,3}, {0,0,3,0,0,3}, {3,0,3,0,0,3}, {0,3,3,0,0,3}, {3,3,3,0,0,3}, {0,0,0,3,0,3}, {3,0,0,3,0,3}, {0,3,0,3,0,3}, {3,3,0,3,0,3}, {0,0,3,3,0,3}, {3,0,3,3,0,3}, {0,3,3,3,0,3}, {3,3,3,3,0,3}, {0,0,0,0,3,3}, {3,0,0,0,3,3}, {0,3,0,0,3,3}, {3,3,0,0,3,3}, {0,0,3,0,3,3}, {3,0,3,0,3,3}, {0,3,3,0,3,3}, {3,3,3,0,3,3}, {0,0,0,3,3,3}, {3,0,0,3,3,3}, {0,3,0,3,3,3}, {3,3,0,3,3,3}, {0,0,3,3,3,3}, {3,0,3,3,3,3}, {0,3,3,3,3,3}, {3,3,3,3,3,3},
1952static int c6847_image_converter_sg6_block(
Environment * _environment,
char * _source,
int _width,
int _depth ) {
1957 int sampled_block[2][3];
1958 int sg6_blocks_distance[256];
1960 memset(block, 0, 8 * 12 *
sizeof(
int));
1962 for (y = 0; y < 12; ++y) {
1963 for (x = 0; x < 8; ++x) {
1969 rgb.
green = *(_source + 1);
1970 rgb.
blue = *(_source + 2);
1972 rgb.
alpha = *(_source + 3);
1976 if ( rgb.
alpha == 0 ) {
1986 if ( rgb.
alpha < 255 ) {
1989 int minDistance = 9999;
1990 for(
int i=0; i<
sizeof(SYSTEM_PALETTE_SG6)/
sizeof(
RGBi); ++i ) {
1995 colorIndex = SYSTEM_PALETTE_SG6[i].index;
2000 block[x][y] = colorIndex;
2010 _source += ( _width - 8 ) * _depth;
2014 for (y = 0; y < 3; ++y) {
2015 for (x = 0; x < 2; ++x) {
2020 memset( colorCount, 0, 4 *
sizeof(
int ) );
2022 for( y2 = 0; y2 < 4; ++y2 ) {
2023 for( x2 = 0; x2 < 4; ++x2 ) {
2024 colorCount[block[4*x+x2][4*y+y2]]++;
2028 int colorCountMax = 0;
2031 for( i = 0; i<4; ++i ) {
2032 if ( colorCount[i] > colorCountMax ) {
2033 colorCountMax = colorCount[i];
2038 sampled_block[x][y] = colorIndex;
2048 int min_sg6_block_distance = 9999;
2049 int min_sg6_block_number = 0;
2051 for( i=0; i<256; ++i ) {
2052 int absoluteDistance =
2054 pow2( sampled_block[0][0] - sg6_blocks[i][5] ) +
2055 pow2( sampled_block[1][0] - sg6_blocks[i][4] ) +
2056 pow2( sampled_block[0][1] - sg6_blocks[i][3] ) +
2057 pow2( sampled_block[1][1] - sg6_blocks[i][2] ) +
2058 pow2( sampled_block[0][2] - sg6_blocks[i][1] ) +
2059 pow2( sampled_block[1][2] - sg6_blocks[i][0] )
2062 int diagonalDistance =
2064 pow2( sampled_block[0][0] - sg6_blocks[i][5] ) +
2065 pow2( sampled_block[0][1] - sg6_blocks[i][3] ) +
2066 pow2( sampled_block[1][1] - sg6_blocks[i][2] ) +
2067 pow2( sampled_block[1][2] - sg6_blocks[i][0] )
2070 pow2( sampled_block[1][0] - sg6_blocks[i][4] ) +
2071 pow2( sampled_block[1][1] - sg6_blocks[i][2] ) +
2072 pow2( sampled_block[1][2] - sg6_blocks[i][0] ) +
2073 pow2( sampled_block[0][2] - sg6_blocks[i][1] )
2079 if ( (absoluteDistance * diagonalDistance) < min_sg6_block_distance ) {
2080 min_sg6_block_distance = (absoluteDistance * diagonalDistance);
2081 min_sg6_block_number = i;
2088 return 0x80 | min_sg6_block_number;
2092static Variable * c6847_image_converter_sg6(
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 ) {
2095 (void)!_transparent_color;
2099 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
2101 if ( _frame_width % 2 ) {
2102 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
2107 if ( _height % 2 ) {
2108 _height = ( ( ( _height - 1 ) / 12 ) - 1 ) * 12;
2110 if ( _frame_height % 2 ) {
2111 _frame_height = ( ( ( _frame_height - 1 ) / 12 ) - 1 ) * 12;
2115 image_converter_asserts( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8, 12 );
2121 if (paletteColorCount > 5) {
2127 SYSTEM_PALETTE = &SYSTEM_PALETTE_SG6[0];
2129 commonPalette =
palette_match( palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE_SG6) /
sizeof(
RGBi) );
2134 adilinepalette(
"CPMS:%d", (
int)(
sizeof(SYSTEM_PALETTE_SG6) /
sizeof(
RGBi)), SYSTEM_PALETTE );
2144 char * buffer =
malloc ( bufferSize );
2145 memset( buffer, 0, bufferSize );
2148 int image_x, image_y;
2154 int offset, offsetc, bitmask;
2159 *(buffer) = _frame_width;
2160 *(buffer+1) = _frame_height / 12;
2163 _source += ( ( _offset_y * (_width>>3) ) + _offset_x ) * _depth;
2168 for (image_y = 0; image_y < _frame_height; image_y+=12) {
2169 for (image_x = 0; image_x < _frame_width; image_x+=8) {
2173 offset = ( ( image_y / 12 ) * ( _frame_width >> 3 ) ) + ( image_x >> 3 );
2175 int colorIndex = c6847_image_converter_sg6_block( _environment, _source, _width, _depth );
2178 *(buffer + 3 +
offset) = colorIndex;
2182 _source += 8 * _depth;
2186 _source += 12 * _width * _depth;
2187 _source -= _frame_width * _depth;
2207static int sg8_blocks[256*8][8] = {
2208 {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, {0,0,0,0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7,0,0,7,7}, {0,0,7,7,0,0,7,7}, {7,0,7,7,0,0,7,7}, {0,7,7,7,0,0,7,7}, {7,7,7,7,0,0,7,7}, {0,0,0,0,7,0,7,7}, {7,0,0,0,7,0,7,7}, {0,7,0,0,7,0,7,7}, {7,7,0,0,7,0,7,7}, {0,0,7,0,7,0,7,7}, {7,0,7,0,7,0,7,7}, {0,7,7,0,7,0,7,7}, {7,7,7,0,7,0,7,7}, {0,0,0,7,7,0,7,7}, {7,0,0,7,7,0,7,7}, {0,7,0,7,7,0,7,7}, {7,7,0,7,7,0,7,7}, {0,0,7,7,7,0,7,7}, {7,0,7,7,7,0,7,7}, {0,7,7,7,7,0,7,7}, {7,7,7,7,7,0,7,7}, {0,0,0,0,0,7,7,7}, {7,0,0,0,0,7,7,7}, {0,7,0,0,0,7,7,7}, {7,7,0,0,0,7,7,7}, {0,0,7,0,0,7,7,7}, {7,0,7,0,0,7,7,7}, {0,7,7,0,0,7,7,7}, {7,7,7,0,0,7,7,7}, {0,0,0,7,0,7,7,7}, {7,0,0,7,0,7,7,7}, {0,7,0,7,0,7,7,7}, {7,7,0,7,0,7,7,7}, {0,0,7,7,0,7,7,7}, {7,0,7,7,0,7,7,7}, {0,7,7,7,0,7,7,7}, {7,7,7,7,0,7,7,7}, {0,0,0,0,7,7,7,7}, {7,0,0,0,7,7,7,7}, {0,7,0,0,7,7,7,7}, {7,7,0,0,7,7,7,7}, {0,0,7,0,7,7,7,7}, {7,0,7,0,7,7,7,7}, {0,7,7,0,7,7,7,7}, {7,7,7,0,7,7,7,7}, {0,0,0,7,7,7,7,7}, {7,0,0,7,7,7,7,7}, {0,7,0,7,7,7,7,7}, {7,7,0,7,7,7,7,7}, {0,0,7,7,7,7,7,7}, {7,0,7,7,7,7,7,7}, {0,7,7,7,7,7,7,7}, {7,7,7,7,7,7,7,7}
2218static int c6847_image_converter_sg8_block(
Environment * _environment,
char * _source,
int _width,
int _depth ) {
2223 int sampled_block[2][3];
2224 int sg8_blocks_distance[256];
2226 memset(block, 0, 8 * 12 *
sizeof(
int));
2228 for (y = 0; y < 12; ++y) {
2229 for (x = 0; x < 8; ++x) {
2235 rgb.
green = *(_source + 1);
2236 rgb.
blue = *(_source + 2);
2238 rgb.
alpha = *(_source + 3);
2242 if ( rgb.
alpha == 0 ) {
2252 if ( rgb.
alpha < 255 ) {
2255 int minDistance = 9999;
2256 for(
int i=0; i<
sizeof(SYSTEM_PALETTE_SG8)/
sizeof(
RGBi); ++i ) {
2260 colorIndex = SYSTEM_PALETTE_SG8[i].index;
2265 block[x][y] = colorIndex;
2275 _source += ( _width - 8 ) * _depth;
2279 for (y = 0; y < 4; ++y) {
2280 for (x = 0; x < 2; ++x) {
2285 memset( colorCount, 0, 6 *
sizeof(
int ) );
2287 for( y2 = 0; y2 < 3; ++y2 ) {
2288 for( x2 = 0; x2 < 2; ++x2 ) {
2289 colorCount[block[4*x+x2][3*y+y2]]++;
2293 int colorCountMax = 0;
2296 for( i = 0; i<4; ++i ) {
2297 if ( colorCount[i] > colorCountMax ) {
2298 colorCountMax = colorCount[i];
2303 sampled_block[x][y] = colorIndex;
2313 int min_sg8_block_distance = 9999;
2314 int min_sg8_block_number = 0;
2316 for( i=0; i<256*8; ++i ) {
2317 int absoluteDistance =
2319 pow2( sampled_block[0][0] - sg8_blocks[i][5] ) +
2320 pow2( sampled_block[1][0] - sg8_blocks[i][4] ) +
2321 pow2( sampled_block[0][1] - sg8_blocks[i][3] ) +
2322 pow2( sampled_block[1][1] - sg8_blocks[i][2] ) +
2323 pow2( sampled_block[0][2] - sg8_blocks[i][1] ) +
2324 pow2( sampled_block[1][2] - sg8_blocks[i][0] )
2327 int diagonalDistance =
2329 pow2( sampled_block[0][0] - sg8_blocks[i][5] ) +
2330 pow2( sampled_block[0][1] - sg8_blocks[i][3] ) +
2331 pow2( sampled_block[1][1] - sg8_blocks[i][2] ) +
2332 pow2( sampled_block[1][2] - sg8_blocks[i][0] )
2335 pow2( sampled_block[1][0] - sg8_blocks[i][4] ) +
2336 pow2( sampled_block[1][1] - sg8_blocks[i][2] ) +
2337 pow2( sampled_block[1][2] - sg8_blocks[i][0] ) +
2338 pow2( sampled_block[0][2] - sg8_blocks[i][1] )
2344 if ( (absoluteDistance * diagonalDistance) < min_sg8_block_distance ) {
2345 min_sg8_block_distance = (absoluteDistance * diagonalDistance);
2346 min_sg8_block_number = i;
2353 return 0x80 | min_sg8_block_number;
2357static Variable * c6847_image_converter_sg8(
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 ) {
2360 (void)!_transparent_color;
2364 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
2366 if ( _frame_width % 2 ) {
2367 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
2372 if ( _height % 2 ) {
2373 _height = ( ( ( _height - 1 ) / 12 ) - 1 ) * 12;
2375 if ( _frame_height % 2 ) {
2376 _frame_height = ( ( ( _frame_height - 1 ) / 12 ) - 1 ) * 12;
2380 image_converter_asserts( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8, 12 );
2386 if (paletteColorCount > 5) {
2392 SYSTEM_PALETTE = &SYSTEM_PALETTE_SG6[0];
2394 commonPalette =
palette_match( palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE_SG6) /
sizeof(
RGBi) );
2399 adilinepalette(
"CPMS:%d", (
int)(
sizeof(SYSTEM_PALETTE_SG6) /
sizeof(
RGBi)), SYSTEM_PALETTE );
2409 char * buffer =
malloc ( bufferSize );
2410 memset( buffer, 0, bufferSize );
2413 int image_x, image_y;
2419 int offset, offsetc, bitmask;
2424 *(buffer) = _frame_width;
2425 *(buffer+1) = _frame_height / 12;
2428 _source += ( ( _offset_y * (_width>>3) ) + _offset_x ) * _depth;
2433 for (image_y = 0; image_y < _frame_height; image_y+=12) {
2434 for (image_x = 0; image_x < _frame_width; image_x+=8) {
2438 offset = ( ( image_y / 12 ) * ( _frame_width >> 3 ) ) + ( image_x >> 3 );
2440 int colorIndex = c6847_image_converter_sg8_block( _environment, _source, _width, _depth );
2443 *(buffer + 3 +
offset) = colorIndex;
2447 _source += 8 * _depth;
2451 _source += 12 * _width * _depth;
2452 _source -= _frame_width * _depth;
2472Variable *
c6847_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 ) {
2479 return c6847_image_converter_sg4( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
2483 return c6847_image_converter_sg6( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
2487 return c6847_image_converter_sg8( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
2498 return c6847_image_converter_multicolor_mode_standard( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
2507 return c6847_image_converter_bitmap_mode_standard( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
2517static void c6847_load_image_address_to_register(
Environment * _environment,
char * _register,
Resource * _source,
char * _sequence,
char * _frame,
int _frame_size,
int _frame_count ) {
2519 if ( !_sequence && !_frame ) {
2537 if ( strlen(_sequence) == 0 ) {
2543 if ( strlen(_frame) == 0 ) {
2552 if ( strlen(_frame) == 0 ) {
2566void c6847_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 ) {
2569 deploy( blitimage, src_hw_6847_blit_image_asm );
2571 if ( _source_count > 2 ) {
2580 outline0(
"STY BLITIMAGEBLITADDR" );
2582 if ( _source_count > 0 ) {
2584 resource.
realName = strdup( _sources[0] );
2587 c6847_load_image_address_to_register( _environment,
"BLITTMPPTR", &resource, _sequence, _frame, _frame_size, _frame_count );
2593 if ( _source_count > 1 ) {
2595 resource.
realName = strdup( _sources[1] );
2598 c6847_load_image_address_to_register( _environment,
"BLITTMPPTR2", &resource, _sequence, _frame, _frame_size, _frame_count );
2609 outline1(
"LDA #$%2.2x", ( _flags & 0xff ) );
2611 outline1(
"LDA #$%2.2x", ( (_flags>>8) & 0xff ) );
2621 deploy( putimage, src_hw_6847_put_image_asm );
2629 if ( _frame_size ) {
2630 if ( !_sequence && !_frame ) {
2634 if ( strlen(_sequence) == 0 ) {
2640 if ( strlen(_frame) == 0 ) {
2649 if ( strlen(_frame) == 0 ) {
2684 memset( buffer, 0,
size );
2687 *(buffer+1) = _height;
2699 int size = calculate_images_size( _environment, _frames, _width, _height, _mode, 0 );
2700 int frameSize =
c6847_image_size( _environment, _width, _height, _mode, 0 );
2709 memset( buffer, 0,
size );
2711 *(buffer) = _frames;
2712 *(buffer+1) = ( _width & 0xff );
2713 *(buffer+2) = ( _width >> 8 ) & 0xff;
2714 for(
int i=0; i<_frames; ++i ) {
2715 *(buffer+3+(i*frameSize)) = _width;
2716 *(buffer+3+(i*frameSize)+1) = _height;
2730 int size2 = calculate_sequence_size( _environment, _sequences, _frames, _width, _height, _mode, 0 );
2731 int size = calculate_images_size( _environment, _frames, _width, _height, _mode, 0 );
2732 int frameSize =
c6847_image_size( _environment, _width, _height, _mode, 0 );
2740 char * buffer =
malloc ( size2 );
2741 memset( buffer, 0, size2 );
2743 *(buffer) = _frames;
2744 *(buffer+1) = _width;
2745 *(buffer+2) = _sequences;
2746 for(
int i=0; i<(_frames * _sequences); ++i ) {
2747 *(buffer+3+(i*frameSize)) = _width;
2748 *(buffer+3+(i*frameSize)+1) = _height;
2753 result->
size = size2;
2760void c6847_get_image(
Environment * _environment,
char * _image,
char * _x,
char * _y,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
int _palette ) {
2763 deploy( getimage, src_hw_6847_get_image_asm );
2768 if ( strlen(_sequence) == 0 ) {
2770 outline1(
"LDX #OFFSETS%4.4x", _frame_count * _frame_size );
2779 if ( strlen(_frame) == 0 ) {
2781 outline1(
"LDX #OFFSETS%4.4x", _frame_size );
2793 if ( strlen(_frame) == 0 ) {
2795 outline1(
"LDX #OFFSETS%4.4x", _frame_size );
2810 outline1(
"LDA #$%2.2x", _palette );
2852void c6847_slice_image(
Environment * _environment,
char * _image,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
char * _destination ) {
2860 SYSTEM_PALETTE = &SYSTEM_PALETTE_ALTERNATE[_environment->
paletteSelected][0];
2862 memcpy( _palette,
palette_match( _palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE) /
sizeof(
RGBi) ), paletteColorCount *
sizeof(
RGBi ) );
2864 int uniquePaletteCount = 0;
2868 return uniquePaletteCount;
2877 if ( strlen(_sequence) == 0 ) {
2879 outline1(
"LDX #OFFSETS%4.4x", _frame_count * _frame_size );
2888 if ( strlen(_frame) == 0 ) {
2890 outline1(
"LDX #OFFSETS%4.4x", _frame_size );
2902 if ( strlen(_frame) == 0 ) {
2904 outline1(
"LDX #OFFSETS%4.4x", _frame_size );
2923 if ( strcmp( _direction,
"#FLIPIMAGEDIRECTION0001" ) == 0 || strcmp( _direction,
"#FLIPIMAGEDIRECTION0003" ) == 0 ) {
2924 c6847_load_image_address_to_register( _environment,
"TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
2925 deploy( flipimagex, src_hw_6847_flip_image_x_asm );
2931 c6847_load_image_address_to_register( _environment,
"TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
2932 deploy( flipimagex, src_hw_6847_flip_image_x_asm );
2941 if ( strcmp( _direction,
"#FLIPIMAGEDIRECTION0002" ) == 0 || strcmp( _direction,
"#FLIPIMAGEDIRECTION0003" ) == 0 ) {
2942 c6847_load_image_address_to_register( _environment,
"TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
2943 deploy( flipimagey, src_hw_6847_flip_image_y_asm );
2949 c6847_load_image_address_to_register( _environment,
"TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
2950 deploy( flipimagey, src_hw_6847_flip_image_y_asm );
2963 deploy( screen, src_hw_6847_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
void c6847_bitmap_disable(Environment *_environment)
void c6847_sprite_enable(Environment *_environment, char *_sprite)
void c6847_bitmap_enable(Environment *_environment, int _width, int _height, int _colors)
void c6847_tilemap_enable(Environment *_environment, int _width, int _height, int _colors, int _tile_width, int _tile_height)
void c6847_put_tile(Environment *_environment, char *_tile, char *_x, char *_y)
int lastUsedSlotInCommonPalette
void c6847_scroll(Environment *_environment, int _dx, int _dy)
void c6847_tile_at(Environment *_environment, char *_x, char *_y, char *_result)
void c6847_hit(Environment *_environment, char *_sprite_mask, char *_result)
VIC-II: emit code to check for collision
Variable * c6847_new_sequence(Environment *_environment, int _sequences, int _frames, int _width, int _height, int _mode)
void c6847_textmap_at(Environment *_environment, char *_address)
void c6847_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)
int c6847_palette_extract(Environment *_environment, char *_data, int _width, int _height, int _depth, int _flags, RGBi *_palette)
void c6847_put_tiles(Environment *_environment, char *_tile, char *_x, char *_y, char *_w, char *_h)
void c6847_sprite_at(Environment *_environment, char *_sprite, char *_x, char *_y)
void c6847_screen_rows(Environment *_environment, char *_rows)
int c6847_image_size(Environment *_environment, int _width, int _height, int _mode, int _transparent)
void c6847_put_image(Environment *_environment, Resource *_source, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_flags)
void c6847_sprite_data_from(Environment *_environment, char *_sprite, char *_address)
void c6847_slice_image(Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
void c6847_sprite_data_set(Environment *_environment, char *_sprite, char *_address)
void c6847_hscroll_line(Environment *_environment, int _direction, int _overlap)
void c6847_back(Environment *_environment)
void c6847_sprite_common_color(Environment *_environment, char *_index, char *_common_color)
VIC-II: emit code to change common sprite's color
void c6847_flip_image(Environment *_environment, Resource *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_direction)
void c6847_tiles_at(Environment *_environment, char *_address)
void c6847_sprite_color(Environment *_environment, char *_sprite, char *_color)
void c6847_initialization(Environment *_environment)
void c6847_calculate_sequence_frame_offset(Environment *_environment, char *_offset, char *_sequence, char *_frame, int _frame_size, int _frame_count)
void c6847_use_tileset(Environment *_environment, char *_tileset)
Variable * c6847_new_image(Environment *_environment, int _width, int _height, int _mode)
void c6847_sprite_priority(Environment *_environment, char *_sprite, char *_priority)
void c6847_tiles_get(Environment *_environment, char *_result)
void c6847_sprite_multicolor(Environment *_environment, char *_sprite)
void c6847_sprite_expand_vertical(Environment *_environment, char *_sprite)
void c6847_screen_columns(Environment *_environment, char *_columns)
void c6847_next_raster(Environment *_environment)
VIC-II: emit code to wait for next raster irq
int c6847_screen_mode_enable(Environment *_environment, ScreenMode *_screen_mode)
void c6847_sprite_compress_vertical(Environment *_environment, char *_sprite)
void c6847_pset_int(Environment *_environment, int _x, int _y, int *_c)
void c6847_sprite_compress_horizontal(Environment *_environment, char *_sprite)
void c6847_background_color(Environment *_environment, char *_index, char *_background_color)
VIC-II: emit code to change background color
Variable * c6847_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 console_calculate_vars(Environment *_environment)
void c6847_get_width(Environment *_environment, char *_result)
void c6847_bitmap_at(Environment *_environment, char *_address)
void c6847_cls(Environment *_environment)
Variable * c6847_get_raster_line(Environment *_environment)
void c6847_collision(Environment *_environment, char *_sprite_mask, char *_result)
VIC-II: emit code to check for collision
void c6847_colormap_at(Environment *_environment, char *_address)
void c6847_border_color(Environment *_environment, char *_border_color)
VIC-II: emit code to change border color
void c6847_next_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
VIC-II: emit code to wait for next raster irq at different position
void c6847_cls_box(Environment *_environment, char *_x1, char *_y1, char *_w, char *_h)
void c6847_horizontal_scroll(Environment *_environment, char *_displacement)
void c6847_get_image(Environment *_environment, char *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, int _palette)
void c6847_text(Environment *_environment, char *_text, char *_text_size, int _raw)
Variable * c6847_new_images(Environment *_environment, int _frames, int _width, int _height, int _mode)
void c6847_sprite_disable(Environment *_environment, char *_sprite)
void c6847_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
VIC-II: emit code to set raster irq
void c6847_pset_vars(Environment *_environment, char *_x, char *_y, char *_c)
void c6847_screen_off(Environment *_environment)
void c6847_cline(Environment *_environment, char *_characters)
void c6847_pget_color_vars(Environment *_environment, char *_x, char *_y, char *_result)
void c6847_sprite_expand_horizontal(Environment *_environment, char *_sprite)
void c6847_finalization(Environment *_environment)
void c6847_screen_on(Environment *_environment)
void c6847_scroll_text(Environment *_environment, int _direction, int _overlap)
void c6847_bank_select(Environment *_environment, int _bank)
void c6847_get_height(Environment *_environment, char *_result)
void console_calculate(Environment *_environment)
void c6847_sprite_monocolor(Environment *_environment, char *_sprite)
void c6847_hscroll_screen(Environment *_environment, int _direction, int _overlap)
void c6847_vertical_scroll(Environment *_environment, char *_displacement)
void c6847_move_tiles(Environment *_environment, char *_tile, char *_x, char *_y)
void c6847_screen(Environment *_environment, char *_x, char *_y, char *_c)
#define BITMAP_MODE_RESOLUTION6
#define BITMAP_MODE_RESOLUTION2
#define BITMAP_MODE_COLOR2
#define BITMAP_MODE_COLOR1
#define TILEMAP_MODE_SEMIGRAPHICS6
#define TILEMAP_MODE_INTERNAL
#define BITMAP_MODE_COLOR6
#define TILEMAP_MODE_EXTERNAL
#define BITMAP_MODE_COLOR3
#define TILEMAP_MODE_SEMIGRAPHICS8
#define TILEMAP_MODE_SEMIGRAPHICS4
#define BITMAP_MODE_RESOLUTION3
#define TILEMAP_MODE_SEMIGRAPHICS12
#define BITMAP_MODE_RESOLUTION1
#define TILEMAP_MODE_SEMIGRAPHICS24
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)
void image_converter_asserts_free_height(Environment *_environment, int _width, int _height, int _offset_x, int _offset_y, int *_frame_width, int *_frame_height, int _modulo_x)
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.
Variable * variable_store(Environment *_environment, char *_destination, unsigned int _value)
Store a direct value to a variable.
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)
Variable * variable_store_buffer(Environment *_environment, char *_destination, unsigned char *_buffer, int _size, int _at)
void plot(Environment *_environment, char *_x, char *_y, char *_c, int _preserve_color)
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
VestigialConfig vestigialConfig
unsigned char * valueBuffer
RGBi originalPalette[MAX_PALETTE]
struct _ScreenMode ScreenMode
#define CRITICAL_IMAGE_CONVERTER_TOO_COLORS(f)
struct _Resource Resource
struct _RGBi RGBi
Structure to store color components (red, green and blue).
#define adilineendbitmap()
#define WARNING_SCREEN_MODE(v1)
struct _Variable Variable
Structure of a single variable.
struct _Environment Environment
Structure of compilation environment.
#define adiline3(s, a, b, c)
#define deploy_preferred(s, e)
#define SCREEN_MODE_DEFINE(_id, _bitmap, _width, _height, _colors, _tile_width, _tile_height, _description)
#define CRITICAL_NEW_IMAGES_UNSUPPORTED_MODE(f)
#define CRITICAL_SCREEN_UNSUPPORTED(v)
#define WARNING_IMAGE_CONVERTER_UNSUPPORTED_MODE(f)
#define adilinepalette(s, c, p)
#define FONT_SCHEMA_ASCII
#define adilinebeginbitmap(s)
struct _CopperList CopperList
#define CRITICAL_NEW_IMAGE_UNSUPPORTED_MODE(f)
#define CRITICAL_BLIT_TOO_MUCH_SOURCES()