From 40121879f3dfaedce310fbc543589ff6aab3a398 Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 20 Aug 2021 21:32:55 +0000 Subject: Updated with latest Z80 core from 3dsspec --- z80.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'z80.c') diff --git a/z80.c b/z80.c index 36c5793..dc4b9d1 100644 --- a/z80.c +++ b/z80.c @@ -2,11 +2,11 @@ z80 - Z80 Emulator - Copyright (C) 2006 Ian Cowburn + Copyright (C) 2021 Ian Cowburn This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + along with this program; if not, see ------------------------------------------------------------------------- @@ -31,10 +30,6 @@ #include "z80.h" #include "z80_private.h" -static const char ident[]="$Id$"; -static const char ident_z80_header[]=Z80_H; -static const char ident_z80_private_header[]=Z80_PRIVATE_H; - Z80Label *z80_labels=NULL; /* ---------------------------------------- PRIVATE FUNCTIONS @@ -173,6 +168,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; @@ -212,6 +211,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; @@ -328,4 +339,5 @@ const char *Z80Disassemble(Z80 *cpu, Z80Word *pc) #endif } + /* END OF FILE */ -- cgit v1.2.3