Announcement

Collapse
No announcement yet.

Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

    I've been (trying to) get into some hacking with the Sega Master System (trying to build custom cartridges basically)

    As part of that, I decided to build this device called the SMSReader: http://www.smspower.org/Development/SMSReader as a way to test things.

    Schematic here: http://www.smspower.org/forums/viewtopic.php?t=6457


    The problem of course, then, is that it does not work properly!

    I have tried with a number of retail cartridges so far, it will read some cartridges just fine, but chokes when trying to read others, where large chunks of the dumped file are just all 1s or Hex FFFF

    I've tried all the points listed here: http://www.smspower.org/Development/...roubleshooting but to no avail.


    My thread on their forums is here: http://www.smspower.org/forums/viewtopic.php?t=13471 but so far nobody has given much useful help.


    I'm hoping someone here might be able to give some help instead, I know it's a long shot but I really don't know what else to do. If there was some stupid mistake in the design for example, I would not be experienced enough to spot it.
    "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
    -David VanHorn

    #2
    Re: Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

    Is it possible that the large chunks of all 1s or Hex FFFF are there just to fill space to achieve a particular file size?
    .
    Mann-Made Global Warming.
    - We should be more concerned about the Intellectual Climate.

    -
    Be who you are and say what you feel, because those who mind don't matter and those who matter don't mind.

    - Dr Seuss
    -
    You can teach a man to fish and feed him for life, but if he can't handle sushi you must also teach him to cook.
    -

    Comment


      #3
      Re: Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

      Sorry, I guess I didn't explain that properly - No, those aren't supposed to be there at all, at least not the ones I am talking about. There is padding present but it's at the end of the file, not in random chunks throughout it.

      Comparing (in a hex editor program) a downloaded and correct dump of the game to my dumped copy shows there should be real data present in those areas. (I can attach the files here if you'd like to see for yourself)

      I also know the dump was wrong as the SMSReader software has an inbuilt database of known ROMs. When reading my game it would not match up.
      "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
      -David VanHorn

      Comment


        #4
        Re: Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

        Where are the error locations? Are they truly random (changing every time you dump) or do they show up consistently at particular addresses?

        The page you linked to says that there are various sizes of catridges; are specific sizes resulting in the read errors you describe?

        If it's consistent, the addressing circuitry might be at fault.

        Another thing to keep in mind is the schematic shows the parallel port data pins connected directly to the cartridge data bus, and the cartridge works on 5V. Newer computers' parallel ports use 3.3V. You can check this with a DMM - if it's only outputting 3.3V, it's a very bad idea to connect it to the cartridge directly, as writing to the cartridge may not work (VOHmax is below VIHmin), and reading may result in a damaged port (since the cartridge will attempt to pull the port pins up to ~5V).

        Comment


          #5
          Re: Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

          The error locations seem to be consistent per-cartridge - but not all cartridges fail to work. I've attached a file containing a good dump and some bad dumps of Hang On so you can see for yourself what's going on...

          I tried two different cartridges of Hang On (32k) both of which consistently don't dump correctly, but a copy of Transbot (also 32k) does work.

          The games Michael Jackson's Moonwalker (256k), Alien Storm (256k), Sonic the Hedgehog (256k), Sonic the Hedgehog 2 (512k) all consistently dump fine, yet Wonderboy (128k) and Black Belt (128k) have issues.

          It could be there is an issue with the addressing for the 128k cartridges but then that isn't consistent with the 32k games and since those are the only games I could get my hands on, the sample size isn't really enough to prove much.

          (note that games higher than 32k also use bank switching circuitry)


          Unfortunately for some stupid reason I didn't save any of the dumps from the other cartridges that didn't work, so I'm not sure if the "FFFF error block" issue was also the problem with them as well, so I can't check that at the moment. (They were borrowed from a friend and I've given them back)


          Interesting though what you say about the newer parallel ports using 3.3v! I did not know this. Perhaps this is indeed a problem. I will look into this, perhaps I need to use a much older machine...
          Attached Files
          "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
          -David VanHorn

          Comment


            #6
            Re: Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

            You have 3 unique error signatures.

            The first 2 corrupt ones are the same and the corruption seems to repeat in blocks of 3584 bytes every 4096 bytes. i.e. these addresses

            0200-0FFF
            1200-1FFF
            2200-2FFF
            3200-3FFF
            ...

            are all corrupted. The first 512 bytes of each 4096 are OK.

            "corrupt 3" and "corrupt 5" are the same, and the error addresses are:

            0200-07FF
            0A00-0FFF
            1200-17FF
            1A00-1FFF
            2200-2FFF

            i.e. the first 512 of each 2048 are OK, and the rest corrupted. "corrupt 4" is a mix of the two:

            0200-087F (?)
            0A00-0FFF
            1200-1FFF
            2200-2FFF
            3200-3FFF

            I would check the connection for the A9 address bit. If you have a logic analyzer, connect it to the address and data busses and see that it's incrementing correctly.

            I didn't look at the software but if it has the option to manually "step" the address counters then you can go to just before 0200 and monitor the busses with a DMM while stepping into the problem area (the alternative would be to wire up some switches and push a button 512 times.) If it has an option to slow down the dump speed then try that too, maybe 9 bits switching state simultaneously (1FF -> 200) draws just enough power to glitch the supply/sag the busses below their limits. (Try adding more/higher capacity decoupling caps.)

            Comment


              #7
              Re: Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

              Thanks, I don't know when (or if) I would have spotted that pattern with the corrupt block addresses!

              I don't have a logic analyser unfortunately, but after reading this yesterday I realise I can probably get one easily...


              The software doesn't have a step feature, but it does have a manual seek and read\write feature.

              By manually setting the software to $01FF and reading, then setting to $0200 and reading again, I think it would do the same thing?

              I tried it, and didn't even get consistent data back when trying it. I would get the same data per-test but if I removed\replaced the cartridge or tried a read operation, etc etc and THEN tried a manual read I'd get a different result. Interestingly enough for address $0200 I couldn't get $FF data back manually at all!


              I also downloaded the DOS software (It has a speed option) and tried it much slower, but I did not get a successful read there either.


              Currently each IC has an 0.1uF ceramic decoupling capacitor and there's a 22uF across the supply rail. Do you think that is not enough?
              "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
              -David VanHorn

              Comment


                #8
                Re: Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

                Originally posted by Agent24 View Post
                I would get the same data per-test but if I removed\replaced the cartridge or tried a read operation, etc etc and THEN tried a manual read I'd get a different result. Interestingly enough for address $0200 I couldn't get $FF data back manually at all!
                Loose/intermittent connection, especially at the cartridge connector? (NES famously had problems with this )

                Comment


                  #9
                  Re: Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

                  Originally posted by b700029 View Post
                  Loose/intermittent connection, especially at the cartridge connector? (NES famously had problems with this )
                  Maybe, although the slot is brand new and the cartridges were all cleaned so probably not.

                  I will try to go back into the manual read feature and test if the A9 pin increments properly as you said (didn't actually do that last time, pain in the ass trying to hold a probe on top of an IC pin while using the keyboard and trying not to let the thing slip and short anything out!)


                  I'm also going to look at getting a new parallel cable since it turns out the one I was using isn't even shielded, which probably doesn't help.
                  "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
                  -David VanHorn

                  Comment


                    #10
                    Re: Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

                    This is a pretty cool thread, I must say.

                    Comment


                      #11
                      Re: Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

                      I realise I never updated this thread, but eventually I found the problem some months ago.

                      An error in my schematic meant a trace to the cartridge was missed out on my PCB.
                      This meant the /OE pin on the ROM was floating! No wonder function was intermittent...

                      It may well be as b700029 said - bigger current fluctuation while 9 lines change state at once, influencing whatever state the /OE pin was in.
                      "Tantalum for the brave, Solid Aluminium for the wise, Wet Electrolytic for the adventurous"
                      -David VanHorn

                      Comment


                        #12
                        Re: Reading ROMs, Digital logic ICs, Parallel ports and bugs... Advice?

                        The infamous floating pin. It will get you every time.

                        Comment

                        Working...
                        X