Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/coolgirl-multicart/coolgirl-multirom-builder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2021-06-28 09:32:30 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2021-06-28 09:32:30 +0300
commit3d26aac7f7847abbc50833f3ff73e39ce23964ff (patch)
tree0c90617d1181eee1ea68f25eeedafff26c625de8
parent85df23a7305c7ffa0b99ca73e9ebedbbb8fd3e29 (diff)
Fixed CHR RAM size detection
-rw-r--r--video.asm16
1 files changed, 11 insertions, 5 deletions
diff --git a/video.asm b/video.asm
index e946345..5976e23 100644
--- a/video.asm
+++ b/video.asm
@@ -1314,21 +1314,29 @@ detect_chr_ram_size:
stx PPUADDR
lda #$AA
sta PPUDATA
+ ; to prevent open bus read
+ lda #$55
+ sta PPUDATA
; check for $AA
stx PPUADDR
stx PPUADDR
ldy PPUDATA ; dump read
+ lda #$AA
cmp PPUDATA
bne .end ; check failed
; store $55
stx PPUADDR
stx PPUADDR
lda #$55
- ; check for $55
sta PPUDATA
+ ; to prevent open bus read
+ lda #$AA
+ sta PPUDATA
+ ; check for $55
stx PPUADDR
stx PPUADDR
ldy PPUDATA ; dump read
+ lda #$55
cmp PPUDATA
bne .end ; check failed
; select zero bank
@@ -1345,11 +1353,9 @@ detect_chr_ram_size:
inc <CHR_RAM_SIZE
jmp .next_size
.end:
+ ; return everything back
lda #0
jsr select_chr_bank
- lda #0
- sta PPUADDR
- sta PPUADDR
- sta PPUDATA
+ jsr load_base_chr
jsr disable_chr_write
rts