binji / binjgb

Gameboy emulator implemented in C, that also runs in the browser
https://binji.github.io/binjgb/
MIT License
534 stars 61 forks source link

Implement debug messages #35

Open jendrikw opened 4 years ago

jendrikw commented 4 years ago

GBG knows two kinds of debug messages that can be used to trace what the program is doing. They're described in the manual.

In the first kind, the message is embedded in the instructions

    ld d, d ; signals a debug message
    jr .enddebugmsg
    ; the next 4 instructions specify the kind of mesage
    ld h, h
    ld h, h
    dw $0000
    db "my message"
.enddebugmsg

The second kind loads a zero-terminated string from an address, which can be useful for dynamic messages that include runtime values.

    ld d, d
    jr .enddebugmsg
    ; the next 4 instructions specify the kind of mesage
    ld h, h
    ld h, h
    dw $0001
    dw address
    dw bank
.enddebugmsg

In BGB, these messages are displayed in a separate window.

image

This would be a nice feature, I think.

binji commented 4 years ago

Same with the other feature -- sounds cool, but I don't know if I have time to implement.