fix catalog previous/next buttons when there are more than 2 pages

This commit is contained in:
4am 2021-01-21 00:55:03 -05:00
parent 079989c27f
commit 095d2e6d93
1 changed files with 14 additions and 10 deletions

View File

@ -212,22 +212,26 @@ isUppercaseKey
catalog_next
lda startIndex
clc
adc #MAXGAMES ; page forward and refresh
adc #MAXGAMES
cmp gameCount
beq @good
bcc @good
jmp catalog_previous
@good sta startIndex
bcc +
lda #0
+ sta startIndex
jmp RefreshCatalog
catalog_previous
lda startIndex
bne @1
jmp catalog_next
@1
sec
sbc #MAXGAMES ; page back and refresh
sta startIndex
sbc #MAXGAMES
bcs +
lda #0
- clc
adc #MAXGAMES
cmp gameCount
bcc -
sec
sbc #MAXGAMES
+ sta startIndex
jmp RefreshCatalog
catalog_main