VRC6 Test Rom and hot swapping carts

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
natt
Posts: 76
Joined: Fri Oct 26, 2012 5:27 pm

VRC6 Test Rom and hot swapping carts

Post by natt » Wed Jul 09, 2014 10:59 am

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?

User avatar
rainwarrior
Posts: 7891
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: VRC6 Test Rom and hot swapping carts

Post by rainwarrior » Wed Jul 09, 2014 11:06 am

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.
Attachments
vrc6_swap_test.zip
(4.35 KiB) Downloaded 200 times

User avatar
thefox
Posts: 3141
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Re: VRC6 Test Rom and hot swapping carts

Post by thefox » Wed Jul 09, 2014 11:06 am

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.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi

User avatar
rainwarrior
Posts: 7891
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: VRC6 Test Rom and hot swapping carts

Post by rainwarrior » Wed Jul 09, 2014 11:15 am

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:

Code: Select all

swap_loop:
@wait_nmi:
	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).

Post Reply