moved most of the LIST command to Mega65 extra ROM
This commit is contained in:
1 parent
1665098ac9
commit
ebf8bf4eb7
12 files changed
+165
-113
No files matched your search
@@ -12,13 +12,14 @@ SRCDIR_BASIC = $(SRCDIR_COMMON) \
|
|||||||
c64/basic \
|
c64/basic \
|
||||||
c64/basic/,stubs \
|
c64/basic/,stubs \
|
||||||
c64/basic/,stubs_math \
|
c64/basic/,stubs_math \
|
||||||
|
c64/basic/assets \
|
||||||
c64/basic/board_m65 \
|
c64/basic/board_m65 \
|
||||||
c64/basic/board_x16 \
|
c64/basic/board_x16 \
|
||||||
c64/basic/commands \
|
c64/basic/commands \
|
||||||
c64/basic/init \
|
c64/basic/init \
|
||||||
c64/basic/math \
|
c64/basic/math \
|
||||||
c64/basic/math_consts \
|
c64/basic/math_consts \
|
||||||
c64/basic/packed_strings \
|
c64/basic/print \
|
||||||
c64/basic/rom_revision
|
c64/basic/rom_revision
|
||||||
|
|
||||||
SRCDIR_KERNAL = $(SRCDIR_COMMON) \
|
SRCDIR_KERNAL = $(SRCDIR_COMMON) \
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -12,11 +12,13 @@
|
|||||||
// Label definitions
|
// Label definitions
|
||||||
|
|
||||||
.label VB1__INITMSG = $4000 + 2 * 0
|
.label VB1__INITMSG = $4000 + 2 * 0
|
||||||
|
.label VB1__list_single_line = $4000 + 2 * 1
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// Vector table (OpenROMs private!)
|
// Vector table (OpenROMs private!)
|
||||||
|
|
||||||
.word INITMSG
|
.word INITMSG
|
||||||
|
.word list_single_line
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -8,13 +8,17 @@
|
|||||||
#import "BASIC_0_combined.sym"
|
#import "BASIC_0_combined.sym"
|
||||||
|
|
||||||
|
|
||||||
|
.label peek_under_roms = BASIC_0.proxy_B1_peek_under_roms
|
||||||
.label JCHROUT = BASIC_0.proxy_B1_JCHROUT
|
.label JCHROUT = BASIC_0.proxy_B1_JCHROUT
|
||||||
.label plot_set = KERNAL_0.plot_set
|
.label plot_set = KERNAL_0.plot_set
|
||||||
|
|
||||||
.label basic_do_new = BASIC_0.proxy_B1_basic_do_new
|
.label basic_do_new = BASIC_0.proxy_B1_basic_do_new
|
||||||
|
.label packed_keywords = BASIC_0.packed_keywords
|
||||||
|
.label packed_word_search = BASIC_0.packed_word_search
|
||||||
.label rom_revision_basic_string = BASIC_0.rom_revision_basic_string
|
.label rom_revision_basic_string = BASIC_0.rom_revision_basic_string
|
||||||
.label print_integer = BASIC_0.proxy_B1_print_integer
|
.label print_integer = BASIC_0.proxy_B1_print_integer
|
||||||
.label print_packed_message = BASIC_0.proxy_B1_print_packed_message
|
.label print_packed_message = BASIC_0.proxy_B1_print_packed_message
|
||||||
|
.label print_return = BASIC_0.proxy_B1_print_return
|
||||||
|
.label print_space = BASIC_0.proxy_B1_print_space
|
||||||
#if CONFIG_SHOW_PAL_NTSC
|
#if CONFIG_SHOW_PAL_NTSC
|
||||||
.label print_pal_ntsc = BASIC_0.proxy_B1_print_pal_ntsc
|
.label print_pal_ntsc = BASIC_0.proxy_B1_print_pal_ntsc
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,6 +6,17 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
|
proxy_B1_peek_under_roms:
|
||||||
|
|
||||||
|
jsr map_NORMAL
|
||||||
|
#if CONFIG_MEMORY_MODEL_60K
|
||||||
|
jsr peek_under_roms
|
||||||
|
#else // CONFIG_MEMORY_MODEL_38K
|
||||||
|
lda (OLDTXT),y
|
||||||
|
#endif
|
||||||
|
jmp map_BASIC_1
|
||||||
|
|
||||||
|
|
||||||
proxy_B1_JCHROUT:
|
proxy_B1_JCHROUT:
|
||||||
|
|
||||||
jsr map_NORMAL
|
jsr map_NORMAL
|
||||||
@@ -33,6 +44,21 @@ proxy_B1_print_packed_message:
|
|||||||
jsr print_packed_message
|
jsr print_packed_message
|
||||||
jmp map_BASIC_1
|
jmp map_BASIC_1
|
||||||
|
|
||||||
|
|
||||||
|
proxy_B1_print_return:
|
||||||
|
|
||||||
|
jsr map_NORMAL
|
||||||
|
jsr print_return
|
||||||
|
jmp map_BASIC_1
|
||||||
|
|
||||||
|
|
||||||
|
proxy_B1_print_space:
|
||||||
|
|
||||||
|
jsr map_NORMAL
|
||||||
|
jsr print_space
|
||||||
|
jmp map_BASIC_1
|
||||||
|
|
||||||
|
|
||||||
#if CONFIG_SHOW_PAL_NTSC
|
#if CONFIG_SHOW_PAL_NTSC
|
||||||
|
|
||||||
proxy_B1_print_pal_ntsc:
|
proxy_B1_print_pal_ntsc:
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ cmd_list:
|
|||||||
// Set current line pointer to start of memory
|
// Set current line pointer to start of memory
|
||||||
jsr init_oldtxt
|
jsr init_oldtxt
|
||||||
|
|
||||||
|
// Always start with empty line, for readability
|
||||||
|
jsr print_return
|
||||||
|
|
||||||
list_loop:
|
list_loop:
|
||||||
|
|
||||||
ldy #1
|
ldy #1
|
||||||
@@ -39,114 +42,3 @@ list_more_lines:
|
|||||||
// Now link to the next line
|
// Now link to the next line
|
||||||
jsr basic_find_next_line
|
jsr basic_find_next_line
|
||||||
jmp list_loop
|
jmp list_loop
|
||||||
|
|
||||||
list_single_line: // entry point needed by DOS wedge
|
|
||||||
// Print line number
|
|
||||||
ldy #3
|
|
||||||
|
|
||||||
#if CONFIG_MEMORY_MODEL_60K
|
|
||||||
jsr peek_under_roms
|
|
||||||
#else // CONFIG_MEMORY_MODEL_38K
|
|
||||||
lda (OLDTXT),y
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pha
|
|
||||||
dey
|
|
||||||
|
|
||||||
#if CONFIG_MEMORY_MODEL_60K
|
|
||||||
jsr peek_under_roms
|
|
||||||
#else // CONFIG_MEMORY_MODEL_38K
|
|
||||||
lda (OLDTXT),y
|
|
||||||
#endif
|
|
||||||
|
|
||||||
tax
|
|
||||||
pla
|
|
||||||
jsr print_integer
|
|
||||||
jsr print_space
|
|
||||||
|
|
||||||
// Iterate through printing out the line
|
|
||||||
// contents
|
|
||||||
lda #0
|
|
||||||
sta QTSW
|
|
||||||
|
|
||||||
ldy #4
|
|
||||||
list_print_loop:
|
|
||||||
|
|
||||||
#if CONFIG_MEMORY_MODEL_60K
|
|
||||||
ldx #<OLDTXT
|
|
||||||
jsr peek_under_roms
|
|
||||||
cmp #$00
|
|
||||||
#else // CONFIG_MEMORY_MODEL_38K
|
|
||||||
lda (OLDTXT),y
|
|
||||||
#endif
|
|
||||||
|
|
||||||
beq list_end_of_line
|
|
||||||
cmp #$22
|
|
||||||
bne list_not_quote
|
|
||||||
lda QTSW
|
|
||||||
eor #$FF
|
|
||||||
sta QTSW
|
|
||||||
lda #$22
|
|
||||||
jmp list_is_literal
|
|
||||||
|
|
||||||
list_not_quote:
|
|
||||||
// Check quote mode, and display as literal if required
|
|
||||||
ldx QTSW
|
|
||||||
bne list_is_literal
|
|
||||||
|
|
||||||
cmp #$FF
|
|
||||||
beq list_is_pi
|
|
||||||
|
|
||||||
cmp #$7F
|
|
||||||
bcc list_is_literal
|
|
||||||
|
|
||||||
// Display a token
|
|
||||||
|
|
||||||
// Save registers
|
|
||||||
tax
|
|
||||||
pha
|
|
||||||
phy_trash_a
|
|
||||||
|
|
||||||
// Get pointer to compressed keyword list
|
|
||||||
lda #<packed_keywords
|
|
||||||
sta FRESPC+0
|
|
||||||
lda #>packed_keywords
|
|
||||||
sta FRESPC+1
|
|
||||||
|
|
||||||
// Subtract $80 from token to get offset in word
|
|
||||||
// list
|
|
||||||
txa
|
|
||||||
and #$7f
|
|
||||||
tax
|
|
||||||
|
|
||||||
// Now ask for it to be printed
|
|
||||||
ldy #$ff
|
|
||||||
jsr packed_word_search
|
|
||||||
|
|
||||||
ply_trash_a
|
|
||||||
pla
|
|
||||||
|
|
||||||
cmp #$8f
|
|
||||||
bne list_not_rem
|
|
||||||
// REM command locks quote flag on until the end of the line, allowing
|
|
||||||
// funny characters in REM statements without problem.
|
|
||||||
sta QTSW // Any value other than $00 or $FF will lock quote mode on, so the token value of REM is fine here
|
|
||||||
// FALL THROUGH
|
|
||||||
list_not_rem:
|
|
||||||
|
|
||||||
iny
|
|
||||||
bne list_print_loop // branch always
|
|
||||||
|
|
||||||
list_is_pi:
|
|
||||||
lda #$7E
|
|
||||||
|
|
||||||
// FALLTROUGH
|
|
||||||
|
|
||||||
list_is_literal:
|
|
||||||
jsr JCHROUT
|
|
||||||
iny
|
|
||||||
bne list_print_loop
|
|
||||||
|
|
||||||
list_end_of_line:
|
|
||||||
// Print end of line
|
|
||||||
jmp print_return
|
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# M65 * #TAKE
|
||||||
|
// #LAYOUT# X16 BASIC_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
list_single_line:
|
||||||
|
|
||||||
|
#if (ROM_LAYOUT_M65 && SEGMENT_BASIC_0)
|
||||||
|
|
||||||
|
jsr map_BASIC_1
|
||||||
|
jsr_ind VB1__list_single_line
|
||||||
|
jmp map_NORMAL
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// Print line number
|
||||||
|
ldy #3
|
||||||
|
|
||||||
|
#if ROM_LAYOUT_M65 || CONFIG_MEMORY_MODEL_60K
|
||||||
|
jsr peek_under_roms
|
||||||
|
#else
|
||||||
|
lda (OLDTXT),y
|
||||||
|
#endif
|
||||||
|
|
||||||
|
pha
|
||||||
|
dey
|
||||||
|
|
||||||
|
#if ROM_LAYOUT_M65 || CONFIG_MEMORY_MODEL_60K
|
||||||
|
jsr peek_under_roms
|
||||||
|
#else
|
||||||
|
lda (OLDTXT),y
|
||||||
|
#endif
|
||||||
|
|
||||||
|
tax
|
||||||
|
pla
|
||||||
|
jsr print_integer
|
||||||
|
jsr print_space
|
||||||
|
|
||||||
|
// Iterate through printing out the line
|
||||||
|
// contents
|
||||||
|
lda #0
|
||||||
|
sta QTSW
|
||||||
|
|
||||||
|
ldy #4
|
||||||
|
list_print_loop:
|
||||||
|
|
||||||
|
#if ROM_LAYOUT_M65 || CONFIG_MEMORY_MODEL_60K
|
||||||
|
ldx #<OLDTXT
|
||||||
|
jsr peek_under_roms
|
||||||
|
cmp #$00
|
||||||
|
#else
|
||||||
|
lda (OLDTXT),y
|
||||||
|
#endif
|
||||||
|
|
||||||
|
beq list_end_of_line
|
||||||
|
cmp #$22
|
||||||
|
bne list_not_quote
|
||||||
|
lda QTSW
|
||||||
|
eor #$FF
|
||||||
|
sta QTSW
|
||||||
|
lda #$22
|
||||||
|
jmp list_is_literal
|
||||||
|
|
||||||
|
list_not_quote:
|
||||||
|
// Check quote mode, and display as literal if required
|
||||||
|
ldx QTSW
|
||||||
|
bne list_is_literal
|
||||||
|
|
||||||
|
cmp #$FF
|
||||||
|
beq list_is_pi
|
||||||
|
|
||||||
|
cmp #$7F
|
||||||
|
bcc list_is_literal
|
||||||
|
|
||||||
|
// Display a token
|
||||||
|
|
||||||
|
// Save registers
|
||||||
|
tax
|
||||||
|
pha
|
||||||
|
phy_trash_a
|
||||||
|
|
||||||
|
// Get pointer to compressed keyword list
|
||||||
|
lda #<packed_keywords
|
||||||
|
sta FRESPC+0
|
||||||
|
lda #>packed_keywords
|
||||||
|
sta FRESPC+1
|
||||||
|
|
||||||
|
// Subtract $80 from token to get offset in word
|
||||||
|
// list
|
||||||
|
txa
|
||||||
|
and #$7f
|
||||||
|
tax
|
||||||
|
|
||||||
|
// Now ask for it to be printed
|
||||||
|
ldy #$ff
|
||||||
|
jsr packed_word_search
|
||||||
|
|
||||||
|
ply_trash_a
|
||||||
|
pla
|
||||||
|
|
||||||
|
cmp #$8f
|
||||||
|
bne list_not_rem
|
||||||
|
// REM command locks quote flag on until the end of the line, allowing
|
||||||
|
// funny characters in REM statements without problem.
|
||||||
|
sta QTSW // Any value other than $00 or $FF will lock quote mode on, so the token value of REM is fine here
|
||||||
|
// FALL THROUGH
|
||||||
|
list_not_rem:
|
||||||
|
|
||||||
|
iny
|
||||||
|
bne list_print_loop // branch always
|
||||||
|
|
||||||
|
list_is_pi:
|
||||||
|
lda #$7E
|
||||||
|
|
||||||
|
// FALLTROUGH
|
||||||
|
|
||||||
|
list_is_literal:
|
||||||
|
jsr JCHROUT
|
||||||
|
iny
|
||||||
|
bne list_print_loop
|
||||||
|
|
||||||
|
list_end_of_line:
|
||||||
|
// Print end of line
|
||||||
|
jmp print_return
|
||||||
|
|
||||||
|
|
||||||
|
#endif // ROM layout
|
||||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user