From b7e8b634595445325d10f8fcddcb7d6cdaa8a922 Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 3 Aug 2021 20:26:23 +0000 Subject: First attempt at sound --- include/z80.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'include/z80.h') diff --git a/include/z80.h b/include/z80.h index ef24fd0..ab095d8 100644 --- a/include/z80.h +++ b/include/z80.h @@ -134,13 +134,23 @@ typedef int (*Z80Callback)(Z80 *cpu, Z80Val data); */ typedef enum { - eZ80_Instruction, /* data = no cycles since reset */ + eZ80_Instruction, /* data = cycles as returned by Z80Cycles */ eZ80_EDHook, /* data = byte after ED opcode (only for NOP opcodes) */ eZ80_Halt, /* data = 1 halt raised, 0 halt cleared by int */ eZ80_RETI, /* data = ignored */ eZ80_NO_CALLBACK /* leave at end */ } Z80CallbackReason; +/* Defines cycle timers +*/ +typedef enum +{ + Z80_TIMER_1, + Z80_TIMER_2, + Z80_TIMER_3, + Z80_NO_TIMERS +} Z80Timer; + /* Flags in the F register */ @@ -235,6 +245,11 @@ void Z80Exec(Z80 *cpu); Z80Val Z80Cycles(Z80 *cpu); void Z80ResetCycles(Z80 *cpu, Z80Val cycles); +/* Timers that count in cycle counts +*/ +Z80Val Z80GetTimer(Z80 *cpu, Z80Timer timer); +void Z80SetTimer(Z80 *cpu, Z80Timer timer, Z80Val cycles); + /* Set address to label mappings for the disassembler */ -- cgit v1.2.3