reduced amount of VICE label conflicts
This commit is contained in:
1 parent
332438145c
commit
72a60958e9
21 files changed
+77
-123
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
// VIC-II registers
|
// VIC-II registers
|
||||||
|
|
||||||
.label VIC_BASE = $D000 // base address of the chip
|
.label __VIC_BASE = $D000 // base address of the chip
|
||||||
|
|
||||||
.label VIC_SP0X = $D000
|
.label VIC_SP0X = $D000
|
||||||
.label VIC_SP0Y = $D001
|
.label VIC_SP0Y = $D001
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
// SID registers
|
// SID registers
|
||||||
|
|
||||||
.label SID_BASE = $D400 // base address of the chip
|
.label __SID_BASE = $D400 // base address of the chip
|
||||||
|
|
||||||
.label SID_FRELO1 = $D400
|
.label SID_FRELO1 = $D400
|
||||||
.label SID_FREHI1 = $D401
|
.label SID_FREHI1 = $D401
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
|
|
||||||
// CIA #1 registers
|
// CIA #1 registers
|
||||||
|
|
||||||
.label CIA1_BASE = $DC00 // base address of the chip
|
.label __CIA1_BASE = $DC00 // base address of the chip
|
||||||
|
|
||||||
.label CIA1_PRA = $DC00
|
.label CIA1_PRA = $DC00
|
||||||
.label CIA1_PRB = $DC01
|
.label CIA1_PRB = $DC01
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
|
|
||||||
// CIA #2 registers
|
// CIA #2 registers
|
||||||
|
|
||||||
.label CIA2_BASE = $DD00 // base address of the chip
|
.label __CIA2_BASE = $DD00 // base address of the chip
|
||||||
|
|
||||||
.label CIA2_PRA = $DD00 // VIC bank switching and IEC port
|
.label CIA2_PRA = $DD00 // VIC bank switching and IEC port
|
||||||
.label CIA2_PRB = $DD01
|
.label CIA2_PRB = $DD01
|
||||||
|
|||||||
@@ -166,13 +166,13 @@
|
|||||||
.label HIBASE = $288 // high byte of start of screen
|
.label HIBASE = $288 // high byte of start of screen
|
||||||
.label XMAX = $289 // max keyboard buffer size
|
.label XMAX = $289 // max keyboard buffer size
|
||||||
.label RPTFLG = $28A // -- NOT IMPLEMENTED --
|
.label RPTFLG = $28A // -- NOT IMPLEMENTED --
|
||||||
.label KOUNT = $28B // -- NOT IMPLEMENTED --
|
.label KOUNT = $28B // key repeat counter
|
||||||
.label DELAY = $28C // -- NOT IMPLEMENTED --
|
.label DELAY = $28C // -- NOT IMPLEMENTED --
|
||||||
.label SHFLAG = $28D // bucky keys (SHIFT/CTRL/C=) flags
|
.label SHFLAG = $28D // bucky keys (SHIFT/CTRL/C=) flags
|
||||||
.label LSTSHF = $28E // last bucky key flags
|
.label LSTSHF = $28E // last bucky key flags
|
||||||
.label KEYLOG = $28F // $28F-$290 -- NOT IMPLEMENTED --
|
.label KEYLOG = $28F // $28F-$290 -- NOT IMPLEMENTED -- keyboard decoding pointer
|
||||||
.label MODE = $291 // flag, is case switch allowed
|
.label MODE = $291 // flag, is case switch allowed
|
||||||
.label AUTODN = $292 // -- NOT IMPLEMENTED --
|
.label AUTODN = $292 // -- NOT IMPLEMENTED -- screen scroll disable
|
||||||
.label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551
|
.label M51CRT = $293 // -- NOT IMPLEMENTED -- mock 6551
|
||||||
.label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551
|
.label M51CDR = $294 // -- NOT IMPLEMENTED -- mock 6551
|
||||||
.label M51AJB = $295 // $295-$296 -- NOT IMPLEMENTED -- mock 6551
|
.label M51AJB = $295 // $295-$296 -- NOT IMPLEMENTED -- mock 6551
|
||||||
|
|||||||
@@ -60,7 +60,6 @@
|
|||||||
// We also use the following for temp colour pointer when scrolling
|
// We also use the following for temp colour pointer when scrolling
|
||||||
.label load_save_verify_end_address = $AE
|
.label load_save_verify_end_address = $AE
|
||||||
|
|
||||||
.label cassette_buffer_ptr = $B2
|
|
||||||
.label current_logical_filenum = $B8
|
.label current_logical_filenum = $B8
|
||||||
.label current_secondary_address = $B9
|
.label current_secondary_address = $B9
|
||||||
.label current_device_number = $BA
|
.label current_device_number = $BA
|
||||||
@@ -80,7 +79,6 @@
|
|||||||
.label keyboard_input_ready = $D0
|
.label keyboard_input_ready = $D0
|
||||||
.label current_screen_line_ptr = $D1
|
.label current_screen_line_ptr = $D1
|
||||||
.label current_screen_x = $D3
|
.label current_screen_x = $D3
|
||||||
.label quote_mode_flag = $D4
|
|
||||||
.label logical_line_length = $D5
|
.label logical_line_length = $D5
|
||||||
.label current_screen_y = $D6
|
.label current_screen_y = $D6
|
||||||
.label last_printed_character_ascii = $D7
|
.label last_printed_character_ascii = $D7
|
||||||
@@ -91,28 +89,6 @@
|
|||||||
.label current_screen_line_colour_ptr = $F3
|
.label current_screen_line_colour_ptr = $F3
|
||||||
.label keyboard_decoding_table_ptr = $F5
|
.label keyboard_decoding_table_ptr = $F5
|
||||||
|
|
||||||
.label basic_input_buffer = BUF
|
|
||||||
|
|
||||||
// "Compute's Mapping the 64" book
|
|
||||||
.label keyboard_buffer = $0277
|
|
||||||
.label text_colour = $0286 // p55
|
|
||||||
.label colour_under_cursor = $0287 // p56
|
|
||||||
.label key_buffer_size = $0289 // p57
|
|
||||||
|
|
||||||
// 0 = cursor keys, insert, delete and space repeat, but nothing else
|
|
||||||
// 128 = all keys repeat
|
|
||||||
// 64 = no keys repeat
|
|
||||||
.label key_repeat_flags = $028A // p58
|
|
||||||
// https://www.c64-wiki.com/wiki/Page_2
|
|
||||||
.label key_repeat_counter = $028B
|
|
||||||
.label key_first_repeat_delay = $028C
|
|
||||||
// bit 0 = shift, 1 = Vendor Key, 2 = Control
|
|
||||||
.label key_bucky_state = $028D
|
|
||||||
.label key_last_bucky_state = $028E
|
|
||||||
.label keyboard_decoding_ptr = $028F
|
|
||||||
.label enable_case_switch = $0291
|
|
||||||
.label screen_scroll_disable = $0292
|
|
||||||
|
|
||||||
#if CONFIG_MEMORY_MODEL_60K
|
#if CONFIG_MEMORY_MODEL_60K
|
||||||
|
|
||||||
// BASIC uses some extra bytes for memory access under ROMs located at $2A7 onwards
|
// BASIC uses some extra bytes for memory access under ROMs located at $2A7 onwards
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ read_line_loop:
|
|||||||
ldx #22
|
ldx #22
|
||||||
jmp basic_do_error
|
jmp basic_do_error
|
||||||
!:
|
!:
|
||||||
sta basic_input_buffer,x
|
sta BUF,x
|
||||||
inx
|
inx
|
||||||
jmp read_line_loop
|
jmp read_line_loop
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ list_single_line: // entry point needed by DOS wedge
|
|||||||
// Iterate through printing out the line
|
// Iterate through printing out the line
|
||||||
// contents
|
// contents
|
||||||
lda #0
|
lda #0
|
||||||
sta quote_mode_flag
|
sta QTSW
|
||||||
|
|
||||||
ldy #4
|
ldy #4
|
||||||
list_print_loop:
|
list_print_loop:
|
||||||
@@ -82,14 +82,14 @@ list_print_loop:
|
|||||||
beq list_end_of_line
|
beq list_end_of_line
|
||||||
cmp #$22
|
cmp #$22
|
||||||
bne list_not_quote
|
bne list_not_quote
|
||||||
lda quote_mode_flag
|
lda QTSW
|
||||||
eor #$ff
|
eor #$ff
|
||||||
sta quote_mode_flag
|
sta QTSW
|
||||||
lda #$22
|
lda #$22
|
||||||
jmp list_is_literal
|
jmp list_is_literal
|
||||||
list_not_quote:
|
list_not_quote:
|
||||||
// Check quote mode, and display as literal if required
|
// Check quote mode, and display as literal if required
|
||||||
ldx quote_mode_flag
|
ldx QTSW
|
||||||
bne list_is_literal
|
bne list_is_literal
|
||||||
|
|
||||||
cmp #$7f
|
cmp #$7f
|
||||||
@@ -128,7 +128,7 @@ list_not_quote:
|
|||||||
// REM command locks quote flag on until the end of the line, allowing
|
// REM command locks quote flag on until the end of the line, allowing
|
||||||
// funny characters in REM statements without problem.
|
// funny characters in REM statements without problem.
|
||||||
inc $0427
|
inc $0427
|
||||||
sta quote_mode_flag // Any value other than $00 or $FF will lock quote mode on, so the token value of REM is fine here
|
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
|
// FALL THROUGH
|
||||||
list_not_rem:
|
list_not_rem:
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ tokenise_line:
|
|||||||
lda #$00
|
lda #$00
|
||||||
sta $0110
|
sta $0110
|
||||||
sta $0112
|
sta $0112
|
||||||
sta quote_mode_flag
|
sta QTSW
|
||||||
|
|
||||||
lda tokenise_work1
|
lda tokenise_work1
|
||||||
sta $0113
|
sta $0113
|
||||||
@@ -40,7 +40,7 @@ tokenise_char:
|
|||||||
|
|
||||||
// Clear quote mode flag that is also used by KERNAL for screen display
|
// Clear quote mode flag that is also used by KERNAL for screen display
|
||||||
lda #$00
|
lda #$00
|
||||||
sta quote_mode_flag
|
sta QTSW
|
||||||
rts
|
rts
|
||||||
!:
|
!:
|
||||||
// More to do
|
// More to do
|
||||||
@@ -60,9 +60,9 @@ tokenise_char_loop:
|
|||||||
bne tk_not_quote
|
bne tk_not_quote
|
||||||
|
|
||||||
// Quote
|
// Quote
|
||||||
lda quote_mode_flag
|
lda QTSW
|
||||||
eor #$ff
|
eor #$ff
|
||||||
sta quote_mode_flag
|
sta QTSW
|
||||||
jmp tk_literal_char
|
jmp tk_literal_char
|
||||||
|
|
||||||
tk_not_quote:
|
tk_not_quote:
|
||||||
@@ -82,7 +82,7 @@ tk_not_quote:
|
|||||||
|
|
||||||
tk_might_be_keyword:
|
tk_might_be_keyword:
|
||||||
// Don't tokenise in quote mode
|
// Don't tokenise in quote mode
|
||||||
lda quote_mode_flag
|
lda QTSW
|
||||||
bne tk_literal_char
|
bne tk_literal_char
|
||||||
|
|
||||||
// Pack string
|
// Pack string
|
||||||
@@ -137,9 +137,9 @@ found_token_in_line:
|
|||||||
// If it is REM, then lock us in quote mode to the end of the line
|
// If it is REM, then lock us in quote mode to the end of the line
|
||||||
cmp #$8f
|
cmp #$8f
|
||||||
bne not_rem
|
bne not_rem
|
||||||
sta quote_mode_flag
|
sta QTSW
|
||||||
not_rem:
|
not_rem:
|
||||||
|
|
||||||
// Now skip over the length of the token
|
// Now skip over the length of the token
|
||||||
lda $0110
|
lda $0110
|
||||||
clc
|
clc
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
// XXX get rid of this file, use ,aliases_ram_lowmem.s instead
|
// XXX get rid of this file, use ,aliases_ram_lowmem.s instead
|
||||||
|
|
||||||
.label kernal_load_or_verify_flag = $93
|
|
||||||
.label current_file_num = $98
|
.label current_file_num = $98
|
||||||
.label input_device_number = DFLTN
|
.label input_device_number = DFLTN
|
||||||
.label cassette_buffer_bytes_used = $A6
|
.label cassette_buffer_bytes_used = $A6
|
||||||
@@ -30,7 +29,6 @@
|
|||||||
.label keyboard_input_ready = $D0
|
.label keyboard_input_ready = $D0
|
||||||
.label current_screen_line_ptr = $D1
|
.label current_screen_line_ptr = $D1
|
||||||
.label current_screen_x = $D3
|
.label current_screen_x = $D3
|
||||||
.label quote_mode_flag = $D4
|
|
||||||
.label logical_line_length = $D5
|
.label logical_line_length = $D5
|
||||||
.label current_screen_y = $D6
|
.label current_screen_y = $D6
|
||||||
.label last_printed_character_ascii = $D7
|
.label last_printed_character_ascii = $D7
|
||||||
@@ -40,26 +38,6 @@
|
|||||||
.label screen_line_link_table = $D9
|
.label screen_line_link_table = $D9
|
||||||
.label current_screen_line_colour_ptr = $F3
|
.label current_screen_line_colour_ptr = $F3
|
||||||
.label keyboard_decoding_table_ptr = $F5
|
.label keyboard_decoding_table_ptr = $F5
|
||||||
|
|
||||||
// "Compute's Mapping the 64" book
|
|
||||||
.label keyboard_buffer = $0277
|
|
||||||
.label text_colour = $0286 // p55
|
|
||||||
.label colour_under_cursor = $0287 // p56
|
|
||||||
.label key_buffer_size = $0289 // p57
|
|
||||||
|
|
||||||
// 0 = cursor keys, insert, delete and space repeat, but nothing else
|
|
||||||
// 128 = all keys repeat
|
|
||||||
// 64 = no keys repeat
|
|
||||||
.label key_repeat_flags = $028A // p58
|
|
||||||
// https://www.c64-wiki.com/wiki/Page_2
|
|
||||||
.label key_repeat_counter = $028B
|
|
||||||
.label key_first_repeat_delay = $028C
|
|
||||||
// bit 0 = shift, 1 = Vendor Key, 2 = Control
|
|
||||||
.label key_bucky_state = $028D
|
|
||||||
.label key_last_bucky_state = $028E
|
|
||||||
.label keyboard_decoding_ptr = $028F
|
|
||||||
.label enable_case_switch = $0291
|
|
||||||
.label screen_scroll_disable = $0292
|
|
||||||
|
|
||||||
#if CONFIG_MEMORY_MODEL_60K
|
#if CONFIG_MEMORY_MODEL_60K
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// cursor_blink_countdown
|
// cursor_blink_countdown
|
||||||
// cursor_saved_character
|
// cursor_saved_character
|
||||||
// cursor_is_visible
|
// cursor_is_visible
|
||||||
// colour_under_cursor
|
// GDCOL (colour under cursor)
|
||||||
|
|
||||||
show_cursor_if_enabled:
|
show_cursor_if_enabled:
|
||||||
lda cursor_blink_disable
|
lda cursor_blink_disable
|
||||||
@@ -48,8 +48,8 @@ draw_cursor:
|
|||||||
sta (current_screen_line_ptr),y
|
sta (current_screen_line_ptr),y
|
||||||
// Also set cursor colour
|
// Also set cursor colour
|
||||||
lda (current_screen_line_colour_ptr),y
|
lda (current_screen_line_colour_ptr),y
|
||||||
sta colour_under_cursor
|
sta GDCOL
|
||||||
lda text_colour
|
lda COLOR
|
||||||
sta (current_screen_line_colour_ptr),y
|
sta (current_screen_line_colour_ptr),y
|
||||||
|
|
||||||
lda #1
|
lda #1
|
||||||
@@ -63,7 +63,7 @@ undraw_cursor:
|
|||||||
lda cursor_saved_character
|
lda cursor_saved_character
|
||||||
ldy current_screen_x
|
ldy current_screen_x
|
||||||
sta (current_screen_line_ptr),y
|
sta (current_screen_line_ptr),y
|
||||||
lda colour_under_cursor
|
lda GDCOL
|
||||||
sta (current_screen_line_colour_ptr),y
|
sta (current_screen_line_colour_ptr),y
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ read_from_keyboard:
|
|||||||
lda keys_in_key_buffer
|
lda keys_in_key_buffer
|
||||||
beq chrin_repeat
|
beq chrin_repeat
|
||||||
|
|
||||||
lda keyboard_buffer
|
lda KEYD
|
||||||
cmp #$0d
|
cmp #$0d
|
||||||
bne not_enter
|
bne not_enter
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ empty_line:
|
|||||||
|
|
||||||
not_enter:
|
not_enter:
|
||||||
// Print character
|
// Print character
|
||||||
lda keyboard_buffer
|
lda KEYD
|
||||||
jsr CHROUT
|
jsr CHROUT
|
||||||
|
|
||||||
jsr pop_keyboard_buffer
|
jsr pop_keyboard_buffer
|
||||||
@@ -160,11 +160,11 @@ pop_keyboard_buffer:
|
|||||||
sei
|
sei
|
||||||
ldx #$00
|
ldx #$00
|
||||||
ldy #$01
|
ldy #$01
|
||||||
!: lda keyboard_buffer,y
|
!: lda KEYD,y
|
||||||
sta keyboard_buffer,x
|
sta KEYD,x
|
||||||
inx
|
inx
|
||||||
iny
|
iny
|
||||||
cpy key_buffer_size
|
cpy XMAX
|
||||||
bne !-
|
bne !-
|
||||||
dec keys_in_key_buffer
|
dec keys_in_key_buffer
|
||||||
cli
|
cli
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ not_0a:
|
|||||||
bne not_0d
|
bne not_0d
|
||||||
// RETURN clears quote and insert modes
|
// RETURN clears quote and insert modes
|
||||||
lda #$00
|
lda #$00
|
||||||
sta quote_mode_flag
|
sta QTSW
|
||||||
sta insert_mode
|
sta insert_mode
|
||||||
jmp screen_advance_to_next_line
|
jmp screen_advance_to_next_line
|
||||||
not_0d:
|
not_0d:
|
||||||
@@ -235,7 +235,7 @@ done_delete:
|
|||||||
not_14:
|
not_14:
|
||||||
|
|
||||||
// Check for quote mode
|
// Check for quote mode
|
||||||
ldx quote_mode_flag
|
ldx QTSW
|
||||||
bne is_quote_mode
|
bne is_quote_mode
|
||||||
ldx insert_mode
|
ldx insert_mode
|
||||||
bne is_quote_mode
|
bne is_quote_mode
|
||||||
@@ -274,7 +274,7 @@ not_quote_mode:
|
|||||||
colour_check_loop:
|
colour_check_loop:
|
||||||
cmp colour_codes,x
|
cmp colour_codes,x
|
||||||
bne !+
|
bne !+
|
||||||
stx text_colour
|
stx COLOR
|
||||||
jmp chrout_done
|
jmp chrout_done
|
||||||
!: dex
|
!: dex
|
||||||
bpl colour_check_loop
|
bpl colour_check_loop
|
||||||
@@ -415,14 +415,14 @@ output_literal_char:
|
|||||||
bne not_quote
|
bne not_quote
|
||||||
|
|
||||||
// Toggle quote flag if required
|
// Toggle quote flag if required
|
||||||
lda quote_mode_flag
|
lda QTSW
|
||||||
eor #$80
|
eor #$80
|
||||||
sta quote_mode_flag
|
sta QTSW
|
||||||
|
|
||||||
not_quote:
|
not_quote:
|
||||||
|
|
||||||
// Set colour
|
// Set colour
|
||||||
lda text_colour
|
lda COLOR
|
||||||
sta (current_screen_line_colour_ptr),y
|
sta (current_screen_line_colour_ptr),y
|
||||||
|
|
||||||
// Advance the column, and scroll screen down if we need
|
// Advance the column, and scroll screen down if we need
|
||||||
@@ -556,7 +556,7 @@ no_copy_down:
|
|||||||
// Erase newly inserted line
|
// Erase newly inserted line
|
||||||
ldy #79
|
ldy #79
|
||||||
!:
|
!:
|
||||||
lda text_colour
|
lda COLOR
|
||||||
sta (current_screen_line_colour_ptr),y
|
sta (current_screen_line_colour_ptr),y
|
||||||
lda #$20
|
lda #$20
|
||||||
sta (current_screen_line_ptr),y
|
sta (current_screen_line_ptr),y
|
||||||
@@ -659,7 +659,7 @@ scroll_copy_loop2:
|
|||||||
// Fill in scrolled up area
|
// Fill in scrolled up area
|
||||||
ldx load_or_scroll_temp_pointer+0
|
ldx load_or_scroll_temp_pointer+0
|
||||||
scroll_copy_loop3:
|
scroll_copy_loop3:
|
||||||
lda text_colour
|
lda COLOR
|
||||||
sta (current_screen_line_colour_ptr),y
|
sta (current_screen_line_colour_ptr),y
|
||||||
lda #$20
|
lda #$20
|
||||||
sta (current_screen_line_ptr),y
|
sta (current_screen_line_ptr),y
|
||||||
|
|||||||
@@ -79,17 +79,17 @@ cint_brk: // entry for BRK and STOP+RESTORE - XXX, where should it start?
|
|||||||
// But require key to be held for ~1/3sec before
|
// But require key to be held for ~1/3sec before
|
||||||
// repeating (Compute's Mapping the 64 p58)
|
// repeating (Compute's Mapping the 64 p58)
|
||||||
ldx #22-2 // Fudge factor to match speed
|
ldx #22-2 // Fudge factor to match speed
|
||||||
stx key_first_repeat_delay
|
stx DELAY
|
||||||
|
|
||||||
// Set current colour for text (Compute's Mapping the 64 p215)
|
// Set current colour for text (Compute's Mapping the 64 p215)
|
||||||
ldx #$01 // default is light blue ($0E), but we use a different one
|
ldx #$01 // default is light blue ($0E), but we use a different one
|
||||||
stx text_colour
|
stx COLOR
|
||||||
|
|
||||||
// Set maximum keyboard buffer size (Compute's Mapping the 64 p215)
|
// Set maximum keyboard buffer size (Compute's Mapping the 64 p215)
|
||||||
ldx #10
|
ldx #10
|
||||||
stx key_buffer_size
|
stx XMAX
|
||||||
// Put non-zero value in enable_case_switch
|
// Put non-zero value in MODE to enable case switch
|
||||||
stx enable_case_switch
|
stx MODE
|
||||||
|
|
||||||
// Set default I/O devices (see SCINIT description at http://sta.c64.org/cbm64krnfunc.html)
|
// Set default I/O devices (see SCINIT description at http://sta.c64.org/cbm64krnfunc.html)
|
||||||
jsr clrchn_reset
|
jsr clrchn_reset
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ clearscreen_l2:
|
|||||||
|
|
||||||
// Clear colour RAM
|
// Clear colour RAM
|
||||||
// (Compute's Mapping the 64 p216)
|
// (Compute's Mapping the 64 p216)
|
||||||
lda text_colour
|
lda COLOR
|
||||||
clearscreen_l3:
|
clearscreen_l3:
|
||||||
sta $d800,y
|
sta $d800,y
|
||||||
sta $d900,y
|
sta $d900,y
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ GETIN:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
!:
|
!:
|
||||||
lda keyboard_buffer
|
lda KEYD
|
||||||
pha
|
pha
|
||||||
|
|
||||||
jsr pop_keyboard_buffer
|
jsr pop_keyboard_buffer
|
||||||
|
|||||||
@@ -53,15 +53,15 @@ IOINIT:
|
|||||||
#endif // CONFIG_SID_D4XX || CONFIG_SID_D5XX
|
#endif // CONFIG_SID_D4XX || CONFIG_SID_D5XX
|
||||||
|
|
||||||
#if CONFIG_SID_2ND
|
#if CONFIG_SID_2ND
|
||||||
lda SID_SIGVOL - SID_BASE + CONFIG_SID_2ND_ADDRESS
|
lda SID_SIGVOL - __SID_BASE + CONFIG_SID_2ND_ADDRESS
|
||||||
and #$F0
|
and #$F0
|
||||||
sta SID_SIGVOL - SID_BASE + CONFIG_SID_2ND_ADDRESS
|
sta SID_SIGVOL - __SID_BASE + CONFIG_SID_2ND_ADDRESS
|
||||||
#endif // CONFIG_SID_2ND
|
#endif // CONFIG_SID_2ND
|
||||||
|
|
||||||
#if CONFIG_SID_3RD
|
#if CONFIG_SID_3RD
|
||||||
lda SID_SIGVOL - SID_BASE + CONFIG_SID_3RD_ADDRESS
|
lda SID_SIGVOL - __SID_BASE + CONFIG_SID_3RD_ADDRESS
|
||||||
and #$F0
|
and #$F0
|
||||||
sta SID_SIGVOL - SID_BASE + CONFIG_SID_3RD_ADDRESS
|
sta SID_SIGVOL - __SID_BASE + CONFIG_SID_3RD_ADDRESS
|
||||||
#endif // CONFIG_SID_3RD
|
#endif // CONFIG_SID_3RD
|
||||||
|
|
||||||
// Initialize CIAs
|
// Initialize CIAs
|
||||||
|
|||||||
+28
-28
@@ -74,9 +74,9 @@ SCNKEY:
|
|||||||
sta BufferQuantity
|
sta BufferQuantity
|
||||||
|
|
||||||
// Decrement key repeat timeout if non-zero
|
// Decrement key repeat timeout if non-zero
|
||||||
ldx key_repeat_counter
|
ldx KOUNT
|
||||||
beq sk_start
|
beq sk_start
|
||||||
dec key_repeat_counter
|
dec KOUNT
|
||||||
|
|
||||||
sk_start:
|
sk_start:
|
||||||
// Call main keyboard scanning routine
|
// Call main keyboard scanning routine
|
||||||
@@ -110,7 +110,7 @@ accept_key:
|
|||||||
// Convert matrix position to key code
|
// Convert matrix position to key code
|
||||||
// XXX - Add offset of $40, $80 or $C0 if shift, CONTROL or C= are held down
|
// XXX - Add offset of $40, $80 or $C0 if shift, CONTROL or C= are held down
|
||||||
pha
|
pha
|
||||||
lda key_bucky_state
|
lda SHFLAG
|
||||||
and #$7
|
and #$7
|
||||||
tax
|
tax
|
||||||
pla
|
pla
|
||||||
@@ -123,9 +123,9 @@ accept_key:
|
|||||||
|
|
||||||
// Stash key into keyboard buffer
|
// Stash key into keyboard buffer
|
||||||
ldx keys_in_key_buffer
|
ldx keys_in_key_buffer
|
||||||
cpx key_buffer_size
|
cpx XMAX
|
||||||
beq sk_nokey
|
beq sk_nokey
|
||||||
sta keyboard_buffer,x
|
sta KEYD,x
|
||||||
inc keys_in_key_buffer
|
inc keys_in_key_buffer
|
||||||
|
|
||||||
sk_nokey:
|
sk_nokey:
|
||||||
@@ -204,10 +204,10 @@ ReturnNoKeys:
|
|||||||
NoActivityDetected:
|
NoActivityDetected:
|
||||||
|
|
||||||
// So cancel all bucky keys
|
// So cancel all bucky keys
|
||||||
lda key_bucky_state
|
lda SHFLAG
|
||||||
sta key_last_bucky_state
|
sta LSTSHF
|
||||||
lda #$00
|
lda #$00
|
||||||
sta key_bucky_state
|
sta SHFLAG
|
||||||
|
|
||||||
jmp ReturnNoKeys
|
jmp ReturnNoKeys
|
||||||
|
|
||||||
@@ -239,7 +239,7 @@ JoystickActivity:
|
|||||||
|
|
||||||
// Clear bucky key status
|
// Clear bucky key status
|
||||||
lda #$00
|
lda #$00
|
||||||
sta key_bucky_state
|
sta SHFLAG
|
||||||
|
|
||||||
lda $dc01
|
lda $dc01
|
||||||
and #$03
|
and #$03
|
||||||
@@ -254,7 +254,7 @@ JoystickActivity:
|
|||||||
// Up
|
// Up
|
||||||
// Mark shift as pressed
|
// Mark shift as pressed
|
||||||
ldx #$01
|
ldx #$01
|
||||||
stx key_bucky_state
|
stx SHFLAG
|
||||||
ldx #$07 // UP/DOWN
|
ldx #$07 // UP/DOWN
|
||||||
jsr KeyFound
|
jsr KeyFound
|
||||||
!:
|
!:
|
||||||
@@ -278,7 +278,7 @@ JoystickActivity:
|
|||||||
cmp #$08
|
cmp #$08
|
||||||
bne !+
|
bne !+
|
||||||
ldx #$01
|
ldx #$01
|
||||||
stx key_bucky_state
|
stx SHFLAG
|
||||||
ldx #$02
|
ldx #$02
|
||||||
jsr KeyFound // LEFT/RIGHT
|
jsr KeyFound // LEFT/RIGHT
|
||||||
!:
|
!:
|
||||||
@@ -332,20 +332,20 @@ next_row:
|
|||||||
|
|
||||||
// Store de-bounce data for bucky keys
|
// Store de-bounce data for bucky keys
|
||||||
// (Compute's Mapping the 64, p58-59)
|
// (Compute's Mapping the 64, p58-59)
|
||||||
lda key_bucky_state
|
lda SHFLAG
|
||||||
sta key_last_bucky_state
|
sta LSTSHF
|
||||||
|
|
||||||
// Build bucky state
|
// Build bucky state
|
||||||
lda #$00
|
lda #$00
|
||||||
sta key_bucky_state
|
sta SHFLAG
|
||||||
lda ScanResult+6
|
lda ScanResult+6
|
||||||
eor #%10000000
|
eor #%10000000
|
||||||
and #%10000000 // Left shift
|
and #%10000000 // Left shift
|
||||||
rol
|
rol
|
||||||
rol
|
rol
|
||||||
and #$01
|
and #$01
|
||||||
ora key_bucky_state
|
ora SHFLAG
|
||||||
sta key_bucky_state
|
sta SHFLAG
|
||||||
|
|
||||||
// Right shift
|
// Right shift
|
||||||
lda ScanResult+1
|
lda ScanResult+1
|
||||||
@@ -355,15 +355,15 @@ next_row:
|
|||||||
lsr
|
lsr
|
||||||
lsr
|
lsr
|
||||||
and #$01
|
and #$01
|
||||||
ora key_bucky_state
|
ora SHFLAG
|
||||||
sta key_bucky_state
|
sta SHFLAG
|
||||||
|
|
||||||
// Control
|
// Control
|
||||||
lda ScanResult+0
|
lda ScanResult+0
|
||||||
eor #$04
|
eor #$04
|
||||||
and #$04
|
and #$04
|
||||||
ora key_bucky_state
|
ora SHFLAG
|
||||||
sta key_bucky_state
|
sta SHFLAG
|
||||||
|
|
||||||
// Vendor key
|
// Vendor key
|
||||||
lda ScanResult+0
|
lda ScanResult+0
|
||||||
@@ -373,17 +373,17 @@ next_row:
|
|||||||
lsr
|
lsr
|
||||||
lsr
|
lsr
|
||||||
and #$02
|
and #$02
|
||||||
ora key_bucky_state
|
ora SHFLAG
|
||||||
sta key_bucky_state
|
sta SHFLAG
|
||||||
|
|
||||||
// Chick for shift + Vendor
|
// Chick for shift + Vendor
|
||||||
cmp #$03
|
cmp #$03
|
||||||
bne no_case_toggle
|
bne no_case_toggle
|
||||||
lda key_last_bucky_state
|
lda LSTSHF
|
||||||
cmp #$03
|
cmp #$03
|
||||||
beq no_case_toggle
|
beq no_case_toggle
|
||||||
|
|
||||||
lda enable_case_switch
|
lda MODE
|
||||||
beq no_case_toggle
|
beq no_case_toggle
|
||||||
|
|
||||||
lda $D018
|
lda $D018
|
||||||
@@ -509,15 +509,15 @@ KeyHeld:
|
|||||||
// Different key held
|
// Different key held
|
||||||
sta last_key_matrix_position
|
sta last_key_matrix_position
|
||||||
pha
|
pha
|
||||||
lda key_first_repeat_delay
|
lda DELAY
|
||||||
sta key_repeat_counter
|
sta KOUNT
|
||||||
pla
|
pla
|
||||||
BuckyHeld:
|
BuckyHeld:
|
||||||
jmp ConsiderNextKey
|
jmp ConsiderNextKey
|
||||||
|
|
||||||
SameKeyHeld:
|
SameKeyHeld:
|
||||||
pha
|
pha
|
||||||
lda key_repeat_counter
|
lda KOUNT
|
||||||
bmi KeyCanRepeat
|
bmi KeyCanRepeat
|
||||||
bne KeyRepeatWait
|
bne KeyRepeatWait
|
||||||
// Count down ended, so repeat key now
|
// Count down ended, so repeat key now
|
||||||
@@ -526,7 +526,7 @@ KeyCanRepeat:
|
|||||||
// (Compute's Mapping the 64 p58)
|
// (Compute's Mapping the 64 p58)
|
||||||
pha
|
pha
|
||||||
lda #6-2 // Fudge factor to match speed
|
lda #6-2 // Fudge factor to match speed
|
||||||
sta key_repeat_counter
|
sta KOUNT
|
||||||
pla
|
pla
|
||||||
pla
|
pla
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user