git.y1.nz

SameBoy

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

commit 3e3ac23432849a79eee6c8b7e91eb4543ff15dfb
parent c6e187a80b7892d49d8baee65bb32dfb98d40d50
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Tue, 25 Apr 2023 13:35:25 +0300

More likely/unlikely fun

Diffstat:
MCore/gb.c2+-
MCore/sm83_cpu.c4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Core/gb.c b/Core/gb.c @@ -1163,7 +1163,7 @@ unsigned GB_run(GB_gameboy_t *gb) GB_ASSERT_NOT_RUNNING(gb) gb->vblank_just_occured = false; - if (gb->sgb && gb->sgb->intro_animation < 96) { + if (unlikely(gb->sgb && gb->sgb->intro_animation < 96)) { /* On the SGB, the GB is halted after finishing the boot ROM. Then, after the boot animation is almost done, it's reset. Since the SGB HLE does not perform any header validity checks, diff --git a/Core/sm83_cpu.c b/Core/sm83_cpu.c @@ -1653,7 +1653,7 @@ static opcode_t *opcodes[256] = { }; void GB_cpu_run(GB_gameboy_t *gb) { - if (gb->stopped) { + if (unlikely(gb->stopped)) { GB_timing_sync(gb); GB_advance_cycles(gb, 4); if ((gb->io_registers[GB_IO_JOYP] & 0x30) != 0x30) { @@ -1699,7 +1699,7 @@ void GB_cpu_run(GB_gameboy_t *gb) } /* Call interrupt */ - else if (effective_ime && interrupt_queue) { + else if (unlikely(effective_ime && interrupt_queue)) { gb->halted = false; if (gb->hdma_on_hblank && (gb->io_registers[GB_IO_STAT] & 3) == 0 && gb->allow_hdma_on_wake) { gb->hdma_on = true;

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