ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
paint.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
48/* <usermanual>
49@keyword PAINT
50
51@english
52
53The ''PAINT'' command is used in high resolution graphics modes, to fill a
54shape with a specified colour.
55
56The ''x,y'' are the coordinates of the point where the painting is to start.
57''c'' is the colour code of the colours to be used to paint. It must be
58between ''0'' and ''COLOR COUNT'' and be one of the available colour set
59for the working mode. If omitted, the current foreground colour is used.
60
61The ''b'' parameter is the colour code of the border at which painting
62is to stop. It must also be between 0 and 8, the painting will continue
63over a border of any other colour. If omitted, the current foreground
64colour is used.
65
66There is also an alternative syntax for ''PAINT'', that is used to fill
67enclosed areas in the color of the specified color source '<fq>' (see ''HIRES''),
68starting from the starting point ''x'', ''y''. ''PAINT'' does nothing if the
69selected starting point already has the desired color.
70
71@italian
72
73Il comando ''PAINT'' viene utilizzato nelle modalità grafiche ad alta
74risoluzione, per riempire una forma con un colore specificato.
75
76Le ''x,y'' sono le coordinate del punto in cui deve iniziare il
77dipinto. ''c'' è il codice colore dei colori da utilizzare per
78dipingere. Deve essere compreso tra ''0'' e ''COLOR COUNT'' ed essere
79uno dei set di colori disponibili per la modalità di lavoro.
80Se omesso, viene utilizzato il colore corrente.
81
82Il parametro ''b'' è il codice colore del bordo in cui deve terminare
83il painting. Inoltre deve essere compreso tra ''0'' e ''COLOR COUNT'', il riempimento
84proseguirà su un bordo di qualsiasi altro colore. Se omesso,
85viene utilizzato il colore di primo piano corrente.
86
87Esiste anche una sintassi alternativa per ''PAINT'', che viene utilizzata per
88riempire le aree chiuse con il colore della sorgente di colore specificata
89''fq'' (vedi ''HIRES''), a partire dal punto iniziale ''x '', ''y''.
90''PAINT'' non fa nulla se il punto iniziale selezionato ha già il colore desiderato.
91
92@syntax PAINT (x,y)[, c[, b]]
93@syntax PAINT x, y, fq
94
95@example PAINT(100,100),RED
96@example PAINT 0,0,1
97
98</usermanual> */
99void paint_vars( Environment * _environment, char * _x, char * _y, char * _c, char * _b ) {
100
102
103 char beginPaintLabel[MAX_TEMPORARY_STORAGE]; sprintf( beginPaintLabel, "%sbegin", label );
104 char isValidLabel[MAX_TEMPORARY_STORAGE]; sprintf( isValidLabel, "%sisvalid", label );
105 char pushQueue[MAX_TEMPORARY_STORAGE]; sprintf( pushQueue, "%spush", label );
106 char pushQueueDone[MAX_TEMPORARY_STORAGE]; sprintf( pushQueueDone, "%spushd", label );
107 char popQueue[MAX_TEMPORARY_STORAGE]; sprintf( popQueue, "%spop", label );
108 char popQueueDone[MAX_TEMPORARY_STORAGE]; sprintf( popQueueDone, "%spopd", label );
109 char resultFalseLabel[MAX_TEMPORARY_STORAGE]; sprintf( resultFalseLabel, "%sresultfalse", label );
110 char resultTrueLabel[MAX_TEMPORARY_STORAGE]; sprintf( resultTrueLabel, "%sresulttrue", label );
111 char loopPaintLabel[MAX_TEMPORARY_STORAGE]; sprintf( loopPaintLabel, "%sloop", label );
112 char endPaintLabel[MAX_TEMPORARY_STORAGE]; sprintf( endPaintLabel, "%send", label );
113 char forceDequePaintLabel[MAX_TEMPORARY_STORAGE]; sprintf( forceDequePaintLabel, "%sdeque", label );
114 char skip1PaintLabel[MAX_TEMPORARY_STORAGE]; sprintf( skip1PaintLabel, "%sskip1", label );
115 char skip2PaintLabel[MAX_TEMPORARY_STORAGE]; sprintf( skip2PaintLabel, "%sskip2", label );
116 char skip3PaintLabel[MAX_TEMPORARY_STORAGE]; sprintf( skip3PaintLabel, "%sskip3", label );
117 char skip4PaintLabel[MAX_TEMPORARY_STORAGE]; sprintf( skip4PaintLabel, "%sskip4", label );
118
119 deploy_begin( paint )
120
121 cpu_jump( _environment, beginPaintLabel );
122
123 Variable * pointValue = variable_define( _environment, "point__v", VT_COLOR, 0 );
124 Variable * paintX = variable_define( _environment, "paint__x", VT_POSITION, 0 );
125 Variable * paintY = variable_define( _environment, "paint__y", VT_POSITION, 0 );
126 Variable * paintC = variable_define( _environment, "paint__c", VT_COLOR, 0 );
127 Variable * paintB = variable_define( _environment, "paint__b", VT_COLOR, 0 );
128
129 Variable * x = variable_temporary( _environment, VT_POSITION, "(x)" );
130 Variable * y = variable_temporary( _environment, VT_POSITION, "(y)" );
131 Variable * previousColor = variable_temporary( _environment, VT_COLOR, "(previousColor)" );
132 Variable * posX = variable_temporary( _environment, VT_POSITION, "(x)" );
133 Variable * posY = variable_temporary( _environment, VT_POSITION, "(y)" );
134
135 Variable * queue = variable_define( _environment, "PAINTQUEUE", VT_BUFFER, 0 );
136 variable_resize_buffer( _environment, queue->name, ( _environment->paintBucketSize == 0 ) ? DEFAULT_PAINT_BUCKET_SIZE : _environment->paintBucketSize );
137 Variable * queuePtrFront = variable_define( _environment, "PAINTQUEUEPTRFRONT", VT_ADDRESS, 0 );
138 Variable * queuePtrRear = variable_define( _environment, "PAINTQUEUEPTRREAR", VT_ADDRESS, 0 );
139 Variable * queuePtrEnd = variable_define( _environment, "PAINTQUEUEPTREND", VT_ADDRESS, 0 );
140
141 cpu_label( _environment, pushQueue );
142
143 cpu_move_16bit_indirect( _environment, x->realName, queuePtrRear->realName );
144 cpu_inc_16bit( _environment, queuePtrRear->realName );
145 cpu_inc_16bit( _environment, queuePtrRear->realName );
146 cpu_move_16bit_indirect( _environment, y->realName, queuePtrRear->realName );
147 cpu_inc_16bit( _environment, queuePtrRear->realName );
148 cpu_inc_16bit( _environment, queuePtrRear->realName );
149 cpu_compare_and_branch_16bit( _environment, queuePtrRear->realName, queuePtrEnd->realName, pushQueueDone, 0 );
150 cpu_addressof_16bit( _environment, queue->realName, queuePtrRear->realName );
151 cpu_label( _environment, pushQueueDone );
152 cpu_return( _environment );
153
154 cpu_label( _environment, popQueue );
155
156 cpu_move_16bit_indirect2( _environment, queuePtrFront->realName, posX->realName );
157 cpu_inc_16bit( _environment, queuePtrFront->realName );
158 cpu_inc_16bit( _environment, queuePtrFront->realName );
159 cpu_move_16bit_indirect2( _environment, queuePtrFront->realName, posY->realName );
160 cpu_inc_16bit( _environment, queuePtrFront->realName );
161 cpu_inc_16bit( _environment, queuePtrFront->realName );
162 cpu_compare_and_branch_16bit( _environment, queuePtrFront->realName, queuePtrEnd->realName, popQueueDone, 0 );
163 cpu_addressof_16bit( _environment, queue->realName, queuePtrFront->realName );
164 cpu_label( _environment, popQueueDone );
165 cpu_return( _environment );
166
167 cpu_label( _environment, isValidLabel );
168
169 Variable * isValid = variable_temporary( _environment, VT_SBYTE, "(isValid)" );
170
171 // // Function that returns true if
172 // // the given pixel is valid
173 // bool isValid(int screen[][8], int m, int n, int x, int y,
174 // int prevC, int newC)
175 // {
176 // if (x < 0
177
178 variable_move( _environment,
179 variable_less_than_const( _environment, x->name, 0, 0 )->name,
180 isValid->name );
181 variable_compare_and_branch_const( _environment, isValid->name, 0xff, resultFalseLabel, 1 );
182
183 // || x >= m
184
185 variable_move( _environment,
186 variable_greater_than( _environment,
187 x->name,
188 screen_get_width( _environment )->name,
189 1 )->name,
190 isValid->name );
191 variable_compare_and_branch_const( _environment, isValid->name, 0xff, resultFalseLabel, 1 );
192
193 // || y < 0
194
195 variable_move( _environment,
196 variable_less_than_const( _environment, y->name, 0, 0 )->name,
197 isValid->name );
198 variable_compare_and_branch_const( _environment, isValid->name, 0xff, resultFalseLabel, 1 );
199
200 // || y >= n
201
202 variable_move( _environment,
203 variable_greater_than( _environment,
204 y->name,
205 screen_get_height( _environment )->name,
206 1 )->name,
207 isValid->name );
208 variable_compare_and_branch_const( _environment, isValid->name, 0xff, resultFalseLabel, 1 );
209
210 // || screen[x][y] != prevC
211
212 variable_move( _environment, point( _environment, x->name, y->name )->name, pointValue->name );
213
214 variable_move( _environment,
215 variable_compare_not( _environment,
216 pointValue->name,
217 previousColor->name
218 )->name,
219 isValid->name );
220 variable_compare_and_branch_const( _environment, isValid->name, 0xff, resultFalseLabel, 1 );
221
222 // || screen[x][y] == newC
223
224 variable_move( _environment,
225 variable_compare( _environment,
226 pointValue->name,
227 paintC->name
228 )->name,
229 isValid->name );
230 variable_compare_and_branch_const( _environment, isValid->name, 0xff, resultFalseLabel, 1 );
231
232 // || (newB > 0 ? screen[x][y] == newB ) )
233
234 variable_compare_and_branch_const( _environment, paintB->name, 0x0, resultTrueLabel, 1 );
235
236 variable_move( _environment,
237 variable_compare( _environment,
238 pointValue->name,
239 paintB->name
240 )->name,
241 isValid->name );
242 variable_compare_and_branch_const( _environment, isValid->name, 0xff, resultFalseLabel, 1 );
243
244 // return false;
245
246 cpu_label( _environment, resultTrueLabel );
247 cpu_store_8bit( _environment, isValid->realName, 0xff );
248 cpu_return( _environment );
249
250 // return true;
251 // }
252
253 cpu_label( _environment, resultFalseLabel );
254
255 cpu_store_8bit( _environment, isValid->realName, 0 );
256 cpu_return( _environment );
257
259
260 cpu_label( _environment, beginPaintLabel );
261
262 variable_move( _environment, paintX->name, x->name );
263 variable_move( _environment, paintY->name, y->name );
264
265 variable_move( _environment,
266 point( _environment, x->name, y->name )->name,
267 previousColor->name);
268
269 cpu_addressof_16bit( _environment, queue->realName, queuePtrFront->realName );
270 cpu_addressof_16bit( _environment, queue->realName, queuePtrRear->realName );
271 cpu_addressof_16bit( _environment, queue->realName, queuePtrEnd->realName );
272 cpu_math_add_16bit_const( _environment, queuePtrEnd->realName, ( _environment->paintBucketSize == 0 ) ? DEFAULT_PAINT_BUCKET_SIZE : _environment->paintBucketSize, queuePtrEnd->realName );
273
274 // Append the position of starting
275 // pixel of the component
276 // cpu_move_16bit_indirect( _environment, x->realName, queuePtrRear->realName );
277 // cpu_inc_16bit( _environment, queuePtrRear->realName );
278 // cpu_inc_16bit( _environment, queuePtrRear->realName );
279 // cpu_move_16bit_indirect( _environment, y->realName, queuePtrRear->realName );
280 // cpu_inc_16bit( _environment, queuePtrRear->realName );
281 // cpu_inc_16bit( _environment, queuePtrRear->realName );
282 cpu_call( _environment, pushQueue );
283
284 // Color the pixel with the new color
285 plot( _environment, x->name, y->name, paintC->name, 0 );
286
287 // ------------------------------[ BEGIN FLOOD FILL LOOP ]
288 cpu_label( _environment, loopPaintLabel );
289
290 // cpu_label( _environment, forceDequePaintLabel );
291
292 // While the queue is not empty i.e. the
293 // whole component having prevC color
294 // is not colored with newC color
295 cpu_compare_and_branch_16bit( _environment, queuePtrFront->realName, queuePtrRear->realName, endPaintLabel, 1 );
296
297 // Dequeue the front node
298 // cpu_dec_16bit( _environment, queuePtr->realName );
299 // cpu_dec_16bit( _environment, queuePtr->realName );
300 // cpu_move_16bit_indirect2( _environment, queuePtr->realName, posY->realName );
301 // cpu_dec_16bit( _environment, queuePtr->realName );
302 // cpu_dec_16bit( _environment, queuePtr->realName );
303 // cpu_move_16bit_indirect2( _environment, queuePtr->realName, posX->realName );
304 cpu_call( _environment, popQueue );
305
306 // int posX = currPixel.first;
307 // int posY = currPixel.second;
308
309 // Check if the adjacent
310 // pixels are valid
311 // if (isValid(screen, m, n, posX + 1, posY, prevC, newC)) {
312 variable_move( _environment, posX->name, x->name );
313 cpu_inc_16bit( _environment, x->realName );
314 variable_move( _environment, posY->name, y->name );
315 cpu_call( _environment, isValidLabel );
316 cpu_compare_and_branch_8bit_const( _environment, isValid->realName, 0x00, skip1PaintLabel, 1 );
317 // Color with newC
318 // if valid and enqueue
319 plot( _environment, x->name, y->name, paintC->name, 0 );
320 // variable_move( _environment,
321 // variable_compare( _environment, queuePtr->name, queuePtrEnd->name )->name,
322 // isValid->name );
323 // cpu_compare_and_branch_8bit_const( _environment, isValid->realName, 0xff, forceDequePaintLabel, 1 );
324 // // p.first = posX + 1;
325 // cpu_move_16bit_indirect( _environment, x->realName, queuePtr->realName );
326 // cpu_inc_16bit( _environment, queuePtr->realName );
327 // cpu_inc_16bit( _environment, queuePtr->realName );
328 // // p.second = posY;
329 // cpu_move_16bit_indirect( _environment, y->realName, queuePtr->realName );
330 // cpu_inc_16bit( _environment, queuePtr->realName );
331 // cpu_inc_16bit( _environment, queuePtr->realName );
332 // // queue.push(p);
333 cpu_call( _environment, pushQueue );
334
335 cpu_label( _environment, skip1PaintLabel );
336
337 // Check if the adjacent
338 // pixels are valid
339 // if (isValid(screen, m, n, posX - 1, posY, prevC, newC)) {
340 variable_move( _environment, posX->name, x->name );
341 cpu_dec_16bit( _environment, x->realName );
342 variable_move( _environment, posY->name, y->name );
343 cpu_call( _environment, isValidLabel );
344 cpu_compare_and_branch_8bit_const( _environment, isValid->realName, 0x00, skip2PaintLabel, 1 );
345 // Color with newC
346 // if valid and enqueue
347 plot( _environment, x->name, y->name, paintC->name, 0 );
348 // variable_move( _environment,
349 // variable_compare( _environment, queuePtr->name, queuePtrEnd->name )->name,
350 // isValid->name );
351 // cpu_compare_and_branch_8bit_const( _environment, isValid->realName, 0xff, forceDequePaintLabel, 1 );
352 // // p.first = posX + 1;
353 // cpu_move_16bit_indirect( _environment, x->realName, queuePtr->realName );
354 // cpu_inc_16bit( _environment, queuePtr->realName );
355 // cpu_inc_16bit( _environment, queuePtr->realName );
356 // // p.second = posY;
357 // cpu_move_16bit_indirect( _environment, y->realName, queuePtr->realName );
358 // cpu_inc_16bit( _environment, queuePtr->realName );
359 // cpu_inc_16bit( _environment, queuePtr->realName );
360 // // queue.push(p);
361 cpu_call( _environment, pushQueue );
362
363 cpu_label( _environment, skip2PaintLabel );
364
365 // Check if the adjacent
366 // pixels are valid
367 // if (isValid(screen, m, n, posX, posY+1, prevC, newC)) {
368 variable_move( _environment, posX->name, x->name );
369 variable_move( _environment, posY->name, y->name );
370 cpu_inc_16bit( _environment, y->realName );
371 cpu_call( _environment, isValidLabel );
372 cpu_compare_and_branch_8bit_const( _environment, isValid->realName, 0x00, skip3PaintLabel, 1 );
373 // Color with newC
374 // if valid and enqueue
375 plot( _environment, x->name, y->name, paintC->name, 0 );
376 // variable_move( _environment,
377 // variable_compare( _environment, queuePtr->name, queuePtrEnd->name )->name,
378 // isValid->name );
379 // cpu_compare_and_branch_8bit_const( _environment, isValid->realName, 0xff, forceDequePaintLabel, 1 );
380 // // p.first = posX + 1;
381 // cpu_move_16bit_indirect( _environment, x->realName, queuePtr->realName );
382 // cpu_inc_16bit( _environment, queuePtr->realName );
383 // cpu_inc_16bit( _environment, queuePtr->realName );
384 // // p.second = posY;
385 // cpu_move_16bit_indirect( _environment, y->realName, queuePtr->realName );
386 // cpu_inc_16bit( _environment, queuePtr->realName );
387 // cpu_inc_16bit( _environment, queuePtr->realName );
388 // // queue.push(p);
389 cpu_call( _environment, pushQueue );
390
391 cpu_label( _environment, skip3PaintLabel );
392
393 // Check if the adjacent
394 // pixels are valid
395 // if (isValid(screen, m, n, posX, posY-1, prevC, newC)) {
396 variable_move( _environment, posX->name, x->name );
397 variable_move( _environment, posY->name, y->name );
398 cpu_dec_16bit( _environment, y->realName );
399 cpu_call( _environment, isValidLabel );
400 cpu_compare_and_branch_8bit_const( _environment, isValid->realName, 0x00, skip4PaintLabel, 1 );
401 // Color with newC
402 // if valid and enqueue
403 plot( _environment, x->name, y->name, paintC->name, 0 );
404 // variable_move( _environment,
405 // variable_compare( _environment, queuePtr->name, queuePtrEnd->name )->name,
406 // isValid->name );
407 // cpu_compare_and_branch_8bit_const( _environment, isValid->realName, 0xff, forceDequePaintLabel, 1 );
408 // // p.first = posX + 1;
409 // cpu_move_16bit_indirect( _environment, x->realName, queuePtr->realName );
410 // cpu_inc_16bit( _environment, queuePtr->realName );
411 // cpu_inc_16bit( _environment, queuePtr->realName );
412 // // p.second = posY;
413 // cpu_move_16bit_indirect( _environment, y->realName, queuePtr->realName );
414 // cpu_inc_16bit( _environment, queuePtr->realName );
415 // cpu_inc_16bit( _environment, queuePtr->realName );
416 // // queue.push(p);
417 cpu_call( _environment, pushQueue );
418
419 cpu_label( _environment, skip4PaintLabel );
420
421 cpu_jump( _environment, loopPaintLabel );
422
423 // ------------------------------[ END FLOOD FILL LOOP ]
424
425 cpu_label( _environment, endPaintLabel );
426
427 cpu_return( _environment );
428
429 deploy_end( paint )
430
431 Variable * x = variable_retrieve_or_define( _environment, _x, VT_POSITION, 0 );
432 Variable * y = variable_retrieve_or_define( _environment, _y, VT_POSITION, 0 );
433 Variable * c = NULL;
434 if ( _c ) {
435 c = variable_retrieve_or_define( _environment, _c, VT_COLOR, 0 );
436 } else {
437 c = variable_retrieve( _environment, "PEN" );
438 }
439
440 Variable * px = variable_retrieve( _environment, "paint__x" );
441 Variable * py = variable_retrieve( _environment, "paint__y" );
442 Variable * pc = variable_retrieve( _environment, "paint__c" );
443 Variable * pb = variable_retrieve( _environment, "paint__b" );
444
445 variable_move( _environment, x->name, px->name );
446 variable_move( _environment, y->name, py->name );
447 variable_move( _environment, c->name, pc->name );
448 if ( _b ) {
449 Variable * b = variable_retrieve( _environment, _b );
450 variable_move( _environment, b->name, pb->name );
451 } else {
452 variable_store( _environment, pb->name, 0 );
453 }
454
455 cpu_call( _environment, "lib_paint" );
456
457}
void cpu_addressof_16bit(Environment *_environment, char *_source, char *_destination)
Definition 6309.c:1485
void cpu_dec_16bit(Environment *_environment, char *_variable)
Definition 6309.c:4640
void cpu_math_add_16bit_const(Environment *_environment, char *_source, int _destination, char *_other)
Definition 6309.c:1674
void cpu_move_16bit_indirect(Environment *_environment, char *_source, char *_value)
Definition 6309.c:5339
void cpu_label(Environment *_environment, char *_label)
Definition 6309.c:356
void cpu_move_16bit_indirect2(Environment *_environment, char *_value, char *_source)
Definition 6309.c:5352
void cpu_call(Environment *_environment, char *_label)
Definition 6309.c:3755
void cpu_store_8bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 8 bit
Definition 6309.c:761
void cpu_jump(Environment *_environment, char *_label)
Definition 6309.c:3739
void cpu_compare_and_branch_16bit(Environment *_environment, char *_source, char *_destination, char *_label, int _positive)
Definition 6309.c:1552
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_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_retrieve(Environment *_environment, char *_name)
Variable * variable_less_than_const(Environment *_environment, char *_source, int _destination, int _equal)
Variable * variable_retrieve_or_define(Environment *_environment, char *_name, VariableType _type, int _value)
Variable * variable_greater_than(Environment *_environment, char *_source, char *_destination, int _equal)
Compare two variable and return the result of comparation.
void variable_compare_and_branch_const(Environment *_environment, char *_source, int _destination, char *_name, int _positive)
Variable * variable_move(Environment *_environment, char *_source, char *_destination)
Store the value of a variable inside another variable by converting it.
Variable * variable_compare_not(Environment *_environment, char *_source, char *_destination)
Compare two variable and return the result of comparation.
Variable * variable_resize_buffer(Environment *_environment, char *_destination, int _size)
Resize the (static) size of a buffer.
Variable * variable_define(Environment *_environment, char *_name, VariableType _type, int _value)
Define a variable for the program.
Variable * variable_temporary(Environment *_environment, VariableType _type, char *_meaning)
Define a temporary variable.
Variable * variable_compare(Environment *_environment, char *_source, char *_destination)
Compare two variable and return the result of comparation.
Variable * variable_store(Environment *_environment, char *_destination, unsigned int _value)
Store a direct value to a variable.
char * name
Definition _optimizer.c:672
void plot(Environment *_environment, char *_x, char *_y, char *_c, int _preserve_color)
Definition plot.c:46
Variable * point(Environment *_environment, char *_x, char *_y)
Definition point.c:46
#define DEFAULT_PAINT_BUCKET_SIZE
Definition atari.h:143
void paint_vars(Environment *_environment, char *_x, char *_y, char *_c, char *_b)
Emit ASM code for PAIN.
Definition paint.c:99
Variable * screen_get_height(Environment *_environment)
Variable * screen_get_width(Environment *_environment)
int paintBucketSize
Definition ugbc.h:3167
char * name
Definition ugbc.h:979
char * realName
Definition ugbc.h:982
#define deploy_end(s)
Definition ugbc.h:4365
#define MAX_TEMPORARY_STORAGE
Definition ugbc.h:563
struct _Variable Variable
Structure of a single variable.
struct _Environment Environment
Structure of compilation environment.
@ VT_POSITION
Definition ugbc.h:468
@ VT_BUFFER
Definition ugbc.h:477
@ VT_SBYTE
Definition ugbc.h:452
@ VT_ADDRESS
Definition ugbc.h:465
@ VT_COLOR
Definition ugbc.h:471
#define deploy_begin(s)
Definition ugbc.h:4356
#define MAKE_LABEL
Definition ugbc.h:3351