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 if ( ( !variable->assigned || ( variable->assigned && !variable->temporary ) ) ) {
50 switch( variable->type ) {
51 case VT_CHAR:
52 case VT_BYTE:
53 case VT_SBYTE:
54 case VT_COLOR:
55 case VT_THREAD:
56 if ( variable->memoryArea ) {
57 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
58 } else {
59 outhead0("section data_user");
60 vars_emit_byte( _environment, variable->realName, variable->initialValue);
61 outhead0("section code_user");
62 }
63 break;
64 case VT_DOJOKA:
65 if ( variable->memoryArea ) {
66 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
67 } else {
68 outhead0("section data_user");
69 outline1("%s: defs 4", variable->realName);
70 outhead0("section code_user");
71 }
72 break;
73 case VT_IMAGEREF:
74 if ( variable->memoryArea ) {
75 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
76 } else {
77 outhead0("section data_user");
78 outline1("%s: defs 14", variable->realName);
79 outhead0("section code_user");
80 }
81 break;
82 case VT_PATH:
83 if ( variable->memoryArea ) {
84 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
85 } else {
86 outhead0("section data_user");
87 outline1("%s: defs 16", variable->realName);
88 outhead0("section code_user");
89 }
90 break;
91 case VT_VECTOR2:
92 if ( variable->memoryArea ) {
93 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
94 } else {
95 outhead0("section data_user");
96 outline1("%s: defs 4", variable->realName);
97 outhead0("section code_user");
98 }
99 break;
100 case VT_WORD:
101 case VT_SWORD:
102 case VT_POSITION:
103 case VT_ADDRESS:
104 if ( variable->memoryArea ) {
105 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
106 } else {
107 outhead0("section data_user");
108 vars_emit_word( _environment, variable->realName, variable->initialValue);
109 outhead0("section code_user");
110 }
111 break;
112 case VT_DWORD:
113 case VT_SDWORD:
114 if ( variable->memoryArea ) {
115 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
116 } else {
117 outhead0("section data_user");
118 vars_emit_dword( _environment, variable->realName, variable->initialValue);
119 outhead0("section code_user");
120 }
121 break;
122 case VT_NUMBER:
123 if ( variable->memoryArea ) {
124 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
125 } else {
126 outhead0("section data_user");
127 vars_emit_number( _environment, variable->realName, variable->initialValue);
128 outhead0("section code_user");
129 }
130 break;
131 case VT_FLOAT:
132 if ( variable->memoryArea ) {
133 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
134 } else {
135 outhead0("section data_user");
136 outline2("%s: defs %d", variable->realName, 1 << VT_FLOAT_NORMALIZED_POW2_WIDTH( variable->arrayPrecision) );
137 outhead0("section code_user");
138 }
139 break;
140 case VT_STRING:
141 outline2("%s: EQU cstring%d", variable->realName, variable->valueString->id );
142 break;
143 case VT_DSTRING:
144 if ( variable->memoryArea ) {
145 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
146 } else {
147 outhead0("section data_user");
148 outline1("%s: db 0", variable->realName);
149 outhead0("section code_user");
150 }
151 break;
152 case VT_MSPRITE:
153 case VT_SPRITE:
154 if ( variable->memoryArea ) {
155 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
156 } else {
157 outhead0("section data_user");
158 outline1("%s: db 0", variable->realName);
159 outhead0("section code_user");
160 }
161 break;
162 case VT_TILE:
163 if ( variable->memoryArea ) {
164 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
165 } else {
166 outhead0("section data_user");
167 outline2("%s: db $%2.2x", variable->realName, variable->value);
168 outhead0("section code_user");
169 }
170 break;
171 case VT_TILESET:
172 if ( variable->memoryArea ) {
173 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
174 } else {
175 outhead0("section data_user");
176 outline1("%s: db 0", variable->realName);
177 outhead0("section code_user");
178 }
179 break;
180 case VT_TILES:
181 if ( variable->memoryArea ) {
182 outline2("%s: EQU $%4.4x", variable->realName, variable->absoluteAddress);
183 } else {
184 outhead0("section data_user");
185 outline1("%s: db 0,0,0,0", variable->realName);
186 outhead0("section code_user");
187 }
188 break;
189 case VT_BLIT:
190 break;
191 case VT_IMAGE:
192 case VT_IMAGES:
193 case VT_SEQUENCE:
194 case VT_MUSIC:
195 case VT_BUFFER:
196 case VT_TYPE:
197 if ( variable->readonly ) {
198
199 } else {
200 outhead0("section data_user");
201 }
202 if ( ! variable->absoluteAddress ) {
203 if ( variable->valueBuffer ) {
204 if ( variable->printable ) {
205 char * string = malloc( variable->size + 1 );
206 memset( string, 0, variable->size + 1 );
207 memcpy( string, variable->valueBuffer, variable->size );
208 outline2("%s: db %s", variable->realName, escape_newlines( string ) );
209 } else {
210 out1("%s: db ", variable->realName);
211 int i=0;
212 for (i=0; i<(variable->size-1); ++i ) {
213 if ( ( ( i + 1 ) % 16 ) == 0 ) {
214 outline1("%d", variable->valueBuffer[i]);
215 out0(" db ");
216 } else {
217 out1("%d,", variable->valueBuffer[i]);
218 }
219 }
220 outline1("%d", variable->valueBuffer[(variable->size-1)]);
221 }
222 } else {
223 outline2("%s: defs %d,0", variable->realName, variable->size);
224 }
225 } else {
226 outline2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
227 if ( variable->valueBuffer ) {
228 if ( variable->printable ) {
229 char * string = malloc( variable->size + 1 );
230 memset( string, 0, variable->size + 1 );
231 memcpy( string, variable->valueBuffer, variable->size );
232 outline2("%scopy: db %s", variable->realName, escape_newlines( string ) );
233 } else {
234 out1("%scopy: db ", variable->realName);
235 int i=0;
236 for (i=0; i<(variable->size-1); ++i ) {
237 out1("%d,", variable->valueBuffer[i]);
238 }
239 outline1("%d", variable->valueBuffer[(variable->size-1)]);
240 }
241 }
242 }
243 if ( variable->readonly ) {
244
245 } else {
246 outhead0("section code_user");
247 }
248 break;
249 case VT_TILEMAP:
250 case VT_TARRAY: {
251 if ( variable->bankAssigned != -1 ) {
252
253 outhead0("section data_user");
254 outhead4("; relocated on bank %d (at %4.4x) for %d bytes (uncompressed: %d)", variable->bankAssigned, variable->absoluteAddress, variable->size, variable->uncompressedSize );
255 if ( variable->type == VT_TARRAY ) {
256 if (VT_BITWIDTH( variable->arrayType ) == 0 ) {
258 }
259 // force +1 byte if size is odd
260 outhead2("%s: defs %d, $00", variable->realName, (VT_BITWIDTH( variable->arrayType )>>3) );
261 } else {
262 if (VT_BITWIDTH( variable->type ) == 0 ) {
263 CRITICAL_DATATYPE_UNSUPPORTED( "BANKED", DATATYPE_AS_STRING[ variable->type ] );
264 }
265 // force +1 byte if size is odd
266 outhead2("%s: defs %d, $00", variable->realName, (VT_BITWIDTH( variable->type )>>3) );
267 }
268 outhead0("section code_user");
269
270 } else {
271
272 if ( variable->readonly ) {
273
274 } else {
275 outhead0("section data_user");
276 }
277 if ( variable->valueBuffer ) {
278 out1("%s: db ", variable->realName);
279 int i=0;
280 for (i=0; i<(variable->size-1); ++i ) {
281 out1("%d,", variable->valueBuffer[i]);
282 }
283 outline1("%d", variable->valueBuffer[(variable->size-1)]);
284 } else if ( variable->value ) {
285
286 switch( VT_BITWIDTH( variable->arrayType ) ) {
287 case 32: {
288 out1("%s: db ", variable->realName );
289 for( int i=0; i<(variable->size/4)-1; ++i ) {
290 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 ) );
291 }
292 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 ) );
293 outline0("");
294 break;
295 }
296 case 16: {
297 out1("%s: db ", variable->realName );
298 for( int i=0; i<(variable->size/2)-1; ++i ) {
299 out2("$%2.2x, $%2.2x,", (unsigned int)( variable->value & 0xff ), (unsigned int)( ( variable->value >> 8 ) & 0xff ) );
300 }
301 out2("$%2.2x, $%2.2x", (unsigned int)( variable->value & 0xff ), (unsigned int)( ( variable->value >> 8 ) & 0xff ) );
302 outline0("");
303 break;
304 }
305 case 8:
306 outline3("%s: defs %d, $%2.2x", variable->realName, variable->size, (unsigned char)(variable->value&0xff) );
307 break;
308 case 1:
309 outline3("%s: defs %d, $%2.2x", variable->realName, variable->size, (unsigned char)(variable->value?0xff:0x00));
310 break;
311 }
312
313 } else {
314 outline2("%s: defs %d", variable->realName, variable->size);
315 }
316 if ( variable->readonly ) {
317
318 } else {
319 outhead0("section code_user");
320 }
321 }
322
323 break;
324 }
325 }
326
327 if( variable->type == VT_IMAGES ) {
328 if ( variable->strips ) {
329 vars_emit_strips( _environment, variable->realName, variable->strips );
330 }
331 }
332
333 }
334 variable = variable->next;
335 }
336
337}
338
339static void variable_cleanup_entry_bit( Environment * _environment, Variable * _first ) {
340
341 Variable * variable = _first;
342
343 int bitCount = 0;
344
345 outhead0("section data_user");
346 while( variable ) {
347
348 if ( ( !variable->assigned || ( variable->assigned && !variable->temporary ) ) && !variable->imported && !variable->memoryArea ) {
349
350 if ( variable->memoryArea && _environment->debuggerLabelsFile ) {
351 fprintf( _environment->debuggerLabelsFile, "%4.4x %s\r\n", variable->absoluteAddress, variable->realName );
352 }
353
354 switch( variable->type ) {
355 case VT_BIT:
356 if ( variable->memoryArea ) {
357 // outline2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
358 } else {
359 outline1("%s:", variable->realName);
360 }
361 ++bitCount;
362 if ( bitCount == 8 ) {
363 outline0(" defs 1");
364 }
365 break;
366 }
367
368 }
369
370 variable = variable->next;
371
372 }
373
374 if ( bitCount > 0 ) {
375 outline0(" defs 1");
376 }
377 outhead0("section code_user");
378
379}
380
390void variable_cleanup( Environment * _environment ) {
391
392 int i=0;
393
394 vars_emit_constants( _environment );
395
396 if ( _environment->dataSegment ) {
397 outhead1("DATAFIRSTSEGMENT EQU %s", _environment->dataSegment->realName );
398 if ( _environment->readDataUsed && _environment->restoreDynamic ) {
399 outhead0("DATASEGMENTNUMERIC:" );
400 DataSegment * actual = _environment->dataSegment;
401 while( actual ) {
402 if ( actual->isNumeric ) {
403 outline2( "dw $%4.4x, %s", actual->lineNumber, actual->realName );
404 }
405 actual = actual->next;
406 }
407 outline0( "dw $ffff, DATAPTRE" );
408 }
409 }
410
411 if ( _environment->offsetting ) {
412 Offsetting * actual = _environment->offsetting;
413 while( actual ) {
414 out1("OFFSETS%4.4x: dw ", actual->size );
415 for( i=0; i<actual->count; ++i ) {
416 out1("$%4.4x", i * actual->size );
417 if ( i < ( actual->count - 1 ) ) {
418 out0(",");
419 } else {
420 outline0("");
421 }
422 }
423 if ( actual->variables ) {
424 OffsettingVariable * actualVariable = actual->variables;
425 while( actualVariable ) {
426 if ( actualVariable->sequence ) {
427 outhead1("%soffsetsequence:", actualVariable->variable->realName );
428 } else {
429 outhead1("%soffsetframe:", actualVariable->variable->realName );
430 }
431 actualVariable = actualVariable->next;
432 }
433 outhead1("fs%4.4xoffsetsequence:", actual->size );
434 outhead1("fs%4.4xoffsetframe:", actual->size );
435 outline0("LD L, A" );
436 outline0("LD H, 0" );
437 outline0("ADD HL, HL" );
438 outline0("LD DE, HL" );
439 outline1("LD HL, OFFSETS%4.4x", actual->size );
440 outline0("ADD HL, DE" );
441 outline0("LD A, (HL)" );
442 outline0("LD E, A" );
443 outline0("INC HL" );
444 outline0("LD A, (HL)" );
445 outline0("LD D, A" );
446 outline0("PUSH IX" );
447 outline0("POP HL" );
448 outline0("ADD HL, DE" );
449 outline0("RET" );
450 }
451 actual = actual->next;
452 }
453
454 int values[MAX_TEMPORARY_STORAGE];
455 char * address[MAX_TEMPORARY_STORAGE];
456
457 actual = _environment->offsetting;
458 int count = 0;
459 while( actual ) {
460 values[count] = actual->size;
461 address[count] = malloc( MAX_TEMPORARY_STORAGE );
462 sprintf( address[count], "fs%4.4xoffsetframe", actual->size );
463 actual = actual->next;
464 ++count;
465 }
466
467 cpu_address_table_build( _environment, "EXECOFFSETS", values, address, count );
468
469 cpu_address_table_lookup( _environment, "EXECOFFSETS", count );
470
471 }
472
473 deploy_inplace_preferred( sn76489startup, src_hw_sn76489z_startup_asm );
474 deploy_inplace_preferred( tms9918startup, src_hw_tms9918_startup_asm);
475
476 generate_cgoto_address_table( _environment );
477
478 banks_generate( _environment );
479
480 Constant * c = _environment->constants;
481 while( c ) {
482 if ( c->valueString ) {
483 int len = strlen( c->valueString->value );
484 out2("%s: db %d,", c->realName, len);
485 int i=0;
486 for (i=0; i<(len-1); ++i ) {
487 out1("$%2.2x,", (unsigned char)c->valueString->value[i]);
488 }
489 outline1("$%2.2x", (unsigned char)c->valueString->value[(len-1)]);
490 }
491 c = c->next;
492 }
493
494 for(i=0; i<BANK_TYPE_COUNT; ++i) {
495 Bank * actual = _environment->banks[i];
496 while( actual ) {
497 if ( actual->type == BT_VARIABLES ) {
498 Variable * variable = _environment->variables;
499 variable_cleanup_entry( _environment, variable );
500 variable_cleanup_entry_bit( _environment, variable );
501 } else if ( actual->type == BT_TEMPORARY ) {
502 if ( _environment->bitmaskNeeded ) {
503 outhead0("BITMASK: defm $01,$02,$04,$08,$10,$20,$40,$80");
504 outhead0("BITMASKN: defm $fe,$fd,$fb,$f7,$ef,$df,$bf,$7f");
505 }
506 if ( _environment->deployed.dstring ) {
507 outhead1("max_free_string = $%4.4x", _environment->dstring.space == 0 ? DSTRING_DEFAULT_SPACE : _environment->dstring.space );
508 }
509
510 for( int j=0; j< (_environment->currentProcedure+1); ++j ) {
511 Variable * variable = _environment->tempVariables[j];
512 variable_cleanup_entry( _environment, variable );
513 variable_cleanup_entry_bit( _environment, variable );
514 }
515
516 Variable * variable = _environment->tempResidentVariables;
517
518 variable_cleanup_entry( _environment, variable );
519 variable_cleanup_entry_bit( _environment, variable );
520
521 } else {
522
523 }
524 actual = actual->next;
525 }
526 }
527
528 variable_on_memory_init( _environment, 1 );
529
530 DataSegment * dataSegment = _environment->dataSegment;
531 while( dataSegment ) {
532 int i=0;
533 if ( dataSegment->data ) {
534 out1("%s: db ", dataSegment->realName );
535 } else {
536 outhead1("%s: ", dataSegment->realName );
537 }
538 DataDataSegment * dataDataSegment = dataSegment->data;
539 while( dataDataSegment ) {
540 if ( dataSegment->type ) {
541 if ( dataDataSegment->type == VT_STRING || dataDataSegment->type == VT_DSTRING ) {
542 out1("$%2.2x,", (unsigned char)(dataDataSegment->size) );
543 out1("\"%s\"", dataDataSegment->data );
544 } else {
545 for( i=0; i<(dataDataSegment->size-1); ++i ) {
546 out1("$%2.2x,", (unsigned char)(dataDataSegment->data[i]&0xff) );
547 }
548 out1("$%2.2x", (unsigned char)(dataDataSegment->data[i]&0xff) );
549 }
550 } else {
551 if ( dataDataSegment->type == VT_STRING || dataDataSegment->type == VT_DSTRING ) {
552 out1("$%2.2x,", (unsigned char)(dataDataSegment->type) );
553 out1("$%2.2x,", (unsigned char)(dataDataSegment->size) );
554 out1("\"%s\"", dataDataSegment->data );
555 } else {
556 out1("$%2.2x,", (unsigned char)(dataDataSegment->type) );
557 for( i=0; i<(dataDataSegment->size-1); ++i ) {
558 out1("$%2.2x,", (unsigned char)(dataDataSegment->data[i]&0xff) );
559 }
560 out1("$%2.2x", (unsigned char)(dataDataSegment->data[i]&0xff) );
561 }
562 }
563 dataDataSegment = dataDataSegment->next;
564 if ( dataDataSegment ) {
565 out0(",");
566 }
567 }
568 outline0("");
569 dataSegment = dataSegment->next;
570 }
571
572 if ( _environment->dataNeeded || _environment->dataSegment || _environment->deployed.read_data_unsafe ) {
573 outhead0("DATAPTRE:");
574 }
575
576 StaticString * staticStrings = _environment->strings;
577 while( staticStrings ) {
578 outline3("cstring%d: db %d, %s", staticStrings->id, (int)strlen(staticStrings->value), escape_newlines( staticStrings->value ) );
579 staticStrings = staticStrings->next;
580 }
581
582 if ( _environment->descriptors ) {
583 outhead0("UDCCHAR:" );
584 int i=0,j=0;
585 for(i=_environment->descriptors->first;i<(_environment->descriptors->first+_environment->descriptors->count);++i) {
586 outline1("; $%2.2x ", i);
587 out0("DEFB " );
588 for(j=0;j<7;++j) {
589 out1("$%2.2x,", ((unsigned char)_environment->descriptors->data[i].data[j]) );
590 }
591 outline1("$%2.2x", ((unsigned char)_environment->descriptors->data[i].data[j]) );
592 }
593 outhead0("TMS9918AUDCCHAR01:" );
594 outline1("LD BC, %d", _environment->descriptors->count * 8 );
595 outline0("LD HL, UDCCHAR" );
596 outline1("LD DE, $%4.4x", _environment->descriptors->first*8 );
597 outline0("CALL VDPWRITE" );
598 outline0("RET" );
599 outhead0("TMS9918AUDCCHAR23:" );
600 outline1("LD BC, %d", _environment->descriptors->count * 8 );
601 outline0("LD HL, UDCCHAR" );
602 outline1("LD DE, $%4.4x", _environment->descriptors->first*8 );
603 outline0("CALL VDPWRITE" );
604 outline1("LD BC, %d", _environment->descriptors->count * 8 );
605 outline0("LD HL, UDCCHAR" );
606 outline1("LD DE, $800+$%4.4x", _environment->descriptors->first*8 );
607 outline0("CALL VDPWRITE" );
608 outline1("LD BC, %d", _environment->descriptors->count * 8 );
609 outline0("LD HL, UDCCHAR" );
610 outline1("LD DE, $1000+$%4.4x", _environment->descriptors->first*8 );
611 outline0("CALL VDPWRITE" );
612 outline0("RET" );
613 } else {
614 outhead0("UDCCHAR: EQU $E000");
615 outhead0("TMS9918AUDCCHAR01:" );
616 outline0("RET" );
617 outhead0("TMS9918AUDCCHAR23:" );
618 outline0("RET" );
619 }
620
621 buffered_push_output( _environment );
622
623 outhead0("SECTION code_user");
624 outhead0("ORG $0000");
625 outhead0("SECTION data_user");
626 outhead0("ORG $C000");
627 outhead0("SECTION code_user");
628
629 deploy_inplace(startup,src_hw_sc3000_startup_asm);
630 deploy_inplace(startup,src_hw_sc3000_startup2_asm);
631
632 outhead0("CODESTART:")
633
634 outline0("CALL VARINIT2");
635 cpu_call( _environment, "VARINIT" );
636
637 buffered_prepend_output( _environment );
638
639}
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_call(Environment *_environment, char *_label)
Definition 6309.c:3755
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 banks_generate(Environment *_environment)
Definition _banks.c:45
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 deploy_inplace(s, e)
Definition ugbc.h:4308
#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]