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