40static RGBi SYSTEM_PALETTE[] = {
41 { 0x00, 0x00, 0x00, 0xFF, 0,
"BLACK" },
42 { 0x22, 0x22, 0x22, 0xFF, 1,
"LIGHT BLACK" },
43 { 0x00, 0x00, 0x88, 0xFF, 2,
"DARK BLUE" },
44 { 0x00, 0x00, 0xFF, 0xFF, 3,
"LIGHT BLUE" },
45 { 0x00, 0x88, 0x00, 0xFF, 4,
"DARK GREEN" },
46 { 0x00, 0xFF, 0x00, 0xFF, 5,
"LIGHT GREEN" },
47 { 0x00, 0x88, 0x88, 0xFF, 6,
"DARK CYAN" },
48 { 0x00, 0xFF, 0xFF, 0xFF, 7,
"LIGHT CYAN" },
49 { 0x88, 0x00, 0x00, 0xFF, 8,
"DARK RED" },
50 { 0xFF, 0x00, 0x00, 0xFF, 9,
"LIGHT RED" },
51 { 0x80, 0x40, 0x80, 0xFF, 10,
"DARK PURPLE" },
52 { 0xFF, 0x80, 0xFF, 0xFF, 11,
"LIGHT PURPLE" },
53 { 0x80, 0x80, 0x40, 0xFF, 12,
"DARK YELLOW" },
54 { 0xFF, 0xFF, 0x80, 0xFF, 13,
"LIGHT YELLOW" },
55 { 0x80, 0x80, 0x80, 0xFF, 14,
"DARK WHITE" },
56 { 0xFF, 0xFF, 0xFF, 0xFF, 15,
"LIGHT WHITE" },
59static RGBi * commonPalette;
68 unsigned int minDistance = 0xffff;
78 return &SYSTEM_PALETTE[colorIndex];
87 return 3 + ( ( _width >> 3 ) * _height ) + 1;
90 return 3 + ( ( _width >> 3 ) * _height ) + ( ( _width >> 3 ) * ( _height >> 3 ) );
96static Variable * vcdz_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 ) {
99 (void)!_transparent_color;
105 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
107 if ( _frame_width % 8 ) {
108 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
116 if (paletteColorCount > 2) {
122 commonPalette =
palette_match( palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE) /
sizeof(
RGBi) );
137 char * buffer =
malloc ( bufferSize );
138 memset( buffer, 0, bufferSize );
141 int image_x, image_y;
152 *(buffer) = (_frame_width & 0XFF );
153 *(buffer+1) = ( (_frame_width>>8) & 0XFF );
154 *(buffer+2) = _frame_height;
156 _source += ( ( _offset_y * _width ) + _offset_x ) * _depth;
163 for (image_y = 0; image_y < _frame_height; ++image_y) {
164 for (image_x = 0; image_x < _frame_width; ++image_x) {
168 rgb.
green = *(_source + 1);
169 rgb.
blue = *(_source + 2);
171 rgb.
alpha = *(_source + 3);
175 if ( rgb.
alpha == 0 ) {
181 int minDistance = 9999;
182 for(
int i=0; i<2; ++i ) {
186 colorIndex = commonPalette[i].index;
190 offset = ( image_y * ( _frame_width >> 3 ) ) + ( image_x >> 3 );
191 bitmask = 1 << ( 7 - (image_x & 0x7) );
193 if ( colorIndex == commonPalette[1].index) {
194 *( buffer +
offset + 3) |= bitmask;
196 *( buffer +
offset + 3) &= ~bitmask;
205 _source += ( _width - _frame_width ) * _depth;
211 *( buffer + 3 + ( ( _frame_width >> 3 ) * _frame_height ) ) = ( commonPalette[1].index << 4 ) | commonPalette[0].index;
235static void vdcz_image_converter_tile(
Environment * _environment,
char * _source,
char * _dest,
int _width,
int _depth,
int _source_width ) {
238 memset(colorIndexesCount, 0,
COLOR_COUNT *
sizeof(
int ) );
247 for (
int y=0; y<8; ++y) {
248 for (
int x=0; x<8; ++x) {
252 memset( &rgb, 0,
sizeof(
RGBi ) );
259 rgb.
alpha = *(_source + 3);
263 if ( rgb.
alpha == 0 ) {
269 if ( rgb.
alpha < 255 ) {
273 ++colorIndexesCount[systemRgb->
index];
280 source += _depth * ( _source_width - 8 );
284 int colorBackground = 0;
285 int colorBackgroundMax = 0;
286 int colorForeground = 0;
287 int colorForegroundMax = 0;
289 if ( colorIndexesCount[xx] > colorBackgroundMax ) {
290 colorBackground = xx;
291 colorBackgroundMax = colorIndexesCount[xx];
295 colorIndexesCount[colorBackground] = 0;
298 if ( colorIndexesCount[xx] > colorForegroundMax ) {
299 colorForeground = xx;
300 colorForegroundMax = colorIndexesCount[xx];
305 if ( colorForeground == 0 ) {
306 colorForeground = colorBackground;
313 if ( colorForeground == colorBackground ) {
314 colorForeground = ( colorBackground == 0 ) ? 1 : 0;
317 *( _dest ) = ( colorForeground << 4 ) | colorBackground ;
332static void vdcz_image_converter_tiles(
Environment * _environment,
char * _source,
char * _dest,
int _width,
int _height,
int _depth,
int _source_width ) {
334 int bitmapSize = ( _width>>3 ) * _height;
335 int colormapSize = ( _width>>3 ) * (_height>>3);
337 char * destBitmap = _dest;
338 char * destColormap = _dest + bitmapSize;
340 memset( _dest, 0, bitmapSize + colormapSize );
344 for(
int y=0; y<_height; y+=8 ) {
345 for(
int x=0; x<_width; x+=8 ) {
347 char *
source = _source + ( ( y * _source_width ) + x ) * _depth;
350 vdcz_image_converter_tile( _environment,
source, &tile, _width, _depth, _source_width );
352 int offset = ((y>>3) * 8 *( _width >> 3 ) ) + ((x>>3) * 8) + ((y) & 0x07);
354 destColormap[
offset] = tile;
366 for (
int image_y = 0; image_y < _height; ++image_y) {
367 for (
int image_x = 0; image_x < _width; ++image_x) {
369 int offsetColor = ((image_y>>3) * 8 *( _width >> 3 ) ) + ((image_x>>3) * 8) + ((image_y) & 0x07);
373 rgb.
green = *(_source + 1);
374 rgb.
blue = *(_source + 2);
376 rgb.
alpha = *(_source + 3);
380 if ( rgb.
alpha == 0 ) {
386 int minDistance = 9999;
387 for(
int i=0; i<2; ++i ) {
391 colorIndex = rgb.
index;
395 offset = ( image_y * ( _width >> 3 ) ) + ( image_x >> 3 );
396 bitmask = 1 << ( 7 - (image_x & 0x7) );
398 if ( colorIndex != ( ( destColormap[offsetColor] >> 4 ) & 0x0f ) ) {
399 *( destBitmap +
offset + 3) |= bitmask;
402 *( destBitmap +
offset + 3) &= ~bitmask;
403 adilinepixel( ( destColormap[offsetColor] >> 4 ) & 0x0f );
415static Variable * vdcz_image_converter_bitmap_mode_multicolor(
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 ) {
417 image_converter_asserts( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8, 8 );
421 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
423 if ( _frame_width % 8 ) {
424 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
430 _height = ( ( ( _height - 1 ) / 8 ) - 1 ) * 8;
432 if ( _frame_height % 8 ) {
433 _frame_height = ( ( ( _frame_height - 1 ) / 8 ) - 1 ) * 8;
441 if (paletteColorCount > 16) {
447 commonPalette =
palette_match( palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE) /
sizeof(
RGBi) );
464 char * buffer =
malloc ( bufferSize );
465 memset( buffer, 0, bufferSize );
468 int image_x, image_y;
479 *(buffer) = ( _frame_width & 0xff );
480 *(buffer+1) = ( (_frame_width>>8) & 0xff );
481 *(buffer+2) = _frame_height;
483 _source += ( ( _offset_y * _width ) + _offset_x ) * 3;
485 vdcz_image_converter_tiles( _environment, _source, buffer+3, _frame_width, _frame_height, _depth, _width );
559 outline1(
"LD A, $%2.2x", _background_color & 0x0f );
584 outline1(
"LD A, (%s)", _background_color );
608 outline1(
"LD A, (%s)", _background_color );
639 outline1(
"LD (%s), A", _background_color );
711static int rgbConverterFunction(
int _red,
int _green,
int _blue ) {
714 unsigned int minDistance = 0xffffffff;
722 for (j = 0; j <
sizeof(SYSTEM_PALETTE)/
sizeof(
RGBi); ++j) {
750 int horizontalCharactersPositions = 127;
751 int horizontalVerticalSyncWidth = 0x49;
752 int horizontalSyncPosition = 102;
753 int totalNumberOfScreenRows = 39;
754 int verticalFineAdjustment = 0;
755 int numberOfVisibleScreenRows;
756 int verticalSyncPosition = 32;
757 int interlaceModeControl = 0;
758 int totalScanLinePerCharacter = 7;
759 int verticalSmoothScrollingAndControl = 8;
760 int horizontalSmoothScrollingAndControl = 0;
761 int addressIncrementPerRowOfChars = 0;
762 int characterPatternAddress = 1;
764 switch( _screen_mode->
id ) {
777 horizontalSmoothScrollingAndControl = 0x47;
796 horizontalSmoothScrollingAndControl = 0x87;
815 horizontalSmoothScrollingAndControl = 0xC7;
839 horizontalCharactersPositions = 0x7e;
840 horizontalVerticalSyncWidth = 0x89;
841 horizontalSyncPosition = 0x66;
842 totalNumberOfScreenRows = 0x4c;
843 verticalFineAdjustment = 6;
844 numberOfVisibleScreenRows = 0x4c;
845 verticalSyncPosition = 0x47;
846 interlaceModeControl = 3;
847 totalScanLinePerCharacter = 6;
848 verticalSmoothScrollingAndControl = 0;
849 horizontalSmoothScrollingAndControl = 0x87;
850 addressIncrementPerRowOfChars = 0;
851 characterPatternAddress = 16;
869 horizontalCharactersPositions = 0x7e;
870 horizontalVerticalSyncWidth = 0x89;
871 horizontalSyncPosition = 0x66;
872 totalNumberOfScreenRows = 0x4c;
873 verticalFineAdjustment = 6;
874 numberOfVisibleScreenRows = 0x4c;
875 verticalSyncPosition = 0x47;
876 interlaceModeControl = 3;
877 totalScanLinePerCharacter = 6;
878 verticalSmoothScrollingAndControl = 0;
879 horizontalSmoothScrollingAndControl = 0xC7;
880 addressIncrementPerRowOfChars = 0;
881 characterPatternAddress = 16;
918 outline1(
"LD A, $%2.2x", horizontalCharactersPositions );
961 outline1(
"LD A, $%2.2x", horizontalSyncPosition );
984 outline1(
"LD A, $%2.2x", horizontalVerticalSyncWidth );
1021 outline1(
"LD A, $%2.2x", totalNumberOfScreenRows );
1055 outline1(
"LD A, $%2.2x", verticalFineAdjustment );
1074 outline1(
"LD A, $%2.2x", numberOfVisibleScreenRows );
1098 outline1(
"LD A, $%2.2x", verticalSyncPosition );
1144 outline1(
"LD A, $%2.2x", interlaceModeControl );
1192 outline1(
"LD A, $%2.2x", totalScanLinePerCharacter );
1304 outline0(
"LD A, (TEXTADDRESS+1)" );
1493 outline0(
"LD A, (COLORMAPADDRESS+1)" );
1498 outline0(
"LD A, (COLORMAPADDRESS)" );
1633 outline1(
"LD A, $%2.2x", verticalSmoothScrollingAndControl );
1731 outline1(
"LD A, $%2.2x", horizontalSmoothScrollingAndControl );
1795 outline1(
"LD A, $%2.2x", addressIncrementPerRowOfChars );
1862 outline1(
"OR $%2.2x", ( characterPatternAddress << 5 ) );
2126 deploy( vdczvars, src_hw_vdcz_vars_asm);
2127 deploy( vdczvarsGraphic, src_hw_vdcz_vars_graphic_asm );
2131 outline1(
"LD A, $%2.2x", ( *_c & 0xff ) );
2137 outline1(
"LD A, $%2.2x", ( _x & 0xff ) );
2139 outline1(
"LD A, $%2.2x", ( ( _x >> 8 ) & 0xff ) );
2141 outline1(
"LD A, $%2.2x", ( _y & 0xff ) );
2143 outline1(
"LD A, $%2.2x", ( ( _y >> 8 ) & 0xff ) );
2162 deploy( vdczvars, src_hw_vdcz_vars_asm);
2163 deploy( vdczvarsGraphic, src_hw_vdcz_vars_graphic_asm );
2187 deploy( vdczvars, src_hw_vdcz_vars_asm);
2188 deploy( vdczvarsGraphic, src_hw_vdcz_vars_graphic_asm );
2341 deploy( clsGraphic, src_hw_vdcz_cls_graphic_asm );
2344 deploy( clsText, src_hw_vdcz_cls_text_asm );
2353 deploy( clsBox, src_hw_vdcz_cls_box_asm );
2371 if ( _direction > 0 ) {
2372 deploy( vScrollTextDown, src_hw_vdcz_vscroll_text_down_asm );
2375 deploy( vScrollTextUp, src_hw_vdcz_vscroll_text_up_asm );
2383 deploy( vdczvars, src_hw_vdcz_vars_asm);
2384 deploy( textEncodedAt, src_hw_vdcz_text_at_asm );
2387 outline1(
"LD A, (%s)", _text_size);
2392 deploy( vdczvarsGraphic, src_hw_vdcz_vars_graphic_asm);
2393 deploy( vScroll, src_hw_vdcz_vscroll_asm );
2394 deploy( clsGraphic, src_hw_vdcz_cls_graphic_asm );
2395 deploy( textEncodedAtGraphicRaw, src_hw_vdcz_text_at_graphic_raw_asm );
2396 outline0(
"CALL TEXTATBITMAPMODERAW");
2398 deploy( vScrollTextUp, src_hw_vdcz_vscroll_text_up_asm );
2399 deploy( clsText, src_hw_vdcz_cls_text_asm );
2400 deploy( textEncodedAtTextRaw, src_hw_vdcz_text_at_text_raw_asm );
2401 outline0(
"CALL TEXTATTILEMODERAW");
2405 deploy( vdczvarsGraphic, src_hw_vdcz_vars_graphic_asm);
2406 deploy( vScroll, src_hw_vdcz_vscroll_asm );
2407 deploy( clsGraphic, src_hw_vdcz_cls_graphic_asm );
2408 deploy( textEncodedAtGraphic, src_hw_vdcz_text_at_graphic_asm );
2411 deploy( vScrollTextUp, src_hw_vdcz_vscroll_text_up_asm );
2412 deploy( clsText, src_hw_vdcz_cls_text_asm );
2413 deploy( textEncodedAtText, src_hw_vdcz_text_at_text_asm );
2423 deploy( vdczvars, src_hw_vdcz_vars_asm );
2576static RGBi * multicolorSpritePalette[2];
2581 deploy( clsText, src_hw_vdcz_cls_text_asm );
2589 copperList = copperList->
next;
2597 deploy( textHScroll, src_hw_vdcz_hscroll_text_asm );
2603 deploy( textHScroll, src_hw_vdcz_hscroll_text_asm );
2615 deploy( textCline, src_hw_vdcz_cline_asm );
2617 if ( _characters ) {
2618 outline1(
"LD A, (%s)", _characters);
2628Variable *
vdcz_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 ) {
2635 return vcdz_image_converter_bitmap_mode_standard( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
2640 return vdcz_image_converter_bitmap_mode_multicolor( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
2656static void vdcz_load_image_address_to_other_register(
Environment * _environment,
char * _register,
char * _source,
char * _sequence,
char * _frame,
int _frame_size,
int _frame_count ) {
2663 if ( strlen(_sequence) == 0 ) {
2667 outline1(
"LD A, (%s)", _sequence );
2672 outline1(
"LD HL, OFFSETS%4.4x", _frame_size * _frame_count );
2684 if ( strlen(_frame) == 0 ) {
2693 outline1(
"LD HL, OFFSETS%4.4x", _frame_size * _frame_count );
2710 if ( strlen(_frame) == 0 ) {
2719 outline1(
"LD HL, OFFSETS%4.4x", _frame_size );
2734 outline1(
"LD (%s), HL", _register );
2747 if ( strlen(_sequence) == 0 ) {
2751 outline1(
"LD A, (%s)", _sequence );
2756 outline1(
"LD HL, OFFSETS%4.4x", _frame_size * _frame_count );
2768 if ( strlen(_frame) == 0 ) {
2777 outline1(
"LD HL, OFFSETS%4.4x", _frame_size * _frame_count );
2794 if ( strlen(_frame) == 0 ) {
2803 outline1(
"LD HL, OFFSETS%4.4x", _frame_size );
2819static void vdcz_load_image_address_to_register(
Environment * _environment,
char * _register,
Resource * _source,
char * _sequence,
char * _frame,
int _frame_size,
int _frame_count ) {
2821 if ( !_sequence && !_frame ) {
2837 if ( strlen(_sequence) == 0 ) {
2840 outline1(
"LD A, (%s)", _sequence );
2846 if ( strlen(_frame) == 0 ) {
2861 if ( strlen(_frame) == 0 ) {
2875 outline1(
"LD (%s), HL", _register );
2882 deploy( vdczvars, src_hw_vdcz_vars_asm);
2883 deploy( vdczvarsGraphic, src_hw_vdcz_vars_graphic_asm );
2884 deploy( putimage, src_hw_vdcz_put_image_asm );
2890 if ( _frame_size ) {
2891 vdcz_load_image_address_to_register( _environment, NULL, _image, _sequence, _frame, _frame_size, _frame_count );
2908void vdcz_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 ) {
2910 deploy( vdczvars, src_hw_vdcz_vars_asm);
2911 deploy( vdczvarsGraphic, src_hw_vdcz_vars_graphic_asm );
2912 deploy( blitimage, src_hw_vdcz_blit_image_asm );
2914 if ( _source_count > 2 ) {
2921 outline0(
"LD (BLITIMAGEBLITTINGADDR), HL");
2924 if ( _source_count > 0 ) {
2926 resource.
realName = strdup( _sources[0] );
2928 vdcz_load_image_address_to_register( _environment,
"BLITTMPPTR", &resource, _sequence, _frame, _frame_size, _frame_count );
2934 if ( _source_count > 1 ) {
2936 resource.
realName = strdup( _sources[0] );
2938 vdcz_load_image_address_to_register( _environment,
"BLITTMPPTR2", &resource, _sequence, _frame, _frame_size, _frame_count );
2941 outline0(
"LD (BLITTMPPTR2), HL" );
2948 outline1(
"LD A, $%2.2x", ( _flags & 0xff ) );
2950 outline1(
"LD A, $%2.2x", ( (_flags>>8) & 0xff ) );
2959 deploy( vdczvarsGraphic, src_hw_vdcz_vars_graphic_asm );
2960 deploy( vbl, src_hw_vdcz_vbl_asm);
2997void vdcz_get_image(
Environment * _environment,
char * _image,
char * _x,
char * _y,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
int _palette ) {
2999 deploy( vdczvars, src_hw_vdcz_vars_asm);
3000 deploy( vdczvarsGraphic, src_hw_vdcz_vars_graphic_asm );
3001 deploy( getimage, src_hw_vdcz_get_image_asm );
3005 vdcz_load_image_address_to_other_register( _environment, NULL, _image, _sequence, _frame, _frame_size, _frame_count );
3009 outline1(
"LD A, $%2.2x", _palette );
3018 deploy( vdczvars, src_hw_vdcz_vars_asm);
3020 deploy( textHScroll, src_hw_vdcz_hscroll_text_asm );
3021 deploy( vScrollTextDown, src_hw_vdcz_vscroll_text_down_asm );
3022 deploy( vScrollTextUp, src_hw_vdcz_vscroll_text_up_asm );
3028 deploy( vdczvars, src_hw_vdcz_vars_asm);
3029 deploy( tiles, src_hw_vdcz_tiles_asm );
3039 deploy( vdczvars, src_hw_vdcz_vars_asm);
3040 deploy( tiles, src_hw_vdcz_tiles_asm );
3046 deploy( vdczvars, src_hw_vdcz_vars_asm);
3047 deploy( tiles, src_hw_vdcz_tiles_asm );
3053 deploy( vdczvars, src_hw_vdcz_vars_asm);
3054 deploy( tiles, src_hw_vdcz_tiles_asm );
3060 deploy( vdczvars, src_hw_vdcz_vars_asm);
3061 deploy( tiles, src_hw_vdcz_tiles_asm );
3073void vdcz_slice_image(
Environment * _environment,
char * _image,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
char * _destination ) {
3081 memcpy( _palette,
palette_match( _palette, paletteColorCount, SYSTEM_PALETTE,
sizeof(SYSTEM_PALETTE) /
sizeof(
RGBi) ), paletteColorCount *
sizeof(
RGBi ) );
3083 int uniquePaletteCount = 0;
3087 return uniquePaletteCount;
3093 deploy( screen, src_hw_vdcz_screen_asm);
void cpu_store_16bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 16 bit
void cpu_move_16bit(Environment *_environment, char *_source, char *_destination)
CPU 6309: emit code to move 16 bit
void cpu_store_8bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 8 bit
int lastUsedSlotInCommonPalette
#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.
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.
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 color(Environment *_environment, int _index, int _shade)
Emit ASM code for instruction COLOR [int], [int].
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]
#define BITMAP_MODE_MULTICOLOR
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 adilinepalette(s, c, p)
#define adilinebeginbitmap(s)
struct _CopperList CopperList
#define CRITICAL_BLIT_TOO_MUCH_SOURCES()
void vdcz_slice_image(Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
void vdcz_hit(Environment *_environment, char *_sprite_mask, char *_result)
VDCZ: emit code to check for collision
void vdcz_horizontal_scroll(Environment *_environment, char *_displacement)
void vdcz_sprite_data_set(Environment *_environment, char *_sprite, char *_address)
void vdcz_colormap_at(Environment *_environment, char *_address)
void vdcz_screen_rows(Environment *_environment, char *_rows)
void vdcz_textmap_at(Environment *_environment, char *_address)
void vdcz_put_tile(Environment *_environment, char *_tile, char *_x, char *_y)
void vdcz_next_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
VDCZ: emit code to wait for next raster irq at different position
void vdcz_finalization(Environment *_environment)
void vdcz_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 vdcz_sprite_monocolor(Environment *_environment, char *_sprite)
Variable * vdcz_new_sequence(Environment *_environment, int _sequences, int _frames, int _width, int _height, int _mode)
void vdcz_scroll(Environment *_environment, int _dx, int _dy)
void vdcz_move_tiles(Environment *_environment, char *_tile, char *_x, char *_y)
void vdcz_pset_int(Environment *_environment, int _x, int _y, int *_c)
void vdcz_screen_columns(Environment *_environment, char *_columns)
Variable * vdcz_new_images(Environment *_environment, int _frames, int _width, int _height, int _mode)
void vdcz_tiles_get(Environment *_environment, char *_result)
void vdcz_background_color_get_vars(Environment *_environment, char *_index, char *_background_color)
VDCZ: emit code to retrieve background color
int vdcz_screen_mode_enable(Environment *_environment, ScreenMode *_screen_mode)
void vdcz_get_height(Environment *_environment, char *_result)
void vdcz_sprite_expand_vertical(Environment *_environment, char *_sprite)
void vdcz_get_image(Environment *_environment, char *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, int _palette)
void vdcz_bitmap_disable(Environment *_environment)
Variable * vdcz_collision(Environment *_environment, char *_sprite)
VDCZ: emit code to check for collision
Variable * vdcz_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 vdcz_calculate_sequence_frame_offset(Environment *_environment, char *_offset, char *_sequence, char *_frame, int _frame_size, int _frame_count)
void vdcz_sprite_priority(Environment *_environment, char *_sprite, char *_priority)
int vdcz_image_size(Environment *_environment, int _width, int _height, int _mode)
void vdcz_tilemap_enable(Environment *_environment, int _width, int _height, int _colors, int _tile_width, int _tile_height)
void vdcz_cls(Environment *_environment)
void vdcz_border_color(Environment *_environment, char *_border_color)
VDCZ: emit code to change border color
void vdcz_background_color_semivars(Environment *_environment, int _index, char *_background_color)
VDCZ: emit code to change background color
void vdcz_cline(Environment *_environment, char *_characters)
void vdcz_scroll_text(Environment *_environment, int _direction, int _overlap)
void vdcz_vertical_scroll(Environment *_environment, char *_displacement)
RGBi * vdcz_image_nearest_system_color(RGBi *_color)
void vdcz_tile_at(Environment *_environment, char *_x, char *_y, char *_result)
void vdcz_screen_off(Environment *_environment)
void vdcz_sprite_compress_vertical(Environment *_environment, char *_sprite)
void vdcz_sprite_at(Environment *_environment, char *_sprite, char *_x, char *_y)
void vdcz_screen(Environment *_environment, char *_x, char *_y, char *_c)
Variable * vdcz_sprite_converter(Environment *_environment, char *_source, int _width, int _height, int _depth, RGBi *_color, int _flags)
void vdcz_bank_select(Environment *_environment, int _bank)
void vdcz_pset_vars(Environment *_environment, char *_x, char *_y, char *_c)
void vdcz_background_color_vars(Environment *_environment, char *_index, char *_background_color)
VDCZ: emit code to change background color
void vdcz_sprite_color(Environment *_environment, char *_sprite, char *_color)
void vdcz_sprite_disable(Environment *_environment, char *_sprite)
void vdcz_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
VDCZ: emit code to set raster irq
void vdcz_sprite_compress_horizontal(Environment *_environment, char *_sprite)
void console_calculate_vars(Environment *_environment)
void vdcz_back(Environment *_environment)
void vdcz_initialization(Environment *_environment)
void vdcz_sprite_common_color(Environment *_environment, char *_index, char *_common_color)
VDCZ: emit code to change common sprite's color
void vdcz_hscroll_screen(Environment *_environment, int _direction, int _overlap)
void vdcz_get_width(Environment *_environment, char *_result)
void vdcz_sprite_expand_horizontal(Environment *_environment, char *_sprite)
Variable * vdcz_get_raster_line(Environment *_environment)
void vdcz_put_tiles(Environment *_environment, char *_tile, char *_x, char *_y, char *_w, char *_h)
void vdcz_put_image(Environment *_environment, Resource *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_flags)
void vdcz_busy_wait(Environment *_environment, char *_timing)
void vdcz_cls_box(Environment *_environment, char *_x1, char *_y1, char *_w, char *_h)
void vdcz_hscroll_line(Environment *_environment, int _direction, int _overlap)
void vdcz_screen_on(Environment *_environment)
Variable * vdcz_new_image(Environment *_environment, int _width, int _height, int _mode)
void vdcz_sprite_multicolor(Environment *_environment, char *_sprite)
void vdcz_sprite_data_from(Environment *_environment, char *_sprite, char *_address)
void vdcz_use_tileset(Environment *_environment, char *_tileset)
void vdcz_bitmap_at(Environment *_environment, char *_address)
void vdcz_text(Environment *_environment, char *_text, char *_text_size, int _raw)
int vdcz_palette_extract(Environment *_environment, char *_data, int _width, int _height, int _depth, int _flags, RGBi *_palette)
void vdcz_pget_color_vars(Environment *_environment, char *_x, char *_y, char *_result)
void vdcz_next_raster(Environment *_environment)
VDCZ: emit code to wait for next raster irq
void vdcz_sprite_enable(Environment *_environment, char *_sprite)
void vdcz_bitmap_enable(Environment *_environment, int _width, int _height, int _colors)
void vdcz_tiles_at(Environment *_environment, char *_address)
void console_calculate(Environment *_environment)
void vdcz_background_color(Environment *_environment, int _index, int _background_color)
VDCZ: emit code to change background color
void vdcz_wait_vbl(Environment *_environment, char *_raster_line)
#define BITMAP_MODE_STANDARD_INT
#define BITMAP_MODE_MULTICOLOR_INT