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 - MKIII/JP to SMS adapter

Reply to topic Goto page 1, 2  Next
Author Message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
MKIII/JP to SMS adapter
Post Posted: Mon Nov 27, 2017 10:00 am
This isnt a new idea but thought id show what ive done. Fits into a standard game cart and works fine assuming a bios mod has been done.

Im tempted to put a small rom and a few other bits on it to get around having to do a bios mod. Assuming no one has done this still?
20171127_221651.jpg (67.7 KB)
20171127_221651.jpg
20171127_221706.jpg (68.24 KB)
20171127_221706.jpg
20171127_221749.jpg (58.64 KB)
20171127_221749.jpg
20171127_221821.jpg (101.39 KB)
20171127_221821.jpg

  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8057
  • Location: Paris, France
Reply with quote
Post Posted: Mon Nov 27, 2017 10:11 am
A ready to use adapter that embed a boot rom would make the adapter a very nice tool, and people who want to get one. Possibly also consider mycard support.

Tinkerers have done that privately but never to the extend of manufacturing more than a handful adapters.
  View user's profile Send private message Visit poster's website
  • Joined: 19 Aug 2011
  • Posts: 115
  • Location: Australia
Reply with quote
Post Posted: Mon Nov 27, 2017 10:14 am
PM me if you plan on selling these, very interested in purchasing one.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Mon Nov 27, 2017 10:24 am
Bock wrote
Possibly also consider mycard support.


That was part of my plan. Was going to do a simple check on all 3 slots (card, cart and expansion) and see if something was there, much like the built in bios does. Then either boot directly if only one slot was found to contain something or display a small menu asking which slot to load from if more than one was found to be used.

Wanted to keep it simple. No unneeded boot logos/screens/menus etc. as it just makes loading the actual game that much slower.
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8057
  • Location: Paris, France
Reply with quote
Post Posted: Mon Nov 27, 2017 10:30 am
Having an option to force a menu (e.g. hold both buttons) would be useful for tinkerers (aka me, probably a minority).

I always felt that it'd be nice if more people had access to a tool such as http://www.smspower.org/Homebrew/SMSDump-SMS which would allow people to confirm the checksum of their game when they have what may be a prototype. Again, very unusual use.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Mon Nov 27, 2017 10:46 am
Could probably add that from the pause button using the NMI routine?. I also thought it would he handy having a small simple utility to test keypads with, and possibly the light gun. Pain in the ass when you have one with a suspect cord and want to check it.
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8057
  • Location: Paris, France
Reply with quote
Post Posted: Mon Nov 27, 2017 11:12 am
So maybe as a side project should consider making such all-in-one tool:

- Test game pad, test light phaser, test audio
- Embed some basic hw diagnostic: detect region, pal/secam, amount of ram
- Embed basic tooling to display contents+checksum of ROM banks (on all slots) or SRAM

Obviously we are over-reaching it here, but it'd be a nice handy tool to have. Perhaps best to focus on adapter first :)
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2359
Reply with quote
Post Posted: Mon Nov 27, 2017 1:22 pm
I can extend my SMS/MD pad test to test port B too, if you guys need it.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Dec 2005
  • Posts: 481
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Mon Nov 27, 2017 2:43 pm
Frank_fjs wrote
PM me if you plan on selling these, very interested in purchasing one.

I would also be interested in buying one of these adapters, even without any additional components.

It would make it possible for all of the existing methods of dumping Western cartridges to also support Japanese carts, plus both Japanese and Western cards (via a Card Catcher).

Similar adapters were previously discussed in this thread.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Wed Nov 29, 2017 12:21 am
RetroSpark wrote
Frank_fjs wrote
PM me if you plan on selling these, very interested in purchasing one.

I would also be interested in buying one of these adapters, even without any additional components.


There not an issue to build, just dont have more of that stupid .125 inch pitch connector. Ive just ordered 20 of a hopefully better one from digikey. They dont hold stock so they are on a 3 or 4 week lead time from the manufacturer.

Moving forward with getting around the bios issues and adding a menu to this.. should be straight forward enough to use a simple 8 bit latch tied to a particular IO address and use that to effectively "rom switch". Need to look at the IO adress space and find something that doesnt conflict with any other hardware. From there we can also toggle the adress lines on the rom ill have to put on it and use that to select between different utilities within the same rom from a menu too.
  View user's profile Send private message
  • Joined: 19 Aug 2011
  • Posts: 115
  • Location: Australia
Reply with quote
Post Posted: Wed Nov 29, 2017 12:51 am
Can get Mark III connectors here:

http://www.tototek.com/store/index.php?main_page=product_info&products_id=79
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Wed Nov 29, 2017 12:11 pm
Last edited by wasup on Wed Nov 29, 2017 12:24 pm; edited 1 time in total
Do SG-1000/SC-3000 games work properly when put into a MKIII or JP master system? Can probably ignore the games that had internal RAM as the extra pins for the memory timing may not be present so wont work anyway.

Ive just tried several SC-3000 games i had and none seem to want to work using this adapter on a master system using Bocks sms loader.

Video fipper (the PCB on the right in the image below) stops the master system booting at all. It just powers on with a blank screen. Ive traced that down to an unusual pinout where instead of using /MemReq from the master system for the rom /CE they use /A15 instead. This probably results in the CPU seeing both the bios rom data along with the game data on the data bus.

Another couple of games i have (all seem to use the PCB type on the left in the image below) seem to load to a point but then freeze. The graphics seems to start loading just before it freezes but its not displayed correctly.

Any ideas? If you download the roms for the same games and run them with an ever drive they seem to run fine.. but not sure if the rom files have been altered at all.
1.jpg (161.22 KB)
1.jpg
2.jpg (118.63 KB)
2.jpg

  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Wed Nov 29, 2017 12:23 pm
Video flipper is definitely the pin out difference that i traced out.
I pulled the rom off its board and put it in a master system game board and it boots and runs fine. Getting a bit late to do the same with the other sort of board now so will look into that tomorrow night and see what i find.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Tue Dec 05, 2017 7:40 am
Making progress.... With a little mod ive managed to get this working properly with SG-3000 games. Ones like video flipper that used a weird pin arrangement that stopped the master system booting work now too.

Here is a list of the carts i have.. all have been tested and work fine using the SMS boot loader on an unmodified master system.

SG-3000

- Video flipper
- Champion golf
- Flicky
- Mahjong
- Sega Basic Level III A and B (Doesn't actually run as it gives a 2 beep error which is due to the internal DRAM not working as the required pins are not present on the MS)
- One other board type game - not sure what its called as its all in Japanese

MKIII/Master system

- Rocky
- After burner
- Phantasy star
- Great soccer (My Card with card catcher)
- My hero (My Card with card catcher)

Does any one have an extensive library of carts and is willing to test this further if i was to send it to you?
20171205_201843.jpg (104.55 KB)
20171205_201843.jpg

  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8057
  • Location: Paris, France
Reply with quote
Post Posted: Tue Dec 05, 2017 8:20 am
Looking good :)

I have an extensive library of carts but probably won't be able to do thorough testing, I can however test specific games if needed.

So I suppose it boots on the ROM and then you have a way to disable the ROM pass-through and switch it to the cartridge?
  View user's profile Send private message Visit poster's website
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Tue Dec 05, 2017 8:36 am
The chip i hacked on there is just a latch/bus driver. All its doing is disabling A15, /MemReq and /Read on MKIII connector while the slot is disabled. Currently its controlled by /CE on the master system slot. That fixed all the issues i was having and is also part way there for adding a small boot rom of its own. Eventually it be controlled by a second latch that will be controlled by writes to a particular IO address. From there we can switch between rom segments (for a selection of utilities) and also the MKIII socket.
  View user's profile Send private message
  • Joined: 19 Aug 2011
  • Posts: 115
  • Location: Australia
Reply with quote
Post Posted: Tue Dec 05, 2017 12:11 pm
Hands up for tester. I have a nice Mark III collection and am happy to test and log results.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Thu Dec 14, 2017 10:37 am
Making a little bit of progress on this.

Sent the hacked up one to Frank_fjs to test. He ran a bunch of games through it and everything worked fine, including "the castle", which was reported in old thread as not working.

Have since done a partially complete surface mount revision, just to test the changes i had to make, before i go too much further. Got the board yesterday and should have parts for that arriving tomorrow. Assuming that all goes to plan ill get a complete revision under way early next week. Might be a few weeks before i get the next lot of parts for that one though as xmas will stuff the shipping up.

After that itll be software writing time.
20171214_231449.jpg (82.6 KB)
20171214_231449.jpg

  View user's profile Send private message
  • Joined: 19 Aug 2011
  • Posts: 115
  • Location: Australia
Reply with quote
Post Posted: Thu Dec 14, 2017 11:21 am
Great work! With bios too, nice.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Sun Dec 17, 2017 5:42 am
My parts arrived on Friday. Put that together and it worked as expected. Tested it on a game gear with a Gear Master and that seemed fine too. Will get the next revision of the board done this week and hopefully be able to get that going over the next few weeks. Im thinking it might be worth adding a jumper or switch to it so that you can enable or disable the boot rom. Without that, if it was used for dumping you would end up just dumping the boot rom rather than the game, which would be a tad annoying.
20171217_182219.jpg (70.41 KB)
20171217_182219.jpg
20171217_182337.jpg (100.38 KB)
20171217_182337.jpg

  View user's profile Send private message
  • Joined: 23 Jun 2015
  • Posts: 16
  • Location: Bolton, England, UK
Reply with quote
MKIII/JP to SMS adapter
Post Posted: Sun Dec 17, 2017 9:00 am
Great work Wasup! I imagine this will be a very sought after bit of kit once finished. If there was some way to incorporate an FM chip then there would be no need to purchase a Japanese system (Though I suppose the cost of manufacture would increase quite a bit).
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Sun Dec 17, 2017 9:07 am
The sms doesnt have sound on the cart connector.. so not really possible to add an fm chip without it having to be hard wired in
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2359
Reply with quote
Post Posted: Sun Dec 17, 2017 10:31 am
what's the size of that boot ROM?
  View user's profile Send private message Visit poster's website
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Sun Dec 17, 2017 5:54 pm
Its a 64KB rom (plcc32 package) for now. Ive got a ton of them on hand and their really cheap. The contents will be quite small tho.. will let you know once thats written. I suspect the rom image will be a bit larger than the code is, due to where the header location sits.. but theres plenty of room so it doesnt really matter.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2359
Reply with quote
Post Posted: Mon Dec 18, 2017 11:02 am
we really could place a few useful tools in there! (activating them only in certain conditions such as holding 1 & 2 together at boot or similar combination)
  View user's profile Send private message Visit poster's website
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Tue Dec 19, 2017 1:33 am
sverx wrote
we really could place a few useful tools in there! (activating them only in certain conditions such as holding 1 & 2 together at boot or similar combination)


Can always go with something bigger if needed. Ive got 6 spare output bits on the latch.. so depending on how many chunks we want to break the rom up into, and how big the chunks are, that gives us a heap of options.

For now ive left that part off the board. It all got annoying and i wanted to get it under way before we close at work for the year. I got it to a point where i could get a boot loader going and will work on that over the break.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Tue Dec 19, 2017 5:43 am
The new connectors i ordered arrived today. No more having to bend pins to make them work as they're designed to go on the end of a board/card. They're rather good, and exactly what i wanted!
20171219_183558.jpg (32.01 KB)
20171219_183558.jpg
20171219_183624.jpg (78.04 KB)
20171219_183624.jpg

  View user's profile Send private message
  • Joined: 19 Aug 2011
  • Posts: 115
  • Location: Australia
Reply with quote
Post Posted: Tue Dec 19, 2017 7:43 am
Looking tidy, keep up the great work. This is a much wanted/needed and awesome product.

To those interested, the test version that I received worked with everything I threw at it. No issues at all. My MS has an FM board installed and that worked flawlessly with the adapter as well.
  View user's profile Send private message
  • Joined: 18 Jul 2017
  • Posts: 14
Reply with quote
Post Posted: Wed Jan 03, 2018 1:43 pm
I wish I would have found this thread earlier. This looks great.

There might not be that big of a market for this feature, but I'd like to see an adapter that can set the Game Gear palette to match the TMS9981 palette when playing SG games. Maxim thinks it could be done with a bootloader

It look like Krikzz has also reintroduced a similar feature into his GG Everdrive, but I'd really like to play the cartridges I actually own.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Sun Jan 07, 2018 9:16 am
A little bit of an update on this. Still waiting for one more part to arrive. It seems to have been put on back order so i sadly never got to work on it over the xmas break. Once that is here (hoping later this week) i should know if its going to work. Assuming it does, Ill look at palette setup for SC-1000 support on the game gear as well.
20180107_220324.jpg (146.56 KB)
20180107_220324.jpg

  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Tue Jan 09, 2018 11:33 am
Another small update on this...

The part i was waiting on arrived today. Have spent the last couple of hours trying to get the stupid thing going. I made a slight oversight on how the latch responds during power up so needed to add some pull down resistors to fix that. Had a couple of tracking errors too and also had a crap solder connection on the eprom socket (don't buy/use cheap and nasty sockets!). I got the addressing for the latch all wrong so need to make a small mod there but its late now so ill leave that for another night.

Its mostly working and will load from either the eprom or the cart connector, its just not software switchable due to the addressing issue that i need to sort.

Will post updates as progress is made.
20180110_003023.jpg (240.92 KB)
20180110_003023.jpg

  View user's profile Send private message
  • Joined: 19 Aug 2011
  • Posts: 115
  • Location: Australia
Reply with quote
Post Posted: Wed Jan 10, 2018 1:09 am
Eagerly anticipating the end result.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Tue Jan 23, 2018 6:15 am
Another update..

After much frustration of things not working and not being able to see why, i got myself a cheap logic analyzer. It was $12 so i didn't have high hopes but it seemed worth a try. It had a tiny solder short between 2 of the input channels, which was difficult to work out as it just stopped the master system actually booting. I suspected the internet pull up resistors were loading the bus up too much so i changed those to a higher more sensible value when i then spotted the short. Fixed that and it seemed to work quite well.

There were some issues with my code as it didn't seem to be working correctly to start with but ive managed to sort that now. As you can see in the screen capture (below) ive got an IO write at 0ms, 5ms and 10ms. The first write was just to trigger the logic analyzer and get it to start logging. The second write is to select between the ROM and the MKIII slot and the 3rd write is to lock the latch out so that it ignores future writes. This should prevent weird things happening if other software randomly uses the same IO port address by chance. So, the software works so far, yay.

Does the hardware work?... Not so much. There are a couple of small stupid issues but it gets tricky to fix due to the surface mount components. I decided ill scrap doing it out of dedicated logic and start again using a form of programmable logic instead. Then i can just do it all in software and not have to make a new board if there are any problems. Ive got a small development board coming so ill just solder a bunch of wires in and see if i can get it going without having to completely start again.

More to follow....
screenshot.png (54.69 KB)
screenshot.png

  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Wed Jan 24, 2018 11:04 am
Spent some more time on this tonight and got it working. Still needs some more time spent on it, but its a great start.

https://youtu.be/FKKGTHflX5Y <--- Running on master system

https://youtu.be/X5J0Fn_Zq7w <--- Running on game gear

Its currently booting from ROM, setting the colour palette up for SG-1000 support on a game gear, copying itself to RAM, disabling the ROM and enabling the SG-1000/MKIII slot before booting from it.

Will get it to check the card and expansions slots too and boot from those first if something is found. Also need to add a menu for some utilities that can be added.
20180124_232526.jpg (148.58 KB)
20180124_232526.jpg

  View user's profile Send private message
  • Joined: 18 Jul 2017
  • Posts: 14
Reply with quote
Post Posted: Sat Jan 27, 2018 4:36 pm
wasup wrote
Spent some more time on this tonight and got it working. Still needs some more time spent on it, but its a great start.

https://youtu.be/FKKGTHflX5Y <--- Running on master system

https://youtu.be/X5J0Fn_Zq7w <--- Running on game gear

Its currently booting from ROM, setting the colour palette up for SG-1000 support on a game gear, copying itself to RAM, disabling the ROM and enabling the SG-1000/MKIII slot before booting from it.

Will get it to check the card and expansions slots too and boot from those first if something is found. Also need to add a menu for some utilities that can be added.


This is fantastic! If you need SG games for testing I'd be willing to help out. I've tested about 20 on my adapter, but not all of them work. Every MKIII game I've tried worked okay though.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Sat Jan 27, 2018 9:28 pm
blahblug wrote
This is fantastic! If you need SG games for testing I'd be willing to help out. I've tested about 20 on my adapter, but not all of them work. Every MKIII game I've tried worked okay though.


Do you know which games didnt work and what they were doing to not work?

I found that some games use a different pin configuration for enabling the rom which stops a master system loading, so you end up with just a black screen when you turn it on.

Im also not sure what happens with sg-1000 games that have expansion ram in them.
  View user's profile Send private message
  • Joined: 18 Jul 2017
  • Posts: 14
Reply with quote
Post Posted: Sun Jan 28, 2018 8:03 am
wasup wrote
Do you know which games didnt work and what they were doing to not work?

I found that some games use a different pin configuration for enabling the rom which stops a master system loading, so you end up with just a black screen when you turn it on.

Im also not sure what happens with sg-1000 games that have expansion ram in them.


I didn't make notes, but offhand I remember that definitely Rock 'n Bolt, Soukouban, and I think Championship Boxing just gave me a black screen. I doubt it was the game itself because multiple copies all behaved the same way.

I'll have to check if I tested anything with expansion ram.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2359
Reply with quote
Post Posted: Tue Jan 30, 2018 9:59 am
Here's the modified 'controllers' test - you can now test also the RESET key (which isn't there on the SMS2, thus I can't test it on hardware but works perfectly on emulators) and the PAUSE key - which actually works by displaying the button as pressed for approx. 1 second (we can change that to a toggle if you prefer).

It reads MegaDrive pads input on port 1 only, but it reads Master System inputs on both ports, so you can test both SMS ports even just with a single controller, and you can test MD pads (3/6 buttons) using port 1.

The attached ROM is 16KB, with no SEGA header. If a SEGA header is needed, we can recompile it - of course.
controllers.png (5.71 KB)
screenshot
controllers.png
controllers.rar (4.19 KB)
ROM

  View user's profile Send private message Visit poster's website
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Tue Jan 30, 2018 10:51 am
Excellent, thank you very much for that! I was busy working on something else tonight but ill have a look at this tomorrow and let you know how it goes.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Wed Jan 31, 2018 9:09 am
Just tested this on my SMS1. Reset button works fine. Thanks again for doing that!
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2359
Reply with quote
Post Posted: Wed Jan 31, 2018 11:59 am
No problem, I'm happy to collaborate to such a nice project :)
  View user's profile Send private message Visit poster's website
  • Joined: 29 May 2015
  • Posts: 17
Reply with quote
Post Posted: Tue Feb 06, 2018 2:09 am
I just heard about the new controller test tool in the latest RetroRGB Weekly Roundup. Great work!
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Tue Feb 06, 2018 9:25 am
Im having a bit of a problem checking slots to see if they contain anything before booting from them (Card then Cart). Im not too familiar assembler so have done a bit of a cut and paste of bits of code from Maxim's hello world example, the slot checking routine from the JP bios and also Bock's boot loader. Where i seem to be having issues is where it jumps to $0000 in the slot check loop. It runs correctly and detects a game in the card slot and loads from it but the game seems to only load its first palette then crash. If i dont use that checking routine and just jump to $0000 with the card slot enabled it loads fine, so its not hardware problems and i must be missing something.

Ive not been able to work out how (if even possible) to test this and debug in an emulator. You don't seem to have any control over the slots and have a rom for the card slot and another for the cart.

Here is the code that runs from RAM to check slots and boot from them, i will also include the whole project as an attachment.

Quote
Boot:

ld a, $03 ; Disable latch and enable SC-1000/MKIII slot on adapter -> IO PORT $CO, Bit 0 AND 1
out (PORT_SG1000), a

ld a, $EB ; Disable all system slots
out (PORT_HARDWARE), a

ld a, $CB
ld ($C000), a ; Set card slot in RAM ($CB = Card, $AB = Cart, $6B = Exp)
out (PORT_HARDWARE), a ; Enable slot
call CheckSlot

ld a, $AB
ld ($C000), a ; Set cart slot in RAM ($CB = Card, $AB = Cart, $6B = Exp)
out (PORT_HARDWARE), a ; Enable slot
; call CheckSlot <----- fails to load here as well
jp $0000 <----- but a direct jump works fine


;==============================================================
; Check slot to see if it contains anything
;==============================================================

CheckSlot:

ld hl,$0000 ; look at ROM from $0000
ld bc,$003C ; loop 256 times, mask $3c
ld a,(hl) ; get byte
and c ; and with $3c = %00111100
ld e,a ; store in e

SlotCheckLoop:

ld a,(hl) ; get byte
inc l ; pointer++
and c ; and with $3c
cp e ; compare to first byte
jp nz,$0000 ; if not equal, run slot
djnz SlotCheckLoop ; repeat 256 times
ret ; Nothing found

Boot_End:


  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12661
  • Location: London
Reply with quote
Post Posted: Tue Feb 06, 2018 9:56 am
The last check needs to do something if nothing is found, but that's not your bug. If the game boots then it should be OK, what game did you test it on? Some games may be sensitive to the system state on boot, so you may need to make sure your code is loaded to the same address as a regular BIOS ($c700).
  View user's profile Send private message Visit poster's website
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Tue Feb 06, 2018 10:22 am
Theres a bit more to be written and it will have something to follow after the last check, so thats ok.

Ive checked it with Space invaders and great soccor, both card format, same thing happens on both. It also happens with video flipper on the sg-1000 slot on my adapter if i check that slot using the same routine. I havnt tested it with anything else. Its running from ram at C700 too. Ive gone through the commented JP bios and tried to do things the same but i must be missing something.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Tue Feb 13, 2018 10:08 am
I gave up on trying to detect if something was present in the slot using software. There's something im missing and i just can't work out what. I suspect its something to do with the bios having already run and done the same thing as im trying to do. Clearing memory and setting the relevant registers to 0 didn't help.

As a work around ive used the CSCN4 pin to detect if a game is present on the MKIII slot on my adapter. If the pin isn't held high by a cart then its assumed nothing is present and loads from the card slot instead. That then still allows card slot compatibility without a menu.

Ive had trouble getting a reliable reset signal from my master system, so have had to use a fixed delay to stop the logic running before the master system CPU has started. The reset time seems to vary from console to console and also varies depending on how long since the console was last turned on. Haven't tried this on a mega drive/genesis yet so not sure what happens there, but imagine it should still work ok.

So far it operates as follows from boot.

1- Set stack pointer
2- Zeros RAM
3- Software delay to allow for the delay in the logic starting
4- Init VDP
5- Set colour palette (for game gear compatibility with SG-1000)
6- Copy boot code to RAM
7- IO write to logic to switch between ROM and SG-1000/MKIII slot
8- Set slot (Cart or Card) in RAM
9- Set slot (Cart or Card) in Port 3E
10- Boot from slot.

Next ill start working on a menu to access utilities.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Thu Feb 15, 2018 9:32 am
Ive just tried this on a mega drive with a "master mega converter" and it sadly doesn't work. I took the converter apart and it looks like the IO Request pin is not connected. Not sure if IO Request is actually present on the mega drive/genesis in master system compatibility mode so i might have to change the way my adapter works to get around this limitation.

So.. the question i have is..

Do i change the way it works so that i don't need the IO Request pin and hopefully restore compatibility for the genesis/mega drive...

Or do i just add a push button to it that puts it into a mode that makes it act as a pass through adapter without any boot loading. This might also be a useful feature anyway as it would then enable easy dumping of games using existing methods.
  View user's profile Send private message
  • Joined: 05 Nov 2014
  • Posts: 181
  • Location: Auckland - NZ
Reply with quote
Post Posted: Mon Feb 26, 2018 9:41 am
I got this working on a mega drive tonight. Not exactly sure why but the mem request pin behaves slightly different on a mega drive in compatibility mode compared to a real master system or game gear. I suspect it might be generated from other hardware and not directly out of the Z80. Anyway, took a bit of poking about and a rethink of the logic but thats sorted now.
  View user's profile Send private message
  • Joined: 19 Aug 2011
  • Posts: 115
  • Location: Australia
Reply with quote
Post Posted: Mon Feb 26, 2018 1:27 pm
Great work as always. Quietly and patiently keeping an eye on this, it's shaping up to be an awesome adapter.
  View user's profile Send private message
  • Joined: 18 Jul 2017
  • Posts: 14
Reply with quote
Post Posted: Thu Mar 01, 2018 1:58 pm
wasup wrote
Im also not sure what happens with sg-1000 games that have expansion ram in them.


I've tested The Castle on my own "dumb" adapter and it the game seemed to run as normal through the first few screens.
  View user's profile Send private message
Reply to topic Goto page 1, 2  Next



Back to the top of this page

Back to SMS Power!