top | item 33848380

(no title)

failedartifact | 3 years ago

This couldnt come at a better time! Debugging is very painful, because the manual i have of the CPU instruction set is full of errors!

discuss

order

pizza234|3 years ago

Are you using the "Gameboy CPU manual"? If so, don't :) there's a better reference at https://github.com/gbdev/gb-opcodes (renders to this page: https://gbdev.io/gb-opcodes/optables).

a1369209993|3 years ago

> https://gbdev.io/gb-opcodes/optables

FWIW, it's very unfortunate that the tables are laid out according to hex rather than octal, since (much like x86) the sm83 instruction set is designed around octal 2+3+3-bit bytes, and using hex significantly obfuscates the underlying structure. (It also makes the table much wider than it needs to be, which would a acceptable tradeoff if it actually corresponded with the instruction set structure, but here just adds insult to injury.)

Edit: Went digging, and almost immediately found (a hidden-by-CSS-nonsense link to) https://gbdev.io/gb-opcodes//optables/octal, which uses the more sensible layout. Still kind of disappointing that's not the default, though. (Also CSS, but at this point I'm past disappointed and into "well, what were you expecting?".)

failedartifact|3 years ago

I was! Thank you for this.

I wanted to use a manual or reference diagrams ti write the cide from to challenge myself, instead of looking at others people's sources.

Im sure this will help me! I had began witting unit tests to test my logic, but the logic was all off anyways..