added 'GO 65 SYS' construction to BASIC
This commit is contained in:
1 parent
d2a9164757
commit
9a4e521eff
2 files changed
+32
-8
No files matched your search
@@ -103,3 +103,7 @@ A 'native' `SYS` - same as `SYS`, but does not switch to C64 compatibility mode.
|
|||||||
### `GO 64`, `GO 65` (MEGA65)
|
### `GO 64`, `GO 65` (MEGA65)
|
||||||
|
|
||||||
Switches machine to C64 compatibility mode or to MEGA65 native mode. Performs `CLR`
|
Switches machine to C64 compatibility mode or to MEGA65 native mode. Performs `CLR`
|
||||||
|
|
||||||
|
### `GO 65 SYS` (MEGA65)
|
||||||
|
|
||||||
|
The same as `GO 65: NSYS`, but does not need tokens unknown to C64 BASIC V2. Intended for usage in 'fat binaries' only.
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
cmd_go:
|
cmd_go:
|
||||||
|
|
||||||
jsr fetch_character_skip_spaces
|
jsr fetch_character_skip_spaces
|
||||||
|
|
||||||
cmp #$A4 // 'TO' keyword
|
cmp #$A4 // 'TO' keyword
|
||||||
beq cmd_goto
|
beq cmd_goto
|
||||||
|
|
||||||
@@ -35,7 +34,7 @@ cmd_go_syntax_error:
|
|||||||
bcs cmd_go_rts
|
bcs cmd_go_rts
|
||||||
|
|
||||||
jsr helper_ask_if_sure
|
jsr helper_ask_if_sure
|
||||||
bcs cmd_go_rts
|
bcs_16 cmd_end
|
||||||
sec
|
sec
|
||||||
jsr M65_MODESET // Carry set = switch to C64 mode
|
jsr M65_MODESET // Carry set = switch to C64 mode
|
||||||
jmp_8 cmd_go_switchmode_clr_banner
|
jmp_8 cmd_go_switchmode_clr_banner
|
||||||
@@ -46,12 +45,17 @@ cmd_go_syntax_error:
|
|||||||
// If in C64 compatibility mode - switch to native mode
|
// If in C64 compatibility mode - switch to native mode
|
||||||
|
|
||||||
jsr M65_MODEGET
|
jsr M65_MODEGET
|
||||||
bcc cmd_go_rts
|
bcs !+
|
||||||
|
jsr cmd_go_sys_check
|
||||||
|
rts
|
||||||
|
|
||||||
|
!:
|
||||||
jsr helper_ask_if_sure
|
jsr helper_ask_if_sure
|
||||||
bcs cmd_go_rts
|
bcs_16 cmd_end
|
||||||
jsr M65_MODESET // Carry clear = switch to M65 mode
|
jsr M65_MODESET // Carry clear = switch to M65 mode
|
||||||
|
|
||||||
|
jsr cmd_go_sys_check
|
||||||
|
|
||||||
// FALLTROUGH
|
// FALLTROUGH
|
||||||
|
|
||||||
cmd_go_switchmode_clr_banner:
|
cmd_go_switchmode_clr_banner:
|
||||||
@@ -60,16 +64,32 @@ cmd_go_switchmode_clr_banner:
|
|||||||
|
|
||||||
ldx CURLIN+1
|
ldx CURLIN+1
|
||||||
inx
|
inx
|
||||||
bne !+
|
beq_16 INITMSG
|
||||||
jmp INITMSG
|
|
||||||
!:
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
lda #147
|
||||||
|
jmp JCHROUT
|
||||||
|
|
||||||
|
cmd_go_sys_check:
|
||||||
|
|
||||||
|
// Check for 'GO 65 SYS' construction
|
||||||
|
|
||||||
|
jsr fetch_character_skip_spaces
|
||||||
|
cmp #$9E // 'SYS' keyword
|
||||||
|
bne !+
|
||||||
|
|
||||||
|
pla
|
||||||
|
pla
|
||||||
|
jmp cmd_nsys
|
||||||
|
!:
|
||||||
|
dew TXTPTR // unconsume character
|
||||||
|
|
||||||
|
// FALLTROUGH
|
||||||
|
|
||||||
cmd_go_rts:
|
cmd_go_rts:
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cmd_run:
|
cmd_run:
|
||||||
|
|||||||
Reference in new issue
Block a user