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

View File

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