I'm trying to figure a way to test whether emulators *truly* support WRAM bigger than 8K.
The test I came up with was to write a different value to the last byte of each 8K WRAM bank and then when all 4 banks have been written, read the values back from each bank and check that they are still set correctly.
The logic behind this is that if the WRAM bank-switching is not implemented, the value from each bank will read the same value (the last value that was written) and therefore I can trap that condition.
However, I've tested this in FCEUX, NesterJ and VirtuaNES and the odd thing is, despite the fact that I *know* these emulators don't support WRAM>8K, the test doesn't catch.
Can anyone suggest another test?
Here's the code from my test:
'setMMC1r1' sets the WRAM bank
WRAM0_TEST is a RAM variable in bank 0
WRAM1_TEST is in bank 1 etc
The test I came up with was to write a different value to the last byte of each 8K WRAM bank and then when all 4 banks have been written, read the values back from each bank and check that they are still set correctly.
The logic behind this is that if the WRAM bank-switching is not implemented, the value from each bank will read the same value (the last value that was written) and therefore I can trap that condition.
However, I've tested this in FCEUX, NesterJ and VirtuaNES and the odd thing is, despite the fact that I *know* these emulators don't support WRAM>8K, the test doesn't catch.
Can anyone suggest another test?
Here's the code from my test:
Code:
lda #WRAM_BANK_00
jsr setMMC1r1
lda #$01
sta WRAM0_TEST
lda #WRAM_BANK_01
jsr setMMC1r1
lda #$02
sta WRAM1_TEST
lda #WRAM_BANK_02
jsr setMMC1r1
lda #$04
sta WRAM2_TEST
lda #WRAM_BANK_03
jsr setMMC1r1
lda #$08
sta WRAM3_TEST
lda #WRAM_BANK_00
jsr setMMC1r1
lda WRAM0_TEST
cmp #$01
bne @lockUp
lda #WRAM_BANK_01
jsr setMMC1r1
lda WRAM1_TEST
cmp #$02
bne @lockUp
lda #WRAM_BANK_02
jsr setMMC1r1
lda WRAM2_TEST
cmp #$04
bne @lockUp
lda #WRAM_BANK_03
jsr setMMC1r1
lda WRAM3_TEST
cmp #$08
beq @noLock
@lockUp: jmp @lockUp
@noLock:
jsr setMMC1r1
lda #$01
sta WRAM0_TEST
lda #WRAM_BANK_01
jsr setMMC1r1
lda #$02
sta WRAM1_TEST
lda #WRAM_BANK_02
jsr setMMC1r1
lda #$04
sta WRAM2_TEST
lda #WRAM_BANK_03
jsr setMMC1r1
lda #$08
sta WRAM3_TEST
lda #WRAM_BANK_00
jsr setMMC1r1
lda WRAM0_TEST
cmp #$01
bne @lockUp
lda #WRAM_BANK_01
jsr setMMC1r1
lda WRAM1_TEST
cmp #$02
bne @lockUp
lda #WRAM_BANK_02
jsr setMMC1r1
lda WRAM2_TEST
cmp #$04
bne @lockUp
lda #WRAM_BANK_03
jsr setMMC1r1
lda WRAM3_TEST
cmp #$08
beq @noLock
@lockUp: jmp @lockUp
@noLock:
'setMMC1r1' sets the WRAM bank
WRAM0_TEST is a RAM variable in bank 0
WRAM1_TEST is in bank 1 etc