From de83a6e5b768acdb12abd5b5205a0b51756fdfac Mon Sep 17 00:00:00 2001 From: radumacocian Date: Mon, 30 Jun 2025 16:16:50 +0200 Subject: [PATCH] changed naming to have multiuple functions files for each row in the optable --- cpu/{functions.go => functions0x0.go} | 2 +- cpu/functions0x1.go | 20 ++++++++++++++++++++ cpu/optable.go | 4 +++- 3 files changed, 24 insertions(+), 2 deletions(-) rename cpu/{functions.go => functions0x0.go} (99%) create mode 100644 cpu/functions0x1.go diff --git a/cpu/functions.go b/cpu/functions0x0.go similarity index 99% rename from cpu/functions.go rename to cpu/functions0x0.go index bf28572..2426770 100644 --- a/cpu/functions.go +++ b/cpu/functions0x0.go @@ -10,7 +10,7 @@ type op_context struct { } // 0x00 NOOP function -func Noop(context op_context) { +func NOOP(context op_context) { return } diff --git a/cpu/functions0x1.go b/cpu/functions0x1.go new file mode 100644 index 0000000..be74ddf --- /dev/null +++ b/cpu/functions0x1.go @@ -0,0 +1,20 @@ +package cpu + +import ( + "radu.macocian.me/goboy/cpu/operations" +) + +/* + 0x10 STOP Execution of a STOP instruction stops both the system clock and oscillator circuit. STOP mode is entered and the LCD controller also stops. However, the status of the internal RAM register ports remains unchanged. + +STOP mode can be cancelled by a reset signal. +If the RESET terminal goes LOW in STOP mode, it becomes that of a normal reset status. +The following conditions should be met before a STOP instruction is executed and stop mode is entered: + + All interrupt-enable (IE) flags are reset. + Input to P10-P13 is LOW for all. +*/ +func STOP(context op_context) { + //TODO + return +} diff --git a/cpu/optable.go b/cpu/optable.go index 21c9d51..ecb805a 100644 --- a/cpu/optable.go +++ b/cpu/optable.go @@ -1,7 +1,7 @@ package cpu var OpTable = [256]func(context op_context){ - Noop, //0x00 + NOOP, //0x00 LDBCd16, //0x01 LDBCa, //0x02 INCBC, //0x03 @@ -17,4 +17,6 @@ var OpTable = [256]func(context op_context){ DECC, //0x0D LDCd8, //0x0E RRRCA, //0x0F + + STOP, //0x10 }