added fetching PI to expression parser, fixed compilation warning
This commit is contained in:
1 parent
a70ce20f30
commit
cfc970e21a
4 files changed
+28
-17
No files matched your search
@@ -72,6 +72,8 @@ cmd_print_float:
|
|||||||
// XXX probably we should also check INTFLG here
|
// XXX probably we should also check INTFLG here
|
||||||
// XXX provide implementation
|
// XXX provide implementation
|
||||||
|
|
||||||
|
jmp do_NOT_IMPLEMENTED_error
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
|
|
||||||
cmd_print_next_arg:
|
cmd_print_next_arg:
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
|
||||||
|
// #LAYOUT# * BASIC_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
// Just a compatibility jump - our routine is longer than original one
|
||||||
|
|
||||||
|
jmp FRMEVL
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
// #LAYOUT# STD * #TAKE
|
// #LAYOUT# STD * #TAKE
|
||||||
// #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000
|
|
||||||
// #LAYOUT# * BASIC_0 #TAKE
|
// #LAYOUT# * BASIC_0 #TAKE
|
||||||
// #LAYOUT# * * #IGNORE
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
@@ -19,7 +18,7 @@
|
|||||||
// in a correct order
|
// in a correct order
|
||||||
//
|
//
|
||||||
|
|
||||||
// XXX finish the implementation: invoking functions, fetcching PI, fetching float, fetching variables
|
// XXX finish the implementation: invoking functions, fetching floats
|
||||||
|
|
||||||
|
|
||||||
FRMEVL:
|
FRMEVL:
|
||||||
@@ -78,7 +77,7 @@ FRMEVL_loop:
|
|||||||
dew TXTPTR
|
dew TXTPTR
|
||||||
#endif
|
#endif
|
||||||
jsr fetch_variable
|
jsr fetch_variable
|
||||||
bcs !+
|
bcs FRMEVL_fetch_float
|
||||||
|
|
||||||
// Found the variable - copy descriptor to FAC1
|
// Found the variable - copy descriptor to FAC1
|
||||||
|
|
||||||
@@ -116,17 +115,6 @@ FRMEVL_loop:
|
|||||||
|
|
||||||
jmp_8 FRMEVL_got_value
|
jmp_8 FRMEVL_got_value
|
||||||
|
|
||||||
!:
|
|
||||||
// There is one possibility left - a floating point value
|
|
||||||
|
|
||||||
|
|
||||||
// XXX implement this part
|
|
||||||
|
|
||||||
|
|
||||||
// Nothing recognized
|
|
||||||
|
|
||||||
jmp do_SYNTAX_error
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// This subroutine handles the situation when we have to execute a BASIC function
|
// This subroutine handles the situation when we have to execute a BASIC function
|
||||||
// in place when parser normally expects a value
|
// in place when parser normally expects a value
|
||||||
@@ -175,9 +163,11 @@ FRMEVL_handle_bracket:
|
|||||||
|
|
||||||
FRMEVL_fetch_PI:
|
FRMEVL_fetch_PI:
|
||||||
|
|
||||||
// XXX implement this
|
lda #<const_PI
|
||||||
|
ldy #>const_PI
|
||||||
|
jsr mov_MEM_FAC1
|
||||||
|
|
||||||
jmp do_NOT_IMPLEMENTED_error
|
jmp_8 FRMEVL_got_value_float
|
||||||
|
|
||||||
//
|
//
|
||||||
// This subroutine fetches the floating point value from the 'outside world'
|
// This subroutine fetches the floating point value from the 'outside world'
|
||||||
@@ -189,6 +179,14 @@ FRMEVL_fetch_float:
|
|||||||
|
|
||||||
jmp do_NOT_IMPLEMENTED_error
|
jmp do_NOT_IMPLEMENTED_error
|
||||||
|
|
||||||
|
// FALLTROUGH
|
||||||
|
|
||||||
|
FRMEVL_got_value_float:
|
||||||
|
|
||||||
|
lda #$00
|
||||||
|
sta VALTYP
|
||||||
|
beq FRMEVL_got_value
|
||||||
|
|
||||||
//
|
//
|
||||||
// This subroutine fetches the string value from the 'outside world'
|
// This subroutine fetches the string value from the 'outside world'
|
||||||
//
|
//
|
||||||
+4
-1
@@ -108,13 +108,16 @@ void abort_(const char * s, ...)
|
|||||||
void read_png_file(char* file_name)
|
void read_png_file(char* file_name)
|
||||||
{
|
{
|
||||||
unsigned char header[8]; // 8 is the maximum size that can be checked
|
unsigned char header[8]; // 8 is the maximum size that can be checked
|
||||||
|
size_t readResult;
|
||||||
|
|
||||||
/* open file and test for it being a png */
|
/* open file and test for it being a png */
|
||||||
infile = fopen(file_name, "rb");
|
infile = fopen(file_name, "rb");
|
||||||
if (infile == NULL)
|
if (infile == NULL)
|
||||||
abort_("[read_png_file] File %s could not be opened for reading", file_name);
|
abort_("[read_png_file] File %s could not be opened for reading", file_name);
|
||||||
|
|
||||||
fread(header, 1, 8, infile);
|
readResult = fread(header, 1, 8, infile);
|
||||||
|
if (readResult != 8)
|
||||||
|
abort_("[read_png_file] File %s could not be read", file_name);
|
||||||
if (png_sig_cmp(header, 0, 8))
|
if (png_sig_cmp(header, 0, 8))
|
||||||
abort_("[read_png_file] File %s is not recognized as a PNG file", file_name);
|
abort_("[read_png_file] File %s is not recognized as a PNG file", file_name);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user