~groovestomp/gsnes

gsnes/cpu.h -rwxr-xr-x 1.6 KiB
9de07668 — GrooveStomp Foreground rendering works 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/******************************************************************************
  GrooveStomp's NES Emulator
  Copyright (c) 2019 Aaron Oman (GrooveStomp)

  File: cpu.h
  Created: 2019-10-16
  Updated: 2019-11-27
  Author: Aaron Oman
  Notice: GNU AGPLv3 License

  Based off of: One Lone Coder NES Emulator Copyright (C) 2019 Javidx9
  This program comes with ABSOLUTELY NO WARRANTY.
  This is free software, and you are welcome to redistribute it under certain
  conditions; See LICENSE for details.
 ******************************************************************************/
//! \file cpu.h
#include <stdint.h>

#ifndef CPU_VERSION
#define CPU_VERSION "0.1.0"

struct cpu;
struct bus;

struct cpu *
CpuInit();

void
CpuDeinit(struct cpu *cpu);

void
CpuConnectBus(struct cpu *cpu, struct bus *bus);

void
CpuReset(struct cpu *cpu);

void
CpuTick(struct cpu *cpu);

int
CpuIsComplete(struct cpu *cpu);

void
CpuNmi(struct cpu *cpu);

//-- Debug ---------------------------------------------------------------------

char **
CpuDebugStateInit(struct cpu *cpu, int *numLines);

void
CpuDebugStateDeinit(char **debug);

struct debug_instruction {
        uint16_t address;
        char *text;
        int text_length;
};

struct disassembly {
        struct debug_instruction **map;
        int count;
};

void
DebugInstructionDeinit(struct debug_instruction *inst);

struct disassembly *
DisassemblyInit(struct cpu *cpu, uint16_t start, uint16_t stop);

void
DisassemblyDeinit(struct disassembly *disassembly);

int
DisassemblyFindPc(struct disassembly *disassembly, struct cpu *cpu);

#endif // CPU_VERSION