From cb74bfd280094bae9f17007d63be773ee85c89e5 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 21 Oct 2022 05:12:40 -0300 Subject: [PATCH] chore: pass destoer's cond_invalid test --- README.md | 2 +- src/cpu.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b0e2d66..f7d53ed 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ An in-progress Gameboy Advance Emulator written in Zig ⚡! - [x] `midikey2freq` - [ ] `swi-tests-random` - [ ] [destoer's GBA Tests](https://github.com/destoer/gba_tests) - - [ ] `cond_invalid.gba` + - [x] `cond_invalid.gba` - [x] `dma_priority.gba` - [x] `hello_world.gba` - [x] `if_ack.gba` diff --git a/src/cpu.zig b/src/cpu.zig index 432c646..e75253d 100644 --- a/src/cpu.zig +++ b/src/cpu.zig @@ -459,7 +459,7 @@ pub fn checkCond(cpsr: PSR, cond: u4) bool { 0xC => !cpsr.z.read() and (cpsr.n.read() == cpsr.v.read()), // GT - Greater than 0xD => cpsr.z.read() or (cpsr.n.read() != cpsr.v.read()), // LE - Less than or equal 0xE => true, // AL - Always - 0xF => std.debug.panic("[CPU/Cond] 0xF is a reserved condition field", .{}), + 0xF => false, // NV - Never (reserved in ARMv3 and up, but seems to have not changed?) }; }