50 switch( variable->
type ) {
205 memset(
string, 0, variable->
size + 1 );
214 for (i=0; i<(variable->
size-1); ++i ) {
215 if ( ( ( i + 1 ) % 16 ) == 0 ) {
237 memset(
string, 0, variable->
size + 1 );
243 for (i=0; i<(variable->
size-1); ++i ) {
280 for (i=0; i<(variable->
size-1); ++i ) {
284 }
else if ( variable->
value ) {
289 for(
int i=0; i<(variable->
size/4)-1; ++i ) {
290 out4(
"$%2.2x, $%2.2x, $%2.2x, $%2.2x, ", (
unsigned int)( variable->
value & 0xff ), (
unsigned int)( ( variable->
value >> 8 ) & 0xff ), (
unsigned int)( ( variable->
value >> 16 ) & 0xff ), (
unsigned int)( ( variable->
value >> 24 ) & 0xff ) );
292 out4(
"$%2.2x, $%2.2x, $%2.2x, $%2.2x", (
unsigned int)( variable->
value & 0xff ), (
unsigned int)( ( variable->
value >> 8 ) & 0xff ), (
unsigned int)( ( variable->
value >> 16 ) & 0xff ), (
unsigned int)( ( variable->
value >> 24 ) & 0xff ) );
298 for(
int i=0; i<(variable->
size/2)-1; ++i ) {
299 out2(
"$%2.2x, $%2.2x,", (
unsigned int)( variable->
value & 0xff ), (
unsigned int)( ( variable->
value >> 8 ) & 0xff ) );
301 out2(
"$%2.2x, $%2.2x", (
unsigned int)( variable->
value & 0xff ), (
unsigned int)( ( variable->
value >> 8 ) & 0xff ) );
334 variable = variable->
next;
354 switch( variable->
type ) {
362 if ( bitCount == 8 ) {
370 variable = variable->
next;
374 if ( bitCount > 0 ) {
406 actual = actual->
next;
415 out1(
"OFFSETS%4.4x: dw ", actual->
size );
416 for( i=0; i<actual->
count; ++i ) {
418 if ( i < ( actual->
count - 1 ) ) {
426 while( actualVariable ) {
432 actualVariable = actualVariable->
next;
452 actual = actual->
next;
461 values[count] = actual->
size;
463 sprintf( address[count],
"fs%4.4xoffsetframe", actual->
size );
464 actual = actual->
next;
482 for (i=0; i<(len-2); ++i ) {
500 variable_cleanup_entry( _environment, variable );
501 variable_cleanup_entry_bit( _environment, variable );
504 outhead0(
"BITMASK: defm $01,$02,$04,$08,$10,$20,$40,$80");
505 outhead0(
"BITMASKN: defm $fe,$fd,$fb,$f7,$ef,$df,$bf,$7f");
513 variable_cleanup_entry( _environment, variable );
514 variable_cleanup_entry_bit( _environment, variable );
519 variable_cleanup_entry( _environment, variable );
520 variable_cleanup_entry_bit( _environment, variable );
525 actual = actual->
next;
599 while( dataSegment ) {
601 if ( dataSegment->
data ) {
607 while( dataDataSegment ) {
608 if ( dataSegment->
type ) {
610 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
size) );
611 out1(
"\"%s\"", dataDataSegment->
data );
613 for( i=0; i<(dataDataSegment->
size-1); ++i ) {
614 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
616 out1(
"$%2.2x", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
620 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
type) );
621 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
size) );
622 out1(
"\"%s\"", dataDataSegment->
data );
624 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
type) );
625 for( i=0; i<(dataDataSegment->
size-1); ++i ) {
626 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
628 out1(
"$%2.2x", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
631 dataDataSegment = dataDataSegment->
next;
632 if ( dataDataSegment ) {
637 dataSegment = dataSegment->
next;
645 while( staticStrings ) {
647 staticStrings = staticStrings->
next;
692 outhead1(
"BANKWINDOWID%2.2x: db $FF, $FF", i );
void vars_emit_constants(Environment *_environment)
void vars_emit_strips(Environment *_environment, char *_name, Strip *_strips)
void cpu_address_table_build(Environment *_environment, char *_table, int *_values, char *_address[], int _count)
void cpu_address_table_lookup(Environment *_environment, char *_table, int _count)
#define VT_FLOAT_NORMALIZED_POW2_WIDTH(p)
void vars_emit_word(Environment *_environment, char *_name, int _value)
void vars_emit_dword(Environment *_environment, char *_name, int _value)
void vars_emit_number(Environment *_environment, char *_name, int _value)
void vars_emit_byte(Environment *_environment, char *_name, int _value)
void buffered_prepend_output(Environment *_environment)
char * escape_newlines(char *_string)
void buffered_push_output(Environment *_environment)
void variable_cleanup(Environment *_environment)
Emit source and configuration lines for variables.
char BANK_TYPE_AS_STRING[][16]
Description of BANK TYPE, in readable format.
#define DSTRING_DEFAULT_SPACE
void generate_cgoto_address_table(Environment *_environment)
void variable_on_memory_init(Environment *_environment, int _imported_too)
StaticString * valueString
struct _DataDataSegment * next
struct _DataSegment * next
Variable * tempResidentVariables
Bank * banks[BANK_TYPE_COUNT]
int maxExpansionBankSize[MAX_RESIDENT_SHAREDS]
OutputFileType outputFileType
Variable * tempVariables[MAX_PROCEDURES]
DataSegment * dataSegment
FILE * debuggerLabelsFile
TileDescriptors * descriptors
struct _Offsetting * next
OffsettingVariable * variables
struct _Variable * variable
struct _OffsettingVariable * next
struct _StaticString * next
unsigned char * valueBuffer
StaticString * valueString
FloatTypePrecision arrayPrecision
#define out4(s, a, b, c, d)
#define deploy_inplace_preferred(s, e)
#define BANK_TYPE_COUNT
Maximum number of bank types.
#define MAX_TEMPORARY_STORAGE
struct _Offsetting Offsetting
#define MAX_RESIDENT_SHAREDS
#define outline3(s, a, b, c)
struct _Variable Variable
Structure of a single variable.
#define outline2(s, a, b)
struct _Environment Environment
Structure of compilation environment.
struct _OffsettingVariable OffsettingVariable
#define outhead4(s, a, b, c, d)
struct _Constant Constant
Structure of a single constant.
struct _StaticString StaticString
Structure of a single (static) string.
#define outhead2(s, a, b)
#define CRITICAL_DATATYPE_UNSUPPORTED(k, v)
struct _DataDataSegment DataDataSegment
struct _DataSegment DataSegment
struct _Bank Bank
Structure of a single bank.
char DATATYPE_AS_STRING[][16]