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