ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
_var.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#include "../../ugbc.h"
36
37/****************************************************************************
38 * CODE SECTION
39 ****************************************************************************/
40
41extern char BANK_TYPE_AS_STRING[][16];
42extern char DATATYPE_AS_STRING[][16];
43
44static void variable_cleanup_entry( Environment * _environment, Variable * _first ) {
45
46 Variable * variable = _first;
47
48 while( variable ) {
49
50 if ( ( !variable->assigned || ( variable->assigned && !variable->temporary ) ) ) {
51 switch( variable->type ) {
52 case VT_CHAR:
53 case VT_BYTE:
54 case VT_SBYTE:
55 case VT_COLOR:
56 case VT_THREAD:
57 if ( variable->memoryArea ) {
58 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
59 } else {
60 outhead0("section data_user");
61 vars_emit_byte( _environment, variable->realName, variable->initialValue );
62 outhead0("section code_user");
63 }
64 break;
65 case VT_DOJOKA:
66 if ( variable->memoryArea ) {
67 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
68 } else {
69 outhead0("section data_user");
70 outline1("%s: defs 4", variable->realName);
71 outhead0("section code_user");
72 }
73 break;
74 case VT_IMAGEREF:
75 if ( variable->memoryArea ) {
76 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
77 } else {
78 outhead0("section data_user");
79 outline1("%s: defs 14", variable->realName);
80 outhead0("section code_user");
81 }
82 break;
83 case VT_PATH:
84 if ( variable->memoryArea ) {
85 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
86 } else {
87 outhead0("section data_user");
88 outline1("%s: defs 16", variable->realName);
89 outhead0("section code_user");
90 }
91 break;
92 case VT_VECTOR2:
93 if ( variable->memoryArea ) {
94 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
95 } else {
96 outhead0("section data_user");
97 outline1("%s: defs 4", variable->realName);
98 outhead0("section code_user");
99 }
100 break;
101 case VT_WORD:
102 case VT_SWORD:
103 case VT_POSITION:
104 case VT_ADDRESS:
105 if ( variable->memoryArea ) {
106 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
107 } else {
108 outhead0("section data_user");
109 vars_emit_word( _environment, variable->realName, variable->initialValue );
110 outhead0("section code_user");
111 }
112 break;
113 case VT_DWORD:
114 case VT_SDWORD:
115 if ( variable->memoryArea ) {
116 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
117 } else {
118 outhead0("section data_user");
119 vars_emit_dword( _environment, variable->realName, variable->initialValue );
120 outhead0("section code_user");
121 }
122 break;
123 case VT_NUMBER:
124 if ( variable->memoryArea ) {
125 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
126 } else {
127 outhead0("section data_user");
128 vars_emit_number( _environment, variable->realName, variable->initialValue );
129 outhead0("section code_user");
130 }
131 break;
132 case VT_FLOAT:
133 if ( variable->memoryArea ) {
134 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
135 } else {
136 outhead0("section data_user");
137 outline2("%s: defs %d", variable->realName, 1 << VT_FLOAT_NORMALIZED_POW2_WIDTH( variable->arrayPrecision) );
138 outhead0("section code_user");
139 }
140 break;
141 case VT_STRING:
142 outline2("%s: EQU cstring%d", variable->realName, variable->valueString->id );
143 break;
144 case VT_DSTRING:
145 if ( variable->memoryArea ) {
146 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
147 } else {
148 outhead0("section data_user");
149 outline1("%s: db 0", variable->realName);
150 outhead0("section code_user");
151 }
152 break;
153 case VT_TILE:
154 case VT_TILESET:
155 case VT_MSPRITE:
156 case VT_SPRITE:
157 if ( variable->memoryArea ) {
158 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
159 } else {
160 outhead0("section data_user");
161 outline1("%s: db 0", variable->realName);
162 outhead0("section code_user");
163 }
164 break;
165 case VT_TILES:
166 if ( variable->memoryArea ) {
167 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
168 } else {
169 outhead0("section data_user");
170 outline1("%s: db 0,0,0,0", variable->realName);
171 outhead0("section code_user");
172 }
173 break;
174 case VT_BLIT:
175 break;
176 case VT_IMAGE:
177 case VT_IMAGES:
178 case VT_SEQUENCE:
179 case VT_MUSIC:
180 case VT_BUFFER:
181 case VT_TYPE:
182 if ( ! variable->absoluteAddress ) {
183 if ( variable->readonly ) {
184
185 } else {
186 outhead0("section data_user");
187 }
188 if ( variable->valueBuffer ) {
189 if ( variable->printable ) {
190 char * string = malloc( variable->size + 1 );
191 memset( string, 0, variable->size + 1 );
192 memcpy( string, variable->valueBuffer, variable->size );
193 outline2("%s: db %s", variable->realName, escape_newlines( string ) );
194 } else {
195 out1("%s: db ", variable->realName);
196 int i=0;
197 for (i=0; i<(variable->size-1); ++i ) {
198 if ( ( ( i + 1 ) % 16 ) == 0 ) {
199 outline1("$%2.2x", (unsigned char)(variable->valueBuffer[i] & 0xff ) );
200 out0(" db ");
201 } else {
202 out1("$%2.2x,", (unsigned char)(variable->valueBuffer[i] & 0xff ) );
203 }
204 }
205 outline1("$%2.2x", (unsigned char)(variable->valueBuffer[(variable->size-1)] & 0xff ) );
206 }
207 } else {
208 outline2("%s: defs %d", variable->realName, variable->size);
209 }
210 if ( variable->readonly ) {
211
212 } else {
213 outhead0("section code_user");
214 }
215 } else {
216 outline2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
217 if ( variable->valueBuffer ) {
218 if ( variable->printable ) {
219 char * string = malloc( variable->size + 1 );
220 memset( string, 0, variable->size + 1 );
221 memcpy( string, variable->valueBuffer, variable->size );
222 outline2("%scopy: db %s", variable->realName, escape_newlines( string ) );
223 } else {
224 out1("%scopy: db ", variable->realName);
225 int i=0;
226 for (i=0; i<(variable->size-1); ++i ) {
227 out1("$%2.2x,", (unsigned char)(variable->valueBuffer[i] & 0xff ) );
228 }
229 outline1("$%2.2x", (unsigned char)(variable->valueBuffer[(variable->size-1)] & 0xff ) );
230 }
231 }
232 }
233 break;
234 case VT_TILEMAP:
235 case VT_TARRAY: {
236 if ( variable->bankAssigned != -1 ) {
237
238 outhead0("section data_user");
239 outhead4("; relocated on bank %d (at %4.4x) for %d bytes (uncompressed: %d)", variable->bankAssigned, variable->absoluteAddress, variable->size, variable->uncompressedSize );
240 if ( variable->type == VT_TARRAY ) {
241 if (VT_BITWIDTH( variable->arrayType ) == 0 ) {
243 }
244 // force +1 byte if size is odd
245 outhead2("%s: defs %d, $00", variable->realName, (VT_BITWIDTH( variable->arrayType )>>3) );
246 } else {
247 if (VT_BITWIDTH( variable->type ) == 0 ) {
248 CRITICAL_DATATYPE_UNSUPPORTED( "BANKED", DATATYPE_AS_STRING[ variable->type ] );
249 }
250 // force +1 byte if size is odd
251 outhead2("%s: defs %d, $00", variable->realName, (VT_BITWIDTH( variable->type )>>3) );
252 }
253 outhead0("section code_user");
254
255 } else {
256
257 if ( variable->readonly ) {
258
259 } else {
260 outhead0("section data_user");
261 }
262 if ( variable->valueBuffer ) {
263 out1("%s: db ", variable->realName);
264 int i=0;
265 for (i=0; i<(variable->size-1); ++i ) {
266 out1("$%2.2x,", (unsigned char)(variable->valueBuffer[i] & 0xff ) );
267 }
268 outline1("$%2.2x", (unsigned char)(variable->valueBuffer[(variable->size-1)] & 0xff ) );
269 } else if ( variable->value ) {
270
271 switch( VT_BITWIDTH( variable->arrayType ) ) {
272 case 32: {
273 out1("%s: db ", variable->realName );
274 for( int i=0; i<(variable->size/4)-1; ++i ) {
275 out4("$%2.2x, $%2.2x, $%2.2x, $%2.2x, ", (unsigned int)( variable->value & 0xff ), (unsigned int)( ( variable->value >> 8 ) & 0xff ), (unsigned int)( ( variable->value >> 16 ) & 0xff ), (unsigned int)( ( variable->value >> 24 ) & 0xff ) );
276 }
277 out4("$%2.2x, $%2.2x, $%2.2x, $%2.2x", (unsigned int)( variable->value & 0xff ), (unsigned int)( ( variable->value >> 8 ) & 0xff ), (unsigned int)( ( variable->value >> 16 ) & 0xff ), (unsigned int)( ( variable->value >> 24 ) & 0xff ) );
278 outline0("");
279 break;
280 }
281 case 16: {
282 out1("%s: db ", variable->realName );
283 for( int i=0; i<(variable->size/2)-1; ++i ) {
284 out2("$%2.2x, $%2.2x,", (unsigned int)( variable->value & 0xff ), (unsigned int)( ( variable->value >> 8 ) & 0xff ) );
285 }
286 out2("$%2.2x, $%2.2x", (unsigned int)( variable->value & 0xff ), (unsigned int)( ( variable->value >> 8 ) & 0xff ) );
287 outline0("");
288 break;
289 }
290 case 8:
291 outline3("%s: defs %d, $%2.2x", variable->realName, variable->size, (unsigned char)(variable->value&0xff) );
292 break;
293 case 1:
294 outline3("%s: defs %d, $%2.2x", variable->realName, variable->size, (unsigned char)(variable->value?0xff:0x00));
295 break;
296 }
297 } else {
298 outline2("%s: defs %d", variable->realName, variable->size);
299 }
300 if ( variable->readonly ) {
301
302 } else {
303 outhead0("section code_user");
304 }
305
306 }
307
308 break;
309 }
310 }
311
312 if( variable->type == VT_IMAGES ) {
313 if ( variable->strips ) {
314 vars_emit_strips( _environment, variable->realName, variable->strips );
315 }
316 }
317
318 }
319 variable = variable->next;
320 }
321
322}
323
324static void variable_cleanup_entry_bit( Environment * _environment, Variable * _first ) {
325
326 Variable * variable = _first;
327
328 int bitCount = 0;
329
330 outhead0("section data_user");
331 while( variable ) {
332
333 if ( ( !variable->assigned || ( variable->assigned && !variable->temporary ) ) && !variable->imported && !variable->memoryArea ) {
334
335 if ( variable->memoryArea && _environment->debuggerLabelsFile ) {
336 fprintf( _environment->debuggerLabelsFile, "%4.4x %s\r\n", variable->absoluteAddress, variable->realName );
337 }
338
339 switch( variable->type ) {
340 case VT_BIT:
341 if ( variable->memoryArea ) {
342 // outline2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
343 } else {
344 outline1("%s:", variable->realName);
345 }
346 ++bitCount;
347 if ( bitCount == 8 ) {
348 outline0(" defs 1");
349 }
350 break;
351 }
352
353 }
354
355 variable = variable->next;
356
357 }
358
359 if ( bitCount > 0 ) {
360 outline0(" defs 1");
361 }
362 outhead0("section code_user");
363
364}
365
366
376void variable_cleanup( Environment * _environment ) {
377
378 int i=0;
379
380 vars_emit_constants( _environment );
381
382 if ( _environment->dataSegment ) {
383 outhead1("DATAFIRSTSEGMENT EQU %s", _environment->dataSegment->realName );
384 if ( _environment->readDataUsed && _environment->restoreDynamic ) {
385 outhead0("DATASEGMENTNUMERIC:" );
386 DataSegment * actual = _environment->dataSegment;
387 while( actual ) {
388 if ( actual->isNumeric ) {
389 outline2( "dw $%4.4x, %s", actual->lineNumber, actual->realName );
390 }
391 actual = actual->next;
392 }
393 outline0( "dw $ffff, DATAPTRE" );
394 }
395 }
396
397 if ( _environment->offsetting ) {
398 Offsetting * actual = _environment->offsetting;
399 while( actual ) {
400 out1("OFFSETS%4.4x: dw ", actual->size );
401 for( i=0; i<actual->count; ++i ) {
402 out1("$%4.4x", i * actual->size );
403 if ( i < ( actual->count - 1 ) ) {
404 out0(",");
405 } else {
406 outline0("");
407 }
408 }
409 if ( actual->variables ) {
410 OffsettingVariable * actualVariable = actual->variables;
411 while( actualVariable ) {
412 if ( actualVariable->sequence ) {
413 outhead1("%soffsetsequence:", actualVariable->variable->realName );
414 } else {
415 outhead1("%soffsetframe:", actualVariable->variable->realName );
416 }
417 actualVariable = actualVariable->next;
418 }
419 outhead1("fs%4.4xoffsetsequence:", actual->size );
420 outhead1("fs%4.4xoffsetframe:", actual->size );
421 outline0("LD L, A" );
422 outline0("LD H, 0" );
423 outline0("ADD HL, HL" );
424 outline0("LD DE, HL" );
425 outline1("LD HL, OFFSETS%4.4x", actual->size );
426 outline0("ADD HL, DE" );
427 outline0("LD A, (HL)" );
428 outline0("LD E, A" );
429 outline0("INC HL" );
430 outline0("LD A, (HL)" );
431 outline0("LD D, A" );
432 outline0("PUSH IX" );
433 outline0("POP HL" );
434 outline0("ADD HL, DE" );
435 outline0("RET" );
436 }
437 actual = actual->next;
438 }
439
440 int values[MAX_TEMPORARY_STORAGE];
441 char * address[MAX_TEMPORARY_STORAGE];
442
443 actual = _environment->offsetting;
444 int count = 0;
445 while( actual ) {
446 values[count] = actual->size;
447 address[count] = malloc( MAX_TEMPORARY_STORAGE );
448 sprintf( address[count], "fs%4.4xoffsetframe", actual->size );
449 actual = actual->next;
450 ++count;
451 }
452
453 cpu_address_table_build( _environment, "EXECOFFSETS", values, address, count );
454
455 cpu_address_table_lookup( _environment, "EXECOFFSETS", count );
456
457 }
458
459 Constant * c = _environment->constants;
460 while( c ) {
461 if ( c->valueString ) {
462 int len = strlen( c->valueString->value );
463 out2("%s: db %d,", c->realName, len);
464 int i=0;
465 for (i=0; i<(len-1); ++i ) {
466 out1("$%2.2x,", (unsigned char)c->valueString->value[i]);
467 }
468 outline1("$%2.2x", (unsigned char)c->valueString->value[(len-1)]);
469 }
470 c = c->next;
471 }
472
473 for(i=0; i<BANK_TYPE_COUNT; ++i) {
474 Bank * actual = _environment->banks[i];
475 while( actual ) {
476 if ( actual->type == BT_VARIABLES ) {
477 Variable * variable = _environment->variables;
478 variable_cleanup_entry( _environment, variable );
479 variable_cleanup_entry_bit( _environment, variable );
480 } else if ( actual->type == BT_TEMPORARY ) {
481 if ( _environment->bitmaskNeeded ) {
482 outhead0("BITMASK: defm $01,$02,$04,$08,$10,$20,$40,$80");
483 outhead0("BITMASKN: defm $fe,$fd,$fb,$f7,$ef,$df,$bf,$7f");
484 }
485 if ( _environment->deployed.dstring ) {
486 outhead1("max_free_string = $%4.4x", _environment->dstring.space == 0 ? DSTRING_DEFAULT_SPACE : _environment->dstring.space );
487 }
488
489 for( int j=0; j< (_environment->currentProcedure+1); ++j ) {
490 Variable * variable = _environment->tempVariables[j];
491 variable_cleanup_entry( _environment, variable );
492 variable_cleanup_entry_bit( _environment, variable );
493 }
494
495 Variable * variable = _environment->tempResidentVariables;
496
497 variable_cleanup_entry( _environment, variable );
498 variable_cleanup_entry_bit( _environment, variable );
499
500 } else {
501
502 }
503 actual = actual->next;
504 }
505 }
506
507 generate_cgoto_address_table( _environment );
508
509 variable_on_memory_init( _environment, 1 );
510
511 buffered_push_output( _environment );
512
513 outhead0("SECTION code_user");
514 outhead0("ORG $8000");
515 outhead0("SECTION data_user");
516 outhead0("ORG $7030");
517 outhead0("SECTION code_user");
518
519 // DB 0AAh,055h ;Cartridge present: Colecovision logo
520 // outline0("DEFB $aa, $55");
521 // ;DB 055h,0AAh ;Cartridge present: skip logo, Colecovision logo
522 outline0("DEFB $55, $aa");
523 // DW 0000 ;Pointer to the sprite name table
524 outline0("DEFW $0000");
525 // DW 0000 ;Pointer to the sprite order table
526 outline0("DEFW $0000");
527 // DW 0000 ;Pointer to the working buffer for WR_SPR_NM_TBL
528 outline0("DEFW $0000");
529 // DW CONTROLLER_BUFFER ;Pointer to the hand controller input areas
530 outline0("DEFW CONTROLLER_BUFFER");
531 // DW START ;Entry point to the user program
532 outline0("DEFW CODESTART");
533
534 deploy_inplace_preferred( startup, src_hw_coleco_startup_asm);
535 deploy_inplace_preferred( startup2, src_hw_coleco_startup2_asm);
536 deploy_inplace_preferred( sn76489startup, src_hw_sn76489z_startup_asm );
537 deploy_inplace_preferred( tms9918startup, src_hw_tms9918_startup_asm);
538
539 buffered_prepend_output( _environment );
540
541 DataSegment * dataSegment = _environment->dataSegment;
542 while( dataSegment ) {
543 int i=0;
544 if ( dataSegment->data ) {
545 out1("%s: db ", dataSegment->realName );
546 } else {
547 outhead1("%s ", dataSegment->realName );
548 }
549 DataDataSegment * dataDataSegment = dataSegment->data;
550 while( dataDataSegment ) {
551 if ( dataSegment->type ) {
552 if ( dataDataSegment->type == VT_STRING || dataDataSegment->type == VT_DSTRING ) {
553 out1("$%2.2x,", (unsigned char)(dataDataSegment->size) );
554 out1("\"%s\"", dataDataSegment->data );
555 } else {
556 for( i=0; i<(dataDataSegment->size-1); ++i ) {
557 out1("$%2.2x,", (unsigned char)(dataDataSegment->data[i]&0xff) );
558 }
559 out1("$%2.2x", (unsigned char)(dataDataSegment->data[i]&0xff) );
560 }
561 } else {
562 if ( dataDataSegment->type == VT_STRING || dataDataSegment->type == VT_DSTRING ) {
563 out1("$%2.2x,", (unsigned char)(dataDataSegment->type) );
564 out1("$%2.2x,", (unsigned char)(dataDataSegment->size) );
565 out1("\"%s\"", dataDataSegment->data );
566 } else {
567 out1("$%2.2x,", (unsigned char)(dataDataSegment->type) );
568 for( i=0; i<(dataDataSegment->size-1); ++i ) {
569 out1("$%2.2x,", (unsigned char)(dataDataSegment->data[i]&0xff) );
570 }
571 out1("$%2.2x", (unsigned char)(dataDataSegment->data[i]&0xff) );
572 }
573 }
574 dataDataSegment = dataDataSegment->next;
575 if ( dataDataSegment ) {
576 out0(",");
577 }
578 }
579 outline0("");
580 dataSegment = dataSegment->next;
581 }
582
583 if ( _environment->dataNeeded || _environment->dataSegment || _environment->deployed.read_data_unsafe ) {
584 outhead0("DATAPTRE:");
585 }
586
587 StaticString * staticStrings = _environment->strings;
588 while( staticStrings ) {
589 outline3("cstring%d: db %d, %s", staticStrings->id, (int)strlen(staticStrings->value), escape_newlines( staticStrings->value ) );
590 staticStrings = staticStrings->next;
591 }
592
593 if ( _environment->descriptors ) {
594 outhead0("UDCCHAR:" );
595 int i=0,j=0;
596 for(i=_environment->descriptors->first;i<(_environment->descriptors->first+_environment->descriptors->count);++i) {
597 outline1("; $%2.2x ", i);
598 out0("DEFB " );
599 for(j=0;j<7;++j) {
600 out1("$%2.2x,", ((unsigned char)_environment->descriptors->data[i].data[j]) );
601 }
602 outline1("$%2.2x", ((unsigned char)_environment->descriptors->data[i].data[j]) );
603 }
604 outhead0("TMS9918AUDCCHAR01:" );
605 outline1("LD BC, %d", _environment->descriptors->count * 8 );
606 outline0("LD HL, UDCCHAR" );
607 outline1("LD DE, $%4.4x", _environment->descriptors->first*8 );
608 outline0("CALL VDPWRITE" );
609 outline0("RET" );
610 outhead0("TMS9918AUDCCHAR23:" );
611 outline1("LD BC, %d", _environment->descriptors->count * 8 );
612 outline0("LD HL, UDCCHAR" );
613 outline1("LD DE, $%4.4x", _environment->descriptors->first*8 );
614 outline0("CALL VDPWRITE" );
615 outline1("LD BC, %d", _environment->descriptors->count * 8 );
616 outline0("LD HL, UDCCHAR" );
617 outline1("LD DE, $800+$%4.4x", _environment->descriptors->first*8 );
618 outline0("CALL VDPWRITE" );
619 outline1("LD BC, %d", _environment->descriptors->count * 8 );
620 outline0("LD HL, UDCCHAR" );
621 outline1("LD DE, $1000+$%4.4x", _environment->descriptors->first*8 );
622 outline0("CALL VDPWRITE" );
623 outline0("RET" );
624 } else {
625 outhead0("UDCCHAR: EQU $8000" );
626 outhead0("TMS9918AUDCCHAR01:" );
627 outline0("RET" );
628 outhead0("TMS9918AUDCCHAR23:" );
629 outline0("RET" );
630 }
631
632}
void vars_emit_constants(Environment *_environment)
Definition _vars.c:58
void vars_emit_strips(Environment *_environment, char *_name, Strip *_strips)
Definition _vars.c:118
void cpu_address_table_build(Environment *_environment, char *_table, int *_values, char *_address[], int _count)
Definition 6309.c:7344
void cpu_address_table_lookup(Environment *_environment, char *_table, int _count)
Definition 6309.c:7353
#define VT_FLOAT_NORMALIZED_POW2_WIDTH(p)
Definition 6309.h:50
void vars_emit_word(Environment *_environment, char *_name, int _value)
Definition _vars.c:92
void vars_emit_dword(Environment *_environment, char *_name, int _value)
Definition _vars.c:100
void vars_emit_number(Environment *_environment, char *_name, int _value)
Definition _vars.c:108
void vars_emit_byte(Environment *_environment, char *_name, int _value)
Definition _vars.c:84
void buffered_prepend_output(Environment *_environment)
char * escape_newlines(char *_string)
void buffered_push_output(Environment *_environment)
void variable_cleanup(Environment *_environment)
Emit source and configuration lines for variables.
Definition _var.c:559
char BANK_TYPE_AS_STRING[][16]
Description of BANK TYPE, in readable format.
#define DSTRING_DEFAULT_SPACE
Definition atari.h:152
void generate_cgoto_address_table(Environment *_environment)
Definition _var.c:122
void variable_on_memory_init(Environment *_environment, int _imported_too)
Definition _var.c:41
struct _Bank * next
Definition ugbc.h:185
BankType type
Definition ugbc.h:162
StaticString * valueString
Definition ugbc.h:820
struct _Constant * next
Definition ugbc.h:832
char * realName
Definition ugbc.h:803
int space
Definition ugbc.h:1970
struct _DataDataSegment * next
Definition ugbc.h:2181
char * data
Definition ugbc.h:2178
VariableType type
Definition ugbc.h:2175
struct _DataSegment * next
Definition ugbc.h:2198
DataDataSegment * data
Definition ugbc.h:2196
int lineNumber
Definition ugbc.h:2193
VariableType type
Definition ugbc.h:2187
int isNumeric
Definition ugbc.h:2189
char * realName
Definition ugbc.h:2192
int read_data_unsafe
Definition ugbc.h:1923
int dstring
Definition ugbc.h:1789
Variable * tempResidentVariables
Definition ugbc.h:2595
Offsetting * offsetting
Definition ugbc.h:2937
Bank * banks[BANK_TYPE_COUNT]
Definition ugbc.h:2514
Variable * tempVariables[MAX_PROCEDURES]
Definition ugbc.h:2606
DataSegment * dataSegment
Definition ugbc.h:2568
FILE * debuggerLabelsFile
Definition ugbc.h:3319
StaticString * strings
Definition ugbc.h:2641
int restoreDynamic
Definition ugbc.h:2573
int bitmaskNeeded
Definition ugbc.h:2659
int currentProcedure
Definition ugbc.h:2601
DString dstring
Definition ugbc.h:2405
Variable * variables
Definition ugbc.h:2616
int dataNeeded
Definition ugbc.h:2557
Constant * constants
Definition ugbc.h:2611
TileDescriptors * descriptors
Definition ugbc.h:2939
int readDataUsed
Definition ugbc.h:2578
Deployed deployed
Definition ugbc.h:2921
int size
Definition ugbc.h:892
struct _Offsetting * next
Definition ugbc.h:905
int count
Definition ugbc.h:897
OffsettingVariable * variables
Definition ugbc.h:902
struct _Variable * variable
Definition ugbc.h:880
struct _OffsettingVariable * next
Definition ugbc.h:883
char * value
Definition ugbc.h:337
struct _StaticString * next
Definition ugbc.h:342
char data[8]
Definition ugbc.h:2141
TileData data[512]
Definition ugbc.h:2153
int bankAssigned
Definition ugbc.h:1172
unsigned char * valueBuffer
Definition ugbc.h:1061
int printable
Definition ugbc.h:1097
Strip * strips
Definition ugbc.h:1215
StaticString * valueString
Definition ugbc.h:1041
int assigned
Definition ugbc.h:1020
struct _Variable * next
Definition ugbc.h:1225
int initialValue
Definition ugbc.h:1030
int size
Definition ugbc.h:1077
int absoluteAddress
Definition ugbc.h:1092
FloatTypePrecision arrayPrecision
Definition ugbc.h:1128
VariableType type
Definition ugbc.h:988
int readonly
Definition ugbc.h:1195
MemoryArea * memoryArea
Definition ugbc.h:1107
int uncompressedSize
Definition ugbc.h:1082
int value
Definition ugbc.h:1025
int imported
Definition ugbc.h:1014
VariableType arrayType
Definition ugbc.h:1125
int temporary
Definition ugbc.h:996
char * realName
Definition ugbc.h:982
void * malloc(YYSIZE_T)
#define out4(s, a, b, c, d)
Definition ugbc.h:4263
#define deploy_inplace_preferred(s, e)
Definition ugbc.h:4313
#define BANK_TYPE_COUNT
Maximum number of bank types.
Definition ugbc.h:145
#define MAX_TEMPORARY_STORAGE
Definition ugbc.h:563
struct _Offsetting Offsetting
#define outline3(s, a, b, c)
Definition ugbc.h:4255
struct _Variable Variable
Structure of a single variable.
#define outline2(s, a, b)
Definition ugbc.h:4254
struct _Environment Environment
Structure of compilation environment.
@ VT_THREAD
Definition ugbc.h:492
@ VT_DOJOKA
Definition ugbc.h:534
@ VT_TILE
Definition ugbc.h:504
@ VT_FLOAT
Definition ugbc.h:522
@ VT_BLIT
Definition ugbc.h:519
@ VT_TARRAY
Definition ugbc.h:480
@ VT_WORD
Definition ugbc.h:455
@ VT_POSITION
Definition ugbc.h:468
@ VT_NUMBER
Definition ugbc.h:549
@ VT_SDWORD
Definition ugbc.h:462
@ VT_MSPRITE
Definition ugbc.h:531
@ VT_STRING
Definition ugbc.h:474
@ VT_TILEMAP
Definition ugbc.h:525
@ VT_TILES
Definition ugbc.h:507
@ VT_SWORD
Definition ugbc.h:457
@ VT_BYTE
Definition ugbc.h:450
@ VT_DWORD
Definition ugbc.h:460
@ VT_BIT
Definition ugbc.h:528
@ VT_IMAGEREF
Definition ugbc.h:537
@ VT_VECTOR2
Definition ugbc.h:543
@ VT_CHAR
Definition ugbc.h:498
@ 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_MUSIC
Definition ugbc.h:516
@ VT_TYPE
Definition ugbc.h:546
@ VT_ADDRESS
Definition ugbc.h:465
@ VT_COLOR
Definition ugbc.h:471
@ VT_TILESET
Definition ugbc.h:510
@ VT_DSTRING
Definition ugbc.h:483
@ VT_PATH
Definition ugbc.h:540
@ VT_IMAGE
Definition ugbc.h:489
@ VT_SEQUENCE
Definition ugbc.h:513
struct _OffsettingVariable OffsettingVariable
#define outhead0(s)
Definition ugbc.h:4246
#define outhead4(s, a, b, c, d)
Definition ugbc.h:4250
#define out0(s)
Definition ugbc.h:4259
struct _Constant Constant
Structure of a single constant.
@ BT_VARIABLES
Definition ugbc.h:126
@ BT_TEMPORARY
Definition ugbc.h:129
#define out2(s, a, b)
Definition ugbc.h:4261
#define outline0(s)
Definition ugbc.h:4252
struct _StaticString StaticString
Structure of a single (static) string.
#define outhead2(s, a, b)
Definition ugbc.h:4248
#define CRITICAL_DATATYPE_UNSUPPORTED(k, v)
Definition ugbc.h:3447
struct _DataDataSegment DataDataSegment
#define out1(s, a)
Definition ugbc.h:4260
#define outline1(s, a)
Definition ugbc.h:4253
struct _DataSegment DataSegment
#define VT_BITWIDTH(t)
Definition ugbc.h:595
struct _Bank Bank
Structure of a single bank.
#define outhead1(s, a)
Definition ugbc.h:4247
char DATATYPE_AS_STRING[][16]