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#include <math.h>
37
38/****************************************************************************
39 * CODE SECTION
40 ****************************************************************************/
41
42extern char BANK_TYPE_AS_STRING[][16];
43extern char DATATYPE_AS_STRING[][16];
44
45static void variable_cleanup_entry( Environment * _environment, Variable * _first ) {
46
47 Variable * variable = _first;
48
49 while( variable ) {
50
51 if ( (variable->memoryArea && variable->bankAssigned != -1 && !variable->assigned) || ( !variable->assigned || ( variable->assigned && !variable->temporary ) ) && !variable->imported && !variable->memoryArea ) {
52
53 if ( variable->memoryArea && _environment->debuggerLabelsFile ) {
54 fprintf( _environment->debuggerLabelsFile, "%4.4x %s\r\n", variable->absoluteAddress, variable->realName );
55 }
56
57 switch( variable->type ) {
58 case VT_CHAR:
59 case VT_BYTE:
60 case VT_SBYTE:
61 case VT_COLOR:
62 case VT_THREAD:
63 if ( strcmp( variable->name, "PEN" ) == 0 ) {
64 outhead1("%s = 646", variable->realName);
65 } else {
66 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
67 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
68 } else {
69 vars_emit_byte( _environment, variable->realName, variable->initialValue );
70 }
71 }
72 break;
73 case VT_DOJOKA:
74 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
75 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
76 } else {
77 outhead1("%s: .res 4,0", variable->realName);
78 }
79 break;
80 case VT_IMAGEREF:
81 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
82 // outline2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
83 } else {
84 outhead1("%s: .res 14,0", variable->realName);
85 }
86 break;
87 case VT_PATH:
88 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
89 // outline2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
90 } else {
91 outhead1("%s: .res 16,0", variable->realName);
92 }
93 break;
94 case VT_VECTOR2:
95 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
96 // outline2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
97 } else {
98 outhead1("%s: .res 4,0", variable->realName);
99 }
100 break;
101 case VT_WORD:
102 case VT_SWORD:
103 case VT_POSITION:
104 case VT_ADDRESS:
105 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
106 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
107 } else {
108 vars_emit_word( _environment, variable->realName, variable->initialValue );
109 }
110 break;
111 case VT_DWORD:
112 case VT_SDWORD:
113 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
114 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
115 } else {
116 vars_emit_dword( _environment, variable->realName, variable->initialValue );
117 }
118 break;
119 case VT_NUMBER:
120 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
121 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
122 } else {
123 vars_emit_number( _environment, variable->realName, variable->initialValue );
124 }
125 break;
126 case VT_FLOAT:
127 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
128 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
129 } else {
130 outhead1("%s: .res 4,0", variable->realName);
131 }
132 break;
133 case VT_STRING:
134 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
135 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
136 } else {
137 outhead2("%s = cstring%d", variable->realName, variable->valueString->id );
138 }
139 break;
140 case VT_DSTRING:
141 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
142 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
143 } else {
144 outhead1("%s: .res 1,0", variable->realName);
145 }
146 break;
147 case VT_TILE:
148 case VT_TILESET:
149 case VT_SPRITE:
150 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
151 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
152 } else {
153 outhead1("%s: .res 1,0", variable->realName);
154 }
155 break;
156 case VT_MSPRITE:
157 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
158 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
159 } else {
160 outhead1("%s: .res 2,0", variable->realName);
161 }
162 break;
163 case VT_TILES:
164 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
165 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
166 } else {
167 outhead1("%s: .res 4,0", variable->realName);
168 }
169 break;
170 case VT_BLIT:
171 break;
172 case VT_IMAGE:
173 case VT_IMAGES:
174 case VT_SEQUENCE:
175 if ( variable->usedImage ) {
176 if ( variable->bankAssigned != -1 ) {
177 outhead2("; relocated on bank %d (at %4.4x)", variable->bankAssigned, variable->absoluteAddress );
178 outhead1("%s: .byte $0", variable->realName );
179 } else {
180 if ( ! variable->absoluteAddress ) {
181 if ( variable->valueBuffer && ! variable->onStorage ) {
182 if ( variable->printable ) {
183 char * string = malloc( variable->size + 1 );
184 memset( string, 0, variable->size + 1 );
185 memcpy( string, variable->valueBuffer, variable->size );
186 outhead2("%s: .byte %s", variable->realName, escape_newlines( string ) );
187 } else {
188 out1("%s: .byte ", variable->realName);
189 int i=0;
190 for (i=0; i<(variable->size-1); ++i ) {
191 if ( ( ( i+1 ) % 16 ) == 0 ) {
192 outline1("$%2.2x", (unsigned char)(variable->valueBuffer[i] & 0xff ) );
193 out0(" .byte ");
194 } else {
195 out1("$%2.2x,", (unsigned char)(variable->valueBuffer[i] & 0xff ) );
196 }
197 }
198 outline1("$%2.2x", (unsigned char)(variable->valueBuffer[(variable->size-1)] & 0xff ) );
199 }
200 } else {
201 outhead2("%s: .res %d,0", variable->realName, variable->size);
202 }
203 } else {
204 if ( ! variable->memoryArea && variable->valueBuffer && ! variable->onStorage && variable->bankAssigned == -1 ) {
205 outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
206 if ( variable->printable ) {
207 char * string = malloc( variable->size + 1 );
208 memset( string, 0, variable->size + 1 );
209 memcpy( string, variable->valueBuffer, variable->size );
210 outhead2("%scopy: .byte %s", variable->realName, escape_newlines( string ) );
211 } else {
212 out1("%scopy: .byte ", 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 }
219 }
220 }
221 }
222
223 }
224 break;
225 case VT_MUSIC:
226 if ( variable->sidFile ) {
227 if ( variable->sidFile->loadAddress ) {
228 outhead1(".segment \"%s\"", variable->name);
229 outhead1("%s:", variable->realName );
230 out0( ".BYTE ");
231 for( int i=0; i<variable->sidFile->size; ++i ) {
232 out1("$%2.2x", (unsigned char)(variable->sidFile->data[i]) );
233 if ( ( ( i + 1 ) % 8 ) == 0 ) {
234 outline0("");
235 if ( i < (variable->sidFile->size-1) ) {
236 out0( ".BYTE ");
237 }
238 } else {
239 if ( i < (variable->sidFile->size-1) ) {
240 out0( ",");
241 }
242 }
243 }
244 outline0("");
245 outhead0(".segment \"CODE\"");
246 break;
247 }
248 }
249 case VT_BUFFER:
250 case VT_TYPE:
251 if ( variable->bankAssigned != -1 ) {
252 outhead2("; relocated on bank %d (at %4.4x)", variable->bankAssigned, variable->absoluteAddress );
253 outhead1("%s: .byte $0", variable->realName );
254 } else {
255 if ( ! variable->absoluteAddress ) {
256 if ( variable->valueBuffer && ! variable->onStorage ) {
257 if ( variable->printable ) {
258 char * string = malloc( variable->size + 1 );
259 memset( string, 0, variable->size + 1 );
260 memcpy( string, variable->valueBuffer, variable->size );
261 outhead2("%s: .byte %s", variable->realName, escape_newlines( string ) );
262 } else {
263 out1("%s: .byte ", variable->realName);
264 int i=0;
265 for (i=0; i<(variable->size-1); ++i ) {
266 if ( ( ( i+1 ) % 16 ) == 0 ) {
267 outline1("$%2.2x", (unsigned char)(variable->valueBuffer[i] & 0xff ) );
268 out0(" .byte ");
269 } else {
270 out1("$%2.2x,", (unsigned char)(variable->valueBuffer[i] & 0xff ) );
271 }
272 }
273 outline1("$%2.2x", (unsigned char)(variable->valueBuffer[(variable->size-1)] & 0xff ) );
274 }
275 } else {
276 outhead2("%s: .res %d,0", variable->realName, variable->size);
277 }
278 } else {
279 if ( ! variable->memoryArea && variable->valueBuffer && ! variable->onStorage && variable->bankAssigned == -1 ) {
280 outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
281 if ( variable->printable ) {
282 char * string = malloc( variable->size + 1 );
283 memset( string, 0, variable->size + 1 );
284 memcpy( string, variable->valueBuffer, variable->size );
285 outhead2("%scopy: .byte %s", variable->realName, escape_newlines( string ) );
286 } else {
287 out1("%scopy: .byte ", variable->realName);
288 int i=0;
289 for (i=0; i<(variable->size-1); ++i ) {
290 out1("$%2.2x,", (unsigned char)(variable->valueBuffer[i] & 0xff ) );
291 }
292 outline1("$%2.2x", (unsigned char)(variable->valueBuffer[(variable->size-1)] & 0xff ) );
293 }
294 }
295 }
296 }
297 break;
298 case VT_TILEMAP:
299 case VT_TARRAY: {
300 if ( variable->bankAssigned != -1 ) {
301 outhead4("; relocated on bank %d (at %4.4x) for %d bytes (uncompressed: %d)", variable->bankAssigned, variable->absoluteAddress, variable->size, variable->uncompressedSize );
302 if ( variable->type == VT_TARRAY ) {
303 if (VT_BITWIDTH( variable->arrayType ) == 0 ) {
305 }
306 // force +1 byte if size is odd
307 outhead2("%s: .res %d, $00", variable->realName, (VT_BITWIDTH( variable->arrayType )>>3) );
308 } else {
309 if (VT_BITWIDTH( variable->type ) == 0 ) {
310 CRITICAL_DATATYPE_UNSUPPORTED( "BANKED", DATATYPE_AS_STRING[ variable->type ] );
311 }
312 // force +1 byte if size is odd
313 outhead2("%s: .res %d, $00", variable->realName, (VT_BITWIDTH( variable->type )>>3) );
314 }
315 } else {
316 if ( ! variable->memoryArea && variable->valueBuffer ) {
317 out1("%s: .byte ", variable->realName);
318 int i=0;
319 for (i=0; i<(variable->size-1); ++i ) {
320 out1("$%2.2x,", (unsigned char) ( variable->valueBuffer[i] & 0xff ) );
321 }
322 outline1("$%2.2x", (unsigned char) ( variable->valueBuffer[(variable->size-1)] & 0xff ) );
323 } else if ( variable->memoryArea && ! variable->value ) {
324 outhead3("%s: .res %d, $%2.2x", variable->realName, variable->size, 0 );
325 } else {
326 if ( variable->value ) {
327 switch( VT_BITWIDTH( variable->arrayType ) ) {
328 case 32: {
329 out1("%s: .byte ", variable->realName );
330 for( int i=0; i<(variable->size/4)-1; ++i ) {
331 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 ) );
332 }
333 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 ) );
334 outline0("");
335 break;
336 }
337 case 16: {
338 out1("%s: .byte ", variable->realName );
339 for( int i=0; i<(variable->size/2)-1; ++i ) {
340 out2("$%2.2x, $%2.2x,", (unsigned int)( variable->value & 0xff ), (unsigned int)( ( variable->value >> 8 ) & 0xff ) );
341 }
342 out2("$%2.2x, $%2.2x", (unsigned int)( variable->value & 0xff ), (unsigned int)( ( variable->value >> 8 ) & 0xff ) );
343 outline0("");
344 break;
345 }
346 case 8:
347 outhead3("%s: .res %d, $%2.2x", variable->realName, variable->size, (unsigned char)(variable->value&0xff) );
348 break;
349 case 1:
350 outhead3("%s: .res %d, $%2.2x", variable->realName, variable->size, (unsigned char)(variable->value?0xff:0x00));
351 break;
352 }
353
354 } else {
355 outhead2("%s: .res %d, 0", variable->realName, variable->size);
356 }
357 }
358 }
359
360 break;
361 }
362 }
363
364 if( variable->type == VT_IMAGES ) {
365 if ( variable->strips ) {
366 vars_emit_strips( _environment, variable->realName, variable->strips );
367 }
368 }
369
370 }
371
372 variable = variable->next;
373 }
374
375}
376
377static void variable_cleanup_memory_mapped( Environment * _environment, Variable * _variable ) {
378
379 outhead2("; %s (%4.4x)", _variable->realName, _variable->absoluteAddress );
380
381 switch( _variable->type ) {
382 case VT_CHAR:
383 outhead1("%s:", _variable->realName );
384 if ( _variable->value >= 32 ) {
385 outline1(" .byte '%c'", ( _variable->value & 0xff ) );
386 } else {
387 outline1(" .byte $%1.1x", ( _variable->value & 0xff ) );
388 }
389 break;
390 case VT_BYTE:
391 case VT_SBYTE:
392 case VT_COLOR:
393 case VT_THREAD:
394 if ( strcmp( _variable->name, "PEN" ) == 0 ) {
395 outhead1("%s = 646", _variable->realName);
396 } else {
397 vars_emit_byte( _environment, _variable->realName, _variable->initialValue );
398 }
399 break;
400 case VT_DOJOKA:
401 outhead1("%s:", _variable->realName );
402 outline0(" .res 4, 0" );
403 break;
404 case VT_IMAGEREF:
405 outhead1("%s: .res 14,0", _variable->realName);
406 break;
407 case VT_PATH:
408 outhead1("%s: .res 16,0", _variable->realName);
409 break;
410 case VT_VECTOR2:
411 outhead1("%s: .res 4,0", _variable->realName);
412 break;
413 case VT_WORD:
414 case VT_SWORD:
415 case VT_POSITION:
416 case VT_ADDRESS:
417 vars_emit_word( _environment, _variable->realName, _variable->initialValue );
418 break;
419 case VT_DWORD:
420 case VT_SDWORD:
421 vars_emit_dword( _environment, _variable->realName, _variable->initialValue );
422 break;
423 case VT_NUMBER:
424 vars_emit_number( _environment, _variable->realName, _variable->initialValue );
425 break;
426 case VT_FLOAT: {
427 outhead1("%s:", _variable->realName );
428 int bytes = VT_FLOAT_BITWIDTH( _variable->precision ) >> 3;
429 // int * data = malloc( bytes * sizeof( int ) );
430 // switch( _variable->precision ) {
431 // case FT_FAST:
432 // cpu_float_fast_from_double_to_int_array( _environment, _variable->valueFloating, data );
433 // break;
434 // case FT_SINGLE:
435 // cpu_float_single_from_double_to_int_array( _environment, _variable->valueFloating, data );
436 // break;
437 // }
438 // for( int i=0; i<bytes; ++i ) {
439 // outline1(" .byte $%2.2x", (unsigned char)( ( data[i] ) & 0xff ) );
440 // }
441 outhead1("%s: .res 4,0", _variable->realName);
442 break;
443 }
444 case VT_STRING:
445 outhead2("%s = cstring%d", _variable->realName, _variable->valueString->id );
446 break;
447 case VT_DSTRING:
448 case VT_SPRITE:
449 case VT_TILE:
450 case VT_TILESET:
451 outhead1("%s:", _variable->realName );
452 outline0(" .byte 0" );
453 break;
454 case VT_MSPRITE:
455 outhead1("%s:", _variable->realName );
456 outline0(" .byte 0, 0" );
457 break;
458 case VT_TILES:
459 outhead1("%s:", _variable->realName );
460 outline0(" .byte 0, 0, 0, 0" );
461 break;
462 case VT_BLIT:
463 break;
464 case VT_IMAGE:
465 case VT_IMAGES:
466 case VT_SEQUENCE:
467 if ( _variable->usedImage ) {
468 if ( _variable->bankAssigned != -1 ) {
469 outhead2("; relocated on bank %d (at %4.4x)", _variable->bankAssigned, _variable->absoluteAddress );
470 outhead1("%s: .byte $0", _variable->realName );
471 } else {
472 outhead1("%s:", _variable->realName );
473 if ( _variable->valueBuffer && ! _variable->onStorage ) {
474 if ( _variable->printable ) {
475 char * string = malloc( _variable->size + 1 );
476 memset( string, 0, _variable->size + 1 );
477 memcpy( string, _variable->valueBuffer, _variable->size );
478 outline1(" .byte %s", escape_newlines( string ) );
479 } else {
480 out0(" .byte ");
481 int i=0;
482 for (i=0; i<(_variable->size-1); ++i ) {
483 out1("$%2.2x,", (unsigned char)(_variable->valueBuffer[i] & 0xff ) );
484 }
485 outline1("$%2.2x", (unsigned char)(_variable->valueBuffer[(_variable->size-1)] & 0xff ) );
486 }
487 } else {
488 outline1(" .res %d,0", _variable->size);
489 }
490 }
491 }
492 break;
493 case VT_MUSIC:
494 case VT_BUFFER:
495 case VT_TYPE:
496 if ( _variable->bankAssigned != -1 ) {
497 outhead2("; relocated on bank %d (at %4.4x)", _variable->bankAssigned, _variable->absoluteAddress );
498 outhead1("%s: .byte $0", _variable->realName );
499 } else {
500 outhead1("%s:", _variable->realName );
501 if ( _variable->valueBuffer && ! _variable->onStorage ) {
502 if ( _variable->printable ) {
503 char * string = malloc( _variable->size + 1 );
504 memset( string, 0, _variable->size + 1 );
505 memcpy( string, _variable->valueBuffer, _variable->size );
506 outline1(" .byte %s", escape_newlines( string ) );
507 } else {
508 out0(" .byte ");
509 int i=0;
510 for (i=0; i<(_variable->size-1); ++i ) {
511 out1("$%2.2x,", (unsigned char)(_variable->valueBuffer[i] & 0xff ) );
512 }
513 outline1("$%2.2x", (unsigned char)(_variable->valueBuffer[(_variable->size-1)] & 0xff ) );
514 }
515 } else {
516 outline1(" .res %d,0", _variable->size);
517 }
518 }
519 break;
520 case VT_TARRAY: {
521 if ( _variable->bankAssigned != -1 ) {
522 outhead4("; relocated on bank %d (at %4.4x) for %d bytes (uncompressed: %d)", _variable->bankAssigned, _variable->absoluteAddress, _variable->size, _variable->uncompressedSize );
523 if ( _variable->type == VT_TARRAY ) {
524 if (VT_BITWIDTH( _variable->arrayType ) == 0 ) {
526 }
527 // force +1 byte if size is odd
528 outhead2("%s: .res %d, $00", _variable->realName, (VT_BITWIDTH( _variable->arrayType )>>3) );
529 } else {
530 if (VT_BITWIDTH( _variable->type ) == 0 ) {
531 CRITICAL_DATATYPE_UNSUPPORTED( "BANKED", DATATYPE_AS_STRING[ _variable->type ] );
532 }
533 // force +1 byte if size is odd
534 outhead2("%s: .res %d, $00", _variable->realName, (VT_BITWIDTH( _variable->type )>>3) );
535 }
536 } else {
537 if ( ! _variable->memoryArea && _variable->valueBuffer ) {
538 out1("%s: .byte ", _variable->realName);
539 int i=0;
540 for (i=0; i<(_variable->size-1); ++i ) {
541 out1("$%2.2x,", (unsigned char) ( _variable->valueBuffer[i] & 0xff ) );
542 }
543 outline1("$%2.2x", (unsigned char) ( _variable->valueBuffer[(_variable->size-1)] & 0xff ) );
544 } else if ( _variable->memoryArea && ! _variable->value ) {
545 outhead3("%s: .res %d, $%2.2x", _variable->realName, _variable->size, 0 );
546 } else {
547 if ( _variable->value ) {
548 switch( VT_BITWIDTH( _variable->arrayType ) ) {
549 case 32: {
550 out1("%s: .byte ", _variable->realName );
551 for( int i=0; i<(_variable->size/4)-1; ++i ) {
552 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 ) );
553 }
554 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 ) );
555 outline0("");
556 break;
557 }
558 case 16: {
559 out1("%s: .byte ", _variable->realName );
560 for( int i=0; i<(_variable->size/2)-1; ++i ) {
561 out2("$%2.2x, $%2.2x,", (unsigned int)( _variable->value & 0xff ), (unsigned int)( ( _variable->value >> 8 ) & 0xff ) );
562 }
563 out2("$%2.2x, $%2.2x", (unsigned int)( _variable->value & 0xff ), (unsigned int)( ( _variable->value >> 8 ) & 0xff ) );
564 outline0("");
565 break;
566 }
567 case 8:
568 outhead3("%s: .res %d, $%2.2x", _variable->realName, _variable->size, (unsigned char)(_variable->value&0xff) );
569 break;
570 case 1:
571 outhead3("%s: .res %d, $%2.2x", _variable->realName, _variable->size, (unsigned char)(_variable->value?0xff:0x00));
572 break;
573 }
574
575 } else {
576 outhead2("%s: .res %d, 0", _variable->realName, _variable->size);
577 }
578 }
579 }
580
581 break;
582 }
583
584 if( _variable->type == VT_IMAGES ) {
585 if ( _variable->strips ) {
586 vars_emit_strips( _environment, _variable->realName, _variable->strips );
587 }
588 }
589
590 }
591
592}
593
594static void variable_cleanup_entry_bit( Environment * _environment, Variable * _first ) {
595
596 Variable * variable = _first;
597
598 int bitCount = 0;
599
600 while( variable ) {
601
602 if ( ( !variable->assigned || ( variable->assigned && !variable->temporary ) ) && !variable->imported && !variable->memoryArea ) {
603
604 if ( variable->memoryArea && _environment->debuggerLabelsFile ) {
605 fprintf( _environment->debuggerLabelsFile, "%4.4x %s\r\n", variable->absoluteAddress, variable->realName );
606 }
607
608 switch( variable->type ) {
609 case VT_BIT:
610 if ( variable->memoryArea ) {
611 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
612 } else {
613 outhead1("%s:", variable->realName);
614 }
615 ++bitCount;
616 if ( bitCount == 8 ) {
617 outline0(" .res 1,0");
618 }
619 break;
620 }
621
622 }
623
624 variable = variable->next;
625
626 }
627
628 if ( bitCount > 0 ) {
629 outline0(" .res 1,0");
630 }
631
632}
633
643void variable_cleanup( Environment * _environment ) {
644 int i=0;
645
646 vars_emit_constants( _environment );
647
648 if ( _environment->dataSegment ) {
649 outhead1("DATAFIRSTSEGMENT = %s", _environment->dataSegment->realName );
650 if ( _environment->readDataUsed && _environment->restoreDynamic ) {
651 outhead0("DATASEGMENTNUMERIC:" );
652 DataSegment * actual = _environment->dataSegment;
653 while( actual ) {
654 if ( actual->isNumeric ) {
655 outline2( ".word $%4.4x, %s", actual->lineNumber, actual->realName );
656 }
657 actual = actual->next;
658 }
659 outline0( ".word $ffff, DATAPTRE" );
660 }
661 }
662
663 if ( _environment->offsetting ) {
664 Offsetting * actual = _environment->offsetting;
665 while( actual ) {
666 out1("OFFSETS%4.4x: .word ", actual->size );
667 for( i=0; i<actual->count; ++i ) {
668 out1("$%4.4x", i * actual->size );
669 if ( i < ( actual->count - 1 ) ) {
670 out0(",");
671 } else {
672 outline0("");
673 }
674 }
675 if ( actual->variables ) {
676 OffsettingVariable * actualVariable = actual->variables;
677 while( actualVariable ) {
678 if ( actualVariable->sequence ) {
679 outhead1("%soffsetsequence:", actualVariable->variable->realName );
680 } else {
681 outhead1("%soffsetframe:", actualVariable->variable->realName );
682 }
683 actualVariable = actualVariable->next;
684 }
685 outhead1("fs%4.4xoffsetsequence:", actual->size );
686 outhead1("fs%4.4xsoffsetframe:", actual->size );
687 outline1("LDA #<OFFSETS%4.4x", actual->size );
688 outline0("STA MATHPTR1" );
689 outline1("LDA #>OFFSETS%4.4x", actual->size );
690 outline0("STA MATHPTR1+1" );
691 outline0("CLC" );
692 outline0("LDA MATHPTR0" );
693 outline0("ASL" );
694 outline0("TAY" );
695 outline0("LDA TMPPTR" );
696 outline0("ADC (MATHPTR1), Y" );
697 outline0("STA TMPPTR" );
698 outline0("INY" );
699 outline0("LDA TMPPTR+1" );
700 outline0("ADC (MATHPTR1), Y" );
701 outline0("STA TMPPTR+1" );
702 outline0("RTS" );
703 }
704 actual = actual->next;
705 }
706
707 int values[MAX_TEMPORARY_STORAGE];
708 char * address[MAX_TEMPORARY_STORAGE];
709
710 actual = _environment->offsetting;
711 int count = 0;
712 while( actual ) {
713 values[count] = actual->size;
714 address[count] = malloc( MAX_TEMPORARY_STORAGE );
715 sprintf( address[count], "fs%4.4xsoffsetframe", actual->size );
716 actual = actual->next;
717 ++count;
718 }
719
720 cpu_address_table_build( _environment, "EXECOFFSETS", values, address, count );
721
722 cpu_address_table_lookup( _environment, "EXECOFFSETS", count );
723
724 }
725
726 generate_cgoto_address_table( _environment );
727
728 banks_generate( _environment );
729
730 for(i=0; i<BANK_TYPE_COUNT; ++i) {
731 Bank * actual = _environment->banks[i];
732 while( actual ) {
733 if ( actual->type == BT_VARIABLES ) {
734 // cfgline3("# BANK %s %s AT $%4.4x", BANK_TYPE_AS_STRING[actual->type], actual->name, actual->address);
735 // cfgline2("%s: load = MAIN, type = ro, optional = yes, start = $%4.4x;", actual->name, actual->address);
736 // outhead1(".segment \"%s\"", actual->name);
737 Variable * variable = _environment->variables;
738
739 variable_cleanup_entry( _environment, variable );
740 variable_cleanup_entry_bit( _environment, variable );
741
742 } else if ( actual->type == BT_TEMPORARY ) {
743 // cfgline3("# BANK %s %s AT $%4.4x", BANK_TYPE_AS_STRING[actual->type], actual->name, actual->address);
744 // cfgline2("%s: load = MAIN, type = ro, optional = yes, start = $%4.4x;", actual->name, actual->address);
745 // outhead1(".segment \"%s\"", actual->name);
746
747 for( int j=0; j< (_environment->currentProcedure+1); ++j ) {
748 Variable * variable = _environment->tempVariables[j];
749 variable_cleanup_entry( _environment, variable );
750 variable_cleanup_entry_bit( _environment, variable );
751 }
752
753 Variable * variable = _environment->tempResidentVariables;
754
755 variable_cleanup_entry( _environment, variable );
756 variable_cleanup_entry_bit( _environment, variable );
757
758 // } else if ( actual->type == BT_STRINGS ) {
759 // cfgline3("# BANK %s %s AT $%4.4x", BANK_TYPE_AS_STRING[actual->type], actual->name, actual->address);
760 // cfgline2("%s: load = MAIN, type = ro, optional = yes, start = $%4.4x;", actual->name, actual->address);
761 } else if ( actual->type == BT_EXPANSION && actual->name && ( actual->space != actual->remains ) ) {
762 outhead2("%s: .res %d,0", actual->name, actual->space - actual->remains );
763 } else {
764
765 }
766 actual = actual->next;
767 }
768 }
769
770 if ( _environment->descriptors ) {
771 outhead0(".segment \"UDCCHAR\"" );
772 outhead0("UDCCHAR:");
773 int i=0,j=0;
774 for(i=0;i<256;++i) {
775 outline1("; $%2.2x ", i);
776 out0(".byte " );
777 for(j=0;j<7;++j) {
778 out1("$%2.2x,", ((unsigned char)_environment->descriptors->data[i].data[j]) );
779 }
780 outline1("$%2.2x", ((unsigned char)_environment->descriptors->data[i].data[j]) );
781 }
782 } else {
783 outhead0("UDCCHAR = $9800");
784 }
785
786 if ( _environment->memoryAreas ) {
787 MemoryArea * memoryArea = _environment->memoryAreas;
788 while( memoryArea ) {
789 // if ( memoryArea->type == MAT_RAM ) {
790 // cfgline3("MA%3.3x: load = RAM%3.3x, type = overwrite, optional = yes, start = $%4.4x;", memoryArea->id, memoryArea->id, memoryArea->start);
791 // } else {
792 // cfgline2("MA%3.3x: load = MAIN, type = overwrite, optional = yes, start = $%4.4x;", memoryArea->id, memoryArea->start);
793 // }
794 outhead1(".segment \"MA%3.3x\"", memoryArea->id );
795 for( i=memoryArea->start; i<memoryArea->end; ++i ) {
796 Variable * variable = _environment->variables;
797 while( variable ) {
798 if (
799 ( !variable->assigned && variable->memoryArea == memoryArea && variable->absoluteAddress == i )
800 ) {
801 variable_cleanup_memory_mapped( _environment, variable );
802 variable->staticalInit = ( memoryArea->type == MAT_RAM ? 0 : 1 );
803 break;
804 }
805 variable = variable->next;
806 }
807 for( int j=0; j< (_environment->currentProcedure+1); ++j ) {
808 Variable * variable = _environment->tempVariables[j];
809 while( variable ) {
810 if (
811 ( !variable->assigned && variable->memoryArea == memoryArea && variable->absoluteAddress == i )
812 ){
813 variable_cleanup_memory_mapped( _environment, variable );
814 variable->staticalInit = ( memoryArea->type == MAT_RAM ? 0 : 1 );
815 break;
816 }
817 variable = variable->next;
818 }
819 }
820 variable = _environment->tempResidentVariables;
821 while( variable ) {
822 if (
823 ( !variable->assigned && variable->memoryArea == memoryArea && variable->absoluteAddress == i )
824 ) {
825 variable_cleanup_memory_mapped( _environment, variable );
826 variable->staticalInit = ( memoryArea->type == MAT_RAM ? 0 : 1 );
827 break;
828 }
829 variable = variable->next;
830 }
831 }
832 memoryArea = memoryArea->next;
833 }
834
835 }
836
837 buffered_push_output( _environment );
838
839 char buffer[32];
840 sprintf( buffer, "%5.5d", _environment->program.startingAddress );
841
842 outhead0(".segment \"BASIC\"");
843 outline0(".byte $01,$08,$0b,$08,$00,$00,$9e" );
844 outline5(".byte $%2.2x,$%2.2x,$%2.2x,$%2.2x,$%2.2x",
845 buffer[0],
846 buffer[1],
847 buffer[2],
848 buffer[3],
849 buffer[4]
850 );
851 outline0(".byte $00,$00,$00" );
852 outhead0(".segment \"CODE\"");
853 outline0("NOP");
854 outline0("NOP");
855 outline0("JMP CODESTART");
856
860
861 if ( _environment->chainUsed ) {
862 _environment->sysCallUsed = 1;
865 _environment->deployed.syscall = 0;
868 _environment->deployed.dcommon = 0;
871 _environment->deployed.dload = 0;
874 _environment->deployed.chain = 0;
875 outhead0("CHAINEDSTART:");
876 outline0("JMP CODESTART");
877 }
878
879 if ( _environment->sidFiles && ( ! _environment->sidRelocAddress || _environment->sidRelocAddress <= 0x1000 ) ) {
880 int lastAddress = 0;
881 SIDFILE * actual = _environment->sidFiles;
882 while( actual ) {
883 if ( lastAddress < actual->loadAddress + actual->size ) {
884 lastAddress = actual->loadAddress + actual->size;
885 }
886 actual = actual->next;
887 }
888 if ( lastAddress < ( _environment->program.startingAddress - 5 ) ) {
890 }
891 outline1(" .RES $%4.4x", lastAddress - _environment->program.startingAddress - 5 );;
892 }
893
905
906 // Moved here for banking reasons.
907
908 // outhead0(".segment \"CODE\"" );
909
910 variable_on_memory_init( _environment, 0 );
911
912 DataSegment * dataSegment = _environment->dataSegment;
913 while( dataSegment ) {
914 int i=0;
915 if ( dataSegment->data ) {
916 out1("%s: .BYTE ", dataSegment->realName );
917 } else {
918 outhead1("%s: ", dataSegment->realName );
919 }
920 DataDataSegment * dataDataSegment = dataSegment->data;
921 while( dataDataSegment ) {
922 if ( dataSegment->type ) {
923 if ( dataDataSegment->type == VT_STRING || dataDataSegment->type == VT_DSTRING ) {
924 out1("$%2.2x,", (unsigned char)(dataDataSegment->size) );
925 out1("\"%s\"", dataDataSegment->data );
926 } else {
927 for( i=0; i<(dataDataSegment->size-1); ++i ) {
928 out1("$%2.2x,", (unsigned char)(dataDataSegment->data[i]&0xff) );
929 }
930 out1("$%2.2x", (unsigned char)(dataDataSegment->data[i]&0xff) );
931 }
932 } else {
933 if ( dataDataSegment->type == VT_STRING || dataDataSegment->type == VT_DSTRING ) {
934 out1("$%2.2x,", (unsigned char)(dataDataSegment->type) );
935 out1("$%2.2x,", (unsigned char)(dataDataSegment->size) );
936 out1("\"%s\"", dataDataSegment->data );
937 } else {
938 out1("$%2.2x,", (unsigned char)(dataDataSegment->type) );
939 for( i=0; i<(dataDataSegment->size-1); ++i ) {
940 out1("$%2.2x,", (unsigned char)(dataDataSegment->data[i]&0xff) );
941 }
942 out1("$%2.2x", (unsigned char)(dataDataSegment->data[i]&0xff) );
943 }
944 }
945 dataDataSegment = dataDataSegment->next;
946 if ( dataDataSegment ) {
947 out0(",");
948 }
949 }
950 outline0("");
951 dataSegment = dataSegment->next;
952 }
953
954 if ( _environment->dataNeeded || _environment->dataSegment || _environment->deployed.read_data_unsafe ) {
955 outhead0("DATAPTRE:");
956 }
957
958 StaticString * staticStrings = _environment->strings;
959 while( staticStrings ) {
960 outhead3("cstring%d: .byte %d, %s", staticStrings->id, (int)strlen(staticStrings->value), escape_newlines_full( staticStrings->value, staticStrings->size ) );
961 staticStrings = staticStrings->next;
962 }
963
964 for( i=0; i<MAX_RESIDENT_SHAREDS; ++i ) {
965 if ( _environment->maxExpansionBankSize[i] ) {
966 outhead1("BANKWINDOWID%2.2x: .byte $FF, $FF", i );
967 outhead2("BANKWINDOW%2.2x: .res %d,0", i, _environment->maxExpansionBankSize[i]);
968 }
969 }
970
971 if ( _environment->bitmaskNeeded ) {
972 outhead0("BITMASK: .byte $01,$02,$04,$08,$10,$20,$40,$80");
973 outhead0("BITMASKN: .byte $fe,$fd,$fb,$f7,$ef,$df,$bf,$7f");
974 }
975 if ( _environment->deployed.dstring ) {
976 outhead1("max_free_string = $%4.4x", _environment->dstring.space == 0 ? DSTRING_DEFAULT_SPACE : _environment->dstring.space );
977 }
978
979}
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
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
#define VT_FLOAT_BITWIDTH(p)
Definition 6309.h:38
void vars_emit_byte(Environment *_environment, char *_name, int _value)
Definition _vars.c:84
char * escape_newlines(char *_string)
void buffered_push_output(Environment *_environment)
char * escape_newlines_full(char *_string, int _size)
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.
void chain(Environment *_environment, char *_filename)
Definition chain.c:101
void dload(Environment *_environment, char *_filename, char *_offset, char *_address, char *_bank, char *_size)
Emit code for DLOAD(...).
Definition dload.c:60
void dsave(Environment *_environment, char *_filename, char *_offset, char *_address, char *_size)
Emit code for DLOAD(...).
Definition dsave.c:58
#define DSTRING_DEFAULT_SPACE
Definition atari.h:152
void banks_generate(Environment *_environment)
Definition _banks.c:45
unsigned char src_hw_c64_bank_asm[]
Definition c64_bank.c:1
unsigned char src_hw_c64_chain_asm[]
Definition c64_chain.c:1
unsigned char src_hw_c64_dcommon_asm[]
Definition c64_dcommon.c:1
unsigned char src_hw_c64_dload_asm[]
Definition c64_dload.c:1
unsigned char src_hw_c64_dsave_asm[]
Definition c64_dsave.c:1
unsigned char src_hw_c64_startup_asm[]
Definition c64_startup.c:1
unsigned char src_hw_c64_syscall_asm[]
Definition c64_syscall.c:1
unsigned char src_hw_c64_vars_asm[]
Definition c64_vars.c:1
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
void console(Environment *_environment, int _x1, int _y1, int _x2, int _y2)
Emit code for CONSOLE.
Definition console.c:118
void end(Environment *_environment)
Emit ASM code for END.
Definition end.c:91
unsigned char src_hw_vic2_vscroll_text_up_asm[]
unsigned char src_hw_vic2_vars_asm[]
unsigned char src_hw_vic2_hscroll_text_asm[]
unsigned char src_hw_vic2_vscroll_text_down_asm[]
unsigned char src_hw_vic2_console_asm[]
unsigned char src_hw_vic2_startup_asm[]
struct _SIDFILE SIDFILE
int remains
Definition ugbc.h:171
char * name
Definition ugbc.h:156
struct _Bank * next
Definition ugbc.h:185
int space
Definition ugbc.h:168
BankType type
Definition ugbc.h:162
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 syscall
Definition ugbc.h:1958
int dload
Definition ugbc.h:1934
int read_data_unsafe
Definition ugbc.h:1923
int chain
Definition ugbc.h:1957
int dcommon
Definition ugbc.h:1933
int dstring
Definition ugbc.h:1789
Variable * tempResidentVariables
Definition ugbc.h:2595
int sidRelocAddress
Definition ugbc.h:3223
int chainUsed
Definition ugbc.h:3287
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
MemoryArea * memoryAreas
Definition ugbc.h:2689
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
int sysCallUsed
Definition ugbc.h:3162
SIDFILE * sidFiles
Definition ugbc.h:3221
TileDescriptors * descriptors
Definition ugbc.h:2939
int readDataUsed
Definition ugbc.h:2578
Deployed deployed
Definition ugbc.h:2921
int start
Definition ugbc.h:737
struct _MemoryArea * next
Definition ugbc.h:760
int id
Definition ugbc.h:732
MemoryAreaType type
Definition ugbc.h:757
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
int loadAddress
Definition sid_file.h:36
int size
Definition sid_file.h:42
unsigned char * data
Definition sid_file.h:41
struct _SIDFILE * next
Definition sid_file.h:44
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
FloatTypePrecision precision
Definition ugbc.h:991
SIDFILE * sidFile
Definition ugbc.h:1213
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
char * name
Definition ugbc.h:979
int absoluteAddress
Definition ugbc.h:1092
int usedImage
Definition ugbc.h:1220
int onStorage
Definition ugbc.h:1201
VariableType type
Definition ugbc.h:988
int staticalInit
Definition ugbc.h:1139
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
@ MAT_RAM
Definition ugbc.h:726
#define MAX_RESIDENT_SHAREDS
Definition ugbc.h:572
#define CRITICAL_CANNOT_LOAD_SID_FILE_NO_SPACE()
Definition ugbc.h:3804
struct _Variable Variable
Structure of a single variable.
#define outline2(s, a, b)
Definition ugbc.h:4254
struct _Environment Environment
Structure of compilation environment.
struct _MemoryArea MemoryArea
@ 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 deploy_preferred(s, e)
Definition ugbc.h:4299
#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
#define outhead3(s, a, b, c)
Definition ugbc.h:4249
@ BT_VARIABLES
Definition ugbc.h:126
@ BT_EXPANSION
Definition ugbc.h:138
@ 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 outline5(s, a, b, c, d, e)
Definition ugbc.h:4257
#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]