This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

VRC6 Test Rom and hot swapping carts

VRC6 Test Rom and hot swapping carts
by on (#130886)
A while back, I added (what is believed to be) fully correct VRC6 support to Bizhawk, including the special PPU mapping modes. I also created a test ROM to verify that my behavior was correct, and asked for people to run the test rom. I had someone run the test rom on an everdrive, which showed that an everdrive makes no attempt to implement the special mapping modes, and so was inconclusive overall. However, no one ran the test on a real VRC6 chip. I still want to get results, so I'd like to adapt the VRC6 test ROM that I made to be able to run as hotswap: it would be loaded on a programmable cart, and then booted, and then the cart would be swapped for a real VRC6 cart, which would then run the test.

I know that in order to be hotswappable, I need to put all code in internal RAM, and then consequently execute the test program without using any interrupts (since none of those vectors are under my control). Is there anything else I need to watch out for?
Re: VRC6 Test Rom and hot swapping carts
by on (#130887)
Here's a VRC6 audio test hotswap program and source, if it helps. I wrote it a while back to test some of the audio features.
Re: VRC6 Test Rom and hot swapping carts
by on (#130889)
While waiting for hotswap you can run OAM DMA to minimize the chance of crashes (you should be able to find a post or two on the forums by blargg suggesting this). It's also a good idea to somehow indicate that the code is still running, for example by switching the monochrome bit of PPU in a loop.
Re: VRC6 Test Rom and hot swapping carts
by on (#130891)
I tried the OAM DMA as a wait later on when Blargg suggested it to me. If you want to try it, replace the "swap_loop" segment of the program I posted with this:
   LDA #$02
   STA $4014
   STA $4014
   BIT $2002
   BPL @wait_nmi
   JSR swap_play
   JMP swap_loop

In my own experience, I didn't find it helped. I didn't notice an increased or decreased frequency of crash during the swap. Doesn't really matter though; just try again a few times and it should work sooner or later.

My indicator that stuff was still running was a short audio buzz via $4011 at the beginning and then again after the delay where I was supposed to swap the cartridge (and again as the process loops after completion).