August 10th, 2014, 19:21
That e-2 bit was probably Nintendo trying to encourage good program design. The JR instructions occupy 2 bytes in machine code. When performing the JR instruction, the PC is actually pointing to the instruction right after JR. If e is specified as -1, the PC would technically be the the address of JR's immediate, which would then become an opcode the next cycle, which could lead to some wacky code execution. It's probably perfectly legal to do what I described above, but Nintendo probably didn't want to have games messing up, so they opted to keep programmers safe to begin with.
So what I think they meant to explain was that the signed immediate (e) should always be calculated as the value you want to jump first, then subtract 2. So if you wanted to jump the PC to one byte before the JR instruction, you would not use -1 (that jumps the PC into JR's immediate) but -3. This concept is poorly communicated in Nintendo docs though, and it took me some head-scratching to figure out what they meant.
September 3rd, 2014, 08:57
I ported my emulator to the STM32F429I-Discovery board,
which has a 180MHz Cortex-M4 with 256KB RAM and 2MB flash, a 320x240 LCD and 8MB SDRAM.
It runs but it's very slow, I guess single-digit FPS. There is no input, no sound and the
game has to fit inside the flash together with the emulator.
The board can be programmed and debugged over usb, which makes things considerably easier,
but programming larger files doesn't work reliably and anything over 1MB almost always breaks .
Next up are input and some missing rendering stuff.
Getting acceptable performance will probably not be as easy and I may have to rewrite the critical
parts in assembly. It really shows that I did not write the code with speed in mind .
September 6th, 2014, 06:33
Hey, that's very cool
The closest thing I ever did was port my emulator to the Dingoo A320 a long time ago (400MHz MIPS CPU). I must admit though, 180MHz seems awfully limited, you'd have to make every cycle count. ARM assembly is pretty easy to get to grips with, and implementing the GB's CPU instructions in assembly shouldn't be that difficult. Any big plans for your STM32F429I-Discovery board?