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 development > DS(i) GBA Emulator

#164896 - cboomf_ - Sun Nov 30, 2008 10:26 am

Now that we know the DSi doesn't have a gba slot, could work begin on producng a GBA emulator to run .gba games from slot-1...

I know that DSi currenty cant run homebrew but eventually, it will inevitably run homebrew, so is it worth starting now then modifying later to run on DSi hardware/flash carts ....
_________________
M3 Simply - 1GB SanDisk
Flashme'd DS

#164897 - Dwedit - Sun Nov 30, 2008 10:36 am

It's not so much writing an emulator, more of writing a relocator. Really hard to tell what is code and what is data, and properly relocate the binary.
Then there would be some difficult patching, and then it may possibly work with no sound.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#164898 - cboomf_ - Sun Nov 30, 2008 1:59 pm

I was thinking how about extending lameboy/goomba colour ...
_________________
M3 Simply - 1GB SanDisk
Flashme'd DS

#164906 - DiscoStew - Sun Nov 30, 2008 7:19 pm

Excluding the fact that this could be for running pirated commercial games......


Even if a GBA emulator (or even loading GBA games via the slot-1, and changing to GBA mode if it still exists), wouldn't the access time and read speed on the cards and main RAM be a major problem in getting this to work since they are somewhat slower than GBA carts?
_________________
DS - It's all about DiscoStew

#164909 - silent_code - Sun Nov 30, 2008 8:17 pm

cboomf_ wrote:
I was thinking how about extending lameboy/goomba colour ...

Because they emulate a totally different architecture (Z80?) from the GBA?

I'd said it in the past and I'll say it again: People should try to make the hardware run GBA homebrew from slot 1, using the native hardware that is already available.

Although, I don't have any info about the DSi's GBA (non-)"compatibility."
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#164933 - Apache Thunder - Wed Dec 03, 2008 5:50 am

Perhaps the DSi will give the DS programmers out there a good reason to try a GBA Emulator since the first DS's had the GBA slot, so coders didn't feel the need to do it even though it could probably be done.

Once they find a way past the fact that the entire rom can't be executed directly from the card (since Slot-1 cards don't have their own ram), then the rest should be pretty easy.

The DSi has more internal ram and perhaps a few undiscovered features, so it may turn out that the DSi can have GBA stuff run from Slot-1, but would not work on the standard DS's without some kind of GBA slot expansion pack which would defeat the purpose of doing it on the DS anyway. Of coarse if they find a way of booting GBA from the SD slot, then it won't bear any similarity to a standard DS version.

I look forward to it, as I don't own a GBA flashcart, so Slot-1 would be the only option for me.
_________________
Sig under construction...Please check back after the sun explodes....

#164950 - silent_code - Wed Dec 03, 2008 10:53 pm

Just a thought: What are the odds (I don't know this) of the DSi not having a GBA BIOS anymore?
That's a delicate matter.

Shouldn't it be possible to write a virtual virtual (yes, there's two of them) memory module that dynamically pages data from the ROM file to the RAM and runs the code from there?

Although I know the theory (and practical basics), I can't tell whether this can be efficiently (so it's usable) done on the NDS hardware or not. That's not much of my area of interest, you should know. ;^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#165024 - M3d10n - Sat Dec 06, 2008 11:13 pm

A crazy approach would load the GBA roms into the RAM (the DSi has 16MBs of RAM, right?). Few GBA games cross the 16MB barrier, and full 16MB games could be done by keeping the emulator code in unused VRAM banks.

#165037 - DiscoStew - Sun Dec 07, 2008 5:20 am

Most GBA games shown as 16MB don't exactly take up that much. That's just how much space is on the chip that the ROM is stored on. Trimming them would help free space up.
_________________
DS - It's all about DiscoStew

#165085 - Chase-san - Tue Dec 09, 2008 2:49 pm

Would probably have to make some kind of pagefile on the cart, but it would be very slow, and most games probably wouldn't run at full speed because of it.

#165114 - tepples - Wed Dec 10, 2008 4:10 am

I would imagine that DSi RAM covers 0x02000000 through 0x02FFFFFF. But a 16 MB GBA game that has been trimmed to 15 MB expects to cover 0x08000000 through 0x08EFFFFF. Your virtualizer would need to at least
  • rewrite all ROM addresses from 0x08000000 to 0x02100000 somehow
  • emulate the entire GBC and GBA audio system
  • translate writes to graphics mode registers (DISPCNT, BGCTRL[])
  • change all scroll values (BG_OFFSET[], BG2PA, etc.) so that the 240x160px GBA screen is centered in the 256x192px DS screen; this also involves trapping HDMAs
  • translate writes to DMA registers
  • trap all interrupts

_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#165120 - elwing - Wed Dec 10, 2008 7:48 am

it should be somehow easyer if you forget about the sound hardware at first, no? it seems to be the worst part...

#165142 - silent_code - Wed Dec 10, 2008 9:12 pm

I wonder how much of the old hardware (read: GBA) is still intact and usable on the DSi? Well, I guess we'll have to wait for the world wide release in order to find out via reverse engineering and trial and error. :^)

Btw.: Who knows what is mapped to the previously slot 2 memory area on the DSi?

Why would the sound hardware have to be emulated? Is it that different from the NDS'? Did the NDS' prior to the DSi have a special compatibility sound chip for GBA games on board?
This is only speculation, but I don't think that the whole compatibility was nuked...

This is definitely an interesting topic! :^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#165147 - Normmatt - Wed Dec 10, 2008 10:20 pm

silent_code wrote:
I wonder how much of the old hardware (read: GBA) is still intact and usable on the DSi? Well, I guess we'll have to wait for the world wide release in order to find out via reverse engineering and trial and error. :^)

Btw.: Who knows what is mapped to the previously slot 2 memory area on the DSi?

Why would the sound hardware have to be emulated? Is it that different from the NDS'? Did the NDS' prior to the DSi have a special compatibility sound chip for GBA games on board?
This is only speculation, but I don't think that the whole compatibility was nuked...

This is definitely an interesting topic! :^)


The DS had the GBA hardware inside it aswell as the NDS hardware.

#165148 - DiscoStew - Wed Dec 10, 2008 10:32 pm

Normmatt wrote:
silent_code wrote:
I wonder how much of the old hardware (read: GBA) is still intact and usable on the DSi? Well, I guess we'll have to wait for the world wide release in order to find out via reverse engineering and trial and error. :^)

Btw.: Who knows what is mapped to the previously slot 2 memory area on the DSi?

Why would the sound hardware have to be emulated? Is it that different from the NDS'? Did the NDS' prior to the DSi have a special compatibility sound chip for GBA games on board?
This is only speculation, but I don't think that the whole compatibility was nuked...

This is definitely an interesting topic! :^)


The DS had the GBA hardware inside it aswell as the NDS hardware.


I think in specifics, it has many features that the GBA has, and the GBA compatibility mode sets up the NDS hardware to match those of the GBA imo, including using the NDS sound hardware to assign 2 digital channels + 4 analogue channels. But, I don't think we are talking about using that compatibility mode, even if it exists, because then it would set the hardware to match a GBA, including the RAM to 256KB + 32KB, when we want to fit upwards of 15MB into the 16MB RAM available.
_________________
DS - It's all about DiscoStew

#165187 - silent_code - Thu Dec 11, 2008 8:48 pm

Yeah, but if sound were "fead" through to the hardware (in NDS mode) through a "thin" software layer, it wouldn't be much hassle with converting and all after that.

@ Normmatt: Thanks, but I'm already aware of that. I was specifically asking about the sound hardware with the intention (although maybe not clear enough formulated) to find out how the compatibility mode is realized in hardware: anoth chip or through the NDS' chip.
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#165477 - M3d10n - Mon Dec 22, 2008 4:41 pm

Chase-san wrote:
Would probably have to make some kind of pagefile on the cart, but it would be very slow, and most games probably wouldn't run at full speed because of it.

The DS NeoGeo emulator does exactly that and it runs games several times bigger than the DS RAM, at full speed or very close to for most games.

#165492 - wintermute - Tue Dec 23, 2008 2:18 am

The DSi already has GBA emulation. Certain things also lead me to believe that Nintendo intend to offer GBA games via the DSi download service.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#165496 - HyperHacker - Tue Dec 23, 2008 4:58 am

M3d10n wrote:
Chase-san wrote:
Would probably have to make some kind of pagefile on the cart, but it would be very slow, and most games probably wouldn't run at full speed because of it.

The DS NeoGeo emulator does exactly that and it runs games several times bigger than the DS RAM, at full speed or very close to for most games.
The GBAMP version of Goomba Color also does this for GBC games, paging the ROM from the CF card. It's a bit slow for some games, but it manages to run a 2MB ROM with nothing but 256K of RAM.
_________________
I'm a PSP hacker now, but I still <3 DS.

#165514 - silent_code - Wed Dec 24, 2008 1:55 am

wintermute wrote:
The DSi already has GBA emulation. Certain things also lead me to believe that Nintendo intend to offer GBA games via the DSi download service.

> MORE INPUT
> ?
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#165521 - Wuschmaster - Wed Dec 24, 2008 1:12 pm

wintermute wrote:
The DSi already has GBA emulation. Certain things also lead me to believe that Nintendo intend to offer GBA games via the DSi download service.
That sounds very unlikely...