summaryrefslogtreecommitdiff
path: root/source/z80.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2021-08-03 20:26:23 +0000
committerIan C <ianc@noddybox.co.uk>2021-08-03 20:26:23 +0000
commitb7e8b634595445325d10f8fcddcb7d6cdaa8a922 (patch)
tree7ecd54e8539cbe1abd37ffda8d3fcd9eb0ddf258 /source/z80.c
parent30c4591b629bb96e9ff99aca24d0e0e51cedbf23 (diff)
First attempt at sound
Diffstat (limited to 'source/z80.c')
-rw-r--r--source/z80.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/z80.c b/source/z80.c
index e5f6c92..790aeec 100644
--- a/source/z80.c
+++ b/source/z80.c
@@ -170,6 +170,10 @@ Z80 *Z80Init(Z80ReadMemory read_memory,
void Z80Reset(Z80 *cpu)
{
PRIV->cycle=0;
+ PRIV->timer[Z80_TIMER_1]=0;
+ PRIV->timer[Z80_TIMER_2]=0;
+ PRIV->timer[Z80_TIMER_3]=0;
+
cpu->PC=0;
cpu->AF.w=0xffff;
@@ -209,6 +213,18 @@ void Z80ResetCycles(Z80 *cpu, Z80Val cycles)
}
+Z80Val Z80GetTimer(Z80 *cpu, Z80Timer timer)
+{
+ return PRIV->timer[timer];
+}
+
+
+void Z80SetTimer(Z80 *cpu, Z80Timer timer, Z80Val cycles)
+{
+ PRIV->timer[timer] = cycles;
+}
+
+
int Z80LodgeCallback(Z80 *cpu, Z80CallbackReason reason, Z80Callback callback)
{
int f;