Next Generation Emulation banner
1 - 3 of 3 Posts

·
Emu Author
Joined
·
616 Posts
Discussion Starter · #1 ·
ok i am working on my gameboy emulator and i am trying to put in support for the original gameboy bootstrap, problem is that going by the documents i have and looking at a commented asm version of the bootstrap, it does not seem to follow what the byte code shows. this inconsistency is causing me problems and i was wondering if anyone has any knowledge of how the bootstrap works and knows if maybe i may have an incorrect bootstrap?

the piece of code i am concerned about is where in the asm it has this "JR NZ, Addr_0007 ; $000a" now in the byte code the full opcode is 20 FB and if it jumps relative to the current pc which is A it jumps into the header of the loaded game and crashes soon after when it tries to run the RETI command when it has never come across a call at this point.

any help would be most grateful :D
 

·
Emu author
Joined
·
1,490 Posts
The disassembly you're looking at is correct. Branch displacements are signed quantities. 0xFB is -5, not 251. So it's correct that the branch jumps to 0x7, as that's 0xC - 0x5 (0xC is the PC after the branch instruction).

No offense, but I'm a little confused as to why you're having problems with that if you already did an 8080 interpreter a_a
 

·
Emu Author
Joined
·
616 Posts
Discussion Starter · #3 · (Edited)
ooooooo thank you i was wondering if maybe i had something way off, seems gameboy is a little bit different than i first thought. guess i should go in and fix that, thanks again for the help exophase.

Edit: i just reread the information on that instruction and i see where i went wrong, i did not see where it mentioned the value to be signed so i was using an unsigned value, i guess coding late at night strikes again.
 
1 - 3 of 3 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top