ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
put_image.c
Go to the documentation of this file.
1/*****************************************************************************
2 * ugBASIC - an isomorphic BASIC language compiler for retrocomputers *
3 *****************************************************************************
4 * Copyright 2021-2026 Marco Spedaletti (asimov@mclink.it)
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *----------------------------------------------------------------------------
18 * Concesso in licenza secondo i termini della Licenza Apache, versione 2.0
19 * (la "Licenza"); è proibito usare questo file se non in conformità alla
20 * Licenza. Una copia della Licenza è disponibile all'indirizzo:
21 *
22 * http://www.apache.org/licenses/LICENSE-2.0
23 *
24 * Se non richiesto dalla legislazione vigente o concordato per iscritto,
25 * il software distribuito nei termini della Licenza è distribuito
26 * "COSÌ COM'È", SENZA GARANZIE O CONDIZIONI DI ALCUN TIPO, esplicite o
27 * implicite. Consultare la Licenza per il testo specifico che regola le
28 * autorizzazioni e le limitazioni previste dalla medesima.
29 ****************************************************************************/
30
31/****************************************************************************
32 * INCLUDE SECTION
33 ****************************************************************************/
34
35#include "../../ugbc.h"
36
37/****************************************************************************
38 * CODE SECTION
39 ****************************************************************************/
40
41extern char DATATYPE_AS_STRING[][16];
42
53/* <usermanual>
54@keyword PUT IMAGE
55
56@english
57This function draws an image at a specific position on the screen.
58The programmer can draw on the screen a single image (''IMAGE''), a
59frame of a series of images (''ATLAS'') or a frame of a strip of a
60sequence of images (''SEQUENCE''). In all cases the syntax changes
61slightly.
62
63Every ''PUT IMAGE'' can be followed by a flag that modify the
64wayt the image will be drawn on the screen. The ''WITH TRANSPARENCY''
65will enable the transparency effect when the image is drawn,
66while ''DOUBLE Y'' will double the vertical size of the image. Both
67flags could be not available on all targerts and graphical modes.
68
69Another syntax is more compatible with other BASICs, that requires
70that the ''PUT IMAGE'' is followed with the bounds to draw to. This
71is only a syntatic equivalence, there is no "clipping" around the
72bounds. Moreover, it is possible to give a flag that alter the
73default behaviour of ''PUT IMAGE''. The ''PSET'' is the standard
74behaviour of ''PUT IMAGE'', while ''PRESET'' will put only the
75bitmap part of the image (if possible). The ''AND'' and ''OR''
76flags will activate the same logical operation between the
77image and the background. ''NOT'' is not currently supported.
78
79@italian
80Questa funzione disegna una immagine in una specifica posizione dello schermo.
81Il programmatore può disegnare sullo schermo una singola immagine
82(''IMAGE''), un frame di una serie di immagini (''ATLAS'') oppure
83un frame di una posa di una sequenza di immagini (''SEQUENCE'').
84In tutti i casi la sintassi cambia leggermente.
85
86Ogni ''PUT IMAGE'' può essere seguito da un flag che modifica il
87modo in cui l'immagine verrà disegnata sullo schermo. ''WITH TRANSPARENCY''
88abilita l'effetto trasparenza quando l'immagine viene disegnata,
89mentre ''DOUBLE Y'' raddoppia la dimensione verticale dell'immagine. Entrambi i
90flag potrebbero non essere disponibili su tutti i target e le modalità grafiche.
91
92Un'altra sintassi è più compatibile con altri BASIC, che richiede
93che ''PUT IMAGE'' sia seguito dai limiti su cui disegnare. Questa
94è solo un'equivalenza sintattica, non c'è alcun "clipping" attorno ai
95limiti. Inoltre, è possibile fornire un flag che alteri il
96comportamento predefinito di ''PUT IMAGE''. ''PSET'' è il comportamento
97standard di ''PUT IMAGE'', mentre ''PRESET'' inserirà solo la
98parte bitmap dell'immagine (se possibile). I flag ''AND'' e ''OR''
99attiveranno la stessa operazione logica tra l'immagine e lo sfondo.
100''NOT'' non è attualmente supportato.
101
102@syntax PUT IMAGE resource [ AT [x],[y] ] [fl]
103@syntax PUT IMAGE resource FRAME f [ AT [x],[y] ] [fl]
104@syntax PUT IMAGE resource STRIP s FRAME f [ AT [x],[y] ] [fl]
105@syntax fl: [WITH TRANSPARENCY] [DOUBLE Y]
106@syntax PUT ([x1],[y1])-(x2,y2),resource[,fl2]
107@syntax fl2: PSET|PRESET|AND|OR|NOT
108
109@example PUT IMAGE airplane AT 10,10
110
111@usedInExample contrib_themill.bas
112@usedInExample defines_screen_01.bas
113@usedInExample images_load_05.bas
114
115@seeAlso PUT BITMAP
116
117</usermanual> */
118/* <usermanual>
119@keyword PUT BITMAP
120
121@english
122This function draws the bitmap component of an image at a specific position on the screen.
123The programmer can draw on the screen a single bitmap (''IMAGE''), a
124frame of a series of bitmaps (''ATLAS'') or a frame of a strip of a
125sequence of bitmaps (''SEQUENCE''). In all cases the syntax changes
126slightly.
127
128Every ''PUT BITMAP'' can be followed by a flag that modify the
129wayt the image will be drawn on the screen. The ''DOUBLE Y''
130flag will double the vertical size of the image. This flag
131could be not available on all targerts and graphical modes.
132
133@italian
134Questa funzione disegna una bitmap (immagine senza colori) in una specifica posizione dello schermo.
135Il programmatore può disegnare sullo schermo una singola bitmap
136(''IMAGE''), un frame di una serie di bitmap (''ATLAS'') oppure
137un frame di una posa di una sequenza di bitmap (''SEQUENCE'').
138In tutti i casi la sintassi cambia leggermente.
139
140Ogni ''PUT BITMAP'' può essere seguito da un flag che modifica il
141modo in cui l'immagine verrà disegnata sullo schermo. Il flag
142''DOUBLE Y'' raddoppia la dimensione verticale della bitmap, ma
143potrebbe non essere disponibile su tutti i target e le modalità grafiche.
144
145@syntax PUT BITMAP resource [ AT [x],[y] ] [DOUBLE Y]
146@syntax PUT BITMAP resource FRAME f [ AT [x],[y] ] [DOUBLE Y]
147@syntax PUT BITMAP resource STRIP s FRAME f [ AT [x],[y] ] [DOUBLE Y]
148
149@example PUT BITMAP airplane AT 10,10
150
151@usedInExample contrib_themill.bas
152@usedInExample defines_screen_01.bas
153@usedInExample images_load_05.bas
154
155@seeAlso PUT IMAGE
156
157</usermanual> */
158
159void put_image_vars_original( Environment * _environment, char * _image, char * _x1, char * _y1, char * _x2, char * _y2, char * _frame, char * _sequence, char * _flags ) {
160
161 if ( _environment->emptyProcedure ) {
162 return;
163 }
164
166
167 Variable * image = variable_retrieve( _environment, _image );
168
169 Resource * resource = build_resource_for_sequence( _environment, _image, _frame, _sequence );
170
171 Variable * x1 = variable_retrieve_or_define( _environment, _x1, VT_POSITION, 0 );
172 Variable * y1 = variable_retrieve_or_define( _environment, _y1, VT_POSITION, 0 );
173 Variable * realFrame = NULL;
174 Variable * frame = NULL;
175 if ( _frame) {
176 frame = variable_retrieve_or_define( _environment, _frame, VT_BYTE, 0 );
177 realFrame = frame;
178 }
179 Variable * sequence = NULL;
180 if ( _sequence) {
181 sequence = variable_retrieve_or_define( _environment, _sequence, VT_BYTE, 0 );
182 }
183
184 switch( resource->type ) {
185 case VT_SEQUENCE:
186 if ( image->bankAssigned != -1 ) {
187
188 char alreadyLoadedLabel[MAX_TEMPORARY_STORAGE];
189 sprintf(alreadyLoadedLabel, "%salready", label );
190
191 char bankWindowId[MAX_TEMPORARY_STORAGE];
192 sprintf( bankWindowId, "BANKWINDOWID%2.2x", image->residentAssigned );
193
194 char bankWindowName[MAX_TEMPORARY_STORAGE];
195 sprintf( bankWindowName, "BANKWINDOW%2.2x", image->residentAssigned );
196
197 // cpu_compare_and_branch_16bit_const( _environment, bankWindowId, image->variableUniqueId, alreadyLoadedLabel, 1 );
198 // if ( image->uncompressedSize ) {
199 // bank_uncompress_semi_var( _environment, image->bankAssigned, image->absoluteAddress, bankWindowName );
200 // } else {
201 // bank_read_semi_var( _environment, image->bankAssigned, image->absoluteAddress, bankWindowName, image->size );
202 // }
203 // cpu_store_16bit(_environment, bankWindowId, image->variableUniqueId );
204 // cpu_label( _environment, alreadyLoadedLabel );
205
206 Variable * frameSize = variable_temporary( _environment, VT_WORD, "(temporary)");
207 variable_store( _environment, frameSize->name, image->frameSize );
208 Variable * bank = variable_temporary( _environment, VT_BYTE, "(temporary)");
209 variable_store( _environment, bank->name, image->bankAssigned );
210 Variable * offset = variable_temporary( _environment, VT_ADDRESS, "(temporary)");
211
212 if ( !sequence ) {
213 if ( !frame ) {
214 ted_calculate_sequence_frame_offset(_environment, offset->realName, "", "", image->frameSize, image->frameCount );
215 } else {
216 ted_calculate_sequence_frame_offset(_environment, offset->realName, "", frame->realName, image->frameSize, image->frameCount );
217 }
218 } else {
219 if ( !frame ) {
220 ted_calculate_sequence_frame_offset(_environment, offset->realName, sequence->realName, "", image->frameSize, image->frameCount );
221 } else {
222 ted_calculate_sequence_frame_offset(_environment, offset->realName, sequence->realName, frame->realName, image->frameSize, image->frameCount );
223 }
224 }
225
226 Variable * address = variable_temporary( _environment, VT_ADDRESS, "(temporary)");
227 variable_store( _environment, address->name, image->absoluteAddress );
228 variable_add_inplace_vars( _environment, address->name, offset->name );
229 bank_read_vars_direct( _environment, bank->name, address->name, bankWindowName, frameSize->name );
230
231 Resource resource;
232 resource.realName = strdup( bankWindowName );
233 resource.isAddress = 0;
234
235 ted_put_image( _environment, &resource, x1->realName, y1->realName, NULL, NULL, image->frameSize, 0, _flags );
236
237 } else {
238 if ( !sequence ) {
239 if ( !frame ) {
240 ted_put_image( _environment, resource, x1->realName, y1->realName, "", "", image->frameSize, image->frameCount, _flags );
241 } else {
242 ted_put_image( _environment, resource, x1->realName, y1->realName, frame->realName, "", image->frameSize, image->frameCount, _flags );
243 }
244 } else {
245 if ( !frame ) {
246 ted_put_image( _environment, resource, x1->realName, y1->realName, "", sequence->realName, image->frameSize, image->frameCount, _flags );
247 } else {
248 ted_put_image( _environment, resource, x1->realName, y1->realName, frame->realName, sequence->realName, image->frameSize, image->frameCount, _flags );
249 }
250 }
251 }
252 break;
253 case VT_IMAGES:
254 if ( image->bankAssigned != -1 ) {
255
256 char alreadyLoadedLabel[MAX_TEMPORARY_STORAGE];
257 sprintf(alreadyLoadedLabel, "%salready", label );
258
259 char bankWindowId[MAX_TEMPORARY_STORAGE];
260 sprintf( bankWindowId, "BANKWINDOWID%2.2x", image->residentAssigned );
261
262 char bankWindowName[MAX_TEMPORARY_STORAGE];
263 sprintf( bankWindowName, "BANKWINDOW%2.2x", image->residentAssigned );
264
265 // cpu_compare_and_branch_16bit_const( _environment, bankWindowId, image->variableUniqueId, alreadyLoadedLabel, 1 );
266 // if ( image->uncompressedSize ) {
267 // bank_uncompress_semi_var( _environment, image->bankAssigned, image->absoluteAddress, bankWindowName );
268 // } else {
269 // bank_read_semi_var( _environment, image->bankAssigned, image->absoluteAddress, bankWindowName, image->size );
270 // }
271 // cpu_store_16bit(_environment, bankWindowId, image->variableUniqueId );
272 // cpu_label( _environment, alreadyLoadedLabel );
273
274 Variable * frameSize = variable_temporary( _environment, VT_WORD, "(temporary)");
275 variable_store( _environment, frameSize->name, image->frameSize );
276 Variable * bank = variable_temporary( _environment, VT_BYTE, "(temporary)");
277 variable_store( _environment, bank->name, image->bankAssigned );
278 Variable * offset = variable_temporary( _environment, VT_ADDRESS, "(temporary)");
279
280 if ( sequence ) {
281 if ( image->strips ) {
282 realFrame = variable_temporary( _environment, VT_BYTE, "(real frame)" );
283 outline1("LDA %s", sequence->realName);
284 outline0("ASL");
285 outline0("TAY");
286 outline1("LDA #<%sstrip", image->realName);
287 outline0("STA TMPPTR");
288 outline1("LDA #>%sstrip", image->realName);
289 outline0("STA TMPPTR+1");
290 outline0("LDA (TMPPTR),Y" );
291 outline0("STA TMPPTR2");
292 outline0("INY" );
293 outline0("LDA (TMPPTR),Y" );
294 outline0("STA TMPPTR2+1");
295 outline1("LDA %s", frame->realName );
296 outline0("TAY" );
297 outline0("LDA (TMPPTR2),Y" );
298 outline1("STA %s", realFrame->realName );
299 } else {
301 }
302 }
303
304 if ( !frame ) {
305 ted_calculate_sequence_frame_offset(_environment, offset->realName, NULL, "", image->frameSize, 0 );
306 } else {
307 ted_calculate_sequence_frame_offset(_environment, offset->realName, NULL, realFrame->realName, image->frameSize, 0 );
308 }
309
310 Variable * address = variable_temporary( _environment, VT_ADDRESS, "(temporary)");
311 variable_store( _environment, address->name, image->absoluteAddress );
312 variable_add_inplace_vars( _environment, address->name, offset->name );
313 bank_read_vars_direct( _environment, bank->name, address->name, bankWindowName, frameSize->name );
314
315 Resource resource;
316 resource.realName = strdup( bankWindowName );
317 resource.isAddress = 0;
318
319 ted_put_image( _environment, &resource, x1->realName, y1->realName, NULL, NULL, image->frameSize, 0, _flags );
320
321 } else {
322 if ( sequence ) {
323 if ( image->strips ) {
324 realFrame = variable_temporary( _environment, VT_BYTE, "(real frame)" );
325 outline1("LDA %s", sequence->realName);
326 outline0("ASL");
327 outline0("TAY");
328 outline1("LDA #<%sstrip", image->realName);
329 outline0("STA TMPPTR");
330 outline1("LDA #>%sstrip", image->realName);
331 outline0("STA TMPPTR+1");
332 outline0("LDA (TMPPTR),Y" );
333 outline0("STA TMPPTR2");
334 outline0("INY" );
335 outline0("LDA (TMPPTR),Y" );
336 outline0("STA TMPPTR2+1");
337 outline1("LDA %s", frame->realName );
338 outline0("TAY" );
339 outline0("LDA (TMPPTR2),Y" );
340 outline1("STA %s", realFrame->realName );
341 } else {
343 }
344 }
345
346 if ( !frame ) {
347 ted_put_image( _environment, resource, x1->realName, y1->realName, "", NULL, image->frameSize, 0, _flags );
348 } else {
349 ted_put_image( _environment, resource, x1->realName, y1->realName, realFrame->realName, NULL, image->frameSize, 0, _flags );
350 }
351 }
352 break;
353 case VT_IMAGE:
354 case VT_TARRAY:
355 if ( image->residentAssigned ) {
356
357 char alreadyLoadedLabel[MAX_TEMPORARY_STORAGE];
358 sprintf(alreadyLoadedLabel, "%salready", label );
359
360 char bankWindowId[MAX_TEMPORARY_STORAGE];
361 sprintf( bankWindowId, "BANKWINDOWID%2.2x", image->residentAssigned );
362
363 char bankWindowName[MAX_TEMPORARY_STORAGE];
364 sprintf( bankWindowName, "BANKWINDOW%2.2x", image->residentAssigned );
365
366 cpu_compare_and_branch_16bit_const( _environment, bankWindowId, image->variableUniqueId, alreadyLoadedLabel, 1 );
367 if ( image->uncompressedSize ) {
368 bank_uncompress_semi_var( _environment, image->bankAssigned, image->absoluteAddress, bankWindowName );
369 } else {
370 bank_read_semi_var( _environment, image->bankAssigned, image->absoluteAddress, bankWindowName, image->size );
371 }
372 cpu_store_16bit(_environment, bankWindowId, image->variableUniqueId );
373 cpu_label( _environment, alreadyLoadedLabel );
374
375 Resource resource;
376 resource.realName = strdup( bankWindowName );
377 resource.isAddress = 0;
378
379 ted_put_image( _environment, &resource, x1->realName, y1->realName, NULL, NULL, 1, 0, _flags );
380 } else {
381 ted_put_image( _environment, resource, x1->realName, y1->realName, NULL, NULL, 1, 0, _flags );
382 }
383 break;
384 default:
386 }
387
388
389}
390
391void put_image_vars_imageref( Environment * _environment, char * _image, char * _x1, char * _y1, char * _x2, char * _y2, char * _frame, char * _sequence, char * _flags ) {
392
394
395 Variable * image = variable_retrieve( _environment, _image );
396
397 Variable * x1 = variable_retrieve_or_define( _environment, _x1, VT_POSITION, 0 );
398 Variable * y1 = variable_retrieve_or_define( _environment, _y1, VT_POSITION, 0 );
399 Variable * frame = NULL;
400 if ( _frame) {
401 frame = variable_retrieve_or_define( _environment, _frame, VT_BYTE, 0 );
402 }
403 Variable * sequence = NULL;
404 if ( _sequence) {
405 sequence = variable_retrieve_or_define( _environment, _sequence, VT_BYTE, 0 );
406 }
407
408 Variable * address = variable_temporary( _environment, VT_ADDRESS, "(stub)" );
409
410 if ( !_environment->putImageRefUnsafe ) {
411 outline1("LDA %s", address_displacement( _environment, image->realName, "5") );
412 outline1("BNE %sskipx", label );
413 outline1("JMP %sskip", label );
414 outhead1("%sskipx:", label );
415 }
416
417 // Y = OFFSET
418
419 if ( _sequence ) {
420
421 outline1("LDA %s", image->realName );
422 outline0("STA TMPPTR" );
423 outline1("LDA %s", address_displacement( _environment, image->realName, "1") );
424 outline0("STA TMPPTR+1" );
425
426 outline0("CLC" );
427 outline0("LDA TMPPTR" );
428 outline0("ADC #3" );
429 outline0("STA TMPPTR" );
430 outline0("LDA TMPPTR+1" );
431 outline0("ADC #0" );
432 outline0("STA TMPPTR+1" );
433
434 if ( strlen(_sequence) == 0 ) {
435
436 } else {
437 outline1("LDA %s", sequence->realName );
438 outline0("STA MATHPTR0" );
439 cpu_call_indirect( _environment, address_displacement( _environment, image->realName, "10") );
440 }
441 if ( _frame ) {
442 if ( strlen(_frame) == 0 ) {
443
444 } else {
445 outline1("LDA %s", frame->realName );
446 outline0("STA MATHPTR0" );
447 cpu_call_indirect( _environment, address_displacement( _environment, image->realName, "8") );
448 }
449 }
450
451 outline0("LDA TMPPTR" );
452 outline1("STA %s", address->realName );
453 outline0("LDA TMPPTR+1" );
454 outline1("STA %s", address_displacement(_environment, address->realName, "1") );
455
456 } else {
457
458 if ( _frame ) {
459
460 outline1("LDA %s", image->realName );
461 outline0("STA TMPPTR" );
462 outline1("LDA %s", address_displacement( _environment, image->realName, "1") );
463 outline0("STA TMPPTR+1" );
464
465 outline0("CLC" );
466 outline0("LDA TMPPTR" );
467 outline0("ADC #3" );
468 outline0("STA TMPPTR" );
469 outline0("LDA TMPPTR+1" );
470 outline0("ADC #0" );
471 outline0("STA TMPPTR+1" );
472 if ( strlen(_frame) == 0 ) {
473
474 } else {
475 outline1("LDA %s", frame->realName );
476 outline0("STA MATHPTR0" );
477 cpu_call_indirect( _environment, address_displacement( _environment, image->realName, "8") );
478 }
479
480 outline0("LDA TMPPTR" );
481 outline1("STA %s", address->realName );
482 outline0("LDA TMPPTR+1" );
483 outline1("STA %s", address_displacement(_environment, address->realName, "1") );
484
485 } else {
486
487 outline1("LDA %s", image->realName );
488 outline1("STA %s", address->realName );
489 outline1("LDA %s", address_displacement( _environment, image->realName, "1") );
490 outline0("STA TMPPTR+1" );
491 outline1("STA %s", address_displacement(_environment, address->realName, "1") );
492
493 }
494
495 }
496
497 Resource resource;
498 resource.realName = strdup( address->realName );
499 resource.isAddress = 1;
500
501 ted_put_image( _environment, &resource, x1->realName, y1->realName, NULL, NULL, 0, 0, _flags );
502
503 if ( !_environment->putImageRefUnsafe ) {
504 outhead1("%sskip:", label );
505 }
506
507}
508
509void put_image_vars( Environment * _environment, char * _image, char * _x1, char * _y1, char * _x2, char * _y2, char * _frame, char * _sequence, char * _flags ) {
510
511 if ( _environment->emptyProcedure ) {
512 return;
513 }
514
515 Variable * image = variable_retrieve( _environment, _image );
516
517 switch( image->type ) {
518 case VT_IMAGE:
519 case VT_IMAGES:
520 case VT_SEQUENCE:
521 case VT_ADDRESS:
522 put_image_vars_original( _environment, _image, _x1, _y1, _x2, _y2, _frame, _sequence, _flags );
523 break;
524 case VT_IMAGEREF:
525 put_image_vars_imageref( _environment, _image, _x1, _y1, _x2, _y2, _frame, _sequence, _flags );
526 break;
527 default:
529 }
530
531}
532
533void put_image_vars_flags( Environment * _environment, char * _image, char * _x1, char * _y1, char * _x2, char * _y2, char * _frame, char * _sequence, int _flags ) {
534
535 char flagsConstantName[MAX_TEMPORARY_STORAGE]; sprintf( flagsConstantName, "PUTIMAGEFLAGS%4.4x", _flags );
536 char flagsConstantParameter[MAX_TEMPORARY_STORAGE]; sprintf( flagsConstantParameter, "#PUTIMAGEFLAGS%4.4x", _flags );
537
538 Constant * flagsConstant = constant_find( _environment, flagsConstantName );
539
540 if ( !flagsConstant ) {
541 flagsConstant = malloc( sizeof( Constant ) );
542 memset( flagsConstant, 0, sizeof( Constant ) );
543 flagsConstant->name = strdup( flagsConstantName );
544 flagsConstant->realName = strdup( flagsConstantName );
545 flagsConstant->value = _flags;
546 flagsConstant->type = CT_INTEGER;
547 flagsConstant->next = _environment->constants;
548 _environment->constants = flagsConstant;
549 }
550
551 put_image_vars( _environment, _image, _x1, _y1, _x2, _y2, _frame, _sequence, flagsConstantParameter );
552}
void cpu_store_16bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 16 bit
Definition 6309.c:1503
void cpu_compare_and_branch_16bit_const(Environment *_environment, char *_source, int _destination, char *_label, int _positive)
CPU 6309: emit code to compare two 8 bit values and jump if they are equal/different
Definition 6309.c:1578
void cpu_label(Environment *_environment, char *_label)
Definition 6309.c:356
void cpu_call_indirect(Environment *_environment, char *_value)
Definition 6309.c:3765
Variable * variable_retrieve(Environment *_environment, char *_name)
Variable * variable_retrieve_or_define(Environment *_environment, char *_name, VariableType _type, int _value)
Resource * build_resource_for_sequence(Environment *_environment, char *_image, char *_frame, char *_sequence)
void variable_add_inplace_vars(Environment *_environment, char *_source, char *_destination)
Add two variable and return the sum of them on the first.
Variable * variable_temporary(Environment *_environment, VariableType _type, char *_meaning)
Define a temporary variable.
Variable * variable_store(Environment *_environment, char *_destination, unsigned int _value)
Store a direct value to a variable.
char * address_displacement(Environment *_environment, char *_address, char *_displacement)
Constant * constant_find(Environment *_environment, char *_name)
int offset
Definition _optimizer.c:681
void put_image_vars_original(Environment *_environment, char *_image, char *_x1, char *_y1, char *_x2, char *_y2, char *_frame, char *_sequence, char *_flags)
Emit ASM code for PUT IMAGE [image] AT [int],[int].
Definition put_image.c:53
void put_image_vars_imageref(Environment *_environment, char *_image, char *_x1, char *_y1, char *_x2, char *_y2, char *_frame, char *_sequence, char *_flags)
Definition put_image.c:289
void put_image_vars_flags(Environment *_environment, char *_image, char *_x1, char *_y1, char *_x2, char *_y2, char *_frame, char *_sequence, int _flags)
Definition put_image.c:430
void put_image_vars(Environment *_environment, char *_image, char *_x1, char *_y1, char *_x2, char *_y2, char *_frame, char *_sequence, char *_flags)
Definition put_image.c:406
void bank_read_semi_var(Environment *_environment, int _bank, int _address1, char *_address2, int _size)
Emit ASM code for instruction BANK READ ....
Definition bank_read.c:50
void bank_read_vars_direct(Environment *_environment, char *_bank, char *_address1, char *_address2, char *_size)
Definition bank_read.c:138
void bank_uncompress_semi_var(Environment *_environment, int _bank, int _address1, char *_address2)
Emit ASM code for instruction BANK UNCOMPRESS ....
char * name
Definition ugbc.h:800
int value
Definition ugbc.h:815
ConstantType type
Definition ugbc.h:805
struct _Constant * next
Definition ugbc.h:832
char * realName
Definition ugbc.h:803
int putImageRefUnsafe
Definition ugbc.h:3271
Constant * constants
Definition ugbc.h:2611
int emptyProcedure
Definition ugbc.h:2932
int isAddress
Definition ugbc.h:557
VariableType type
Definition ugbc.h:559
char * realName
Definition ugbc.h:555
char * name
Definition ugbc.h:979
VariableType type
Definition ugbc.h:988
char * realName
Definition ugbc.h:982
void ted_calculate_sequence_frame_offset(Environment *_environment, char *_offset, char *_sequence, char *_frame, int _frame_size, int _frame_count)
Definition ted.c:1721
void ted_put_image(Environment *_environment, Resource *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_flags)
Definition ted.c:1996
void * malloc(YYSIZE_T)
struct _Resource Resource
#define MAX_TEMPORARY_STORAGE
Definition ugbc.h:563
@ CT_INTEGER
Definition ugbc.h:788
struct _Variable Variable
Structure of a single variable.
struct _Environment Environment
Structure of compilation environment.
@ VT_TARRAY
Definition ugbc.h:480
@ VT_WORD
Definition ugbc.h:455
@ VT_POSITION
Definition ugbc.h:468
@ VT_BYTE
Definition ugbc.h:450
@ VT_IMAGEREF
Definition ugbc.h:537
@ VT_IMAGES
Definition ugbc.h:495
@ VT_ADDRESS
Definition ugbc.h:465
@ VT_IMAGE
Definition ugbc.h:489
@ VT_SEQUENCE
Definition ugbc.h:513
struct _Constant Constant
Structure of a single constant.
#define CRITICAL_CANNOT_PUT_IMAGE_WITHOUT_STRIP(s)
Definition ugbc.h:3855
#define outline0(s)
Definition ugbc.h:4252
#define CRITICAL_PUT_IMAGE_UNSUPPORTED(v, t)
Definition ugbc.h:3532
#define outline1(s, a)
Definition ugbc.h:4253
#define MAKE_LABEL
Definition ugbc.h:3351
#define outhead1(s, a)
Definition ugbc.h:4247
char DATATYPE_AS_STRING[][16]