When I heard that the DSi was removing the Slot-2. I didn't shed many tears. "After all," I told myself, "I don't have many GBA games anyway, and I can emulate those on my x (x=whatever has an emulator) if need be." But then, I found this the thread on "The truth about GBA emulation" or something (http://gbatemp.net/index.php?showtopic=72623) and read it. I came to realize that while actual emulation of GBA code is likely impossible at a performant level, there is the possibility that another method could be used, which I will present here for interested parties.
To put it simply, the idea is to disassemble Game Boy Advance ROMs and rebuild them in an optimized form to be transferred and run as DS-native code using the LLVM framework (http://llvm.org).
I won't lie, it wouldlikely be a substantial amount of work. One (or more likely, a group) would have to:
* write a disassembler frontend for LLVM to transform ARM7TDMI ASM to the LLVM IR
** LLVM's IR is very robust and one of the main features that elevates it to the fore of modern compiler theory.
** Does disassembly carry caveats from a legal standpoint? Such things are ever the hindrance of innovation.
* Write a compilation strategy for the DS hardware (ARM9+ARM7) that encapsulates:
** Sequentiality - It mustn't jump around too much or try to load too much at once. This is a doozy and is where the optimization flexibility of LLVM will really shine.
** IO reassignment - It's all different, though this might be the easiest step. Some stuff might be able to be done on the ARM7 anyway (the special non-ARM9 instructions I saw mentioned in the other thread)
** Reentrancy - I could be wrong on this, but as I recall, the DS was mentioned to run simultaneously on both ARMs. I believe that this creates an interesting requirement on thread safety.
Note, too that while I speak of a GBA frontend and a DS backend specifically, all backends use the same IR and one could potentially target any platform, giving performant GBA gaming to many machines and architectures.
Cheers,
Wyatt
To put it simply, the idea is to disassemble Game Boy Advance ROMs and rebuild them in an optimized form to be transferred and run as DS-native code using the LLVM framework (http://llvm.org).
I won't lie, it would
* write a disassembler frontend for LLVM to transform ARM7TDMI ASM to the LLVM IR
** LLVM's IR is very robust and one of the main features that elevates it to the fore of modern compiler theory.
** Does disassembly carry caveats from a legal standpoint? Such things are ever the hindrance of innovation.
* Write a compilation strategy for the DS hardware (ARM9+ARM7) that encapsulates:
** Sequentiality - It mustn't jump around too much or try to load too much at once. This is a doozy and is where the optimization flexibility of LLVM will really shine.
** IO reassignment - It's all different, though this might be the easiest step. Some stuff might be able to be done on the ARM7 anyway (the special non-ARM9 instructions I saw mentioned in the other thread)
** Reentrancy - I could be wrong on this, but as I recall, the DS was mentioned to run simultaneously on both ARMs. I believe that this creates an interesting requirement on thread safety.
Note, too that while I speak of a GBA frontend and a DS backend specifically, all backends use the same IR and one could potentially target any platform, giving performant GBA gaming to many machines and architectures.
Cheers,
Wyatt