provided screen scroll up unofficial routine

This commit is contained in:
FeralChild64 committed 2020-01-05 21:59:17 +01:00
1 parent 82c7c22831
commit ca0d316948
6 files changed
+76 -101

No files matched your search

+2 -2
View File
@@ -235,7 +235,7 @@ Not all of them - only these we want to have implemented.
| `$E518` | legacy part of CINT | DONE | |
| `$E51B` | init screen keyboard, no VIC | DONE | |
| `$E544` | clear screen | DONE | |
| `$E50C` | set cursor position | PARTIAL | |
| `$E50C` | set cursor position | DONE | |
| `$E566` | home cursor | DONE | |
| `$E56C` | set PNT and USER values | DONE | |
| `$E5A0` | setup VIC II & I/O | DONE | |
@@ -243,7 +243,7 @@ Not all of them - only these we want to have implemented.
| `$E701` | previous line | NOT DONE | |
| `$E716` | screen CHROUT | NOT DONE | |
| `$E8DA` | color code table | DONE | |
| `$E8EA` | scroll line | NOT DONE | |
| `$E8EA` | scroll logical line up | DONE | |
| `$E96C` | insert line on top | NOT DONE | |
| `$E9FF` | clear line | DONE | |
| `$EA31` | default IRQ | PARTIAL | |
-4
View File
@@ -1,4 +0,0 @@
// XXX provide documentation and implementation
STUB_IMPLEMENTATION()
File renamed without changes.
@@ -1,43 +1,18 @@
//
// Scroll the whole screen up by 1 logical line
// Scroll the whole screen up by 1 logical line, described in:
//
// - [CM64] Computes Mapping the Commodore 64 - page 218
//
screen_scroll_up:
// First handle CTRL and NO_SCRL keys
#if CONFIG_KEYBOARD_C128 || CONFIG_KEYBOARD_C65
jsr screen_scroll_delay
// 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 !-
screen_scroll_up_delay_done:
// First scroll the LDTBL (line link table)
// Scroll the LDTBL (line link table)
ldy #$00
!:
@@ -133,49 +108,8 @@ screen_scroll_up_loop_done:
// If the first line is linked, scroll once more
bit LDTBL+0
#if CONFIG_KEYBOARD_C128 || CONFIG_KEYBOARD_C65
bpl_far screen_scroll_up
#else
bpl screen_scroll_up
#endif
// Recalculate PNT and USER
jmp screen_calculate_PNT_USER
/* YYY disabled for rework, add CTRL and NO_SCROLL support
not_last_line:
rts
screen_scroll_up_if_on_last_line:
// Colour RAM is always in fixed place, so is easiest
// to use to check if we are on the last line.
// The last line is at $D800 + 24*40 = $DBC0
lda USER+1
cmp #>$DBC0
bne not_last_line
lda USER+0
cmp #<$DBC0
beq is_last_line
jsr screen_get_current_line_logical_length
clc
adc USER+0
cmp #<$DBE7-1
bcc not_last_line
is_last_line:
dec TBLX
// FALLTHROUGH to screen_scroll_up
*/
+28 -23
View File
@@ -7,33 +7,38 @@ screen_grow_logical_line_done:
screen_grow_logical_line:
jmp screen_grow_logical_line // YYY
// Do not grow line if previus one is grown
ldy TBLX
lda LDTBL,y
bpl screen_grow_logical_line_done
// If last line, scroll the screen up
cpy #24
bne !+
jsr screen_scroll_up
ldy TBLX
!:
// Do not grow line if already grown
iny
lda LDTBL,y
bpl screen_grow_logical_line_done
// Mark current line as grown
lda #$00
sta LDTBL,y
// Now we have to scroll lines downwards to make space
.break
rts
/* YYY disabled for rework
// Do not grow line if it is already grown
ldy TBLX
lda LDTBL,y
bmi screen_grow_logical_line_done
// Do not grow line if previous grown
dey
bmi !+
lda LDTBL,y
bmi screen_grow_logical_line_done
!:
iny
// Mark current line as grown
lda #$80
sta LDTBL,y
// Now make space for the extra line added.
// If we are on the last physical line of the screen,
// Then we need to scroll the screen up
jsr screen_scroll_up_if_on_last_line
// Count the number of physical lines to scroll down
ldx #$01
ldy TBLX
+40
View File
@@ -0,0 +1,40 @@
//
// 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