ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
6847z.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(__vz200__)
36
37#include "../ugbc.h"
38#include <math.h>
39
40static RGBi SYSTEM_PALETTE_ALTERNATE[][4] = {
41 {
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" }
46 },
47 {
48 // { 0x00, 0x00, 0x00, 0xff, 0, "BLACK" },
49 { 0xf0, 0xf0, 0xf0, 0xff, 0, "BUFF" },
50 { 0xaa, 0xff, 0xe6, 0xff, 1, "CYAN" },
51 { 0xcc, 0x44, 0xcc, 0xff, 2, "MAGENTA" },
52 { 0xa1, 0x68, 0x3c, 0xff, 3, "ORANGE" }
53 }
54};
55
56static RGBi * SYSTEM_PALETTE = &SYSTEM_PALETTE_ALTERNATE[1][0];
57
58static RGBi * commonPalette;
60
61/****************************************************************************
62 * CODE SECTION
63 ****************************************************************************/
64
65extern char DATATYPE_AS_STRING[][16];
66
78void c6847z_collision( Environment * _environment, char * _sprite_mask, char * _result ) {
79
80}
81
93void c6847z_hit( Environment * _environment, char * _sprite_mask, char * _result ) {
94
95}
96
106void c6847z_border_color( Environment * _environment, char * _border_color ) {
107
109
110 outline1( "LD A, (%s)", _border_color );
111 outline0( "CP 4" );
112 outline1( "JR C, %scss0", label );
113 outhead1( "%scss1:", label );
114 outline0( "LD HL, $6800" );
115 outline0( "LD A, (HL)" );
116 outline0( "OR $10" );
117 outline0( "LD (HL), A" );
118 outline1( "JMP %sdone", label );
119 outhead1( "%scss0:", label );
120 outline0( "LD HL, $6800" );
121 outline0( "LD A, (HL)" );
122 outline0( "AND $EF" );
123 outline0( "LD (HL), A" );
124 outhead1( "%sdone:", label );
125
126}
127
138void c6847z_background_color( Environment * _environment, char * _index, char * _background_color ) {
139
141
142 (void) _index;
143
144 outline1( "LD A, (%s)", _background_color );
145 outline0( "CP 4" );
146 outline1( "JR C, %scss0", label );
147 outhead1( "%scss1:", label );
148 outline0( "LD HL, $6800" );
149 outline0( "LD A, (HL)" );
150 outline0( "OR $10" );
151 outline0( "LD (HL), A" );
152 outline1( "JP %sdone", label );
153 outhead1( "%scss0:", label );
154 outline0( "LD HL, $6800" );
155 outline0( "LD A, (HL)" );
156 outline0( "AND $EF" );
157 outline0( "LD (HL), A" );
158 outhead1( "%sdone:", label );
159
160}
161
172void c6847z_sprite_common_color( Environment * _environment, char * _index, char * _common_color ) {
173
174}
175
191void c6847z_raster_at( Environment * _environment, char * _label, char * _positionlo, char * _positionhi ) {
192
193}
194
205void c6847z_next_raster( Environment * _environment ) {
206
207}
208
222void c6847z_next_raster_at( Environment * _environment, char * _label, char * _positionlo, char * _positionhi ) {
223
224}
225
226void c6847z_bank_select( Environment * _environment, int _bank ) {
227
228}
229
230#define SET_VIDEOAT_400 SAM_F0_CLR; SAM_F1_CLR; SAM_F2_CLR; SAM_F3_CLR; SAM_F4_CLR; SAM_F5_CLR; SAM_F6_CLR; SAM_F1_SET;
231#define SET_VIDEOAT_600 SAM_F0_CLR; SAM_F1_CLR; SAM_F2_CLR; SAM_F3_CLR; SAM_F4_CLR; SAM_F5_CLR; SAM_F6_CLR; SAM_F0_SET; SAM_F1_SET;
232#define SET_VIDEOAT_C00 SAM_F0_CLR; SAM_F1_CLR; SAM_F2_CLR; SAM_F3_CLR; SAM_F4_CLR; SAM_F5_CLR; SAM_F6_CLR; SAM_F1_SET; SAM_F2_SET;
233
234void console_calculate( Environment * _environment ) {
235
236 // int consoleSA = 0x0c00;
237 // int consoleWB = _environment->activeConsole.width;
238 // int consoleHB = _environment->activeConsole.height * 8;
239
240 // switch( _environment->currentMode ) {
241 // case TILEMAP_MODE_INTERNAL: // Alphanumeric Internal 32 × 16 2 512
242 // case TILEMAP_MODE_EXTERNAL: // Alphanumeric External 32 × 16 2 512
243 // case TILEMAP_MODE_SEMIGRAPHICS4: // Semigraphics 4 64 × 32 8 512
244 // case TILEMAP_MODE_SEMIGRAPHICS6: // Semigraphics 6 64 × 48 4 512
245 // case TILEMAP_MODE_SEMIGRAPHICS8: // Semigraphics 8 64 × 64 2 512
246 // case TILEMAP_MODE_SEMIGRAPHICS12: // Semigraphics 6 64 × 96 1 3072
247 // case TILEMAP_MODE_SEMIGRAPHICS24: // Semigraphics 6 64 × 96 1 3072
248 // break;
249 // case BITMAP_MODE_COLOR1: // Color Graphics 1 64 × 64 4 1024
250 // consoleSA += ( _environment->activeConsole.y1 << 7 ) + ( _environment->activeConsole.x1 << 1 );
251 // consoleWB = _environment->activeConsole.width * 2;
252 // break;
253 // case BITMAP_MODE_RESOLUTION1: // Resolution Graphics 1 128 × 64 1 + Black 1024
254 // consoleSA += ( _environment->activeConsole.y1 << 7 ) + ( _environment->activeConsole.x1 << 2 );
255 // break;
256 // case BITMAP_MODE_COLOR2: // Color Graphics 2 128 × 64 4 2048
257 // consoleSA += ( _environment->activeConsole.y1 << 8 ) + ( _environment->activeConsole.x1 << 1 );
258 // consoleWB = _environment->activeConsole.width * 2;
259 // break;
260 // case BITMAP_MODE_RESOLUTION2: // Resolution Graphics 2 128 × 96 1 + Black 1536
261 // consoleSA += ( _environment->activeConsole.y1 << 7 ) + ( _environment->activeConsole.x1 << 1 );
262 // break;
263 // case BITMAP_MODE_COLOR3: // Color Graphics 3 128 × 96 4 3072
264 // consoleSA += ( _environment->activeConsole.y1 << 8 ) + ( _environment->activeConsole.x1 << 1 );
265 // consoleWB = _environment->activeConsole.width * 2;
266 // break;
267 // case BITMAP_MODE_RESOLUTION3: // Resolution Graphics 3 128 × 192 1 + Black 3072
268 // consoleSA += ( _environment->activeConsole.y1 << 7 ) + ( _environment->activeConsole.x1 << 2 );
269 // break;
270 // case BITMAP_MODE_COLOR6: // Color Graphics 6 128 × 192 4 6144
271 // consoleSA += ( _environment->activeConsole.y1 << 8 ) + ( _environment->activeConsole.x1 << 1 );
272 // consoleWB = _environment->activeConsole.width * 2;
273 // break;
274 // case BITMAP_MODE_RESOLUTION6: // Resolution Graphics 6 256 × 192 1 + Black 6144 break;
275 // consoleSA += ( _environment->activeConsole.y1 << 8 ) + ( _environment->activeConsole.x1 );
276 // consoleWB = _environment->activeConsole.width * 2;
277 // break;
278 // default:
279 // CRITICAL_SCREEN_UNSUPPORTED( _environment->currentMode );
280 // }
281
282 // cpu_store_16bit( _environment, "CONSOLESA", consoleSA );
283 // cpu_store_8bit( _environment, "CONSOLEWB", consoleWB );
284 // cpu_store_8bit( _environment, "CONSOLEHB", consoleHB );
285
286}
287
288void console_calculate_vars( Environment * _environment ) {
289
290 _environment->dynamicConsole = 1;
291
292 // outline0( "JSR CONSOLECALCULATE" );
293
294}
295
296
297int c6847z_screen_mode_enable( Environment * _environment, ScreenMode * _screen_mode ) {
298 // deploy( c6847vars, src_hw_6847_vars_asm );
299
300 _environment->fontWidth = 8;
301 _environment->fontHeight = 8;
302 _environment->screenShades = 4;
303 _environment->screenTiles = 128;
304 switch( _screen_mode->id ) {
305 // ALPHANUMERIC DISPLAY MODES – All alphanumeric modes occupy an 8 x 12
306 // dot character matrix box and there are 32 x 16 character boxes per TV frame.
307 // Each horizontal dot (dot-clock) corresponds to one half the period duration of
308 // the 3.58 MHz clock and each vertical dot is one scan line. One of two colors
309 // for the lighted dots may be selected by the color set select pin (pin 39).
310 // An internal ROM will generate 64 ASCII display characters in a standard 5 x 7 box.
311 // Six bits of the eight-bit data word are used for the ASCII character generator
312 // and the two bits not used are used to implement inverse video and mode
313 // switching to semigraphics – 4, – 8, – 12, or – 24.
314 case TILEMAP_MODE_INTERNAL: // Alphanumeric Internal 32 × 16 2 512
315 _environment->screenWidth = 32*8;
316 _environment->screenHeight = 16*12;
317 _environment->screenTilesWidth = 32;
318 _environment->screenTilesHeight = 16;
319 _environment->screenColors = 4;
320 // Internal alphanumeric 0 X X 0 0 0 0 32x16 ( 5x7 pixel ch)
321 outline0("LD HL, $6800");
322 outline0("LD A, (HL)");
323 outline0("AND $F7");
324 outline0("LD (HL), A");
325 cpu_store_16bit( _environment, "CLIPX1", 0 );
326 cpu_store_16bit( _environment, "CLIPX2", 31 );
327 cpu_store_16bit( _environment, "CLIPY1", 0 );
328 cpu_store_16bit( _environment, "CLIPY2", 15 );
329 cpu_store_16bit( _environment, "CURRENTFRAMESIZE", 32*16 );
330 break;
331 // The 128 x 64 Color Graphics mode generates a display matrix 128
332 // elements wide by 64 elements high. Each element may be one of four
333 // colors. A 2K x 8 display memory is required. Each pixel equals
334 // two dot-clocks by three scan lines.
335 case BITMAP_MODE_COLOR2: // Color Graphics 2 128 × 64 4 2048
336 _environment->screenWidth = 128;
337 _environment->screenHeight = 64;
338 _environment->screenTilesWidth = _environment->screenWidth/_environment->fontWidth;
339 _environment->screenTilesHeight = _environment->screenHeight/_environment->fontHeight;
340 _environment->screenColors = 4;
341 // Full graphic 2-C 1 0 1 0 0 1 0 128x64x4 $800(2048)
342 outline0("LD HL, $6800");
343 outline0("LD A, (HL)");
344 outline0("OR $08");
345 outline0("LD (HL), A");
346 cpu_store_16bit( _environment, "CLIPX1", 0 );
347 cpu_store_16bit( _environment, "CLIPX2", 127 );
348 cpu_store_16bit( _environment, "CLIPY1", 0 );
349 cpu_store_16bit( _environment, "CLIPY2", 63 );
350 cpu_store_16bit( _environment, "CURRENTFRAMESIZE", 2048 );
351 cpu_store_8bit( _environment, "CURRENTSL", 128 / 4 );
352 break;
353 }
354
355 _environment->consoleTilesWidth = _environment->screenTilesWidth;
356 _environment->consoleTilesHeight = _environment->screenTilesHeight;
357
358 cpu_store_16bit( _environment, "ORIGINX", 0 );
359 cpu_store_16bit( _environment, "ORIGINY", 0 );
360 cpu_store_16bit( _environment, "CURRENTWIDTH", _environment->screenWidth );
361 cpu_store_16bit( _environment, "CURRENTHEIGHT", _environment->screenHeight );
362 cpu_move_16bit( _environment, "CURRENTWIDTH", "RESOLUTIONX" );
363 cpu_move_16bit( _environment, "CURRENTHEIGHT", "RESOLUTIONY" );
364 cpu_store_8bit( _environment, "CURRENTTILES", _environment->screenTiles );
365 cpu_store_8bit( _environment, "CURRENTTILESWIDTH", _environment->screenTilesWidth );
366 cpu_store_8bit( _environment, "CURRENTTILESHEIGHT", _environment->screenTilesHeight );
367
368 // console_init( _environment );
369
370 // console_calculate( _environment );
371
372 // console_calculate_vars( _environment );
373
374 if (_environment->vestigialConfig.clsImplicit ) {
375 c6847z_cls( _environment );
376 }
377
378}
379
380void c6847z_bitmap_enable( Environment * _environment, int _width, int _height, int _colors ) {
381
382 ScreenMode * mode = find_screen_mode_by_suggestion( _environment, 1, _width, _height, _colors, 8, 8 );
383
384 if ( mode ) {
385
386 cpu_store_8bit( _environment, "CURRENTMODE", mode->id );
387 cpu_store_8bit( _environment, "CURRENTTILEMODE", 0 );
388
389 _environment->currentMode = mode->id;
390 _environment->currentTileMode = 0;
391
392 c6847z_screen_mode_enable( _environment, mode );
393
394 } else {
396 }
397
398}
399
400void c6847z_bitmap_disable( Environment * _environment ) {
401
402}
403
404void c6847z_tilemap_enable( Environment * _environment, int _width, int _height, int _colors, int _tile_width, int _tile_height ) {
405
406 ScreenMode * mode = find_screen_mode_by_suggestion( _environment, 0, _width, _height, _colors, _tile_width, _tile_height );
407
408 if ( mode ) {
409
410 _environment->currentMode = mode->id;
411 _environment->currentTileMode = 1;
412
413 cpu_store_8bit( _environment, "CURRENTMODE", mode->id );
414 cpu_store_8bit( _environment, "CURRENTTILEMODE", 1 );
415
416 c6847z_screen_mode_enable( _environment, mode );
417
418
419 } else {
421 }
422
423}
424
425void c6847z_bitmap_at( Environment * _environment, char * _address ) {
426
427 // outline1("LDD %s", _address);
428 // outline0("JSR C6847VIDEOSTARTATB" );
429
430}
431
432void c6847z_colormap_at( Environment * _environment, char * _address ) {
433
434}
435
436void c6847z_textmap_at( Environment * _environment, char * _address ) {
437
438 // outline1("LDD %s", _address);
439 // outline0("JSR C6847VIDEOSTARTATT" );
440
441}
442
443void c6847z_pset_int( Environment * _environment, int _x, int _y, int *_c ) {
444
445 deploy( plot, src_hw_6847z_plot_asm );
446
447 outline1("LD A, 0x%2.2x", ( _y & 0xff ) );
448 outline0("LD D, A");
449 outline1("LD A, 0x%2.2x", ( _x & 0xff ) );
450 if ( _c ) {
451 outline0("LD E, A");
452 outline1("LD A, 0x%2.2x", ( *_c & 0xff ) );
453 outline0("LD (PLOTCPE), A");
454 }
455 outline0("LD A, 1");
456 outline0("CALL PLOT");
457
458}
459
460void c6847z_pset_vars( Environment * _environment, char *_x, char *_y, char *_c ) {
461
462 Variable * x = variable_retrieve_or_define( _environment, _x, VT_POSITION, 0 );
463 Variable * y = variable_retrieve_or_define( _environment, _y, VT_POSITION, 0 );
464 Variable * c;
465
466 if ( _c ) {
467 c = variable_retrieve_or_define( _environment, _c, VT_COLOR, 0 );
468 } else {
469 c = variable_retrieve( _environment, "PEN" );
470 }
471
472 deploy( plot, src_hw_6847z_plot_asm );
473
474 outline1("LD A, (%s)", y->realName );
475 outline0("LD D, A");
476 outline1("LD A, (%s)", x->realName );
477 outline0("LD E, A");
478 outline1("LD A, (%s)", c->realName );
479 outline0("LD (PLOTCPE), A");
480 outline0("LD A, 1");
481 outline0("CALL PLOT");
482
483}
484void c6847z_pget_color_vars( Environment * _environment, char *_x, char *_y, char * _result ) {
485
486 // Variable * x = variable_retrieve_or_define( _environment, _x, VT_POSITION, 0 );
487 // Variable * y = variable_retrieve_or_define( _environment, _y, VT_POSITION, 0 );
488 // Variable * result = variable_retrieve_or_define( _environment, _result, VT_BYTE, 0 );
489
490 // deploy( c6847vars, src_hw_6847_vars_asm );
491 // deploy_preferred( plot, src_hw_6847_plot_asm );
492
493 // switch( VT_BITWIDTH( x->type ) ) {
494 // case 32:
495 // if ( x->initializedByConstant ) {
496 // outline1("LDB #$%2.2x", (unsigned char)(x->value&0xff) );
497 // } else {
498 // outline1("LDB %s+3", x->realName );
499 // }
500 // outline0("STB <PLOTX" );
501 // break;
502 // case 16:
503 // if ( x->initializedByConstant ) {
504 // outline1("LDB #$%2.2x", (unsigned char)(x->value&0xff) );
505 // } else {
506 // outline1("LDB %s+1", x->realName );
507 // }
508 // outline0("STB <PLOTX" );
509 // break;
510 // case 8:
511 // if ( x->initializedByConstant ) {
512 // outline1("LDB #$%2.2x", (unsigned char)(x->value&0xff) );
513 // } else {
514 // outline1("LDB %s", x->realName );
515 // }
516 // outline0("STB <PLOTX" );
517 // break;
518 // default:
519 // CRITICAL_PLOT_X_UNSUPPORTED( _x, DATATYPE_AS_STRING[x->type]);
520 // }
521
522 // switch( VT_BITWIDTH( y->type ) ) {
523 // case 32:
524 // if ( y->initializedByConstant ) {
525 // outline1("LDB #$%2.2x", (unsigned char)(y->value&0xff) );
526 // } else {
527 // outline1("LDB %s+3", y->realName );
528 // }
529 // outline0("STB <PLOTY" );
530 // break;
531 // case 16:
532 // if ( y->initializedByConstant ) {
533 // outline1("LDB #$%2.2x", (unsigned char)(y->value&0xff) );
534 // } else {
535 // outline1("LDB %s+1", y->realName );
536 // }
537 // outline0("STB <PLOTY" );
538 // break;
539 // case 8:
540 // if ( y->initializedByConstant ) {
541 // outline1("LDB #$%2.2x", (unsigned char)(y->value&0xff) );
542 // } else {
543 // outline1("LDB %s", y->realName );
544 // }
545 // outline0("STB <PLOTY" );
546 // break;
547 // default:
548 // CRITICAL_PLOT_Y_UNSUPPORTED( _y, DATATYPE_AS_STRING[y->type]);
549 // }
550
551 // outline0("LDB #3");
552 // outline0("STB <PLOTM");
553 // outline0("JSR PLOT");
554 // outline0("LDA <PLOTM");
555 // outline1("STA %s", result->realName );
556
557}
558
559void c6847z_screen_on( Environment * _environment ) {
560
561}
562
563void c6847z_screen_off( Environment * _environment ) {
564
565}
566
567void c6847z_screen_rows( Environment * _environment, char * _rows ) {
568
569}
570
571void c6847z_screen_columns( Environment * _environment, char * _columns ) {
572
573}
574
575void c6847z_sprite_data_from( Environment * _environment, char * _sprite, char * _address ) {
576
577}
578
579void c6847z_sprite_data_set( Environment * _environment, char * _sprite, char * _address ) {
580
581}
582
583void c6847z_sprite_enable( Environment * _environment, char * _sprite ) {
584
585}
586
587void c6847z_sprite_disable( Environment * _environment, char * _sprite ) {
588
589}
590
591void c6847z_sprite_at( Environment * _environment, char * _sprite, char * _x, char * _y ) {
592
593}
594
595void c6847z_sprite_priority( Environment * _environment, char * _sprite, char * _priority ) {
596
597}
598
599void c6847z_sprite_expand_vertical( Environment * _environment, char * _sprite ) {
600
601}
602
603void c6847z_sprite_expand_horizontal( Environment * _environment, char * _sprite ) {
604
605}
606
607void c6847z_sprite_compress_vertical( Environment * _environment, char * _sprite ) {
608
609}
610
611void c6847z_sprite_compress_horizontal( Environment * _environment, char * _sprite ) {
612
613}
614
615void c6847z_sprite_multicolor( Environment * _environment, char * _sprite ) {
616
617}
618
619void c6847z_sprite_monocolor( Environment * _environment, char * _sprite ) {
620
621}
622
623void c6847z_sprite_color( Environment * _environment, char * _sprite, char * _color ) {
624
625}
626
627void c6847z_tiles_at( Environment * _environment, char * _address ) {
628
629}
630
631void c6847z_vertical_scroll( Environment * _environment, char * _displacement ) {
632
633}
634
635void c6847z_horizontal_scroll( Environment * _environment, char * _displacement ) {
636
637}
638
639void c6847z_get_width( Environment * _environment, char *_result ) {
640
641 // outline0("LDX CURRENTWIDTH" );
642 // outline1("STX %s", _result );
643
644}
645
646void c6847z_tiles_get( Environment * _environment, char *_result ) {
647
648 // outline0("LDA CURRENTTILES" );
649 // outline1("STA %s", _result );
650
651}
652
653void c6847z_get_height( Environment * _environment, char *_result ) {
654
655 // outline0("LDX CURRENTHEIGHT" );
656 // outline1("STX %s", _result );
657
658}
659
660void c6847z_cls( Environment * _environment ) {
661
662 if ( _environment->currentMode < 7 ) {
663 deploy( clsText, src_hw_6847z_cls_text_asm );
664 outline0("CALL CLST");
665 } else {
666 deploy( clsGraphic, src_hw_6847z_cls_graphic_asm );
667 outline0("CALL CLSG");
668 }
669
670}
671
672void c6847z_scroll_text( Environment * _environment, int _direction, int _overlap ) {
673
674 // if ( _environment->currentMode < 7 ) {
675 // deploy_preferred( vScrollText, src_hw_6847_vscroll_text_asm );
676 // outline1("LDA #$%2.2x", ( _direction & 0xff ) );
677 // outline0("STA <DIRECTION" );
678 // outline1("LDA #$%2.2x", ( _overlap & 0xff ) );
679 // outline0("STA <PORT" );
680 // outline0("JSR VSCROLLT");
681 // } else {
682 // deploy_preferred( vScroll, src_hw_6847_vscroll_graphic_asm );
683 // outline1("LDA #$%2.2x", ( _direction & 0xff ) );
684 // outline0("STA <DIRECTION" );
685 // outline1("LDA #$%2.2x", ( _overlap & 0xff ) );
686 // outline0("STA <PORT" );
687 // outline0("JSR VSCROLLG");
688 // }
689
690}
691
692void c6847z_text( Environment * _environment, char * _text, char * _text_size, int _raw ) {
693
694 // deploy( vScrollTextUp, src_hw_6847z_vscroll_text_up_asm );
695 deploy( textEncodedAt, src_hw_6847z_text_at_asm );
696
697 outline1("LD DE, (%s)", _text);
698 outline1("LD A, (%s)", _text_size);
699 outline0("LD C, A");
700
701 if ( _raw ) {
702 if ( _environment->currentMode < 7 ) {
703 deploy( clsText, src_hw_6847z_cls_text_asm );
704 deploy_preferred( vScrollText, src_hw_6847z_vscroll_text_asm );
705 deploy( textEncodedAtTextRaw, src_hw_6847z_text_at_text_raw_asm );
706 outline0("CALL TEXTATTILEMODERAW");
707 } else {
708 // deploy( clsGraphic, src_hw_6847_cls_graphic_asm );
709 // deploy( vScroll, src_hw_6847_vscroll_graphic_asm );
710 // deploy( textEncodedAtGraphicRaw, src_hw_6847_text_at_graphic_raw_asm );
711 // outline0("JSR TEXTATBITMAPMODERAW");
712 }
713 } else {
714 if ( _environment->currentMode < 7 ) {
715 deploy( clsText, src_hw_6847z_cls_text_asm );
716 deploy_preferred( vScrollText, src_hw_6847_vscroll_text_asm );
717 deploy( textEncodedAtText, src_hw_6847z_text_at_text_asm );
718 outline0("CALL TEXTATTILEMODE");
719 } else {
720 // deploy( clsGraphic, src_hw_6847_cls_graphic_asm );
721 // deploy( vScroll, src_hw_6847_vscroll_graphic_asm );
722 // deploy( textEncodedAtGraphic, src_hw_6847_text_at_graphic_asm );
723 // outline0("JSR TEXTATBITMAPMODE");
724 }
725 }
726
727}
728
729void c6847z_initialization( Environment * _environment ) {
730
731 // deploy( c6847vars, src_hw_6847_vars_asm );
732 deploy( c6847startup, src_hw_6847z_startup_asm );
733
734 variable_import( _environment, "CURRENTMODE", VT_BYTE, 0 );
735 variable_global( _environment, "CURRENTMODE" );
736 variable_import( _environment, "CURRENTTILEMODE", VT_BYTE, 1 );
737 variable_global( _environment, "CURRENTTILEMODE" );
738
739 variable_import( _environment, "CURRENTWIDTH", VT_POSITION, 256 );
740 variable_global( _environment, "CURRENTWIDTH" );
741 variable_import( _environment, "CURRENTHEIGHT", VT_POSITION, 128 );
742 variable_global( _environment, "CURRENTHEIGHT" );
743 variable_import( _environment, "CURRENTTILESWIDTH", VT_SBYTE, 32 );
744 variable_global( _environment, "CURRENTTILESWIDTH" );
745 variable_import( _environment, "CURRENTTILESHEIGHT", VT_SBYTE, 16 );
746 variable_global( _environment, "CURRENTTILESHEIGHT" );
747 variable_import( _environment, "CURRENTTILES", VT_BYTE, 255 );
748 variable_global( _environment, "CURRENTTILES" );
749 variable_import( _environment, "FONTWIDTH", VT_BYTE, 8 );
750 variable_global( _environment, "FONTWIDTH" );
751 variable_import( _environment, "FONTHEIGHT", VT_BYTE, 8 );
752 variable_global( _environment, "FONTHEIGHT" );
753 variable_import( _environment, "CURRENTFRAMESIZE", VT_WORD, 0 );
754 variable_global( _environment, "CURRENTFRAMESIZE" );
755 variable_import( _environment, "IMAGEF", VT_BYTE, 0 );
756 variable_global( _environment, "IMAGEF" );
757 variable_import( _environment, "IMAGET", VT_BYTE, 0 );
758 variable_global( _environment, "IMAGET" );
759 variable_import( _environment, "CURRENTSL", VT_BYTE, 0 );
760 variable_global( _environment, "CURRENTSL" );
761
762 SCREEN_MODE_DEFINE( TILEMAP_MODE_INTERNAL, 0, 32, 16, 2, 8, 8, "Alphanumeric Internal");
763 SCREEN_MODE_DEFINE( BITMAP_MODE_COLOR2, 1, 128, 64, 4, 8, 8, "Color Graphics 2" );
764
765 outline0("CALL C6847ZSTARTUP");
766
767 variable_import( _environment, "XGR", VT_POSITION, 0 );
768 variable_global( _environment, "XGR" );
769 variable_import( _environment, "YGR", VT_POSITION, 0 );
770 variable_global( _environment, "YGR" );
771 variable_import( _environment, "LINE", VT_WORD, (unsigned short)(0xffff) );
772 variable_global( _environment, "LINE" );
773 variable_import( _environment, "TABCOUNT", VT_BYTE, 4 );
774 variable_global( _environment, "TABCOUNT" );
775 variable_import( _environment, "TABSTODRAW", VT_BYTE, 0 );
776 variable_global( _environment, "TABSTODRAW" );
777
778 variable_import( _environment, "PLOTAMA", VT_BYTE, 0 );
779 variable_global( _environment, "PLOTAMA" );
780 variable_import( _environment, "PLOTOMA", VT_BYTE, 0 );
781 variable_global( _environment, "PLOTOMA" );
782 variable_import( _environment, "PLOTNB", VT_BYTE, 0 );
783 variable_global( _environment, "PLOTNB" );
784 variable_import( _environment, "PLOTND", VT_BYTE, 0 );
785 variable_global( _environment, "PLOTND" );
786 variable_import( _environment, "PLOTCPE", VT_BYTE, 0 );
787 variable_global( _environment, "PLOTCPE" );
788
789 variable_import( _environment, "CLIPX1", VT_POSITION, 0 );
790 variable_global( _environment, "CLIPX1" );
791 variable_import( _environment, "CLIPX2", VT_POSITION, 255 );
792 variable_global( _environment, "CLIPX2" );
793 variable_import( _environment, "CLIPY1", VT_POSITION, 0 );
794 variable_global( _environment, "CLIPY1" );
795 variable_import( _environment, "CLIPY2", VT_POSITION, 127 );
796 variable_global( _environment, "CLIPY2" );
797
798 variable_import( _environment, "ORIGINX", VT_POSITION, 0 );
799 variable_global( _environment, "ORIGINX" );
800 variable_import( _environment, "ORIGINY", VT_POSITION, 0 );
801 variable_global( _environment, "ORIGINY" );
802 variable_import( _environment, "RESOLUTIONX", VT_POSITION, 0 );
803 variable_global( _environment, "RESOLUTIONX" );
804 variable_import( _environment, "RESOLUTIONY", VT_POSITION, 0 );
805 variable_global( _environment, "RESOLUTIONY" );
806
807 _environment->fontConfig.schema = FONT_SCHEMA_ASCII;
808
809 font_descriptors_init( _environment, 0 );
810
811 _environment->fontWidth = 8;
812 _environment->fontHeight = 8;
813 _environment->screenTilesWidth = 32;
814 _environment->screenTilesHeight = 16;
815 _environment->consoleTilesWidth = 32;
816 _environment->consoleTilesHeight = 16;
817 _environment->screenTiles = 128;
818 _environment->screenWidth = _environment->screenTilesWidth*_environment->fontWidth;
819 _environment->screenHeight = _environment->screenTilesHeight*_environment->fontHeight;
820 _environment->screenShades = 4;
821 _environment->screenColors = 4;
822
823 console_init( _environment );
824
825 c6847z_tilemap_enable( _environment, 32, 16, 1, 8, 8 );
826
827 if ( _environment->vestigialConfig.clsImplicit ) {
828 c6847z_cls( _environment );
829 }
830
831}
832
833void c6847z_finalization( Environment * _environment ) {
834
835 if (_environment->vestigialConfig.clsImplicit ) {
836 deploy( clsText, src_hw_6847z_cls_text_asm );
837 }
838
839 CopperList * copperList = _environment->copperList;
840 if ( copperList ) {
841 while(copperList) {
842 outhead1("COPPERACTIVATE%s:", copperList->name ? copperList->name : "" );
843 outline0("RET");
844 copperList = copperList->next;
845 }
846 }
847
848}
849
850void c6847z_hscroll_line( Environment * _environment, int _direction, int _overlap ) {
851
852 // deploy_preferred( textHScroll, src_hw_6847_hscroll_text_asm );
853
854 // Variable * y = variable_retrieve( _environment, "YCURSYS" );
855 // outline1("LDA #$%2.2x", ( _direction & 0xff ) );
856 // outline0("STA <DIRECTION" );
857 // outline1("LDA #$%2.2x", ( _overlap & 0xff ) );
858 // outline0("STA <PORT" );
859 // outline1("LDA %s", y->realName );
860 // outline0("STA <CLINEY");
861
862 // outline0("JSR HSCROLLLT");
863
864}
865
866void c6847z_hscroll_screen( Environment * _environment, int _direction, int _overlap ) {
867
868 // deploy_preferred( textHScroll, src_hw_6847_hscroll_text_asm );
869
870 // outline1("LDA #$%2.2x", ( _direction & 0xff ) );
871 // outline0("STA <DIRECTION" );
872 // outline1("LDA #$%2.2x", ( _overlap & 0xff ) );
873 // outline0("STA <PORT" );
874
875 // outline0("JSR HSCROLLST");
876
877}
878
879void c6847z_back( Environment * _environment ) {
880
881}
882
883void c6847z_cline( Environment * _environment, char * _characters ) {
884
885 // Variable * x = variable_retrieve( _environment, "XCURSYS" );
886 // Variable * y = variable_retrieve( _environment, "YCURSYS" );
887
888 // if ( _characters ) {
889 // outline1("LDD %s", _characters);
890 // } else {
891 // outline0("LDD #0");
892 // }
893 // outline0("STB <CHARACTERS");
894 // outline1("LDA %s", x->realName );
895 // outline0("STA <CLINEX" );
896 // outline1("LDA %s", y->realName );
897 // outline0("STA <CLINEY");
898
899 // if ( _environment->currentMode < 7 ) {
900 // deploy( textCline, src_hw_6847_cline_text_asm );
901 // outline0("JSR CLINE");
902 // } else {
903 // deploy( textClineGraphic, src_hw_6847_cline_graphic_asm );
904 // outline0("JSR CLINEG");
905 // }
906
907}
908
909int c6847z_image_size( Environment * _environment, int _width, int _height, int _mode ) {
910
911 switch( _mode ) {
912 case TILEMAP_MODE_INTERNAL: // Alphanumeric Internal 32 × 16 2 512
913 break;
914 case BITMAP_MODE_COLOR2: // Color Graphics 2 128 × 64 4 2048
915 return 3 + ( ( _width >> 2 ) * _height );
916
917 }
918
919 return 0;
920
921}
922
923static int calculate_images_size( Environment * _environment, int _frames, int _width, int _height, int _mode ) {
924
925 switch( _mode ) {
926 case TILEMAP_MODE_INTERNAL: // Alphanumeric Internal 32 × 16 2 512
927 break;
928 case BITMAP_MODE_COLOR2: // Color Graphics 2 128 × 64 4 2048
929 return 3 + ( 3 + ( ( _width >> 2 ) * _height ) ) * _frames;
930
931 }
932
933 return 0;
934
935}
936
937static int calculate_sequence_size( Environment * _environment, int _sequences, int _frames, int _width, int _height, int _mode ) {
938
939 switch( _mode ) {
940 case TILEMAP_MODE_INTERNAL: // Alphanumeric Internal 32 × 16 2 512
941 break;
942 case BITMAP_MODE_COLOR2: // Color Graphics 2 128 × 64 4 2048
943 return 3 + ( ( 3 + ( ( _width >> 2 ) * _height ) ) * _frames ) * _sequences;
944
945 }
946
947 return 0;
948
949}
950
951static Variable * c6847z_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 ) {
952
953 RGBi white = { 0xff, 0xff, 0xff, 0xff };
954 RGBi black = { 0x00, 0x00, 0x00, 0x00 };
955
956 // ignored on bitmap mode
957 (void)!_transparent_color;
958
959 image_converter_asserts_free_height( _environment, _width, _height, _offset_x, _offset_y, &_frame_width, &_frame_height, 8 );
960
961 if ( _environment->freeImageWidth ) {
962 if ( _width % 8 ) {
963 _width = ( ( ( _width - 1 ) / 8 ) - 1 ) * 8;
964 }
965 if ( _frame_width % 8 ) {
966 _frame_width = ( ( ( _frame_width - 1 ) / 8 ) - 1 ) * 8;
967 }
968 }
969
970 RGBi * palette = malloc_palette( MAX_PALETTE );
971
972 int paletteColorCount = rgbi_extract_palette(_environment, _source, _width, _height, _depth, palette, MAX_PALETTE, ( ( _flags & FLAG_EXACT ) ? 0 : 1 ) /* sorted */);
973
974 if (paletteColorCount > 4) {
975 CRITICAL_IMAGE_CONVERTER_TOO_COLORS( paletteColorCount );
976 }
977
978 int i, j, k;
979
980 SYSTEM_PALETTE = &SYSTEM_PALETTE_ALTERNATE[_environment->paletteSelected][0];
981
982 commonPalette = palette_match( palette, paletteColorCount, SYSTEM_PALETTE, sizeof(SYSTEM_PALETTE_ALTERNATE[0]) / sizeof(RGBi) );
983 commonPalette = palette_remove_duplicates( commonPalette, paletteColorCount, &paletteColorCount );
984 lastUsedSlotInCommonPalette = paletteColorCount;
985 adilinepalette( "CPM1:%d", paletteColorCount, commonPalette );
986
987 adilinepalette( "CPMS:%d", (int)(sizeof(SYSTEM_PALETTE_ALTERNATE[0]) / sizeof(RGBi)), SYSTEM_PALETTE );
988
989 Variable * result = variable_temporary( _environment, VT_IMAGE, 0 );
991 memcpy( result->originalPalette, commonPalette, lastUsedSlotInCommonPalette * sizeof( RGBi ) );
992
993 int bufferSize = c6847z_image_size( _environment, _frame_width, _frame_height, BITMAP_MODE_COLOR2 );
994
995 adiline3("BMP:%4.4x:%4.4x:%2.2x", _frame_width, _frame_height, BITMAP_MODE_COLOR2 );
996
997 char * buffer = malloc ( bufferSize );
998 memset( buffer, 0, bufferSize );
999
1000 // Position of the pixel in the original image
1001 int image_x, image_y;
1002
1003 // Position of the pixel, in terms of tiles
1004 int tile_x, tile_y;
1005
1006 // Position of the pixel, in terms of offset and bitmask
1007 int offset, offsetc, bitmask;
1008
1009 // Color of the pixel to convert
1010 RGBi rgb;
1011
1012 *(buffer) = _frame_width;
1013 *(buffer+1) = _frame_height;
1014 *(buffer+2) = 0;
1015
1016 _source += ( ( _offset_y * _width ) + _offset_x ) * _depth;
1017
1018 adilinebeginbitmap("BMD");
1019
1020 // Loop for all the source surface.
1021 for (image_y = 0; image_y < _frame_height; ++image_y) {
1022 for (image_x = 0; image_x < _frame_width; ++image_x) {
1023
1024 // Take the color of the pixel
1025 rgb.red = *_source;
1026 rgb.green = *(_source + 1);
1027 rgb.blue = *(_source + 2);
1028 if ( _depth > 3 ) {
1029 rgb.alpha = *(_source + 3);
1030 } else {
1031 rgb.alpha = 255;
1032 }
1033 if ( rgb.alpha == 0 ) {
1034 rgb.red = 0;
1035 rgb.green = 0;
1036 rgb.blue = 0;
1037 }
1038
1039 offset = ( image_y * ( _frame_width >> 2 ) ) + ( image_x >> 2 );
1040
1041 int colorIndex = 0;
1042
1043 if ( rgb.alpha < 255 ) {
1044 colorIndex = 0;
1045 } else {
1046 int minDistance = 9999;
1047 for( int i=0; i<lastUsedSlotInCommonPalette; ++i ) {
1048 int distance = rgbi_distance(&commonPalette[i], &rgb );
1049 if ( distance < minDistance ) {
1050 minDistance = distance;
1051 colorIndex = commonPalette[i].index;
1052 }
1053 }
1054 }
1055
1056 adilinepixel(colorIndex);
1057
1058 // printf( "%1.1x", colorIndex );
1059
1060 bitmask = colorIndex << (6 - ((image_x & 0x3) * 2));
1061
1062 *(buffer + 3 + offset) |= bitmask;
1063
1064 _source += _depth;
1065
1066 }
1067
1068 _source += ( _width - _frame_width ) * _depth;
1069
1070 // printf("\n" );
1071 }
1072
1074
1075 // for(i=0; i<4; ++i ) {
1076 // printf( "%1.1x = %2.2x\n", i, palette[i].index );
1077 // }
1078
1079 // printf("\n" );
1080 // printf("\n" );
1081
1082 variable_store_buffer( _environment, result->name, buffer, bufferSize, 0 );
1083
1084 return result;
1085
1086}
1087
1088Variable * c6847z_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 ) {
1089
1090 switch( _mode ) {
1091 case TILEMAP_MODE_INTERNAL: // Alphanumeric Internal 32 × 16 2 512
1092 break;
1093 case BITMAP_MODE_COLOR2: // Color Graphics 2 128 × 64 4 2048
1094
1095 return c6847z_image_converter_multicolor_mode_standard( _environment, _data, _width, _height, _depth, _offset_x, _offset_y, _frame_width, _frame_height, _transparent_color, _flags );
1096
1097 break;
1098
1099 }
1100
1102
1103 return c6847z_new_image( _environment, 8, 8, BITMAP_MODE_COLOR2 );
1104
1105}
1106
1107static void c6847z_load_image_address_to_register( Environment * _environment, char * _register, Resource * _source, char * _sequence, char * _frame, int _frame_size, int _frame_count ) {
1108
1109 // if ( !_sequence && !_frame ) {
1110 // if ( _source->isAddress ) {
1111 // outline1("LDY %s", _source->realName );
1112 // outline1("STY %s", _register );
1113 // } else {
1114 // outline1("LDY #%s", _source->realName );
1115 // outline1("STY %s", _register );
1116 // }
1117 // } else {
1118
1119 // if ( _source->isAddress ) {
1120 // outline1("LDY %s", _source->realName );
1121 // } else {
1122 // outline1("LDY #%s", _source->realName );
1123 // }
1124
1125 // if ( _sequence ) {
1126 // outline0("LEAY 3,y" );
1127 // if ( strlen(_sequence) == 0 ) {
1128 // } else {
1129 // outline1("LDB %s", _sequence );
1130 // outline1("JSR %soffsetsequence", _source->realName );
1131 // }
1132 // if ( _frame ) {
1133 // if ( strlen(_frame) == 0 ) {
1134 // } else {
1135 // outline1("LDB %s", _frame );
1136 // outline1("JSR %soffsetframe", _source->realName );
1137 // }
1138 // }
1139 // } else {
1140 // if ( _frame ) {
1141 // outline0("LEAY 3,y" );
1142 // if ( strlen(_frame) == 0 ) {
1143 // } else {
1144 // outline1("LDB %s", _frame );
1145 // outline1("JSR %soffsetframe", _source->realName );
1146 // }
1147 // }
1148 // }
1149
1150 // outline1("STY %s", _register );
1151
1152 // }
1153
1154}
1155
1156void c6847z_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 ) {
1157
1158 // deploy( c6847vars, src_hw_6847_vars_asm);
1159 // deploy( blitimage, src_hw_6847_blit_image_asm );
1160
1161 // if ( _source_count > 2 ) {
1162 // CRITICAL_BLIT_TOO_MUCH_SOURCES( );
1163 // }
1164
1165 // MAKE_LABEL
1166
1167 // outhead1("blitimage%s", label);
1168
1169 // outline1("LDY #%s", _blit );
1170 // outline0("STY BLITIMAGEBLITADDR" );
1171
1172 // if ( _source_count > 0 ) {
1173 // Resource resource;
1174 // resource.realName = strdup( _sources[0] );
1175 // resource.isAddress = 0;
1176 // resource.type = VT_IMAGE;
1177 // c6847z_load_image_address_to_register( _environment, "BLITTMPPTR", &resource, _sequence, _frame, _frame_size, _frame_count );
1178 // } else {
1179 // outline0( "LDY #0" );
1180 // outline0( "STY BLITTMPPTR" );
1181 // }
1182
1183 // if ( _source_count > 1 ) {
1184 // Resource resource;
1185 // resource.realName = strdup( _sources[1] );
1186 // resource.isAddress = 0;
1187 // resource.type = VT_IMAGE;
1188 // c6847z_load_image_address_to_register( _environment, "BLITTMPPTR2", &resource, _sequence, _frame, _frame_size, _frame_count );
1189 // } else {
1190 // outline0( "LDY #0" );
1191 // outline0( "STY BLITTMPPTR2" );
1192 // }
1193
1194 // outline1("LDD %s", _x );
1195 // outline0("STD <IMAGEX" );
1196 // outline1("LDD %s", _y );
1197 // outline0("STD <IMAGEY" );
1198
1199 // outline1("LDA #$%2.2x", ( _flags & 0xff ) );
1200 // outline0("STA <IMAGEF" );
1201 // outline1("LDA #$%2.2x", ( (_flags>>8) & 0xff ) );
1202 // outline0("STA <IMAGET" );
1203
1204 // outline0("JSR BLITIMAGE");
1205
1206}
1207
1208void c6847z_put_image( Environment * _environment, Resource * _source, char * _x, char * _y, char * _frame, char * _sequence, int _frame_size, int _frame_count, char * _flags ) {
1209
1210 deploy( putimage, src_hw_6847z_put_image_asm );
1211
1212 if ( _source->isAddress ) {
1213 outline1("LD HL, (%s)", _source->realName );
1214 } else {
1215 outline1("LD HL, %s", _source->realName );
1216 }
1217
1218 if ( _frame_size ) {
1219 if ( !_sequence && !_frame ) {
1220 } else {
1221 if ( _sequence ) {
1222 outline0("LD DE, $0003" );
1223 outline0("ADD HL, DE" );
1224 if ( strlen(_sequence) == 0 ) {
1225 } else {
1226 outline1("LD A, (%s)", _sequence );
1227 outline0("PUSH HL" );
1228 outline0("POP IX" );
1229 outline1("CALL %soffsetsequence", _source->realName );
1230 }
1231 if ( _frame ) {
1232 if ( strlen(_frame) == 0 ) {
1233 } else {
1234 outline1("LD A, (%s)", _frame );
1235 outline0("PUSH HL" );
1236 outline0("POP IX" );
1237 outline1("CALL %soffsetframe", _source->realName );
1238 }
1239 }
1240 } else {
1241 if ( _frame ) {
1242 outline0("LD DE, $0003" );
1243 outline0("ADD HL, DE" );
1244 if ( strlen(_frame) == 0 ) {
1245 } else {
1246 outline1("LD A, (%s)", _frame );
1247 outline0("PUSH HL" );
1248 outline0("POP IX" );
1249 outline1("CALL %soffsetframe", _source->realName );
1250 }
1251 }
1252 }
1253
1254 }
1255 }
1256
1257 outline1("LD A, (%s)", _x );
1258 outline0("LD E, A" );
1259 outline1("LD A, (%s)", _y );
1260 outline0("LD D, A" );
1261
1262 outline0("PUSH HL" );
1263 outline1("LD HL, %s", _flags );
1264 outline0("LD A, L" );
1265 outline0("LD (IMAGEF), A" );
1266 outline0("LD A, H" );
1267 outline0("LD (IMAGET), A" );
1268 outline0("POP HL" );
1269
1270 outline0("CALL PUTIMAGE");
1271
1272}
1273
1274Variable * c6847z_new_image( Environment * _environment, int _width, int _height, int _mode ) {
1275
1276 int size = c6847z_image_size( _environment, _width, _height, _mode );
1277
1278 if ( ! size ) {
1280 }
1281
1282 Variable * result = variable_temporary( _environment, VT_IMAGE, "(new image)" );
1283
1284 char * buffer = malloc ( size );
1285 memset( buffer, 0, size );
1286
1287 *(buffer) = _width;
1288 *(buffer+1) = _height;
1289 *(buffer+2) = 0;
1290
1291 result->valueBuffer = buffer;
1292 result->size = size;
1293
1294 return result;
1295
1296}
1297
1298Variable * c6847z_new_images( Environment * _environment, int _frames, int _width, int _height, int _mode ) {
1299
1300 int size = calculate_images_size( _environment, _frames, _width, _height, _mode );
1301 int frameSize = c6847z_image_size( _environment, _width, _height, _mode );
1302
1303 if ( ! size ) {
1305 }
1306
1307 Variable * result = variable_temporary( _environment, VT_IMAGES, "(new images)" );
1308
1309 char * buffer = malloc ( size );
1310 memset( buffer, 0, size );
1311
1312 *(buffer) = _frames;
1313 *(buffer+1) = ( _width & 0xff );
1314 *(buffer+2) = ( _width >> 8 ) & 0xff;
1315 for( int i=0; i<_frames; ++i ) {
1316 *(buffer+3+(i*frameSize)) = _width;
1317 *(buffer+3+(i*frameSize)+1) = _height;
1318 }
1319
1320 result->valueBuffer = buffer;
1321 result->frameSize = frameSize;
1322 result->size = size;
1323 result->frameCount = _frames;
1324
1325 return result;
1326
1327}
1328
1329Variable * c6847z_new_sequence( Environment * _environment, int _sequences, int _frames, int _width, int _height, int _mode ) {
1330
1331 int size2 = calculate_sequence_size( _environment, _sequences, _frames, _width, _height, _mode );
1332 int size = calculate_images_size( _environment, _frames, _width, _height, _mode );
1333 int frameSize = c6847z_image_size( _environment, _width, _height, _mode );
1334
1335 if ( ! size ) {
1337 }
1338
1339 Variable * result = variable_temporary( _environment, VT_SEQUENCE, "(new sequence)" );
1340
1341 char * buffer = malloc ( size2 );
1342 memset( buffer, 0, size2 );
1343
1344 *(buffer) = _frames;
1345 *(buffer+1) = _width;
1346 *(buffer+2) = _sequences;
1347 for( int i=0; i<(_frames * _sequences); ++i ) {
1348 *(buffer+3+(i*frameSize)) = _width;
1349 *(buffer+3+(i*frameSize)+1) = _height;
1350 }
1351
1352 result->valueBuffer = buffer;
1353 result->frameSize = frameSize;
1354 result->size = size2;
1355 result->frameCount = _frames;
1356
1357 return result;
1358
1359}
1360
1361void c6847z_get_image( Environment * _environment, char * _image, char * _x, char * _y, char * _frame, char * _sequence, int _frame_size, int _frame_count, int _palette ) {
1362
1363 // deploy( c6847vars, src_hw_6847_vars_asm);
1364 // deploy( getimage, src_hw_6847_get_image_asm );
1365
1366 // outline1("LDY #%s", _image );
1367 // if ( _sequence ) {
1368 // outline0("LEAY 3,y" );
1369 // if ( strlen(_sequence) == 0 ) {
1370 // } else {
1371 // outline1("LDX #OFFSETS%4.4x", _frame_count * _frame_size );
1372 // outline1("LDB %s", _sequence );
1373 // outline0("LDA #0" );
1374 // outline0("LEAX D, X" );
1375 // outline0("LEAX D, X" );
1376 // outline0("LDD ,X" );
1377 // outline0("LEAY D, Y" );
1378 // }
1379 // if ( _frame ) {
1380 // if ( strlen(_frame) == 0 ) {
1381 // } else {
1382 // outline1("LDX #OFFSETS%4.4x", _frame_size );
1383 // outline1("LDB %s", _frame );
1384 // outline0("LDA #0" );
1385 // outline0("LEAX D, X" );
1386 // outline0("LEAX D, X" );
1387 // outline0("LDD ,X" );
1388 // outline0("LEAY D, Y" );
1389 // }
1390 // }
1391 // } else {
1392 // if ( _frame ) {
1393 // outline0("LEAY 3,y" );
1394 // if ( strlen(_frame) == 0 ) {
1395 // } else {
1396 // outline1("LDX #OFFSETS%4.4x", _frame_size );
1397 // outline1("LDB %s", _frame );
1398 // outline0("LDA #0" );
1399 // outline0("LEAX D, X" );
1400 // outline0("LEAX D, X" );
1401 // outline0("LDD ,X" );
1402 // outline0("LEAY D, Y" );
1403 // }
1404 // }
1405 // }
1406
1407 // outline1("LDD %s", _x );
1408 // outline0("STD <IMAGEX" );
1409 // outline1("LDD %s", _y );
1410 // outline0("STD <IMAGEY" );
1411 // outline1("LDA #$%2.2x", _palette );
1412 // outline0("STA <IMAGET");
1413
1414 // outline0("JSR GETIMAGE");
1415
1416}
1417
1418void c6847z_scroll( Environment * _environment, int _dx, int _dy ) {
1419
1420}
1421
1422void c6847z_put_tile( Environment * _environment, char * _tile, char * _x, char * _y ) {
1423
1424}
1425
1426void c6847z_tile_at( Environment * _environment, char * _x, char * _y, char * _result ) {
1427
1428}
1429
1430void c6847z_move_tiles( Environment * _environment, char * _tile, char * _x, char * _y ) {
1431
1432}
1433
1434void c6847z_put_tiles( Environment * _environment, char * _tile, char * _x, char * _y, char *_w, char *_h ) {
1435
1436
1437}
1438
1439void c6847z_use_tileset( Environment * _environment, char * _tileset ) {
1440
1441}
1442
1444
1445 // Variable * result = variable_temporary( _environment, VT_WORD, "(raster line)" );
1446
1447 // variable_store( _environment, result->name, 0 );
1448
1449 // return result;
1450
1451}
1452
1453void c6847z_slice_image( Environment * _environment, char * _image, char * _frame, char * _sequence, int _frame_size, int _frame_count, char * _destination ) {
1454
1455}
1456
1457int c6847z_palette_extract( Environment * _environment, char * _data, int _width, int _height, int _depth, int _flags, RGBi * _palette ) {
1458
1459 // int paletteColorCount = rgbi_extract_palette(_environment, _data, _width, _height, _depth, _palette, MAX_PALETTE, ( ( _flags & FLAG_EXACT ) ? 0 : 1 ) /* sorted */);
1460
1461 // SYSTEM_PALETTE = &SYSTEM_PALETTE_ALTERNATE[_environment->paletteSelected][0];
1462
1463 // memcpy( _palette, palette_match( _palette, paletteColorCount, SYSTEM_PALETTE, sizeof(SYSTEM_PALETTE) / sizeof(RGBi) ), paletteColorCount * sizeof( RGBi ) );
1464
1465 // int uniquePaletteCount = 0;
1466
1467 // memcpy( _palette, palette_remove_duplicates( _palette, paletteColorCount, &uniquePaletteCount ), paletteColorCount * sizeof( RGBi ) );
1468
1469 // return uniquePaletteCount;
1470
1471}
1472
1473void c6847z_calculate_sequence_frame_offset( Environment * _environment, char * _offset, char * _sequence, char * _frame, int _frame_size, int _frame_count ) {
1474
1475 // outline0("LDY #$0" );
1476 // if ( _sequence ) {
1477 // outline0("LEAY 3,y" );
1478 // if ( strlen(_sequence) == 0 ) {
1479 // } else {
1480 // outline1("LDX #OFFSETS%4.4x", _frame_count * _frame_size );
1481 // outline1("LDB %s", _sequence );
1482 // outline0("LDA #0" );
1483 // outline0("LEAX D, X" );
1484 // outline0("LEAX D, X" );
1485 // outline0("LDD ,X" );
1486 // outline0("LEAY D, Y" );
1487 // }
1488 // if ( _frame ) {
1489 // if ( strlen(_frame) == 0 ) {
1490 // } else {
1491 // outline1("LDX #OFFSETS%4.4x", _frame_size );
1492 // outline1("LDB %s", _frame );
1493 // outline0("LDA #0" );
1494 // outline0("LEAX D, X" );
1495 // outline0("LEAX D, X" );
1496 // outline0("LDD ,X" );
1497 // outline0("LEAY D, Y" );
1498 // }
1499 // }
1500 // } else {
1501 // if ( _frame ) {
1502 // outline0("LEAY 3,y" );
1503 // if ( strlen(_frame) == 0 ) {
1504 // } else {
1505 // outline1("LDX #OFFSETS%4.4x", _frame_size );
1506 // outline1("LDB %s", _frame );
1507 // outline0("LDA #0" );
1508 // outline0("LEAX D, X" );
1509 // outline0("LEAX D, X" );
1510 // outline0("LDD ,X" );
1511 // outline0("LEAY D, Y" );
1512 // }
1513 // }
1514 // }
1515
1516 // outline1("STY %s", _offset );
1517
1518}
1519
1520void c6847z_flip_image( Environment * _environment, Resource * _image, char * _frame, char * _sequence, int _frame_size, int _frame_count, char * _direction ) {
1521
1522 // deploy( c6847vars, src_hw_6847_vars_asm);
1523
1524 // if ( strcmp( _direction, "#FLIPIMAGEDIRECTION0001" ) == 0 || strcmp( _direction, "#FLIPIMAGEDIRECTION0003" ) == 0 ) {
1525 // c6847z_load_image_address_to_register( _environment, "TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
1526 // deploy( flipimagex, src_hw_6847_flip_image_x_asm );
1527 // outline0("JSR FLIPIMAGEX");
1528 // } else {
1529
1530 // MAKE_LABEL
1531
1532 // c6847z_load_image_address_to_register( _environment, "TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
1533 // deploy( flipimagex, src_hw_6847_flip_image_x_asm );
1534 // outline1("LDA %s", _direction );
1535 // outline1("ANDA #$%2.2x", FLAG_FLIP_X );
1536 // outline1("BEQ %s", label );
1537 // outline0("JSR FLIPIMAGEX");
1538 // outhead1("%s", label );
1539
1540 // }
1541
1542 // if ( strcmp( _direction, "#FLIPIMAGEDIRECTION0002" ) == 0 || strcmp( _direction, "#FLIPIMAGEDIRECTION0003" ) == 0 ) {
1543 // c6847z_load_image_address_to_register( _environment, "TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
1544 // deploy( flipimagey, src_hw_6847_flip_image_y_asm );
1545 // outline0("JSR FLIPIMAGEY");
1546 // } else {
1547
1548 // MAKE_LABEL
1549
1550 // c6847z_load_image_address_to_register( _environment, "TMPPTR", _image, _sequence, _frame, _frame_size, _frame_count );
1551 // deploy( flipimagey, src_hw_6847_flip_image_y_asm );
1552 // outline1("LDA %s", _direction );
1553 // outline1("ANDA #$%2.2x", FLAG_FLIP_Y );
1554 // outline1("BEQ %s", label );
1555 // outline0("JSR FLIPIMAGEY");
1556 // outhead1("%s", label );
1557
1558 // }
1559
1560}
1561
1562void c6847z_screen( Environment * _environment, char * _x, char * _y, char * _c ) {
1563
1564 // deploy( screen, src_hw_6847_screen_asm);
1565
1566 // outline1("LDA %s", _x );
1567 // outline1("LDB %s", _y );
1568 // outline0("JSR SCREEN" );
1569 // outline1("STA %s", _c );
1570
1571}
1572void c6847z_cls_box( Environment * _environment, char * _x1, char * _y1, char * _w, char * _h ) {
1573
1574 if ( _environment->currentMode < 7 ) {
1575
1576 } else {
1577 // deploy( clsBox, src_hw_6847_cls_box_asm );
1578 // outline1("LDD %s", _x1 );
1579 // outline0("STD <IMAGEX" );
1580 // outline1("LDD %s", _y1 );
1581 // outline0("STD <IMAGEY" );
1582 // outline1("LDA %s", _w );
1583 // outline0("STA <IMAGEW" );
1584 // outline1("LDA %s", _h );
1585 // outline0("STA <IMAGEH" );
1586 // outline0("JSR CLSBOX");
1587 }
1588
1589}
1590
1591#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
int lastUsedSlotInCommonPalette
Definition 6847.c:100
#define BITMAP_MODE_COLOR2
Definition 6847.h:88
#define TILEMAP_MODE_INTERNAL
Definition 6847.h:77
void c6847z_screen_rows(Environment *_environment, char *_rows)
Definition 6847z.c:567
void c6847z_sprite_expand_vertical(Environment *_environment, char *_sprite)
Definition 6847z.c:599
Variable * c6847z_new_images(Environment *_environment, int _frames, int _width, int _height, int _mode)
Definition 6847z.c:1298
void c6847z_get_image(Environment *_environment, char *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, int _palette)
Definition 6847z.c:1361
void c6847z_hscroll_screen(Environment *_environment, int _direction, int _overlap)
Definition 6847z.c:866
void c6847z_get_height(Environment *_environment, char *_result)
Definition 6847z.c:653
void c6847z_bitmap_enable(Environment *_environment, int _width, int _height, int _colors)
Definition 6847z.c:380
void c6847z_border_color(Environment *_environment, char *_border_color)
VIC-II: emit code to change border color
Definition 6847z.c:106
void c6847z_pget_color_vars(Environment *_environment, char *_x, char *_y, char *_result)
Definition 6847z.c:484
void c6847z_textmap_at(Environment *_environment, char *_address)
Definition 6847z.c:436
void c6847z_sprite_at(Environment *_environment, char *_sprite, char *_x, char *_y)
Definition 6847z.c:591
void c6847z_hscroll_line(Environment *_environment, int _direction, int _overlap)
Definition 6847z.c:850
void c6847z_get_width(Environment *_environment, char *_result)
Definition 6847z.c:639
void c6847z_pset_int(Environment *_environment, int _x, int _y, int *_c)
Definition 6847z.c:443
void c6847z_background_color(Environment *_environment, char *_index, char *_background_color)
VIC-II: emit code to change background color
Definition 6847z.c:138
Variable * c6847z_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 6847z.c:1088
void c6847z_collision(Environment *_environment, char *_sprite_mask, char *_result)
VIC-II: emit code to check for collision
Definition 6847z.c:78
void c6847z_colormap_at(Environment *_environment, char *_address)
Definition 6847z.c:432
void c6847z_next_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
VIC-II: emit code to wait for next raster irq at different position
Definition 6847z.c:222
void c6847z_sprite_compress_vertical(Environment *_environment, char *_sprite)
Definition 6847z.c:607
void c6847z_vertical_scroll(Environment *_environment, char *_displacement)
Definition 6847z.c:631
void c6847z_sprite_common_color(Environment *_environment, char *_index, char *_common_color)
VIC-II: emit code to change common sprite's color
Definition 6847z.c:172
void c6847z_bitmap_at(Environment *_environment, char *_address)
Definition 6847z.c:425
void c6847z_tile_at(Environment *_environment, char *_x, char *_y, char *_result)
Definition 6847z.c:1426
void c6847z_sprite_compress_horizontal(Environment *_environment, char *_sprite)
Definition 6847z.c:611
Variable * c6847z_new_image(Environment *_environment, int _width, int _height, int _mode)
Definition 6847z.c:1274
void c6847z_sprite_data_from(Environment *_environment, char *_sprite, char *_address)
Definition 6847z.c:575
void c6847z_next_raster(Environment *_environment)
VIC-II: emit code to wait for next raster irq
Definition 6847z.c:205
void c6847z_tiles_at(Environment *_environment, char *_address)
Definition 6847z.c:627
void c6847z_initialization(Environment *_environment)
Definition 6847z.c:729
void c6847z_sprite_data_set(Environment *_environment, char *_sprite, char *_address)
Definition 6847z.c:579
int c6847z_palette_extract(Environment *_environment, char *_data, int _width, int _height, int _depth, int _flags, RGBi *_palette)
Definition 6847z.c:1457
void c6847z_bitmap_disable(Environment *_environment)
Definition 6847z.c:400
void c6847z_sprite_priority(Environment *_environment, char *_sprite, char *_priority)
Definition 6847z.c:595
void c6847z_hit(Environment *_environment, char *_sprite_mask, char *_result)
VIC-II: emit code to check for collision
Definition 6847z.c:93
void c6847z_screen_on(Environment *_environment)
Definition 6847z.c:559
void c6847z_horizontal_scroll(Environment *_environment, char *_displacement)
Definition 6847z.c:635
void c6847z_text(Environment *_environment, char *_text, char *_text_size, int _raw)
Definition 6847z.c:692
void c6847z_put_tiles(Environment *_environment, char *_tile, char *_x, char *_y, char *_w, char *_h)
Definition 6847z.c:1434
void c6847z_sprite_multicolor(Environment *_environment, char *_sprite)
Definition 6847z.c:615
void c6847z_screen(Environment *_environment, char *_x, char *_y, char *_c)
Definition 6847z.c:1562
void c6847z_sprite_enable(Environment *_environment, char *_sprite)
Definition 6847z.c:583
void c6847z_screen_off(Environment *_environment)
Definition 6847z.c:563
void c6847z_sprite_disable(Environment *_environment, char *_sprite)
Definition 6847z.c:587
void c6847z_cline(Environment *_environment, char *_characters)
Definition 6847z.c:883
void c6847z_cls_box(Environment *_environment, char *_x1, char *_y1, char *_w, char *_h)
Definition 6847z.c:1572
void console_calculate_vars(Environment *_environment)
Definition 6847z.c:288
void c6847z_sprite_monocolor(Environment *_environment, char *_sprite)
Definition 6847z.c:619
void c6847z_use_tileset(Environment *_environment, char *_tileset)
Definition 6847z.c:1439
void c6847z_screen_columns(Environment *_environment, char *_columns)
Definition 6847z.c:571
void c6847z_put_tile(Environment *_environment, char *_tile, char *_x, char *_y)
Definition 6847z.c:1422
void c6847z_put_image(Environment *_environment, Resource *_source, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_flags)
Definition 6847z.c:1208
Variable * c6847z_new_sequence(Environment *_environment, int _sequences, int _frames, int _width, int _height, int _mode)
Definition 6847z.c:1329
void c6847z_scroll(Environment *_environment, int _dx, int _dy)
Definition 6847z.c:1418
void c6847z_move_tiles(Environment *_environment, char *_tile, char *_x, char *_y)
Definition 6847z.c:1430
void c6847z_sprite_expand_horizontal(Environment *_environment, char *_sprite)
Definition 6847z.c:603
void c6847z_sprite_color(Environment *_environment, char *_sprite, char *_color)
Definition 6847z.c:623
Variable * c6847z_get_raster_line(Environment *_environment)
Definition 6847z.c:1443
void c6847z_finalization(Environment *_environment)
Definition 6847z.c:833
void c6847z_calculate_sequence_frame_offset(Environment *_environment, char *_offset, char *_sequence, char *_frame, int _frame_size, int _frame_count)
Definition 6847z.c:1473
void c6847z_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 6847z.c:1156
void c6847z_bank_select(Environment *_environment, int _bank)
Definition 6847z.c:226
void c6847z_back(Environment *_environment)
Definition 6847z.c:879
void c6847z_tiles_get(Environment *_environment, char *_result)
Definition 6847z.c:646
void c6847z_raster_at(Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
VIC-II: emit code to set raster irq
Definition 6847z.c:191
int c6847z_screen_mode_enable(Environment *_environment, ScreenMode *_screen_mode)
Definition 6847z.c:297
void c6847z_cls(Environment *_environment)
Definition 6847z.c:660
void c6847z_scroll_text(Environment *_environment, int _direction, int _overlap)
Definition 6847z.c:672
int c6847z_image_size(Environment *_environment, int _width, int _height, int _mode)
Definition 6847z.c:909
void c6847z_tilemap_enable(Environment *_environment, int _width, int _height, int _colors, int _tile_width, int _tile_height)
Definition 6847z.c:404
void c6847z_slice_image(Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
Definition 6847z.c:1453
void c6847z_pset_vars(Environment *_environment, char *_x, char *_y, char *_c)
Definition 6847z.c:460
void console_calculate(Environment *_environment)
Definition 6847z.c:234
void c6847z_flip_image(Environment *_environment, Resource *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_direction)
Definition 6847z.c:1520
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".
Variable * variable_store_buffer(Environment *_environment, char *_destination, unsigned char *_buffer, int _size, int _at)
int size
Definition _optimizer.c:678
int offset
Definition _optimizer.c:681
void plot(Environment *_environment, char *_x, char *_y, char *_c, int _preserve_color)
Definition plot.c:46
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
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 freeImageWidth
Definition ugbc.h:3088
int currentMode
Definition ugbc.h:2696
int screenTilesHeight
Definition ugbc.h:2885
int consoleTilesHeight
Definition ugbc.h:2895
int fontWidth
Definition ugbc.h:2900
CopperList * copperList
Definition ugbc.h:3282
int paletteSelected
Definition ugbc.h:2975
int screenColors
Definition ugbc.h:2870
int dynamicConsole
Definition ugbc.h:3298
FontConfig fontConfig
Definition ugbc.h:2415
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
VestigialConfig vestigialConfig
Definition ugbc.h:2442
int schema
Definition ugbc.h:2063
unsigned char red
Definition ugbc.h:433
unsigned char green
Definition ugbc.h:434
unsigned char blue
Definition ugbc.h:435
unsigned char alpha
Definition ugbc.h:436
int isAddress
Definition ugbc.h:557
char * realName
Definition ugbc.h:555
unsigned char * valueBuffer
Definition ugbc.h:1061
int size
Definition ugbc.h:1077
char * name
Definition ugbc.h:979
int originalColors
Definition ugbc.h:1154
int frameSize
Definition ugbc.h:1134
int frameCount
Definition ugbc.h:1137
RGBi originalPalette[MAX_PALETTE]
Definition ugbc.h:1169
char * realName
Definition ugbc.h:982
char clsImplicit
Definition ugbc.h:2008
void * malloc(YYSIZE_T)
struct _ScreenMode ScreenMode
#define CRITICAL_IMAGE_CONVERTER_TOO_COLORS(f)
Definition ugbc.h:3502
struct _Resource Resource
struct _RGBi RGBi
Structure to store color components (red, green and blue).
#define adilineendbitmap()
Definition ugbc.h:4241
#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_SBYTE
Definition ugbc.h:452
@ VT_IMAGES
Definition ugbc.h:495
@ VT_COLOR
Definition ugbc.h:471
@ VT_IMAGE
Definition ugbc.h:489
@ VT_SEQUENCE
Definition ugbc.h:513
#define adiline3(s, a, b, c)
Definition ugbc.h:4197
#define deploy_preferred(s, e)
Definition ugbc.h:4299
#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
#define adilinepalette(s, c, p)
Definition ugbc.h:4219
#define FONT_SCHEMA_ASCII
Definition ugbc.h:582
#define adilinebeginbitmap(s)
Definition ugbc.h:4231
struct _CopperList CopperList
#define FLAG_EXACT
Definition ugbc.h:4569
#define adilinepixel(p)
Definition ugbc.h:4236
#define CRITICAL_NEW_IMAGE_UNSUPPORTED_MODE(f)
Definition ugbc.h:3540
#define deploy(s, e)
Definition ugbc.h:4288
#define MAKE_LABEL
Definition ugbc.h:3351
#define outhead1(s, a)
Definition ugbc.h:4247
char DATATYPE_AS_STRING[][16]