51 switch( variable->
type ) {
191 memset(
string, 0, variable->
size + 1 );
197 for (i=0; i<(variable->
size-1); ++i ) {
198 if ( ( ( i + 1 ) % 16 ) == 0 ) {
220 memset(
string, 0, variable->
size + 1 );
226 for (i=0; i<(variable->
size-1); ++i ) {
265 for (i=0; i<(variable->
size-1); ++i ) {
269 }
else if ( variable->
value ) {
274 for(
int i=0; i<(variable->
size/4)-1; ++i ) {
275 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 ) );
277 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 ) );
283 for(
int i=0; i<(variable->
size/2)-1; ++i ) {
284 out2(
"$%2.2x, $%2.2x,", (
unsigned int)( variable->
value & 0xff ), (
unsigned int)( ( variable->
value >> 8 ) & 0xff ) );
286 out2(
"$%2.2x, $%2.2x", (
unsigned int)( variable->
value & 0xff ), (
unsigned int)( ( variable->
value >> 8 ) & 0xff ) );
319 variable = variable->
next;
339 switch( variable->
type ) {
347 if ( bitCount == 8 ) {
355 variable = variable->
next;
359 if ( bitCount > 0 ) {
391 actual = actual->
next;
400 out1(
"OFFSETS%4.4x: dw ", actual->
size );
401 for( i=0; i<actual->
count; ++i ) {
403 if ( i < ( actual->
count - 1 ) ) {
411 while( actualVariable ) {
417 actualVariable = actualVariable->
next;
437 actual = actual->
next;
446 values[count] = actual->
size;
448 sprintf( address[count],
"fs%4.4xoffsetframe", actual->
size );
449 actual = actual->
next;
465 for (i=0; i<(len-1); ++i ) {
478 variable_cleanup_entry( _environment, variable );
479 variable_cleanup_entry_bit( _environment, variable );
482 outhead0(
"BITMASK: defm $01,$02,$04,$08,$10,$20,$40,$80");
483 outhead0(
"BITMASKN: defm $fe,$fd,$fb,$f7,$ef,$df,$bf,$7f");
491 variable_cleanup_entry( _environment, variable );
492 variable_cleanup_entry_bit( _environment, variable );
497 variable_cleanup_entry( _environment, variable );
498 variable_cleanup_entry_bit( _environment, variable );
503 actual = actual->
next;
542 while( dataSegment ) {
544 if ( dataSegment->
data ) {
550 while( dataDataSegment ) {
551 if ( dataSegment->
type ) {
553 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
size) );
554 out1(
"\"%s\"", dataDataSegment->
data );
556 for( i=0; i<(dataDataSegment->
size-1); ++i ) {
557 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
559 out1(
"$%2.2x", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
563 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
type) );
564 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
size) );
565 out1(
"\"%s\"", dataDataSegment->
data );
567 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
type) );
568 for( i=0; i<(dataDataSegment->
size-1); ++i ) {
569 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
571 out1(
"$%2.2x", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
574 dataDataSegment = dataDataSegment->
next;
575 if ( dataDataSegment ) {
580 dataSegment = dataSegment->
next;
588 while( staticStrings ) {
590 staticStrings = staticStrings->
next;
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]
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 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]