git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 00e1c925a4e36b6a4fb492af4a6e89f37ecc5e18
parent 961950044512fc159f3e79a4e725ffbf307b960d
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Mon, 18 Dec 2023 21:48:09 +0200

Prevent GB_workboy_is_enabled incorrectly returning true, prevent GB_workboy_set_key from affecting other accessories if Workboy isn't connected

Diffstat:
MCore/workboy.c4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Core/workboy.c b/Core/workboy.c @@ -153,11 +153,13 @@ void GB_connect_workboy(GB_gameboy_t *gb, bool GB_workboy_is_enabled(GB_gameboy_t *gb) { - return gb->workboy.mode; + return gb->accessory == GB_ACCESSORY_WORKBOY && gb->workboy.mode; } void GB_workboy_set_key(GB_gameboy_t *gb, uint8_t key) { + if (gb->accessory != GB_ACCESSORY_WORKBOY) return; + if (gb->workboy.user_shift_down != gb->workboy.shift_down && (key & (GB_WORKBOY_REQUIRE_SHIFT | GB_WORKBOY_FORBID_SHIFT)) == 0) { if (gb->workboy.user_shift_down) {

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.