Monday, May 11, 2009

debugging sessions, part II

Well, hmm, perhaps this is a bit anticlimactic. I was looking over my work, and for some reason i mapped address bit 23 as the /cart_enable signal. Basically, this means if you access the ROM in banks $80 - $FF, then it would disable my cart. If you're a snes guru, you probably realize what this means. It means that no fastrom games will work properly.

I fixed this, and now fastrom games work! well, sometimes....

I got a big kick out of this. Pictured above is my cart trying to boot Kirby's Dream Course. It has some pirate deterrents built-in that test the sram save functionality. A lot of backup units from '90s would just use a 32kbyte sram chip (since that was the largest needed to support certain games), but Kirby's Dream Course only had 8kbyte (= 8192 bytes) of sram in the real cart. So, if it tries to write the the 8193rd byte.. then it should wrap and write at byte 0. In a copier with 256kbyte of save sram, this wouldn't happen, and this game would detect it and display this message.

In my case, I hadn't implemented saving at all yet. I worked on this for a good chuck of the weekend, and it seems to be working now. I can even boot Earthbound:


There are still some issues. One of the big ones is corrupt graphics in the Captain America game. I talked to Nach, one of the zsnes authors about it, and apparently this is a bug that showed up in many emulators. It had something to do with memory mapping. I'm wondering if this is just an odd cartridge and triggers data outputs on a weird signal. It would be awesome if anyone had a Captain America cart and could check for me. I might buy one on ebay in a few months if I can't figure it out.

I had been reading the bsnes source for a guide on how to do a lot of the mapping. The author, byuu, is a very meticulous, detail-oriented coder, and it really shows in his work. Most of the stuff in his code is accurate enough that I can just go straight from his memory maps to my hardware and it works. I did find some discrepancies, though I'm not sure if they are issues with the code, or just issues in my understanding of the code. I want to email him about it. I wonder if he'll respond.

8 comments:

  1. LOL ME BE PIRATE = BAD?

    It seems to be going well, I think that the whole kirby's dream course is quite a bit funny, I don't think I'd be able to check my captain america cart, but I would if I could.

    ReplyDelete
  2. Awesome, glad to see it working with games other that Super Mario World! XD

    Oh, and that bit about Kirby explains one thing I never figured out as a kid.
    For some reason my [legit?] Kirby cart always did that. XD
    I think it was probably just defective because it worked for a period of about a year.

    Anyways, great work as always, and I would be happy to be a beta tester. I have a clone system, and a real system that I could do testing on. :)

    ReplyDelete
  3. @Jesse if you have the gamebit screwdriver, it would be awesome if you could just open the case and take a some hi-res closeup pics of the pcb. If not, that's ok.

    @Ed either the "MAD-1" address decoder or the sram is fried. more likely the sram. if you're feeling crazy you could desolder it and replace it with another 64kbit sram from another game. It could be a fun experiment!

    ReplyDelete
  4. Yeah, I do, and if that's all you need I'll get right on it. If you're wondering it is the NTSC form of the cart.

    ReplyDelete
  5. shouldn't make any difference NTSC /PAL only difference is the casing & CIC

    anyway thanks a lot jesse!

    ReplyDelete
  6. Ok, so far, my pictures aren't top quality and I haven't uploaded them on my computer let alone the internet, I had a look at the chips on there and I could get the board and one of the capacitor readings too, so far this is what i've got (pics later)

    BIG CHIP - TOSHIBA 9335EAI 7C538003AP SNS-6A-0 N657 Japan

    Little Chip - D411A 1990 Nintendo 9331CB

    Board says SHVC-1A0N-10 (I'm not sure if those were 1/I or 0/o)

    and the capacitor I could read had 6.3v 2.2uF

    ReplyDelete
  7. @Jesse Thanks for the info. This is the same PCB as NFL Football, which I have. I checked it out, and there wasn't anything out of the ordinary (cart /CS -> snes /RD, cart /OE -> snes /CS). Hmm...

    ReplyDelete