Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Support for SGB features. #223

Closed
Aerocatia opened this issue Feb 14, 2016 · 35 comments
Closed

[Request] Support for SGB features. #223

Aerocatia opened this issue Feb 14, 2016 · 35 comments
Labels
platform:GB/GBC Game Boy/Game Boy Color-related issues severity:enhancement Feature requests
Milestone

Comments

@Aerocatia
Copy link

Now that gameboy emulation is supported what do you think about adding SGB features like colouring and border support? How it works is documented in VBA-M

@endrift endrift added the severity:enhancement Feature requests label Feb 14, 2016
@endrift
Copy link
Member

endrift commented Feb 14, 2016

Full SGB support is out of the question (that would involve writing a SNES emulator), but I'll see how much I can do without having to emulate the whole SNES.

@sczther
Copy link

sczther commented Feb 14, 2016

Aside from borders and colorization usually supported by other GB emus the main thing it uses from SNES is audio, so maybe just use the audio chip core from Higan or something (maybe even optionaly). Then everything would work except for Space Invaders invading.

@waddlesplash
Copy link
Contributor

Borders/colors were also supported on Gameboy Advance hardware, FYI.

@endrift
Copy link
Member

endrift commented Feb 14, 2016

Um, no they aren't.

@waddlesplash
Copy link
Contributor

...? My GBA SP plays the Gameboy cartridges I own in color.
EDIT: nvm, I'm confused here

@shinyquagsire23
Copy link

I would at least like color support, the GBA didn't support borders but some games definitely pull SGB colors like Kirby's Dream Land 2.

@Aerocatia
Copy link
Author

That was a GBC colour palette that are applied to certain games. The GBA/GBC never supported SGB colouration.

@endrift
Copy link
Member

endrift commented Feb 15, 2016

SGB colors are kinda weird because of how they can apply to regions of the screen, such as this:

Pokemon

In this screenshot, Squirtle is in the background, but so is the all of the text. SGB lets you change (IIRC) rectangular regions.

Whereas a GBC can't do that unless it's using GBC-specific features. On GB games, it's just a whole-frame palette.

@oranki
Copy link

oranki commented Feb 24, 2016

There are four different palettes in SGB which can be chosen from per 8x8 tile. I found this document that explains them:
http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf

You can also see eg. VBAGX source for reference:
https://github.com/libertyernie/vba-wii/blob/master/source/vba/gb/gbSGB.cpp

Games that have specific SGB support coded in can make use of these features. The Pokemon Blue supports monochrome GB and SGB. It seems common that games that support SGB only still specify custom colors for GB palettes rather than taking advantage of the more advanced SGB palette features, like Pokemon Blue does.

I've never seen a real SGB, but based on Youtube vids, the SGB also packed built-in preprogrammed custom color GB palettes for older games like Super Mario Land. It would be an interesting undertaking trying to copy them all.

@taisel
Copy link

taisel commented Feb 25, 2016

Fair warning, a true SGB can upload and run SNES binaries on the actual SNES. The route to perfect SGB emulation is wrought with pedantics on how much to implement for SGB support short of bundling with a SNES emulator (see higan SGB support).

@taisel
Copy link

taisel commented Feb 25, 2016

@shinyquagsire23 GameBoy Color boot ROM has special purple coloring provided for Kirby 2, albeit not what the SGB has. You can also force it to use one you specify on logo start with special combos.

GBC Boot ROM colors

@oranki
Copy link

oranki commented Feb 25, 2016

I think "SGB support" translates to supporting the additional SGB palettes for games that can use them, and user-configurable palettes for GB games.

@Aerocatia
Copy link
Author

I think simulating the colourization and borders is enough. Only a handful of games ever used the other features and only Space Invaders ever ran SNES code.

@taisel
Copy link

taisel commented Feb 25, 2016

SGB also can play sound effects on the SNES APU.

@oranki
Copy link

oranki commented Feb 25, 2016

taisel, it should be enough to emulate the SGB functions which are actually used by any actual, existing game.

To be more practical, GBC support would be much, much more useful than SGB support. After all, there aren't many games which do not support GBC, but do support SGB and use it's advanced palette features. Simply having user-configurable GB palette (preferably with preconfigured SGB-like defaults for known games) would already fit the bill for most use cases.

@endrift
Copy link
Member

endrift commented Feb 25, 2016

The obvious counter example is first Gen Pokemon. Also, GBC support is already in place by now.

@oranki
Copy link

oranki commented Feb 25, 2016

Sorry, I've never actually seen a real SGB (and a real GB 20+ years ago) and I've been under the impression that only it's palette features were actually used. I stand corrected; Google found this which states the same: https://tcrf.net/Super_Game_Boy_1_and_2#Unused_Sounds

Should pay more attention before spouting shit on the Internet. :)

Edit: SGB support would be nice either way. I first modified VBAGX to display monochrome palette in greenish tint akin to original instead of b/w (which brought back some very old memories), but seeing how the games look like on Youtube when played on SGB, I'd definitely prefer latter. VBAGX has support for SGB but only for games with SGB support. It fails miserably for some regular GB games and acts erratically to others, due to broken palette code.

@endrift endrift added this to the 1.0.0 milestone Jun 2, 2016
@endrift endrift added the platform:GB/GBC Game Boy/Game Boy Color-related issues label Jun 24, 2016
@endrift endrift modified the milestones: 1.0.0, 0.7.0 Sep 7, 2016
@wildgoosespeeder
Copy link

wildgoosespeeder commented Oct 4, 2016

I agree with @endrift not wanting to fully support SGB features. A real GBA doesn't do this. Not even GBP for GCN. VBA-M or the VisualBoyAdvance line of emulators fakes the features. An emulator already fully supports SGB with cycle accuracy and that is bsnes/Higan, although I have had issues with Pokémon Yellow Version and that ROM is a good dump by the use of GoodTools to verify it. All other versions work fine, even Gold and Silver.

@endrift
Copy link
Member

endrift commented Aug 2, 2017

Aaaaalmost done.

Some of the color attribute (four of them actually) are still missing, but everything else is in place.

E] I forgot to add an SGB section to the BIOS list too...

E2]

Still missing:

  • ATTR_LIN
  • ATTR_DIV
  • ATTR_CHR

@bryc
Copy link

bryc commented Nov 13, 2017

It'd be a great Christmas to be able to play Pokemon Blue (just an example) in its SGB palette mode in mGBA and hopefully the libretro port as well (that'd be a game changer, the only GB emulator in RE with SGB palettes)! 😎

@endrift
Copy link
Member

endrift commented Nov 13, 2017

@bryc it’s already mostly done. Only a handful of less-used features are unimplemented.

@bryc
Copy link

bryc commented Nov 13, 2017

Ah I see it's in the dev builds!

I'm excited af, but I've noticed some issues/bugs:

Machine:
Using build mGBA-build-2017-11-12-win32-4918-dcf42fb081a877a3af32f60020dd81a6f32e74e6
Running 64-bit Windows 7 Ultimate.

  1. Some SGB games glitch out using frameskip.
    image
    First screen is frameskip 0, second is frameskip 7. Toggling SGB border doesn't seem to matter.
    Game is "Another Bible (Japan) (SGB Enhanced).gb"

  2. Some SGB games aren't rendering properly even on frameskip 0?
    image
    First screen is frameskip 0, second is BGB 1.5.2, third is frameskip 7.
    Game is "Battle Arena Toshinden (USA) (SGB Enhanced).gb"

Also I disabled SGB borders, kept it at frameskip 0 and am getting mixed results (holding turbo, pressing shutdown and re-drag drop ROM) on different reset attempts:

image

image
Game is "Battle Crusher (Japan) (SGB Enhanced).gb". Also not rendering properly.

image
Game is "Castlevania Legends (USA, Europe) (SGB Enhanced).gb". The last screenshot is bgb (also matches VBA-M).

donkey kong land 2 usa europe sgb enhanced -0
Game is "Donkey Kong Land 2 (USA, Europe) (SGB Enhanced).gb".

  1. Some games aren't detected as SGB

block kuzushi gb japan sgb enhanced -0

Game is "Block Kuzushi GB (Japan) (SGB Enhanced).gb". Color works fine in BGB.

@DonelBueno
Copy link

DonelBueno commented Nov 26, 2017

@endrift what SGB features have you implemented? Colors and borders? What about sound/music enhancements?

@endrift
Copy link
Member

endrift commented Jan 9, 2018

@bryc Added support for ATTR_CHR and fixed some PAL commands; many of those issues you sent are fixed.
@DonelBueno Sound enhancements aren't going to be implemented at this time.

@bryc
Copy link

bryc commented Jan 9, 2018

Awesome!! Nice work, that fixed the issues with Battle Arena and Battle Crusher as well as DKL2 title screen.

The remaining issues in that sample of tests:

  • Block Kuzushi not detected as SGB
  • DKL2 in-game has palette issues
  • Castlevania has palette issues and odd colors (blue fire instead of red, orange in-game instead of green)

Also other bugs I came across:

  • Some white colors missing in border (Pokemon Blue)
  • Garbled pixels when resetting game after switching SGB border mode without reloading game.

Hopefully those end up automagically fixed when the remaining ATTR functions are added ;)

@lordelan
Copy link

lordelan commented Mar 9, 2018

This is awesome! How can I use this in RetroArch? Where do I have to put the sgb_bios.bin?
Starting Pokémon Red with the mGBA core still displays the game in b/w.

To be clear I just care about the color palettes. I'm using SGB borders with RetroArch's shaders feature which is alright. I just want a GB(C) rom to use this palette priority when booted with mGBA core:

  1. GBC palette if supported by game or GBC bios
  2. SGB palette if supported by game or SGB bios
  3. no palette (or those GBC palette for GB games)

@endrift
Copy link
Member

endrift commented Mar 31, 2018

I've fixed another issue that affects Castlevania Legends. Please retest other games.

@bryc
Copy link

bryc commented Apr 5, 2018

I've fixed another issue that affects Castlevania Legends. Please retest other games.

Great - Castlevania Legends is fixed.

Pokemon Blue's SGB border seems fixed, but Donkey Kong Land 2's seems to regressed in the opposite way. There are now white pixels where there should be black (Pokemon Blue had white pixels that should have been black).

image

Also palettes remain broken while running the gameplay demo/attract mode in Donkey Kong Land 2.

These issues still remain:

  • Block Kuzushi not detected as SGB
  • Garbled pixels when resetting game after switching SGB border mode without reloading game ('shutdown').

I'll test more games this weekend and update this post.

@endrift
Copy link
Member

endrift commented Apr 22, 2018

DKL2 borders should be fixed now.

E] DKL2 attract should be fixed too.
E] Block Kuzushi should be fixed too.

@endrift
Copy link
Member

endrift commented Apr 25, 2018

@bryc are there any remaining SGB issues you're aware of? I'm trying to find any game that uses ATTR_LIN so I can test it.

@bryc
Copy link

bryc commented Apr 25, 2018

image

Not sure if this is related to ATTR_LIN but theres some color differences here in World Heroes 2 Jet (Intro screen after selecting default character on first menu option).
Going to test a bunch more games and see what I can find.

@endrift
Copy link
Member

endrift commented Apr 25, 2018

Yes, that is ATTR_LIN! Thank you.

@endrift
Copy link
Member

endrift commented Apr 25, 2018

I should have that bug fixed tonight, then this issue can be closed (file remaining issues separately).

@bryc
Copy link

bryc commented Apr 25, 2018

No problem! I'll make a new issue for any other bugs/quirks I find (in that build)

@endrift
Copy link
Member

endrift commented Apr 26, 2018

ATTR_LIN added, and with that I'm done with the SGB features I'm planning to add (modulo bugfixes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:GB/GBC Game Boy/Game Boy Color-related issues severity:enhancement Feature requests
Projects
None yet
Development

No branches or pull requests