Hello all
I am a university student in computer engineering, and i am making a circuit to dump NES cartridges. why? just for fun & learning. i came into this project with absolutely no knowledge of how the NES works, but through much time spent reading the wonderful articles on your sister site, i have *almost* successfully built this piece of hardware
but only almost.
before i get to my problem, a brief layout of what i put together and how it operates:
a PIC 16F877 hooked up to two 74HC595 (8 bit) shift registers in series. the shift registers are hooked up to address lines PRG a0 to PRG a14. the PRG data lines are hooked up directly to port C. PRG /CE and PRG R/W are both pulled low.
right now i am only concerned with dumping the PRG rom, 30 wires is already getting a little crazy.
the microcontroller shifts out a 15 bit address, and then reads the byte off of port C. it then sends the byte over a RS-232 serial connection to my PC.
now. it all *seemingly* works fine and dandy. i shift out addresses starting at 0x0000 (even though the ROM starts at 0x8000 in the CPU address space, it is my understanding that pulling PRG /CE low is equivalent to setting the MSB of the address to 1. so 0x0000 + CE = 0x8000 ?). My hyperterminal window fills with hex. the only problem is that the hex code is completely different than the SMB ROM that i downloaded off of the internet. _except for the first byte_
now. there are three possible scenarios here.
one, the ROM i am using for reference is not the same game that i am dumping. I am positive that the game i am using is the original SMB w/ duck hunt, so thats the ROM i got. i have compared 4 different versions of the ROM, the first kilobyte or more is the same across the board. but nowhere near what I'm reading off of this cartridge.
two, amongst the mess of wires flying around my breadboard, i got some address or data lines crossed. ive already checked once, but ill double check again later (im taking a bit of a break, ive been at this for hours...). either that, or i still do not understand exactly how to hook things up properly, and it just isn't working and never would. this still means i have to explain the first byte being the same as a "large coincidence"
three, my code is messed up. Ive already chased down a few bugs, but at this point no matter what i do i still get the same data out of it.
so basically, i was wondering if anyone had and suggestions or ideas. am i going about this right? I'm really hoping I'm just missing a wire or something simple like that. if you want i can provide my code here too, its written in C. i know that theres a mapper in this cart i should be worrying about, but i assumed that in its default state, id be reading from the beginning of the ROM. can anyone explain how the mapper works? i think i have to write a byte to some random address, but i cant find out exactly where or how.
finally, id like to end this post with the first 256 bytes that i am reading, in the hope that maybe someone can identify what i am seeing (assuming it isnt just garbage)
I am a university student in computer engineering, and i am making a circuit to dump NES cartridges. why? just for fun & learning. i came into this project with absolutely no knowledge of how the NES works, but through much time spent reading the wonderful articles on your sister site, i have *almost* successfully built this piece of hardware
but only almost.
before i get to my problem, a brief layout of what i put together and how it operates:
a PIC 16F877 hooked up to two 74HC595 (8 bit) shift registers in series. the shift registers are hooked up to address lines PRG a0 to PRG a14. the PRG data lines are hooked up directly to port C. PRG /CE and PRG R/W are both pulled low.
right now i am only concerned with dumping the PRG rom, 30 wires is already getting a little crazy.
the microcontroller shifts out a 15 bit address, and then reads the byte off of port C. it then sends the byte over a RS-232 serial connection to my PC.
now. it all *seemingly* works fine and dandy. i shift out addresses starting at 0x0000 (even though the ROM starts at 0x8000 in the CPU address space, it is my understanding that pulling PRG /CE low is equivalent to setting the MSB of the address to 1. so 0x0000 + CE = 0x8000 ?). My hyperterminal window fills with hex. the only problem is that the hex code is completely different than the SMB ROM that i downloaded off of the internet. _except for the first byte_
now. there are three possible scenarios here.
one, the ROM i am using for reference is not the same game that i am dumping. I am positive that the game i am using is the original SMB w/ duck hunt, so thats the ROM i got. i have compared 4 different versions of the ROM, the first kilobyte or more is the same across the board. but nowhere near what I'm reading off of this cartridge.
two, amongst the mess of wires flying around my breadboard, i got some address or data lines crossed. ive already checked once, but ill double check again later (im taking a bit of a break, ive been at this for hours...). either that, or i still do not understand exactly how to hook things up properly, and it just isn't working and never would. this still means i have to explain the first byte being the same as a "large coincidence"
three, my code is messed up. Ive already chased down a few bugs, but at this point no matter what i do i still get the same data out of it.
so basically, i was wondering if anyone had and suggestions or ideas. am i going about this right? I'm really hoping I'm just missing a wire or something simple like that. if you want i can provide my code here too, its written in C. i know that theres a mapper in this cart i should be worrying about, but i assumed that in its default state, id be reading from the beginning of the ROM. can anyone explain how the mapper works? i think i have to write a byte to some random address, but i cant find out exactly where or how.
finally, id like to end this post with the first 256 bytes that i am reading, in the hope that maybe someone can identify what i am seeing (assuming it isnt just garbage)
Code:
78 69 42 23 07 cf a2 06 27 20 23 e6 4a 20 00 d0
c9 cf 07 01 03 09 33 0a 45 02 c7 f0 0a c9 8d 2e
69 07 0a 20 4a 00 18 85 85 09 31 c9 89 1c 38 00
c9 cf 58 20 29 03 ed a9 1b 6d 4a 02 0c 4b 18 14
a2 d9 25 c9 f0 49 00 16 c8 05 8b a4 4a 16 0e f4
bc 95 0e 02 0d 1e a9 18 16 1f 87 09 d8 e3 ee 84
8d 07 c7 04 13 08 ad 15 a9 a0 8d 0a 60 95 46 84
70 c0 42 b2 e8 90 b5 f9 06 cf b6 07 ff 03 d5 00
00 10 0e f0 8d 00 07 ad f7 60 0d 02 06 60 cf d0
07 6e 13 c8 93 69 29 cb 26 10 40 c1 b1 d0 a9 34
ad 04 0d aa 07 02 c9 aa f0 1e 00 09 a9 20 53 04
98 95 22 bd 99 ad 20 a9 30 2c e3 fc 0f c9 20 5c
20 07 e9 95 f0 b5 01 a2 23 7a b3 29 09 33 d0 12
85 8a 38 a9 07 85 33 d0 1e 99 06 18 c9 20 8d 04
bd cf 02 c6 aa 02 d0 60 86 bf 0f 4a bc 9d ee 00
24 d3 f8 dc 30 80 d0 a4 9d 3c 30 4a 10 6d a9 09
c9 cf 07 01 03 09 33 0a 45 02 c7 f0 0a c9 8d 2e
69 07 0a 20 4a 00 18 85 85 09 31 c9 89 1c 38 00
c9 cf 58 20 29 03 ed a9 1b 6d 4a 02 0c 4b 18 14
a2 d9 25 c9 f0 49 00 16 c8 05 8b a4 4a 16 0e f4
bc 95 0e 02 0d 1e a9 18 16 1f 87 09 d8 e3 ee 84
8d 07 c7 04 13 08 ad 15 a9 a0 8d 0a 60 95 46 84
70 c0 42 b2 e8 90 b5 f9 06 cf b6 07 ff 03 d5 00
00 10 0e f0 8d 00 07 ad f7 60 0d 02 06 60 cf d0
07 6e 13 c8 93 69 29 cb 26 10 40 c1 b1 d0 a9 34
ad 04 0d aa 07 02 c9 aa f0 1e 00 09 a9 20 53 04
98 95 22 bd 99 ad 20 a9 30 2c e3 fc 0f c9 20 5c
20 07 e9 95 f0 b5 01 a2 23 7a b3 29 09 33 d0 12
85 8a 38 a9 07 85 33 d0 1e 99 06 18 c9 20 8d 04
bd cf 02 c6 aa 02 d0 60 86 bf 0f 4a bc 9d ee 00
24 d3 f8 dc 30 80 d0 a4 9d 3c 30 4a 10 6d a9 09