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