50 switch( variable->
type ) {
206 memset(
string, 0, variable->
size + 1 );
212 for (i=0; i<(variable->
size-1); ++i ) {
213 if ( ( ( i + 1 ) % 16 ) == 0 ) {
230 memset(
string, 0, variable->
size + 1 );
236 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 ) {
405 actual = actual->
next;
414 out1(
"OFFSETS%4.4x: dw ", actual->
size );
415 for( i=0; i<actual->
count; ++i ) {
417 if ( i < ( actual->
count - 1 ) ) {
425 while( actualVariable ) {
431 actualVariable = actualVariable->
next;
451 actual = actual->
next;
460 values[count] = actual->
size;
462 sprintf( address[count],
"fs%4.4xoffsetframe", actual->
size );
463 actual = actual->
next;
486 for (i=0; i<(len-1); ++i ) {
499 variable_cleanup_entry( _environment, variable );
500 variable_cleanup_entry_bit( _environment, variable );
503 outhead0(
"BITMASK: defm $01,$02,$04,$08,$10,$20,$40,$80");
504 outhead0(
"BITMASKN: defm $fe,$fd,$fb,$f7,$ef,$df,$bf,$7f");
512 variable_cleanup_entry( _environment, variable );
513 variable_cleanup_entry_bit( _environment, variable );
518 variable_cleanup_entry( _environment, variable );
519 variable_cleanup_entry_bit( _environment, variable );
524 actual = actual->
next;
531 while( dataSegment ) {
533 if ( dataSegment->
data ) {
539 while( dataDataSegment ) {
540 if ( dataSegment->
type ) {
542 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
size) );
543 out1(
"\"%s\"", dataDataSegment->
data );
545 for( i=0; i<(dataDataSegment->
size-1); ++i ) {
546 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
548 out1(
"$%2.2x", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
552 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
type) );
553 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
size) );
554 out1(
"\"%s\"", dataDataSegment->
data );
556 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
type) );
557 for( i=0; i<(dataDataSegment->
size-1); ++i ) {
558 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
560 out1(
"$%2.2x", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
563 dataDataSegment = dataDataSegment->
next;
564 if ( dataDataSegment ) {
569 dataSegment = dataSegment->
next;
577 while( staticStrings ) {
579 staticStrings = staticStrings->
next;
635 cpu_call( _environment,
"VARINIT" );
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_call(Environment *_environment, char *_label)
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 banks_generate(Environment *_environment)
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 deploy_inplace(s, e)
#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]