From 64624b52279bd76d473aa92b072a0e5ebd516530 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 23 Apr 2024 21:50:15 -0400 Subject: Automated instruction testing using linked repo https://github.com/adtennant/GameboyCPUTests --- fig-emulator-gb/src/Fig/Emulator/GB/Utils.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fig-emulator-gb/src/Fig/Emulator/GB/Utils.hs') diff --git a/fig-emulator-gb/src/Fig/Emulator/GB/Utils.hs b/fig-emulator-gb/src/Fig/Emulator/GB/Utils.hs index 4d00743..b250068 100644 --- a/fig-emulator-gb/src/Fig/Emulator/GB/Utils.hs +++ b/fig-emulator-gb/src/Fig/Emulator/GB/Utils.hs @@ -44,6 +44,14 @@ flagsw8 z n h c = .|. shiftL (if h then 1 else 0) 5 .|. shiftL (if c then 1 else 0) 4 +w8flags :: Word8 -> (Bool, Bool, Bool, Bool) +w8flags x = (z, n, h, c) + where + z = w8bit 7 x + n = w8bit 6 x + h = w8bit 5 x + c = w8bit 4 x + zext :: Word8 -> Word16 zext = fromIntegral -- cgit v1.2.3