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 - SG-1000/SC-3000/Mark III/JP SMS ⇒ Export SMS ⇒ Game Gear Converter

Reply to topic
Author Message
  • Joined: 18 Jul 2017
  • Posts: 12
Reply with quote
SG-1000/SC-3000/Mark III/JP SMS ⇒ Export SMS ⇒ Game Gear Converter
Post Posted: Sat Dec 30, 2017 7:54 am
I have a few Mark III, SG-1000, My Card, and SMS games, but no console to play them on other than a Game Gear.

Inspired by this blog post, I decided to try and make my own adapter.

I have a Master Gear Converter 2 which I had used to play SMS games on my GG. I bought a JP SMS-compatible edge connector online, an MSX prototyping board (has the same pin configuration as Sega consoles in Japan up to the SMS), and found an old SMS (export) cartridge without a board.

I wired it up using the wiki diagrams, and in the end I have pretty much matched the description here, as modified thus.

I needed to close jumper J1 on the two GGs I tested this with. This disables the GG BIOS.

I filed a groove in the edge connector to mate with my donor cartridge, and filed a hole in the donor cartridge, so that I could have as strong of a mechanical bond as possible.

Sion's Papa said his SG-1000 games were inverted, and if you look closely at Zaxxon (SG-1000) on the blog post here, it shows an inverted title screen. This guy uses his own convention to describe the wiring he did making his Mark III to GG converter, but it matches that used by ApolloBoy.

I can play Mark III and My Card games (via the Card Catcher) without any problems. But my SG-1000 games are also inverted. Games like Zaxxon I can basically play with the funny colors, but simpler games like Bongo Congo look terrible and I can't see the playfield clearly. Is this just how the GG necessarily runs these old games, or can I modify the adapter and fix this?

FWIW, I noticed the palette chosen for displaying SG-1000 games varies depending on whether I last booted the system in GG mode or SMS mode.

For others considering a similar project, this page and this page may also be useful.

Finally, my wiring:


Mark III   |SMS
--------------------------------------
A1      |25
A2      |26
A3      |27
A4      |28
A5      |29
A6      |30
A7      |31
A8      |32
A9      |8
A10      |9
A11      |12
A12      |10
A13      |33
A14      |7
A15      |24
A16      |23
A17      |22
A18      |18
A19      |17
A20      |16
A21      |15
A22      |14
B1      |1, 35
B2      |1, 35
B3      |NC
B4      |5
B5      |4
B6      |2
B7      |46
B8      |NC
B9      |3
B10      |13
B11      |34
B12      |NC
B13      |NC
B14      |NC
B15      |NC
B16      |NC
B17      |NC
B18      |6
B19      |11
B20      |37
B21      |19, 20, 21
B22      |19, 20, 21


Could changing B9 to 39 and B10 to 3 make a difference? I'm not so interested in JP SMS games, and this looks like the only bit of wiring that really differs between SG-1000 and the JP SMS.
Converter (1).JPG (361.17 KB)
Converter Outside
Converter (1).JPG
Converter (2).JPG (348.07 KB)
Converter Inside
Converter (2).JPG

  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Sat Dec 30, 2017 8:07 am
The GG doesn't have the palette set up for SG games, previously people have mentioned getting all black but that might depend on the hardware and whether the BIOS is enabled. In theory you can make a bit of software to initialise it to the right colours but I'm not sure how that would survive a power cycle.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 7888
  • Location: Paris, France
Reply with quote
Post Posted: Sat Dec 30, 2017 10:35 am
Copying the data from https://pastebin.com/BDwLurrR for future reference (in case it gets deleted)

markIII to export SMS pinout


Jp  /  Export  | code Jp / Export
B1  /  1,35    | +5V
B2  /
B3
B4  /  5       | M8-B
B5  /  4       | Rd
B6  /  2       | Wr
B7
B8
B9  / 39       | Refresh
B10 / 13       | Mreq / CE
B11 / 34       | CONT
B12
B13
B14
B15
B16
B17
B18 /  6       | A14
B19 / 36,11    | A15 / A15,M0-7
B20 / 37       | M1
B21 / 19,20,21 | Gnd
B22 / 19,20,21 | Gnd

A1  / 25       | A0
A2  / 26       | A1
A3  / 27       | A2
A4  / 28       | A3
A5  / 29       | A4
A6  / 30       | A5
A7  / 31       | A6
A8  / 32       | A7
A9  /  8       | A8
A10 /  9       | A9
A11 / 12       | A10
A12 / 10       | A11
A13 / 33       | A12
A14 /  7       | A13
A15 / 24       | D0
A16 / 23       | D1
A17 / 22       | D2
A18 / 18       | D3
A19 / 17       | D4
A20 / 16       | D5
A21 / 15       | D6
A22 / 14       | D7
  View user's profile Send private message Visit poster's website
  • Joined: 18 Jul 2017
  • Posts: 12
Reply with quote
Post Posted: Sun Dec 31, 2017 6:01 am
Maxim wrote
The GG doesn't have the palette set up for SG games, previously people have mentioned getting all black but that might depend on the hardware and whether the BIOS is enabled. In theory you can make a bit of software to initialise it to the right colours but I'm not sure how that would survive a power cycle.


I was hoping it would display like on a regular Master System, but if this is how the GG necessarily displays SG titles then I suppose there is little that can be done.

I too got all black at first, but not for all games. That suggested that the BIOS was the issue, and disabling that did allow the games to run (albeit with odd colors).
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Sun Dec 31, 2017 8:31 am
If you can go Everdrive then you may be able to work around it, but it's rather more complicated (custom BIOS/bootloader in the adaptor) otherwise.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Nov 2014
  • Posts: 166
  • Location: Auckland - NZ
Reply with quote
Post Posted: Sun Dec 31, 2017 9:14 am
Im working on a similar adapter.

http://www.smspower.org/forums/16879-MKIIIJPToSMSAdapter

Do the colour issues mentioned here only relate to a game gear? Might be able to incorperate a software fix for that with a bit of help.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Sun Dec 31, 2017 11:52 am
Yes, it needs you to set the system palette to match the standard TMS9981 palette which you could do via a bootloader. Master System has a (bad) fixed palette, and Mega Drive doesn't support those video modes at all.
  View user's profile Send private message Visit poster's website
  • Joined: 18 Jul 2017
  • Posts: 12
Reply with quote
Post Posted: Wed Jan 03, 2018 1:32 pm
wasup wrote
Im working on a similar adapter.

http://www.smspower.org/forums/16879-MKIIIJPToSMSAdapter

Do the colour issues mentioned here only relate to a game gear? Might be able to incorperate a software fix for that with a bit of help.


That is a really nice looking adapter. Writing bootloader to fix the palette is beyond what I've done in the past, but I would love that feature.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Wed Jan 03, 2018 2:34 pm
it's just a few lines with devkitSMS - where can I get the correct RGB values?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Wed Jan 03, 2018 8:00 pm
http://www.smspower.org/maxim/forumstuff/colours.html
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Thu Jan 04, 2018 12:20 pm
Last edited by sverx on Fri Mar 09, 2018 9:23 am; edited 1 time in total
Thank you Maxim!

#define TARGET_GG
#include "..\SMSlib\SMSlib.h"

unsigned int const TMScolors[16]={
RGBHTML(0x000000),RGBHTML(0x000000),RGBHTML(0x47b73b),RGBHTML(0x7CCF6F),
RGBHTML(0x5D4EFF),RGBHTML(0x8072FF),RGBHTML(0xB66247),RGBHTML(0x5DC8ED),
RGBHTML(0xD76B48),RGBHTML(0xFB8F6C),RGBHTML(0xC3CD41),RGBHTML(0xD3DA76),
RGBHTML(0x3E9F2F),RGBHTML(0xB664C7),RGBHTML(0xcccccc),RGBHTML(0xffffff)};

void main(void) {
  GG_loadBGPalette (TMScolors);
  GG_loadSpritePalette (TMScolors);
}


edit: (old attachment removed)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Thu Jan 04, 2018 2:22 pm
The tricky part is making the bootloader hardware, whereby somehow the code runs and then replaces itself with the SG game. Typically you need to execute the code from RAM to achieve that, and then have some software signal to the hardware to swap the ROM.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Thu Jan 04, 2018 3:01 pm
well, you can run most of the code from ROM, then just execute from RAM the (small) part you need to un-map the boot ROM and map the game ROM, as in my (w.i.p.?) dbLauncher (highlighted code is the code that gets copied and to RAM and executed from there)
  View user's profile Send private message Visit poster's website
  • Joined: 05 Nov 2014
  • Posts: 166
  • Location: Auckland - NZ
Reply with quote
Post Posted: Wed Jan 24, 2018 11:25 am
Maxim wrote
http://www.smspower.org/maxim/forumstuff/colours.html


I found a small error on this table..

It has TMS $0a = SMS $04, but should be SMS = $05.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Thu Mar 08, 2018 7:34 pm
The table is repeated here: http://www.smspower.org/Development/Palette and I've fixed it there. Please ignore my old html file...

Edit: I thought the colours were a bit too similar so I sanity-checked it against a source similar to the one I used originally (probably about 18 years ago, gulp) which derives them from the datasheet voltages. The wiki page is updated, sverx will need to update his ROM... here's the hex codes:

Quote
000000
000000
21C842
5EDC78
5455ED
7D76FC
D4524D
42EBF5
FC5554
FF7978
D4C154
E6CE80
21B03B
C95BBA
CCCCCC
FFFFFF
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Fri Mar 09, 2018 9:22 am
ROM updated
TMScolors.rar (7.29 KB)
TMScolors (ROM and source)

  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Used these pin equivalence lists, handmade adapter works!
Post Posted: Tue May 01, 2018 8:04 pm
Last edited by bsittler on Mon May 14, 2018 12:02 am; edited 2 times in total
Thank you for sharing your information on pin equivalence between SG-1000/Mark III/etc. and the "export" SMS! Using this information, a 3D printed furrtek-designed cartridge shell, a repurposed MSX protoboard, and an edge connector from Tototek, I was able to solder together a prototype cartridge adapter and use it to load older SG-1000 and Mark III cartridges and (with the aid of a Card Catcher) My Cards on a modified Game Gear via Gear Master (SG-1000 titles have wrong colors), on a modified Nomad via PowerBase Mini (Mark III titles only), and mednafen on Mac via Retrode2 + PlugIn Master (everything works great, but it's a software emulator so maybe not as exciting as seeing Woody Pop with HPD-200 running on a modified Nomad was.)

Still very much hoping someone is able to produce a version of this (especially if it can initialize Game Gear palette for SG-1000 using a mini-BIOS) for sale - I would happily buy one and toss or tear apart my messy prototype for parts :)

More details and some pictures of the adapter towers over in the related thread: Development - MKIII/JP to SMS adapter
  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
SG-1000 Zaxxon "working" with a palette hack
Post Posted: Sun May 13, 2018 11:17 am
sverx wrote
ROM updated


Thank you!

That's also a very useful starting point for patching SG-1000 games so that they worked when flashed onto Game Gear cartridges. However it doesn't do the lower-color-depth palette setup needed to run those same games on a Gear Master or any other cartridge or adapter that is wired for Master System mode.

I've been hacking on Zaxxon and so far this seems to be working well in both Game Gear mode and Master System mode with a single ROM (just change the cartridge wiring to switch modes.)

Palette setup function - this checks for in($00) == $C0 to figure out whether to set up the palette for Game Gear mode or for Master Gear Converter mode. Apologies for the ugly and duplicated code, this was written in a hex editor but really needs to move to ASM.


00007f60: db00 fec0 2870 182a 1100 c00e bff3 ed59  ....(p.*.......Y                                                                 
00007f70: ed51 fb06 100e beed a320 fcc9 1110 c00e  .Q....... ......                                                                 
00007f80: bff3 ed59 ed51 fb06 100e beed a320 fcc9  ...Y.Q....... ..                                                                 
00007f90: 219c 7fcd 687f 219c 7fc3 7c7f 0000 181d  !...h.!...|.....                                                                 
00007fa0: 353a 023d 172b 1a1f 0427 2a3f 1100 c00e  5:.=.+...'*?....                                                                 
00007fb0: bff3 ed59 ed51 fb06 200e beed a320 fcc9  ...Y.Q.. .... ..                                                                 
00007fc0: 1120 c00e bff3 ed59 ed51 fb06 200e beed  . .....Y.Q.. ...                                                                 
00007fd0: a320 fcc9 21e0 7fcd ac7f 21e0 7fc3 c07f  . ..!.....!.....                                                                 
00007fe0: 0000 0000 c204 d507 550e 770f 5d04 e40f  ........U.w.]...                                                                 
00007ff0: 5f05 7f07 cd05 ce08 b203 5c0b cc0c ff0f  _.........\.....                                                                 


The Game Gear native mode palette is from your code, but I couldn't find a Master System mode palette I'm completely happy with. At the moment I'm using this one:

00 00 18 1d 35 3a 02 3d 17 2b 1a 1f 04 27 2a 3f

To wire this palette into Zaxxon, I changed the relative jump displacement at 00000007 from $61 to $1A, overwrote five $00 bytes (I hope they weren't important!) at 00000023 with a call to the palette setup routine followed by a rest-of-the-way relative jump: cd 607f 1841

The only other change was to overwrite the very end of the ROM with the palette setup routine above. I'm sure someone who actually knows Z-80 asm could shorten it significantly, especially since it has two copies of everything, one for each mode, and it could also easily be converted to a single straight-line function to save some bytes.

edit: updated patch to add a ROM header with "export SMS" region and a valid checksum too. Consequently the code was relocated 16 bytes earlier than the version hex-dumped above. The SG-1000 Zaxxon dump I took and applied this patch to had length 32768 bytes and MD5 52bbf5336c190610a0fb1ab0bdaca455

edit 2: In case you're interested in fine-tuning the SMS palette, there's a jsfiddle I've been using to explore possible mappings: https://jsfiddle.net/xjz7dyen/3/

edit 3: The same patch seems to work for Doki Doki Penguin Land, an SG-1000 My Card. I have a separate patch for it here only because the added ROM headers differ. The SG-1000 Penguin Land dump I took and applied this patch to had length 32768 bytes and MD5 79f15598828e697e75c65130262d8d94

edit 4: A very similar patch seems to work for Bomb Jack, another SG-1000 My Card. The SG-1000 Bomb Jack dump I took and applied this patch to had length 32768 bytes and MD5 0bf5b6959fc1b58d8e37f9647f47a0b3
Screen Shot 2018-05-13 at 04.04.17.png (24.8 KB)
Palette comparison (top=GG, bottom=SMS)
Screen Shot 2018-05-13 at 04.04.17.png
Screen Shot 2018-05-13 at 16.30.42.png (99.89 KB)
Some of the other possible SMS palettes
Screen Shot 2018-05-13 at 16.30.42.png
Zaxxon (SG-1000) SG2GG.ips (205 B)
Patch to fix Zaxxon SG-1000 cartridge colors on Game Gear and add an export SMS ROM header
Penguin Land (SG-1000) SG2GG.ips (205 B)
Patch to fix Doki Doki Penguin Land SG-1000 My Card colors on Game Gear and add an export SMS ROM header
Bomb Jack (SG-1000) SG2GG.ips (212 B)
Patch to fix Bomb Jack SG-1000 My Card colors on Game Gear and add an export SMS ROM header

  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Mon May 14, 2018 8:09 am
different palette might work better/worse than other depending on the game they're applied to, so actually we might choose some 4 additional palette and bind them to one of the direction keys - what I mean is to make a 'bios' ROM that loads an alternate palette if you hold a direction on the pad when booting the console...

anyway I wouldn't use that palette where gray and white maps to the same color - my opinion, of course.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Mon May 14, 2018 8:32 pm
Agreed! The ones with duplicate colors are automatically constructed and I wouldn't recommend them. At the moment I'm actually playing with a YPbPr-to-RGB formula from an MSX1 discussion (same VDP) and it's yielding promising results. I'll see whether I can get your direction-pad palette selection idea working with some manually tuned palette options
  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Mon May 14, 2018 11:57 pm
sverx wrote
different palette might work better/worse than other depending on the game they're applied to, so actually we might choose some 4 additional palette and bind them to one of the direction keys - what I mean is to make a 'bios' ROM that loads an alternate palette if you hold a direction on the pad when booting the console...

anyway I wouldn't use that palette where gray and white maps to the same color - my opinion, of course.


New candidates, care to pick some favorites for up, down, left, right and default? All can be used in GG mode, only those with no __ entires can be used in SMS mode.


00,00,__,__,__,__,__,__,__,__,__,__,__,__,__,3f TMS 95% GG
00,00,__,__,__,__,__,__,__,__,__,__,__,__,__,3f f18a GG
00,00,__,__,__,__,__,__,17,__,__,__,__,__,__,3f MESS GG
00,00,__,__,__,__,__,__,__,__,__,__,__,__,__,3f TMS 47% GG
00,00,__,__,__,__,__,__,__,__,__,__,__,__,__,3f TMS 50% GG
00,00,__,__,__,__,__,__,__,__,__,__,__,__,__,3f TMS 50%/75% GG
00,00,__,__,__,__,__,__,__,__,__,__,__,__,__,3f TMS 54% GG
00,00,__,__,__,__,__,__,__,__,__,__,__,__,__,3f RGB GG
00,00,08,0c,10,30,01,3c,02,03,05,0f,04,33,15,3f SMS GG
00,00,08,18,30,35,02,3c,03,17,0a,1b,0c,32,2a,3f mod1
00,00,0c,__,__,__,__,3c,__,__,__,__,__,__,__,3f TMS 100% GG
00,00,0c,1c,34,35,03,3c,07,17,0a,1f,08,37,2a,3f tms100+
00,00,0c,1c,34,35,06,3c,07,17,0a,1f,08,37,2a,3f tms95+
00,00,0c,1d,35,3a,06,3d,07,1b,0a,1f,08,26,2a,3f tms5075+
00,00,0c,2d,35,3a,07,3d,17,2b,0f,2f,08,37,2a,3f f18a+
00,00,18,1d,25,35,16,3d,17,1b,1a,1f,08,26,2e,3f TMS 47% SMS_5
00,00,18,1d,30,35,16,3d,17,2b,1f,1b,08,27,2a,3f mod2
00,00,18,1d,35,3a,02,3d,17,2b,1a,1f,04,27,2a,3f mod3
00,00,18,1d,35,3a,16,3d,17,2b,1a,1f,08,26,2a,3f f18a~
00,00,18,1d,35,3a,16,3d,17,2b,1f,2f,08,26,2a,3f sg~
00,00,18,1d,35,3a,16,3d,17,2b,1f,2f,08,27,2a,3f sg+
00,00,19,1d,25,35,16,3d,17,2b,1a,2f,08,26,2a,3f tms47~
00,00,19,39,35,3a,16,3d,17,2b,1a,2f,08,26,2a,3f rgb~
00,00,19,39,35,3a,16,3d,17,2b,1f,2f,08,26,2a,3f rgb+
00,00,1c,2d,35,3a,16,3d,17,2b,1f,2f,08,26,2a,3f tms50+
00,00,1c,2d,35,3a,16,3d,17,2b,1f,2f,08,27,2a,3f mess+


More possibilities -- including many that were automatically generated, so some include colliding palette entries -- here: https://jsfiddle.net/xjz7dyen/22/
Screen Shot 2018-05-14 at 20.26.46.png (106.24 KB)
SMS mode palette candidates
Screen Shot 2018-05-14 at 20.26.46.png

  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Tue May 15, 2018 7:54 am
I'm afraid I'm not very good at this - you could create a PNG with each of the palette beside the original TMS and create a discussion thread where fellow forum users can comment, and then picking the most appreciated :)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Tue May 15, 2018 7:58 am
Isn't part of the problem that the TV gamma, and GG screen general awfulness, make it hard to compare? You could try to match the colours to a real system but comparing on a computer screen can't be the same.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 7888
  • Location: Paris, France
Reply with quote
Post Posted: Tue May 15, 2018 8:25 am
I don't have much to say now, only that I am really glad this is happening and being researched.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Tue May 15, 2018 9:43 am
Last edited by bsittler on Mon Jul 16, 2018 7:28 am; edited 3 times in total
sverx wrote
I'm afraid I'm not very good at this - you could create a PNG with each of the palette beside the original TMS and create a discussion thread where fellow forum users can comment, and then picking the most appreciated :)


That's an excellent idea! However I'm lazy, and instead I'm inclined to first just try a couple that seem reasonable to me and see whether people are happy with them :) - also, it's trivial to change the palette in a hex editor until it looks right for the game you're using. I would not be surprised to learn that different games were designed for different SG-1000 mode palettes, e.g. due to SMS vs. SG-1000 or due to different television standards

Maxim wrote
Isn't part of the problem that the TV gamma, and GG screen general awfulness, make it hard to compare? You could try to match the colours to a real system but comparing on a computer screen can't be the same.


Yes! I actually don't even have an unmodified original Game Gear (one of mine has a modern backlight behind the original screen, the other one has McWill's awesomeness), nor do I have a Majesco Game Gear of any sort. I also don't have a Master System or SG-1000 to compare to.

For now I've arbitrarily chosen exactly two palettes: "SMS" (for both GG mode and SMS mode) which exactly matches the Master System in SG-1000 mode's palette entries (and many emulators), and "TMS 50% GG" (for GG mode)/"tms50+" (for SMS mode) which is intended to match the original SG-1000 VDP output but I can't actually test that. I also don't have any sort of color-correcting reference for proper photographic measurement, nor do I have a video capture card (which would only help on the McWill Game Gear anyhow)

Bock wrote
I don't have much to say now, only that I am really glad this is happening and being researched.


Thanks! That means a lot especially coming from you whose much more impressive work has benefitted me so many times

The attached patches default to the "TMS 50%" palette, but they inject a less-than-a-second pause at start-up, and if you happen to be pressing up on the direction pad at the end of that pause they will instead use the "SMS" palette

edit: Attached some screenshots so you can see the palette differences in GG mode. SMS mode is similar but with worse color fidelity; I'm not sure I have an easy way to actually capture a screenshot of it, but it does look good on the modified Game Gears I have

Note that while GG mode has better color fidelity, SMS mode is preferred to actually play the games since I have not made any in-game changes (panning, level reduction, etc.) and so you may find the action occurring outside the visible window in GG mode. Zaxxon actually manages to be fairly playable despite this, Bomb Jack and Penguin Land not so much... (and if anyone has ideas for e.g. how to automatically pan to keep the player sprite onscreen in GG mode, that would be awesome!)
Screen Shot 2018-05-15 at 02.54.11.png (26.57 KB)
Bomb Jack in mednafen running in GG mode (SMS palette on the left, TMS 50% on the right)
Screen Shot 2018-05-15 at 02.54.11.png
Screen Shot 2018-05-15 at 02.55.37.png (19.75 KB)
Penguin Land in mednafen running in GG mode (SMS palette on the left, TMS 50% on the right)
Screen Shot 2018-05-15 at 02.55.37.png
Zaxxon (SG-1000) SG2GG.png (20.31 KB)
Zaxxon in mednafen running in GG mode (SMS palette on the right, TMS 50% on the left)
Zaxxon (SG-1000) SG2GG.png
Zaxxon (SG-1000) SG2GG.ips (537 B)
Up at start-up to use the SMS palette, down for CV palette
Bomb Jack (SG-1000) SG2GG.ips (537 B)
Up at start-up to use the SMS palette, down for CV palette
Penguin Land (SG-1000) SG2GG.ips (537 B)
Up at start-up to use the SMS palette, down for CV palette

  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Tue May 15, 2018 9:56 am
bsittler wrote
instead I'm inclined to first just try a couple that seem reasonable to me and see whether people are happy with them :)


whatever floats your boat is surely fine for me :)
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Tue May 15, 2018 11:49 am
bsittler wrote
if anyone has ideas for e.g. how to automatically pan to keep the player sprite onscreen in GG mode, that would be awesome!


I think it's impossibile. Beside that, I'm curious about why you're not seeing the whole screen - shouldn't the GG go in "SMS mode" (fullscreen)?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Tue May 15, 2018 1:01 pm
You can set it to GG mode in hardware and you get a "zoomed" view. I'm not sure if the scroll registers work in this scenario - it's likely they do - and so you could inject a routine to set them based on some game state regarding the player sprite location. But I suspect games will not be very playable like this.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Tue May 15, 2018 1:47 pm
Last edited by sverx on Tue May 29, 2018 11:19 am; edited 1 time in total
sure the scrolling works, the matter is that how can 'automatically' follow the player sprite?
The best you can do is possibly to reprogram some games so that when you copy the SAT (and making sure you do know which sprite is your player!) you also update the scroll registers accordingly... (also, don't forget they're write only...)
  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Tue May 15, 2018 3:12 pm
sverx wrote
bsittler wrote
if anyone has ideas for e.g. how to automatically pan to keep the player sprite onscreen in GG mode, that would be awesome!


I think it's impossibile. Beside that, I'm curious about why you're not seeing the whole screen - shouldn't the GG go in "SMS mode" (fullscreen)?


The patches make the same game ROM work in both windowed (GG) and fullscreen (SMS) modes. This is possible because GG mode leaves a special fingerprint in some of the port-mapped registers. I did this because (a) games are sometimes playable windowed with centered viewport already (e.g. Zaxxon), (b) sometimes the only wiring available is for windowed mode, (c) on the original GG screen many pixels blur together with strange artifacts in SMS mode, and (d) because I'm optimistic that with scrolling hacks additional titles might work this way too.

Expanding on (b), some cartridges are only wired for one of those modes but not the other: for example, anything plugged through an unmodified Beeshu Gear Master is SMS only, and some GG flash cartridges hardwire GG mode, as do most regular GG game cartridges -- so using one of these as a donor PCB without modified traces will force GG mode. The only GG PCB hardwired to SMS mode I have (one of the Mickey Mouse series) is too nice a game for me to consider taking it apart and using as a PCB donor. Others, e.g. GG EverDrive, support both modes using special hardware inside the (GG) cartridge, and choose which to use based on file extension. AFAIK the mode is not changeable at runtime by regular GG or SMS software means, though, as it involves changed electrical connectivity between a couple of the GG cartridge pins that don't have equivalents on the SMS or SG-1000/.../MkIII pinout.

Maxim wrote
You can set it to GG mode in hardware and you get a "zoomed" view. I'm not sure if the scroll registers work in this scenario - it's likely they do - and so you could inject a routine to set them based on some game state regarding the player sprite location. But I suspect games will not be very playable like this.


I hope to find out soon whether this is actually possible. Another possibility might be manual adjustment using an vertical sync interrupt handler patched to intercept e.g. START+optional direction and use that to choose which part to center - START alone to re-center, the others for window positions flush with the appropriate edge(s) of the SMS screen.

sverx wrote
sure the scrolling works, the matter is that how can 'automatically' follow the player sprite?
The best you can do, eventually, is to reprogram some games so that when you copy the SAT (and making sure you do know which sprite is your player!) you also update the scroll registers accordingly... (also, don't forget they're write only...)


Right, I was assuming this would need to be a semi-sophisticated patch likely based on trial and error and/or disassembly of the specific game. My hope is that some of these games are old and simple enough to actually use a single sprite index exclusively for the player or other "focus" point, possibly making identification of the code to patch a bit simpler. Some emulators actually have an option like this already, e.g. smsadvance which is dealing with a screen without enough pixels in the vertical dimension. Needed VDP state being write-only complicates things significantly

edit: I tested some more using my closer-to-original Game Gear (the one with modern backlight but original LCD, no McWill screen) and I think that in SMS mode some games are a lot more playable using the higher-contrast "SMS" version of the SG-1000 palette rather than the "tms50+" palette, even though the colors of the "tms50+" one seem to be much closer to what the SG-1000 software I'm working with look "correct" with -- e.g. Bomb Jack and Zaxxon colors look closer to arcade RGB, and to emulator output for emulators actually claiming to emulate SG-1000 as opposed to SMS. Unfortunately the GG SMS display mode drops a lot of pixels so e.g. it's very hard to spot the "splash" when a Zaxxon test shot hits an approaching wall. For now I just start the game holding the up direction on the pad when using the non-McWill GG and booting the game in SMS mode, which makes things uglier but reduces the number of accidental wall collisions.
  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
One more patch (Othello Multivision Q*Bert)
Post Posted: Wed Jun 06, 2018 7:19 am
Last edited by bsittler on Mon Jul 16, 2018 7:26 am; edited 3 times in total
A very similar patch worked on a Retrode dump of the Othello Multivision Q*Bert cartridge; the original dump was 8096 bytes and had the MD5 a768a8ae921126300e98f9d918a4a0c9 but the patch converts it to 32768 bytes to make room for the palette patcher (and a whole lot of zeros in between which the IPS format compresses very efficiently)

For this game the default palette (more like SG-1000 than like the SMS approximation) seems to work better on all systems than the SMS one. Q*Bert actually ends up being fairly usable even in "windowed" mode on the Game Gear
QBert (J) (MV) (SG2GG).png (18.39 KB)
Q*Bert in mednafen in Game Gear windowed mode showing both palettes
QBert (J) (MV) (SG2GG).png
Q-bert (Japan) (Othello Multivision) SG2GG.ips (545 B)
Press up during start-up for SMS palette, down for CV palette

  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Wed Jun 06, 2018 8:01 pm
You can extend to 16KB, or put the header at 8KB-16, it's a never used feature of the BIOS. But I guess nobody cares about 32KB nowadays :)
  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Mon Jun 11, 2018 8:13 pm
Last edited by bsittler on Mon Jul 16, 2018 7:25 am; edited 5 times in total
Maxim wrote
You can extend to 16KB, or put the header at 8KB-16, it's a never used feature of the BIOS. But I guess nobody cares about 32KB nowadays :)


Yeah, that is my hope - ROM/flash should be cheap enough in this era. I was concerned when I read that no known game uses the SMS header with that size and was concerned that it could trigger bugs so I inflated to a known-good size.

In fact I just got SG-1000 Chack'n Pop (both unmodified MD5 286ba24b335a1600dfc611a0a9fe7875 as trimmed from a Retrode2 dump, and with the English translation patch applied previously MD5 fb5c6e4d23b192cf36d87192289444e2) working by inflating further (to 48k) but for this one I left the header at 7ff0 and the header lies and claims 32k to avoid bugs

edit: I also got my dumps of SG-100 Wonder Boy (MD5 76f29fee0cd3af921e488a276dace636 - I'll warn that it's certainly no comparison to Revenge of Drancon, quality-wise!) and Championship LodeRunner (MD5 f49d9ea611ccb9289994774406f20d06) working, though the latter one unfortunately seems to actually use the BIOS header area so it will likely only work correctly in a no-BIOS early JP-model Game Gear. These patches likewise inflate to 48k

edit 2: turns out Chack'n Pop uses the BIOS header area too, as part of the released heart sprite. Zero out 0x7ff0 ... 0x7fff to fix the glitch (I'll upload fresh IPS files once I have a chance to generate them)

edit 3: Chack'n Pop is fixed (no more BIOS header, freed heart sprite no longer accompanied by graphical errors)

edit 4: Sega-Galaga is added (48K inflation); my Retrode2 dump is likely incorrect (truncated to 40960 bytes, MD5 17a97b16c3c7551c1d0bc98271d65dd1) but seems to work fine; this is another no-BIOS-header dump, so you will need to defang, remove, or otherwise bypass your BIOS (e.g. using a flashcart with BIOS-defeating ROM prior to the "real" ROM) to use this dump. Sega-Galaga does a really odd thing at start-up where SP is initially pointed at ROM(!) and then repointed at RAM, and my patch works by relocating the second SP setup inside the inflated area

edit 5: Removed separate patch for English translation of Chack'n Pop as it is byte-for-byte identical with the patch for the untranslated version

edit 6: Finally got a Retrode2 redump of Sega-Galaga (truncated to 40960 bytes with MD5 7f7e1d564448fdce96d239ad9ebf37d6) which seems to match what others have reported; the same patch works; only differences were some strange infrequent bit-errors scattered throughout the earlier dump

edit 7: Othello Multivision Guzzler (Retrode2 dump trimmed to 8192 bytes with MD5 f3f1042745e96e29bfdf920d031b8cd5) works too

edit 8: Space Invaders (16384 bytes inflated to 32768 bytes, MD5 87a97b049ec01b1803b93f06d0407586) and Star Force (32768 bytes inflated to 49152 bytes, MD5 2cbd1f9f4927f9618390340f56f116a6) are working now too, both with BIOS headers

edit 9: Three more 32K dumps patched & working with BIOS headers: Lode Runner (MD5 4b4f02eb3cf7d5f9dcd1311d72e6d742), Monaco GP v1.1 (MD5 74121fd6f1024ee3d3f5d1db29956d7d), and Sindbad Mystery (MD5 7b0f2be3588337df59959ababbefe505)
Chack'n Pop (SG-1000) SG2GG.png (20.79 KB)
Chack'n Pop in mednafen in Game Gear windowed mode showing both palettes
Chack'n Pop (SG-1000) SG2GG.png
Chack'n Pop trans [v1.02] SG2GG.png (21.88 KB)
Chack'n Pop English translation in mednafen in Game Gear windowed mode showing both palettes
Chack'n Pop trans [v1.02] SG2GG.png
Wonder Boy (SG-1000) [!] SG2GG.png (19.68 KB)
Wonder Boy in mednafen in Game Gear windowed mode showing both palettes
Wonder Boy (SG-1000) [!] SG2GG.png
Championship Loderunner (SG-1000) SG2GG.png (19.05 KB)
Champtionship LodeRunner in mednafen in Game Gear windowed mode showing both palettes
Championship Loderunner (SG-1000) SG2GG.png
SegaGalaga-SG2GG.png (15.64 KB)
Sega-Galaga in mednafen in Game Gear windowed mode showing both palettes
SegaGalaga-SG2GG.png
Guzzler (Japan) (Othello Multivision) SG2GG.png (23.03 KB)
Guzzler in mednafen in Game Gear windowed mode showing both palettes
Guzzler (Japan) (Othello Multivision) SG2GG.png
SpaceInvaders-SG2GG.png (16.65 KB)
Space Invaders in mednafen in Game Gear windowed mode showing both palettes
SpaceInvaders-SG2GG.png
StarForce-SG2GG.png (21.54 KB)
Star Force in mednafen in Game Gear windowed mode showing both palettes
StarForce-SG2GG.png
Lode Runner (JEK) (SG-1000) SG2GG.png (13.91 KB)
Lode Runner in mednafen in Game Gear windowed mode showing both palettes
Lode Runner (JEK) (SG-1000) SG2GG.png
Monaco GP (Japan) (SG-1000) (V1.1) (32K) SG2GG.png (14.93 KB)
Monaco GP v1.1 in mednafen in Game Gear windowed mode showing both palettes
Monaco GP (Japan) (SG-1000) (V1.1) (32K) SG2GG.png
Wonder Boy (SG-1000) [!] SG2GG.ips (558 B)
Press "up" during start-up for SMS palette, "down" for CV, otherwise SG-approximated
Championship Loderunner (SG-1000) SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV, otherwise SG-approximated
Chack'n Pop (SG-1000) SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV, otherwise SG-approximated
Sega Galaga (J) (SG-1000) (40K) SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV, otherwise SG-approximated
Guzzler (Japan) (Othello Multivision) SG2GG.ips (545 B)
Press "up" during start-up for SMS palette, "down" for CV, otherwise SG-approximated
Space Invaders (SG-1000) SG2GG.ips (545 B)
Press "up" during start-up for SMS palette, "down" for CV, otherwise SG-approximated
Star Force (SG-1000) [!] SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV, otherwise SG-approximated
Loderunner (SG-1000) [!] SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV, otherwise SG-approximated
Monaco GP (J) (SG-1000) (V1.1) (32K) SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV, otherwise SG-approximated
Sindbad Mystery (SG-1000) SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV, otherwise SG-approximated

  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Mon Jun 18, 2018 12:51 am
Ancient news at this point, but Twitter user @masuo0258 apparently built some sort of adapter allowing Japanese Mark III cartridges to run on a Game Gear, skipping the middle "export SMS" step:

https://twitter.com/masuo0258/status/962345986096955393

I haven't traced the wiring in those pictures yet, but it's possible that it might be useful to collate with the lists here.

The finished result looks pretty good too, IMHO:

https://twitter.com/masuo0258/status/717749976802045953

Apologies if this was linked elsewhere here - I looked but didn't find it
  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Fri Jun 29, 2018 12:48 am
Last edited by bsittler on Sat Jul 21, 2018 6:24 am; edited 8 times in total
I wrote a couple more SG-1000 to Game Gear patches - one for C_So! (maybe no room for BIOS header, inflates from 32K Retrode2 dump with MD5 d87daad7de33105d703b613052ccc2dd to 48K to accommodate palette fix) and another for Pop Flamer (BIOS header added, inflates from 16K Retrode2 dump with MD5 7f841aa0c225662e26ca7a8df20b2eb8 to 32K to accommodate palette fix) - however I have reached my 25 MB upload quota.

@Bock - is there a better way or alternate part of the site where I could or should share these? Alternatively, is it reasonable & possible to request more quota? Or are these older Sega 8-Bit to newer Sega 8-Bit ports off-topic enough for SMS Power! that I should not post them in the first place?

edit: Maxim granted me more upload quota (thank you!) - the files are attached now and uuencode+instructions are removed

edit 2: Added no-BIOS-header palette fixer with 40K-to-48K expansion for SG-1000 Sega Flipper (MD5 49c7c14879a437e60730b62a7550cdf6)

edit 3: Added no-BIOS-header palette fixer with 40K-to-48K expansion for SG-1000 Pacar (MD5 c672bc2409443cc5bca35abd041d11e0); also reattached screenshot and patch (including BIOS header) for 32K Sindbad Mystery (MD5 7b0f2be3588337df59959ababbefe505) as the previous post reached its attachment limit

edit 4: Added BIOS-appeasing palette fixer for 16K-to-32K expansion for SG-1000 Hustle Chumy (MD5 8be690d357a99abd26ebb5378e9c0153)

edit 5: Added BIOS-appeasing palette fixed for my 32K-truncated SG-1000 Rock N' Bolt dump with MD5 108ffe4ba5c2c8c5e0459cb7f0cfac0e, and a no-BIOS 32K-to-48K expansion for my dump of SG-1000 The Castle with MD5 d047c10d6b27cf34ccb66340a089523a
C-So! (SG-1000) SG2GG.png (20.53 KB)
C_So! in mednafen in Game Gear windowed mode showing both palettes
C-So! (SG-1000) SG2GG.png
Pop Flamer (SG-1000) SG2GG.png (19.23 KB)
Pop Flamer in mednafen in Game Gear windowed mode showing both palettes
Pop Flamer (SG-1000) SG2GG.png
Sega Flipper (SG-1000) (40K) SG2GG.png (17.53 KB)
Sega Flipper in mednafen in Game Gear windowed mode showing both palettes
Sega Flipper (SG-1000) (40K) SG2GG.png
Sindbad Mystery (SG-1000) SG2GG.png (18.54 KB)
Sindbad Mystery in mednafen in Game Gear windowed mode showing both palettes
Sindbad Mystery (SG-1000) SG2GG.png
Hustle Chumy (SG-1000) SG2GG.png (18.16 KB)
Hustle Chumy in mednafen in Game Gear windowed mode showing both palettes
Hustle Chumy (SG-1000) SG2GG.png
Pacar (J) (SG-1000) (40K) SG2GG.png (13.38 KB)
Pacar in mednafen in Game Gear windowed mode showing both palettes
Pacar (J) (SG-1000) (40K) SG2GG.png
Rock N' Bolt (SG-1000) SG2GG.png (12.82 KB)
Rock N' Bolt in mednafen in Game Gear windowed mode showing both palettes
Rock N' Bolt (SG-1000) SG2GG.png
The Castle (SG-1000) SG2GG.png (12.73 KB)
The Castle in mednafen in Game Gear windowed mode showing both palettes
The Castle (SG-1000) SG2GG.png
Sindbad Mystery (SG-1000) SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV-approximated, otherwise SG-approximated
C_So! (J) (SG-1000) SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV-approximated, otherwise SG-approximated
Pop Flamer (SG-1000) [!] SG2GG.ips (545 B)
Press "up" during start-up for SMS palette, "down" for CV-approximated, otherwise SG-approximated
Sega Flipper (J) (SG-1000) (40K) SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV-approximated, otherwise SG-approximated
Pacar (J) (SG-1000) (40K) SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV-approximated, otherwise SG-approximated
Hustle Chumy (SG-1000) SG2GG.ips (545 B)
Press "up" during start-up for SMS palette, "down" for CV-approximated, otherwise SG-approximated
Rock N' Bolt (SG-1000) SG2GG.ips (537 B)
Press "up" during start-up for SMS palette, "down" for CV-approximated, otherwise SG-approximated
The Castle (SG-1000) SG2GG.ips (533 B)
Press "up" during start-up for SMS palette, "down" for CV-approximated, otherwise SG-approximated

  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Fri Jun 29, 2018 5:03 am
These patches fit in our hacks section - http://www.smspower.org/Hacks/Index - although they don't fit the current categories.

I've increased your attachment quota. It looks like you uploaded a bunch of large photos (2-3MB) which could be smaller. I guess it's hard to manage that these days, in the past we'd ask you to resize and recompress, these days we ought to have the server do that for you...
  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Fri Jun 29, 2018 5:24 am
Last edited by bsittler on Sat Jul 14, 2018 3:10 pm; edited 1 time in total
Maxim wrote
These patches fit in our hacks section - http://www.smspower.org/Hacks/Index - although they don't fit the current categories.


Do you have a specific new category in mind? "SG-1000 to Game Gear" perhaps, or maybe "TMS9918 to Game Gear"? And how does one go about proposing/creating a new category there?

Maxim wrote
I've increased your attachment quota. It looks like you uploaded a bunch of large photos (2-3MB) which could be smaller. I guess it's hard to manage that these days, in the past we'd ask you to resize and recompress, these days we ought to have the server do that for you...


Thank you! I'll see whether I can trim those photos and reupload them

edit: photos are reduced, hopefully all of them and not below usable thresholds
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Fri Jun 29, 2018 5:36 am
The categories are just up to us, underneath it works by searching using page name suffixes. We could make the GG2SMS category into a system conversion category and add in SG2GG, or make a new category since there's rather a lot of GG2SMS patches out there. To add a hack involves making a wiki page based on a template, uploading a zipped IPS and at least one screenshot. It then gets listed on the main game page too.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Tue Jul 03, 2018 7:55 pm
Do any emulators correctly emulate the TMS video modes as implemented by the Game Gear in GG-SMS mode? It seems mednafen emulates it correctly at least in GG mode (sadly MEKA does not), but mednafen has (at least AFAIK) no way to access GG-SMS mode as distinct from true SMS emulation — GG in GG-SMS VDP mode allows actually effective SMS-style palette setup in this mode, true SMS VDP does not.
  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Mon Jul 09, 2018 10:20 am
Last edited by bsittler on Tue Aug 14, 2018 7:31 am; edited 16 times in total
Found several bugs in my previous versions, added a third palette (press down during start-up for one that's ColecoVision-inspired), added a "rainbow" animation so you can tell when to hold down the buttons, added more patches (for Pacar, a few of Bock's Gam*Boy dumps, and xbill), added VDP latch and VRAM re-inititalization (Pacar and Star Force needed that for correct rendering), and switched from hand-edited machine code to z80asm. The new version is attached to this message, but I intend to move it out of Forums (to Hacks) soon.

Some minimally-tested scripts are included with which you should be able to add patches for more games fairly easily, provided you have the required tools installed. At the moment the patches work by replacing the SP initialization instruction with a jump to the patcher. The asm source for the palette patcher should also be fairly easy to adapt for use in a cartridge adapter.

Feedback welcomed+appreciated!

edit: slightly fewer tool dependencies: still needs z80asm + flips + python + python2 + GNU make + gls or GNU ls + bash + cp + rm + zip

edit 2: patches earlier in this thread are updated to the latest version from this ZIP file (xbill and Gam*Boy patches are only in the ZIP file so far, though)

edit 3: flips dependency is gone and a python3 ips patch creator is included instead. it seems to give identical results.

edit 4: the patcher now copies itself into ram (0x0200 bytes starting at 0xc500) before doing anything interesting, and simulates a reset (sort of?) if it doesn't find the ROM contents it expects when it's done with VDP setup, so it's technically possible (NOTE: NOT AT ALL RECOMMENDED! THIS COULD PROBABLY DESTROY YOUR GAME GEAR AND/OR CARTRIDGE) to hot-swap cartridges during the 1-second rainbow animation and e.g. use a GG EverDrive to load the patcher (the SG2GG patched xbill should work well for this) but then very quickly swap in a cartridge connector converter (e.g. Gear Master + hand-built Mark Master Converter, maybe with a card catcher on top) with an SG-1000 game in it, and run the SG-1000 game with the correct palette; this same technique could probably also be used to build an on-device debugger and cartridge dumper (using the link port) for those cartridges not easily dumped by other means

edit 5: added apply_ips.py tool to complement create_ips.py and a "test" Makefile target to verify that the IPS patches from create_ips.py do in fact produce the expected patched files when applied to the original inputs; this uses the "cmp" command for checking and either "md5" or "md5sum" for diagnostic messages

edit 6: added patch for 48K Mojon Twins' Super Uwol
(MD5 36e35c0cf1596a906e02b102fc7e4f9d)

edit 7: now the rainbow animation can be paused by pressing the 1 button and control is not transferred to the game until all player 1 controls are released; together these mean it is fairly easy to pause long enough to hot-swap

edit 8: the patcher now has an equate to allow Sega mapper cartridge RAM to conditionally be mapped in from 0x8000 ... 0xbfff before jumping from RAM back to ROM. This is needed by The Castle, and works with GG EverDrive and the original Master EverDrive but not with the Master EverDrive X7. The Castle also works hot-swapped, of course, modulo the usual might-destroy-your-game-and-system caveat, but in that case it's not relying on the Sega mapper — it doesn't have a mapper, AFAIK, just some RAM + some ROM.

edit 9: added patches for more SG-1000 cartridges and MyCards
mcwill-star-jacker-hot-swap.jpg (29.56 KB)
Star Jacker on a McWill-modded Game Gear, booted by hot-swapping a different palette-patched game from an EverDrive
mcwill-star-jacker-hot-swap.jpg
original-congo-bongo-hot-swap.jpg (23.46 KB)
Congo Bongo on an LED-backlit but otherwise fairly original Game Gear, booted by hot-swapping a different palette-patched game from an EverDrive
original-congo-bongo-hot-swap.jpg
sg2gg.zip (52.29 KB)
SG2GG patches and tools

  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Mon Jul 09, 2018 12:25 pm
How are you finding space for the new code? Do you always append the original ROM?
  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Mon Jul 09, 2018 4:03 pm
Maxim wrote
How are you finding space for the new code? Do you always append the original ROM?


Usually. When the original ROM is less than 32k or is exactly 32k and ends with 512 bytes that are all 0x00 or all 0xFF, the 512-byte patcher (which includes a trailing 16 NUL bytes that can be replaced with a BIOS header) is installed at 0x7e00-0x7fff. Otherwise the patcher is installed at 0xbe00-0xbfff, which must either be past the end of the original ROM or the last 512 bytes of the original ROM (which must be either all 0x00 or all 0xFF).

The build scripts should actually work fine with other install locations too, but I have not tested those. The assembly source expects to be 'include'-d from another file that sets up equates for the three-byte patch location, the initial SP value, and the patcher address. At the moment those 'outer' assembly source files are generated by a shell script rule inlined inside the (GNU-flavored) Makefile.

The super-hackish build system needs at least z80asm, make, bash, (GNU) ls or gls, python (2, for the checksum verifier I wrote a while ago), python3 (for the patch+ROM combiner), flips (to generate the .ips files), md5 (used in generating the manifest.txt), and appropriately-named ROM files (you can comment out all the Makefile rules for those you don't have, though.)

edit: also, as a special case, when the input ROM is exactly 32K and ends with at least 64 0x00 or 0xFF bytes, but not enough to fit the patcher, a BIOS header is written at 0x7ff0 but that header lies and claims/checksums only 32K of ROM even though the file is 48K with the patcher at the end (0xbe00-0xbfff).

edit 2: this is no longer entirely accurate, see my previous message for updated dependency information
  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Sat Jul 21, 2018 4:42 pm
Last edited by bsittler on Sun Jul 22, 2018 8:42 pm; edited 3 times in total
Maxim wrote
The categories are just up to us, underneath it works by searching using page name suffixes. We could make the GG2SMS category into a system conversion category and add in SG2GG, or make a new category since there's rather a lot of GG2SMS patches out there. To add a hack involves making a wiki page based on a template, uploading a zipped IPS and at least one screenshot. It then gets listed on the main game page too.


Calindro recently added GG-SMS emulation to Emulicious's GG emulation, selectable using
GameGearSMSmode=true
in the Emulicious.ini config file (thank you!), so finally non-windowed screenshots can be made using an emulator. I'd like to add these to the wiki, maybe as just a single page since they all use the same assembly source. At the moment all the patches are in a single fairly small .zip file up-thread, would that work for the wiki or are separate .zip files needed?

edit: added details on how to configure Emulicious

edit 2: note that Emulicious will only pay attention to GameGearSMSmode when in Game Gear mode; you can trigger that either through the menus (Options, System, Game Gear) or by setting the file extension to .gg
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12333
  • Location: London
Reply with quote
Post Posted: Sat Jul 21, 2018 5:10 pm
The wiki likes to have a page for each game so it can link it from the main page for the game. The page contents can be fairly easily generated, I may give it a go myself later.
  View user's profile Send private message Visit poster's website
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Tue Jul 31, 2018 6:03 am
Looks like hot-swapping from a flash cart running the palette patcher to the real cartridge plugged into an adapter also works with the テレビおえかき (TV oekaki) set too. AFAIK this isn't really one that makes sense to patch, but maybe someone will find a working tablet with a non-working cartridge and wire it to a GB flash cartridge and surprise me ;)

edit: or surprise me even more with a fully integrated touchscreen version on a McWill-modded Game Gear, of course!
oekaki-gear.jpg (20.16 KB)
oekaki-gear.jpg
oekaki-gear2.jpg (17.57 KB)
oekaki-gear2.jpg

  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Sat Aug 04, 2018 5:02 pm
tiny update on scrolling: I've tried several different ways so far, but so far as I can tell scrolling registers simply do not function in TMS modes on the Game Gear (entirely possible I just did it wrong every time, though!) so the best hope for native-GG mode might be game-specific deeper modifications to fit in the screen window
  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 56
Reply with quote
Post Posted: Sun Aug 12, 2018 8:25 am
the ZIP file in my previous comment is now updated to include patches for some more SG-1000 MyCard dumps — each Retrode2 dump was first truncated to 32768 bytes, then patched. Hashes prior to patching:

MD5 (Bank Panic (SG-1000).sg) = 47cd2d0bbcb879302f83f2f7058f49d4
MD5 (Black Onyx, The (SG-1000).sg) = d2b0524a2cf5754c0fa1c900e9ecb06b
MD5 (Champion Billiards (SG-1000).sg) = 71c32b1cf1e85d217421068ac8ccc655
MD5 (Champion Boxing (SG-1000).sg) = 7527098abb9df1db29ba9f495b06998a
MD5 (Champion Golf (SG-1000).sg) = 3c01bb2a4414989378c252f45a4e5050
MD5 (Champion Ice Hockey (SG-1000).sg) = b3af58c60e62bb85522ddc29096cef60
MD5 (Champion Kendou (SG-1000).sg) = ed6e4e8e081b56be488f57abcb51a7e5
MD5 (Choplifter (SG-1000).sg) = ee557c7811f03c44965a56b80801a3b9
MD5 (Dragon Wang (SG-1000) [!].sg) = 64d3cc8117292f6d5af8e1aad95bcb90
MD5 (Dragon Wang (SG-1000).sg) = 0528eed7e7ae46ec8298098f1a22d18f
MD5 (Drol (SG-1000).sg) = 8eb2ab42d2bc3f3568e85cba2b46a251
MD5 (Elevator Action (SG-1000).sg) = 23c751fe6bb8bd4f8c0cd9b0d39adecd
MD5 (Gulkave (SG-1000).sg) = 43c23a134aec3ab424405780ff729d54
MD5 (H.E.R.O. (SG-1000).sg) = d10f38c614113cb34bbf4a19b487e1fb
MD5 (Hang-On II (SG-1000).sg) = 314c865decbe6f578d9bfa23f27a08e6
MD5 (Ninja Princess (SG-1000).sg) = 28d83150c298bcdae6aec51cc2c6975a
MD5 (Pitfall II - The Lost Caverns (SG-1000).sg) = c34260b61c6a45bbdd074df3f3e72c46
MD5 (Soukoban (SG-1000).sg) = 6cae3b6286041e742020aeb3cd2bdf52
MD5 (Super Tank (SG-1000).sg) = 59d01bf1093a65e9ec08e533cfbbc5ff
MD5 (Zippy Race (SG-1000).sg) = 0eda34ba313d3bb34558fd5939b19794
MD5 (Zoom 909 (SG-1000).sg) = 4e457a6c5b4b613f2aac3472f6827a89

edit: SG2GG patches are added for English translations of The Black Onyx and Ninja Princess.

edit 2: it turns out skaman's Retrode2 Mark III adapter works with Peter Byemu (famulator)'s "Lithium" MD dumper, and after deinterleaving and truncation I was finally able to read my remaining SG-1000 cartridges. Now patches are included for:

MD5 (Congo Bongo (SG-1000) [a1].sg) = b9ae730672ade71c6fce5527c2b1b42e
MD5 (Flicky (SG-1000).sg) = b52e308e1c0005bc1dba2ba900ad44d0
MD5 (Girl's Garden (SG-1000).sg) = ac95c0655360f667e3ad705e2eb7367a
MD5 (Orguss (SG-1000) (Alt).sg) = 49d4ef0e2ff7d9c6793053da2180f1da
MD5 (Star Jacker (SG-1000) (V1.1) [!].sg) = 658ede490eae6af2b0f61dd136761d95
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!