gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Misc > Will we ever see a GBA emulator?

#97418 - Dan2552 - Wed Aug 09, 2006 5:27 pm

I know this kind of thing easily attracts pirates :( but also It would allow users using GBAMP to play full sized GBA homebrew - I'd love to be able to play luminesweeper with music.

Also If such a thing were made, would it be possible to speed boost by using the DS' ARM9? That would be ultra cool, especially for those RPGs with really long chats and battles..

Maybe to prevent piracy, have some sort of protection for if the rom is commercial, it tries to read the slot for the official cart? (eg, load the emulator, cart switch to GBA game, play GBA game with cool features like savestates, speed boosts etc?)

I may be dreaming would this would be incredibly cool. With it, wouldn't it also GBAMP users to use goomba color with the right speed? Goomba color lags like hell on GBAMP.

Sorry if this isn't the right forum for this, but I think it is... because I'm suggesting anti-piracy methods for it, although I can imagine someone replying saying 'that'd be too easy to crack' :(

#97419 - knight0fdragon - Wed Aug 09, 2006 5:33 pm

cart swapping gba games tends to turn the ds off
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206

#97420 - outphase - Wed Aug 09, 2006 5:33 pm

If the GBAMP lags when running Goomba Color natively, how would it speed up when emulated? Emulation requires somewhere about 5x (maybe 10x) the processing power to emulate well.

#97421 - knight0fdragon - Wed Aug 09, 2006 5:36 pm

goomba color is in GBA mode, and it is still an "alpha"
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206

#97423 - Dan2552 - Wed Aug 09, 2006 5:51 pm

outphase wrote:
If the GBAMP lags when running Goomba Color natively, how would it speed up when emulated? Emulation requires somewhere about 5x (maybe 10x) the processing power to emulate well.


why, if it has the proper GBA processor to work on? And with the NDS processor as an extra, surely it can speed things up? (let alone 4MB RAM)


Last edited by Dan2552 on Wed Aug 09, 2006 5:54 pm; edited 2 times in total

#97424 - Snowy? - Wed Aug 09, 2006 5:52 pm

Arm9 emulating Arm7
Maybe they could add GBA connect over wifi too :) I bet it's not possiable for some technical reason

#97425 - Dan2552 - Wed Aug 09, 2006 5:57 pm

The point is DS-mode has access to both CPUs.

in theory, it could run the normal GBA stuff with the ARM7 CPU, and extras using the ARM9.

The lag in Goomba color caused by RAM limits - DS has 4 MB, while GBA had what? ~256kb?

#97428 - MaHe - Wed Aug 09, 2006 6:25 pm

Dan2552 wrote:
in theory, it could run the normal GBA stuff with the ARM7 CPU, and extras using the ARM9.

I was thinking about that too. This way, it wouldn't even be a real emulator, because it wouldn't emulate anything - however, we must consider that ARM7 also handles the touchscreen & some other functions of DS' hardware not implemented in Game Boy Advance, so this may lag or disable the 'normal GBA stuff' only running in ARM7. On the other side, if this COULD be implemented this way, we could emulate another GBA on ARM9 (using the same ROM image / GBA cartridge, but a different 'state), not displaying anything, but just running in the background and swapping the keypresses with another DS using the very same emulator. This would work in most of the cases, since most of the games connected in GBA Link mode are the same (Mario Kart <-> Mario Kart), or at least similar (LeafGreen <-> FireRed), though some aren't (LeafGreen <-> Emerald). So what could we benefit from such an emulator?

- running GBA homebrew from any device, even SLOT-1 based ones;
- connecting the official GBA games in a 2-player Link mode;
- 'save state' functions;
- easier GBA debugging;
- etc.
_________________
[ Crimson and Black Nintendo DS Lite | CycloDS Evolution | EZ-Flash 3-in-1 | 1 GB Transcend microSD ]

#97431 - tepples - Wed Aug 09, 2006 6:40 pm

Dan2552 wrote:
The point is DS-mode has access to both CPUs.

But in DS mode, the ARM7 doesn't have access to the video chip, and neither has access to the GBA sound chip. Those would have to be mapped onto the DS sound hardware somehow. In addition, every access to GBA ROM would have to be virtualized, and that takes a long time, especially if a program is streaming Thumb instructions from GBA ROM.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#97441 - Dan2552 - Wed Aug 09, 2006 7:48 pm

tepples wrote:
Dan2552 wrote:
The point is DS-mode has access to both CPUs.

But in DS mode, the ARM7 doesn't have access to the video chip, and neither has access to the GBA sound chip. Those would have to be mapped onto the DS sound hardware somehow.

That causes a problem... Is there any method where ARM7 sends the picture to ARM9? (I don't know anything about the CPUs or anything to be honest) No-Sound wouldn't be too much of a problem, for at least the 1st few versions.

Quote:
In addition, every access to GBA ROM would have to be virtualized, and that takes a long time, especially if a program is streaming Thumb instructions from GBA ROM.


Does this apply to just GBA ROMs, or GBA dumped ROMs (/homebrew), or both?

#97442 - MaHe - Wed Aug 09, 2006 8:01 pm

Dan2552 wrote:
Does this apply to just GBA ROMs, or GBA dumped ROMs (/homebrew), or both?
Both, as they're pretty much similar, contrary to NDS homebrew.
_________________
[ Crimson and Black Nintendo DS Lite | CycloDS Evolution | EZ-Flash 3-in-1 | 1 GB Transcend microSD ]

#97447 - HyperHacker - Wed Aug 09, 2006 8:57 pm

I think the best method would be dynamic recompilation on ARM9, with ARM7 handling emulator functions. It'd probably still be horribly slow, though.
_________________
I'm a PSP hacker now, but I still <3 DS.

#97468 - Snowy? - Thu Aug 10, 2006 12:03 am

I'll just ask a silly question...

How come the video has to be recompiled are there two different instruction sets between DS & GBA mode? (I would imagine there maybe extra instruction sets for DS mode???)

Are the sound instructions the same? (completly new set?)
Kinda seems silly for Nintendo to put 2 separate sound chips on there and make only one usuable per time, but maybe they couldn't design an upgraded GBA chip??? (Wow it would of been cool if they had redirected it to the earphone socket in DS mode for other sounds during gameplay lol)

Oh and these Modes are all hardware based right? possiable hardware mod? (adds GBA link play via wireless & button remapping - lol)

One last question Tepples you said
Quote:
every access to GBA ROM would have to be virtualized

Is this just because it is running from the GBA slot? Would access from the DS slot need the same?

Could you not just have the Arm7 running GBA and the Arm9 intercepting and redirecting sound/video requests?

Wait a min okay shot in the dark (as I know - not much lol) could the GBA code be prebuffered into the DS's extra memory and rewritten where necessary to redirect the output?

#97503 - tepples - Thu Aug 10, 2006 5:00 am

Snowy? wrote:
How come the video has to be recompiled are there two different instruction sets between DS & GBA mode? (I would imagine there maybe extra instruction sets for DS mode???)

Only the ARM9 chip has access to the DS video registers, and only the ARM7 chip has access to the DS audio registers. If the ARM7 attempts to write to the DS video registers, it will hit only dead air. If the ARM9 attempts to write to the DS audio registers, it will hit only dead air.

Quote:
Are the sound instructions the same? (completly new set?)

It's a completely new set of audio registers.

Quote:
Kinda seems silly for Nintendo to put 2 separate sound chips on there and make only one usuable per time, but maybe they couldn't design an upgraded GBA chip???

Remember that the GBA sound chip also contains the Game Boy sound chip from 1989.

Quote:
(Wow it would of been cool if they had redirected it to the earphone socket in DS mode for other sounds during gameplay lol)

You've been reading too many Wii-views ;-)

Quote:
One last question Tepples you said
Quote:
every access to GBA ROM would have to be virtualized

Is this just because it is running from the GBA slot? Would access from the DS slot need the same?

The DS slot and the GBAMP CF slot are block devices. It's designed to be read in 512-byte blocks, where time to start reading a block can be arbitrarily slow. The GBA slot, on the other hand, is a word addressed device, designed to be read really damn quick in 2-byte units.

Quote:
Could you not just have the Arm7 running GBA and the Arm9 intercepting and redirecting sound/video requests?

Intercepting? How?

Quote:
Wait a min okay shot in the dark (as I know - not much lol) could the GBA code be prebuffered into the DS's extra memory and rewritten where necessary to redirect the output?

Every pointer would need to be rewritten to point into DS EWRAM, and that's highly non-trivial. Look at self-modifying code, and look at the common ARM idiom of building up large constants (such as pointers) with ORs and shifts.

Bottom line: It could be done by a team of dedicated, experienced, highly paid professionals. Don't count on volunteers to produce anything before the post-DS handheld comes out.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#97559 - Darkflame - Thu Aug 10, 2006 1:21 pm

Quote:
there where many people in the Emu forums that were coming up with all kind of silly reasons why emulating GBA on DS is impossible. 32-Bit 66 mhz ARM9 processor that DS has is not powerful enough to emulate 32-Bit CPU 16.7mh ARM7 CPU of GBA - WRONG.
- Loopy

ok,ok, I paraphrased a bit ;)

Seriously, of course its possible, you just need a codeing genius with spare time...unfortuntely they are in short supply.

And, personaly, Id rather they spent their time on other things.
(like doing the last 1% needed to make NesDS perfect)
_________________
Darkflames Reviews --
Make your own at;
Rateoholic:Reviews for anything, by anyone.

#97792 - sonic-nkt - Fri Aug 11, 2006 3:29 pm

isnt the arm7 and arm9 binary compatible, i remember a gp32 project called gpadvance, it was a gba emu that didnt emulate the arm7 but executed the code directly on the arm9, the rest of the gba hardware was emulated...
couldnt something like this also used on the DS?
the only thing i would like to see a gba emu on the ds would be wlan multiplayer, but i dont know if the gbas wlan is fast enough for this.


PS: gpdvance was never completed, but the code is on sourceforge

#97900 - octopusfluff - Sat Aug 12, 2006 8:17 am

This has come up a few times.
The bandwidth is there, but 802.11b cannot guarantee latency low enough stay within tolerance of the GBA networking requirements.

ASSUMING that you could work past the whole issue of getting a GBA game to run in NDS mode, via whatever technique suits your fancy, at best networking would work sometimes or for some games.. at worst, it would never synchronize, or immediately desynchronize.. or slow down 'emulation' (or virtualization, or whatever) to the point of unplayable.

VBA-link is intended to be used over lan, not wan, and it still has to force slowdown to maintain synchronization sometimes even on a lan.

#97933 - Darkflame - Sat Aug 12, 2006 12:05 pm

Dual emulation is needed on both systems, which is safe to say beyond doing on the nds well enough.
_________________
Darkflames Reviews --
Make your own at;
Rateoholic:Reviews for anything, by anyone.