It is currently Tue Oct 23, 2018 12:57 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Aug 09, 2018 1:10 am 
Offline
User avatar

Joined: Fri Feb 27, 2009 2:35 pm
Posts: 295
Location: Fort Wayne, Indiana
A user on Kaydus's nesdev Discord server mentioned wanting to be able to keep track of game stats from a game being played on an actual NES, for speedrunning purposes (automatic splits) and to keep track of things like death count. This made me think of modifications I've seen that replace the NES's RAM with dual-ported RAM, but I feel like a Game Genie-like device that watches for writes to specific RAM addresses would be a lot better because that would avoid modifying the NES, and it would work with PRG-RAM too.

I guess the obvious changes from dual ported RAM + microcontroller are that you'd need to find a 72-pin cartridge connector somewhere (and I hear they're difficult to find) and you'd probably need some sort of programmable logic to be able to react to the write fast enough.

Another option I can see would be the Everdrive N8's USB port, with a custom mapper that watches for writes in addition to performing mapper functions, if the hardware is capable of controlling the USB port like that.

Any advice or better ways to accomplish this? Or preferably a preexisting product?


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 3:22 am 
Offline
User avatar

Joined: Thu Sep 15, 2016 6:29 am
Posts: 773
Location: Denmark (PAL)
NovaSquirrel wrote:
A user on Kaydus's nesdev Discord server mentioned wanting to be able to keep track of game stats from a game being played on an actual NES, for speedrunning purposes (automatic splits) and to keep track of things like death count. This made me think of modifications I've seen that replace the NES's RAM with dual-ported RAM, but I feel like a Game Genie-like device that watches for writes to specific RAM addresses would be a lot better because that would avoid modifying the NES, and it would work with PRG-RAM too.


I'm not sure a "game genie" could do this well, as the NES RAM is being accessed directly from the CPU, not via the cartridge, and you can't afford to interfer with the CPU usage during a speedrun :)
I guess you could do a low-key version that detects what addresses are being read from the cartridge, but then you have the issue with mappers.


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 3:47 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10914
Location: Rio de Janeiro - Brazil
The cartridge does have access to the address and data buses, so I suppose it could tell when the CPU is writing to RAM and snatch a copy of the value if the address matches one of the addresses being watched.


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 5:50 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2308
Location: DIGDUG
You could read that RAM with your program, once per frame, and print its contents to screen with 2 sprites.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 6:34 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20688
Location: NE Indiana, USA (NTSC)
Anything where you insert code in NMI might change lag frames, which can invalidate a run's timing. It has to be based on snooping writes and logging them somewhere.


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 9:04 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 3132
Location: Tampere, Finland
I have been thinking about the exact same thing sometimes when watching speedrunners doing their splits manually. I think you could do a lot of stuff by simply watching PRG accesses, just have to configure it for each game separately. So a GameGenie-like device should be sufficient. You could test this theory on emulators quite easily, e.g., with Lua support in FCEUX.

I think many speedrunners wouldn't go for a EDN8/PowerPak solution since they seem to prefer to do attempts on original cartridges. But it would make for a cool demo.

The device could keep track of frame count based on M2. Or even cycle count, if you have enough bits in your counter. :)

Another idea would be to use the expansion port, but unfortunately it doesn't have the necessary signals. It has the data bus, but only A15 of the address bus. So you'd need a GameGenie-like device to pass more information via the EXP pins, but that kind of defeats the point of using the expansion port.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 9:42 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20688
Location: NE Indiana, USA (NTSC)
If all you can snoop on the NES expansion port are A15 and D7-D0, watching for this sequence should handle the obvious cases:

  1. A15 = high, D7-D0 = target RAM address bits A7-A0
  2. A15 = high, D7-D0 = target RAM address bits A15-A8
  3. A15 = low, D7-D0 = target RAM value

Because the R/W signal isn't present, this logic might not catch when something is incremented.


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 11:30 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10914
Location: Rio de Janeiro - Brazil
Doesn't the cartridge port have all the signals? What prevents a Game Genie-like device from detecting writes to RAM and copying the values to show them on a built-in display?


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 11:33 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20688
Location: NE Indiana, USA (NTSC)
The cartridge port has all 26 signals needed to monitor the CPU's activity: M2, PRG /CE, R/W, A14-A0, and D7-D0. But using a cartridge port device with an authentic cartridge will cause the cartridge to stick out of the front of the Control Deck. This in turn invites accusations of using a Game Genie or similar cartridge port device capable of more than just "snooPING AS usual", in particular things that invalidate a run.


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 11:50 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 3132
Location: Tampere, Finland
Yeah I kind of like the idea of using the expansion port (if it wasn't for the obvious issues) because it seems less intrusive, although in practice people could cheat their asses off if they wanted, even if "the cartridge wasn't sticking out of the system". It's all based on trust.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 11:52 am 
Offline

Joined: Fri Apr 07, 2017 5:02 pm
Posts: 15
While it does sound interesting, being able to read RAM on console, coming from a speedrunner perspective this would be a big no no. Looking at the RAM during a run is not allowed as it can provide an unfair advantage, like knowing what RNG seed you are on, enemy/boss patterns etc. Anything that you can't do on an original, unmodified console is not allowed. It could prove useful for practice however, but would need to be turned off for actual run attempts.


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 12:00 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 3132
Location: Tampere, Finland
It depends what the system would do I guess.

I don't see a problem in doing automated splits like this. But if the system would show, e.g., what state the RNG is in, that of course is not OK.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 12:08 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6900
Location: Canada
thefox wrote:
I think many speedrunners wouldn't go for a EDN8/PowerPak solution since they seem to prefer to do attempts on original cartridges. But it would make for a cool demo.

I've seen many speedrunners using these things. I think in general as long as they're open about it, in most cases it's still considered an acceptable run? I'm sure rules vary a bit depending on who runs the leaderboard for any particular game, though.


Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 1:00 pm 
Offline
User avatar

Joined: Thu Sep 15, 2016 6:29 am
Posts: 773
Location: Denmark (PAL)
tepples wrote:
The cartridge port has all 26 signals needed to monitor the CPU's activity: M2, PRG /CE, R/W, A14-A0, and D7-D0. But using a cartridge port device with an authentic cartridge will cause the cartridge to stick out of the front of the Control Deck. This in turn invites accusations of using a Game Genie or similar cartridge port device capable of more than just "snooPING AS usual", in particular things that invalidate a run.


I think if a device like this existed, it would very quickly be embraced by the speedrun community, and no one would blame the device. I t wouldn't just be some unknown thing some guy is using.
It's very easy to cheat in speedrunning if you really want to, and it happens a lot as it is. But there also exists a sense of trust, a code of honor as such (which is what caused the community to point out the blatant lies going on at Twin Galaxies), and it's usually very easy to out a cheater.


Last edited by Sumez on Thu Aug 09, 2018 10:41 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Aug 09, 2018 3:07 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6900
Location: Canada
Yeah, with so many people who stream their attempts, there being witnesses and recordings not just of the successful attempts but you can also see that they "put in the time" to deserve that run. Big difference in trust from the era of people mailing in VHS tapes. Cheating still happens but there's some good ways to build a trusted reputation at least.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group