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 ( variable->memoryArea && variable->bankAssigned != -1 ) {
64 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
65 } else {
66 if ( strcmp( variable->name, "PEN" ) == 0 ) {
67 outhead1("%s = 646", variable->realName);
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_WORD:
81 case VT_SWORD:
82 case VT_POSITION:
83 case VT_ADDRESS:
84 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
85 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
86 } else {
87 vars_emit_word( _environment, variable->realName, variable->initialValue );
88 }
89 break;
90 case VT_DWORD:
91 case VT_SDWORD:
92 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
93 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
94 } else {
95 vars_emit_dword( _environment, variable->realName, variable->initialValue );
96 }
97 break;
98 case VT_NUMBER:
99 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
100 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
101 } else {
102 vars_emit_number( _environment, variable->realName, variable->initialValue );
103 }
104 break;
105 case VT_FLOAT:
106 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
107 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
108 } else {
109 outhead1("%s: .res 4,0", variable->realName);
110 }
111 break;
112 case VT_STRING:
113 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
114 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
115 } else {
116 outhead2("%s = cstring%d", variable->realName, variable->valueString->id );
117 }
118 break;
119 case VT_DSTRING:
120 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
121 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
122 } else {
123 outhead1("%s: .res 1,0", variable->realName);
124 }
125 break;
126 case VT_TILE:
127 case VT_TILESET:
128 case VT_SPRITE:
129 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
130 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
131 } else {
132 outhead1("%s: .res 1,0", variable->realName);
133 }
134 break;
135 case VT_MSPRITE:
136 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
137 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
138 } else {
139 outhead1("%s: .res 2,0", variable->realName);
140 }
141 break;
142 case VT_TILES:
143 if ( variable->memoryArea && variable->bankAssigned != -1 ) {
144 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
145 } else {
146 outhead1("%s: .res 4,0", variable->realName);
147 }
148 break;
149 case VT_IMAGEREF:
150 if ( variable->memoryArea ) {
151 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
152 } else {
153 outhead1("%s: .res 14,0", variable->realName);
154 }
155 break;
156 case VT_PATH:
157 if ( variable->memoryArea ) {
158 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
159 } else {
160 outhead1("%s: .res 16,0", variable->realName);
161 }
162 break;
163 case VT_VECTOR2:
164 if ( variable->memoryArea ) {
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
373 variable = variable->next;
374 }
375
376}
377
378static void variable_cleanup_memory_mapped( Environment * _environment, Variable * _variable ) {
379
380 outhead2("; %s (%4.4x)", _variable->realName, _variable->absoluteAddress );
381
382 switch( _variable->type ) {
383 case VT_CHAR:
384 outhead1("%s:", _variable->realName );
385 if ( _variable->value >= 32 ) {
386 outline1(" .byte '%c'", ( _variable->value & 0xff ) );
387 } else {
388 outline1(" .byte $%1.1x", ( _variable->value & 0xff ) );
389 }
390 break;
391 case VT_BYTE:
392 case VT_SBYTE:
393 case VT_COLOR:
394 case VT_THREAD:
395 if ( strcmp( _variable->name, "PEN" ) == 0 ) {
396 outhead1("%s = 646", _variable->realName);
397 } else {
398 vars_emit_byte( _environment, _variable->realName, _variable->initialValue );
399 }
400 break;
401 case VT_DOJOKA:
402 outhead1("%s:", _variable->realName );
403 outline0(" .res 4, 0" );
404 break;
405 case VT_IMAGEREF:
406 outhead1("%s:", _variable->realName );
407 outline0(" .res 14, 0" );
408 break;
409 case VT_PATH:
410 outhead1("%s:", _variable->realName );
411 outline0(" .res 16, 0" );
412 break;
413 case VT_VECTOR2:
414 outhead1("%s:", _variable->realName );
415 outline0(" .res 4, 0" );
416 break;
417 case VT_WORD:
418 case VT_SWORD:
419 case VT_POSITION:
420 case VT_ADDRESS:
421 vars_emit_word( _environment, _variable->realName, _variable->initialValue );
422 break;
423 case VT_DWORD:
424 case VT_SDWORD:
425 vars_emit_dword( _environment, _variable->realName, _variable->initialValue );
426 break;
427 case VT_NUMBER:
428 vars_emit_number( _environment, _variable->realName, _variable->initialValue );
429 break;
430 case VT_FLOAT: {
431 outhead1("%s:", _variable->realName );
432 // int bytes = VT_FLOAT_BITWIDTH( _variable->precision ) >> 3;
433 // int * data = malloc( bytes * sizeof( int ) );
434 // switch( _variable->precision ) {
435 // case FT_FAST:
436 // cpu_float_fast_from_double_to_int_array( _environment, _variable->valueFloating, data );
437 // break;
438 // case FT_SINGLE:
439 // cpu_float_single_from_double_to_int_array( _environment, _variable->valueFloating, data );
440 // break;
441 // }
442 // for( int i=0; i<bytes; ++i ) {
443 // outline1(" .byte $%2.2x", (unsigned char)( ( data[i] ) & 0xff ) );
444 // }
445 outhead1("%s: .res 4,0", _variable->realName);
446 break;
447 }
448 case VT_STRING:
449 outhead2("%s = cstring%d", _variable->realName, _variable->valueString->id );
450 break;
451 case VT_DSTRING:
452 case VT_SPRITE:
453 case VT_TILE:
454 case VT_TILESET:
455 outhead1("%s:", _variable->realName );
456 outline0(" .byte 0" );
457 break;
458 case VT_MSPRITE:
459 outhead1("%s:", _variable->realName );
460 outline0(" .byte 0, 0" );
461 break;
462 case VT_TILES:
463 outhead1("%s:", _variable->realName );
464 outline0(" .byte 0, 0, 0, 0" );
465 break;
466 case VT_BLIT:
467 break;
468 case VT_IMAGE:
469 case VT_IMAGES:
470 case VT_SEQUENCE:
471 if ( _variable->usedImage ) {
472 if ( _variable->bankAssigned != -1 ) {
473 outhead2("; relocated on bank %d (at %4.4x)", _variable->bankAssigned, _variable->absoluteAddress );
474 outhead1("%s: .byte $0", _variable->realName );
475 } else {
476 outhead1("%s:", _variable->realName );
477 if ( _variable->valueBuffer && ! _variable->onStorage ) {
478 if ( _variable->printable ) {
479 char * string = malloc( _variable->size + 1 );
480 memset( string, 0, _variable->size + 1 );
481 memcpy( string, _variable->valueBuffer, _variable->size );
482 outline1(" .byte %s", escape_newlines( string ) );
483 } else {
484 out0(" .byte ");
485 int i=0;
486 for (i=0; i<(_variable->size-1); ++i ) {
487 out1("$%2.2x,", (unsigned char)(_variable->valueBuffer[i] & 0xff ) );
488 }
489 outline1("$%2.2x", (unsigned char)(_variable->valueBuffer[(_variable->size-1)] & 0xff ) );
490 }
491 } else {
492 outline1(" .res %d,0", _variable->size);
493 }
494 }
495 }
496 break;
497 case VT_MUSIC:
498 case VT_BUFFER:
499 case VT_TYPE:
500 if ( _variable->bankAssigned != -1 ) {
501 outhead2("; relocated on bank %d (at %4.4x)", _variable->bankAssigned, _variable->absoluteAddress );
502 outhead1("%s: .byte $0", _variable->realName );
503 } else {
504 outhead1("%s:", _variable->realName );
505 if ( _variable->valueBuffer && ! _variable->onStorage ) {
506 if ( _variable->printable ) {
507 char * string = malloc( _variable->size + 1 );
508 memset( string, 0, _variable->size + 1 );
509 memcpy( string, _variable->valueBuffer, _variable->size );
510 outline1(" .byte %s", escape_newlines( string ) );
511 } else {
512 out0(" .byte ");
513 int i=0;
514 for (i=0; i<(_variable->size-1); ++i ) {
515 out1("$%2.2x,", (unsigned char)(_variable->valueBuffer[i] & 0xff ) );
516 }
517 outline1("$%2.2x", (unsigned char)(_variable->valueBuffer[(_variable->size-1)] & 0xff ) );
518 }
519 } else {
520 outline1(" .res %d,0", _variable->size);
521 }
522 }
523 break;
524 case VT_TARRAY: {
525 if ( _variable->bankAssigned != -1 ) {
526 outhead4("; relocated on bank %d (at %4.4x) for %d bytes (uncompressed: %d)", _variable->bankAssigned, _variable->absoluteAddress, _variable->size, _variable->uncompressedSize );
527 if ( _variable->type == VT_TARRAY ) {
528 if (VT_BITWIDTH( _variable->arrayType ) == 0 ) {
530 }
531 // force +1 byte if size is odd
532 outhead2("%s: .res %d, $00", _variable->realName, (VT_BITWIDTH( _variable->arrayType )>>3) );
533 } else {
534 if (VT_BITWIDTH( _variable->type ) == 0 ) {
535 CRITICAL_DATATYPE_UNSUPPORTED( "BANKED", DATATYPE_AS_STRING[ _variable->type ] );
536 }
537 // force +1 byte if size is odd
538 outhead2("%s: .res %d, $00", _variable->realName, (VT_BITWIDTH( _variable->type )>>3) );
539 }
540 } else {
541 if ( ! _variable->memoryArea && _variable->valueBuffer ) {
542 out1("%s: .byte ", _variable->realName);
543 int i=0;
544 for (i=0; i<(_variable->size-1); ++i ) {
545 out1("$%2.2x,", (unsigned char) ( _variable->valueBuffer[i] & 0xff ) );
546 }
547 outline1("$%2.2x", (unsigned char) ( _variable->valueBuffer[(_variable->size-1)] & 0xff ) );
548 } else if ( _variable->memoryArea && ! _variable->value ) {
549 outhead3("%s: .res %d, $%2.2x", _variable->realName, _variable->size, 0 );
550 } else {
551 if ( _variable->value ) {
552 switch( VT_BITWIDTH( _variable->arrayType ) ) {
553 case 32: {
554 out1("%s: .byte ", _variable->realName );
555 for( int i=0; i<(_variable->size/4)-1; ++i ) {
556 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 ) );
557 }
558 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 ) );
559 outline0("");
560 break;
561 }
562 case 16: {
563 out1("%s: .byte ", _variable->realName );
564 for( int i=0; i<(_variable->size/2)-1; ++i ) {
565 out2("$%2.2x, $%2.2x,", (unsigned int)( _variable->value & 0xff ), (unsigned int)( ( _variable->value >> 8 ) & 0xff ) );
566 }
567 out2("$%2.2x, $%2.2x", (unsigned int)( _variable->value & 0xff ), (unsigned int)( ( _variable->value >> 8 ) & 0xff ) );
568 outline0("");
569 break;
570 }
571 case 8:
572 outhead3("%s: .res %d, $%2.2x", _variable->realName, _variable->size, (unsigned char)(_variable->value&0xff) );
573 break;
574 case 1:
575 outhead3("%s: .res %d, $%2.2x", _variable->realName, _variable->size, (unsigned char)(_variable->value?0xff:0x00));
576 break;
577 }
578
579 } else {
580 outhead2("%s: .res %d, 0", _variable->realName, _variable->size);
581 }
582 }
583 }
584
585 break;
586 }
587
588
589 }
590
591 if( _variable->type == VT_IMAGES ) {
592 if ( _variable->strips ) {
593 vars_emit_strips( _environment, _variable->realName, _variable->strips );
594 }
595 }
596
597
598}
599
600static void variable_cleanup_entry_bit( Environment * _environment, Variable * _first ) {
601
602 Variable * variable = _first;
603
604 int bitCount = 0;
605
606 while( variable ) {
607
608 if ( ( !variable->assigned || ( variable->assigned && !variable->temporary ) ) && !variable->imported && !variable->memoryArea ) {
609
610 if ( variable->memoryArea && _environment->debuggerLabelsFile ) {
611 fprintf( _environment->debuggerLabelsFile, "%4.4x %s\r\n", variable->absoluteAddress, variable->realName );
612 }
613
614 switch( variable->type ) {
615 case VT_BIT:
616 if ( variable->memoryArea ) {
617 // outhead2("%s = $%4.4x", variable->realName, variable->absoluteAddress);
618 } else {
619 outhead1("%s:", variable->realName);
620 }
621 ++bitCount;
622 if ( bitCount == 8 ) {
623 outline0(" .res 1,0");
624 }
625 break;
626 }
627
628 }
629
630 variable = variable->next;
631
632 }
633
634 if ( bitCount > 0 ) {
635 outline0(" .res 1,0");
636 }
637
638}
639
649void variable_cleanup( Environment * _environment ) {
650 int i=0;
651
652 vars_emit_constants( _environment );
653
654 if ( _environment->offsetting ) {
655 Offsetting * actual = _environment->offsetting;
656 while( actual ) {
657 out1("OFFSETS%4.4x: .word ", actual->size );
658 for( i=0; i<actual->count; ++i ) {
659 out1("$%4.4x", i * actual->size );
660 if ( i < ( actual->count - 1 ) ) {
661 out0(",");
662 } else {
663 outline0("");
664 }
665 }
666 if ( actual->variables ) {
667 OffsettingVariable * actualVariable = actual->variables;
668 while( actualVariable ) {
669 if ( actualVariable->sequence ) {
670 outhead1("%soffsetsequence:", actualVariable->variable->realName );
671 } else {
672 outhead1("%soffsetframe:", actualVariable->variable->realName );
673 }
674 actualVariable = actualVariable->next;
675 }
676 outhead1("fs%4.4xoffsetsequence:", actual->size );
677 outhead1("fs%4.4xsoffsetframe:", actual->size );
678 outline1("LDA #<OFFSETS%4.4x", actual->size );
679 outline0("STA MATHPTR1" );
680 outline1("LDA #>OFFSETS%4.4x", actual->size );
681 outline0("STA MATHPTR1+1" );
682 outline0("CLC" );
683 outline0("LDA MATHPTR0" );
684 outline0("ASL" );
685 outline0("TAY" );
686 outline0("LDA TMPPTR" );
687 outline0("ADC (MATHPTR1), Y" );
688 outline0("STA TMPPTR" );
689 outline0("INY" );
690 outline0("LDA TMPPTR+1" );
691 outline0("ADC (MATHPTR1), Y" );
692 outline0("STA TMPPTR+1" );
693 outline0("RTS" );
694 }
695 actual = actual->next;
696 }
697
698 int values[MAX_TEMPORARY_STORAGE];
699 char * address[MAX_TEMPORARY_STORAGE];
700
701 actual = _environment->offsetting;
702 int count = 0;
703 while( actual ) {
704 values[count] = actual->size;
705 address[count] = malloc( MAX_TEMPORARY_STORAGE );
706 sprintf( address[count], "fs%4.4xsoffsetframe", actual->size );
707 actual = actual->next;
708 ++count;
709 }
710
711 cpu_address_table_build( _environment, "EXECOFFSETS", values, address, count );
712
713 cpu_address_table_lookup( _environment, "EXECOFFSETS", count );
714
715 }
716
717 generate_cgoto_address_table( _environment );
718
719 for(i=0; i<BANK_TYPE_COUNT; ++i) {
720 Bank * actual = _environment->banks[i];
721 while( actual ) {
722 if ( actual->type == BT_VARIABLES ) {
723 // cfgline3("# BANK %s %s AT $%4.4x", BANK_TYPE_AS_STRING[actual->type], actual->name, actual->address);
724 // cfgline2("%s: load = MAIN, type = ro, optional = yes, start = $%4.4x;", actual->name, actual->address);
725 // outhead1(".segment \"%s\"", actual->name);
726 Variable * variable = _environment->variables;
727
728 variable_cleanup_entry( _environment, variable );
729 variable_cleanup_entry_bit( _environment, variable );
730
731 } else if ( actual->type == BT_TEMPORARY ) {
732 // cfgline3("# BANK %s %s AT $%4.4x", BANK_TYPE_AS_STRING[actual->type], actual->name, actual->address);
733 // cfgline2("%s: load = MAIN, type = ro, optional = yes, start = $%4.4x;", actual->name, actual->address);
734 // outhead1(".segment \"%s\"", actual->name);
735 for( int j=0; j< (_environment->currentProcedure+1); ++j ) {
736 Variable * variable = _environment->tempVariables[j];
737 variable_cleanup_entry( _environment, variable );
738 variable_cleanup_entry_bit( _environment, variable );
739 }
740
741 Variable * variable = _environment->tempResidentVariables;
742
743 variable_cleanup_entry( _environment, variable );
744 variable_cleanup_entry_bit( _environment, variable );
745
746 // } else if ( actual->type == BT_STRINGS ) {
747 // cfgline3("# BANK %s %s AT $%4.4x", BANK_TYPE_AS_STRING[actual->type], actual->name, actual->address);
748 // cfgline2("%s: load = MAIN, type = ro, optional = yes, start = $%4.4x;", actual->name, actual->address);
749 } else {
750
751 }
752 actual = actual->next;
753 }
754 }
755
756 if ( _environment->descriptors ) {
757 outhead0(".segment \"UDCCHAR\"" );
758 int i=0,j=0;
759 for(i=0;i<256;++i) {
760 outline1("; $%2.2x ", i);
761 out0(".byte " );
762 for(j=0;j<7;++j) {
763 out1("$%2.2x,", ((unsigned char)_environment->descriptors->data[i].data[j]) );
764 }
765 outline1("$%2.2x", ((unsigned char)_environment->descriptors->data[i].data[j]) );
766 }
767 } else {
768 outhead0("UDCCHAR = $9800");
769 }
770
771 if ( _environment->memoryAreas ) {
772 MemoryArea * memoryArea = _environment->memoryAreas;
773 while( memoryArea ) {
774 // if ( memoryArea->type == MAT_RAM ) {
775 // cfgline3("MA%3.3x: load = RAM%3.3x, type = overwrite, optional = yes, start = $%4.4x;", memoryArea->id, memoryArea->id, memoryArea->start);
776 // } else {
777 // cfgline2("MA%3.3x: load = MAIN, type = overwrite, optional = yes, start = $%4.4x;", memoryArea->id, memoryArea->start);
778 // }
779 outhead1(".segment \"MA%3.3x\"", memoryArea->id );
780 for( i=memoryArea->start; i<memoryArea->end; ++i ) {
781 Variable * variable = _environment->variables;
782 while( variable ) {
783 if (
784 ( !variable->assigned && variable->memoryArea == memoryArea && variable->absoluteAddress == i )
785 ) {
786 variable_cleanup_memory_mapped( _environment, variable );
787 variable->staticalInit = ( memoryArea->type == MAT_RAM ? 0 : 1 );
788 break;
789 }
790 variable = variable->next;
791 }
792 for( int j=0; j< (_environment->currentProcedure+1); ++j ) {
793 Variable * variable = _environment->tempVariables[j];
794 while( variable ) {
795 if (
796 ( !variable->assigned && variable->memoryArea == memoryArea && variable->absoluteAddress == i )
797 ){
798 variable_cleanup_memory_mapped( _environment, variable );
799 variable->staticalInit = ( memoryArea->type == MAT_RAM ? 0 : 1 );
800 break;
801 }
802 variable = variable->next;
803 }
804 }
805 variable = _environment->tempResidentVariables;
806 while( variable ) {
807 if (
808 ( !variable->assigned && variable->memoryArea == memoryArea && variable->absoluteAddress == i )
809 ) {
810 variable_cleanup_memory_mapped( _environment, variable );
811 variable->staticalInit = ( memoryArea->type == MAT_RAM ? 0 : 1 );
812 break;
813 }
814 variable = variable->next;
815 }
816 }
817 memoryArea = memoryArea->next;
818 }
819
820 }
821
822 buffered_push_output( _environment );
823
824 char buffer[32];
825 sprintf( buffer, "%5.5d", _environment->program.startingAddress );
826
827 outhead0(".segment \"BASIC\"");
828 outline0(".byte $01,$08,$0b,$08,$00,$00,$9e" );
829 outline5(".byte $%2.2x,$%2.2x,$%2.2x,$%2.2x,$%2.2x",
830 buffer[0],
831 buffer[1],
832 buffer[2],
833 buffer[3],
834 buffer[4]
835 );
836 outline0(".byte $00,$00,$00" );
837 outhead0(".segment \"CODE\"");
838 outline0("NOP");
839 outline0("NOP");
840 outline0("JMP CODESTART")
841 if ( _environment->sidFiles && ( ! _environment->sidRelocAddress || _environment->sidRelocAddress <= 0x1000 ) ) {
842 int lastAddress = 0;
843 SIDFILE * actual = _environment->sidFiles;
844 while( actual ) {
845 if ( lastAddress < actual->loadAddress + actual->size ) {
846 lastAddress = actual->loadAddress + actual->size;
847 }
848 actual = actual->next;
849 }
850 if ( lastAddress < ( _environment->program.startingAddress - 5 ) ) {
852 }
853 outline1(" .RES $%4.4x", lastAddress - _environment->program.startingAddress - 5 );;
854 }
855 deploy_inplace_preferred( vars, src_hw_c64reu_vars_asm);
856 deploy_inplace_preferred( startup, src_hw_c64reu_startup_asm);
862 deploy_inplace_preferred( bank, src_hw_c64reu_bank_asm );
864
865 // outhead0(".segment \"CODE\"" );
866
867 variable_on_memory_init( _environment, 0 );
868
869 if ( _environment->outputFileType == OUTPUT_FILE_TYPE_D64 ) {
870 outhead0("C64REUBANKSLOAD:")
871 Bank * bank = _environment->expansionBanks;
872 while( bank ) {
873 if ( bank->remains < bank->space ) {
874 outline1("LDA #'%d'", bank->id );
875 outline0("STA C64REUBANKFILENAME+4" );
876 outline0("LDA #0" );
877 outline0("STA REUREUBASE" );
878 outline0("STA REUREUBASE+1" );
879 outline1("LDA #$%2.2x", bank->id );
880 outline0("STA REUREUBASE+2" );
881 outline0("JSR C64REUBANKLOAD");
882 }
883 bank = bank->next;
884 }
885 outline0("RTS" );
886 }
887
888 if ( _environment->dataSegment ) {
889 char * data = malloc( 0x10000 );
890 memset( data, 0, 0x10000 );
891 DataSegment * dataSegment = _environment->dataSegment;
892 int dataOffset=0;
893 while( dataSegment ) {
894 dataSegment->absoluteAddress = dataOffset;
895 DataDataSegment * dataDataSegment = dataSegment->data;
896 while( dataDataSegment ) {
897 if ( dataSegment->type ) {
898 if ( dataDataSegment->type == VT_STRING || dataDataSegment->type == VT_DSTRING ) {
899 data[dataOffset] = (unsigned char)(dataDataSegment->size);
900 for( i=0; i<(dataDataSegment->size); ++i ) {
901 unsigned char letter = (unsigned char)(dataDataSegment->data[i]&0xff);
902 if ( letter >= 'a' && letter <= 'z' ) {
903 letter = letter - 'a' + 'A';
904 } else if ( letter >= 'a' && letter <= 'z' ) {
905 letter = letter - 'A' + 'a';
906 }
907 data[dataOffset+i+1] = letter;
908 }
909 dataOffset += ( dataDataSegment->size + 1 );
910 } else {
911 for( i=0; i<(dataDataSegment->size); ++i ) {
912 data[dataOffset+i] = (unsigned char)(dataDataSegment->data[i]&0xff);
913 }
914 dataOffset += ( dataDataSegment->size );
915 }
916 } else {
917 if ( dataDataSegment->type == VT_STRING || dataDataSegment->type == VT_DSTRING ) {
918 data[dataOffset] = (unsigned char)(dataDataSegment->type);
919 data[dataOffset+1] = (unsigned char)(dataDataSegment->size);
920 for( i=0; i<(dataDataSegment->size); ++i ) {
921 unsigned char letter = (unsigned char)(dataDataSegment->data[i]&0xff);
922 if ( letter >= 'a' && letter <= 'z' ) {
923 letter = letter - 'a' + 'A';
924 } else if ( letter >= 'a' && letter <= 'z' ) {
925 letter = letter - 'A' + 'a';
926 }
927 data[dataOffset+i+2] = letter;
928 }
929 dataOffset += ( dataDataSegment->size + 2 );
930 } else {
931 data[dataOffset] = (unsigned char)(dataDataSegment->type);
932 for( i=0; i<(dataDataSegment->size); ++i ) {
933 data[dataOffset+i+1] = (unsigned char)(dataDataSegment->data[i]&0xff);
934 }
935 dataOffset += ( dataDataSegment->size + 1 );
936 }
937 }
938 dataDataSegment = dataDataSegment->next;
939 }
940 dataSegment = dataSegment->next;
941 }
942 int dataBank = banks_store_data( _environment, data, 0xffff );
943 outhead1("DATABANKC = $%2.2x", dataBank );
944 outhead0("DATABANK: .byte DATABANKC");
945
946 outhead0("DATAFIRSTSEGMENT = $0000" );
947 if ( _environment->readDataUsed && _environment->restoreDynamic ) {
948 outhead0("DATASEGMENTNUMERIC:" );
949 DataSegment * actual = _environment->dataSegment;
950 while( actual ) {
951 if ( actual->isNumeric ) {
952 outline2( ".word $%4.4x, $%4.4x", actual->lineNumber, actual->absoluteAddress );
953 }
954 actual = actual->next;
955 }
956 outline1( ".word $ffff, $%4.4x", _environment->dataLastAbsoluteAddress );
957 }
958
959 }
960
961 if ( _environment->dataNeeded || _environment->dataSegment || _environment->deployed.read_data_unsafe ) {
962 outhead1("DATAPTRE: .word $%4.4x", _environment->dataLastAbsoluteAddress );
963 }
964
965 StaticString * staticStrings = _environment->strings;
966 while( staticStrings ) {
967 outhead3("cstring%d: .byte %d, %s", staticStrings->id, (int)strlen(staticStrings->value), escape_newlines( staticStrings->value ) );
968 staticStrings = staticStrings->next;
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
980}
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
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)
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
int banks_store_data(Environment *_environment, char *_data, int _size)
Definition _banks.c:312
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
int id
Definition ugbc.h:153
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
int absoluteAddress
Definition ugbc.h:2194
VariableType type
Definition ugbc.h:2187
int isNumeric
Definition ugbc.h:2189
int read_data_unsafe
Definition ugbc.h:1923
int dstring
Definition ugbc.h:1789
Variable * tempResidentVariables
Definition ugbc.h:2595
int sidRelocAddress
Definition ugbc.h:3223
Offsetting * offsetting
Definition ugbc.h:2937
Bank * banks[BANK_TYPE_COUNT]
Definition ugbc.h:2514
Program program
Definition ugbc.h:3179
OutputFileType outputFileType
Definition ugbc.h:2452
Variable * tempVariables[MAX_PROCEDURES]
Definition ugbc.h:2606
DataSegment * dataSegment
Definition ugbc.h:2568
FILE * debuggerLabelsFile
Definition ugbc.h:3319
Bank * expansionBanks
Definition ugbc.h:3005
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
SIDFILE * sidFiles
Definition ugbc.h:3221
TileDescriptors * descriptors
Definition ugbc.h:2939
int dataLastAbsoluteAddress
Definition ugbc.h:3278
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
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
@ OUTPUT_FILE_TYPE_D64
Definition ugbc.h:266
#define MAX_TEMPORARY_STORAGE
Definition ugbc.h:563
struct _Offsetting Offsetting
@ MAT_RAM
Definition ugbc.h:726
#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 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_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]