Homebrew Emulation GameYob, a gameboy emulator for DS

Kouen Hasuki

Coffee Addict
Member
Joined
Jan 9, 2013
Messages
1,387
Trophies
1
Age
40
Location
Behind you
XP
681
Country
Norway
Diablo works just fine for me, with bios and all. Maybe try running it in bgb? It'll tell you if the header checksum is wrong, in which case it wouldn't get past the bios. The checksum is correct in my copy

Got a fresh copy bgb claims "checksum fails but real GB wouldn't care"

My copy is 131,072 Bytes big now and does work with Gameyob :)
 

Snailface

My frothing demand for 3ds homebrew is increasing
Member
Joined
Sep 20, 2010
Messages
4,324
Trophies
2
Age
40
Location
Engine Room with Cyan, watching him learn.
XP
2,256
Damn. "Sound initialized" was my last print statement. Okay, try this one. I disabled a speed hack and set it to print some rom info when starting.
Well, the gurus have stopped meditating and now Shantae runs at almost 90fps :lol:
http://www.mediafire.com/?566h5os06m1y825 (Sudokuhax build, messed up sound but fast)

I was able to narrow down the problem to the swiIntrWait() libnds function. I found it by simply using placing while(1); statements until I deduced exactly where the game was crashing. Pretty old fashioned, heh.

So I simply commented it out in the two functions it appears: drawScreen() and updateLCD(). It screws up the sound but at least it runs now. I trust you have a solution that's better than just the stop-gap measure of omitting swiIntrWait(). Any ideas?
 

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
Well, the gurus have stopped meditating and now Shantae runs at almost 90fps :lol:
http://www.mediafire.com/?566h5os06m1y825 (Sudokuhax build, messed up sound but fast)

I was able to narrow down the problem to the swiIntrWait() libnds function. I found it by simply using placing while(1); statements until I deduced exactly where the game was crashing. Pretty old fashioned, heh.

So I simply commented it out in the two functions it appears: drawScreen() and updateLCD(). It screws up the sound but at least it runs now. I trust you have a solution that's better than just the stop-gap measure of omitting swiIntrWait(). Any ideas?
Thanks! It's certainly easier to debug if you can test it yourself. So, how do you mean the sound is messed up? Is it just playing too fast or what? Also I'm not sure how accurate the fps counter is if the timers run at different speed on a dsi. But, anyway. I tried replacing the "swiIntrWait"s with "swiWaitForVBlank"s. For some reason I decided to use the VCOUNT interrupt instead of VBLANK, but they work basically the same on a regular ds. Also "Wait for Vblank" is essentially always on this way, but you shouldn't even need to disable it if Shantae really is running at 90fps. Try it out... same link as always.
Or make it compatible with the Activition Motion option pack for DS?
That would be even cooler. I don't own one myself though. I guess we'll see.
And by the way. My copy of Mortal Kombat 1&2 can't select a game even on bgb. In fact I tried 2 copies. One gave me a warning about rom size when starting bgb. The other gave no warning but still wouldn't enter either game.
A lot of Blargg's sound tests are failing right now. I've tried improving on that a little, see the latest pull request from my correctness branch. The 1st sound test ROM now passes, but the rest is a train wreck. That points to a systemic failure with your sound handling.

Ed: All OAM bug tests and all memory timing tests are also failing, but maybe that's less meaningful for games. Sound tests are more crucial. The "non-OAM-bug tests", which test for the OAM bug not appearing in certain non-causing circumstances, pass, by the way.

Ed 2: Should we start using GitHub's issue tracking for these bugs? :)
Thanks again Nebuleon! It's possible I'm doing some things completely wrong with sound, and most games just don't care because they don't read sound registers. But I don't think these are causing most audio issues, most of them appeared when I ported it to the ds. And wow, the cgb sound test does fail horribly. It doesn't even stop when it's supposed to!

It's probably not so important to emulate the pointless bugs in the gameboy hardware. Except maybe the halt bug, perhaps a few games require it.

And, sure, you can mention bugs or inaccuracies on github's tracking system. It'd be helpful to have them all in one place.
 

Arm73

Well-Known Member
Member
Joined
Mar 4, 2006
Messages
2,046
Trophies
0
Location
Switzerland
XP
587
Country
Italy
Thanks! It's certainly easier to debug if you can test it yourself. So, how do you mean the sound is messed up? Is it just playing too fast or what? Also I'm not sure how accurate the fps counter is if the timers run at different speed on a dsi. But, anyway. I tried replacing the "swiIntrWait"s with "swiWaitForVBlank"s. For some reason I decided to use the VCOUNT interrupt instead of VBLANK, but they work basically the same on a regular ds. Also "Wait for Vblank" is essentially always on this way, but you shouldn't even need to disable it if Shantae really is running at 90fps. Try it out... same link as always.

......

It works !! It works !!

Sorry, I need to contain my excitement....;)
Yeah, I tried two games for now, Batman ( J) for GB, and R-Type DX for GBC.
They both run at steady, rock solid 60fps and I couldn't notice anything wrong with the timing, and I should know those games very, very well....
No sound though, but that was already explained.

What tricky games do you want me to test ?
Fire away........;)
 

Kouen Hasuki

Coffee Addict
Member
Joined
Jan 9, 2013
Messages
1,387
Trophies
1
Age
40
Location
Behind you
XP
681
Country
Norway
That would be even cooler. I don't own one myself though. I guess we'll see.
And by the way. My copy of Mortal Kombat 1&2 can't select a game even on bgb. In fact I tried 2 copies. One gave me a warning about rom size when starting bgb. The other gave no warning but still wouldn't enter either game.

Well there on eBay for next to nothing since it only supported one Tony Hawk Game :P I'm still winning one on eBay for under £1 after 4 days so ya wouldn't be hard to acquire it to try it out, I Spose you could also maybe do Rumble Pack emulation for titles like Perfect Dark and Pokemon Pinball at some point too.

It would be extremely awesome to use some pre existing DS Option packs to give the emulation that bit closer to a true experience you would have had :)

As for MK I&II its not the biggest of worries since the normal non combo pack works and so it shouldn't be a large concern :)
 

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
It works !! It works !!

Sorry, I need to contain my excitement....;)
Yeah, I tried two games for now, Batman ( J) for GB, and R-Type DX for GBC.
They both run at steady, rock solid 60fps and I couldn't notice anything wrong with the timing, and I should know those games very, very well....
No sound though, but that was already explained.

What tricky games do you want me to test ?
Fire away........;)
But wait a second... sound should be working. I I re-enabled it.

Unless...

Does sleep mode work? Does the Y-button work when you set the control scheme to "B/Y"?

If not the arm7 crashed. Again.
 

Arm73

Well-Known Member
Member
Joined
Mar 4, 2006
Messages
2,046
Trophies
0
Location
Switzerland
XP
587
Country
Italy
Yep, no sound here ....

Y works fine when enabled.
Sleep mode also works.
I also enabled and disabled that Vblank option on a couple of games and I couldn't notice any difference in FPS, still rock solid 60 FPS.

A couple of games I tested ( just a minute each mind you ) :

Zelda Oracle of Season/Ages displays and plays normally at full speed.
So does Advenure Island GB, Blaster Master GBC, Bomb Jack GB, Ghost and Goblins GBC ans a few more I tried.
Tomb Rider GBC has garbled story telling static screens at start up ( I think I had that problem on my F2A cart on a real GBA with a GBA bridge too ) , but once the game stats , it runs full speed, while it used to leg on the F2A!
Robocop GBC seems to run fine but has some minor graphic glitches.
Robocop GB however, plays fine but you can't see the sprites on the screen.
I tried a few more and were mostly working, some with minor graphic glitches.
Cant comment on the audio unfortunately ...

By the way, do I need the gbc bios, and is it OK to place it in the games directory or does it need to be in the root of the card/ emulatro directory ?

EDIT:
More games I tried:
Super Mario Land, unfortunately red screen of death...
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
Country
Chile
uhm this may (not) be THAT useful but...

accesing from the gurus meditation there are troubles handling i/o on ARM7
(on the screens based off past users)

http://nocash.emubase.de/gbatek.htm#dsmemorymaps


04000000h ARM7-I/O Ports


so either the sent data (not palettes) since snailface disabled sound and shantae did run but fast, but sound handling is causing issues... if you send the same values[allocating sound registers, raw gb sounds] on a GBC emu (or any GBA emu that can interpret GBC sounds] are sounds working by sending the same values you're building on ARM7??

great work, and i'll try to help too.
 

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
Yep, no sound here ....

Y works fine when enabled.
Sleep mode also works.
I also enabled and disabled that Vblank option on a couple of games and I couldn't notice any difference in FPS, still rock solid 60 FPS.

A couple of games I tested ( just a minute each mind you ) :

Zelda Oracle of Season/Ages displays and plays normally at full speed.
So does Advenure Island GB, Blaster Master GBC, Bomb Jack GB, Ghost and Goblins GBC ans a few more I tried.
Tomb Rider GBC has garbled story telling static screens at start up ( I think I had that problem on my F2A cart on a real GBA with a GBA bridge too ) , but once the game stats , it runs full speed, while it used to leg on the F2A!
Robocop GBC seems to run fine but has some minor graphic glitches.
Robocop GB however, plays fine but you can't see the sprites on the screen.
I tried a few more and were mostly working, some with minor graphic glitches.
Cant comment on the audio unfortunately ...

By the way, do I need the gbc bios, and is it OK to place it in the games directory or does it need to be in the root of the card/ emulatro directory ?
Actually if you're using the bios, it needs to be in the same directory as your rom. But it's totally optional.

It's odd that there's no sound, even if the Y button is read correctly (indicating arm7 is alive). Just double-check that sound is enabled in the debug options... it should be by default.

There's one game I'd be interested to hear how it runs on a dsi, Alone in the Dark. Nebuleon's optimizations only increased its speed by 2FPS, for some reason, while most games went up much more. Be warned, the graphics are complete garbage in gameyob.
 

Kouen Hasuki

Coffee Addict
Member
Joined
Jan 9, 2013
Messages
1,387
Trophies
1
Age
40
Location
Behind you
XP
681
Country
Norway
Actually if you're using the bios, it needs to be in the same directory as your rom. But it's totally optional.

It's odd that there's no sound, even if the Y button is read correctly (indicating arm7 is alive). Just double-check that sound is enabled in the debug options... it should be by default.

There's one game I'd be interested to hear how it runs on a dsi, Alone in the Dark. Nebuleon's optimizations only increased its speed by 2FPS, for some reason, while most games went up much more. Be warned, the graphics are complete garbage in gameyob.

Perfect Dark is along the same level as Alone in the dark so there may be something those 2 roms do that others dont
 

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
uhm this may (not) be THAT useful but...

accesing from the gurus meditation there are troubles handling i/o on ARM7
(on the screens based off past users)

http://nocash.emubase.de/gbatek.htm#dsmemorymaps


04000000h ARM7-I/O Ports


so either the sent data (not palettes) since snailface disabled sound and shantae did run but fast, but sound handling is causing issues... if you send the same values[allocating sound registers, raw gb sounds] on a GBC emu (or any GBA emu that can interpret GBC sounds] are sounds working by sending the same values you're building on ARM7??

great work, and i'll try to help too.
I don't totally understand. I can't really interpret the output of a guru meditation error, just a few lines. Correct me if I'm wrong but aren't guru meditation errors about crashes on arm9, not arm7? I know there are potential issues with arm9 and arm7 communication, relating to sound. But can you explain how you interpreted the error screen? (in fact, which error screen?)
 

Deleted member 319809

MAH BOI/GURL
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
a) Thanks again Nebuleon! It's possible I'm doing some things completely wrong with sound, and most games just don't care because they don't read sound registers. But I don't think these are causing most audio issues, most of them appeared when I ported it to the ds. And wow, the cgb sound test does fail horribly. It doesn't even stop when it's supposed to!

b) It's probably not so important to emulate the pointless bugs in the gameboy hardware. Except maybe the halt bug, perhaps a few games require it.

c) And, sure, you can mention bugs or inaccuracies on github's tracking system. It'd be helpful to have them all in one place.
a) Maybe you tore down too much code when you made the DS version from the PC version; it'd be wise to look at what you tore down and re-add some of the code. Though I know that using the ARM7's PSG channels will be much faster than rendering everything as PCM sound, plus using the PSG means that the FPS can drop and the sound will just slow down in sync.

b) Alright. (And maybe the sprite count limit too!)

c) Alright, I'll begin a compilation of bugs from this thread onto GitHub.
 

Arm73

Well-Known Member
Member
Joined
Mar 4, 2006
Messages
2,046
Trophies
0
Location
Switzerland
XP
587
Country
Italy
Actually if you're using the bios, it needs to be in the same directory as your rom. But it's totally optional.

It's odd that there's no sound, even if the Y button is read correctly (indicating arm7 is alive). Just double-check that sound is enabled in the debug options... it should be by default.

There's one game I'd be interested to hear how it runs on a dsi, Alone in the Dark. Nebuleon's optimizations only increased its speed by 2FPS, for some reason, while most games went up much more. Be warned, the graphics are complete garbage in gameyob.

Yep, the sound is enabled, but I don't hear nothing.
All the channels are enables as well. I tried with and without headphones for what it worth.

Now the games:
Alone in the dark has garbled intro screens and menu ( just like Tomb Raider ) and according to the emulator runs at 28 - 30 fps during those selections.
Once the game starts, it still has garbled background graphics, but the main sprite looks OK and the framerate is loked at 30 fps.

Perfect dark on the other hand, has normal looking graphics ( from what I can tell, never played it before on the GBC ) and it runs steady at 30 fps, but it seems really slow, maybe the game is slow to begin with ?

As before, I can't comment on the audio.
Hope it helps.
 

nl255

Well-Known Member
Member
Joined
Apr 9, 2004
Messages
3,004
Trophies
2
XP
2,816
Country
General question. Is it necessary for the header checksum to be correct like it is on the Genesis even for things like translation patches? I know on the SNES it is considered best practice to just leave the checksum as it is and let it be bad rather than correct it.
 

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
Yep, the sound is enabled, but I don't hear nothing.
All the channels are enables as well. I tried with and without headphones for what it worth.

Now the games:
Alone in the dark has garbled intro screens and menu ( just like Tomb Raider ) and according to the emulator runs at 28 - 30 fps during those selections.
Once the game starts, it still has garbled background graphics, but the main sprite looks OK and the framerate is loked at 30 fps.

Perfect dark on the other hand, has normal looking graphics ( from what I can tell, never played it before on the GBC ) and it runs steady at 30 fps, but it seems really slow, maybe the game is slow to begin with ?

As before, I can't comment on the audio.
Hope it helps.
I'm thinking I'll have to overhaul a lot of my sound code, due to arm7 crashing issues, and Pikachu's cry. Hopefully sound will work then. In the meantime, the latest builds should work for dsi users now... at least, they shouldn't crash.
General question. Is it necessary for the header checksum to be correct like it is on the Genesis even for things like translation patches? I know on the SNES it is considered best practice to just leave the checksum as it is and let it be bad rather than correct it.
It will not run on a real gameboy if the header checksum is incorrect. In fact, if you're using the gameboy color bios, it will refuse to run even in an emulator. So it's better to correct it. But unless the hack increases the size of the rom or something, the header probably doesn't need to change. The rom checksum is another story, a gameboy doesn't care about that.
 

nl255

Well-Known Member
Member
Joined
Apr 9, 2004
Messages
3,004
Trophies
2
XP
2,816
Country
It will not run on a real gameboy if the header checksum is incorrect. In fact, if you're using the gameboy color bios, it will refuse to run even in an emulator. So it's better to correct it. But unless the hack increases the size of the rom or something, the header probably doesn't need to change. The rom checksum is another story, a gameboy doesn't care about that.

Ok, because the Genesis apparently does care about the rom checksum and Gens even has an auto correct checksum feature just for that. I wasn't sure if the gameboy cared or not.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: Now go take a shower @BakerMan . Phew +1