started work on screen scroll
This commit is contained in:
1 parent
870de4e432
commit
44df124fc7
3 files changed
+108
-8
No files matched your search
@@ -16,9 +16,8 @@ iec_wait1ms:
|
|||||||
ldx #18 // we probably won't start with the beginning of raster
|
ldx #18 // we probably won't start with the beginning of raster
|
||||||
|
|
||||||
#endif // CONFIG_IEC
|
#endif // CONFIG_IEC
|
||||||
#if CONFIG_IEC || (!CONFIG_TAPE_NO_MOTOR_CONTROL && (CONFIG_TAPE_TURBO || CONFIG_TAPE_NORMAL))
|
|
||||||
|
|
||||||
wait_x_bars: // additional entry point for tape support
|
wait_x_bars: // additional entry point for delayy in screen and tape support
|
||||||
// has to preserve .Y and put .X to 0
|
// has to preserve .Y and put .X to 0
|
||||||
|
|
||||||
lda VIC_RASTER
|
lda VIC_RASTER
|
||||||
@@ -32,6 +31,3 @@ wait_x_bars: // additional entry point for tape support
|
|||||||
iec_wait_rts: // dummy RTS, for very short waits
|
iec_wait_rts: // dummy RTS, for very short waits
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -4,12 +4,11 @@ screen_advance_to_next_line:
|
|||||||
|
|
||||||
// Check if we are at the bottom of the screen
|
// Check if we are at the bottom of the screen
|
||||||
ldy TBLX
|
ldy TBLX
|
||||||
cpy #$24
|
cpy #24
|
||||||
bne !+
|
bne !+
|
||||||
|
|
||||||
// We need to scroll the screen up
|
// We need to scroll the screen up
|
||||||
jsr screen_scroll_up
|
jsr screen_scroll_up
|
||||||
skip_2_bytes_trash_nvz
|
|
||||||
!:
|
!:
|
||||||
inc TBLX
|
inc TBLX
|
||||||
|
|
||||||
|
|||||||
+106
-1
@@ -1,7 +1,110 @@
|
|||||||
|
|
||||||
|
//
|
||||||
|
// Scroll the whole screen up by 1 logical line
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
screen_scroll_up:
|
screen_scroll_up:
|
||||||
|
|
||||||
|
// Preserve SAL and EAL
|
||||||
|
|
||||||
|
lda SAL+0
|
||||||
|
pha
|
||||||
|
lda SAL+1
|
||||||
|
pha
|
||||||
|
lda EAL+0
|
||||||
|
pha
|
||||||
|
lda EAL+1
|
||||||
|
pha
|
||||||
|
|
||||||
|
screen_scroll_up_next:
|
||||||
|
|
||||||
|
#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 #$03
|
||||||
|
!:
|
||||||
|
ldx #$FF
|
||||||
|
jsr wait_x_bars
|
||||||
|
dey
|
||||||
|
bne !-
|
||||||
|
|
||||||
|
screen_scroll_up_delay_done:
|
||||||
|
|
||||||
|
// First scroll the LDTBL (line link table)
|
||||||
|
|
||||||
|
ldy #$00
|
||||||
|
!:
|
||||||
|
lda LDTBL+1, y
|
||||||
|
sta LDTBL+0, y
|
||||||
|
iny
|
||||||
|
cpy #24
|
||||||
|
bne !-
|
||||||
|
|
||||||
|
lda #$80
|
||||||
|
sta LDTBL+24
|
||||||
|
|
||||||
|
// Now, we need to scroll both screen memory and color memory
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// YYY implement
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Clear the newly introduced line
|
||||||
|
|
||||||
|
ldx #24
|
||||||
|
jsr screen_clear_line
|
||||||
|
|
||||||
|
// Decrement the current physical line number
|
||||||
|
|
||||||
|
dec TBLX
|
||||||
|
|
||||||
|
// If the first line is linked, scroll once more
|
||||||
|
|
||||||
|
bit LDTBL+0
|
||||||
|
bpl screen_scroll_up_next
|
||||||
|
|
||||||
|
// Restore SAL and EAL
|
||||||
|
|
||||||
|
pla
|
||||||
|
sta EAL+1
|
||||||
|
pla
|
||||||
|
sta EAL+0
|
||||||
|
pla
|
||||||
|
sta SAL+1
|
||||||
|
pla
|
||||||
|
sta SAL+0
|
||||||
|
|
||||||
|
// Return
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* YYY disabled for rework, add CTRL and NO_SCROLL support
|
/* YYY disabled for rework, add CTRL and NO_SCROLL support
|
||||||
|
|
||||||
not_last_line:
|
not_last_line:
|
||||||
@@ -30,7 +133,9 @@ is_last_line:
|
|||||||
|
|
||||||
dec TBLX
|
dec TBLX
|
||||||
|
|
||||||
// FALLTHROUGH
|
// FALLTHROUGH to screen_scroll_up
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
scroll_screen_up:
|
scroll_screen_up:
|
||||||
|
|
||||||
Reference in new issue
Block a user