From cabc0ae63919dfe6c8bc1ce1e0f3f423a8cf8732 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 29 Oct 2021 22:17:01 +0200 Subject: [PATCH] fixed gcc build errors --- NES Emulator/cpu.c | 4 ++-- NES Emulator/cpu.h | 6 +++--- NES Emulator/types.h | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/NES Emulator/cpu.c b/NES Emulator/cpu.c index 8746aec..7ebac04 100644 --- a/NES Emulator/cpu.c +++ b/NES Emulator/cpu.c @@ -5,12 +5,12 @@ #include "log.h" #include "bus.h" -inline void Push(struct Bus* bus, Byte val) +static inline void Push(struct Bus* bus, Byte val) { writeBus(bus, 0x0100 + (bus->cpu->sp--), val); } -inline Byte Pop(struct Bus* bus) +static inline Byte Pop(struct Bus* bus) { return readBus(bus, 0x0100 + (++bus->cpu->sp)); } diff --git a/NES Emulator/cpu.h b/NES Emulator/cpu.h index dec38e9..029c3f5 100644 --- a/NES Emulator/cpu.h +++ b/NES Emulator/cpu.h @@ -37,7 +37,7 @@ struct Opcode const char str[4]; }; -const struct Opcode OPCODE_TABLE[256]; +extern const struct Opcode OPCODE_TABLE[256]; struct CPU @@ -74,7 +74,7 @@ struct CPU } pc; char remainingCycles; - size_t totalCycles; + Qword totalCycles; Byte fetchedVal; Word fetchedAddress; @@ -100,4 +100,4 @@ void execute(struct CPU* cpu); void IRQ(struct CPU* cpu); void NMI(struct CPU* cpu); -#endif // _CPU_H_ \ No newline at end of file +#endif // _CPU_H_ diff --git a/NES Emulator/types.h b/NES Emulator/types.h index 8770d55..997377f 100644 --- a/NES Emulator/types.h +++ b/NES Emulator/types.h @@ -6,5 +6,6 @@ typedef uint8_t Byte; typedef uint16_t Word; typedef uint32_t DWord; +typedef uint64_t Qword; -#endif // _TYPES_H_ \ No newline at end of file +#endif // _TYPES_H_