56 switch( variable->
type ) {
187 memset(
string, 0, variable->
size + 1 );
193 for (i=0; i<(variable->
size-1); ++i ) {
194 if ( ( ( i + 1 ) % 16 ) == 0 ) {
211 memset(
string, 0, variable->
size + 1 );
217 for (i=0; i<(variable->
size-1); ++i ) {
245 for (i=0; i<(variable->
size-1); ++i ) {
249 }
else if ( variable->
value ) {
254 for(
int i=0; i<(variable->
size/4)-1; ++i ) {
255 out4(
"$%2.2x, $%2.2x, $%2.2x, $%2.2x, ", (
unsigned int)( ( variable->
value >> 24 ) & 0xff ), (
unsigned int)( ( variable->
value >> 16 ) & 0xff ), (
unsigned int)( ( variable->
value >> 8 ) & 0xff ), (
unsigned int)( variable->
value & 0xff ) );
257 out4(
"$%2.2x, $%2.2x, $%2.2x, $%2.2x", (
unsigned int)( ( variable->
value >> 24 ) & 0xff ), (
unsigned int)( ( variable->
value >> 16 ) & 0xff ), (
unsigned int)( ( variable->
value >> 8 ) & 0xff ), (
unsigned int)( variable->
value & 0xff ) );
263 for(
int i=0; i<(variable->
size/2)-1; ++i ) {
264 out2(
"$%2.2x, $%2.2x,", (
unsigned int)( ( variable->
value >> 8 ) & 0xff ), (
unsigned int)( variable->
value & 0xff ) );
266 out2(
"$%2.2x, $%2.2x", (
unsigned int)( ( variable->
value >> 8 ) & 0xff ), (
unsigned int)( variable->
value & 0xff ) );
296 variable = variable->
next;
316 switch( variable->
type ) {
324 if ( bitCount == 8 ) {
332 variable = variable->
next;
336 if ( bitCount > 0 ) {
365 actual = actual->
next;
376 for( i=0; i<actual->
count; ++i ) {
378 if ( i < ( actual->
count - 1 ) ) {
386 while( actualVariable ) {
392 actualVariable = actualVariable->
next;
404 actual = actual->
next;
413 values[count] = actual->
size;
415 sprintf( address[count],
"fs%4.4xoffsetframe", actual->
size );
416 actual = actual->
next;
432 outhead1(
"BANKWINDOWID%2.2x fcb $FF, $FF", i );
446 variable_cleanup_entry( _environment, variable );
447 variable_cleanup_entry_bit( _environment, variable );
456 variable_cleanup_entry( _environment, variable );
457 variable_cleanup_entry_bit( _environment, variable );
462 variable_cleanup_entry( _environment, variable );
463 variable_cleanup_entry_bit( _environment, variable );
471 actual = actual->
next;
478 while( dataSegment ) {
480 if ( dataSegment->
data ) {
486 while( dataDataSegment ) {
487 if ( dataSegment->
type ) {
489 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
size) );
490 out1(
"\"%s\"", dataDataSegment->
data );
492 for( i=0; i<(dataDataSegment->
size-1); ++i ) {
493 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
495 out1(
"$%2.2x", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
499 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
type) );
500 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
size) );
501 out1(
"\"%s\"", dataDataSegment->
data );
503 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
type) );
504 for( i=0; i<(dataDataSegment->
size-1); ++i ) {
505 out1(
"$%2.2x,", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
507 out1(
"$%2.2x", (
unsigned char)(dataDataSegment->
data[i]&0xff) );
510 if ( dataDataSegment->
next && dataDataSegment->
size ) {
513 dataDataSegment = dataDataSegment->
next;
516 dataSegment = dataSegment->
next;
524 while( staticStrings ) {
525 outhead2(
"cstring%d fcb %d", staticStrings->
id, (
int)strlen(staticStrings->
value) );
526 if ( strlen( staticStrings->
value ) > 0 ) {
529 staticStrings = staticStrings->
next;
548 outhead0(
"BITMASK fcb $01,$02,$04,$08,$10,$20,$40,$80");
549 outhead0(
"BITMASKN fcb $fe,$fd,$fb,$f7,$ef,$df,$bf,$7f");
567 outhead0(
"IRQSTACKEND fcb $00, 00");
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)
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.
void plot(Environment *_environment, char *_x, char *_y, char *_c, int _preserve_color)
#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)
struct _DataDataSegment * next
struct _DataSegment * next
Variable * tempResidentVariables
Bank * banks[BANK_TYPE_COUNT]
int maxExpansionBankSize[MAX_RESIDENT_SHAREDS]
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
#define out4(s, a, b, c, d)
#define deploy_inplace_preferred(s, e)
#define BANK_TYPE_COUNT
Maximum number of bank types.
#define CRITICAL_INVALID_PROGRAM_START(a)
#define MAX_TEMPORARY_STORAGE
struct _Offsetting Offsetting
#define MAX_RESIDENT_SHAREDS
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)
#define outhead3(s, a, b, c)
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]