Hot-plugging Everdrive N8 and game cartidges

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderator: Moderators

NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Hot-plugging Everdrive N8 and game cartidges

Post by NewRisingSun »

I would like to investigate the behavior of a few custom mapper chips, and also measure the relative expansion sound volume of various Namcot 163 carts, with a self-written test program using simple means. My plan was to write and use the Everdrive N8 to run a mapper 0 program that copies itself into RAM ($000-$7FF), disables interrupts and NMI and waits for controller input. While it does that, I remove the Everdrive N8 and insert the cartridge whose properties I want to test, press a controller button, so that my program in RAM will do its test and report its results acoustically or via attribute byte changes.

Can this work, and if not, can it damage any component? I plan to use a Twin Famicom for this, so there should be no unexpected reset during the hot-plugging sequence.
Great Hierophant
Posts: 780
Joined: Tue Nov 23, 2004 9:35 pm

Re: Hot-plugging Everdrive N8 and game cartidges

Post by Great Hierophant »

I tried Chris Covell's TapeDump program once on my AV Famicom to dump my 72-pin Super Mario Bros. cartridge. I am pretty sure I used my EverDrive to load the dumping ROM, then swapped it out with SMB (with an attached pin converter) and successfully completed the dump. My EverDrive is still going strong, as is my AV Famicom. I believe what you want to do is pretty similar in concept and execution.

viewtopic.php?f=2&t=7978

Anecdotal evidence I know, but I hope it helps.
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Hot-plugging Everdrive N8 and game cartidges

Post by rainwarrior »

I've done this probably hundreds of times with my PowerPak / Famicom. I'm sure the Everdrive could do it as well.

There's probably a 50% chance the NES will crash when you pull the cart out, but its easy to just try again.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Hot-plugging Everdrive N8 and game cartidges

Post by tepples »

I've been told that doing OAM DMA in a fairly tight loop reduces the chance of crashing, though it appears not to work for everyone. (See previous posts: blargg mentions OAM DMA; VRC6 Test Rom and hot swapping carts)

Code: Select all

loop:
  lda #$02
  ldy #$22
  sty $4011  ; buzz the speaker to indicate not crashing
  sta $4014  ; initate DMA
  sta $4011  ; more buzz
  sta $4014  ; another DMA

  ; OMITTED: do whatever check for whether done
  beq loop
User avatar
krzysiobal
Posts: 1037
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland
Contact:

Re: Hot-plugging Everdrive N8 and game cartidges

Post by krzysiobal »

I have AX5202P MMC3-clone based cartridge which ocassionaly gets really hot when hot plugged (into kazzo). I would not recommend hot-swapping anything that was not designed.

Some chips require proper supply voltage timings. If the cartridge edge connetor makes contact on address/data lines before the power line contact, the cartridge's chips will be powered through those lines which might damage it.
MLX
Posts: 110
Joined: Tue Feb 14, 2017 9:50 am

Re: Hot-plugging Everdrive N8 and game cartidges

Post by MLX »

krzysiobal wrote:I have AX5202P MMC3-clone based cartridge which ocassionaly gets really hot when hot plugged (into kazzo). I would not recommend hot-swapping anything that was not designed
This is indeed not completly on subject but it's a good chance to ask; I've noticed that with my Kazzo as well, I have a bunch of cartridges where a PAL or a MMC chip get very hot in minutes when plugged in the Kazzo. Like Contra Fighter (on that one it was very bad) and KS-7030. I'm guessing the chips are trying something that continuously fail and draws a lot of current?
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Hot-plugging Everdrive N8 and game cartidges

Post by nesrocks »

I have a question not entirely on topic: has anyone ever made a game that transfers itself to nes ram on startup and then runs entirely there and the cartridge can be removed? I had no idea the cartridge could be removed like that.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Hot-plugging Everdrive N8 and game cartidges

Post by rainwarrior »

nesrocks wrote:I have a question not entirely on topic: has anyone ever made a game that transfers itself to nes ram on startup and then runs entirely there and the cartridge can be removed? I had no idea the cartridge could be removed like that.
If you remove the cartridge, CHR isn''t connected to anything so you can't really have any graphics except attributes or raster lines? (Actually, not sure about attributes... addressing the nametables might not be possible without a cartridge?)

ccovell wrote a theremin program (audio only) that runs like this though. It also used some analog electrical effects present without a cartridge in to respond to your hands nearby.
https://forums.nesdev.com/viewtopic.php ... min#p95339
Last edited by rainwarrior on Fri Jan 05, 2018 11:50 am, edited 3 times in total.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Hot-plugging Everdrive N8 and game cartidges

Post by tepples »

Furthermore, timing sources aren't reliable. The vblank bit in $2002 has that race condition between reading and acknowledgment, and there are no IRQ or NMI vectors when no cartridge is inserted. What timing source is reliable and not subject to a race condition?
User avatar
rainwarrior
Posts: 8732
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Hot-plugging Everdrive N8 and game cartidges

Post by rainwarrior »

$2002 is reliable "enough" for a lot of purposes though. Not for raster timings, but certainly for a coarse "frame" timing. I've used it for that on many hotswap tests.

How often you get the race condition is dependent on how often you are polling it. It's kind of a heisenberg uncertainty thing where you can make it more reliable but less precise, or vice versa. (You could also use a tight loop to hit it precisely once to get things started, and then just go cycle-timed from there on?)

Actually maybe you could use sprite overflow for raster timings?


It occurs to me that many Atari 2600 games were as small as 2k and it was also a 6502. This is almost an Atari 2600 sized problem. ;)
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Hot-plugging Everdrive N8 and game cartidges

Post by lidnariq »

nesrocks wrote:I have a question not entirely on topic: has anyone ever made a game that transfers itself to nes ram on startup and then runs entirely there and the cartridge can be removed? I had no idea the cartridge could be removed like that.
I've also written something.
If you remove the cartridge, CHR isn''t connected to anything so you can't really have any graphics except attributes or raster lines? (Actually, not sure about attributes... addressing the nametables might not be possible without a cartridge?)
No meaningful background at all. NTRAM's enable is floating, but seems to tend to float high towards "disabled". So for the most part, everything's just the PPU open bus pattern:
openbus.png
openbus.png (1.58 KiB) Viewed 6429 times
Sprites can be positioned and colored arbitrarily, but again, their contents are the open bus pattern:

Code: Select all

WXYZ▒  ▄
WXYZ▒ █▄
WXYZ▒█ ▄
WXYZ▒██▄
(where WXYZ are color 3 if the 8s, 4s, 2s, and 1s bits of the tile number is set, backdrop/transparent otherwise) , █ is color 3, ▒ is color 2, ' ' is transparent.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Hot-plugging Everdrive N8 and game cartidges

Post by tokumaru »

The sprite overflow does sound like a reliable way to keep track of time. I believe you can even place them on scanline 240 (Y coordinate 239 in their respective OAM entries) so they're evaluated during the last visible scanline, but never displayed, so you don't have to worry about their palettes or their graphics.
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Hot-plugging Everdrive N8 and game cartidges

Post by nesrocks »

lidnariq wrote:I've also written something
That sounds great. These things would go viral with a properly editted video to show it off.
lidnariq wrote:No meaningful background at all. NTRAM's enable is floating, but seems to tend to float high towards "disabled". So for the most part, everything's just the PPU open bus pattern
Looks like you can almost reliably have the attribute table being used as huge 16x16 "pixels" and have a crude game going on (snake perhaps).
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Hot-plugging Everdrive N8 and game cartidges

Post by Memblers »

If it's a cart you can afford to replace, hot-swapping should be fine. Probably best not to take any chances if it's something rare.

I use a Game Genie to mess with carts. Some of them have epoxy blobs, but the other ones have a normal 27C32 EPROM that can be replaced. After setting the Game Genie control registers, you have access to the cart, but can no longer access the GG ROM or registers. I use a bootloader ROM that will send/receive data over the 2nd controller port with a USB-to-TTL adapter, it can load a program into NES RAM $200-$7FF or write an .NES file to a GTROM cart. Maybe I should share the EPROM code if anybody wants build one, otherwise all this comes with the Cheapocabra devkit which normally goes for $35+shipping.

I haven't tried plugging an FC cart adapter into the Game Genie before, but I imagine it should work fine.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Hot-plugging Everdrive N8 and game cartidges

Post by lidnariq »

nesrocks wrote:Looks like you can almost reliably have the attribute table being used as huge 16x16 "pixels" and have a crude game going on (snake perhaps).
No... there's no ability to change which attributes are used where. It's always going to be the four palettes in that pattern.
Post Reply