Hello, good night. During the development of a hardware cartridge, in order to erase a SST39SF040, we were trying to run code from a SRAM mapped at $6000. However, we were unable to and thought it was something wrong with the code, even though it ran perfectly fine on the emulator.
After one entire day of fiddling, I tried moving the code to $0200 and, surprisingly, it worked. Even more surprisingly, it ran correctly from the same SRAM at $7000. And even from $6100! It just wouldn't run from $6000.
So thinking it could be something about the bank switching register at $E000 interfering the RAM at $6000 due to improper address decoding during writes, I wrote a very basic code that cycles through all colors in the NES palette, ignoring bankswitching entirely. And... I have the same behaviour. And I cannot explain why this could be.
The code in question (to be compiled with asm6) that does not work in our board is the following:If someone could test it in real hardware, that would be very helpful. Or even better, find an explanation for this behaviour!
EDIT: A second test ROM that fills the WRAM with 0xAA, 0x55, 0x00 and 0xFF shows that the ICs are 99.9% sure alright. They were bought from Mouser, so they're not Chinese special either.
After one entire day of fiddling, I tried moving the code to $0200 and, surprisingly, it worked. Even more surprisingly, it ran correctly from the same SRAM at $7000. And even from $6100! It just wouldn't run from $6000.
So thinking it could be something about the bank switching register at $E000 interfering the RAM at $6000 due to improper address decoding during writes, I wrote a very basic code that cycles through all colors in the NES palette, ignoring bankswitching entirely. And... I have the same behaviour. And I cannot explain why this could be.
The code in question (to be compiled with asm6) that does not work in our board is the following:
Code:
; ***************; * iNES header *; ***************; Signaturedb $4E, $45, $53, $1A, $10, $00, $10, $08, $00, $00, $07, $07, $00, $00, $00, $00; *******; * RAM *; *******enum $0000curcol: dsb 1ende; ***********; * PROGRAM *; ***********rept $3E000db 0endrbase $E000include "reg.s65"reset_handler:sei; Disable interruptscld; Disable decimal modeldx #$FF; Setup stacktxsinxstx PPUCTRL; Disable NMIstx PPUMASK; Disable renderingstx DMCFREQ; Disable DMC IRQs; Clear RAMtxa-sta $0000,xsta $0100,xsta $0200,xsta $0300,xsta $0400,xsta $0500,xsta $0600,xsta $0700,xinxbne -; Wait one frame-bit PPUSTATUSbpl -ldx #0; Copy to RAM-lda ramcodestartrom,xsta ramcodestart,xinxcpx #ramcodeend-ramcodestartbne -jmp blinkramcodestartrom:BASE $6000ramcodestart:blink:ldx #30waitvblank:-bit PPUSTATUS bpl -dexbne waitvblanklda #$00sta PPUCTRLlda #$3Fsta PPUADDRlda #$3Fsta PPUADDRldx #$00lda curcol-sta PPUDATAinxcpx #$20bne -lda curcolclcadc #1and #$3Fsta curcoljmp blinkramcodeend:base ramcodestartrom+ramcodeend-ramcodestartpad $FFFA; NMI handlerdw 0; Reset handlerdw reset_handler; IRQ handler - none for nowdw 0
EDIT: A second test ROM that fills the WRAM with 0xAA, 0x55, 0x00 and 0xFF shows that the ICs are 99.9% sure alright. They were bought from Mouser, so they're not Chinese special either.
Statistics: Posted by socram — Fri Nov 01, 2024 6:17 pm — Replies 3 — Views 84