38 #include <sysinfoapi.h>
39 #include <errhandlingapi.h>
56#elif defined(__atarixl__)
60#elif defined(__plus4__)
66#elif defined(__coco__)
68#elif defined(__cocob__)
70#elif defined(__coco3__)
72#elif defined(__coco3b__)
76#elif defined(__d32b__)
80#elif defined(__d64b__)
84#elif defined(__pc128op__)
90#elif defined(__vic20__)
92#elif defined(__msx1__)
94#elif defined(__coleco__)
96#elif defined(__pccga__)
98#elif defined(__sc3000__)
100#elif defined(__sg1000__)
102#elif defined(__cpc__)
104#elif defined(__c128__)
106#elif defined(__c128z__)
108#elif defined(__vg5000__)
110#elif defined(__c64reu__)
112#elif defined(__pc1403__)
114#elif defined(__vz200__)
118#define strcmp_nocase strcasecmp
120extern RGBi SYSTEM_PALETTE[];
194 neededSpace = _variable->
size;
203 if ( neededSpace == 0 )
return;
207 int enoughSpace = actual->
size > neededSpace;
214 actual->
size -= neededSpace;
217 actual->
current += neededSpace;
220 actual = actual->
next;
230 neededSpace = _variable->
size;
237 if ( neededSpace == 0 )
return;
243 actual->
size += neededSpace;
246 actual->
current -= neededSpace;
252 Bank * actual = _first;
254 if ( strcmp( actual->
name, _name ) == 0 ) {
257 actual = actual->
next;
265 if ( actual->
locked == 0 ) {
275 actual = actual->
next;
279static Variable * variable_find_by_realname(
Variable * _first,
char * _name ) {
283 if ( strcmp( actual->
realName, _name ) == 0 ) {
286 actual = actual->
next;
295 if ( strcmp( actual->
name, _name ) == 0 ) {
298 actual = actual->
next;
303static void variable_remove(
Variable * _first,
char * _name ) {
308 if ( strcmp( actual->
name, _name ) == 0 ) {
312 actual = actual->
next;
325 if ( actual->
used || ( actual->
type != _type ) ) {
326 actual = actual->
next;
328 actual = actual->
next;
336static Constant * constant_find_by_realname(
Constant * _first,
char * _name ) {
340 if ( strcmp( actual->
realName, _name ) == 0 ) {
343 actual = actual->
next;
350 memset( c3, 0,
sizeof(
Constant ) );
354 c3->
name = strdup( _name );
362 while( constLast->
next ) {
363 constLast = constLast->
next;
365 constLast->
next = c3;
377 if ( strcmp( actual->
name, _name ) == 0 ) {
380 actual = actual->
next;
389 if ( actual->
size == _size ) {
392 actual = actual->
next;
403 actual->
size = _size;
404 actual->
count = _count;
408 if ( actual->
count < _count ) {
409 actual->
count = _count;
417static void error_out_of_boundary(
Environment * _environment ) {
425static int calculate_cast_type_best_fit(
Environment * _environment,
int _type1,
int _type2 ) {
436 if ( bits1 < bits2 ) {
438 }
else if ( bits2 < bits1 ) {
459 offsettingVariable->
variable = _var;
460 offsettingVariable->
sequence = _sequence;
470 memset( pattern, 0,
sizeof(
Pattern ) );
472 pattern->
pattern = strdup( _pattern );
478static int variable_is_global(
Environment * _environment,
char * _name ) {
485 if ( strstr( _name,
"__" ) != NULL ) {
500 current = current->
next;
529 int isGlobal = variable_is_global( _environment, _name );
538 var = variable_find( _environment->
variables, parameterName );
566 var = variable_find( _environment->
variables, parameterName );
587 var = variable_find( _environment->
tempVariables[0], _name );
594 var = variable_find( _environment->
variables, _name );
602 if ( !var && _mandatory ) {
613 memset( var, 0,
sizeof(
Variable ) );
614 var->
name = strdup( _name );
617 if ( _procedure_name ) {
618 var->
realName =
malloc( strlen( _name ) + strlen( _procedure_name ) + 3 );
620 strcat( var->
realName, _procedure_name );
649 while( varLast->
next ) {
650 varLast = varLast->
next;
734 isGlobal = variable_is_global( _environment, _name );
770 var = variable_define_internal( _environment, &_environment->
variables, _name, NULL, _type, _value );
789 if ( var->
type != _type ) {
794 memset( var, 0,
sizeof(
Variable ) );
795 var->
name = strdup( _name );
797#if defined(cpu6809)||defined(cpu6309)
799 strcmp( _name,
"PEN" ) == 0 ||
800 strcmp( _name,
"XCURSYS" ) == 0 ||
801 strcmp( _name,
"YCURSYS" ) == 0
815 var->
size = _size_or_value;
817 var->
value = _size_or_value;
835 while( varLast->
next ) {
836 varLast = varLast->
next;
853 if ( var->
type != _type ) {
858 memset( var, 0,
sizeof(
Variable ) );
859 var->
name = strdup( _name );
861#if defined(cpu6809)||defined(cpu6309)
863 strcmp( _name,
"PEN" ) == 0 ||
864 strcmp( _name,
"XCURSYS" ) == 0 ||
865 strcmp( _name,
"YCURSYS" ) == 0
879 var->
size = _size_or_value;
881 var->
value = _size_or_value;
898 while( varLast->
next ) {
899 varLast = varLast->
next;
923 if ( var->
type != _type ) {
928 memset( var, 0,
sizeof(
Variable ) );
929 var->
name = strdup( _name );
947 while( varLast->
next ) {
948 varLast = varLast->
next;
973 var = variable_find_by_realname( _environment->
tempVariables[0], _name );
983 var = variable_find_by_realname( _environment->
variables, _name );
1016 var = variable_find( _environment->
tempVariables[0], _name );
1030 var = variable_find( _environment->
variables, _name );
1032 variable_remove( _environment->
variables, _name );
1046 int isGlobal = variable_is_global( _environment, _name );
1108 var = variable_define_internal( _environment, &_environment->
variables, _name, _environment->
procedureName, _type, _value );
1132 variable_reset_pool( _environment, _environment->
tempVariables[0] );
1232 error_out_of_boundary( _environment );
1233 cpu_label( _environment, checkBoundaryOk );
1265static Variable * variable_move_from_array_get_address(
Environment * _environment,
char * _array,
char * _field ) {
1274 Field * field = NULL;
1276 if ( array->arrayType !=
VT_TYPE ) {
1279 if ( !array->typeType ) {
1282 field =
field_find( array->typeType, _field );
1292 Variable *
offset = calculate_offset_in_array( _environment, array->name);
1294 switch( array->arrayType ) {
1338 if ( array->bankAssigned == -1 ) {
1418 var = variable_find_first_unused( *variableSet, _type, _environment->
floatType.
precision );
1425 var->
meaningName = ( _meaning) ? strdup( _meaning ) : NULL;
1440 }
else if ( _type ==
VT_PATH ) {
1456 }
else if ( _type ==
VT_BIT ) {
1464 var = variable_define_internal( _environment, variableSet,
name, _environment->
procedureName, _type, 0 );
1476 }
else if ( _type ==
VT_PATH ) {
1494 var->
meaningName = _meaning ? strdup( _meaning ) : NULL;
1543 }
else if ( _type ==
VT_PATH ) {
1559 }
else if ( _type ==
VT_BIT ) {
1567 var = variable_define_internal( _environment, variableSet,
name, NULL, _type, 0 );
1579 }
else if ( _type ==
VT_PATH ) {
1597 var->
meaningName = _meaning ? strdup( _meaning ) : NULL;
1644 if (
source->type == _type ) {
1724 destination->
value = _value;
1735 if ( _value >= 20 && _value <= 127 ) {
1779 size *= ( 1 << os );
1791 value[0] = (
unsigned char)((_value) & 0xff );
1792 value[1] = (
unsigned char)((_value>>8) & 0xff );
1793 value[2] = (
unsigned char)((_value>>16) & 0xff );
1794 value[3] = (
unsigned char)((_value>>24) & 0xff );
1821 sprintf( offsetAsString,
"%d", field->
offset );
1831 if ( _value >= 20 && _value <= 127 ) {
1855#define UNESCAPE_COLOR( c, d ) \
1856 else if ( strcmp_nocase( word, c ) == 0 ) { \
1857 int c2 = COLOR_##d;\
1861 if ( _printing ) { \
1867 if ( _printing ) { \
1877 char * newValue =
malloc( strlen( _value ) + 1 );
1879 memset( newValue, 0, strlen( _value ) + 1 );
1881 char * p = _value, * q = newValue;
1884 if ( _final_size ) {
1891 if ( isdigit(*p) ) {
1893 while( *p && *p !=
'}' ) {
1894 c = 10 * c + ( *p -
'0' );
1904 if ( _final_size ) {
1908 char * p2 = strchr(p+1,
'}' );
1912 memcpy(
word, p, p2-p );
1922 if ( _final_size ) {
1968 if ( _final_size ) {
1977 if ( _final_size ) {
1999 switch( destination->
type ) {
2004 if ( strcmp( _value,
" 1 2 3 4 5 6 7" ) == 0 ) {
2005 _value = strdup(
"Press 1-9 key to play" );
2048 switch( destination->
type ) {
2059#if defined(__atari__) || defined(__atarixl__) || defined(__c64__) || \
2060 defined(__c64reu__) || defined(__c128__) || defined(__vic20__)
2062 double fractional = modf( _value, &integral);
2063 if ( fractional == 0.0 ) {
2069 double q = fabs( _value ), n = 0;
2070 int s = _value >= 0 ? 1 : -1;
2071 while ( q > 32767 ) {
2072 q = q / pow( 10, n );
2106 double q = fabs( _value ), n = 0;
2107 int s = _value >= 0 ? 1 : -1;
2112 double fractional = modf(q, &integral);
2113 if ( fractional == 0.0 ) {
2164 switch( destination->
type ) {
2166 destination->
size = _size;
2177 switch( destination->
type ) {
2186 memcpy( destination->
valueBuffer, _buffer, _size );
2187 destination->
size = _size;
2202 temporary->
size = _size;
2206 if ( destination->
size < _size ) {
2209 destination->
size = _size;
2226 switch( destination->
type ) {
2230 memcpy( destination->
valueBuffer, _buffer, _size );
2231 destination->
size = _size;
2241 temporary->
size = _size;
2242 if ( destination->
size < _size ) {
2245 destination->
size = _size;
2308 variable_move_32bit_signed_16bit_signed( _environment, _source, _target );
2312 variable_move_32bit_signed_16bit_unsigned( _environment, _source, _target );
2324 variable_move_32bit_unsigned_16bit_signed( _environment, _source, _target );
2330 variable_move_32bit_unsigned_16bit_unsigned( _environment, _source, _target );
2377 variable_move_32bit_signed_8bit_signed( _environment, _source, _target );
2381 variable_move_32bit_signed_8bit_unsigned( _environment, _source, _target );
2393 variable_move_32bit_unsigned_8bit_signed( _environment, _source, _target );
2399 variable_move_32bit_unsigned_8bit_unsigned( _environment, _source, _target );
2429 cpu_jump( _environment, doneLabel );
2481 variable_move_16bit_signed_32bit_signed( _environment, _source, _target );
2487 variable_move_16bit_signed_32bit_unsigned( _environment, _source, _target );
2497 variable_move_16bit_unsigned_32bit_signed( _environment, _source, _target );
2503 variable_move_16bit_unsigned_32bit_unsigned( _environment, _source, _target );
2563 variable_move_16bit_signed_8bit_signed( _environment, _source, _target );
2567 variable_move_16bit_signed_8bit_unsigned( _environment, _source, _target );
2579 variable_move_16bit_unsigned_8bit_signed( _environment, _source, _target );
2585 variable_move_16bit_unsigned_8bit_unsigned( _environment, _source, _target );
2615 cpu_jump( _environment, doneLabel );
2665 variable_move_8bit_signed_32bit_signed( _environment, _source, _target );
2671 variable_move_8bit_signed_32bit_unsigned( _environment, _source, _target );
2681 variable_move_8bit_unsigned_32bit_signed( _environment, _source, _target );
2687 variable_move_8bit_unsigned_32bit_unsigned( _environment, _source, _target );
2736 variable_move_8bit_signed_16bit_signed( _environment, _source, _target );
2740 variable_move_8bit_signed_16bit_unsigned( _environment, _source, _target );
2752 variable_move_8bit_unsigned_16bit_signed( _environment, _source, _target );
2758 variable_move_8bit_unsigned_16bit_unsigned( _environment, _source, _target );
2801 cpu_jump( _environment, doneLabel );
2903 variable_move_16bit_16bit( _environment, temp, _target );
2913 #ifdef CPU_BIG_ENDIAN
2947 #ifdef CPU_BIG_ENDIAN
2981 #ifdef CPU_BIG_ENDIAN
3013 variable_move_8bit_number( _environment,
byte, _target );
3025 #ifdef CPU_BIG_ENDIAN
3039 #ifdef CPU_BIG_ENDIAN
3053 #ifdef CPU_BIG_ENDIAN
3068 variable_move_number_8bit( _environment, _source, sourceByte );
3069 variable_move_8bit_1bit( _environment, sourceByte, _target );
3113 variable_move_32bit_32bit( _environment,
source, target );
3119 variable_move_32bit_16bit( _environment,
source, target );
3125 variable_move_32bit_8bit( _environment,
source, target );
3131 variable_move_32bit_1bit( _environment,
source, target );
3137 switch( target->
type ) {
3140 #ifdef CPU_BIG_ENDIAN
3169 variable_move_32bit_number( _environment,
source, target );
3185 variable_move_16bit_32bit( _environment,
source, target );
3190 variable_move_16bit_16bit( _environment,
source, target );
3195 variable_move_16bit_8bit( _environment,
source, target );
3201 variable_move_16bit_1bit( _environment,
source, target );
3207 switch( target->
type ) {
3210 #ifdef CPU_BIG_ENDIAN
3232 variable_move_16bit_number( _environment,
source, target );
3250 variable_move_8bit_32bit( _environment,
source, target );
3256 variable_move_8bit_16bit( _environment,
source, target );
3262 variable_move_8bit_8bit( _environment,
source, target );
3268 variable_move_8bit_1bit( _environment,
source, target );
3274 switch( target->
type ) {
3291 variable_move_8bit_number( _environment,
source, target );
3309 variable_move_1bit_32bit( _environment,
source, target );
3315 variable_move_1bit_16bit( _environment,
source, target );
3321 variable_move_1bit_8bit( _environment,
source, target );
3327 variable_move_1bit_1bit( _environment,
source, target );
3333 switch( target->
type ) {
3350 variable_move_1bit_number( _environment,
source, target );
3371 variable_move_number_32bit( _environment,
source, target );
3381 switch(
source->precision ) {
3393 variable_move_number_16bit( _environment,
source, target );
3403 switch(
source->precision ) {
3415 variable_move_number_8bit( _environment,
source, target );
3425 variable_move_number_1bit( _environment,
source, target );
3435 switch( target->
type ) {
3447 switch( target->
type ) {
3469 switch( target->
type ) {
3480 switch( target->
type ) {
3491 switch( target->
type ) {
3502 switch( target->
type ) {
3517 variable_move_number_number( _environment,
source, target );
3520 switch( target->
type ) {
3531 switch( target->
type ) {
3548 switch( target->
type ) {
3562 switch( target->
type ) {
3573 switch( target->
type ) {
3584 switch( target->
type ) {
3595 switch( target->
type ) {
3597 if ( !
source->valueBuffer ) {
3609 int realAllocationSize = 0;
3610 if (
source->bankAssigned != -1 ) {
3615 sprintf(alreadyLoadedLabel,
"%salready", label );
3618 sprintf( bankWindowId,
"BANKWINDOWID%2.2x",
source->residentAssigned );
3620 sprintf( bankWindowName,
"BANKWINDOW%2.2x",
source->residentAssigned );
3627 if (
source->uncompressedSize ) {
3629 realSize =
source->uncompressedSize;
3636 cpu_label( _environment, alreadyLoadedLabel );
3641 realAllocationSize = realSize;
3644 if ( target->
size == 0 ) {
3645 target->
size = realAllocationSize;
3662 switch( target->
type ) {
3668 if ( target->
size == 0 ) {
3684 switch( target->
type ) {
3689 if ( target->
size == 0 ) {
3708 switch( target->
type ) {
3711 if ( target->
size == 0 ) {
3727 switch( target->
type ) {
3729 if ( target->
size == 0 ) {
3760 switch( target->
type ) {
3765 if ( target->
size == 0 ) {
3777 first = first->
next;
3783 first = type->
first;
3788 first = first->
next;
3799 switch( target->
type ) {
3801 if (
source->size > 255 ) {
3823 if ( target->
size == 0 ) {
3945 switch( target->
type ) {
3960 switch( target->
type ) {
3971 switch( target->
type ) {
3982 switch( target->
type ) {
3993 switch( target->
type ) {
4007 switch( target->
type ) {
4018 switch( target->
type ) {
4035 switch( target->
type ) {
4068 if ( target->
size == 0 ) {
4078 if ( target->
size == 0 ) {
4085 if ( target->
size == 0 ) {
4092 if ( target->
size == 0 ) {
4099 if ( target->
size == 0 ) {
4114 if ( target->
size == 0 ) {
4166 int best = calculate_cast_type_best_fit( _environment,
source->type, target->
type );
4246 switch( target->
type ) {
4290 if ( _destination ) {
4328 if ( _destination ) {
4342 sprintf( offsetAsString,
"%d", field->
offset );
4458 sprintf( offsetAsString,
"%d", field->
offset );
4539 if ( _destination ) {
4692 int best = calculate_cast_type_best_fit( _environment,
source->type, target->
type );
4748 switch( target->
type ) {
5108 int best = calculate_cast_type_best_fit( _environment,
source->type, target->
type );
5116 #ifdef CPU_BIG_ENDIAN
5182 switch( target->
type ) {
5244 if ( log2(target->
value) == (
int)log2(target->
value) ) {
5342 switch( target->
type ) {
5541 sprintf( offsetAsString,
"%d", field->
offset );
5565static void variable_increment_decrement_array(
Environment * _environment,
char * _source,
int _direction ) {
5572 Variable *
offset = variable_move_from_array_get_address( _environment, _source, NULL );
5576 if (
source->bankAssigned == -1 ) {
5619 if ( _direction > 0 ) {
5621 }
else if ( _direction < 0 ) {
5625 if (
source->bankAssigned == -1 ) {
5863 sprintf( offsetAsString,
"%d", field->
offset );
5939 if ( _destination ) {
5947 if ( _destination ) {
6000 #ifdef CPU_BIG_ENDIAN
6011 #ifdef CPU_BIG_ENDIAN
6023 variable_move_1bit_8bit( _environment, target, converted );
6024 #ifdef CPU_BIG_ENDIAN
6035 switch( target->
type ) {
6044 #ifdef CPU_BIG_ENDIAN
6065 #ifdef CPU_BIG_ENDIAN
6079 #ifdef CPU_BIG_ENDIAN
6091 variable_move_1bit_8bit( _environment, target, converted );
6092 #ifdef CPU_BIG_ENDIAN
6103 switch( target->
type ) {
6112 #ifdef CPU_BIG_ENDIAN
6133 #ifdef CPU_BIG_ENDIAN
6144 #ifdef CPU_BIG_ENDIAN
6159 variable_move_1bit_8bit( _environment, target, converted );
6164 switch( target->
type ) {
6173 #ifdef CPU_BIG_ENDIAN
6192 variable_move_1bit_8bit( _environment,
source, converted );
6196 #ifdef CPU_BIG_ENDIAN
6207 #ifdef CPU_BIG_ENDIAN
6222 variable_move_1bit_8bit( _environment, target, converted2 );
6234 switch( target->
type ) {
6242 cpu_label( _environment, differentLabel );
6261 cpu_label( _environment, differentLabel );
6276 switch( target->
type ) {
6292 cpu_label( _environment, differentLabel );
6308 cpu_label( _environment, differentLabel );
6321 switch( target->
type ) {
6335 switch( target->
type ) {
6363 switch(
source->precision ) {
6375 cpu_jump( _environment, doneLabel );
6376 cpu_label( _environment, differentLabel );
6516 if ( _steps == 0 ) {
6525 if ( (
int)log2(_steps) > 0 ) {
6530 if ( (
int)log2(_steps) > 0 ) {
6535 if ( (
int)log2(_steps) > 0 ) {
6541 switch( destination->
type ) {
6561 if ( _steps == 0 ) {
6580 switch( destination->
type ) {
6619 if ( (
int)log2(_bits) > 0 ) {
6624 if ( (
int)log2(_bits) > 0 ) {
6629 if ( (
int)log2(_bits) > 0 ) {
6635 switch( destination->
type ) {
6664 switch( destination->
type ) {
7232 int best = calculate_cast_type_best_fit( _environment,
source->type, target->
type );
7245 #ifdef CPU_BIG_ENDIAN
7256 #ifdef CPU_BIG_ENDIAN
7267 switch( target->
type ) {
7269 #ifdef CPU_BIG_ENDIAN
7289 #ifdef CPU_BIG_ENDIAN
7303 #ifdef CPU_BIG_ENDIAN
7314 switch( target->
type ) {
7316 #ifdef CPU_BIG_ENDIAN
7347 switch( target->
type ) {
7349 #ifdef CPU_BIG_ENDIAN
7370 switch( target->
type ) {
7387 cpu_label( _environment, differentLabel );
7406 cpu_label( _environment, differentLabel );
7416 switch( target->
type ) {
7431 cpu_label( _environment, differentLabel );
7448 cpu_label( _environment, differentLabel );
7462 switch( target->
type ) {
7475 switch( target->
type ) {
7500 switch(
source->precision ) {
7515 cpu_jump( _environment, doneLabel );
7516 cpu_label( _environment, greaterLabel );
7587 int best = calculate_cast_type_best_fit( _environment,
source->type, target->
type );
7600 #ifdef CPU_BIG_ENDIAN
7611 #ifdef CPU_BIG_ENDIAN
7622 switch( target->
type ) {
7624 #ifdef CPU_BIG_ENDIAN
7645 #ifdef CPU_BIG_ENDIAN
7659 #ifdef CPU_BIG_ENDIAN
7670 switch( target->
type ) {
7672 #ifdef CPU_BIG_ENDIAN
7694 #ifdef CPU_BIG_ENDIAN
7704 #ifdef CPU_BIG_ENDIAN
7718 switch( target->
type ) {
7720 #ifdef CPU_BIG_ENDIAN
7740 switch( target->
type ) {
7758 cpu_jump( _environment, doneLabel );
7760 cpu_label( _environment, differentLabel );
7780 cpu_jump( _environment, doneLabel );
7782 cpu_label( _environment, differentLabel );
7792 switch( target->
type ) {
7808 cpu_jump( _environment, doneLabel );
7810 cpu_label( _environment, differentLabel );
7828 cpu_jump( _environment, doneLabel );
7830 cpu_label( _environment, differentLabel );
7845 switch( target->
type ) {
7858 switch( target->
type ) {
7875 switch( target->
type ) {
7883 switch(
source->precision ) {
7898 cpu_jump( _environment, doneLabel );
7899 cpu_label( _environment, greaterLabel );
7901 cpu_jump( _environment, doneLabel );
8006 switch( string->
type ) {
8090 switch( string->
type ) {
8120 cpu_jump( _environment, labelDone );
8206 switch( string->
type ) {
8316 switch( string->
type ) {
8410 switch( string->
type ) {
8435 cpu_label( _environment, unlimitedLenLabel );
8478 cpu_label( _environment, unlimitedLenLabel );
8501 cpu_jump( _environment, doneLabel );
8503 cpu_label( _environment, emptyResultLabel );
8579 sprintf( lessThanLabel,
"%slessthan", label );
8586 cpu_label( _environment, lessThanLabel );
8668 switch( string->
type ) {
8810 switch( search->
type ) {
8822 switch( searched->
type ) {
8854 cpu_bvneq( _environment, found->realName, notFoundLabel );
8861 cpu_bvneq( _environment, found->realName, foundLabel );
8863 cpu_jump( _environment, repeatLabel );
8865 cpu_label( _environment, notFoundLabel );
8953 switch( string->
type ) {
9048 switch( string->
type ) {
9114 switch( value->
type ) {
9212 switch( value->type ) {
9318 switch( originalValue->type ) {
9407 switch( value->type ) {
9426 switch( variable->
type ) {
9511 switch( string->type ) {
9595 switch( string->
type ) {
9720 switch( string->
type ) {
9750 switch( variable->
type ) {
9937 switch( character->type ) {
10014 switch( string->
type ) {
10038static Variable * calculate_offset_in_array_byte(
Environment * _environment,
char * _array ) {
10066 error_out_of_boundary( _environment );
10067 cpu_label( _environment, checkBoundaryOk );
10091 error_out_of_boundary( _environment );
10092 cpu_label( _environment, checkBoundaryOk );
10305 if ( !precalculatedOffset ) {
10307 memset( precalculatedOffset, 0,
sizeof(
Constant ) );
10308 precalculatedOffset->
name = strdup( precalculatedOffsetName );
10309 precalculatedOffset->
realName = strdup( precalculatedOffsetName );
10314 _environment->
constants = precalculatedOffset;
10340 outline0(
"; variable_move_array_byte(2)");
10565 Variable *
offset = calculate_offset_in_array( _environment, _array);
10578 switch( string->
type ) {
10661 error_out_of_boundary( _environment );
10662 cpu_label( _environment, checkBoundaryOk );
10672 error_out_of_boundary( _environment );
10673 cpu_label( _environment, checkBoundaryOk );
10683 error_out_of_boundary( _environment );
10684 cpu_label( _environment, checkBoundaryOk );
10696 if ( !precalculatedOffset ) {
10698 memset( precalculatedOffset, 0,
sizeof(
Constant ) );
10699 precalculatedOffset->
name = strdup( precalculatedOffsetName );
10700 precalculatedOffset->
realName = strdup( precalculatedOffsetName );
10705 _environment->
constants = precalculatedOffset;
11104 if (*_pattern ==
'\0' && *_value ==
'\0')
11110 if (*_pattern ==
'*' && *(_pattern+1) !=
'\0' && *_value ==
'\0')
11115 if (*_pattern ==
'?' || *_pattern == *_value)
11121 if (*_pattern ==
'*')
11293 cpu_jump( _environment, finishedLabel );
11295 cpu_label( _environment, truncateLabel );
11303 cpu_label( _environment, finishedLabel );
11491 while ( screenMode ) {
11493 screenMode = screenMode->
next;
11503 while ( screenMode ) {
11507 screenMode = screenMode->
next;
11519 while ( screenMode ) {
11520 if ( screenMode->
bitmap == _bitmap ) {
11521 firstMode = screenMode;
11524 screenMode = screenMode->
next;
11527 if ( ! _width && ! _height && ! _colors ) {
11534 while ( screenMode ) {
11535 if ( screenMode->
bitmap == _bitmap ) {
11536 screenMode->
score = 1000;
11537 if ( _width < 0 ) {
11539 }
else if ( _height < 0 ) {
11542 screenMode->
score -= ( _width ) ? (
abs( _width - screenMode->
width ) ) : 0;
11543 screenMode->
score -= ( _height ) ? (
abs( _height - screenMode->
height ) ) : 0;
11544 screenMode->
score -= ( _colors ) ? (
abs( _colors - screenMode->
colors ) * 100 ) : 0;
11545 screenMode->
score -= ( _tile_width ) ? (
abs( _tile_width - screenMode->
tileWidth ) * 10 ) : 0;
11546 screenMode->
score -= ( _tile_height ) ? (
abs( _tile_height - screenMode->
tileHeight ) * 10 ) : 0;
11549 screenMode->
score = -1000;
11551 screenMode = screenMode->
next;
11555 bestMode = firstMode;
11558 while ( screenMode ) {
11559 if ( screenMode->
score > bestMode->
score ) {
11560 bestMode = screenMode;
11562 screenMode = screenMode->
next;
11575 while ( screenMode ) {
11576 if ( screenMode->
id == _id ) {
11577 firstMode = screenMode;
11580 screenMode = screenMode->
next;
11651 int best = calculate_cast_type_best_fit( _environment,
source->type, target->
type );
11675 switch(
source->type ) {
11696 if ( !actual->
name && actual->
number == _label ) {
11699 actual = actual->
next;
11709 if ( actual->
name && !strcmp( actual->
name, _label ) ) {
11712 actual = actual->
next;
11725 memset( label, 0,
sizeof(
Label ) );
11729 while( last->
next ) {
11732 last->
next = label;
11734 _environment->
labels = label;
11746 memset( label, 0,
sizeof(
Label ) );
11747 label->
name = strdup( _label );
11750 while( last->
next ) {
11753 last->
next = label;
11755 _environment->
labels = label;
11764 if ( !actual->
name && actual->
number == _label ) {
11767 actual = actual->
next;
11777 if ( actual->
name && !strcmp( actual->
name, _label ) ) {
11780 actual = actual->
next;
11793 memset( label, 0,
sizeof(
Label ) );
11797 while( last->
next ) {
11800 last->
next = label;
11814 memset( label, 0,
sizeof(
Label ) );
11815 label->
name = strdup( _label );
11818 while( last->
next ) {
11821 last->
next = label;
11832 if ( actual->
name && !strcmp( actual->
name, _label ) ) {
11835 actual = actual->
next;
11848 memset( label, 0,
sizeof(
Label ) );
11849 label->
name = strdup( _label );
11852 while( last->
next ) {
11855 last->
next = label;
11878 if ( c->
value != _value ) {
11888 memset( c, 0,
sizeof(
Constant ) );
11889 c->
name = strdup( _name );
11895 while( constLast->
next ) {
11896 constLast = constLast->
next;
11898 constLast->
next = c;
11927 memset( c, 0,
sizeof(
Constant ) );
11928 c->
name = strdup( _name );
11934 while( constLast->
next ) {
11935 constLast = constLast->
next;
11937 constLast->
next = c;
11948static void variable_array_fill_value(
Environment * _environment,
char * _name,
int _value ) {
11956 if ( array->
size > 0 ) {
11960 int sizeInElements = 1;
11965 if ( sizeInElements < 256 ) {
11999 cpu_jump( _environment, loopLabel );
12051 if ( array->
size > 0 ) {
12056 int sizeInElements = 1;
12061 if ( sizeInElements < 256 ) {
12097 cpu_label( _environment, targetLabel );
12100 cpu_jump( _environment, loopLabel );
12151 if ( array->
size > 0 ) {
12156 int sizeInElements = 1;
12161 if ( sizeInElements < 256 ) {
12197 cpu_jump( _environment, loopLabel );
12239 if ( array->
size > 0 ) {
12245 int sizeInElements = 1;
12250 if ( sizeInElements < 256 ) {
12288 cpu_jump( _environment, loopLabel );
12330 if ( array->
size > 0 ) {
12336 int sizeInElements = 1;
12341 if ( sizeInElements < 256 ) {
12379 cpu_jump( _environment, loopLabel );
12431 if ( array->
size > 0 ) {
12438 variable_array_fill_value( _environment, _name, _value );
12457 if ( array->
size > 0 ) {
12464 int sizeInElements = 1;
12469 if ( sizeInElements < 256 ) {
12479 if ( _max_value > 0 ) {
12496 if ( _count > 0 ) {
12497 if ( _count < 256 ) {
12527 cpu_label( _environment, booleanLabel );
12529 if ( _min_value > 0 ) {
12555 cpu_jump( _environment, loopLabel );
12571 if ( array->
size > 0 ) {
12577 int sizeInElements = 1;
12582 if ( sizeInElements < 256 ) {
12591 if ( _count > 0 ) {
12592 if ( _count < 256 ) {
12629 cpu_jump( _environment, loopLabel );
12645 if ( array->
size > 0 ) {
12649 int sizeInElements = 1;
12654 if ( sizeInElements < 256 ) {
12664 if ( _rounds < 256 ) {
12714 cpu_jump( _environment, loopLabel );
12724 if ( *_frame_width == 0 ) {
12725 *_frame_width = _width;
12728 if ( _modulo_x == 0 ) {
12732 if ( _modulo_y == 0 ) {
12736 if ( (*_frame_width % _modulo_x) && !_environment->
freeImageWidth ) {
12740 if ( (_offset_x < 0) || (_offset_x >= _width) || ( ( _offset_x + (*_frame_width ) ) > _width ) ) {
12744 if ( *_frame_height == 0 ) {
12745 *_frame_height = _height;
12748 if ( (*_frame_height % _modulo_y) && !_environment->
freeImageHeight ) {
12752 if ( (*_frame_height % _modulo_y) && !_environment->
freeImageHeight ) {
12756 if ( (_offset_y < 0) || (_offset_y >= _height) || ( ( _offset_y + ( *_frame_height )) > _height ) ) {
12764 if ( *_frame_width == 0 ) {
12765 *_frame_width = _width;
12768 if ( (_offset_x < 0) || (_offset_x >= _width) || ( ( _offset_x + (*_frame_width ) ) > _width ) ) {
12772 if ( *_frame_height == 0 ) {
12773 *_frame_height = _height;
12776 if ( (_offset_y < 0) || (_offset_y >= _height) || ( ( _offset_y + ( *_frame_height )) > _height ) ) {
12789 if ( *_frame_width == 0 ) {
12790 *_frame_width = _width;
12793 if ( _modulo_y == 0 ) {
12797 if ( (_offset_x < 0) || (_offset_x >= _width) || ( ( _offset_x + (*_frame_width ) ) > _width ) ) {
12801 if ( *_frame_height == 0 ) {
12802 *_frame_height = _height;
12809 if ( (*_frame_height % _modulo_y) && !_environment->
freeImageHeight ) {
12813 if ( (_offset_y < 0) || (_offset_y >= _height) || ( ( _offset_y + ( *_frame_height )) > _height ) ) {
12821 if ( *_frame_width == 0 ) {
12822 *_frame_width = _width;
12825 if ( _modulo_x == 0 ) {
12833 if ( (_offset_x < 0) || (_offset_x >= _width) || ( ( _offset_x + (*_frame_width ) ) > _width ) ) {
12837 if ( *_frame_height == 0 ) {
12838 *_frame_height = _height;
12841 if ( (_offset_y < 0) || (_offset_y >= _height) || ( ( _offset_y + ( *_frame_height )) > _height ) ) {
12856 strcopy( lookedFilename, _filename );
12857 char * c = strrchr( lookedFilename,
'/' );
12859 strcopy( lookedExtension, c );
12862 strcopy( lookedFilename,
"." );
12864 strcat( lookedExtension, _filename );
12867#if defined(__atari__)
12868 strcat( lookedFilename,
"atari" );
12869#elif defined(__atarixl__)
12870 strcat( lookedFilename,
"atarixl" );
12872 strcat( lookedFilename,
"c64" );
12874 strcat( lookedFilename,
"plus4" );
12876 strcat( lookedFilename,
"c16" );
12878 strcat( lookedFilename,
"zx" );
12880 strcat( lookedFilename,
"d32" );
12882 strcat( lookedFilename,
"d32" );
12884 strcat( lookedFilename,
"d64" );
12886 strcat( lookedFilename,
"d64" );
12888 strcat( lookedFilename,
"pc128op" );
12890 strcat( lookedFilename,
"to8" );
12892 strcat( lookedFilename,
"mo5" );
12894 strcat( lookedFilename,
"vic20" );
12896 strcat( lookedFilename,
"msx1" );
12898 strcat( lookedFilename,
"coleco" );
12900 strcat( lookedFilename,
"sc3000" );
12902 strcat( lookedFilename,
"sg1000" );
12904 strcat( lookedFilename,
"cpc" );
12906 strcat( lookedFilename,
"c128" );
12908 strcat( lookedFilename,
"c128z" );
12910 strcat( lookedFilename,
"vg5000" );
12912 strcat( lookedFilename,
"coco" );
12914 strcat( lookedFilename,
"coco" );
12916 strcat( lookedFilename,
"coco3" );
12918 strcat( lookedFilename,
"coco3" );
12920 strcat( lookedFilename,
"c64reu" );
12922 strcat( lookedFilename,
"pc1403" );
12924 strcat( lookedFilename,
"gb" );
12926 strcat( lookedFilename,
"pccga" );
12928 strcat( lookedFilename,
"vz200" );
12931 if ( strlen( lookedExtension ) ) {
12932 strcat( lookedFilename, lookedExtension );
12935 FILE * file = fopen( lookedFilename,
"rb" );
12939 strcopy( lookedFilename, _filename );
12941 file = fopen( lookedFilename,
"rb" );
12952 return lookedFilename;
12965 if ( strcmp( varLast->
name, _name ) == 0 ) {
12975 varLast = varLast->
next;
12977 if ( strcmp( varLast->
name, _name ) == 0 ) {
12981 previous = varLast;
12982 varLast = varLast->
next;
12993 if ( _tileData->
data[j] & ( 1 << i ) ) {
13006 if ( _tileData->
data[_position] & ( 1 << i ) ) {
13026 if ( _tileData->
data[i] & ( 1 << _position ) ) {
13069 return tileDescriptor;
13080 for(i=0;i<_fontSize;++i) {
13082 tileDescriptors->
data[i].
data[j] = *(_fontData + i*8 + j);
13087 tileDescriptors->
count = 0;
13089 return tileDescriptors;
13110 int minAffinity = 0xffffff;
13111 int nearestTileIndex = -1;
13114 for(i=0;i<256;++i) {
13117 if ( minAffinity > affinity ) {
13118 minAffinity = affinity;
13119 nearestTileIndex = i;
13124 return nearestTileIndex;
13140 for(i=0;i<256;++i) {
13170 char * buffer = NULL;
13173 *_size = strlen( _buffer ) / 2;
13174 buffer =
malloc( *_size );
13177 for( i = 0, c = strlen( _buffer ); i<(c); i += 2 ) {
13178 hexdigits[0] = _buffer[i];
13179 hexdigits[1] = _buffer[i+1];
13181 buffer[i>>1] = strtol(hexdigits,0,16);
13184 char * unescapedString =
unescape_string( _environment, _buffer, 0, _size );
13185 buffer =
malloc( *_size + 1 );
13186 memset( buffer, 0, *_size + 1 );
13187 memcpy( buffer, unescapedString, *_size );
13197 char * buffer =
parse_buffer( _environment, _buffer, &bufferSize, _hex_only );
13209 for( y=0; y<_height; ++y ) {
13210 for( x=0; x<( _width >> 1 ); ++x ) {
13211 char * pixel1r = _source + ( y * _width * _depth ) + ( x * _depth );
13212 char * pixel1g = _source + ( y * _width * _depth ) + ( x * _depth ) + 1;
13213 char * pixel1b = _source + ( y * _width * _depth ) + ( x * _depth ) + 2;
13215 if ( _depth > 3 ) {
13216 pixel1a = _source + ( y * _width * _depth ) + ( x * _depth ) + 3;
13218 char * pixel2r = _source + ( y * _width * _depth ) + ( ( _width - x - 1 ) * _depth );
13219 char * pixel2g = _source + ( y * _width * _depth ) + ( ( _width - x - 1 ) * _depth ) + 1;
13220 char * pixel2b = _source + ( y * _width * _depth ) + ( ( _width - x - 1 ) * _depth ) + 2;
13222 if ( _depth > 3 ) {
13223 pixel2a = _source + ( y * _width * _depth ) + ( ( _width - x - 1 ) * _depth ) + 3;
13229 *pixel1r = *pixel2r;
13233 *pixel1g = *pixel2g;
13237 *pixel1b = *pixel2b;
13240 if ( _depth > 3 ) {
13242 *pixel1a = *pixel2a;
13257 for( x=0; x<_width; ++x ) {
13258 for( y=0; y<( _height >> 1 ); ++y ) {
13259 char * pixel1r = _source + ( y * _width * _depth ) + ( x * _depth );
13260 char * pixel1g = _source + ( y * _width * _depth ) + ( x * _depth ) + 1;
13261 char * pixel1b = _source + ( y * _width * _depth ) + ( x * _depth ) + 2;
13263 if ( _depth > 3 ) {
13264 pixel1b = _source + ( y * _width * _depth ) + ( x * _depth ) + 3;
13266 char * pixel2r = _source + ( ( _height - y - 1) * _width * _depth ) + ( x * _depth );
13267 char * pixel2g = _source + ( ( _height - y - 1) * _width * _depth ) + ( x * _depth ) + 1;
13268 char * pixel2b = _source + ( ( _height - y - 1) * _width * _depth ) + ( x * _depth ) + 2;
13270 if ( _depth > 3 ) {
13271 pixel2b = _source + ( ( _height - y - 1) * _width * _depth ) + ( x * _depth ) + 3;
13277 *pixel1r = *pixel2r;
13281 *pixel1g = *pixel2g;
13285 *pixel1b = *pixel2b;
13288 if ( _depth > 3 ) {
13290 *pixel1a = *pixel2a;
13305 for( y=0; y<_height; ++y ) {
13307 unsigned char * pixel2r = _source + ( y * _width * 3 ) + ( (_width-1) * 3 );
13308 unsigned char * pixel2g = _source + ( y * _width * 3 ) + ( (_width-1) * 3 ) + 1;
13309 unsigned char * pixel2b = _source + ( y * _width * 3 ) + ( (_width-1) * 3 ) + 2;
13311 unsigned char r, g, b;
13317 for( x=(_width-2); x > -1; --x ) {
13318 unsigned char * pixel1r = _source + ( y * _width * 3 ) + ( x * 3 );
13319 unsigned char * pixel1g = _source + ( y * _width * 3 ) + ( x * 3 ) + 1;
13320 unsigned char * pixel1b = _source + ( y * _width * 3 ) + ( x * 3 ) + 2;
13321 unsigned char * pixel2r = _source + ( y * _width * 3 ) + ( (x+1) * 3 );
13322 unsigned char * pixel2g = _source + ( y * _width * 3 ) + ( (x+1) * 3 ) + 1;
13323 unsigned char * pixel2b = _source + ( y * _width * 3 ) + ( (x+1) * 3 ) + 2;
13327 *pixel2r = (
unsigned char) *pixel1r;
13328 *pixel2g = (
unsigned char) *pixel1g;
13329 *pixel2b = (
unsigned char) *pixel1b;
13333 unsigned char * pixel1r = _source + ( y * _width * 3 );
13334 unsigned char * pixel1g = _source + ( y * _width * 3 ) + 1;
13335 unsigned char * pixel1b = _source + ( y * _width * 3 ) + 2;
13350 for( y=0; y<_height; ++y ) {
13352 unsigned char * pixel2r = _source + ( y * _width * 3 );
13353 unsigned char * pixel2g = _source + ( y * _width * 3 ) + 1;
13354 unsigned char * pixel2b = _source + ( y * _width * 3 ) + 2;
13356 unsigned char r, g, b;
13362 for( x=0; x<_width-2; ++x ) {
13363 unsigned char * pixel1r = _source + ( y * _width * 3 ) + ( (x+1) * 3 );
13364 unsigned char * pixel1g = _source + ( y * _width * 3 ) + ( (x+1) * 3 ) + 1;
13365 unsigned char * pixel1b = _source + ( y * _width * 3 ) + ( (x+1) * 3 ) + 2;
13366 unsigned char * pixel2r = _source + ( y * _width * 3 ) + ( (x) * 3 );
13367 unsigned char * pixel2g = _source + ( y * _width * 3 ) + ( (x) * 3 ) + 1;
13368 unsigned char * pixel2b = _source + ( y * _width * 3 ) + ( (x) * 3 ) + 2;
13372 *pixel2r = (
unsigned char) *pixel1r;
13373 *pixel2g = (
unsigned char) *pixel1g;
13374 *pixel2b = (
unsigned char) *pixel1b;
13378 unsigned char * pixel1r = _source + ( y * _width * 3 ) + ( (_width-1) * 3 );
13379 unsigned char * pixel1g = _source + ( y * _width * 3 ) + ( (_width-1) * 3 ) + 1;
13380 unsigned char * pixel1b = _source + ( y * _width * 3 ) + ( (_width-1) * 3 ) + 2;
13395 for( x=0; x < _width; ++x ) {
13397 unsigned char * pixel2r = _source + ( ( _height - 1 ) * _width * 3 ) + x * 3;
13398 unsigned char * pixel2g = _source + ( ( _height - 1 ) * _width * 3 ) + x * 3 + 1;
13399 unsigned char * pixel2b = _source + ( ( _height - 1 ) * _width * 3 ) + x * 3 + 2;
13401 unsigned char r, g, b;
13407 for( y=( _height - 2); y > -1; --y ) {
13408 unsigned char * pixel1r = _source + ( y * _width * 3 ) + ( x * 3 );
13409 unsigned char * pixel1g = _source + ( y * _width * 3 ) + ( x * 3 ) + 1;
13410 unsigned char * pixel1b = _source + ( y * _width * 3 ) + ( x * 3 ) + 2;
13411 unsigned char * pixel2r = _source + ( (y+1) * _width * 3 ) + ( x * 3 );
13412 unsigned char * pixel2g = _source + ( (y+1) * _width * 3 ) + ( x * 3 ) + 1;
13413 unsigned char * pixel2b = _source + ( (y+1) * _width * 3 ) + ( x * 3 ) + 2;
13417 *pixel2r = (
unsigned char) *pixel1r;
13418 *pixel2g = (
unsigned char) *pixel1g;
13419 *pixel2b = (
unsigned char) *pixel1b;
13423 unsigned char * pixel1r = _source + x * 3;
13424 unsigned char * pixel1g = _source + x * 3 + 1;
13425 unsigned char * pixel1b = _source + x * 3 + 2;
13440 int size = ( _width + _delta ) * 3 * _height;
13442 memset( destination, 0,
size );
13444 for( y=0; y<_height; ++y ) {
13445 for( x=0; x < _width; ++x ) {
13446 unsigned char * pixel1r = _source + ( y * _width * 3 ) + ( x * 3 );
13447 unsigned char * pixel1g = _source + ( y * _width * 3 ) + ( x * 3 ) + 1;
13448 unsigned char * pixel1b = _source + ( y * _width * 3 ) + ( x * 3 ) + 2;
13449 unsigned char * pixel2r = destination + ( y * ( _width + _delta ) * 3 ) + ( (x+1) * 3 );
13450 unsigned char * pixel2g = destination + ( y * ( _width + _delta ) * 3 ) + ( (x+1) * 3 ) + 1;
13451 unsigned char * pixel2b = destination + ( y * ( _width + _delta ) * 3 ) + ( (x+1) * 3 ) + 2;
13455 *pixel2r = (
unsigned char) *pixel1r;
13456 *pixel2g = (
unsigned char) *pixel1g;
13457 *pixel2b = (
unsigned char) *pixel1b;
13461 return destination;
13469 int size = ( _width ) * 3 * ( _height + _delta);
13471 memset( destination, 0,
size );
13472 memcpy( destination, _source, ( _width ) * 3 * ( _height ) );
13474 return destination;
13480 char * destination =
malloc( _frame_width * _frame_height * _depth );
13481 memset( destination, 0, _frame_width * _frame_height * _depth );
13483 char *
source = _source + _frame_height * _width * _y * _depth + _frame_width * _x * _depth;
13485 char * originalDestination = destination;
13487 while( _frame_height ) {
13488 memcpy( destination,
source, _frame_width * _depth );
13489 source += _width * _depth;
13490 destination += _frame_width * _depth;
13494 return originalDestination;
13507 memcpy( _destination, _source,
sizeof(
RGBi ) );
13525 long rmean = ( (long)_e1->
red + (long)_e2->
red ) / 2;
13526 long r = (long)_e1->
red - (
long)_e2->
red;
13527 long g = (long)_e1->
green - (
long)_e2->
green;
13528 long b = (long)_e1->
blue - (
long)_e2->
blue;
13529 return (
int)( sqrt((((512+rmean)*r*r)>>8) + 4*g*g + (((767-rmean)*b*b)>>8)) );
13533static int rgbi_qsort_compare(
const void * _first,
const void * _second ) {
13541 }
else if ( first->
count > second->
count ) {
13549 }
else if ( first->
alpha < second->
alpha ) {
13572 memset( _palette, 0,
sizeof(
RGBi ) * _palette_size );
13573 for( i=0; i<_palette_size; ++i ) {
13574 _palette[i].
alpha = 255;
13577 int image_x, image_y;
13579 int usedPalette = 0;
13580 unsigned char*
source = _source;
13582 for (image_y = 0; image_y < _height; ++image_y) {
13583 for (image_x = 0; image_x < _width; ++image_x) {
13585 memset( &rgb, 0,
sizeof(
RGBi ) );
13595 if ( rgb.
alpha == 0 ) {
13604 for (i = 0; i < usedPalette; ++i) {
13610 if (i >= usedPalette) {
13613 rgbi_move( &rgb, &_palette[usedPalette] );
13615 if (usedPalette >= (_palette_size-1)) {
13622 ++_palette[i].
count;
13628 if (usedPalette > (_palette_size-1)) {
13643 qsort( _palette, _palette_size,
sizeof(
RGBi ), rgbi_qsort_compare );
13652 return usedPalette;
13657 return (_x > _y) ? _x : _y;
13665 return (_x < _y) ? _x : _y;
13675 memset( temp, 0, 16 );
13680 for( i=0; i<15; ++i ) {
13681 temp[i] =
'a' + ((char) (rand() % 20));
13684 for(i=0; i<strlen(temp); ++i ) {
13685 if ( temp[i] ==
'.' ) {
13693 strcat( temporaryFilename, temp );
13695 strcopy( temporaryFilename, temp );
13698 return strdup( temporaryFilename );
13711 TRACE0(
"system_call" );
13725 TRACE1(
" creating batchfile \"%s\"", batchFileName );
13727 FILE * fh = fopen( batchFileName,
"w+t" );
13728 fprintf( fh,
"@echo off\n%s\n", _commandline );
13731 TRACE1(
" content \"%s\"", _commandline );
13741 sprintf( batchFileName2,
"%s /C \"%s\"", _environment->
cmdFileName, batchFileName );
13743 sprintf( batchFileName2,
"%s\\cmd.exe /C \"%s\"", systemDirectoryPath, batchFileName );
13748 int result = system( batchFileName2 );
13752 TRACE1(
" removing \"%s\"", batchFileName );
13754 remove( batchFileName );
13758 TRACE1(
" result = %d", result );
13770 TRACE1(
" executing %s", _commandline );
13772 int result = system( _commandline );
13776 TRACE1(
" result = %d", result );
13786 TRACE1(
"system_remove_safe( ..., %s)", _filename );
13788 FILE * f = fopen( _filename,
"rb" );
13791 if ( remove( _filename ) != 0 ) {
13802 memset( result, 0, 6 * _size + 2 );
13804 char * p = _string, * q = result;
13807 if ( *p ==
'\n' || *p ==
'\r' ) {
13808 if ( (q-result) > 2 && ( *(q-1) ==
'"') && ( *(q-2) ==
',') ) {
13825 }
else if ( *p < 31 ) {
13826 if ( (q-result) > 2 && ( *(q-1) ==
'"') && ( *(q-2) ==
',') ) {
13836 *q = ( ( (*p & 0xf0) >> 4 ) < 10 ) ? ( ( (*p & 0xf0) >> 4 ) +
'0' ) : ( ( ( (*p & 0xf0) >> 4 ) - 10 ) +
'a' );
13838 *q = ( ( (*p & 0x0f) ) < 10 ) ? ( ( (*p & 0x0f) ) +
'0' ) : ( ( ( (*p & 0x0f) ) - 10 ) +
'a' );
13845 }
else if ( *p ==
'"' ) {
13846 if ( (q-result) > 2 && ( *(q-1) ==
'"') && ( *(q-2) ==
',') ) {
13863 }
else if ( *p ==
'\\' ) {
13864 if ( (q-result) > 2 && ( *(q-1) ==
'"') && ( *(q-2) ==
',') ) {
13889 if ( strlen( result ) > 1 ) {
13890 if ( ( *result ==
'"' ) && ( *(result+1) ==
',' ) ) {
13891 memmove( result, result+2, strlen( result ) - 2 );
13893 *(result+strlen( result ) - 2) = 0;
13897 if ( strlen( result ) > 2 ) {
13898 if ( ( *(result+strlen( result )-1) ==
'"' ) && ( *(result+strlen( result )-2) ==
',' ) ) {
13899 *(result+strlen( result )-2 ) = 0;
13905 int close_escaped = 0;
13908 close_escaped = ! close_escaped;
13916 sprintf( result2,
"\"%s", result );
13917 close_escaped = ! close_escaped;
13923 if ( close_escaped ) {
13924 sprintf( result2,
"%s\"", result );
13944 if ( strchr( _filename,
':' ) ) {
13948 if ( strchr( _filename,
'\\' ) ) {
13966 memset( palette, 0, _size *
sizeof(
RGBi) );
13987 for ( i=0; i<_source_size; ++i ) {
13989 unsigned int minDistance = 0xffff;
13991 for( j=0; j<_system_size; ++j ) {
13992 if ( _source[i].alpha < 255 ) {
13993 if (
rgbi_equals_rgb( &_source[i], &_system[j] ) && _system[j].alpha == 0 ) {
13995 rgbi_move( &_system[j], &matchedPalette[i] );
13998 if ( _system[j].alpha < 255 ) {
14003 rgbi_move( &_system[j], &matchedPalette[i] );
14011 return matchedPalette;
14021 for ( i=0; i<_source_size; ++i ) {
14023 unsigned int minDistance = 0xffff;
14025 for( j=0; j<_system_size; ++j ) {
14030 rgbi_move( &_source[i], &matchedPalette[i] );
14040 return matchedPalette;
14059 for ( i=0; i<_source_size; ++i ) {
14061 if ( _source[i].hardwareIndex == 0xff ) {
14066 for( j=0; j<*_unique_size; ++j ) {
14081 if ( j >= *_unique_size ) {
14083 rgbi_move( &_source[i], &uniquePalette[*_unique_size]);
14085 if ( *_unique_size > _source_size ) {
14092 return uniquePalette;
14111 for ( i=0; i<_source_size; ++i ) {
14112 rgbi_move( &_source[i], &reorderedPalette[i] );
14115 for ( i=0; i<_source_size; ++i ) {
14116 if ( _source[i].hardwareIndex == _index ) {
14121 if ( i <_source_size ) {
14123 rgbi_move( &reorderedPalette[i], &tmp );
14124 rgbi_move( &reorderedPalette[0], &reorderedPalette[i] );
14125 rgbi_move( &tmp, &reorderedPalette[0] );
14128 return reorderedPalette;
14147 for ( i=0; i<_source_size; ++i ) {
14148 rgbi_move( &_source[i], &reorderedPalette[i] );
14150 for ( i=_source_size; i<_max_size; ++i ) {
14151 rgbi_move( &_source[0], &reorderedPalette[i] );
14152 reorderedPalette[i].
index = 0xff;
14156 for ( i=0; i<_source_size; ++i ) {
14157 if ( _source[i].hardwareIndex == _index ) {
14162 if ( i <_source_size ) {
14164 rgbi_move( &reorderedPalette[i], &tmp );
14167 rgbi_move( &tmp, &reorderedPalette[(_max_size-1)] );
14168 reorderedPalette[(_max_size-1)].alpha = 0xff;
14171 return reorderedPalette;
14187 if ( _offset == 0 ) {
14193 unsigned char * dest = (
unsigned char *)shiftedPalette;
14194 unsigned char *
source = (
unsigned char *)_source;
14196 if ( _offset > 0 ) {
14197 memmove( dest + ( _offset *
sizeof(
RGBi ) ),
source, _source_size *
sizeof(
RGBi ) );
14198 }
else if ( _offset < 0 ) {
14199 memmove( shiftedPalette, _source - ( _offset *
sizeof(
RGBi ) ), _source_size *
sizeof(
RGBi ) );
14202 return shiftedPalette;
14223 for ( i=0; i<_palette1_size; ++i ) {
14224 if ( _palette1[i].hardwareIndex == 0xff )
continue;
14225 if ( _palette1[i].alpha < 255 ) {
14226 rgbi_move( &_palette1[i], &mergedPalette[*_size] );
14231 for ( i=0; i<_palette2_size; ++i ) {
14232 if ( _palette2[i].hardwareIndex == 0xff )
continue;
14233 if ( _palette2[i].alpha < 255 ) {
14235 for(
int k=0; k<*_size; ++k ) {
14240 if ( k >= *_size ) {
14241 rgbi_move( &_palette2[i], &mergedPalette[*_size] );
14247 for ( i=0; i<_palette1_size; ++i ) {
14248 if ( _palette1[i].hardwareIndex == 0xff )
continue;
14249 if ( _palette1[i].alpha < 255 )
continue;
14250 for( j=0; j<*_size; ++j ) {
14255 if ( j >= *_size ) {
14256 rgbi_move( &_palette1[i], &mergedPalette[*_size] );
14261 for ( i=0; i<_palette2_size; ++i ) {
14262 if ( _palette2[i].hardwareIndex == 0xff )
continue;
14263 if ( _palette2[i].alpha < 255 )
continue;
14264 for( j=0; j<*_size; ++j ) {
14269 if ( j >= *_size ) {
14270 rgbi_move( &_palette2[i], &mergedPalette[*_size] );
14275 return mergedPalette;
14281 if ( ! *_buffer ) {
14284 if ( *_buffer ==
'\r' || *_buffer ==
'\n' ) {
14287 while( * _buffer ) {
14288 if ( *_buffer ==
' ' || *_buffer ==
'\t' ) {
14290 }
else if ( *_buffer ==
';' ) {
14301 char * target = strdup( _string );
14316 char * target = strdup( _path );
14318 char * p = strrchr( target,
'/' );
14321 p = strrchr( target,
'\\' );
14344 if ( !_is_relative ) {
14366 if ( _is_relative ) {
14413 if ( !_is_relative ) {
14435 if ( _is_relative ) {
14476 char * data = NULL;
int dataSize = 0;
14480 if ( _embedded_present ) {
14520 if ( ! strchr( _address,
'+' ) ) {
14521 if ( atoi(_displacement) ) {
14522 sprintf( addressed,
"%s+%d", _address, atoi(_displacement) );
14524 sprintf( addressed,
"%s", _address );
14527 char * duplicated = strdup( _address );
14528 char * p = strtok( duplicated,
"+");
14529 char * q = strtok ( NULL,
"+" );
14530 if ( atoi(q) + atoi(_displacement) ) {
14531 sprintf( addressed,
"%s+%d", p, atoi(q) + atoi(_displacement) );
14533 sprintf( addressed,
"%s", p );
14537 return strdup( addressed );
14549 if ( !_tileset->
tiles ) {
14553 TsxTile * collectedTiles = NULL;
14558 if ( strcmp( actual->
type, _description ) == 0 ) {
14561 memcpy( duplicatedTile, actual,
sizeof(
TsxTile ) );
14562 duplicatedTile->
next = NULL;
14563 if ( collectedTiles ) {
14564 duplicatedTile->
next = collectedTiles;
14565 collectedTiles = duplicatedTile;
14567 collectedTiles = duplicatedTile;
14570 actual = actual->
next;
14573 if ( !collectedTiles ) {
14577 double totalProbability = 0.0f;
14579 actual = collectedTiles;
14584 actual = actual->
next;
14587 if ( totalProbability <= 0 ) {
14591 float r = ( (float) rand() ) / ( (
float) (RAND_MAX/totalProbability) );
14593 totalProbability = 0.0f;
14595 actual = collectedTiles;
14598 if ( r < actual->probability ) {
14601 actual = actual->
next;
14618 if ( !_tileset->
tiles ) {
14622 TsxTile * collectedTiles = NULL;
14627 if ( actual->
type ) {
14628 if ( strcmp( actual->
type, _description ) == 0 ) {
14632 actual = actual->
next;
14729 if ( strlen( _value ) > 255 ) {
14735 while ( current ) {
14736 if ( strcmp( current->
value, _value ) == 0 ) {
14739 current = current->
next;
14749 _environment->
strings = current;
14811 if ( _number < 0 ) {
14812 if ( (-_number) > (0x7fff) ) {
14814 }
else if ( (-_number) > (0x7f) ) {
14820 if ( _number > (0xffff) ) {
14822 }
else if ( _number > (0xff) ) {
14829 if (
abs(_number) > (0x7fff) ) {
14831 }
else if (
abs(_number) > (0x7f) ) {
14844 if (
abs(_number) > 0x7fff ) {
14855 if (
abs(_number) > 0x7fff ) {
14861 }
else if (
abs(_number) > 0x7f ) {
14905 data->name = strdup( _name );
14906 data->realName =
malloc( strlen( _name ) + 6 );
14908 strcopy( data->realName,
"DATA_" );
14909 strcat( data->realName, data->name );
14915 while( first->
next ) {
14916 first = first->
next;
14918 first->
next = data;
14929 data->lineNumber = _number;
14930 data->isNumeric = 1;
14933 sprintf( data->realName,
"DATA_%4.4x", _number );
14939 while( first->
next ) {
14940 first = first->
next;
14942 first->
next = data;
14953 if ( !first->
isNumeric && strcmp( first->
name, _name ) == 0 ) {
14956 first = first->
next;
14970 first = first->
next;
15001static void buffered_realloc(
Environment * _environment,
const char * _ptr,
int _size ) {
15014 va_start( args, _format );
15016 vsprintf( temporaryBuffer, _format, args );
15017 buffered_realloc( _environment, temporaryBuffer, strlen( temporaryBuffer ) );
15023 buffered_realloc( _environment, _string, strlen( _string ) );
15028 buffered_realloc( _environment, _data, _size * _count );
15076 memset( resource, 0,
sizeof(
Resource ) );
15092 }
else if ( _frame ) {
15158 char * result = NULL;
15170 GetTempPathA( len, result );
15174 if ( result[strlen(result)-1] ==
'\\' || result[strlen(result)-1] ==
'/' ) {
15175 result[strlen(result)-1] = 0;
15184 char * tmp = getenv(
"TMPDIR" );
15186 tmp = getenv(
"TMP" );
15189 tmp = getenv(
"TEMP" );
15192 tmp = getenv(
"TEMPDIR" );
15195 tmp = strdup(
"/tmp" );
15198 result = strdup( tmp );
15208 char * basePath = strrchr( _path,
'/' );
15211 basePath = strrchr( _path,
'\\' );
15231 int currentSize = v->
size;
15235 v->
size = currentSize;
15239 if ( ! fileStorage ) {
15243 if ( v->
size < fileStorage->
size ) {
15265 sprintf( filename,
"%s%2.2d.%s", _prefix, _number, _suffix );
15267 return strdup( filename );
15273 FILE * lookedFileHandle = fopen( _filename,
"rb" );
15274 fseek( lookedFileHandle, 0, SEEK_END );
15275 int fileSize = ftell( lookedFileHandle );
15276 fclose( lookedFileHandle );
15290 switch( string->
type ) {
15320 cpu_jump( _environment, finishedLabel );
15326 cpu_label( _environment, finishedLabel );
15409 switch(
source->type ) {
15435 return color->name;
15442static int show_troubleshooting_accessing_path(
Environment * _environment,
char * _path,
int _mode,
int _create,
int _show ) {
15447 FILE * fh = fopen( _path,
"wt" );
15448 fprintf( fh,
"test" );
15452 if ( ( _mode & R_OK ) && access( _path, R_OK ) ) {
15454 printf(
"#####> It cannot be read: %s\n", strerror(errno));
15458 if ( ( _mode & W_OK ) && access( _path, W_OK ) ) {
15460 printf(
"#####> It cannot be write: %s\n", strerror(errno));
15464 if ( ( _mode & X_OK ) && access( _path, X_OK ) ) {
15466 printf(
"#####> It cannot be executed: %s\n", strerror(errno));
15470 if ( ( _mode & F_OK ) && access( _path, F_OK ) ) {
15472 printf(
"#####> It does not exist: %s\n", strerror(errno));
15485static int show_troubleshooting_try_exec(
Environment * _environment,
char * _path,
int _show ) {
15487 char mutedExecutable[2*
MAX_TEMPORARY_STORAGE]; sprintf( mutedExecutable,
"%s >/dev/null 2>/dev/null", _path );
15491 if ( system( mutedExecutable ) < 0 ) {
15493 printf(
"#####> It cannot be executed: %s\n", strerror(errno));
15506 printf(
"========================\n");
15507 printf(
"=== TROUBLE SHOOTING ===\n");
15508 printf(
"========================\n\n");
15510 printf(
"Below you will find a brief analysis of the execution environment of\n" );
15511 printf(
"the following compiler: \"%s\".\n", _argv[0] );
15512 printf(
"For each entry, the outcome of a brief testing is reported, where the possible\n" );
15513 printf(
"cause is also indicated. Please follow the preliminary indications contained\n" );
15514 printf(
"here and, in case you are not successful in producing an assembly listing or\n" );
15515 printf(
"an executable / binary file, please contact the author via GitHub here:\n" );
15516 printf(
"https://github.com/spotlessmind1975/ugbasic/issues/new\n\n" );
15523 check = GetSystemDirectoryA( systemDirectoryPath, check );
15524 systemDirectoryPath[check] = 0;
15525 printf(
"[PA0] SYSTEM DIRECTORY PATH = \"%s\" (%d)\n", systemDirectoryPath, check );
15527 printf(
"[PA0] SYSTEM DIRECTORY PATH: (unable to retrieve)\n" );
15528 printf(
"##### An error occurred while the program tried to \n" );
15529 printf(
"##### retrieve the name of the system directory: %d\n", GetLastError( ) );
15533 sprintf( systemDirectoryCmdPath,
"%s\\cmd.exe", systemDirectoryPath );
15534 printf(
"[PA1] FULL NAME FOR CMD.EXE = \"%s\"\n", systemDirectoryCmdPath );
15535 check = show_troubleshooting_accessing_path( _environment, systemDirectoryCmdPath, R_OK, 0, 1 );
15536 if ( (check & R_OK) ) {
15537 printf(
"##### The cmd.exe program seems not to exists. \n" );
15543 check = GetEnvironmentVariable(
"Path", systemPath, check );
15544 systemPath[check] = 0;
15545 printf(
"[PA2] ENVIRONMENT PATH = \"%s\" (%d)\n", systemPath, check );
15547 printf(
"[PA2] ENVIRONMENT PATH: (unable to retrieve)\n" );
15548 printf(
"##### An error occurred while the program tried to \n" );
15549 printf(
"##### retrieve the variable Path: %d\n", GetLastError( ) );
15552 printf(
"[PA3] IS CMD.EXE IN PATH?\n" );
15553 int checkComplete = 0;
15554 char * t = strtok( systemPath,
";");
15557 sprintf( systemFileName,
"%s\\cmd.exe", t );
15558 check = show_troubleshooting_accessing_path( _environment, systemFileName, R_OK, 0, 0 );
15559 if ( !(check & R_OK) ) {
15560 printf(
"[PA4] IS CMD.EXE IN PATH \"%s\"\n", systemFileName );
15563 t = strtok( NULL,
";" );
15566 if ( !checkComplete ) {
15567 printf(
"##### The cmd.exe does not seem to be present or reachable\n" );
15568 printf(
"##### inside the system Path.\n" );
15571 printf(
"[PA5] CMD.EXE REPLACEMENT: %s\n", ( _environment->
cmdFileName ) ? _environment->
cmdFileName :
"(no replacement)" );
15572 printf(
"[PA6] IS (REPLACEMENT) COMMAND CMD.EXE EXECUTABLE? " );
15576 int cmdEsito = system(
"cmd.exe /C" );
15585 switch( cmdEsito ) {
15593 printf(
"\n##### It is like some error prevents the cmd.exe \n" );
15594 printf(
"##### from executing after the child process is created.\n" );
15601 printf(
"\n##### It is like the cmd.exe cannot be created, or if the\n" );
15602 printf(
"##### termination status for the cmd.exe\n" );
15603 printf(
"##### cannot be obtained (errno = %d).\n\n", errno );
15604 perror(
"##### Error from execution:");
15608 printf(
"yes, it is.\n");
15612 printf(
"\n##### It is like some error occurrend in execution of cmd.exe (%d).\n\n", cmdEsito );
15636 char * tmp = getenv(
"TMPDIR" );
15638 tmp = getenv(
"TMP" );
15641 tmp = getenv(
"TEMP" );
15644 tmp = getenv(
"TEMPDIR" );
15647 tmp = strdup(
"/tmp" );
15655 printf(
"[P01] TEMPORARY PATH : \"%s\"\n",
temporaryPath );
15657 printf(
"[P01] TEMPORARY PATH : (unable to retrieve)\n" );
15658 printf(
"##### An error occurred while the program tried to \n" );
15659 printf(
"##### retrieve the path of the temporary directory.\n" );
15662 check = show_troubleshooting_accessing_path( _environment,
temporaryPath, R_OK | W_OK, 0, 1 );
15664 if ( (check & R_OK) | (check & W_OK) | (check & X_OK) ) {
15665 printf(
"##### There is a problem in accessing the temporary path. Please, check the above\n" );
15666 printf(
"##### path, or use the '-T' parameter to set it in an explicit way.\n\n" );
15671 printf(
"[P02] TEMPORARY FILENAME : \"%s\"\n", temporaryFileName );
15672 check = show_troubleshooting_accessing_path( _environment, temporaryFileName, R_OK | W_OK | F_OK, 1, 1 );
15674 if ( (check & R_OK) | (check & W_OK) | (check & F_OK) ) {
15675 printf(
"##### There is a problem in creating a temporary file. Please, check the above\n" );
15676 printf(
"##### path, or use the '-T' parameter to set a different temporary path.\n\n" );
15681 printf(
"[P03] WORKING DIRECTORY: \"%s\"\n", workingDirectory );
15682 check = show_troubleshooting_accessing_path( _environment, workingDirectory, R_OK | W_OK | F_OK, 0, 1 );
15684 if ( (check & R_OK) | (check & W_OK) | (check & F_OK) ) {
15685 printf(
"##### There is a problem in accessing the current (working) directory.\n" );
15686 printf(
"##### Please, check the permissions or use an explicit path with '-o'\n" );
15687 printf(
"##### option, otherwise the binary file cannot be created.\n" );
15690#if defined(cpu6809)||defined(cpu6309)
15694 printf(
"[P04] EXECUTABLE NAME FOR ASM6809: \"%s\"\n", executableName );
15695 check = show_troubleshooting_try_exec( _environment, executableName, 1 );
15697 printf(
"##### The assembler for the 6809 processor does not appear to be present\n" );
15698 printf(
"##### or executable. Please check the path or specify it using the \n" );
15699 printf(
"##### '-C' option.\n" );
15709 printf(
"[P05] ASSEMBLY EXAMPLE (on temp path): \"%s\"\n",
asmFileName );
15710 check = show_troubleshooting_accessing_path( _environment,
asmFileName, W_OK, 1, 1 );
15711 if ( (check & W_OK) ) {
15712 printf(
"##### The sample assembly file cannot be created. This could be related \n" );
15713 printf(
"##### to any temporary path problem, so check the previous messages. \n" );
15718 fprintf( fh,
"TEST\n JMP TEST\n" );
15724 printf(
"[P06] BINARY EXAMPLE (on temp path): \"%s\"\n", binaryFileName );
15725 check = show_troubleshooting_accessing_path( _environment, binaryFileName, W_OK, 1, 1 );
15726 if ( (check & W_OK) ) {
15727 printf(
"##### The sample binary file cannot be created. This could be related \n" );
15728 printf(
"##### to any temporary path problem, so check the previous messages. \n" );
15733 printf(
"[P07] AUXILIARY BATCH FILE: \"%s\"\n", batchFileName );
15734 check = show_troubleshooting_accessing_path( _environment, batchFileName, W_OK | X_OK, 1, 1 );
15735 if ( (check & W_OK) || (check & X_OK)) {
15736 printf(
"##### The auxiliary batch file cannot be created or executed. This could be related \n" );
15737 printf(
"##### to any temporary path problem, so check the previous messages. Anyway, if the\n" );
15738 printf(
"##### file cannot be executed, the binary / disk image cannot be built.\n" );
15741 fh = fopen( batchFileName,
"w+t" );
15743 fprintf( fh,
"@echo off\n\"%s\" -o \"%s\" \"%s\"\n", executableName, binaryFileName,
asmFileName );
15748 sprintf( batchFileName2,
"%s\\cmd.exe /C \"%s\"", systemDirectoryPath, batchFileName );
15749 printf(
"[P08] BATCH LAUNCHER COMMAND LINE: %s\n", batchFileName2 );
15753 int esito = system( batchFileName2 );
15770 printf(
"##### It is like some error prevents the command language interpreter \n" );
15771 printf(
"##### from executing after the child process is created.\n" );
15778 printf(
"##### It is like the child process cannot be created, or if the\n" );
15779 printf(
"##### termination status for the command language interpreter\n" );
15780 printf(
"##### cannot be obtained (errno = %d).\n\n", errno );
15781 perror(
"##### Error from execution:");
15788 printf(
"##### It is like some error occurrend in execution.\n\n" );
15802 TRACE2(
"system_move_safe( ..., %s, %s)", _source, _destination );
15804 if ( strcmp( _source, _destination ) != 0 ) {
15806 FILE * fi = fopen( _source,
"rb" );
15810 FILE * fo = fopen( _destination,
"wb" );
15815 fseek( fi, 0, SEEK_END );
15816 long size = ftell( fi );
15817 fseek( fi, 0, SEEK_SET );
15821 memset( content, 0,
size );
15822 if ( ! fread( content, 1,
size, fi ) ) {
15825 if ( ! fwrite(content, 1,
size, fo ) ) {
15846 current = current->
next;
15847 if ( strcmp( _name, current->
name ) ) {
15859 while (*_x !=
'\0' && !equal) {
15860 if ((*_x == *_y) ) {
15863 const char *cX = _x, *cY = _y;
15865 while (*cX && *cY && !
done) {
15866 if (tolower(*cX) != tolower(*cY)) {
15874 equal = (*cY ==
'\0');
15879 return (*_x ==
'\0') ? NULL : _x;
15882const char *
strrstr(
const char *haystack,
const char *needle)
15884 if (*needle ==
'\0')
15885 return (
char *) haystack;
15887 char *result = NULL;
15889 char *p = strstr(haystack, needle);
15917 return abs(_value) <= 0x7f;
15919 return abs(_value) <= 0x7fff;
15921 return abs(_value) <= 0x7fffffff;
15928 return _value <= 0xff;
15930 return _value <= 0xffff;
15932 return _value <= 0xffffffff;
15942 FILE * handle = fopen( _filename,
"rt" );
15950 while( !feof( handle ) ) {
15954 int p=0, j=0, cmt=0;
15956 while( !feof( handle ) ) {
15957 char c = fgetc(handle);
15959 if ( c == 13 || c == 10 ) {
15965 if ( c ==
'\'' && !cmt ) {
15969 if ( (c <
'0') || (c >
'9') ) {
15974 if ( (c <
'0') || (c >
'9') ) {
15978 valueString[p] = c;
15982 if ( ! cmt && p ) {
15985 memset( current, 0,
sizeof(
Constant ) );
15990 current = current->
next;
15992 current->
value = atoi( valueString );
16002 int bytes = 1 << os;
16012 current = current->
next;
16024 char * buffer =
malloc( *_size );
16025 char * ptr = buffer;
16026 char * lastPtr = buffer;
16035 *ptr = (current->
value) & 0xff;
16039 #ifdef CPU_BIG_ENDIAN
16040 *ptr = ( current->
value >> 8 ) & 0xff;
16041 *(ptr+1) = ( current->
value ) & 0xff;
16043 *(ptr+1) = ( current->
value >> 8 ) & 0xff;
16044 *ptr = ( current->
value ) & 0xff;
16049 #ifdef CPU_BIG_ENDIAN
16050 *ptr = ( current->
value >> 24 ) & 0xff;
16051 *(ptr+1) = ( current->
value >> 16 ) & 0xff;
16052 *(ptr+2) = ( current->
value >> 8 ) & 0xff;
16053 *(ptr+3) = ( current->
value ) & 0xff;
16055 *(ptr+3) = ( current->
value >> 24 ) & 0xff;
16056 *(ptr+2) = ( current->
value >> 16 ) & 0xff;
16057 *(ptr+1) = ( current->
value >> 8 ) & 0xff;
16058 *ptr = ( current->
value ) & 0xff;
16064 current = current->
next;
16083 first = first->
next;
16086 char * buffer =
malloc( *_size ), * ptr = buffer;
16092 *ptr = (current->
value) & 0xff;
16096 #ifdef CPU_BIG_ENDIAN
16097 *ptr = ( current->
value >> 8 ) & 0xff;
16098 *(ptr+1) = ( current->
value ) & 0xff;
16100 *(ptr+1) = ( current->
value >> 8 ) & 0xff;
16101 *ptr = ( current->
value ) & 0xff;
16106 #ifdef CPU_BIG_ENDIAN
16107 *ptr = ( current->
value >> 24 ) & 0xff;
16108 *(ptr+1) = ( current->
value >> 16 ) & 0xff;
16109 *(ptr+2) = ( current->
value >> 8 ) & 0xff;
16110 *(ptr+3) = ( current->
value ) & 0xff;
16112 *(ptr+3) = ( current->
value >> 24 ) & 0xff;
16113 *(ptr+2) = ( current->
value >> 16 ) & 0xff;
16114 *(ptr+1) = ( current->
value >> 8 ) & 0xff;
16115 *ptr = ( current->
value ) & 0xff;
16120 current = current->
next;
16131 Type * current = _first;
16134 if ( strcmp( current->
name, _name ) == 0 ) {
16137 current = current->
next;
16149 if ( strcmp( current->
name, _name ) == 0 ) {
16152 current = current->
next;
16210 sprintf( offsetAsString,
"%d", field->
offset );
16223 switch( field->
type ) {
16257 sprintf( offsetAsString,
"%d", field->
offset );
16270 switch( field->
type ) {
16336 switch( field->
type ) {
16372 switch( field->
type ) {
16415 if ( array->arrayType !=
VT_TYPE ) {
16418 if ( !array->typeType ) {
16447 if ( array->arrayType !=
VT_TYPE ) {
16450 if ( !array->typeType ) {
16464 Variable *
offset = calculate_offset_in_array( _environment, array->name);
16470 if ( array->bankAssigned == -1 ) {
16486 switch( field->
type ) {
16521 switch( field->
type ) {
16555 if ( array->arrayType !=
VT_TYPE ) {
16558 if ( !array->typeType ) {
16566 if ( array->arrayDimensions != 1 ) {
16579 if ( array->bankAssigned == -1 ) {
16595 switch( field->
type ) {
16630 switch( field->
type ) {
16664 if ( array->arrayType !=
VT_TYPE ) {
16667 if ( !array->typeType ) {
16675 if ( array->arrayDimensions != 1 ) {
16736 switch( field->
type ) {
16771 switch( field->
type ) {
16819 if ( field1->
type != field2->
type ) {
16855 switch( field1->
type ) {
16896 switch( field1->
type ) {
16989static void variable_increment_decrement_array_type(
Environment * _environment,
char * _source,
char * _field,
int _direction ) {
17003 if ( !
source->typeType ) {
17011 Variable *
offset = variable_move_from_array_get_address( _environment, _source, _field );
17015 if (
source->bankAssigned == -1 ) {
17059 if ( _direction > 0 ) {
17061 }
else if ( _direction < 0 ) {
17065 if (
source->bankAssigned == -1 ) {
17106 variable_increment_decrement_array_type( _environment, _source, _field, 1 );
17110 variable_increment_decrement_array_type( _environment, _source, _field, -1 );
17114 variable_increment_decrement_array( _environment, _source, 1 );
17118 variable_increment_decrement_array( _environment, _source, -1 );
17123 if ( _dest == NULL || _source == NULL) {
17127 memmove( _dest, _source, strlen(_source) + 1);
17133char *
strreplace(
const char * _orig,
const char * _rep,
const char * _with) {
17145 if (!_orig || !_rep)
17147 len_rep = strlen(_rep);
17152 len_with = strlen(_with);
17156 for (count = 0; (tmp = strstr(cins, _rep)); ++count) {
17157 cins = tmp + len_rep;
17160 tmp = result =
malloc(strlen(_orig) + (len_with - len_rep) * count + 1);
17171 ins = strstr(_orig, _rep);
17172 len_front = ins - _orig;
17173 tmp = strncpy(tmp, _orig, len_front) + len_front;
17174 tmp = strcpy(tmp, _with) + len_with;
17175 _orig += len_front + len_rep;
17177 strcpy(tmp, _orig);
17187 if ( !actual->
name ) {
17191 if ( actual->
name ) {
17192 if ( strcmp( actual->
name, _name ) == 0 ) {
17197 actual = actual->
next;
17207 if ( _import_path ) {
17208 sprintf(importDeclaresFilename,
"%s/%s.bas", _import_path,
targetName);
17210 sprintf(importDeclaresFilename,
"../../imports/%s.bas",
targetName);
17211 if( access( importDeclaresFilename, F_OK ) != 0 ) {
17212 sprintf(importDeclaresFilename,
"../imports/%s.bas",
targetName);
17214 if( access( importDeclaresFilename, F_OK ) != 0 ) {
17215 sprintf(importDeclaresFilename,
"imports/%s.bas",
targetName);
17217 if( access( importDeclaresFilename, F_OK ) != 0 ) {
17222 return importDeclaresFilename;
17230 if ( memcmp( actual->
value, _value, _size ) == 0 ) {
17233 actual = actual->
next;
17244 memset( result->
value, _value, _size );
17245 result->
size = _size;
17248 if ( storedStaticString ) {
17249 return storedStaticString;
17252 _environment->
strings = result;
17263 memcpy( result->
value, _value, _size );
17264 result->
size = _size;
17266 if ( storedStaticString ) {
17267 return storedStaticString;
17270 _environment->
strings = result;
17286 return environment;
17319 #if defined(__pc128op__) || defined(__to8__)
17323 #if defined(__atari__) || defined(__atarixl__)
17325 #elif defined(__c64__) || defined(__plus4__) || defined(__c16__) || defined(__vic20__) || defined(__c128__) || defined(__c128z__)
17327 #elif defined(__zx__)
17329 #elif defined(__coco__) || defined(__cocob__) || defined(__coco3__) || defined(__coco3b__)
17331 #elif defined(__d32__) || defined(__d32b__) || defined(__d64__) || defined(__d64b__)
17333 #elif defined(__pc128op__) || defined(__to8__) || defined(__mo5__)
17335 #elif defined(__msx1__) || defined(__coleco__) || defined(__sc3000__) || defined(__sg1000__)
17337 #elif defined(__gb__)
17339 #elif defined(__pccga__)
17341 #elif defined(__cpc__)
17343 #elif defined(__vg5000__)
17345 #elif defined(__c64reu__)
17347 #elif defined(__pc1403__)
17349 #elif defined(__vz__)
17369 while ((opt = getopt(_argc, _argv,
"@1a:A:b:B:c:C:dD:Ee:Ffg:G:Ii:l:L:o:O:p:P:q:rR:st:T:VvWw:X:y")) != -1) {
17388 if ( strcmp( optarg,
"UGBASIC" ) ) {
17390 }
else if ( strcmp( optarg,
"TSB" ) ) {
17393 CRITICAL(
"Option '-B': unknown dialect.");
17399 CRITICAL(
"Option '-C': compiler not found.");
17404 if( access( _environment->
cmdFileName, F_OK ) != 0 ) {
17405 CRITICAL(
"Option '-w': replaced cmd.exe not found.");
17410 if( access( _environment->
decbFileName, F_OK ) != 0 ) {
17411 CRITICAL(
"Option '-b': decb application not found.");
17417 CRITICAL(
"Option '-X': executer not found.");
17432 CRITICAL(
"Option '-A': app maker no found.");
17439 #if defined(__atari__) || defined(__atarixl__)
17442 CRITICAL(
"Option '-t': dir2atr not found.");
17445 #if defined(__msx1__)
17448 CRITICAL(
"Option '-t': dsktools tool not found.");
17451 #if defined(__pc1403__)
17454 CRITICAL(
"Option '-t': aslink tool not found.");
17473 if ( strcmp( optarg,
"none") == 0 || atoi( optarg ) == 0 ) {
17475 }
else if ( strcmp( optarg,
"type1") == 0 || atoi( optarg ) == 1 ) {
17477 }
else if ( strcmp( optarg,
"type2") == 0 || atoi( optarg ) == 2 ) {
17482 if ( strcmp( optarg,
"bin") == 0 ) {
17484 }
else if ( strcmp( optarg,
"prg") == 0 ) {
17486 }
else if ( strcmp( optarg,
"xex") == 0 ) {
17488 }
else if ( strcmp( optarg,
"k7o") == 0 ) {
17490 }
else if ( strcmp( optarg,
"k7") == 0 ) {
17492 }
else if ( strcmp( optarg,
"tap") == 0 ) {
17494 }
else if ( strcmp( optarg,
"rom") == 0 ) {
17496 }
else if ( strcmp( optarg,
"com") == 0 ) {
17498 }
else if ( strcmp( optarg,
"d64") == 0 ) {
17500 }
else if ( strcmp( optarg,
"gb") == 0 ) {
17502 }
else if ( strcmp( optarg,
"ram") == 0 ) {
17504 }
else if ( strcmp( optarg,
"dsk") == 0 ) {
17506 }
else if ( strcmp( optarg,
"atr") == 0 ) {
17508 }
else if ( strcmp( optarg,
"reu") == 0 ) {
17510 }
else if ( strcmp( optarg,
"vz") == 0 ) {
17512 }
else if ( strcmp( optarg,
"sddrive") == 0 ) {
17515 CRITICAL2(
"Unknown output format", optarg);
17523 char * q = strrchr( p,
'.' );
17534 CRITICAL(
"Option '-I' has been removed, see bug#641" );
17549 _environment->
ramSize = atoi(optarg);
17565 char * p = strtok(optarg,
",");
17567 if ( strcmp(p,
"CLS_IMPLICIT" ) == 0 ) {
17570 if ( strstr(p,
"STRING_COUNT=" ) != NULL ) {
17573 if ( strstr(p,
"STRING_SPACE=" ) != NULL ) {
17576 p = strtok(NULL,
",");
17581 char * p = strtok(optarg,
",");
17728 p = strtok(NULL,
",");
17738 if ( ! _argv[optind] ) {
17742 if ( ! _argv[optind+1] && !_environment->
exeFileName ) {
17773 if ( strstr( _environment->
sourceFileName,
"btd-10liner") != NULL ) {
17780 if ( strstr( _environment->
sourceFileName,
"cocon.bas") != NULL ) {
17788 if ( strstr( _environment->
sourceFileName,
"pick-the-star-10liner") != NULL ) {
17795 if ( strstr( _environment->
sourceFileName,
"4gravity") != NULL ) {
17803 if ( strstr( _environment->
sourceFileName,
"falling-balls") != NULL ) {
17810 if ( strstr( _environment->
sourceFileName,
"ccarrots") != NULL ) {
void cpu_and_32bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_move_32bit_indirect2(Environment *_environment, char *_value, char *_source)
void cpu_dsfree(Environment *_environment, char *_index)
void cpu_less_than_memory_size(Environment *_environment, char *_source, char *_destination, int _size, char *_result, int _equal)
void cpu_dsresize_size(Environment *_environment, char *_index, int _resize)
void cpu_hex_to_string_calc_string(Environment *_environment, char *_size, int _separator, char *_string_size)
void cpu_move_8bit_signed_32bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_float_fast_from_8(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_hex_to_string_calc_string_size(Environment *_environment, int _size, int _separator, char *_string_size)
void cpu_pokew(Environment *_environment, char *_address, char *_source)
void cpu_move_32bit_signed_16bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_combine_nibbles(Environment *_environment, char *_low_nibble, char *_hi_nibble, char *_byte)
void cpu_di(Environment *_environment)
void cpu_math_double_32bit(Environment *_environment, char *_source, char *_other, int _signed)
CPU 6309: emit code to double a 32 bit value
void cpu_not_16bit(Environment *_environment, char *_value, char *_result)
void cpu_move_8bit_unsigned_32bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_math_mul2_const_16bit(Environment *_environment, char *_source, int _steps, int _signed)
CPU 6309: emit code to halves for several times a 8 bit value
void cpu_math_div_16bit_to_16bit(Environment *_environment, char *_source, char *_destination, char *_other, char *_other_remainder, int _signed)
void cpu_move_16bit_signed_32bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_move_8bit_unsigned_16bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_compare_32bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _positive)
CPU 6309: emit code to compare two 32 bit values
void cpu_math_mul_16bit_to_32bit(Environment *_environment, char *_source, char *_destination, char *_other, int _signed)
CPU 6309: emit code to multiply two 16 bit values in a 32 bit register
void cpu_swap_32bit(Environment *_environment, char *_left, char *_right)
void cpu_float_fast_from_16(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_bveq(Environment *_environment, char *_value, char *_label)
void cpu_dsresize(Environment *_environment, char *_index, char *_resize)
void cpu_move_nbit_indirect(Environment *_environment, int _n, char *_source, char *_value)
void cpu_math_div_8bit_to_8bit_const(Environment *_environment, char *_source, int _destination, char *_other, char *_other_remainder, int _signed)
void cpu_bit_check_extended(Environment *_environment, char *_value, char *_position, char *_result, int _bitwidth)
void cpu_math_div_32bit_to_16bit(Environment *_environment, char *_source, char *_destination, char *_other, char *_other_remainder, int _signed)
void cpu_math_mul2_const_8bit(Environment *_environment, char *_source, int _steps, int _signed)
CPU 6309: emit code to double for several times a 8 bit value
void cpu_float_fast_div(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_move_32bit_signed_16bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_move_32bit_unsigned_8bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_math_mul2_const_32bit(Environment *_environment, char *_source, int _steps, int _signed)
CPU 6309: emit code to double for several times a 32 bit value
void cpu_uppercase(Environment *_environment, char *_source, char *_size, char *_result)
void cpu_math_add_16bit_with_8bit(Environment *_environment, char *_source, char *_destination, char *_other)
void cpu_mem_move(Environment *_environment, char *_source, char *_destination, char *_size)
void cpu_math_sub_8bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to subtract two 8 bit values
void cpu_xor_32bit_const(Environment *_environment, char *_left, int _right, char *_result)
void cpu_math_add_32bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to add two 32 bit values
void cpu_store_char(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 8 bit
void cpu_math_complement_const_32bit(Environment *_environment, char *_source, int _value)
CPU 6309: emit code to calculate a 32 bit complement of a number
void cpu_store_16bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 16 bit
void cpu_poked(Environment *_environment, char *_address, char *_source)
void cpu_and_8bit_const(Environment *_environment, char *_left, int _right, char *_result)
void cpu_dsassign(Environment *_environment, char *_original, char *_copy)
void cpu_math_double_16bit(Environment *_environment, char *_source, char *_other, int _signed)
CPU 6309: emit code to double a 16 bit value
void cpu_math_sub_32bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to subtract two 32 bit values
void cpu_complement2_8bit(Environment *_environment, char *_source, char *_destination)
void cpu_math_div2_const_8bit(Environment *_environment, char *_source, int _steps, int _signed, char *_remainder)
CPU 6309: emit code to halves for several times a 8 bit value
void cpu_less_than_memory(Environment *_environment, char *_source, char *_destination, char *_size, char *_result, int _equal)
void cpu_dsalloc_size(Environment *_environment, int _size, char *_index)
void cpu_move_16bit_unsigned_8bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_math_div_nbit_to_nbit(Environment *_environment, char *_source, char *_destination, char *_other, char *_other_remainder, int _bits)
void cpu_math_add_8bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to add two 8 bit values
void cpu_float_single_add(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_float_single_sub(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_bit_inplace_8bit_extended_indirect(Environment *_environment, char *_address, char *_position, char *_bit)
void cpu_move_8bit_unsigned_32bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_move_8bit_indirect(Environment *_environment, char *_source, char *_value)
void cpu_string_sub(Environment *_environment, char *_source, char *_source_size, char *_pattern, char *_pattern_size, char *_destination, char *_destination_size)
void cpu_compare_8bit(Environment *_environment, char *_source, char *_destination, char *_other, int _positive)
CPU 6309: emit code to compare two 8 bit values
void cpu_math_and_const_32bit(Environment *_environment, char *_source, int _mask)
CPU 6309: emit code to mask with "and" a value of 32 bit
void cpu_addressof_16bit(Environment *_environment, char *_source, char *_destination)
void cpu_dec_16bit(Environment *_environment, char *_variable)
void cpu_dsgc(Environment *_environment)
void cpu_move_16bit_signed_32bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_inc(Environment *_environment, char *_variable)
void cpu_poke_const(Environment *_environment, char *_address, int _source)
void cpu_math_complement_const_8bit(Environment *_environment, char *_source, int _value)
CPU 6309: emit code to calculate an 8 bit complement of a number
void cpu_dsdefine(Environment *_environment, char *_string, char *_index)
void cpu_math_complement_const_16bit(Environment *_environment, char *_source, int _value)
CPU 6309: emit code to calculate a 16 bit complement of a number
void cpu_move_16bit_unsigned_32bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_math_mul2_const_nbit(Environment *_environment, char *_source, int _steps, int _bits)
void cpu_move_32bit(Environment *_environment, char *_source, char *_destination)
CPU 6309: emit code to move 32 bit
void cpu_dsfill(Environment *_environment, char *_string, char *_value)
void cpu_less_than_8bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
CPU 6309: emit code to compare two 8 bit values
void cpu_fill_direct_size_value(Environment *_environment, char *_address, int _bytes, int _pattern)
CPU 6309: emit code to fill up a memory area
void cpu_dec_32bit(Environment *_environment, char *_variable)
void cpu_greater_than_16bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)
void cpu_math_add_16bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to add two 16 bit values
void cpu_greater_than_16bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
CPU 6309: emit code to compare two 8 bit values
void cpu_bit_inplace_8bit(Environment *_environment, char *_value, int _position, int *_bit)
void cpu_math_add_16bit_const(Environment *_environment, char *_source, int _destination, char *_other)
void cpu_poked_const(Environment *_environment, char *_address, int _source)
void cpu_math_add_16bit_with_16bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to add two 16 bit values
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
void cpu_move_32bit_indirect(Environment *_environment, char *_source, char *_value)
void cpu_dswrite(Environment *_environment, char *_index)
void cpu_greater_than_8bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
CPU 6309: emit code to compare two 8 bit values
void cpu_or_16bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_fill(Environment *_environment, char *_address, char *_bytes, int _bytes_width, char *_pattern)
CPU 6309: emit code to fill up a memory area
void cpu_move_16bit_indirect(Environment *_environment, char *_source, char *_value)
void cpu_limit_16bit(Environment *_environment, char *_variable, int _value)
void cpu_move_8bit_indirect_with_offset2(Environment *_environment, char *_source, char *_value, char *_offset)
void cpu_less_than_32bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)
void cpu_move_nbit_indirect2(Environment *_environment, int _n, char *_value, char *_source)
void cpu_and_8bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_math_mul_8bit_to_16bit(Environment *_environment, char *_source, char *_destination, char *_other, int _signed)
CPU 6309: emit code to multiply two 8bit values in a 16 bit register
void cpu_compare_16bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _positive)
CPU 6309: emit code to compare two 16 bit values
void cpu_math_sub_16bit(Environment *_environment, char *_source, char *_destination, char *_other)
CPU 6309: emit code to subtract two 16 bit values
void cpu_compare_and_branch_32bit_const(Environment *_environment, char *_source, int _destination, char *_label, int _positive)
CPU 6309: emit code to compare two 32 bit values and jump if they are equal/different
void cpu_store_nbit(Environment *_environment, char *_destination, int _n, int _value[])
CPU 6309: emit code to store n bit
void cpu_mem_move_direct_indirect_size(Environment *_environment, char *_source, char *_destination, int _size)
void cpu_dec_nbit(Environment *_environment, char *_variable, int _bits)
void cpu_math_and_const_16bit(Environment *_environment, char *_source, int _mask)
CPU 6309: emit code to mask with "and" a value of 16 bit
void cpu_move_8bit_indirect2_8bit(Environment *_environment, char *_value, char *_offset, char *_source)
void cpu_float_single_from_16(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_fill_indirect(Environment *_environment, char *_address, char *_size, char *_pattern, int _size_size)
void cpu_compare_and_branch_char_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
void cpu_less_than_nbit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _bits)
void cpu_math_mul_nbit_to_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _bits)
void cpu_label(Environment *_environment, char *_label)
void cpu_dec(Environment *_environment, char *_variable)
void cpu_and_16bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_move_nbit(Environment *_environment, int _n, char *_source, char *_destination)
CPU cpu6309: emit code to store n bit
void cpu_logical_not_8bit(Environment *_environment, char *_value, char *_result)
void cpu_pokew_const(Environment *_environment, char *_address, int _source)
void cpu_logical_and_8bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_math_div2_const_32bit(Environment *_environment, char *_source, int _steps, int _signed, char *_remainder)
CPU 6309: emit code to halves for several times a 32 bit value
void cpu_halt(Environment *_environment)
void cpu_end(Environment *_environment)
void cpu_float_fast_from_double_to_int_array(Environment *_environment, double _value, int _result[])
void cpu_compare_memory(Environment *_environment, char *_source, char *_destination, char *_size, char *_result, int _equal)
void cpu_greater_than_8bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)
void cpu_complement2_16bit(Environment *_environment, char *_source, char *_destination)
void cpu_xor_8bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_complement2_32bit(Environment *_environment, char *_source, char *_destination)
void cpu_lowercase(Environment *_environment, char *_source, char *_size, char *_result)
void cpu_float_single_to_8(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_move_16bit(Environment *_environment, char *_source, char *_destination)
CPU 6309: emit code to move 16 bit
void cpu_move_8bit_with_offset2(Environment *_environment, char *_source, char *_value, char *_offset)
void cpu_move_16bit_unsigned_8bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_bneq(Environment *_environment, char *_label)
CPU 6309: emit code to make long conditional jump
void cpu_move_16bit_indirect2(Environment *_environment, char *_value, char *_source)
void cpu_float_fast_cmp(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_math_double_8bit(Environment *_environment, char *_source, char *_other, int _signed)
CPU 6309: emit code to double a 8 bit value
void cpu_float_fast_mul(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_bits_to_string(Environment *_environment, char *_number, char *_string, char *_string_size, int _bits, char *_zero, char *_one)
void cpu_dsalloc(Environment *_environment, char *_size, char *_index)
void cpu_less_than_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _bits)
void cpu_not_32bit(Environment *_environment, char *_value, char *_result)
void cpu_float_single_from_double_to_int_array(Environment *_environment, double _value, int _result[])
void cpu_float_single_to_16(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_greater_than_memory_size(Environment *_environment, char *_source, char *_destination, int _size, char *_result, int _equal)
void cpu_hex_to_string(Environment *_environment, char *_number, char *_string, char *_size, int _separator)
void cpu_or_8bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_move_8bit_indirect2_16bit(Environment *_environment, char *_value, char *_offset, char *_source)
void cpu_math_add_32bit_const(Environment *_environment, char *_source, int _destination, char *_other)
void cpu_move_8bit_indirect_with_offset(Environment *_environment, char *_source, char *_value, int _offset)
void cpu_sqroot(Environment *_environment, char *_number, char *_result)
void cpu_number_to_string(Environment *_environment, char *_number, char *_string, char *_string_size, int _bits, int _signed)
void cpu_greater_than_32bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
CPU 6309: emit code to compare two 8 bit values
void cpu_peekd(Environment *_environment, char *_address, char *_target)
void cpu_call(Environment *_environment, char *_label)
void cpu_random_8bit(Environment *_environment, char *_entropy, char *_result)
void cpu_xor_8bit_const(Environment *_environment, char *_left, int _right, char *_result)
void cpu_move_16bit_signed_8bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_mem_move_direct(Environment *_environment, char *_source, char *_destination, char *_size)
void cpu_store_8bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 8 bit
void cpu_swap_8bit(Environment *_environment, char *_left, char *_right)
void cpu_float_fast_to_8(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_float_single_div(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_hex_to_bin(Environment *_environment, char *_value_address, char *_value_size, char *_variable_address, char *_variable_size, char *_result)
void cpu_greater_than_32bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)
void cpu_float_fast_to_16(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_compare_32bit(Environment *_environment, char *_source, char *_destination, char *_other, int _positive)
CPU 6309: emit code to compare two 32 bit values
void cpu_jump(Environment *_environment, char *_label)
void cpu_store_8bit_with_offset2(Environment *_environment, char *_source, char *_offset, int _value)
void cpu_move_16bit_unsigned_32bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_move_32bit_signed_8bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_mem_move_size(Environment *_environment, char *_source, char *_destination, int _size)
void cpu_fill_blocks(Environment *_environment, char *_address, char *_blocks, char *_pattern)
CPU 6309: emit code to fill up a memory area
void cpu_bvneq(Environment *_environment, char *_value, char *_label)
void cpu_float_single_mul(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_move_16bit_signed_8bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_math_div_16bit_to_16bit_const(Environment *_environment, char *_source, int _destination, char *_other, char *_other_remainder, int _signed)
void cpu_poke(Environment *_environment, char *_address, char *_source)
void cpu_bit_check(Environment *_environment, char *_value, int _position, char *_result, int _bitwidth)
void cpu_move_32bit_signed_8bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_math_div_nbit_to_nbit_const(Environment *_environment, char *_source, int _destination, char *_other, char *_other_remainder, int _bits)
void cpu_random_32bit(Environment *_environment, char *_entropy, char *_result)
void cpu_move_32bit_unsigned_16bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_less_than_8bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)
void cpu_greater_than_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _bits)
void cpu_less_than_16bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
CPU 6309: emit code to compare two 8 bit values
void cpu_math_and_const_8bit(Environment *_environment, char *_source, int _mask)
CPU 6309: emit code to mask with "and" a value of 8 bit
void cpu_move_32bit_unsigned_16bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_inc_32bit(Environment *_environment, char *_variable)
void cpu_move_8bit_signed_16bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_mem_move_direct_size(Environment *_environment, char *_source, char *_destination, int _size)
void cpu_float_fast_sub(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_xor_32bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_return(Environment *_environment)
void cpu_move_8bit_indirect2(Environment *_environment, char *_value, char *_source)
void cpu_inc_nbit(Environment *_environment, char *_variable, int _bits)
void cpu_pop(Environment *_environment)
void cpu_math_sub_16bit_with_8bit(Environment *_environment, char *_source, char *_destination, char *_other)
void cpu_random_16bit(Environment *_environment, char *_entropy, char *_result)
void cpu_ei(Environment *_environment)
void cpu_or_32bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_math_div2_const_16bit(Environment *_environment, char *_source, int _steps, int _signed, char *_remainder)
CPU 6309: emit code to halves for several times a 16 bit value
void cpu_inc_16bit(Environment *_environment, char *_variable)
void cpu_logical_or_8bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_random(Environment *_environment, char *_entropy)
void cpu_move_32bit_unsigned_8bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_compare_and_branch_8bit(Environment *_environment, char *_source, char *_destination, char *_label, int _positive)
void cpu_move_16bit_indirect2_8bit(Environment *_environment, char *_value, char *_offset, char *_source)
void cpu_float_single_from_8(Environment *_environment, char *_value, char *_result, int _signed)
void cpu_math_sub_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _bits)
void cpu_float_single_cmp(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_move_8bit_signed_32bit_signed(Environment *_environment, char *_source, char *_destination)
void cpu_math_div2_const_nbit(Environment *_environment, char *_source, int _steps, int _bits, char *_remainder)
void cpu_store_8bit_with_offset(Environment *_environment, char *_destination, int _value, int _offset)
void cpu_busy_wait(Environment *_environment, char *_timing)
void cpu_greater_than_memory(Environment *_environment, char *_source, char *_destination, char *_size, char *_result, int _equal)
void cpu_store_32bit(Environment *_environment, char *_destination, int _value)
CPU 6309: emit code to store 32 bit
void cpu_peekw(Environment *_environment, char *_address, char *_target)
void cpu_flip(Environment *_environment, char *_source, char *_size, char *_destination)
void cpu_move_8bit(Environment *_environment, char *_source, char *_destination)
CPU 6309: emit code to move 8 bit
void cpu_beq(Environment *_environment, char *_label)
CPU 6309: emit code to make long conditional jump
void cpu_compare_16bit(Environment *_environment, char *_source, char *_destination, char *_other, int _positive)
CPU 6309: emit code to compare two 16 bit values
void cpu_peek(Environment *_environment, char *_address, char *_target)
void cpu_float_fast_add(Environment *_environment, char *_x, char *_y, char *_result)
void cpu_convert_string_into_16bit(Environment *_environment, char *_string, char *_len, char *_value)
void cpu_not_8bit(Environment *_environment, char *_value, char *_result)
void cpu_math_div_8bit_to_8bit(Environment *_environment, char *_source, char *_destination, char *_other, char *_other_remainder, int _signed)
void cpu_dsdescriptor(Environment *_environment, char *_index, char *_address, char *_size)
void cpu_math_add_nbit(Environment *_environment, char *_source, char *_destination, char *_other, int _bits)
void cpu_compare_8bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _positive)
CPU 6309: emit code to compare two 8 bit values
void cpu_xor_16bit(Environment *_environment, char *_left, char *_right, char *_result)
void cpu_xor_16bit_const(Environment *_environment, char *_left, int _right, char *_result)
void cpu_swap_16bit(Environment *_environment, char *_left, char *_right)
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
void cpu_math_div_32bit_to_16bit_const(Environment *_environment, char *_source, int _destination, char *_other, char *_other_remainder, int _signed)
void cpu_less_than_32bit(Environment *_environment, char *_source, char *_destination, char *_other, int _equal, int _signed)
CPU 6309: emit code to compare two 32 bit values
void cpu_dsfill_value(Environment *_environment, char *_string, int _value)
void cpu_dsassign_string(Environment *_environment, char *_string, char *_copy)
void cpu_move_8bit_signed_16bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_move_8bit_unsigned_16bit_unsigned(Environment *_environment, char *_source, char *_destination)
void cpu_compare_memory_size(Environment *_environment, char *_source, char *_destination, int _size, char *_result, int _equal)
void cpu_math_add_8bit_const(Environment *_environment, char *_source, int _destination, char *_other)
void cpu_flip_8bit(Environment *_environment, char *_source, char *_destination)
void cpu_less_than_16bit_const(Environment *_environment, char *_source, int _destination, char *_other, int _equal, int _signed)
#define VT_FLOAT_NORMALIZED_BITWIDTH(p)
#define VT_FLOAT_NORMALIZED_POW2_WIDTH(p)
#define VT_FLOAT_BITWIDTH(p)
#define DEFAULT_PAPER_COLOR
#define DEFAULT_PEN_COLOR
Variable * variable_bin(Environment *_environment, char *_value, char *_digits, char *_zero, char *_one)
Emit code for <string>BIN(...).
int calculate_nearest_tile(TileDescriptor *_tile, TileDescriptors *_tiles)
StaticString * static_string_find_by_value(Environment *_environment, char *_value, int _size)
void label_define_numeric(Environment *_environment, int _label)
Variable * variable_move_from_array_bit(Environment *_environment, Variable *_array)
Variable * variable_array_min_vars(Environment *_environment, char *_name)
Variable * variable_hex2bin(Environment *_environment, char *_value, char *_variable)
Emit code for = HEX2BIN( ... ).
int procedure_exists(Environment *_environment, char *_name)
int assemblyLineIsAComment(char *_buffer)
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)
size_t buffered_fwrite(Environment *_environment, void *_data, size_t _size, size_t _count, FILE *_stream)
DataSegment * data_segment_find_numeric(Environment *_environment, int _number)
void variable_add_inplace(Environment *_environment, char *_source, int _destination)
void memory_area_unassign(MemoryArea *_first, Variable *_variable)
void parser_array_index_symbolic(Environment *_environment, char *_index)
char * image_extract_subimage(Environment *_environment, char *_source, int _width, int _height, int _frame_width, int _frame_height, int _x, int _y, int _depth)
ScreenMode * find_screen_mode_by_id(Environment *_environment, int _id)
int tile_allocate(TileDescriptors *_tiles, char *_data)
Variable * origin_resolution_relative_transform_x(Environment *_environment, char *_x, int _is_relative)
int system_move_safe(Environment *_environment, char *_source, char *_destination)
void variable_store_array_const_byte(Environment *_environment, Variable *_array, int _value)
RGBi * palette_match_hardware_index(RGBi *_source, int _source_size, RGBi *_system, int _system_size)
void variable_increment_array_type(Environment *_environment, char *_source, char *_field)
DataSegment * data_segment_define_or_retrieve_numeric(Environment *_environment, int _number)
int calculate_tile_affinity(TileDescriptor *_first, TileDescriptor *_second)
int find_frame_by_type(Environment *_environment, TsxTileset *_tileset, char *_images, char *_description)
void const_define_numeric(Environment *_environment, char *_name, int _value)
void variable_string_right_assign(Environment *_environment, char *_string, char *_position, char *_expression)
Emit code for RIGHT( ..., ... ) = ....
int reset_screen_mode_selected(Environment *_environment)
Variable * variable_string_right(Environment *_environment, char *_string, char *_position)
Emit code for = LEFT( ..., ... ).
Variable * variable_less_than_const(Environment *_environment, char *_source, int _destination, int _equal)
Variable * variable_string_mid(Environment *_environment, char *_string, char *_position, char *_len)
Emit code for = MID( ..., ... [, ...] ).
void variable_add_inplace_type(Environment *_environment, char *_source, char *_field, int _destination)
int count_screen_mode_selected(Environment *_environment)
VariableType variable_type_from_numeric_value(Environment *_environment, int _number)
void buffered_prepend_output(Environment *_environment)
void parser_array_cleanup(Environment *_environment)
Variable * variable_retrieve_or_define(Environment *_environment, char *_name, VariableType _type, int _value)
int rgbi_distance(RGBi *_e1, RGBi *_e2)
Calculate the distance between two colors.
void label_referred_define_named(Environment *_environment, char *_label)
RGBi * palette_shift(RGBi *_source, int _source_size, int _offset)
Shift colors in palette.
int calculate_horizontal_edges(TileData *_tileData, int _position)
Variable * variable_mul2_const(Environment *_environment, char *_destination, int _steps)
Double a variable for various times and return the result.
DataSegment * data_segment_define_numeric(Environment *_environment, int _number)
void variable_move_array(Environment *_environment, char *_array, char *_value)
StaticString * static_string_create(Environment *_environment, char *_value, int _size)
void variable_decrement(Environment *_environment, char *_source)
Decrement a variable by one.
DataSegment * data_segment_define_or_retrieve(Environment *_environment, char *_name)
Variable * variable_sr_const(Environment *_environment, char *_destination, int _bits)
void variable_add_inplace_mt(Environment *_environment, char *_source, char *_destination)
Add two variable and return the sum of them on the first.
Variable * variable_move_from_type(Environment *_environment, char *_type, char *_field)
void variable_string_mid_assign(Environment *_environment, char *_string, char *_position, char *_len, char *_expression)
Emit code for MID( ..., ... [, ...] ) = ....
CopperList * find_copper_list(Environment *_environment, char *_name)
char * image_roll_y_down(Environment *_environment, char *_source, int _width, int _height)
void variable_decrement_array(Environment *_environment, char *_source)
int variable_exists(Environment *_environment, char *_name)
Variable * variable_not(Environment *_environment, char *_value)
Calculate logical "not" and return it as the result.
DataSegment * data_segment_define(Environment *_environment, char *_name)
Variable * variable_string_inst(Environment *_environment, char *_string, char *_altstring, char *_pos)
void environment_setup_retrohack(Environment *_environment)
void label_stored_define_named(Environment *_environment, char *_label)
Variable * variable_move_from_array1_type(Environment *_environment, char *_array, char *_index, char *_field)
Variable * variable_store_type(Environment *_environment, char *_destination, char *_field, unsigned int _value)
Variable * variable_less_than(Environment *_environment, char *_source, char *_destination, int _equal)
Compare two variable and return the result of comparation.
void variable_array_fill_random(Environment *_environment, char *_name, int _base, int _min_value, int _max_value, int _count, int _boolean)
int system_call(Environment *_environment, char *_commandline)
Call an external executable.
Variable * variable_and(Environment *_environment, char *_left, char *_right)
Calculate logical "and" and return it as the result.
void variable_array_fill_incremental(Environment *_environment, char *_name, int _min, int _count)
Variable * calculate_frame_by_type(Environment *_environment, TsxTileset *_tileset, char *_images, char *_description)
char * find_last_path_separator(char *_path)
Variable * variable_greater_than(Environment *_environment, char *_source, char *_destination, int _equal)
Compare two variable and return the result of comparation.
Variable * parser_casted_numeric(Environment *_environment, VariableType _type, int _number)
Variable * variable_string_space(Environment *_environment, char *_repetitions)
Emit code for = SPACE( ... ).
void variable_compare_and_branch_const(Environment *_environment, char *_source, int _destination, char *_name, int _positive)
Variable * variable_string_val(Environment *_environment, char *_value)
Emit code for = VAL( ... ).
int buffered_fputs(Environment *_environment, const char *_string, FILE *_stream)
Variable * variable_move(Environment *_environment, char *_source, char *_destination)
Store the value of a variable inside another variable by converting it.
Variable * variable_move_naked(Environment *_environment, char *_source, char *_destination)
Store the value of a variable inside another variable without conversion.
Variable * variable_array_sum_vars(Environment *_environment, char *_name)
Variable * variable_array_type(Environment *_environment, char *_name, VariableType _type)
void variable_decrement_array_type(Environment *_environment, char *_source, char *_field)
RGBi * palette_merge(RGBi *_palette1, int _palette1_size, RGBi *_palette2, int _palette2_size, int *_size)
Make a "palette merge".
Variable * variable_string_str(Environment *_environment, char *_value)
Emit code for = STR( ... ).
char * file_read_csv(Environment *_environment, char *_filename, VariableType _type, int *_size, int *_count)
Variable * variable_string_upper(Environment *_environment, char *_string)
Emit code for = UPPER( ... ).
float min_of_three(float _m, float _n, float _p)
Variable * variable_and_const(Environment *_environment, char *_destination, int _mask)
Calculate "and" mask for a variable and it as the result.
int rgbi_equals_rgba(RGBi *_first, RGBi *_second)
int check_if_filename_is_valid(Environment *_environment, char *_filename)
int label_exists_named(Environment *_environment, char *_label)
void image_converter_asserts_free_height(Environment *_environment, int _width, int _height, int _offset_x, int _offset_y, int *_frame_width, int *_frame_height, int _modulo_x)
Variable * variable_int(Environment *_environment, char *_expression)
void image_converter_asserts_free_width(Environment *_environment, int _width, int _height, int _offset_x, int _offset_y, int *_frame_width, int *_frame_height, int _modulo_y)
Variable * variable_move_from_array(Environment *_environment, char *_array)
void image_converter_asserts_free(Environment *_environment, int _width, int _height, int _offset_x, int _offset_y, int *_frame_width, int *_frame_height)
void variable_string_left_assign(Environment *_environment, char *_string, char *_position, char *_expression)
Emit code for LEFT( ..., ... ) = ....
Variable * variable_string_chr(Environment *_environment, char *_ascii)
Emit code for = CHR( ... ).
void variable_add_inplace_type_vars(Environment *_environment, char *_source, char *_field, char *_destination)
char * image_flip_y(Environment *_environment, char *_source, int _width, int _height, int _depth)
ArrayReference * parser_array_retrieve(Environment *_environment)
char * basename(char *_path)
Variable * variable_define_no_init(Environment *_environment, char *_name, VariableType _type)
Variable * variable_string_pick(Environment *_environment, char *_string, int _position)
Variable * variable_sub_const(Environment *_environment, char *_source, int _destination)
Make a differenze between a variable a constant, and return the difference of them.
Variable * variable_add_const(Environment *_environment, char *_source, int _destination)
Add a variable with a constant, and return the sum of them.
void variable_store_array_const_bit(Environment *_environment, Variable *_array, int _value)
char * escape_newlines(char *_string)
void variable_increment(Environment *_environment, char *_source)
Increment a variable by one.
Resource * build_resource_for_sequence(Environment *_environment, char *_image, char *_frame, char *_sequence)
void define_implicit_array_if_needed(Environment *_environment, char *_name)
int label_stored_exists_named(Environment *_environment, char *_label)
void variable_increment_array(Environment *_environment, char *_source)
TileDescriptor * calculate_tile_descriptor(TileData *_tileData)
Variable * variable_string_lower(Environment *_environment, char *_string)
Emit code for = UPPER( ... ).
TileDescriptors * precalculate_tile_descriptors_for_font(char *_fontData, int _fontSize)
void environment_setup_10liner(Environment *_environment)
Variable * variable_mod(Environment *_environment, char *_source, char *_destination)
char * resolve_color(Environment *_environment, char *_color)
int pattern_match(char *_pattern, char *_value)
Environment * environment_create(void)
Create a new environment.
Variable * variable_string_left(Environment *_environment, char *_string, char *_position)
Emit code for = LEFT( ..., ... ).
Variable * variable_string_insert(Environment *_environment, char *_string, char *_altstring, char *_pos)
void variable_move_from_array_byte_inplace(Environment *_environment, Variable *_array, Variable *_result)
Variable * variable_flip(Environment *_environment, char *_variable)
Variable * variable_string_asc(Environment *_environment, char *_char)
Emit code for = ASC( ... ).
Variable * variable_retrieve_internal(Environment *_environment, char *_name, int _mandatory)
Retrieve the definition of a variable.
void variable_xor_inplace_mt(Environment *_environment, char *_source, char *_destination)
Add two variable and return the sum of them on the first.
Variable * variable_hex(Environment *_environment, char *_value, int _separator)
Emit code for = HEX( ... ).
Variable * variable_string_string(Environment *_environment, char *_string, char *_repetitions)
Emit code for = STRING( ..., ... ).
Variable * variable_move_from_array_byte(Environment *_environment, Variable *_array)
int rgbi_equals_rgb(RGBi *_first, RGBi *_second)
Variable * variable_import(Environment *_environment, char *_name, VariableType _type, int _size_or_value)
char * unescape_string(Environment *_environment, char *_value, int _printing, int *_final_size)
void environment_parse_command_line(Environment *_environment, int _argc, char *_argv[])
Parse command line parameters.
Variable * variable_move_from_mt(Environment *_environment, char *_source, char *_destination)
Increment a variable by one.
void get_image_overwrite_size(Environment *_environment, char *_image, char *_x1, char *_y1, char *_x2, char *_y2)
void variable_increment_type(Environment *_environment, char *_source, char *_field)
Variable * variable_compare_not(Environment *_environment, char *_source, char *_destination)
Compare two variable and return the result of comparation.
Variable * variable_resident(Environment *_environment, VariableType _type, char *_meaning)
Variable * variable_div_const(Environment *_environment, char *_source, int _destination, char *_remainder)
RGBi * palette_promote_color_as_background(int _index, RGBi *_source, int _source_size)
Promote an index color in a palette.
void variable_decrement_type(Environment *_environment, char *_source, char *_field)
int variable_exists_by_realname(Environment *_environment, char *_name)
const char * strrstr(const char *haystack, const char *needle)
char * image_roll_x_right(Environment *_environment, char *_source, int _width, int _height)
int label_referred_exists_named(Environment *_environment, char *_label)
Variable * variable_xor(Environment *_environment, char *_left, char *_right)
Calculate logical "xor" and return it as the result.
void variable_set_type(Environment *_environment, char *_name, char *_type)
char * image_flip_x(Environment *_environment, char *_source, int _width, int _height, int _depth)
RGBi * malloc_palette(int _size)
Allocate a palette space.
int variable_delete(Environment *_environment, char *_name)
Constant * constant_create(Environment *_environment, char *_name)
Variable * parse_buffer_definition(Environment *_environment, char *_buffer, VariableType _type, int _hex_only)
char * strcopy(char *_dest, char *_source)
Variable * variable_string_instr(Environment *_environment, char *_search, char *_searched, char *_start)
Emit code for = INSTR( ..., ... [, ...] ).
Variable * variable_resize_buffer(Environment *_environment, char *_destination, int _size)
Resize the (static) size of a buffer.
void variable_temporary_remove(Environment *_environment, char *_name)
char * image_enlarge_right(Environment *_environment, char *_source, int _width, int _height, int _delta)
void rgbi_move(RGBi *_source, RGBi *_destination)
DataSegment * data_segment_find(Environment *_environment, char *_name)
Variable * variable_by_constant(Environment *_environment, VariableType _type, int _value)
void variable_move_array_type(Environment *_environment, char *_array, char *_field, char *_value)
int calculate_exact_tile(TileDescriptor *_tile, TileDescriptors *_tiles)
Variable * variable_move_from_array_bit_inplace(Environment *_environment, Variable *_array, Variable *_result)
void variable_global(Environment *_environment, char *_pattern)
void variable_store_array_const(Environment *_environment, char *_array, int _value)
Variable * variable_store_float(Environment *_environment, char *_destination, double _value)
Store a string to a variable.
Variable * variable_define(Environment *_environment, char *_name, VariableType _type, int _value)
Define a variable for the program.
Variable * variable_export(Environment *_environment, char *_name, VariableType _type, int _size_or_value)
void label_define_named(Environment *_environment, char *_label)
ScreenMode * find_screen_mode_by_suggestion(Environment *_environment, int _bitmap, int _width, int _height, int _colors, int _tile_width, int _tile_height)
void variable_move_array1_type_const(Environment *_environment, char *_array, char *_index, char *_field, int _value)
Variable * variable_direct_assign(Environment *_environment, char *_var, char *_expr)
Variable * variable_array_max_vars(Environment *_environment, char *_name)
Variable * variable_mul(Environment *_environment, char *_source, char *_destination)
Make a multiplication between two variable and return the product of them.
void variable_xor_inplace_vars(Environment *_environment, char *_source, char *_destination)
Add two variable and return the sum of them on the first.
Type * type_find(Type *_first, char *_name)
float max_of_two(float _x, float _y)
void variable_move_array_byte(Environment *_environment, Variable *_array, char *_value)
void label_referred_define_numeric(Environment *_environment, int _label)
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_sl_const(Environment *_environment, char *_destination, int _steps)
void parser_array_index_numeric(Environment *_environment, int _index)
Field * field_find(Type *_type, char *_name)
StaticString * string_reserve(Environment *_environment, char *_value)
Variable * variable_move_to_mt(Environment *_environment, char *_source, char *_destination)
void variable_sub_inplace(Environment *_environment, char *_source, char *_dest)
Make a differenze between two variable and assign the difference of them to the first.
void parser_array_init(Environment *_environment)
Variable * variable_store_string(Environment *_environment, char *_destination, char *_value)
Store a string to a variable.
void const_define_string(Environment *_environment, char *_name, char *_value)
void variable_move_array1_type_fields(Environment *_environment, char *_array, char *_index, char *_field1, char *_field2)
int show_troubleshooting_and_exit(Environment *_environment, int _argc, char *_argv[])
char * generate_storage_filename(Environment *_environment, char *_prefix, char *_suffix, int _number)
void prepare_variable_storage(Environment *_environment, char *_name, Variable *_source)
char * resource_load_asserts(Environment *_environment, char *_filename)
void variable_move_from_array_type_inplace(Environment *_environment, char *_array, char *_field, char *_value)
void offsetting_add_variable_reference(Environment *_environment, Offsetting *_first, Variable *_var, int _sequence)
Variable * origin_resolution_relative_transform_y(Environment *_environment, char *_y, int _is_relative)
char * strtoupper(char *_string)
Variable * variable_sub(Environment *_environment, char *_source, char *_dest)
Make a differenze between two variable and return the difference of them.
Variable * variable_div(Environment *_environment, char *_source, char *_destination, char *_remainder)
Make a division between two variable and return the product of them.
Variable * variable_cast(Environment *_environment, char *_source, VariableType _type)
Cast a variable from a type to another.
Variable * variable_string_len(Environment *_environment, char *_string)
Emit code for = LEN( ... ).
Variable * variable_temporary(Environment *_environment, VariableType _type, char *_meaning)
Define a temporary variable.
int label_referred_exists_numeric(Environment *_environment, int _label)
int rgbi_extract_palette(Environment *_environment, unsigned char *_source, int _width, int _height, int _depth, RGBi _palette[], int _palette_size, int _sorted)
Extract the color palette from the given image.
Variable * variable_compare(Environment *_environment, char *_source, char *_destination)
Compare two variable and return the result of comparation.
Offsetting * offsetting_size_count(Environment *_environment, int _size, int _count)
RGBi * palette_promote_color_as_foreground(int _index, RGBi *_source, int _source_size, int _max_size)
Promote an index color in a palette.
void variable_add_inplace_array(Environment *_environment, char *_source, char *_destination)
Add a variable to an array element, and return the sum of them on the array element.
Variable * variable_store_array(Environment *_environment, char *_destination, unsigned char *_buffer, int _size, int _at)
void variable_move_from_array1_type_inplace(Environment *_environment, char *_array, char *_index, char *_field, char *_value)
float max_of_three(float _m, float _n, float _p)
void variable_swap(Environment *_environment, char *_source, char *_dest)
Swap values of two variables.
void environment_setup_default(Environment *_environment)
Setup default environment values.
void variable_xor_inplace(Environment *_environment, char *_source, int _destination)
Variable * variable_store(Environment *_environment, char *_destination, unsigned int _value)
Store a direct value to a variable.
Variable * variable_string_dup(Environment *_environment, char *_string, char *_repetitions)
char * strreplace(const char *_orig, const char *_rep, const char *_with)
Variable * variable_array_count_vars(Environment *_environment, char *_name, char *_target)
char * parse_buffer(Environment *_environment, char *_buffer, int *_size, int _hex_only)
StaticString * static_string_create_filled(Environment *_environment, int _size, char _value)
Variable * variable_or(Environment *_environment, char *_left, char *_right)
Calculate logical "or" and return it as the result.
void variable_increment_mt(Environment *_environment, char *_source)
Increment a variable by one.
void variable_array_fill(Environment *_environment, char *_name, int _value)
void variable_reset(Environment *_environment)
Reset the usage flags for the temporary variable pool.
void variable_move_from_type_inplace(Environment *_environment, char *_type, char *_field, char *_value)
void variable_array_shuffle(Environment *_environment, char *_name, int _rounds)
#define UNESCAPE_COLOR(c, d)
char * get_default_temporary_path()
void buffered_push_output(Environment *_environment)
RGBi * palette_remove_duplicates(RGBi *_source, int _source_size, int *_unique_size)
Remove duplicates from a palette.
Variable * parser_adapted_numeric(Environment *_environment, int _number)
Variable * variable_move_from_array_type(Environment *_environment, char *_array, char *_field)
char * get_temporary_filename(Environment *_environment)
void font_descriptors_init(Environment *_environment, int _embedded_present)
Variable * variable_greater_than_const(Environment *_environment, char *_source, int _destination, int _equal)
char * image_roll_x_left(Environment *_environment, char *_source, int _width, int _height)
void buffered_pop_output(Environment *_environment)
Variable * variable_retrieve_by_realname(Environment *_environment, char *_name)
void variable_decrement_mt(Environment *_environment, char *_source)
Decrement a variable by one.
char * import_file_name(char *_import_path)
Variable * variable_div2_const(Environment *_environment, char *_destination, int _bits, char *_remainder)
Subdivide by two a variable for various times and return the result.
Variable * variable_compare_not_const(Environment *_environment, char *_source, int _destination)
Compare two variable and return the result of comparation.
char * image_enlarge_bottom(Environment *_environment, char *_source, int _width, int _height, int _delta)
Variable * variable_complement_const(Environment *_environment, char *_source, int _value)
Calculate the complement of a variable.
int system_remove_safe(Environment *_environment, char *_filename)
char * escape_newlines_full(char *_string, int _size)
void memory_area_assign(MemoryArea *_first, Variable *_variable)
RGBi * palette_match(RGBi *_source, int _source_size, RGBi *_system, int _system_size)
Make a "palette match".
int calculate_white_area(TileData *_tileData)
int label_exists_numeric(Environment *_environment, int _label)
void image_converter_asserts(Environment *_environment, int _width, int _height, int _offset_x, int _offset_y, int *_frame_width, int *_frame_height, int _modulo_x, int _modulo_y)
void variable_store_mt(Environment *_environment, char *_source, unsigned int _value)
Store a variable's value.
void parser_array_init_by(Environment *_environment, ArrayReference *_array_reference)
Variable * variable_string_substring(Environment *_environment, char *_string, char *_start, char *_end)
Emit code for = SUBSTRING( ..., ... [, ...] ).
void buffered_output(Environment *_environment, FILE *_stream)
void variable_move_array_bit(Environment *_environment, Variable *_array, char *_value)
char * address_displacement(Environment *_environment, char *_address, char *_displacement)
Constant * constant_find(Environment *_environment, char *_name)
void buffered_fprintf(Environment *_environment, FILE *_stream, const char *_format,...)
Variable * variable_compare_const(Environment *_environment, char *_source, int _destination)
Compare two variable and return the result of comparation.
float min_of_two(float _x, float _y)
void variable_move_from_array_inplace(Environment *_environment, char *_array, char *_result)
const char * strstrcase(const char *_x, const char *_y)
void variable_move_array1_type(Environment *_environment, char *_array, char *_index, char *_field, char *_value)
void variable_move_array_string(Environment *_environment, char *_array, char *_string)
void variable_move_type(Environment *_environment, char *_type, char *_field, char *_value)
int file_get_size(Environment *_environment, char *_filename)
Bank * bank_find(Bank *_first, char *_name)
Variable * variable_string_flip(Environment *_environment, char *_string)
Emit code for = FLIP( ... ).
int check_datatype_limits(VariableType _type, int _value)
int calculate_vertical_edges(TileData *_tileData, int _position)
Variable * variable_store_buffer(Environment *_environment, char *_destination, unsigned char *_buffer, int _size, int _at)
Variable * variable_bit(Environment *_environment, char *_value, char *_position)
Emit code for HAS BIT / BIT(...).
Variable * absolute(Environment *_environment, char *_value)
Return the absolute value of a variable.
char BANK_TYPE_AS_STRING[][16]
Description of BANK TYPE, in readable format.
void color(Environment *_environment, int _index, int _shade)
Emit ASM code for instruction COLOR [int], [int].
#define JOYSTICK_CONFIG_DEFAULT_SYNC
#define KEYBOARD_CONFIG_DEFAULT_SYNC
void bank_read_semi_var(Environment *_environment, int _bank, int _address1, char *_address2, int _size)
Emit ASM code for instruction BANK READ ....
void bank_read_vars_bank_direct_size(Environment *_environment, int _bank, char *_address1, char *_address2, int _size)
void bank_uncompress_semi_var(Environment *_environment, int _bank, int _address1, char *_address2)
Emit ASM code for instruction BANK UNCOMPRESS ....
void bank_write_vars_bank_direct_size(Environment *_environment, char *_address1, int _bank, char *_address2, int _size)
Variable * create_vector(Environment *_environment, char *_x, char *_y)
Emit ASM code to implement CREATE PATH command.
Variable * distance(Environment *_environment, char *_x1, char *_y1, char *_x2, char *_y2)
Return the distance between two (screen) positions.
void end(Environment *_environment)
Emit ASM code for END.
void error(Environment *_environment, char *_message)
Emit ASM code for ERROR.
unsigned int data_font_alpha_bin_len
unsigned char data_font_alpha_bin[]
unsigned int data_font_ascii_bin_len
unsigned char data_font_ascii_bin[]
unsigned int data_font_complete_bin_len
unsigned char data_font_complete_bin[]
unsigned char data_font_semigraphic_bin[]
unsigned int data_font_semigraphic_bin_len
unsigned int data_font_standard_bin_len
unsigned char data_font_standard_bin[]
Variable * rnd(Environment *_environment, char *_value)
Return a random value.
Variable * sbpen_get(Environment *_environment, char *_index)
Variable * sign(Environment *_environment, char *_value)
Return the sign of a variable.
int arrayIndexesDirectEach[MAX_ARRAY_DIMENSIONS]
char * arrayIndexesEach[MAX_ARRAY_DIMENSIONS]
StaticString * valueString
struct _CopperList * next
struct _DataSegment * next
Structure of compilation environment.
Variable * tempResidentVariables
char * bufferOutput[MAX_BUFFERED_OUTPUT]
Variable * procedureVariables
char * arrayIndexesEach[MAX_NESTED_ARRAYS][MAX_ARRAY_DIMENSIONS]
Bank * banks[BANK_TYPE_COUNT]
JoystickConfig joystickConfig
int dojoOnVirtualizedFujiNet
int maxExpansionBankSize[MAX_RESIDENT_SHAREDS]
VariableType defaultVariableType
char * configurationFileName
int bufferOutputSize[MAX_BUFFERED_OUTPUT]
OutputFileType outputFileType
Variable * tempVariables[MAX_PROCEDURES]
FileStorage * currentFileStorage
DataSegment * dataSegment
char * debuggerLabelsFileName
int tenLinerRulesEnforced
int peepholeOptimizationLimit
NumberConfig numberConfig
int arrayDimensionsEach[MAX_ARRAY_DIMENSIONS]
char * additionalInfoFileName
Pattern * globalVariablePatterns
ProtothreadConfig protothreadConfig
int arrayIndexes[MAX_NESTED_ARRAYS]
int arrayIndexesDirectEach[MAX_NESTED_ARRAYS][MAX_ARRAY_DIMENSIONS]
KeyboardConfig keyboardConfig
int residentDetectionEnabled
TileDescriptors * descriptors
GammaCorrection gammaCorrection
int dataLastAbsoluteAddress
VestigialConfig vestigialConfig
FloatTypePrecision precision
struct _MemoryArea * next
struct _Offsetting * next
OffsettingVariable * variables
struct _Variable * variable
struct _OffsettingVariable * next
unsigned char hardwareIndex
struct _ScreenMode * next
struct _StaticString * next
TileDescriptor * descriptor[512]
unsigned char * reflected
unsigned char * valueBuffer
Offsetting * offsettingFrames
struct _Variable * tileset
FloatTypePrecision precision
StaticString * valueString
struct _Variable * origin
Offsetting * offsettingSequences
TsxTileset * originalTileset
FloatTypePrecision arrayPrecision
int arrayDimensionsEach[MAX_ARRAY_DIMENSIONS]
int initializedByConstant
RGBi originalPalette[MAX_PALETTE]
char rchack_falling_balls_1163
char rchack_4gravity_1163
char rchack_pick_the_star_1163
char rchack_4gravity_1164
char rchack_ccarrots_1163
struct _TsxTileset TsxTileset
struct _ScreenMode ScreenMode
#define WARNING_DOWNCAST(v1, v2)
struct _Resource Resource
#define CRITICAL_CANNOT_READ_FILE(f, n)
#define FONT_SCHEMA_COMPLETE
#define CRITICAL_CONSTANT_ALREADY_DEFINED_AS_VARIABLE(f)
#define CRITICAL_DATATYPE_MISMATCH(v1, v2)
@ OUTPUT_FILE_TYPE_K7_NEW
@ OUTPUT_FILE_TYPE_K7_ORIGINAL
@ OUTPUT_FILE_TYPE_SDDRIVE
#define CRITICAL_RESIZE_UNSUPPORTED(t)
#define FONT_SCHEMA_SEMIGRAPHIC
#define CRITICAL_VARIABLE_TYPE_NEEDED(n)
#define CRITICAL_CANNOT_MOVE_PLACEHOLDERS_TO_IMAGE(v)
#define CRITICAL_CANNOT_COPY_SID_FILE(f)
#define CRITICAL_SUB_UNSUPPORTED(v, t)
#define CRITICAL_NOT_SUPPORTED(v)
#define CRITICAL_IMAGE_CONVERTER_INVALID_FRAME_HEIGHT(h, m)
struct _RGBi RGBi
Structure to store color components (red, green and blue).
#define CRITICAL_MID_UNSUPPORTED(v, t)
#define CRITICAL_CANNOT_FILL_RANDOM(v)
#define CRITICAL_LABEL_ALREADY_DEFINED(n)
#define CRITICAL_MID_UNSUPPORTED_FOR_STRING(s)
#define MAX_TEMPORARY_STORAGE
#define CRITICAL_UNKNOWN_FIELD_ON_TYPE(n)
struct _Offsetting Offsetting
#define CRITICAL_CANNOT_COMPARE(t1, t2)
#define CRITICAL_MISSING_FILE_STORAGE(v)
#define CRITICAL_IMAGE_CONVERTER_INVALID_OFFSET_Y(y)
struct _ArrayReference ArrayReference
#define CRITICAL_BIN_UNSUPPORTED(v, t)
#define FONT_SCHEMA_EMBEDDED
#define CRITICAL_XOR_UNSUPPORTED(v, t)
#define VT_ESIGN_16BIT(t, v)
#define CRITICAL_VARIABLE_REDEFINED_DIFFERENT_TYPE(f)
struct _TileDescriptors TileDescriptors
#define CRITICAL_CANNOT_STORE_BIT_ON_BANKED_ARRAY(v)
#define CRITICAL_ASC_UNSUPPORTED(v, t)
#define VT_OPTIMAL_SHIFT(s)
#define CRITICAL_STRING_UNSUPPORTED(v, t)
#define CRITICAL_VARIABLE_UNDEFINED(f)
#define CRITICAL_VARIABLE_CANNOT_DIRECT_ASSIGN_WRONG_TYPE(v, t)
#define CRITICAL_IMAGE_CONVERTER_INVALID_OFFSET_X(x)
#define FONT_SCHEMA_STANDARD
#define CRITICAL_CANNOT_OPEN_FILE(f, n)
#define MAX_ARRAY_DIMENSIONS
#define VT_ESIGN_32BIT(t, v)
#define CRITICAL_BIT_UNSUPPORTED(v, t)
#define CRITICAL_CANNOT_SWAP_DIFFERENT_DATATYPES(v1, v2)
#define CRITICAL_LINE_NUMBER_ALREADY_DEFINED(n)
#define CRITICAL_NOT_ARRAY(v)
#define CRITICAL_MUL2_UNSUPPORTED(v, t)
#define CRITICAL_CANNOT_MOVE_BIT_ON_BANKED_ARRAY(v)
#define CRITICAL_CANNOT_REMOVE_FILE(f, n)
#define CRITICAL_ARRAY_OUT_OF_BOUND(a)
#define CRITICAL_FILE_NOT_FOUND(n)
#define CRITICAL_CANNOT_USE_FIELD_ON_NONTYPE(n)
#define CRITICAL_PUT_IMAGE_NAMED_TILE_MISSING_TILESET(v)
struct _Variable Variable
Structure of a single variable.
#define CRITICAL_CANNOT_USE_STRINGS_LONGER_256_CHARS()
#define CRITICAL_CANNOT_MOVE_FROM_BIT_ON_BANKED_ARRAY(v)
#define CRITICAL_CHR_UNSUPPORTED(v, t)
#define CRITICAL_CANNOT_COPY_TO_BANKED(v)
#define CRITICAL_CANNOT_CAST_TILEMAP_SIZE(v)
#define CRITICAL_FILENAME_INVALID_COLON(v)
#define CRITICAL_IMAGE_CONVERTER_INVALID_HEIGHT(h, m)
#define CRITICAL_VARIABLE_IMPORTED_DIFFERENT_TYPE(f)
#define WARNING_BITWIDTH(v1, v2)
struct _Environment Environment
Structure of compilation environment.
struct _MemoryArea MemoryArea
#define CRITICAL_HEX2BIN_UNSUPPORTED_DATATYPE(v, s)
#define parse_embedded(p, s)
#define PATH_SEPARATOR_AS_STRING
#define CRITICAL_CANNOT_CAST(t1, t2)
struct _OffsettingVariable OffsettingVariable
#define CRITICAL_LEN_UNSUPPORTED(v, t)
#define CRITICAL_OR_UNSUPPORTED(v, t)
#define FONT_SCHEMA_ALPHA
struct _Constant Constant
Structure of a single constant.
#define CRITICAL_PUT_IMAGE_NAMED_TILE_NOT_FOUND(v)
#define CRITICAL_CANNOT_MOVE_STRING_ON_BANKED_ARRAY(v)
#define CRITICAL_CANNOT_COMPARE_SID_FILE(f)
#define CRITICAL_STORAGE_BANKED_UNCOMPATIBLE(v)
#define CRITICAL_CANNOT_WRITE_FILE(f, n)
#define CRITICAL_VARIABLE_ALREADY_DEFINED_AS_CONSTANT(f)
#define CRITICAL_IMAGE_CONVERTER_INVALID_WIDTH(w, m)
#define CRITICAL_STR_UNSUPPORTED(v, t)
#define CRITICAL_MOVE_NAKED_UNSUPPORTED(t)
#define CRITICAL_RESOURCE_LOAD_MISSING_FILE(f)
#define CRITICAL_FILENAME_INVALID_BACKSLASH(v)
#define CRITICAL_SWAP_DIFFERENT_BITWIDTH(v)
#define CRITICAL_LEFT_UNSUPPORTED(v, t)
#define VT_MAX_BITWIDTH_TYPE(a, b)
#define CRITICAL_CONSTANT_REDEFINED_DIFFERENT_TYPE(f)
#define CRITICAL_CONSTANT_REDEFINED_DIFFERENT_VALUE(f)
enum _FloatTypePrecision FloatTypePrecision
#define CRITICAL_DIV_UNSUPPORTED(v, t)
#define CRITICAL_UNKNOWN_TYPE(n)
#define CRITICAL_LOWER_UNSUPPORTED(v, t)
#define CRITICAL_SWAP_UNSUPPORTED(v, t)
#define CRITICAL_MUL2_INVALID_STEPS(v)
#define CRITICAL_CANNOT_CAST_FLOAT_PRECISION(v1, v2)
#define CRITICAL_XOR_INPLACE_UNSUPPORTED(v, t)
#define CRITICAL_BUFFER_SIZE_MISMATCH(v1, v2)
struct _StaticString StaticString
Structure of a single (static) string.
#define CRITICAL_IMAGE_CONVERTER_INVALID_FRAME_WIDTH(w, m)
struct _FileStorage FileStorage
Structure of a single file inside a storage.
#define VT_ESIGN_8BIT(t, v)
struct _TileDescriptor TileDescriptor
#define CRITICAL_VARIABLE_CANNOT_DIRECT_ASSIGN_DIFFERENT_TYPE(t1, t2)
#define CRITICAL_SUB_INPLACE_UNSUPPORTED(v, t)
#define CRITICAL_MUL_UNSUPPORTED(v, t)
struct _Label Label
Structure of a single label.
#define CRITICAL_DATATYPE_UNSUPPORTED(k, v)
#define BUILD_TOOLCHAIN_ASM6809_GET_EXECUTABLE(_environment, executableName)
#define CRITICAL_PUT_IMAGE_NAMED_TILE_MISSING_TILES_FROM_TILESET(v)
#define CRITICAL_CANNOT_CAST_BUFFER_STRING_SIZE(a, b)
#define CRITICAL_ADD_INPLACE_UNSUPPORTED(v, t)
#define CRITICAL_FILE_CSV_NOT_ENOUGH_DATA(n)
#define CRITICAL_CANNOT_CAST_FLOAT_32BIT_UNSIGNED(v)
enum _VariableType VariableType
Type of variables.
#define CRITICAL_INSTR_UNSUPPORTED(v, t)
#define VT_DIRECT_ASSIGN(t)
#define CRITICAL_DIV2_UNSUPPORTED(v, t)
#define WARNING_USE_OF_UNDEFINED_ARRAY(v1)
#define CRITICAL_VAL_UNSUPPORTED(v, t)
#define adilinepalette(s, c, p)
#define PROTOTHREAD_DEFAULT_COUNT
struct _DataSegment DataSegment
#define FONT_SCHEMA_ASCII
#define CRITICAL_PUT_IMAGE_NAMED_TILE_INVALID_PROBABILITY(v)
#define CRITICAL_CANNOT_STORE_FILE_ON_VARIABLE_OF_DIFFERENT_TYPE(v)
struct _Bank Bank
Structure of a single bank.
#define CRITICAL_HEX_UNSUPPORTED(v, t)
#define CRITICAL_CANNOT_FLIP(s)
#define CRITICAL_ADD_UNSUPPORTED(v, t)
#define CRITICAL_ARRAY_SIZE_MISMATCH(v, d1, d2)
struct _CopperList CopperList
#define TRACE2(s, p1, p2)
#define CRITICAL_AND_UNSUPPORTED(v, t)
#define CRITICAL_PUT_IMAGE_UNINITIALIZED(v)
#define CRITICAL_VARIABLE(v)
#define CRITICAL_COMPLEMENT_UNSUPPORTED(v, t)
struct _TileData TileData
struct _Procedure Procedure
#define CRITICAL_STORE_UNSUPPORTED(t)
#define CRITICAL_RIGHT_UNSUPPORTED(v, t)
#define CRITICAL_CANNOT_COMPARE_CONST(t)
#define CRITICAL_NOT_UNSUPPORTED(v, t)
void show_usage_and_exit(int _argc, char *_argv[])
Show usage and exit.
char OUTPUT_FILE_TYPE_AS_STRING[][16]
char DATATYPE_AS_STRING[][16]
Variable * vector_get_x(Environment *_environment, char *_vector)
Variable * vector_get_y(Environment *_environment, char *_vector)