diff options
author | Ian C <ianc@noddybox.co.uk> | 2021-08-20 21:32:55 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2021-08-20 21:32:55 +0000 |
commit | 40121879f3dfaedce310fbc543589ff6aab3a398 (patch) | |
tree | b35afaf9a528a58703e24f4085587357c623e7f6 /z80.c | |
parent | 66d4bb423e981aece8c5590eb2a5968a5d874c9f (diff) |
Updated with latest Z80 core from 3dsspec
Diffstat (limited to 'z80.c')
-rw-r--r-- | z80.c | 28 |
1 files changed, 20 insertions, 8 deletions
@@ -2,11 +2,11 @@ z80 - Z80 Emulator - Copyright (C) 2006 Ian Cowburn <ianc@noddybox.co.uk> + Copyright (C) 2021 Ian Cowburn <ianc@noddybox.co.uk> 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 <http://www.gnu.org/licenses/> ------------------------------------------------------------------------- @@ -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 */ |