Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Region changing in hardware

Reply to topic
Author Message
  • Joined: 05 Nov 2014
  • Posts: 229
  • Location: Auckland - NZ
Reply with quote
Region changing in hardware
Post Posted: Thu Jun 20, 2019 10:39 am
I was trying to replicate the region changing method that Tim's FM board uses. That works by looking for a IO write to port $3F and then pulling the JyDs pin high, which disables the IO chip and hopefully prevents it seeing the write, so the TH pin never changes state.

I didn't have much luck getting that to work well and apparently it doesn't work on around 20% of systems with the FM board as well. The timing of this seems to be very critical so i looked at other ways around it.

I thought about letting the CPU write to port $3F happen, then using the bus request pin to halt the CPU, which would free up the bus. Then i could externally write to port $3F with a micro and change TH back to 0 or 1 before freeing up the bus again and letting the CPU continue. That should work quite well but it got a little involved for my liking.

The other way i thought about doing this was to look at the OP code being read by the CPU during the M1 cycle. D3 is an OUT command and the next read after that is the port being written to. Using that i could then disable the IO chip (with the JyDs pin as above) before the CPU even starts the write process, avoiding all of the timing issues i faced earlier.

I had a crack at doing it the Op Code way with programmable logic and managed to get it going. It was a bit of trial and error and i had to get a new logic analyzer with more channels to be able to watch what was happening but it seems to work ok. I ended up making a small program that wrote to $3F in a loop and also made a little controller port breakout board with some LEDs on it for TH and TR so i could see if the pins were changing state. I also made a breakout board for the cart port to make hooking the logic analyzer up easy. The board directly under the cart is the bit doing the work.

Ive since tested this with a couple of games, both with and without FM sound and it seems fine.
Capture.PNG (134.92 KB)
Capture.PNG
20190620_223218.jpg (277.4 KB)
20190620_223218.jpg
20190620_223307.jpg (139.33 KB)
20190620_223307.jpg
20190620_223314.jpg (316.67 KB)
20190620_223314.jpg

  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2465
Reply with quote
Post Posted: Fri Jun 21, 2019 1:32 pm
Wow, so cool! :D
BTW you're using a very old Test Suite mate ;)
  View user's profile Send private message Visit poster's website
  • Joined: 05 Nov 2014
  • Posts: 229
  • Location: Auckland - NZ
Reply with quote
Post Posted: Fri Jun 21, 2019 10:33 pm
sverx wrote
BTW you're using a very old Test Suite mate ;)


Yea.. itll be rather old, it just happened to be on my everdrive lol. The region checking bit was all i was really interested in.
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!