Homebrew Emulation GameYob, a gameboy emulator for DS

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
Also I found bug: roms colored with GameBoy Colorizer don't work.
Which roms did you try? I tried the colorized Super Mario Land and it worked fine - at least, as well as it did on bgb, with a lot of colorization lag... however it's come to my attention that there are some bugs which can occur when switching roms. So try making the colorized game the first one you load after starting gameyob.

About NiFi. I wrote a little test rom which sends the string "Awesome Possum" through the link port. It works consistently in tgb dual, and in gameyob it sometimes works, but often some of the letters don't make it through. That seems consistent with what's happening in Pokemon. While the other ds is receiving the letters, it doesn't receive them at the appropriate time... that is, the receiving ds hasn't had the time to emulate the preparations for transfer by the time a transfer is requested. Or something like that.
Also, sometimes they stop communicating entirely... perhaps the "transfer finished" signals aren't emulated for some reason?
And lastly, my dsi will often stop transmitting for no apparent reason. The debug output says data is being sent, but the wifi light doesn't flash, and the data isn't received on the other end. This never seems to happen on my ds phat...

But on the bright side, Tetris is working almost consistently. It's constantly transmitting the same information over and over so I guess a few slip-ups by the emulator are permissible.
 

Deleted member 319809

MAH BOI/GURL
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
[Givens of this post: The GB serial read/write register is FF01, the serial control register is FF02.]

Then you might need a way to tell the other DS at which cycle each byte was transmitted, so that reading from FF01 returns nothing until that cycle. What becomes problematic is that the other DS needs to "stop" when the Game Boy reads from the link cable, in case a packet will arrive for that cycle in the near future.

You'd need to introduce some rigorous timing in the link cable stuff when writing to FF01: wrap each byte in a NiFi packet and replay it exactly when the external-clock Game Boy would expect it. Example protocol: DS A -> DS B [<Variable-length integer: Cycle at which the byte has been sent> <Byte sent>]

And then you'd need to pause the external-clock Game Boy when it uses FF02, and wait for the NiFi packet to arrive. And then discard any bytes that were sent at least 8 bits too early and continue pausing, because those are already read.
 

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
[Givens of this post: The GB serial read/write register is FF01, the serial control register is FF02.]

Then you might need a way to tell the other DS at which cycle each byte was transmitted, so that reading from FF01 returns nothing until that cycle. What becomes problematic is that the other DS needs to "stop" when the Game Boy reads from the link cable, in case a packet will arrive for that cycle in the near future.

You'd need to introduce some rigorous timing in the link cable stuff when writing to FF01: wrap each byte in a NiFi packet and replay it exactly when the external-clock Game Boy would expect it. Example protocol: DS A -> DS B [<Variable-length integer: Cycle at which the byte has been sent> <Byte sent>]

And then you'd need to pause the external-clock Game Boy when it uses FF02, and wait for the NiFi packet to arrive. And then discard any bytes that were sent at least 8 bits too early and continue pausing, because those are already read.
Thanks for your insight. Synchronizing clock cycles through nifi across 2 emulated gameboys is... rather complicated. I gave it a try today, and it didn't end well. I'd need to find a more flexible way to count clock cycles than just counting from the beginning - the 2 ds's can be desynchronized too easily. Maybe I'll try again, but I've been tackling this nifi stuff for the past few days and I've just about run out of steam. I'll probably come back to it later, but for now I'm going to wrap up what I have working and merge it into the master branch so I can get back to various other things. Enjoy your multiplayer Tetris and Dr. Mario.
 

Deleted member 319809

MAH BOI/GURL
Member
Joined
Dec 22, 2012
Messages
900
Trophies
0
XP
461
Country
Canada
I guess it does have the potential to desync really bad, if the lag between the two GameYobs is different (for example, a player with 0.2 playing against one with a later version with more optimisations) then they won't skip the same frames at all. You could add both "rough timing" and rigorous timing for that case. Consider that one version is always ahead of the other or exactly in sync; you would then need one packet per second with the FPS emulated during it, so that the other one can slow itself down artificially to match. Pauses (menu entry) and resumes (menu exit) can also be broadcast for the other GB to pause and resume.

Also assume that, if the Game Boy didn't need to send or receive data during a frame, then the other Game Boy won't need the sync to be perfect, and if DS A is ahead by 1-3 frames when its Game Boy WRITES to the cable, then it will pause until DS B has caught up and is on the same frame to read the data. Similar when reading: DS A is ahead, and its Game Boy READS from the cable and finds nothing, so it pauses until DS B has caught up and is on the correct frame to write.

Perhaps Tetris and Dr. Mario need less rigo(u)r. In any case, thanks!
 

lps

man with no face
Newcomer
Joined
Sep 13, 2009
Messages
55
Trophies
1
Location
Crimea, UA
Website
tagteam.ru
XP
335
Country
try L+R+start+select.
This combination for soft-reset works fine in NesDS, but gameyob goes to error:
gyoberror.jpg

Which roms did you try? I tried the colorized Super Mario Land and it worked fine - at least, as well as it did on bgb, with a lot of colorization lag... however it's come to my attention that there are some bugs which can occur when switching roms. So try making the colorized game the first one you load after starting gameyob.
i'm try colored Metroid II from romhacking.net
 

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
This combination for soft-reset works fine in NesDS, but gameyob goes to error:
gyoberror.jpg


i'm try colored Metroid II from romhacking.net
Oh dear. Can you tell me what exact version you're using which caused that crash? For me, L+R+Start+Select just turns the ds off.

And I see that colorized metroid 2 doesn't work. However in both visualboyadvance and bgb it had severe colorization errors in the background, so maybe my rom is unclean? But in any case it shouldn't be crashing. I will investigate.
 

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
I know I said I was done with nifi, but while I was wrapping up what I had I noticed that a severe problem, maybe the main problem, is a lot more basic than I thought. That is, some of the packets just aren't received by the other ds. A disturbingly high number of them. Or maybe they're just not being sent, even though the Wifi_RawTxFrame function is definitely being called. I know this is contrary to what I thought a few posts ago... I guess I was wrong when I said the missing letters (in the case of my test rom) were being received, but not parsed properly. They're not received at all. Maybe wireless just isn't as reliable as cable? Perhaps some redundant packets would help. I think the pokemon games would work if I fixed this.
 

Matando

Active Member
Newcomer
Joined
Oct 14, 2008
Messages
35
Trophies
0
XP
220
Country
United States
When Launching any rom I get a Guru Meditation Error...

Rom in this example was Pokemon Yellow... latest built revision as of this post.

Boot Sequence DSi Menu -> Sudokuhax -> hbmenu -> GameYob

Picture of error:
20130310235026499.jpg
Not Sure if I'm the only one testing with as DSi.... But I hope not :)
 
  • Like
Reactions: Snailface

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
When Launching any rom I get a Guru Meditation Error...

Rom in this example was Pokemon Yellow... latest built revision as of this post.

Boot Sequence DSi Menu -> Sudokuhax -> hbmenu -> GameYob

Picture of error:
20130310235026499.jpg
Not Sure if I'm the only one testing with as DSi.... But I hope not :)
SodukuHax user as well. All the ROMS I run get that same error with the same program counter, FFFF0260.
Seems like something a simple adjustment could fix but I could be wrong.
 
  • Like
Reactions: Matando

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
I tried nifi with redundant transmissions. It didn't really help. Some signals still just aren't received even if I send them 3 times... Pokemon will usually at least get into the trade screen, but looking at the other player's pokemon in detail, often their names aren't complete or stats are glitched. Battles are basically the same.

And sudokuhax users... I don't have a clue what the problem is. If one of you is willing to be a guinea-pig, tomorrow I'll cook up a version which goes through the process of loading a rom step by step so you can tell me when it crashes. If not there are a few other people I can ask.
 

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
I tried nifi with redundant transmissions. It didn't really help. Some signals still just aren't received even if I send them 3 times... Pokemon will usually at least get into the trade screen, but looking at the other player's pokemon in detail, often their names aren't complete or stats are glitched. Battles are basically the same.

And sudokuhax users... I don't have a clue what the problem is. If one of you is willing to be a guinea-pig, tomorrow I'll cook up a version which goes through the process of loading a rom step by step so you can tell me when it crashes. If not there are a few other people I can ask.
Ready to go.

Spring break, got all the time in the world. ^^ (thanks btw)
 
  • Like
Reactions: Rydian

Matando

Active Member
Newcomer
Joined
Oct 14, 2008
Messages
35
Trophies
0
XP
220
Country
United States
I tried nifi with redundant transmissions. It didn't really help. Some signals still just aren't received even if I send them 3 times... Pokemon will usually at least get into the trade screen, but looking at the other player's pokemon in detail, often their names aren't complete or stats are glitched. Battles are basically the same.

And sudokuhax users... I don't have a clue what the problem is. If one of you is willing to be a guinea-pig, tomorrow I'll cook up a version which goes through the process of loading a rom step by step so you can tell me when it crashes. If not there are a few other people I can ask.

Don't mind being a guinea-pig, actually I would love to help figure out the problem :)
 

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
I just need a few things cleared up. Does sudokuhax support dldi by reading from the sd card? Or do I need to code that myself? Are you selecting games with argument loading or through gameyob's file selector?
 

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
I'm use v0.2 from filetrip
Metroid II color is working now. There were 2 rather serious bugs in early gameboy games which use more than 32 rom banks.

NiFi branch is merged into master. The last little hack I added in was that, when a ds times out while waiting for a response, it sends the signal again. It gives up on the next timeout if no signal is received. Pokemon is working decently, but make sure to check the pokemon's stats before trading. But then again, my caterpie with 255 defense (perhaps more) is pretty cool.
 
  • Like
Reactions: Geren

Arm73

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

I'm trying to run gameyob on my sudokuhaxed DSiXL, but I skipped the HB Channel altogether, renamed gameyob to boot.nds and placed it on the root of my SD card.
The emulator starts, and I get to browse the folders on the SD card and choose which roms to load, but when I try to actually load something I get a very similar screen to this, only with different numbers ( pc: FFFF0260 addr FFFF0260.
The game I tried was GB Batman ( J) by Sunsoft.
 

Drenn

Well-Known Member
OP
Member
Joined
Feb 22, 2013
Messages
574
Trophies
0
XP
696
Country
Canada
I'm trying to run gameyob on my sudokuhaxed DSiXL, but I skipped the HB Channel altogether, renamed gameyob to boot.nds and placed it on the root of my SD card.
The emulator starts, and I get to browse the folders on the SD card and choose which roms to load, but when I try to actually load something I get a very similar screen to this, only with different numbers ( pc: FFFF0260 addr FFFF0260.
The game I tried was GB Batman ( J) by Sunsoft.
lps wasn't using dsi-mode, your error is actually the same as matando's. Anyway, like I said yesterday I made a test version which goes through each step of loading a rom. If you could try it out that would be great. Download it here. Press A to proceed whenever it pauses.

Edit: Also I disabled sound for good measure since it was causing problems before. If sound caused the crash then it should run anyway.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: I really don't want to buy this fap tab...