ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
ef9345.c
Go to the documentation of this file.
1/*****************************************************************************
2 * ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
3 *****************************************************************************
4 * Copyright 2021-2026 Marco Spedaletti (asimov@mclink.it)
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *----------------------------------------------------------------------------
18 * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0
19 * (la "Licenza"); è proibito usare questo file se non in conformità alla
20 * Licenza. Una copia della Licenza è disponibile all'indirizzo:
21 *
22 * http://www.apache.org/licenses/LICENSE-2.0
23 *
24 * Se non richiesto dalla legislazione vigente o concordato per iscritto,
25 * il software distribuito nei termini della Licenza è distribuito
26 * "COSì COM'è", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o
27 * implicite. Consultare la Licenza per il testo specifico che regola le
28 * autorizzazioni e le limitazioni previste dalla medesima.
29 ****************************************************************************/
30
31/****************************************************************************
32 * INCLUDE SECTION
33 ****************************************************************************/
34
35#if defined(__vg5000__)
36
37#include "../ugbc.h"
38#include <math.h>
39
40static RGBi SYSTEM_PALETTE[] = {
41 { 0x00, 0x00, 0x00, 0xff, 1, "BLACK" },
42 { 0x00, 0x00, 0x00, 0xff, 0, "TRANSPARENT" },
43 { 0x00, 0x80, 0x00, 0xff, 2, "GREEN" },
44 { 0x00, 0xff, 0x00, 0xff, 3, "LIGHT_GREEN" },
45 { 0x00, 0x00, 0x80, 0xff, 4, "DARK_BLUE" },
46 { 0x00, 0x00, 0xff, 0xff, 5, "LIGHT_BLUE" },
47 { 0x80, 0x00, 0x00, 0xff, 6, "DARK_RED" },
48 { 0x00, 0xff, 0xff, 0xff, 7, "CYAN" },
49 { 0x80, 0x00, 0x00, 0xff, 8, "RED" },
50 { 0xff, 0x00, 0x00, 0xff, 9, "LIGHT_RED" },
51 { 0xff, 0xff, 0x20, 0xff, 10, "DARK_YELLOW" },
52 { 0xff, 0xff, 0xee, 0xff, 11, "LIGHT_YELLOW" },
53 { 0x00, 0x40, 0x00, 0xff, 12, "DARK_GREEN" },
54 { 0xaa, 0x00, 0xaa, 0xff, 13, "MAGENTA" },
55 { 0xaa, 0xaa, 0xaa, 0xff, 14, "GRAY" },
56 { 0xff, 0xff, 0xff, 0xff, 15, "WHITE" }
57};
58
59/****************************************************************************
60 * CODE SECTION
61 ****************************************************************************/
62
64
65 int minDistance = 0xffff;
66 int colorIndex = 0;
67 for (int j = 0; j < COLOR_COUNT; ++j) {
68 int distance = rgbi_distance(&SYSTEM_PALETTE[j], _color);
69 if (distance < minDistance) {
70 minDistance = distance;
71 colorIndex = j;
72 }
73 }
74
75 return &SYSTEM_PALETTE[colorIndex];
76
77}
78
90static void ef9345_image_converter_tile( char * _source, char * _dest, int _width, int _depth, int _source_width ) {
91
92 int colorIndexesCount[COLOR_COUNT];
93
94 int colorBackgroundMax = 0;
95 int colorBackground[8];
96 memset( colorBackground, 0, 8 );
97
98 int colorForegroundMax = 0;
99 int colorForeground[8];
100 memset( colorForeground, 0, 8 );
101
102 char * source = _source;
103
104 // Clear the box and colors
105 memset( _dest, 0, 16 );
106
107 // Loop for all the box surface
108 for (int y=0; y<8; ++y) {
109
110 memset(colorIndexesCount, 0, COLOR_COUNT * sizeof( int ) );
111 colorBackgroundMax = 0;
112 colorForegroundMax = 0;
113
114 for (int x=0; x<8; ++x) {
115
116 RGBi rgb;
117
118 memset( &rgb, 0, sizeof( RGBi ) );
119
120 // Take the color of the pixel
121 rgb.red = *source;
122 rgb.green = *(source + 1);
123 rgb.blue = *(source + 2);
124
125 RGBi *systemRgb = ef9345_image_nearest_system_color( &rgb );
126
127 ++colorIndexesCount[systemRgb->index];
128
129 source += _depth;
130
131 }
132
133 for( int xx = 0; xx<COLOR_COUNT; ++xx ) {
134 if ( colorIndexesCount[xx] > colorBackgroundMax ) {
135 colorBackground[y] = xx;
136 colorBackgroundMax = colorIndexesCount[xx];
137 };
138 }
139
140 colorIndexesCount[colorBackground[y]] = 0;
141
142 for( int xx = 0; xx<COLOR_COUNT; ++xx ) {
143 if ( colorIndexesCount[xx] > colorForegroundMax ) {
144 colorForeground[y] = xx;
145 colorForegroundMax = colorIndexesCount[xx];
146 };
147 }
148
149 if ( colorForeground[y] == colorBackground[y] ) {
150 colorForeground[y] = ( colorBackground[y] == 0 ) ? 1 : 0;
151 }
152
153 source += _depth * ( _source_width - 8 );
154
155 }
156
157 source = _source;
158
159 for (int y=0; y<8; ++y) {
160 for (int x=0; x<8; ++x) {
161
162 RGBi rgb;
163
164 memset( &rgb, 0, sizeof( RGBi ) );
165
166 rgb.red = *source;
167 rgb.green = *(source + 1);
168 rgb.blue = *(source + 2);
169
170 RGBi *systemRgb = ef9345_image_nearest_system_color( &rgb );
171
172 char bitmask = 1 << ( 7 - ((x) & 0x7) );
173
174 if ( systemRgb->index != colorBackground[y] ) {
175 *( _dest + y ) |= bitmask;
176 // printf("*");
177 } else {
178 *( _dest + y ) &= ~bitmask;
179 // printf(" ");
180 }
181
182 source += _depth;
183
184 }
185
186 source += _depth * ( _source_width - 8 );
187
188 }
189
190 for( int i=0; i<8; ++i ) {
191 *( _dest + 8 + i ) = ( colorForeground[i] << 4 ) | colorBackground[i] ;
192 }
193
194}
195
207static void ef9345_image_converter_tiles( char * _source, char * _dest, int _width, int _height, int _depth, int _source_width ) {
208
209 int bitmapSize = ( _width>>3 ) * _height;
210 int colormapSize = ( _width>>3 ) * _height;
211
212 memset( _dest, 0, bitmapSize + colormapSize );
213
214 for( int y=0; y<_height; y+=8 ) {
215 for( int x=0; x<_width; x+=8 ) {
216
217 char * source = _source + ( ( y * _source_width ) + x ) * _depth;
218 char tile[16];
219
220 ef9345_image_converter_tile( source, tile, _width, _depth, _source_width );
221
222 int offset = ((y>>3) * 8 *( _width >> 3 ) ) + ((x>>3) * 8) + ((y) & 0x07);
223 // x = 8, y = 8
224 // offset = ((8 >> 3) * 8 * (16>>3) ) + ((8>>3) * 8) + ((8) & 7)
225 // offset = (1 * 8 * 2 ) + (1 * 8)
226 // offset = 16 + 8 = 24
227
228 char * destBitmap = _dest + offset;
229 char * destColormap = _dest + bitmapSize + offset;
230 for( int i=0; i<8; ++i ) {
231 *destBitmap = tile[i];
232 *destColormap = tile[i+8];
233 ++destBitmap;
234 ++destColormap;
235 }
236 }
237 }
238}
239
251Variable * ef9345_collision( Environment * _environment, char * _sprite ) {
252
253}
254
266void ef9345_hit( Environment * _environment, char * _sprite_mask, char * _result ) {
267
268 //todo
269
270}
271
281void ef9345_border_color( Environment * _environment, char * _border_color ) {
282
283}
284
295void ef9345_background_color( Environment * _environment, int _index, int _background_color ) {
296
297}
298
309void ef9345_background_color_vars( Environment * _environment, char * _index, char * _background_color ) {
310
311}
312
323void ef9345_background_color_semivars( Environment * _environment, int _index, char * _background_color ) {
324
325}
326
337void ef9345_background_color_get_vars( Environment * _environment, char * _index, char * _background_color ) {
338
339}
340
351void ef9345_sprite_common_color( Environment * _environment, char * _index, char * _common_color ) {
352
353}
354
370void ef9345_raster_at( Environment * _environment, char * _label, char * _positionlo, char * _positionhi ) {
371
372}
373
384void ef9345_next_raster( Environment * _environment ) {
385
386}
387
401void ef9345_next_raster_at( Environment * _environment, char * _label, char * _positionlo, char * _positionhi ) {
402
403}
404
405void ef9345_bank_select( Environment * _environment, int _bank ) {
406
407}
408
409static int rgbConverterFunction( int _red, int _green, int _blue ) {
410
411 int colorIndex = 0;
412 unsigned int minDistance = 0xffffffff;
413 int j;
414
415 RGBi rgb;
416 rgb.red = _red;
417 rgb.green = _green;
418 rgb.blue = _blue;
419
420 for (j = 0; j < sizeof(SYSTEM_PALETTE)/sizeof(RGBi); ++j) {
421 int distance = rgbi_distance(&SYSTEM_PALETTE[j], &rgb);
422 if (distance < minDistance) {
423 minDistance = distance;
424 colorIndex = j;
425 }
426 }
427
428 return colorIndex;
429
430}
431
432void console_calculate( Environment * _environment ) {
433
434 // #if defined(__to8__)
435 // int consoleSA = 0x4000;
436 // #else
437 // int consoleSA = 0x0000;
438 // #endif
439 // int consoleWB = _environment->activeConsole.width * _environment->currentModeBW;
440 // int consoleHB = _environment->activeConsole.height * 8;
441
442 // cpu_store_16bit( _environment, "CONSOLESA", consoleSA );
443 // cpu_store_8bit( _environment, "CONSOLEWB", consoleWB );
444 // cpu_store_8bit( _environment, "CONSOLEHB", consoleHB );
445
446}
447
448void console_calculate_vars( Environment * _environment ) {
449
450 _environment->dynamicConsole = 1;
451
452 // outline0( "CALL CONSOLECALCULATE" );
453
454}
455
456int ef9345_screen_mode_enable( Environment * _environment, ScreenMode * _screen_mode ) {
457
458 _screen_mode->selected = 1;
459
460 cpu_store_8bit( _environment, "_PEN", _environment->defaultPenColor );
461 cpu_store_8bit( _environment, "_PAPER", _environment->defaultPaperColor );
462
463 switch( _screen_mode->id ) {
465 _environment->fontWidth = 8;
466 _environment->fontHeight = 10;
467 _environment->screenTilesWidth = 40;
468 _environment->screenTilesHeight = 21;
469 _environment->screenTiles = 127;
470 _environment->screenWidth = _environment->screenTilesWidth * _environment->fontWidth;
471 _environment->screenHeight = _environment->screenTilesHeight * _environment->fontHeight;
472 _environment->screenColors = 8;
473
474 cpu_store_16bit( _environment, "TEXTADDRESS", 0x0000 );
475
476 break;
477 }
478
479 _environment->consoleTilesWidth = _environment->screenTilesWidth;
480 _environment->consoleTilesHeight = _environment->screenTilesHeight;
481
482 cpu_store_16bit( _environment, "CLIPX1", 0 );
483 cpu_store_16bit( _environment, "CLIPX2", (_environment->screenWidth-1) );
484 cpu_store_16bit( _environment, "CLIPY1", 0 );
485 cpu_store_16bit( _environment, "CLIPY2", (_environment->screenHeight-1) );
486
487 cpu_store_16bit( _environment, "ORIGINX", 0 );
488 cpu_store_16bit( _environment, "ORIGINY", 0 );
489
490 cpu_store_16bit( _environment, "CURRENTWIDTH", _environment->screenWidth );
491 cpu_store_16bit( _environment, "CURRENTHEIGHT", _environment->screenHeight );
492 cpu_move_16bit( _environment, "CURRENTWIDTH", "RESOLUTIONX" );
493 cpu_move_16bit( _environment, "CURRENTHEIGHT", "RESOLUTIONY" );
494 cpu_store_8bit( _environment, "CURRENTTILES", _environment->screenTiles );
495 cpu_store_8bit( _environment, "CURRENTTILESWIDTH", _environment->screenTilesWidth );
496 cpu_store_8bit( _environment, "CURRENTTILESHEIGHT", _environment->screenTilesHeight );
497 cpu_store_8bit( _environment, "FONTWIDTH", _environment->fontWidth );
498 cpu_store_8bit( _environment, "FONTHEIGHT", _environment->fontHeight );
499
500 console_init( _environment );
501
502 if (_environment->vestigialConfig.clsImplicit ) {
503 ef9345_cls( _environment );
504 }
505
506}
507
508void ef9345_bitmap_enable( Environment * _environment, int _width, int _height, int _colors ) {
509
510 ScreenMode * mode = find_screen_mode_by_suggestion( _environment, 1, _width, _height, _colors, 8, 8 );
511
512 if ( mode ) {
513 ef9345_screen_mode_enable( _environment, mode );
514
515 cpu_store_8bit( _environment, "CURRENTMODE", mode->id );
516 cpu_store_8bit( _environment, "CURRENTTILEMODE", 0 );
517
518 _environment->currentMode = mode->id;
519 _environment->currentTileMode = 0;
520
521 ef9345_cls( _environment );
522
523 } else {
525 }
526}
527
528void ef9345_bitmap_disable( Environment * _environment ) {
529
530 //todo
531
532}
533
534void ef9345_tilemap_enable( Environment * _environment, int _width, int _height, int _colors, int _tile_width, int _tile_height ) {
535
536 ScreenMode * mode = find_screen_mode_by_suggestion( _environment, 0, _width, _height, _colors, _tile_width, _tile_height );
537
538 if ( mode ) {
539
540 // printf("ef9345_tilemap_enable() -> %d\n", mode->id );
541
542 ef9345_screen_mode_enable( _environment, mode );
543
544 _environment->currentMode = mode->id;
545 _environment->currentTileMode = 1;
546
547 cpu_store_8bit( _environment, "CURRENTMODE", mode->id );
548 cpu_store_8bit( _environment, "CURRENTTILEMODE", 1 );
549
550 ef9345_cls( _environment );
551
552 } else {
553 // printf("ef9345_tilemap_enable() -> -1\n" );
555 }
556
557}
558
559void ef9345_bitmap_at( Environment * _environment, char * _address ) {
560
561}
562
563void ef9345_colormap_at( Environment * _environment, char * _address ) {
564
565}
566
567void ef9345_textmap_at( Environment * _environment, char * _address ) {
568
569}
570
571void ef9345_pset_int( Environment * _environment, int _x, int _y, int *_c ) {
572
573}
574
575void ef9345_pset_vars( Environment * _environment, char *_x, char *_y, char *_c ) {
576
577}
578
579void ef9345_pget_color_vars( Environment * _environment, char *_x, char *_y, char * _result ) {
580
581}
582
583void ef9345_screen_on( Environment * _environment ) {
584
585}
586
587void ef9345_screen_off( Environment * _environment ) {
588
589}
590
591void ef9345_screen_rows( Environment * _environment, char * _rows ) {
592
593}
594
595void ef9345_screen_columns( Environment * _environment, char * _columns ) {
596
597}
598
599void ef9345_sprite_data_from( Environment * _environment, char * _sprite, char * _image ) {
600
601}
602
603void ef9345_sprite_data_set( Environment * _environment, char * _sprite, char * _image ) {
604
605}
606
607void ef9345_sprite_enable( Environment * _environment, char * _sprite ) {
608
609}
610
611void ef9345_sprite_disable( Environment * _environment, char * _sprite ) {
612
613}
614
615void ef9345_sprite_at( Environment * _environment, char * _sprite, char * _x, char * _y ) {
616
617}
618
619void ef9345_sprite_expand_vertical( Environment * _environment, char * _sprite ) {
620
621}
622
623void ef9345_sprite_expand_horizontal( Environment * _environment, char * _sprite ) {
624
625}
626
627void ef9345_sprite_compress_vertical( Environment * _environment, char * _sprite ) {
628
629}
630
631void ef9345_sprite_compress_horizontal( Environment * _environment, char * _sprite ) {
632
633}
634
635void ef9345_sprite_multicolor( Environment * _environment, char * _sprite ) {
636
637}
638
639void ef9345_sprite_monocolor( Environment * _environment, char * _sprite ) {
640
641}
642
643void ef9345_sprite_color( Environment * _environment, char * _sprite, char * _color ) {
644
645}
646
647void ef9345_sprite_priority( Environment * _environment, char * _sprite, char * _priority ) {
648
649}
650
651void ef9345_tiles_at( Environment * _environment, char * _address ) {
652
653}
654
655void ef9345_vertical_scroll( Environment * _environment, char * _displacement ) {
656
657}
658
659void ef9345_horizontal_scroll( Environment * _environment, char * _displacement ) {
660
661}
662
663void ef9345_busy_wait( Environment * _environment, char * _timing ) {
664
665}
666
667void ef9345_get_width( Environment * _environment, char *_result ) {
668
669 outline0("LD HL, (CURRENTWIDTH)" );
670 outline1("LD (%s), HL", _result );
671
672}
673
674void ef9345_tiles_get( Environment * _environment, char *_result ) {
675
676 outline0("LD A, (CURRENTTILES)" );
677 outline1("LD (%s), A", _result );
678
679}
680
681void ef9345_get_height( Environment * _environment, char *_result ) {
682
683 outline0("LD HL, (CURRENTHEIGHT)" );
684 outline1("LD (%s), HL", _result );
685
686}
687
688void ef9345_cls( Environment * _environment ) {
689
690 deploy( clsText, src_hw_ef9345_cls_asm );
691 outline0("CALL CLS");
692
693}
694
695void ef9345_cls_box( Environment * _environment, char * _x1, char * _y1, char * _w, char * _h ) {
696
697 // deploy( clsBox, src_hw_cpc_cls_box_asm );
698 // outline1("LD A, (%s)", _x1);
699 // outline0("LD B, A");
700 // outline1("LD A, (%s)", _y1);
701 // outline0("LD C, A");
702 // outline1("LD A, (%s)", _x2);
703 // outline0("LD D, A");
704 // outline1("LD A, (%s)", _y2);
705 // outline0("LD E, A");
706 // outline0("CALL CLSBOX");
707
708}
709
710void ef9345_scroll_text( Environment * _environment, int _direction, int _overlap ) {
711
712}
713
714void ef9345_text( Environment * _environment, char * _text, char * _text_size, int _raw ) {
715
716 deploy( ef9345vars, src_hw_ef9345_vars_asm);
717 deploy( textEncodedAt, src_hw_ef9345_text_at_asm );
718 // deploy( vScrollTextUp, src_hw_ef9345_vscroll_text_up_asm );
719 // deploy( clsText, src_hw_tms9918_cls_text_asm );
720
721 outline1("LD DE, (%s)", _text);
722 outline1("LD A, (%s)", _text_size);
723 outline0("LD C, A");
724
725 outline0("CALL TEXTAT");
726
727}
728
729void ef9345_initialization( Environment * _environment ) {
730
731 deploy( ef9345vars, src_hw_ef9345_vars_asm );
732 deploy( ef9345startup, src_hw_ef9345_startup_asm );
733
734 variable_import( _environment, "CURRENTWIDTH", VT_POSITION, 256 );
735 variable_global( _environment, "CURRENTWIDTH" );
736 variable_import( _environment, "CURRENTHEIGHT", VT_POSITION, 192 );
737 variable_global( _environment, "CURRENTHEIGHT" );
738 variable_import( _environment, "CURRENTTILES", VT_BYTE, 255 );
739 variable_global( _environment, "CURRENTTILES" );
740 variable_import( _environment, "CURRENTTILESWIDTH", VT_SBYTE, 40 );
741 variable_global( _environment, "CURRENTTILESWIDTH" );
742 variable_import( _environment, "CURRENTTILESHEIGHT", VT_SBYTE, 24 );
743 variable_global( _environment, "CURRENTTILESHEIGHT" );
744 variable_import( _environment, "FONTWIDTH", VT_BYTE, 8 );
745 variable_global( _environment, "FONTWIDTH" );
746 variable_import( _environment, "FONTHEIGHT", VT_BYTE, 8 );
747 variable_global( _environment, "FONTHEIGHT" );
748 variable_import( _environment, "SPRITEADDRESS", VT_ADDRESS, 0x0000 );
749 variable_global( _environment, "SPRITEADDRESS" );
750 variable_import( _environment, "SPRITEAADDRESS", VT_ADDRESS, 0x1000 );
751 variable_global( _environment, "SPRITEAADDRESS" );
752 variable_import( _environment, "TEXTADDRESS", VT_ADDRESS, 0x1800 );
753 variable_global( _environment, "TEXTADDRESS" );
754 variable_import( _environment, "COLORMAPADDRESS", VT_ADDRESS, 0x3800 );
755 variable_global( _environment, "COLORMAPADDRESS" );
756 variable_import( _environment, "PATTERNADDRESS", VT_ADDRESS, 0x0000 );
757 variable_global( _environment, "PATTERNADDRESS" );
758
759 SCREEN_MODE_DEFINE( TILEMAP_MODE_STANDARD, 0, 40, 24, 20, 6, 8, "Text Mode" );
760
761 outline0("CALL EF9345STARTUP");
762
763 variable_import( _environment, "XGR", VT_POSITION, 0 );
764 variable_global( _environment, "XGR" );
765 variable_import( _environment, "YGR", VT_POSITION, 0 );
766 variable_global( _environment, "YGR" );
767 variable_import( _environment, "LINE", VT_WORD, (unsigned short)(0xffff) );
768 variable_global( _environment, "LINE" );
769
770 variable_import( _environment, "CLIPX1", VT_POSITION, 0 );
771 variable_global( _environment, "CLIPX1" );
772 variable_import( _environment, "CLIPX2", VT_POSITION, 255 );
773 variable_global( _environment, "CLIPX2" );
774 variable_import( _environment, "CLIPY1", VT_POSITION, 0 );
775 variable_global( _environment, "CLIPY1" );
776 variable_import( _environment, "CLIPY2", VT_POSITION, 191 );
777 variable_global( _environment, "CLIPY2" );
778
779 variable_import( _environment, "ORIGINX", VT_POSITION, 0 );
780 variable_global( _environment, "ORIGINX" );
781 variable_import( _environment, "ORIGINY", VT_POSITION, 0 );
782 variable_global( _environment, "ORIGINY" );
783
784 variable_import( _environment, "RESOLUTIONX", VT_POSITION, 0 );
785 variable_global( _environment, "RESOLUTIONX" );
786 variable_import( _environment, "RESOLUTIONY", VT_POSITION, 0 );
787 variable_global( _environment, "RESOLUTIONY" );
788
789 variable_import( _environment, "TABCOUNT", VT_BYTE, 4 );
790 variable_global( _environment, "TABCOUNT" );
791
792 variable_import( _environment, "CLINEX", VT_BYTE, 0 );
793 variable_global( _environment, "CLINEX" );
794
795 variable_import( _environment, "CLINEY", VT_BYTE, 0 );
796 variable_global( _environment, "CLINEY" );
797
798 variable_import( _environment, "TABSTODRAW", VT_BYTE, 0 );
799 variable_global( _environment, "TABSTODRAW" );
800
801 variable_import( _environment, "CURRENTMODE", VT_BYTE, 0 );
802 variable_global( _environment, "CURRENTMODE" );
803 variable_import( _environment, "CURRENTTILEMODE", VT_BYTE, 1 );
804 variable_global( _environment, "CURRENTTILEMODE" );
805
806 variable_import( _environment, "SPRITECOUNT", VT_SPRITE, 0 );
807 variable_global( _environment, "SPRITECOUNT" );
808
809 variable_import( _environment, "TILEX", VT_BYTE, 0 );
810 variable_global( _environment, "TILEX" );
811 variable_import( _environment, "TILEY", VT_BYTE, 0 );
812 variable_global( _environment, "TILEY" );
813 variable_import( _environment, "TILEX2", VT_BYTE, 0 );
814 variable_global( _environment, "TILEX2" );
815 variable_import( _environment, "TILET", VT_BYTE, 0 );
816 variable_global( _environment, "TILET" );
817 variable_import( _environment, "TILEW", VT_BYTE, 0 );
818 variable_global( _environment, "TILEW" );
819 variable_import( _environment, "TILEH", VT_BYTE, 0 );
820 variable_global( _environment, "TILEH" );
821 variable_import( _environment, "TILEW2", VT_BYTE, 0 );
822 variable_global( _environment, "TILEW2" );
823 variable_import( _environment, "TILEH2", VT_BYTE, 0 );
824 variable_global( _environment, "TILEH2" );
825 variable_import( _environment, "TILEA", VT_BYTE, 0 );
826 variable_global( _environment, "TILEA" );
827 variable_import( _environment, "TILEO", VT_WORD, 0 );
828 variable_global( _environment, "TILEO" );
829
830 variable_import( _environment, "XSCROLLPOS", VT_BYTE, 0 );
831 variable_global( _environment, "XSCROLLPOS" );
832 variable_import( _environment, "YSCROLLPOS", VT_BYTE, 0 );
833 variable_global( _environment, "YSCROLLPOS" );
834 variable_import( _environment, "XSCROLL", VT_BYTE, 0 );
835 variable_global( _environment, "XSCROLL" );
836 variable_import( _environment, "YSCROLL", VT_BYTE, 0 );
837 variable_global( _environment, "YSCROLL" );
838 variable_import( _environment, "DIRECTION", VT_BYTE, 0 );
839 variable_global( _environment, "DIRECTION" );
840
841 variable_import( _environment, "ONSCROLLUP", VT_BUFFER, 3 );
842 variable_global( _environment, "ONSCROLLUP" );
843
844 variable_import( _environment, "ONSCROLLDOWN", VT_BUFFER, 3 );
845 variable_global( _environment, "ONSCROLLDOWN" );
846
847 variable_import( _environment, "ONSCROLLLEFT", VT_BUFFER, 3 );
848 variable_global( _environment, "ONSCROLLLEFT" );
849
850 variable_import( _environment, "ONSCROLLRIGHT", VT_BUFFER, 3 );
851 variable_global( _environment, "ONSCROLLRIGHT" );
852
853 variable_import( _environment, "IMAGEF", VT_BYTE, 0 );
854 variable_global( _environment, "IMAGEF" );
855
856 variable_import( _environment, "IMAGET", VT_BYTE, 0 );
857 variable_global( _environment, "IMAGET" );
858
859 ef9345_tilemap_enable( _environment, 40, 21, 1, 8, 10 );
860
861 font_descriptors_init( _environment, 0 );
862
863
864 _environment->fontWidth = 8;
865 _environment->fontHeight = 10;
866 _environment->screenTilesWidth = 40;
867 _environment->screenTilesHeight = 21;
868 _environment->screenTiles = 127;
869 _environment->screenWidth = _environment->screenTilesWidth * _environment->fontWidth;
870 _environment->screenHeight = _environment->screenTilesHeight * _environment->fontHeight;
871 _environment->screenColors = 8;
872 _environment->currentRgbConverterFunction = rgbConverterFunction;
873 _environment->screenShades = 16;
874
875 console_init( _environment );
876
877 if (_environment->vestigialConfig.clsImplicit ) {
878 ef9345_cls( _environment );
879 }
880
881}
882
883void ef9345_finalization( Environment * _environment ) {
884
885 if ( _environment->vestigialConfig.clsImplicit ) {
886 deploy( clsText, src_hw_ef9345_cls_asm );
887 }
888
889 CopperList * copperList = _environment->copperList;
890 if ( copperList ) {
891 while(copperList) {
892 outhead1("COPPERACTIVATE%s:", copperList->name ? copperList->name : "" );
893 outline0("RET");
894 copperList = copperList->next;
895 }
896 }
897
898}
899
900void ef9345_hscroll_line( Environment * _environment, int _direction, int _overlap ) {
901
902}
903
904void ef9345_hscroll_screen( Environment * _environment, int _direction, int _overlap ) {
905
906}
907
908void ef9345_back( Environment * _environment ) {
909
910}
911
912void ef9345_cline( Environment * _environment, char * _characters ) {
913
914}
915
916int ef9345_image_size( Environment * _environment, int _width, int _height, int _mode ) {
917
918 switch( _mode ) {
919
921 break;
922 }
923
924 return 0;
925
926}
927
928static int calculate_images_size( Environment * _environment, int _frames, int _width, int _height, int _mode ) {
929
930 switch( _mode ) {
931
933 break;
934 }
935
936 return 0;
937
938}
939
940static int calculate_sequence_size( Environment * _environment, int _sequences, int _frames, int _width, int _height, int _mode ) {
941
942 switch( _mode ) {
943
945 break;
946 }
947
948 return 0;
949
950}
951
952
953Variable * ef9345_sprite_converter( Environment * _environment, char * _source, int _width, int _height, int _depth, RGBi * _color ) {
954
955 // deploy( ef9345varsGraphic, src_hw_ef9345_vars_graphic_asm );
956
957 // RGBi palette[MAX_PALETTE];
958
959 // int colorUsed = rgbi_extract_palette(_environment, _source, _width, _height, _depth, palette, MAX_PALETTE, 1 /* sorted */);
960
961 Variable * result = variable_temporary( _environment, VT_IMAGE, 0 );
962 // result->originalColors = colorUsed;
963
964 // int i, j, k;
965
966 // for( i=0; i<colorUsed; ++i ) {
967 // int minDistance = 0xffff;
968 // int colorIndex = 0;
969 // for (j = 0; j < sizeof(SYSTEM_PALETTE)/sizeof(RGBi); ++j) {
970 // int distance = rgbi_distance(&SYSTEM_PALETTE[j], &palette[i]);
971 // if (distance < minDistance) {
972 // for( k=0; k<i; ++k ) {
973 // if ( palette[k].index == SYSTEM_PALETTE[j].index ) {
974 // break;
975 // }
976 // }
977 // if ( k>=i ) {
978 // minDistance = distance;
979 // colorIndex = j;
980 // }
981 // }
982 // }
983 // palette[i].index = SYSTEM_PALETTE[colorIndex].index;
984 // strcopy( palette[i].description, SYSTEM_PALETTE[colorIndex].description );
985 // }
986
987 // memcpy( result->originalPalette, palette, MAX_PALETTE * sizeof( RGBi ) );
988
989 // int bufferSize = ( ( _width >> 3 ) * _height ) + 3;
990
991 // char * buffer = malloc ( bufferSize );
992 // memset( buffer, 0, bufferSize );
993
994 // // Position of the pixel in the original image
995 // int image_x, image_y;
996
997 // // Position of the pixel, in terms of tiles
998 // int tile_x, tile_y;
999
1000 // // Position of the pixel, in terms of offset and bitmask
1001 // int offset, bitmask;
1002
1003 // // Color of the pixel to convert
1004 // RGBi rgb;
1005
1006 // // Loop for all the source surface.
1007 // for (image_y = 0; image_y < _height; ++image_y) {
1008 // if ( image_y == 8 ) {
1009 // break;
1010 // }
1011 // for (image_x = 0; image_x < _width; ++image_x) {
1012 // if ( image_x == 8 ) {
1013 // break;
1014 // }
1015
1016 // // Take the color of the pixel
1017 // rgb.red = *_source;
1018 // rgb.green = *(_source + 1);
1019 // rgb.blue = *(_source + 2);
1020 // if ( _depth > 3 ) {
1021 // rgb.alpha = *(_source + 3);
1022 // } else {
1023 // rgb.alpha = 255;
1024 // }
1025
1026 // // Calculate the relative tile
1027
1028 // // Calculate the offset starting from the tile surface area
1029 // // and the bit to set.
1030 // offset = (image_y * ( _width>>3 ) ) + (image_x >> 3);
1031
1032 // int minDistance = 0xffff;
1033 // int colorIndex = 0;
1034
1035 // if ( rgbi_equals_rgba( _color, &rgb ) ) {
1036 // i = 1;
1037 // } else {
1038 // i = 0;
1039 // }
1040
1041 // colorIndex = i;
1042
1043 // bitmask = ( colorIndex == 0 ? 0 : 1 ) << (7 - ((image_x & 0x7)));
1044 // *(buffer + 2 + offset) |= bitmask;
1045
1046 // _source += 3;
1047
1048 // }
1049
1050 // _source += 3 * ( _width - image_x );
1051
1052 // }
1053
1054 // *(buffer + 2 + ( ( _width >> 3 ) * _height )) = _color->index | ( _color->index << 4 );
1055
1056 // variable_store_buffer( _environment, result->name, buffer, bufferSize, 0 );
1057
1058 return result;
1059
1060}
1061
1062Variable * ef9345_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 ) {
1063
1065
1066 return ef9345_new_image( _environment, 8, 8, TILEMAP_MODE_STANDARD );
1067
1068}
1069
1070void ef9345_put_image( Environment * _environment, Resource * _image, char * _x, char * _y, char * _frame, char * _sequence, int _frame_size, int _frame_count, char * _flags ) {
1071
1072}
1073
1074void ef9345_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 ) {
1075
1076}
1077
1078void ef9345_wait_vbl( Environment * _environment ) {
1079
1080}
1081
1082Variable * ef9345_new_image( Environment * _environment, int _width, int _height, int _mode ) {
1083
1084 int size = ef9345_image_size( _environment, _width, _height, _mode );
1085
1086 if ( ! size ) {
1088 }
1089
1090 Variable * result = variable_temporary( _environment, VT_IMAGE, "(new image)" );
1091
1092 char * buffer = malloc ( size );
1093 memset( buffer, 0, size );
1094
1095 *(buffer) = (_width & 0xff);
1096 *(buffer+1) = (_width>>8) & 0xff;
1097 *(buffer+2) = _height;
1098
1099 result->valueBuffer = buffer;
1100 result->size = size;
1101
1102 return result;
1103
1104}
1105
1106Variable * ef9345_new_images( Environment * _environment, int _frames, int _width, int _height, int _mode ) {
1107
1108 int size = calculate_images_size( _environment, _frames, _width, _height, _mode );
1109 int frameSize = ef9345_image_size( _environment, _width, _height, _mode );
1110
1111 if ( ! size ) {
1113 }
1114
1115 Variable * result = variable_temporary( _environment, VT_IMAGES, "(new images)" );
1116
1117 char * buffer = malloc ( size );
1118 memset( buffer, 0, size );
1119
1120 *(buffer) = _frames;
1121 *(buffer+1) = ( _width & 0xff );
1122 *(buffer+2) = ( _width >> 8 ) & 0xff;
1123 for( int i=0; i<_frames; ++i ) {
1124 *(buffer+3+(i*frameSize)) = ( _width & 0xff );
1125 *(buffer+3+(i*frameSize)+1) = ( ( _width >> 8 ) & 0xff );
1126 *(buffer+3+(i*frameSize)+2) = ( _height & 0xff );
1127 }
1128
1129 result->valueBuffer = buffer;
1130 result->frameSize = frameSize;
1131 result->size = size;
1132 result->frameCount = _frames;
1133
1134 return result;
1135
1136}
1137
1138Variable * ef9345_new_sequence( Environment * _environment, int _sequences, int _frames, int _width, int _height, int _mode ) {
1139
1140 int size2 = calculate_sequence_size( _environment, _sequences, _frames, _width, _height, _mode );
1141 int size = calculate_images_size( _environment, _frames, _width, _height, _mode );
1142 int frameSize = ef9345_image_size( _environment, _width, _height, _mode );
1143
1144 if ( ! size ) {
1146 }
1147
1148 Variable * result = variable_temporary( _environment, VT_IMAGES, "(new images)" );
1149
1150 char * buffer = malloc ( size2 );
1151 memset( buffer, 0, size2 );
1152
1153 *(buffer) = _frames;
1154 *(buffer+1) = _width;
1155 *(buffer+2) = _sequences;
1156 for( int i=0; i<(_frames*_sequences); ++i ) {
1157 *(buffer+3+(i*frameSize)) = ( _width & 0xff );
1158 *(buffer+3+(i*frameSize)+1) = ( ( _width >> 8 ) & 0xff );
1159 *(buffer+3+(i*frameSize)+2) = ( _height & 0xff );
1160 }
1161
1162 result->valueBuffer = buffer;
1163 result->frameSize = frameSize;
1164 result->size = size;
1165 result->frameCount = _frames;
1166
1167 return result;
1168
1169}
1170
1171
1172void ef9345_get_image( Environment * _environment, char * _image, char * _x, char * _y, char * _frame, char * _sequence, int _frame_size, int _frame_count, int _palette ) {
1173
1174}
1175
1176
1177void ef9345_scroll( Environment * _environment, int _dx, int _dy ) {
1178
1179}
1180
1181void ef9345_put_tile( Environment * _environment, char * _tile, char * _x, char * _y ) {
1182
1183}
1184
1185void ef9345_move_tiles( Environment * _environment, char * _tile, char * _x, char * _y ) {
1186
1187}
1188
1189void ef9345_put_tiles( Environment * _environment, char * _tile, char * _x, char * _y, char *_w, char *_h ) {
1190
1191}
1192
1193void ef9345_tile_at( Environment * _environment, char * _x, char * _y, char *_result ) {
1194
1195}
1196
1197void ef9345_use_tileset( Environment * _environment, char * _tileset ) {
1198
1199}
1200
1202
1203}
1204
1205void ef9345_move_memory_video( Environment * _environment, char * _from, char * _to, char * _size ) {
1206
1207}
1208
1209void ef9345_move_video_memory( Environment * _environment, char * _from, char * _to, char * _size ) {
1210
1211}
1212
1213void ef9345_colors_vars( Environment * _environment, char * _foreground_color, char * _background_color ) {
1214
1215}
1216
1217void ef9345_slice_image( Environment * _environment, char * _image, char * _frame, char * _sequence, int _frame_size, int _frame_count, char * _destination ) {
1218
1219}
1220
1221int ef9345_palette_extract( Environment * _environment, char * _data, int _width, int _height, int _depth, int _flags, RGBi * _palette ) {
1222
1223 int paletteColorCount = rgbi_extract_palette(_environment, _data, _width, _height, _depth, _palette, MAX_PALETTE, ( ( _flags & FLAG_EXACT ) ? 0 : 1 ) /* sorted */);
1224
1225 memcpy( _palette, palette_match( _palette, paletteColorCount, SYSTEM_PALETTE, sizeof(SYSTEM_PALETTE) / sizeof(RGBi) ), paletteColorCount * sizeof( RGBi ) );
1226
1227 int uniquePaletteCount = 0;
1228
1229 memcpy( _palette, palette_remove_duplicates( _palette, paletteColorCount, &uniquePaletteCount ), paletteColorCount * sizeof( RGBi ) );
1230
1231 return uniquePaletteCount;
1232
1233}
1234
1235#endif
void cpu_store_16bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 16 bit
Definition 6309.c:1503
void cpu_move_16bit(Environment *_environment, char *_source, char *_destination)
CPU 6309: emit code to move 16 bit
Definition 6309.c:1474
void cpu_store_8bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 8 bit
Definition 6309.c:761
#define COLOR_COUNT
Definition 6847.h:72
int rgbi_distance(RGBi *_e1, RGBi *_e2)
Calculate the distance between two colors.
Variable * variable_import(Environment *_environment, char *_name, VariableType _type, int _size_or_value)
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".
int size
Definition _optimizer.c:678
int offset
Definition _optimizer.c:681
#define TILEMAP_MODE_STANDARD
Definition cga.h:80
void console_init(Environment *_environment)
Definition console.c:41
Variable * distance(Environment *_environment, char *_x1, char *_y1, char *_x2, char *_y2)
Return the distance between two (screen) positions.
Definition distance.c:76
void ef9345_textmap_at(Environment *_environment, char *_address)
Definition ef9345.c:567
void ef9345_sprite_compress_vertical(Environment *_environment, char *_sprite)
Definition ef9345.c:627
void ef9345_tiles_at(Environment *_environment, char *_address)
Definition ef9345.c:651
RGBi * ef9345_image_nearest_system_color(RGBi *_color)
Definition ef9345.c:63
void ef9345_screen_columns(Environment *_environment, char *_columns)
Definition ef9345.c:595
void ef9345_sprite_expand_vertical(Environment *_environment, char *_sprite)
Definition ef9345.c:619
void ef9345_pget_color_vars(Environment *_environment, char *_x, char *_y, char *_result)
Definition ef9345.c:579
void ef9345_wait_vbl(Environment *_environment)
Definition ef9345.c:1078
void ef9345_bitmap_at(Environment *_environment, char *_address)
Definition ef9345.c:559
void ef9345_busy_wait(Environment *_environment, char *_timing)
Definition ef9345.c:663
void ef9345_border_color(Environment *_environment, char *_border_color)
EF9345: emit code to change border color
Definition ef9345.c:281
void ef9345_sprite_common_color(Environment *_environment, char *_index, char *_common_color)
EF9345: emit code to change common sprite's color
Definition ef9345.c:351
void ef9345_screen_off(Environment *_environment)
Definition ef9345.c:587
void ef9345_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)
Definition ef9345.c:1074
void ef9345_background_color_get_vars(Environment *_environment, char *_index, char *_background_color)
EF9345: emit code to retrieve background color
Definition ef9345.c:337
void ef9345_background_color_vars(Environment *_environment, char *_index, char *_background_color)
EF9345: emit code to change background color
Definition ef9345.c:309
void ef9345_slice_image(Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
Definition ef9345.c:1217
void ef9345_sprite_data_from(Environment *_environment, char *_sprite, char *_image)
Definition ef9345.c:599
int ef9345_image_size(Environment *_environment, int _width, int _height, int _mode)
Definition ef9345.c:916
void ef9345_next_raster(Environment *_environment)
EF9345: emit code to wait for next raster irq
Definition ef9345.c:384
void ef9345_vertical_scroll(Environment *_environment, char *_displacement)
Definition ef9345.c:655
void ef9345_use_tileset(Environment *_environment, char *_tileset)
Definition ef9345.c:1197
void ef9345_sprite_color(Environment *_environment, char *_sprite, char *_color)
Definition ef9345.c:643
Variable * ef9345_new_images(Environment *_environment, int _frames, int _width, int _height, int _mode)
Definition ef9345.c:1106
void ef9345_next_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
EF9345: emit code to wait for next raster irq at different position
Definition ef9345.c:401
void ef9345_sprite_compress_horizontal(Environment *_environment, char *_sprite)
Definition ef9345.c:631
void ef9345_tile_at(Environment *_environment, char *_x, char *_y, char *_result)
Definition ef9345.c:1193
void ef9345_text(Environment *_environment, char *_text, char *_text_size, int _raw)
Definition ef9345.c:714
void ef9345_move_video_memory(Environment *_environment, char *_from, char *_to, char *_size)
Definition ef9345.c:1209
void ef9345_screen_on(Environment *_environment)
Definition ef9345.c:583
void ef9345_initialization(Environment *_environment)
Definition ef9345.c:729
void ef9345_scroll(Environment *_environment, int _dx, int _dy)
Definition ef9345.c:1177
void ef9345_background_color(Environment *_environment, int _index, int _background_color)
EF9345: emit code to change background color
Definition ef9345.c:295
void ef9345_move_tiles(Environment *_environment, char *_tile, char *_x, char *_y)
Definition ef9345.c:1185
void ef9345_bank_select(Environment *_environment, int _bank)
Definition ef9345.c:405
void ef9345_get_height(Environment *_environment, char *_result)
Definition ef9345.c:681
void ef9345_cline(Environment *_environment, char *_characters)
Definition ef9345.c:912
int ef9345_palette_extract(Environment *_environment, char *_data, int _width, int _height, int _depth, int _flags, RGBi *_palette)
Definition ef9345.c:1221
void ef9345_pset_int(Environment *_environment, int _x, int _y, int *_c)
Definition ef9345.c:571
void ef9345_get_image(Environment *_environment, char *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, int _palette)
Definition ef9345.c:1172
void ef9345_finalization(Environment *_environment)
Definition ef9345.c:883
void ef9345_colormap_at(Environment *_environment, char *_address)
Definition ef9345.c:563
void ef9345_cls(Environment *_environment)
Definition ef9345.c:688
void ef9345_scroll_text(Environment *_environment, int _direction, int _overlap)
Definition ef9345.c:710
void ef9345_sprite_disable(Environment *_environment, char *_sprite)
Definition ef9345.c:611
void ef9345_sprite_expand_horizontal(Environment *_environment, char *_sprite)
Definition ef9345.c:623
void ef9345_tiles_get(Environment *_environment, char *_result)
Definition ef9345.c:674
void ef9345_put_tiles(Environment *_environment, char *_tile, char *_x, char *_y, char *_w, char *_h)
Definition ef9345.c:1189
Variable * ef9345_new_sequence(Environment *_environment, int _sequences, int _frames, int _width, int _height, int _mode)
Definition ef9345.c:1138
Variable * ef9345_sprite_converter(Environment *_environment, char *_source, int _width, int _height, int _depth, RGBi *_color)
Definition ef9345.c:953
void ef9345_bitmap_enable(Environment *_environment, int _width, int _height, int _colors)
Definition ef9345.c:508
void ef9345_sprite_at(Environment *_environment, char *_sprite, char *_x, char *_y)
Definition ef9345.c:615
void ef9345_sprite_multicolor(Environment *_environment, char *_sprite)
Definition ef9345.c:635
void ef9345_hscroll_line(Environment *_environment, int _direction, int _overlap)
Definition ef9345.c:900
void console_calculate_vars(Environment *_environment)
Definition ef9345.c:448
int ef9345_screen_mode_enable(Environment *_environment, ScreenMode *_screen_mode)
Definition ef9345.c:456
void ef9345_bitmap_disable(Environment *_environment)
Definition ef9345.c:528
void ef9345_sprite_data_set(Environment *_environment, char *_sprite, char *_image)
Definition ef9345.c:603
void ef9345_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
EF9345: emit code to set raster irq
Definition ef9345.c:370
void ef9345_screen_rows(Environment *_environment, char *_rows)
Definition ef9345.c:591
void ef9345_sprite_enable(Environment *_environment, char *_sprite)
Definition ef9345.c:607
Variable * ef9345_get_raster_line(Environment *_environment)
Definition ef9345.c:1201
void ef9345_put_tile(Environment *_environment, char *_tile, char *_x, char *_y)
Definition ef9345.c:1181
Variable * ef9345_collision(Environment *_environment, char *_sprite)
EF9345: emit code to check for collision
Definition ef9345.c:251
void ef9345_background_color_semivars(Environment *_environment, int _index, char *_background_color)
EF9345: emit code to change background color
Definition ef9345.c:323
void ef9345_move_memory_video(Environment *_environment, char *_from, char *_to, char *_size)
Definition ef9345.c:1205
void ef9345_sprite_monocolor(Environment *_environment, char *_sprite)
Definition ef9345.c:639
void ef9345_sprite_priority(Environment *_environment, char *_sprite, char *_priority)
Definition ef9345.c:647
void ef9345_cls_box(Environment *_environment, char *_x1, char *_y1, char *_w, char *_h)
Definition ef9345.c:695
void ef9345_back(Environment *_environment)
Definition ef9345.c:908
void ef9345_get_width(Environment *_environment, char *_result)
Definition ef9345.c:667
Variable * ef9345_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)
Definition ef9345.c:1062
void ef9345_put_image(Environment *_environment, Resource *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_flags)
Definition ef9345.c:1070
void ef9345_hit(Environment *_environment, char *_sprite_mask, char *_result)
EF9345: emit code to check for collision
Definition ef9345.c:266
void console_calculate(Environment *_environment)
Definition ef9345.c:432
void ef9345_pset_vars(Environment *_environment, char *_x, char *_y, char *_c)
Definition ef9345.c:575
void ef9345_hscroll_screen(Environment *_environment, int _direction, int _overlap)
Definition ef9345.c:904
void ef9345_tilemap_enable(Environment *_environment, int _width, int _height, int _colors, int _tile_width, int _tile_height)
Definition ef9345.c:534
void ef9345_horizontal_scroll(Environment *_environment, char *_displacement)
Definition ef9345.c:659
Variable * ef9345_new_image(Environment *_environment, int _width, int _height, int _mode)
Definition ef9345.c:1082
void ef9345_colors_vars(Environment *_environment, char *_foreground_color, char *_background_color)
Definition ef9345.c:1213
char * name
Definition ugbc.h:2252
struct _CopperList * next
Definition ugbc.h:2255
int screenTilesWidth
Definition ugbc.h:2880
int screenShades
Definition ugbc.h:2865
int fontHeight
Definition ugbc.h:2905
int currentMode
Definition ugbc.h:2696
int screenTilesHeight
Definition ugbc.h:2885
int consoleTilesHeight
Definition ugbc.h:2895
RgbConverterFunction currentRgbConverterFunction
Definition ugbc.h:2711
int fontWidth
Definition ugbc.h:2900
CopperList * copperList
Definition ugbc.h:3282
int screenColors
Definition ugbc.h:2870
int dynamicConsole
Definition ugbc.h:3298
int screenHeight
Definition ugbc.h:2860
int consoleTilesWidth
Definition ugbc.h:2890
int currentTileMode
Definition ugbc.h:2706
int screenTiles
Definition ugbc.h:2875
int screenWidth
Definition ugbc.h:2855
int defaultPaperColor
Definition ugbc.h:3226
int defaultPenColor
Definition ugbc.h:3225
VestigialConfig vestigialConfig
Definition ugbc.h:2442
unsigned char red
Definition ugbc.h:433
unsigned char green
Definition ugbc.h:434
unsigned char blue
Definition ugbc.h:435
unsigned char index
Definition ugbc.h:437
int selected
Definition ugbc.h:1510
unsigned char * valueBuffer
Definition ugbc.h:1061
int size
Definition ugbc.h:1077
int frameSize
Definition ugbc.h:1134
int frameCount
Definition ugbc.h:1137
char clsImplicit
Definition ugbc.h:2008
void * malloc(YYSIZE_T)
struct _ScreenMode ScreenMode
struct _Resource Resource
struct _RGBi RGBi
Structure to store color components (red, green and blue).
#define WARNING_SCREEN_MODE(v1)
Definition ugbc.h:3878
struct _Variable Variable
Structure of a single variable.
struct _Environment Environment
Structure of compilation environment.
@ VT_WORD
Definition ugbc.h:455
@ VT_POSITION
Definition ugbc.h:468
@ VT_BYTE
Definition ugbc.h:450
@ VT_BUFFER
Definition ugbc.h:477
@ VT_SPRITE
Definition ugbc.h:501
@ VT_SBYTE
Definition ugbc.h:452
@ VT_IMAGES
Definition ugbc.h:495
@ VT_ADDRESS
Definition ugbc.h:465
@ VT_IMAGE
Definition ugbc.h:489
#define SCREEN_MODE_DEFINE(_id, _bitmap, _width, _height, _colors, _tile_width, _tile_height, _description)
Definition ugbc.h:1516
#define MAX_PALETTE
Definition ugbc.h:568
#define CRITICAL_NEW_IMAGES_UNSUPPORTED_MODE(f)
Definition ugbc.h:3688
#define outline0(s)
Definition ugbc.h:4252
#define outline1(s, a)
Definition ugbc.h:4253
#define WARNING_IMAGE_CONVERTER_UNSUPPORTED_MODE(f)
Definition ugbc.h:3880
struct _CopperList CopperList
#define FLAG_EXACT
Definition ugbc.h:4569
#define CRITICAL_NEW_IMAGE_UNSUPPORTED_MODE(f)
Definition ugbc.h:3540
#define deploy(s, e)
Definition ugbc.h:4288
#define outhead1(s, a)
Definition ugbc.h:4247