Homebrew gbaemu4ds: GBA emulator for DS(i) (DSi Entry)

Is the graphic better if you use the sc Version and the upper screen on a 3DS

  • I can't do that (have no 3DS) (have not tested that)

    Votes: 110 40.3%
  • Yes

    Votes: 48 17.6%
  • No

    Votes: 26 9.5%
  • I don't know

    Votes: 89 32.6%

  • Total voters
    273

ipwndeveloper

Well-Known Member
Member
Joined
Jun 3, 2013
Messages
276
Trophies
0
Age
35
Location
San Fransisco, CA
Website
gb4iphone.x10.mx
XP
189
Country
United States
5 Months... If I knew anything about making Hypervisors and GBA Opcodes I would step up to help, but going through the source code it appears that a lot of the code is in ARM Assembly and I have little experience in DS Low level programming. But I do hope this project stays alive for a good long while or at least a few more significant updates.
 

ichichfly

Well-Known Member
OP
Member
Joined
Sep 23, 2009
Messages
619
Trophies
1
XP
1,075
Country
Gambia, The
5 Months... If I knew anything about making Hypervisors and GBA Opcodes I would step up to help, but going through the source code it appears that a lot of the code is in ARM Assembly and I have little experience in DS Low level programming. But I do hope this project stays alive for a good long while or at least a few more significant updates.
The only code that is in asm is the part for the thumb emulation and the low level stuff(interrupt handler, swi replacement, wrapper for some mcr cmds, some mem copy routine (faster) and the sp initializer) the rest is to check what the C code result in and see if there is a way to make the emulator faster.
if you have any Questions about the DS hardware or internal working of my code just ask I will try to help you
 

nl255

Well-Known Member
Member
Joined
Apr 9, 2004
Messages
3,000
Trophies
2
XP
2,791
Country
The only code that is in asm is the part for the thumb emulation and the low level stuff(interrupt handler, swi replacement, wrapper for some mcr cmds, some mem copy routine (faster) and the sp initializer) the rest is to check what the C code result in and see if there is a way to make the emulator faster.
if you have any Questions about the DS hardware or internal working of my code just ask I will try to help you

I have a feeling the questions are more basic things such as how does a hypervisor for a system without a MMU work in the first place?
 

Warioss

Member
Newcomer
Joined
Nov 3, 2012
Messages
9
Trophies
0
Age
33
XP
63
Country
Italy
You know how you select an IRQ type, like "advirqsound"? Well, to enable scaling, select the "sc" versions; e.g. "advirqsoundsc".
Thank u soo much!!! with the "sc" versions I've resolved the tilest's problem. But ... now I've another question: Can I also play with "hack rom pokemon" with this emulator? Because when I put a hack rom the emulator gives to me strange errors ...
 

Fishaman P

Speedrunner
Member
Joined
Jan 2, 2010
Messages
3,322
Trophies
1
Location
Wisconsin
Website
twitch.tv
XP
2,185
Country
United States
Thank u soo much!!! with the "sc" versions I've resolved the tilest's problem. But ... now I've another question: Can I also play with "hack rom pokemon" with this emulator? Because when I put a hack rom the emulator gives to me strange errors ...
Apparently, most hacks won't work. This is because they use new areas of RAM that the emulator can't handle properly.
Now, if you were to try something like a ROM randomizer, I would be willing to bet that would work.
 

ichichfly

Well-Known Member
OP
Member
Joined
Sep 23, 2009
Messages
619
Trophies
1
XP
1,075
Country
Gambia, The
I have a feeling the questions are more basic things such as how does a hypervisor for a system without a MMU work in the first place?
That is simple we only emulate parts of the memory range

This is the
GBA Memory Map
General Internal Memory
00000000-00003FFF BIOS - System ROM (16 KBytes)
00004000-01FFFFFF Not used
02000000-0203FFFF WRAM - On-board Work RAM (256 KBytes) 2 Wait
02040000-02FFFFFF Not used
03000000-03007FFF WRAM - On-chip Work RAM (32 KBytes)
03008000-03FFFFFF Not used
04000000-040003FE I/O Registers
04000400-04FFFFFF Not used
Internal Display Memory
05000000-050003FF BG/OBJ Palette RAM (1 Kbyte)
05000400-05FFFFFF Not used
06000000-06017FFF VRAM - Video RAM (96 KBytes)
06018000-06FFFFFF Not used
07000000-070003FF OAM - OBJ Attributes (1 Kbyte)
07000400-07FFFFFF Not used
External Memory (Game Pak)
08000000-09FFFFFF Game Pak ROM/FlashROM (max 32MB) - Wait State 0
0A000000-0BFFFFFF Game Pak ROM/FlashROM (max 32MB) - Wait State 1
0C000000-0DFFFFFF Game Pak ROM/FlashROM (max 32MB) - Wait State 2
0E000000-0E00FFFF Game Pak SRAM (max 64 KBytes) - 8bit Bus width
0E010000-0FFFFFFF Not used
Unused Memory Area
10000000-FFFFFFFF Not used (upper 4bits of address bus unused)


and the DS arm9 (this is where the emulator runs)

NDS9 Memory Map
00000000h Instruction TCM (32KB) (not moveable) (mirror-able to 1000000h)
0xxxx000h Data TCM (16KB) (moveable)
02000000h Main Memory (4MB)
03000000h Shared WRAM (0KB, 16KB, or 32KB can be allocated to ARM9)
04000000h ARM9-I/O Ports
05000000h Standard Palettes (2KB) (Engine A BG/OBJ, Engine B BG/OBJ)
06000000h VRAM - Engine A, BG VRAM (max 512KB)
06200000h VRAM - Engine B, BG VRAM (max 128KB)
06400000h VRAM - Engine A, OBJ VRAM (max 256KB)
06600000h VRAM - Engine B, OBJ VRAM (max 128KB)
06800000h VRAM - "LCDC"-allocated (max 656KB)
07000000h OAM (2KB) (Engine A, Engine B)
08000000h GBA Slot ROM (max. 32MB)
0A000000h GBA Slot RAM (max. 64KB)
FFFF0000h ARM9-BIOS (32KB) (only 3K used)


nds 00000000h Instruction TCM (32KB)
gba 00000000-00003FFF BIOS - System ROM (16 KBytes)
emu code to manage the interrupts for the hypervisor and fast code, parts do the same thing as the gba BIOS
pu settings read only

nds 0xxxx000h Data TCM (16KB) (moveable)
gba not existing
emu hypervisor stack and fast access data

nds 02000000h Main Memory (4MB)
gba 02000000-0203FFFF WRAM - On-board Work RAM (256 KBytes)
emu hypervisor code and data
gba 08000000h GBA Slot ROM (max. 32MB) parts of gba code to execute is mapped here with various tricks


nds 03000000h Shared WRAM 32KB allocated to ARM9
gba 03000000-03007FFF WRAM - On-chip Work RAM (32 KBytes)

nds 04000000h ARM9-I/O Ports
gba 04000000-040003FE I/O
emu full emulated




08000000-09FFFFFF Game Pak ROM/FlashROM (max 32MB) - Wait State 0
0A000000-0BFFFFFF Game Pak ROM/FlashROM (max 32MB) - Wait State 1
0C000000-0DFFFFFF Game Pak ROM/FlashROM (max 32MB) - Wait State 2

reads with full address are emulated manually executings are remapped to a big buffer with the first 3MB of the rom. executes above this address causes random behaver

rest is the same
 

Bassdark25

Active Member
Newcomer
Joined
Oct 5, 2008
Messages
25
Trophies
0
XP
114
Country
United States
So it's normal if some games run if not running with sound. (asvirqsound) Was looking forwards to playing with sound, but if it causes freezing, then it can't be helped.
 

Tornplaya

Active Member
Newcomer
Joined
Jun 16, 2012
Messages
33
Trophies
0
Age
41
Location
Pennsylvania
XP
79
Country
United States
I'll be waiting patiently :). I'd be most happy if the audio issues could be fixed while still running at normal framerate without slowdowns, but that's probably a while off. Anyways Good Luck and don't give up on us :bow:.
 

bart2465

Well-Known Member
Newcomer
Joined
Sep 5, 2012
Messages
45
Trophies
0
Age
25
Location
at home
XP
87
Country
Netherlands
I have made a new patcher and a new thumb interpreter(to buggy to release)


great!
one question, what is a thumb interpreter and what is the difference between a thumb interpreter, a interpreter and dynamic intepreter?
i have really no idea what they are and what they do, i only know that they have something to do with core emulation.
 

Fishaman P

Speedrunner
Member
Joined
Jan 2, 2010
Messages
3,322
Trophies
1
Location
Wisconsin
Website
twitch.tv
XP
2,185
Country
United States
great!
one question, what is a thumb interpreter and what is the difference between a thumb interpreter, a interpreter and dynamic intepreter?
i have really no idea what they are and what they do, i only know that they have something to do with core emulation.
Thumb isn't a type of interpreter, it's an instruction set.
So it's kinda like x86 interpreter vs. PPC interpreter vs. ARM interpreter.
Thumb is basically a simple, fast subset of ARM, and is used when speed is important (i.e. GBA games).
 
  • Like
Reactions: Boriar

ipwndeveloper

Well-Known Member
Member
Joined
Jun 3, 2013
Messages
276
Trophies
0
Age
35
Location
San Fransisco, CA
Website
gb4iphone.x10.mx
XP
189
Country
United States
No, just idleing. Last update was a thumb interpreter, nothing has been pushed to the GIT in a while though ):, but the project still has a little attention on it, as of November 24 (I hope). I believe the last few updates were fairly unstable, so he has not published to the git repo.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    I @ idonthave: :)