More likely/unlikely fun

This commit is contained in:
Lior Halphon 2023-04-25 13:35:25 +03:00
parent c6e187a80b
commit 3e3ac23432
2 changed files with 3 additions and 3 deletions

View File

@ -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,

View File

@ -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;