View Full Version : Gameshark <--> PC Communication
HyperHacker
Fri 8 Dec 2006, 04:15
Has anyone managed to have an N64 talk to a PC via the Gameshark's parallel port? And if so is there documentation/source I could use to try to do this myself? I have the Neon64 GS Uploader source (http://n64dev.cvs.sourceforge.net/n64dev/n64dev/util/gsupload/gsupload.cpp?revision=1.4&view=markup) but that only seems to be code to upload a program into N64 RAM (which I will need to do); I need to have that program talk to the PC program as well. The idea here is to load a program into memory while a game is running (using the Expansion Pak memory) and communicate information about the game back and forth. GSCC does it, so I know it can be done, but it doesn't do everything I want.
The gsuploader reads from N64 RAM, too. That should allow you to write things into RAM on the N64 side and read them back. Ideally we'd have our own code running the parallel port, but I don't know enough about the hardware interface.
Spoondiddly
Sat 9 Dec 2006, 20:58
I really question if GSCC actualy does do that. However, a nice starting point might be to look at how the registers at 1E400000 are used. The gs button is mapped to 04 and can be manually triggered with any old code. The second byte seems to be used by the parallel port during upload/download.
Your best bet would probably be to disassemble either the official tools or gscc.
HyperHacker
Sat 9 Dec 2006, 21:50
OK, reading from and writing to N64 memory should be sufficient. The Code Generator will need to be running, correct? I'd prefer it not have to be (even if it means having to inject my communications code through an actual GS code); that'll cause problems with 8MB games, but for now I can make do with 4MB.
Spoondiddly, thanks for that info, I was looking for it way back when so I could trigger the GS button from the controller instead of having to touch the unstable hardware. Now that Nemu works well enough (and I have a non-sucky computer) I don't really use that anymore though. :p Anyway GSCC does indeed read and write N64 memory while a game is running; you can even have the PC display RAM updated in real time. I don't know near enough x86 ASM to go about disassembling them, but I think GSUploader will do what I need, thanks.
What sort of bandwidth are we talking here? I don't need much, probably just under 2K/s to start with though that could go up. (Specifically, about 32 bytes per frame.)
hcs
Sun 10 Dec 2006, 04:39
That "real time" is just periodic polling. I have no idea what kind of bandwidth you might expect... I've never measured it.
Spoondiddly
Wed 27 Dec 2006, 16:34
This may be slightly off-topic, but if you want to simulate the "add active codes" feature of gscc...
807E9D60 stores the number of gameshark-formatted codes usually activated after using the built-in code generator. Somewhere between 50-60 can be added at any given time. Each of these is 6 bytes. Usable code types are:
80,81
D0,D1
and on v3.3 sharks D2,D3
The code list starts are 807E9D64. To write a new entry, read the number of entries from 807E9D60. Multiply by 6 and add to A07E9D64. (have to use the mirror) Upload the 6-byte code, then revise the number of entries at A07E9D60.
Addresses above this range take care of the code generator and such nonsense, none of it too interesting.
vBulletin v3.6.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.