separate functions for EAL/SAL preservation during screen routines
This commit is contained in:
1 parent
309cfe3eb0
commit
27792a78ea
5 files changed
+91
-59
No files matched your search
@@ -10,7 +10,38 @@ screen_scroll_up:
|
|||||||
|
|
||||||
// First handle CTRL and NO_SCRL keys
|
// First handle CTRL and NO_SCRL keys
|
||||||
|
|
||||||
jsr screen_scroll_delay
|
#if CONFIG_KEYBOARD_C128 || CONFIG_KEYBOARD_C65
|
||||||
|
|
||||||
|
// Do not scroll if NO_SCRL is pressed and interrupts are enabled
|
||||||
|
!:
|
||||||
|
php
|
||||||
|
pla
|
||||||
|
and #%00000010
|
||||||
|
bne !+ // branch if IRQs disabled, we cannot detect NO_SCRL status
|
||||||
|
|
||||||
|
lda SHFLAG
|
||||||
|
and #KEY_FLAG_NO_SCRL
|
||||||
|
bne !-
|
||||||
|
!:
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Check if CTRL key pressed - if so, perform a delay
|
||||||
|
|
||||||
|
lda SHFLAG
|
||||||
|
and #KEY_FLAG_CTRL
|
||||||
|
beq screen_scroll_up_delay_done
|
||||||
|
|
||||||
|
ldy #$09
|
||||||
|
!:
|
||||||
|
ldx #$FF
|
||||||
|
jsr wait_x_bars
|
||||||
|
dey
|
||||||
|
bne !-
|
||||||
|
|
||||||
|
// FALLTROUGH
|
||||||
|
|
||||||
|
screen_scroll_up_delay_done:
|
||||||
|
|
||||||
// Scroll the LDTBL (line link table)
|
// Scroll the LDTBL (line link table)
|
||||||
|
|
||||||
@@ -27,14 +58,7 @@ screen_scroll_up:
|
|||||||
|
|
||||||
// Preserve SAL and EAL
|
// Preserve SAL and EAL
|
||||||
|
|
||||||
lda SAL+0
|
jsr screen_preserve_sal_eal
|
||||||
pha
|
|
||||||
lda SAL+1
|
|
||||||
pha
|
|
||||||
lda EAL+0
|
|
||||||
pha
|
|
||||||
lda EAL+1
|
|
||||||
pha
|
|
||||||
|
|
||||||
// Now, we need to scroll both screen memory and color memory; first create start/end pointers
|
// Now, we need to scroll both screen memory and color memory; first create start/end pointers
|
||||||
|
|
||||||
@@ -87,14 +111,7 @@ screen_scroll_up_loop_done:
|
|||||||
|
|
||||||
// Restore SAL and EAL
|
// Restore SAL and EAL
|
||||||
|
|
||||||
pla
|
jsr screen_restore_sal_eal
|
||||||
sta EAL+1
|
|
||||||
pla
|
|
||||||
sta EAL+0
|
|
||||||
pla
|
|
||||||
sta SAL+1
|
|
||||||
pla
|
|
||||||
sta SAL+0
|
|
||||||
|
|
||||||
// Clear the newly introduced line
|
// Clear the newly introduced line
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ screen_grow_logical_line_done:
|
|||||||
screen_grow_logical_line:
|
screen_grow_logical_line:
|
||||||
|
|
||||||
// Do not grow line if previus one is grown
|
// Do not grow line if previus one is grown
|
||||||
|
|
||||||
ldy TBLX
|
ldy TBLX
|
||||||
lda LDTBL,y
|
lda LDTBL,y
|
||||||
bpl screen_grow_logical_line_done
|
bpl screen_grow_logical_line_done
|
||||||
@@ -28,12 +27,27 @@ screen_grow_logical_line:
|
|||||||
lda #$00
|
lda #$00
|
||||||
sta LDTBL,y
|
sta LDTBL,y
|
||||||
|
|
||||||
|
// Preserve SAL and EAL
|
||||||
|
jsr screen_preserve_sal_eal
|
||||||
|
|
||||||
// Now we have to scroll lines downwards to make space
|
// Now we have to scroll lines downwards to make space
|
||||||
|
|
||||||
|
|
||||||
|
// YYY implement here
|
||||||
|
|
||||||
.break
|
.break
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Restore SAL and EAL
|
||||||
|
jsr screen_restore_sal_eal
|
||||||
|
|
||||||
|
// Recalculate PNT and USER YYY is it needed?
|
||||||
|
jmp screen_calculate_PNT_USER
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
|
||||||
|
screen_preserve_sal_eal:
|
||||||
|
|
||||||
|
plx_trash_a
|
||||||
|
ply_trash_a
|
||||||
|
|
||||||
|
lda SAL+0
|
||||||
|
pha
|
||||||
|
lda SAL+1
|
||||||
|
pha
|
||||||
|
lda EAL+0
|
||||||
|
pha
|
||||||
|
lda EAL+1
|
||||||
|
pha
|
||||||
|
|
||||||
|
// FALLTROUGH
|
||||||
|
|
||||||
|
screen_common_sal_eal:
|
||||||
|
|
||||||
|
phy_trash_a
|
||||||
|
phx_trash_a
|
||||||
|
rts
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
screen_restore_sal_eal:
|
||||||
|
|
||||||
|
plx_trash_a
|
||||||
|
ply_trash_a
|
||||||
|
|
||||||
|
pla
|
||||||
|
sta EAL+1
|
||||||
|
pla
|
||||||
|
sta EAL+0
|
||||||
|
pla
|
||||||
|
sta SAL+1
|
||||||
|
pla
|
||||||
|
sta SAL+0
|
||||||
|
|
||||||
|
jmp screen_common_sal_eal
|
||||||
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
|
|
||||||
//
|
|
||||||
// Handles CTRL and NO_SCRL during screen scroll
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
screen_scroll_delay:
|
|
||||||
|
|
||||||
#if CONFIG_KEYBOARD_C128 || CONFIG_KEYBOARD_C65
|
|
||||||
|
|
||||||
// Do not scroll if NO_SCRL is pressed and interrupts are enabled
|
|
||||||
!:
|
|
||||||
php
|
|
||||||
pla
|
|
||||||
and #%00000010
|
|
||||||
bne !+ // branch if IRQs disabled, we cannot detect NO_SCRL status
|
|
||||||
|
|
||||||
lda SHFLAG
|
|
||||||
and #KEY_FLAG_NO_SCRL
|
|
||||||
bne !-
|
|
||||||
!:
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Check if CTRL key pressed - if so, perform a delay
|
|
||||||
|
|
||||||
lda SHFLAG
|
|
||||||
and #KEY_FLAG_CTRL
|
|
||||||
beq screen_scroll_delay_done
|
|
||||||
|
|
||||||
ldy #$09
|
|
||||||
!:
|
|
||||||
ldx #$FF
|
|
||||||
jsr wait_x_bars
|
|
||||||
dey
|
|
||||||
bne !-
|
|
||||||
|
|
||||||
screen_scroll_delay_done:
|
|
||||||
|
|
||||||
rts
|
|
||||||
Reference in new issue
Block a user