changed handling of external token lists

This commit is contained in:
FeralChild64 committed 2020-07-21 17:45:24 +02:00
1 parent 151b9440dd
commit 985a0882f6
29 files changed
+295 -316

No files matched your search

@@ -0,0 +1,58 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Jumptable for BASIC commands with tokens prefixed by $01
//
.const command_01_list = List().add(
cmd_slow,
cmd_fast,
cmd_old,
// NOTE! These commands are temporarily placed here, they should be a part of list 02!
cmd_merge,
cmd_bload,
cmd_bsave,
cmd_bverify,
cmd_clear,
varstr_garbage_collect // cmd_dispose
)
#if !HAS_OPCODES_65C02
command_01_jumptable_lo:
put_jumptable_lo(command_01_list)
command_01_jumptable_hi:
put_jumptable_hi(command_01_list)
#else // HAS_OPCODES_65C02
__before_command_01_jumptable:
.if (mod(*, $2) == 1) { brk } // align code so that vector never crosses page boundary
command_01_jumptable:
put_jumptable(command_01_list)
// Make sure routine size is always the same - build system limitation
.if (__before_command_01_jumptable == command_01_jumptable) { brk }
#endif
@@ -0,0 +1,77 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
#if CONFIG_MB_MEGA_65
// Command implementation for Mega65
// XXX - I think there are some bit-set instructions in 65CE02...
cmd_slow:
lda #$40
skip_2_bytes_trash_nvz
// FALLTROUGH
cmd_fast:
lda #$41
sta CPU_D6510
rts
#elif CONFIG_MB_ULTIMATE_64
// Command implementation for Ultimate 64 - SuperCPU compatible way should be enough
cmd_slow:
sta SCPU_SPEED_NORMAL
rts
cmd_fast:
sta SCPU_SPEED_TURBO
rts
#elif CONFIG_PLATFORM_COMMODORE_64
// Command implementation for generic C64 platform
cmd_slow:
// Try to disable turbo in SuperCPU compatible way
sta SCPU_SPEED_NORMAL
// Try to disable turbo mode in C128 compatible way
lda #$00
beq !+ // branch always
cmd_fast:
// Try to enable turbo in SuperCPU compatible way
sta SCPU_SPEED_TURBO
// Try to enable turbo mode in C128 compatible way
lda #$01
!:
sta VIC_CLKRATE
rts
#else
cmd_slow:
nop // just to prevent double label
// FALLTROUGH
cmd_fast:
jmp do_NOT_IMPLEMENTED_error
#endif
+24
View File
@@ -0,0 +1,24 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
cmd_old:
// First make sure we are in direct mode
ldx CURLIN+1
inx
bne_16 do_DIRECT_MODE_ONLY_error
// Now try to restore program linkage and VARTAB
ldy #$01
tya
sta (TXTTAB),y
jsr update_LINKPRG_VARTAB_do_clr
// Quit
jmp end_of_program