added 'GO 65 SYS' construction to BASIC

This commit is contained in:
FeralChild64 committed 2020-09-03 17:40:43 +02:00
1 parent d2a9164757
commit 9a4e521eff
2 files changed
+32 -8

No files matched your search

+4
View File
@@ -103,3 +103,7 @@ A 'native' `SYS` - same as `SYS`, but does not switch to C64 compatibility mode.
### `GO 64`, `GO 65` (MEGA65)
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.
+28 -8
View File
@@ -6,7 +6,6 @@
cmd_go:
jsr fetch_character_skip_spaces
cmp #$A4 // 'TO' keyword
beq cmd_goto
@@ -35,7 +34,7 @@ cmd_go_syntax_error:
bcs cmd_go_rts
jsr helper_ask_if_sure
bcs cmd_go_rts
bcs_16 cmd_end
sec
jsr M65_MODESET // Carry set = switch to C64 mode
jmp_8 cmd_go_switchmode_clr_banner
@@ -46,12 +45,17 @@ cmd_go_syntax_error:
// If in C64 compatibility mode - switch to native mode
jsr M65_MODEGET
bcc cmd_go_rts
bcs !+
jsr cmd_go_sys_check
rts
!:
jsr helper_ask_if_sure
bcs cmd_go_rts
bcs_16 cmd_end
jsr M65_MODESET // Carry clear = switch to M65 mode
jsr cmd_go_sys_check
// FALLTROUGH
cmd_go_switchmode_clr_banner:
@@ -60,16 +64,32 @@ cmd_go_switchmode_clr_banner:
ldx CURLIN+1
inx
bne !+
jmp INITMSG
!:
rts
beq_16 INITMSG
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:
rts
#endif
cmd_run: