ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
put_tilemap.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
51/* <usermanual>
52@keyword PUT TILEMAP
53
54@english
55
56The command ''PUT TILEMAP'' can be used to draw a map on the screen. Note how the same map draws the
57same way on different screens. The map is however within the available screen size. If the
58map is bigger than the screen, the comamnd only draws a part of the map. To scroll the map you
59can use the ''FROM'' parameter with the offsets (in terms of tiles) starting from which the map will
60have to be drawn on the screen.
61
62@italian
63
64@syntax PUT TILEMAP resource [ LAYER layer ] [ FROM x, y ]
65
66@example PUT TILEMAP map
67
68@target all
69</usermanual> */
70
71void put_tilemap_vars( Environment * _environment, char * _tilemap, int _flags, char * _dx, char * _dy, char * _layer, char * _pad_frame ) {
72
73 if ( _environment->emptyProcedure ) {
74 return;
75 }
76
77 deploy_begin( put_tilemap );
78
80
81 // Labels
82 char labelForLayers[MAX_TEMPORARY_STORAGE]; sprintf( labelForLayers, "%slayersf", label );
83 char labelNextLayers[MAX_TEMPORARY_STORAGE]; sprintf( labelNextLayers, "%slayersn", label );
84 char labelLoopY[MAX_TEMPORARY_STORAGE]; sprintf( labelLoopY, "%sy", label );
85 char labelLoopX[MAX_TEMPORARY_STORAGE]; sprintf( labelLoopX, "%sx", label );
86 char labelExit[MAX_TEMPORARY_STORAGE]; sprintf( labelExit, "%se", label );
87 char labelExitX[MAX_TEMPORARY_STORAGE]; sprintf( labelExitX, "%sex", label );
88 char labelExitX2[MAX_TEMPORARY_STORAGE]; sprintf( labelExitX2, "%sexx", label );
89 char labelPadding[MAX_TEMPORARY_STORAGE]; sprintf( labelPadding, "%spad", label );
90 char labelPadding2[MAX_TEMPORARY_STORAGE]; sprintf( labelPadding2, "%spady", label );
91 char labelDonePutImage[MAX_TEMPORARY_STORAGE]; sprintf( labelDonePutImage, "%sdop", label );
92 char labelExitFrame[MAX_TEMPORARY_STORAGE]; sprintf( labelExitFrame, "%sfr", label );
93 char labelSkipFxCheck[MAX_TEMPORARY_STORAGE]; sprintf( labelSkipFxCheck, "%sskipx", label );
94 char labelSkipIndexCheck[MAX_TEMPORARY_STORAGE]; sprintf( labelSkipIndexCheck, "%sskipy", label );
95
96 // Local constants
97 Variable * transparency = variable_temporary( _environment, VT_WORD, "(flags)" );
98 variable_store( _environment, transparency->name, FLAG_TRANSPARENCY );
99
100 // Parameters
101 Variable * tilemapAddress = variable_define( _environment, "puttilemap__tilemap", VT_ADDRESS, 0 );
102 Variable * tileset = variable_define( _environment, "puttilemap__tileset", VT_IMAGEREF, 0 );
103 Variable * dx = variable_define( _environment, "puttilemap__dx", VT_BYTE, 0 );
104 Variable * dy = variable_define( _environment, "puttilemap__dy", VT_BYTE, 0 );
105 Variable * layer = variable_define( _environment, "puttilemap__layer", VT_BYTE, 0 );
106 Variable * flags = variable_define( _environment, "puttilemap__flags", VT_WORD, 0 );
107 Variable * size = variable_define( _environment, "puttilemap__size", VT_WORD, 0 );
108 Variable * deltaFrameRow = variable_define( _environment, "puttilemap__deltaFrameRow", VT_WORD, 0 );
109 Variable * deltaFrameScreen = variable_define( _environment, "puttilemap__deltaFrameScreen", VT_WORD, 0 );
110 Variable * mapWidth = variable_define( _environment, "puttilemap__mapWidth", VT_BYTE, 0 );
111 Variable * frameWidth = variable_define( _environment, "puttilemap__frameWidth", VT_BYTE, 0 );
112 Variable * frameHeight = variable_define( _environment, "puttilemap__frameHeight", VT_BYTE, 0 );
113 Variable * padFrame = variable_define( _environment, "puttilemap__padFrame", VT_BYTE, 0 );
114 Variable * mapLayers = variable_define( _environment, "puttilemap__mapLayers", VT_BYTE, 0 );
115
116 // Local variables
117 Variable * index = variable_temporary( _environment, VT_WORD, "(index)" );
118 Variable * y = variable_temporary( _environment, VT_POSITION, "(y)" );
119 Variable * x = variable_temporary( _environment, VT_POSITION, "(x)" );
120 Variable * fx = variable_temporary( _environment, VT_BYTE, "(fx)" );
121 Variable * frame = variable_temporary( _environment, VT_BYTE, "(frame)" );
122 Variable * padding = variable_temporary( _environment, VT_BYTE, "(padding)" );
123 Variable * padding2 = variable_temporary( _environment, VT_BYTE, "(padding2)" );
124 Variable * layerIndex = variable_temporary( _environment, VT_BYTE, "(layerIndex)" );
125
126 // Starting index from 0 (zero).
127 variable_store( _environment, index->name, 0 );
128
129 // Starting layer from 0 (zero).
130 variable_store( _environment, layerIndex->name, 0 );
131
132 // If a starting point has been given, we must increase the
133 // index to match the first tile to draw.
134 variable_move( _environment, variable_add( _environment, index->name, variable_mul( _environment, dy->name, mapWidth->name )->name )->name, index->name );
135 variable_move( _environment, variable_add( _environment, index->name, dx->name )->name, index->name );
136
137 // If a layer has been given, we must increate the index to match
138 // the first tile of the layer to draw.
139 variable_move( _environment, variable_add( _environment, index->name, variable_mul( _environment, layer->name, size->name )->name )->name, index->name );
140
141 // *** Add index to the tile address
142 cpu_math_add_16bit( _environment, tilemapAddress->realName, index->realName, tilemapAddress->realName );
143
144 // Restore index to zero.
145 variable_store( _environment, index->name, 0 );
146
147 // For each layer (actually, a normal map has just one layer).
148 // for( int layerIndex = 0; layerIndex < tilemap->mapLayers; ++layerIndex ) {
149 cpu_label( _environment, labelForLayers );
150
151 // If a specific layer is selected, we must point to that layer.
152 // Let's start from the start of the screen.
153
154 variable_store( _environment, y->name, 0 );
155
156 // Disable vertical padding.
157
158 variable_store( _environment, padding2->name, 0 );
159
160 // --------------------------------------------------------------------------
161 // Y loop
162 // --------------------------------------------------------------------------
163
164 cpu_label( _environment, labelLoopY );
165
166 // Let's start from the left from the screen.
167
168 variable_store( _environment, x->name, 0 );
169
170 // Set the count of frames drawed on the horizontal
171 // line to zero (0).
172
173 // variable_store( _environment, fx->name, 0 );
174
175 // If a delta position is given, the count of horizontal frames
176 // drawed must be increased by delta position.
177
178 variable_move( _environment, dx->name, fx->name );
179
180 // Disable horizontal padding.
181
182 variable_store( _environment, padding->name, 0 );
183
184 // --------------------------------------------------------------------------
185 // Begin X loop
186 // --------------------------------------------------------------------------
187
188 cpu_label( _environment, labelLoopX );
189
190 // If the horizontal padding is enabled, we must skip to draw the padding tile.
191
192 cpu_compare_and_branch_8bit_const( _environment, padding->realName, 1, labelPadding, 1 );
193
194 // If the vertical padding is enabled, we must skip to draw the padding tile.
195
196 cpu_compare_and_branch_8bit_const( _environment, padding2->realName, 1, labelPadding, 1 );
197
198 // Take the tile from the map and increase the index.
199
200 cpu_peek( _environment, tilemapAddress->realName, frame->realName );
201 cpu_inc_16bit( _environment, tilemapAddress->realName );
202 cpu_inc_16bit( _environment, index->realName );
203
204 // In case the frame read from the map is 0xff, it means that that specific
205 // frame has not to be drawn, so we exit from this frame drawing.
206
207 cpu_compare_and_branch_8bit_const( _environment, frame->realName, 0xff, labelExitFrame, 1 );
208
209 // --- DRAW TILE --
210
211 outline1("; put_image_vars, image = %s...", tileset->name );
212 put_image_vars( _environment, tileset->name, x->name, y->name, NULL, NULL, frame->name, NULL, flags->realName );
213 cpu_jump( _environment, labelDonePutImage );
214
215 // --- DRAW PADDING TILE --
216
217 cpu_label( _environment, labelPadding );
218 cpu_compare_and_branch_8bit_const( _environment, padFrame->realName, 0x00, labelDonePutImage, 1 );
219
220 outline1("; put_image_vars, image = %s...", tileset->name );
221 put_image_vars( _environment, tileset->name, x->name, y->name, NULL, NULL, padFrame->name, NULL, flags->realName );
222
223 // From here and ahead, we drawed the tile so we must calculate the
224 // next conditions and actions to do. We arrive here both if we drawed
225 // a TILE, a PADDING TILE or if we skipped the drawing.
226
227 cpu_label( _environment, labelDonePutImage ); cpu_label( _environment, labelExitFrame );
228
229 // Increase the horizontal frames drawed count.
230
231 cpu_inc( _environment, fx->realName );
232
233 // Increase the next X position to draw to.
234
235 variable_add_inplace_vars( _environment, x->name, frameWidth->name );
236
237 // If the horizontal padding is enabled, we must move to the skip fx check,
238 // since the horizontal padding is enabled by reaching the horizontal limit.
239
240 cpu_compare_and_branch_8bit_const( _environment, padding->realName, 1, labelSkipFxCheck, 1 );
241
242 // We must check if the horizontal limit is reached. In this case, we must
243 // enable horizontal padding by moving to the specific routine.
244
245 Variable * check = variable_less_than( _environment, fx->name, mapWidth->name, 0 );
246 cpu_compare_and_branch_8bit_const( _environment, check->realName, 0x0, labelExitX, 1 );
247
248 // Both if the horizontal limit has been reached or not, we must check if the
249 // screen limit has been reached. If the screen limit has not been reached,
250 // we must repeat the X loop. Otherwise, we exit from the X loop.
251
252 cpu_label( _environment, labelSkipFxCheck );
253 check = variable_less_than_const( _environment, x->name, ( _environment->screenWidth), 0 );
254 cpu_compare_and_branch_8bit_const( _environment, check->realName, 0xff, labelLoopX, 1 );
255 cpu_jump( _environment, labelExitX2 );
256
257 // --- ENABLE HORIZONTAL PADDING ---
258 cpu_label( _environment, labelExitX );
259 variable_store( _environment, padding->name, 1 );
260 cpu_jump( _environment, labelSkipFxCheck );
261
262 // --------------------------------------------------------------------------
263 // End X loop
264 // --------------------------------------------------------------------------
265
266 cpu_label( _environment, labelExitX2 );
267
268 // Disable horizontal padding.
269
270 variable_store( _environment, padding->name, 0 );
271
272 // If the screen is narrower than the map, we must move ahead the
273 // index by the calculated delta frame row.
274
275 // if ( deltaFrameRow > 0 ) {
276 variable_add_inplace_vars( _environment, tilemapAddress->name, deltaFrameRow->name );
277 variable_add_inplace_vars( _environment, index->name, deltaFrameRow->name );
278 // }
279
280 // Move to the next row to draw.
281
282 variable_add_inplace_vars( _environment, y->name, frameHeight->name );
283
284 // If we reach the limit of ther map size, we enable the vertical padding.
285
286 check = variable_less_than( _environment, index->name, size->name, 0 );
287 cpu_compare_and_branch_8bit_const( _environment, check->realName, 0x00, labelPadding2, 1 );
288
289 // Both if the vertical padding is enabled or not, we must check if the
290 // screen vertical limit has been reached. If not, we repeat the Y loop.
291
292 cpu_label( _environment, labelSkipIndexCheck );
293 check = variable_less_than_const( _environment, y->name, (_environment->screenHeight ), 0 );
294 cpu_compare_and_branch_8bit_const( _environment, check->realName, 0xff, labelLoopY, 1 );
295 cpu_jump( _environment, labelExit );
296
297 // --- ENABLE VERTICAL PADDING ---
298 cpu_label( _environment, labelPadding2 );
299 variable_store( _environment, padding2->name, 1 );
300 cpu_jump( _environment, labelSkipIndexCheck );
301
302 // --------------------------------------------------------------------------
303 // End Y loop
304 // --------------------------------------------------------------------------
305
306 cpu_label( _environment, labelExit );
307
308 cpu_inc( _environment, layerIndex->realName );
309 cpu_compare_and_branch_8bit( _environment, layerIndex->realName, mapLayers->realName, labelNextLayers, 1 );
310
311 // if ( deltaFrameScreen ) {
312 variable_add_inplace_vars( _environment, tilemapAddress->name, deltaFrameScreen->name );
313 variable_store( _environment, index->name, 0 );
314 // }
315
316 // _flags = _flags | FLAG_TRANSPARENCY;
317 variable_move( _environment,
318 variable_or( _environment, flags->name, transparency->name )->name,
319 flags->name
320 );
321
322 cpu_jump( _environment, labelForLayers );
323 // }
324
325 cpu_label( _environment, labelNextLayers );
326
327 cpu_return( _environment );
328
329 deploy_end( put_tilemap );
330
331 Variable * ptilemap = variable_retrieve( _environment, _tilemap );
332 if ( ptilemap->type != VT_TILEMAP ) {
334 }
335
336 Variable * vtilemap = variable_retrieve( _environment, "puttilemap__tilemap" );
337 if ( ptilemap->onStorage ) {
338 cpu_addressof_16bit( _environment, ptilemap->realName, vtilemap->realName );
339 cpu_math_add_16bit_const( _environment, vtilemap->realName, 15, vtilemap->realName );
340 } else {
341 cpu_addressof_16bit( _environment, ptilemap->realName, vtilemap->realName );
342 }
343
344 Variable * vtileset = variable_retrieve( _environment, "puttilemap__tileset" );
345 if ( ptilemap->tileset ) {
346 variable_move( _environment, image_ref( _environment, ptilemap->tileset->name )->name, vtileset->name );
347 } else {
349 }
350
351 Variable * vdx = variable_retrieve( _environment, "puttilemap__dx" );
352 if ( _dx ) {
353 Variable * pdx = variable_retrieve( _environment, _dx );
354 variable_move( _environment, pdx->name, vdx->name );
355 } else {
356 variable_store( _environment, vdx->name, 0 );
357 }
358
359 Variable * vdy = variable_retrieve( _environment, "puttilemap__dy" );
360 if ( _dy ) {
361 Variable * pdy = variable_retrieve( _environment, _dy );
362 variable_move( _environment, pdy->name, vdy->name );
363 } else {
364 variable_store( _environment, vdy->name, 0 );
365 }
366
367 Variable * vlayer = variable_retrieve( _environment, "puttilemap__layer" );
368 if ( _layer ) {
369 Variable * player = variable_retrieve( _environment, _layer );
370 variable_move( _environment, player->name, vlayer->name );
371 } else {
372 variable_store( _environment, vlayer->name, 0 );
373 }
374
375 Variable * vflags = variable_retrieve( _environment, "puttilemap__flags" );
376 variable_store( _environment, vflags->name, _flags );
377
378 Variable * vpadFrame = variable_retrieve( _environment, "puttilemap__padFrame" );
379 if ( _pad_frame ) {
380 Variable * ppadFrame = variable_retrieve( _environment, _pad_frame );
381 variable_move( _environment, ppadFrame->name, vpadFrame->name );
382 } else {
383 variable_store( _environment, vpadFrame->name, 0 );
384 }
385
386 Variable * temporaryAddress = variable_temporary( _environment, VT_ADDRESS, "(temp)");
387
388 int sizeConst;
389 Variable * vsize = variable_retrieve( _environment, "puttilemap__size" );
390 if ( ptilemap->onStorage ) {
391 cpu_addressof_16bit( _environment, ptilemap->realName, temporaryAddress->realName );
392 cpu_math_add_16bit_const( _environment, temporaryAddress->realName, 5, temporaryAddress->realName );
393 cpu_peekw( _environment, temporaryAddress->realName, vsize->realName );
394 } else {
395 sizeConst = ptilemap->mapWidth * ptilemap->mapHeight;
396 variable_store( _environment, vsize->name, sizeConst );
397 }
398
399 int screenWidthAsTilesConst = 0;
400 int screenHeightAsTilesConst = 0;
401 int deltaFrameConst = 0;
402
403 Variable * vdeltaFrameRow = variable_retrieve( _environment, "puttilemap__deltaFrameRow" );
404 if ( ptilemap->onStorage ) {
405 cpu_addressof_16bit( _environment, ptilemap->realName, temporaryAddress->realName );
406 cpu_math_add_16bit_const( _environment, temporaryAddress->realName, 4, temporaryAddress->realName );
407 cpu_peek( _environment, temporaryAddress->realName, vdeltaFrameRow->realName );
408 } else {
409 screenWidthAsTilesConst = ( _environment->screenWidth / ptilemap->tileset->frameWidth );
410 screenHeightAsTilesConst = ( _environment->screenHeight / ptilemap->tileset->frameHeight );
411 // int deltaFrameRow = tilemap->mapWidth > screenWidthAsTiles ? ( tilemap->mapWidth - screenWidthAsTiles ) : 0;
412 deltaFrameConst = ptilemap->mapWidth > screenWidthAsTilesConst ? ( ptilemap->mapWidth - screenWidthAsTilesConst ) : 0;
413 variable_store( _environment, vdeltaFrameRow->name, deltaFrameConst );
414 }
415
416 Variable * vdeltaFrameScreen = variable_retrieve( _environment, "puttilemap__deltaFrameScreen" );
417 if ( ptilemap->onStorage ) {
418 cpu_addressof_16bit( _environment, ptilemap->realName, temporaryAddress->realName );
419 cpu_math_add_16bit_const( _environment, temporaryAddress->realName, 7, temporaryAddress->realName );
420 cpu_peekw( _environment, temporaryAddress->realName, vdeltaFrameScreen->realName );
421 } else {
422 int deltaFrameScreenConst = sizeConst - ( ptilemap->mapWidth * screenHeightAsTilesConst );
423 variable_store( _environment, vdeltaFrameScreen->name, deltaFrameScreenConst );
424 }
425
426 Variable * vmapWidth = variable_retrieve( _environment, "puttilemap__mapWidth" );
427 if ( ptilemap->onStorage ) {
428 cpu_addressof_16bit( _environment, ptilemap->realName, temporaryAddress->realName );
429 cpu_math_add_16bit_const( _environment, temporaryAddress->realName, 9, temporaryAddress->realName );
430 cpu_peek( _environment, temporaryAddress->realName, vmapWidth->realName );
431 } else {
432 variable_store( _environment, vmapWidth->name, ptilemap->mapWidth );
433 }
434
435 Variable * vframeWidth = variable_retrieve( _environment, "puttilemap__frameWidth" );
436 if ( ptilemap->onStorage ) {
437 cpu_addressof_16bit( _environment, ptilemap->realName, temporaryAddress->realName );
438 cpu_math_add_16bit_const( _environment, temporaryAddress->realName, 10, temporaryAddress->realName );
439 cpu_peek( _environment, temporaryAddress->realName, vframeWidth->realName );
440 } else {
441 variable_store( _environment, vframeWidth->name, ptilemap->tileset->frameWidth );
442 }
443
444 Variable * vframeHeight = variable_retrieve( _environment, "puttilemap__frameHeight" );
445 if ( ptilemap->onStorage ) {
446 cpu_addressof_16bit( _environment, ptilemap->realName, temporaryAddress->realName );
447 cpu_math_add_16bit_const( _environment, temporaryAddress->realName, 11, temporaryAddress->realName );
448 cpu_peek( _environment, temporaryAddress->realName, vframeHeight->realName );
449 } else {
450 variable_store( _environment, vframeHeight->name, ptilemap->tileset->frameHeight );
451 }
452
453 Variable * vmapLayers = variable_retrieve( _environment, "puttilemap__mapLayers" );
454 if ( ptilemap->onStorage ) {
455 cpu_addressof_16bit( _environment, ptilemap->realName, temporaryAddress->realName );
456 cpu_math_add_16bit_const( _environment, temporaryAddress->realName, 12, temporaryAddress->realName );
457 cpu_peek( _environment, temporaryAddress->realName, vmapLayers->realName );
458 } else {
459 variable_store( _environment, vmapLayers->name, ptilemap->mapLayers );
460 }
461
462 if ( _layer ) {
463 variable_store( _environment, vmapLayers->name, 1 );
464 } else {
465 // variable_store( _environment, vmapLayers->name, ptilemap->mapLayers );
466 }
467
468 cpu_call( _environment, "lib_put_tilemap" );
469
470}
471
void cpu_addressof_16bit(Environment *_environment, char *_source, char *_destination)
Definition 6309.c:1485
void cpu_inc(Environment *_environment, char *_variable)
Definition 6309.c:4555
void cpu_math_add_16bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to add two 16 bit values
Definition 6309.c:1661
void cpu_math_add_16bit_const(Environment *_environment, char *_source, int _destination, char *_other)
Definition 6309.c:1674
void cpu_label(Environment *_environment, char *_label)
Definition 6309.c:356
void cpu_call(Environment *_environment, char *_label)
Definition 6309.c:3755
void cpu_jump(Environment *_environment, char *_label)
Definition 6309.c:3739
void cpu_return(Environment *_environment)
Definition 6309.c:4030
void cpu_inc_16bit(Environment *_environment, char *_variable)
Definition 6309.c:4565
void cpu_compare_and_branch_8bit(Environment *_environment, char *_source, char *_destination, char *_label, int _positive)
Definition 6309.c:851
void cpu_peekw(Environment *_environment, char *_address, char *_target)
Definition 6309.c:399
void cpu_peek(Environment *_environment, char *_address, char *_target)
Definition 6309.c:366
void cpu_compare_and_branch_8bit_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:876
Variable * variable_add(Environment *_environment, char *_source, char *_destination)
Add two variable and return the sum of them.
Variable * variable_retrieve(Environment *_environment, char *_name)
Variable * variable_less_than_const(Environment *_environment, char *_source, int _destination, int _equal)
Variable * variable_less_than(Environment *_environment, char *_source, char *_destination, int _equal)
Compare two variable and return the result of comparation.
Variable * variable_move(Environment *_environment, char *_source, char *_destination)
Store the value of a variable inside another variable by converting it.
Variable * variable_define(Environment *_environment, char *_name, VariableType _type, int _value)
Define a variable for the program.
Variable * variable_mul(Environment *_environment, char *_source, char *_destination)
Make a multiplication between two variable and return the product of them.
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.
Variable * variable_or(Environment *_environment, char *_left, char *_right)
Calculate logical "or" and return it as the result.
int size
Definition _optimizer.c:678
int flags
Definition _optimizer.c:677
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
Variable * image_ref(Environment *_environment, char *_image)
Definition image_ref.c:43
void put_tilemap_vars(Environment *_environment, char *_tilemap, int _flags, char *_dx, char *_dy, char *_layer, char *_pad_frame)
Emit ASM code for PUT TILEMAP [tilemap].
Definition put_tilemap.c:71
int screenHeight
Definition ugbc.h:2860
int screenWidth
Definition ugbc.h:2855
int emptyProcedure
Definition ugbc.h:2932
struct _Variable * tileset
Definition ugbc.h:1186
char * name
Definition ugbc.h:979
int mapLayers
Definition ugbc.h:1160
int onStorage
Definition ugbc.h:1201
VariableType type
Definition ugbc.h:988
int mapHeight
Definition ugbc.h:1158
int frameWidth
Definition ugbc.h:1162
int frameHeight
Definition ugbc.h:1164
int mapWidth
Definition ugbc.h:1156
char * realName
Definition ugbc.h:982
#define CRITICAL_CANNOT_PUT_TILEMAP_FOR_NON_TILEMAP(v)
Definition ugbc.h:3642
#define deploy_end(s)
Definition ugbc.h:4365
#define MAX_TEMPORARY_STORAGE
Definition ugbc.h:563
#define FLAG_TRANSPARENCY
Definition ugbc.h:4567
struct _Variable Variable
Structure of a single variable.
struct _Environment Environment
Structure of compilation environment.
@ VT_WORD
Definition ugbc.h:455
@ VT_POSITION
Definition ugbc.h:468
@ VT_TILEMAP
Definition ugbc.h:525
@ VT_BYTE
Definition ugbc.h:450
@ VT_IMAGEREF
Definition ugbc.h:537
@ VT_ADDRESS
Definition ugbc.h:465
#define outline1(s, a)
Definition ugbc.h:4253
#define CRITICAL_CANNOT_PUT_TILEMAP_FOR_TILEMAP_ON_STORAGE(n)
Definition ugbc.h:3838
#define deploy_begin(s)
Definition ugbc.h:4356
#define MAKE_LABEL
Definition ugbc.h:3351
char DATATYPE_AS_STRING[][16]