Gameboy core

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, spiny, Greenious, Sorgelig, Moderator Team

Locked
djsquare
Atari maniac
Atari maniac
Posts: 91
Joined: Thu Oct 18, 2018 2:01 am

Re: Gameboy core

Post by djsquare »

brNX wrote:Hi

heads-up for those that didn't see it, added a workaround to the README to enable analog out (15KHz) for now until a better solution is found/implemented
have fun.

https://github.com/MiSTer-devel/Gameboy ... /ReadMe.md

Cheers
Thank you very much for posting this. I'll try it first thing when I get home from work
Hewhoisred
Atari freak
Atari freak
Posts: 51
Joined: Sun Dec 09, 2018 6:53 pm

Re: Gameboy core

Post by Hewhoisred »

One caveat, if you use the custom video mode for analog you won't have the usual HDMI+analog (dual video). HDMI will effectively be disabled for this core.
brNX
Atari maniac
Atari maniac
Posts: 85
Joined: Wed Oct 24, 2018 10:22 pm
Location: Coimbra/Portugal

Re: Gameboy core

Post by brNX »

Hewhoisred wrote:One caveat, if you use the custom video mode for analog you won't have the usual HDMI+analog (dual video). HDMI will effectively be disabled for this core.
thanks , I forgot to mention that
djsquare
Atari maniac
Atari maniac
Posts: 91
Joined: Thu Oct 18, 2018 2:01 am

Re: Gameboy core

Post by djsquare »

Alright, the Gameboy core is pretty good looking in RGB but I still like the LCD_Effect filter for HDMI. It's kinda strange because I prefer RGB over HDMI for all cores that support it but with Gameboy, I'm not 100% sure. It's always nice to have options though.
brNX
Atari maniac
Atari maniac
Posts: 85
Joined: Wed Oct 24, 2018 10:22 pm
Location: Coimbra/Portugal

Re: Gameboy core

Post by brNX »

djsquare wrote:Alright, the Gameboy core is pretty good looking in RGB but I still like the LCD_Effect filter for HDMI. It's kinda strange because I prefer RGB over HDMI for all cores that support it but with Gameboy, I'm not 100% sure. It's always nice to have options though.
yeah, I'm a big fan of the lcd_effect filter
PhantombrainM
Captain Atari
Captain Atari
Posts: 187
Joined: Fri Mar 16, 2018 9:10 am

Re: Gameboy core

Post by PhantombrainM »

LCD Filter...by the way...

...the normal Gameboy has black borders in the dot matrix while the gbc has white lines.
There are filters for both systems but...

I'd like to have the filters stored for each system, so you don't have to set it again and again when changing between gc and gbc.

This would also help other cores for example SMS... when I'm running the sms games I'd like scanlines, but when I play Gamegear I'd like lcd effects. But unfortunatly its not saveable.

Just an idea or something I came across for several months now I wanted to share.
Two beer or not two beer? - Shakesbeer.
Dirtbag
Atari User
Atari User
Posts: 40
Joined: Sat Oct 06, 2018 9:26 pm

Re: Gameboy core

Post by Dirtbag »

PhantombrainM wrote:LCD Filter...by the way...

...the normal Gameboy has black borders in the dot matrix while the gbc has white lines.
There are filters for both systems but...

I'd like to have the filters stored for each system, so you don't have to set it again and again when changing between gc and gbc.

This would also help other cores for example SMS... when I'm running the sms games I'd like scanlines, but when I play Gamegear I'd like lcd effects. But unfortunatly its not saveable.

Just an idea or something I came across for several months now I wanted to share.
Didn't the game gear use a CRT not a LCD?
ReedSolomon
Atari nerd
Atari nerd
Posts: 47
Joined: Tue Oct 09, 2018 1:52 am

Re: Gameboy core

Post by ReedSolomon »

Dirtbag wrote:Didn't the game gear use a CRT not a LCD?
No
reelbigeddy
Atarian
Atarian
Posts: 2
Joined: Sat Apr 20, 2019 1:26 am

Re: Gameboy core

Post by reelbigeddy »

Can't seem to get any GBC roms running on the core. Game Boy roms are hit and miss, but usually work after a reset - no such luck with GBC.
Anything obvious I might be missing?

EDIT: For anyone else as dense as me, boot1.rom wasn't in the Gameboy folder. I knew it would be something obvious.
PhantombrainM
Captain Atari
Captain Atari
Posts: 187
Joined: Fri Mar 16, 2018 9:10 am

Re: Gameboy core

Post by PhantombrainM »

brNX wrote:
@brNX: Your latest changes fix Super Mario Land 6 Golden Coins DX. Now Mario has finally two eyes! Thank you :)

Are in interested in bug reports by the way? I'm sorting some games and found 2 broken games:

1) Initial D Gaiden (Japan) (SGB Enhanced).gb -> Press Start (3x) -> Game hangs up. In Emulator its only possible to press 2x start. The third time there is an error sound and the menu is not selectable. I think this is why it hangs up on FPGA because it should not be selectable directly.

2) 4x4 World Trophy (Europe) (En,Fr,De,Es,It).gbc -> only white screen. The two splash screens and the language selection screen is missing.

If you are interested I'll check some games and make a list. If there is already enough to do and it's not important for you its also okay. :cheers:
Two beer or not two beer? - Shakesbeer.
brNX
Atari maniac
Atari maniac
Posts: 85
Joined: Wed Oct 24, 2018 10:22 pm
Location: Coimbra/Portugal

Re: Gameboy core

Post by brNX »

PhantombrainM wrote:
brNX wrote:
@brNX: Your latest changes fix Super Mario Land 6 Golden Coins DX. Now Mario has finally two eyes! Thank you :)
Yeah finally caught that one, most GBC sprite glitches should be gone now hopefully.

Feel free to add them here and tag me or better yet add them to the github issues, I have a known list there that I try to keep updated.

I will work on the PPU next and try fix the remaining display bugs (hopefully once and for all), I took some time to work on tools to help me in simulation and will try to expand those now, they've been really helpful.

:cheers:
slingshot
Atari God
Atari God
Posts: 1840
Joined: Mon Aug 06, 2018 3:05 pm

Re: Gameboy core

Post by slingshot »

@brNX: I've tried the latest "GB games in GBC mode fix" change on MiST, assuming it should fix missing sprites in GBC mode for GB games. However in Xenon2 (again) it doesn't make a difference. Maybe I did something wrong, or the purpose of this patch was something else?
brNX
Atari maniac
Atari maniac
Posts: 85
Joined: Wed Oct 24, 2018 10:22 pm
Location: Coimbra/Portugal

Re: Gameboy core

Post by brNX »

slingshot wrote:@brNX: I've tried the latest "GB games in GBC mode fix" change on MiST, assuming it should fix missing sprites in GBC mode for GB games. However in Xenon2 (again) it doesn't make a difference. Maybe I did something wrong, or the purpose of this patch was something else?
Sorry I may have missed something while implementing that, is xenon 2 buggy again? The fix was about the color palettes (you can check the screenshots here: https://github.com/MiSTer-devel/Gameboy ... /issues/45). Thanks for reporting I'll have a look tomorrow.
slingshot
Atari God
Atari God
Posts: 1840
Joined: Mon Aug 06, 2018 3:05 pm

Re: Gameboy core

Post by slingshot »

brNX wrote: Sorry I may have missed something while implementing that, is xenon 2 buggy again? The fix was about the color palettes (you can check the screenshots here: https://github.com/MiSTer-devel/Gameboy ... /issues/45). Thanks for reporting I'll have a look tomorrow.
Not again, because it still OK in monochrome mode. But in forced color mode (look nice), the same old sprites are still missing. It's definitely not a palette issue.
brNX
Atari maniac
Atari maniac
Posts: 85
Joined: Wed Oct 24, 2018 10:22 pm
Location: Coimbra/Portugal

Re: Gameboy core

Post by brNX »

slingshot wrote: Not again, because it still OK in monochrome mode. But in forced color mode (look nice), the same old sprites are still missing. It's definitely not a palette issue.
It's possibly triggering the incorrect flags ("isGBC_game") and leaves the GBC logic working (2nd vram bank, etc...), just like the regression I had in the GB mode in the past.

I'll test it out when I can (at work at the moment :lol: )
slingshot
Atari God
Atari God
Posts: 1840
Joined: Mon Aug 06, 2018 3:05 pm

Re: Gameboy core

Post by slingshot »

brNX wrote: It's possibly triggering the incorrect flags ("isGBC_game") and leaves the GBC logic working (2nd vram bank, etc...), just like the regression I had in the GB mode in the past.

I'll test it out when I can (at work at the moment :lol: )
I can wait of course, thanks in advance!
slingshot
Atari God
Atari God
Posts: 1840
Joined: Mon Aug 06, 2018 3:05 pm

Re: Gameboy core

Post by slingshot »

brNX wrote:
It's possibly triggering the incorrect flags ("isGBC_game") and leaves the GBC logic working (2nd vram bank, etc...), just like the regression I had in the GB mode in the past.
I have no idea if it's fully correct or not, but this one fixes at least Xenon2:

Code: Select all

--- a/cores/gameboy/video.v
+++ b/cores/gameboy/video.v
@@ -97,7 +97,7 @@ sprites sprites (
        .addr     ( sprite_addr                 ),
        .dvalid   ( sprite_dvalid               ),
        .data     ( vram_data                   ),
-       .data1    ( isGBC?vram1_data:vram_data  ),
+       .data1    ( isGBC&&isGBC_game?vram1_data:vram_data  ),
 
        //gbc
        .pixel_cmap_gbc ( sprite_pixel_cmap_gbc ),
brNX
Atari maniac
Atari maniac
Posts: 85
Joined: Wed Oct 24, 2018 10:22 pm
Location: Coimbra/Portugal

Re: Gameboy core

Post by brNX »

slingshot wrote:
brNX wrote:
It's possibly triggering the incorrect flags ("isGBC_game") and leaves the GBC logic working (2nd vram bank, etc...), just like the regression I had in the GB mode in the past.
I have no idea if it's fully correct or not, but this one fixes at least Xenon2:

Code: Select all

--- a/cores/gameboy/video.v
+++ b/cores/gameboy/video.v
@@ -97,7 +97,7 @@ sprites sprites (
        .addr     ( sprite_addr                 ),
        .dvalid   ( sprite_dvalid               ),
        .data     ( vram_data                   ),
-       .data1    ( isGBC?vram1_data:vram_data  ),
+       .data1    ( isGBC&&isGBC_game?vram1_data:vram_data  ),
 
        //gbc
        .pixel_cmap_gbc ( sprite_pixel_cmap_gbc ),
I'm having a look in a minute , it's weird , that one shouldn't be needed because the logic GBC should be off in video.v but I maybe missed something, can I have a look at your code?
edit: yeah I can reproduce it here too, the fix you posted should do it
brNX
Atari maniac
Atari maniac
Posts: 85
Joined: Wed Oct 24, 2018 10:22 pm
Location: Coimbra/Portugal

Re: Gameboy core

Post by brNX »

@slingshot

ok , got it , yes I missed this part in the sprite.v https://github.com/MiSTer-devel/Gameboy ... rite.v#L62

Thanks a lot for reporting , guess Xenon 2 sets those bits for whatever reason.

edit: will also rename it to isGBC_game in sprites.v and sprite.v
edit2: PR sent https://github.com/MiSTer-devel/Gameboy_MiSTer/pull/53
Gamepimp
Atari User
Atari User
Posts: 33
Joined: Fri Nov 09, 2018 2:59 pm

Re: Gameboy core

Post by Gamepimp »

I have a Sony CRT TV that takes 480p over component. I added the code below to my config file and was able to get the Gameboy core to display (very awesome btw :cheers:). Because the image size is set to 320x240, it creates a small window in the center of the TV. I thought I might be able to change the size of the window by modifying the video mode to 640,8,32,24,480,4,3,16,6048. That did increase the size of the window, but it was off center and the output seemed a bit choppy. I'm not all that familiar with the attributes expressed in that string. Are there other values that I can modify to resize the window appropriately? Also, I've been using the internal scaler for all other cores as this tends to give the best image on the TV. It looks like the code enables the VGA scaler for this core. However, none of the filters seem to work. I wanted to add scanlines to the GB games because my TV is considered "hi def" and doesn't really have them. Any ideas on how I might pull that off?

Code: Select all

[Gameboy]
video_mode=320,8,32,24,240,4,3,16,6048
vga_scaler=1
vsync_adjust=2
vscale_mode=1
brNX
Atari maniac
Atari maniac
Posts: 85
Joined: Wed Oct 24, 2018 10:22 pm
Location: Coimbra/Portugal

Re: Gameboy core

Post by brNX »

Gamepimp wrote:I have a Sony CRT TV that takes 480p over component. I added the code below to my config file and was able to get the Gameboy core to display (very awesome btw :cheers:). Because the image size is set to 320x240, it creates a small window in the center of the TV. I thought I might be able to change the size of the window by modifying the video mode to 640,8,32,24,480,4,3,16,6048. That did increase the size of the window, but it was off center and the output seemed a bit choppy. I'm not all that familiar with the attributes expressed in that string. Are there other values that I can modify to resize the window appropriately? Also, I've been using the internal scaler for all other cores as this tends to give the best image on the TV. It looks like the code enables the VGA scaler for this core. However, none of the filters seem to work. I wanted to add scanlines to the GB games because my TV is considered "hi def" and doesn't really have them. Any ideas on how I might pull that off?

Code: Select all

[Gameboy]
video_mode=320,8,32,24,240,4,3,16,6048
vga_scaler=1
vsync_adjust=2
vscale_mode=1
you can probably try to set vscale_mode = 0 that should fill the screen , the problem is that it's not a good fit (scale 160x144 to 320x240), regarding the video_mode there are some calculators around the internet that can help you with, I'm not that familiar with it sorry.
slingshot
Atari God
Atari God
Posts: 1840
Joined: Mon Aug 06, 2018 3:05 pm

Re: Gameboy core

Post by slingshot »

Works well, thank you!
BlockABoots
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 143
Joined: Sat Oct 20, 2018 3:20 pm

Re: Gameboy core

Post by BlockABoots »

Whats happened to the LCD_effect filter, they used to look really good havent played the core for a good few months and none of the LCD Filters look reminiscent of the GB screen anymore?
Threepwood
Captain Atari
Captain Atari
Posts: 154
Joined: Thu Jan 10, 2019 10:06 am

Re: Gameboy core

Post by Threepwood »

BlockABoots wrote:Whats happened to the LCD_effect filter, they used to look really good havent played the core for a good few months and none of the LCD Filters look reminiscent of the GB screen anymore?
I noticed this, too, yesterday. It looks like the lines are being duplicated a few times and blurred. They looked way better before.
2x MiSTer FPGA: [Official Stormtrooper Case, USB Hub 2.1 with Bridge Board, 128MB SDRAM, ADC, RTC 1.3, I/O v5.5] + [3D printed MiSTer XS Case v2, 128MB SDRAM, I/O v5.6 XL]
hernan43
Atariator
Atariator
Posts: 21
Joined: Thu Dec 27, 2018 7:10 pm

Re: Gameboy core

Post by hernan43 »

What would cause the Gameboy core to not provide audio over HDMI? Right now all my cores are providing audio over HDMI except the Gameboy core. If I plug headphones into the line out on the IO board it does provide audio just fine. For some reason it does not want to provide audio over HDMI.

Now if I hook it up to a different HDMI display the audio works fine. So it is 100% an issue with the particular display I am using. I am just curious what the difference would be.
Locked

Return to “MiSTer”