mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-12 10:37:00 +00:00
Merge pull request #8 from SamsonLib/main
Fixed bug with include and printf in cpu
This commit is contained in:
commit
07556e05ec
1 changed files with 3 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef CPU_H
|
#ifndef CPU_H
|
||||||
#define CPU_H
|
#define CPU_H
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
struct CPU {
|
struct CPU {
|
||||||
|
|
@ -15,14 +16,14 @@ struct CPU {
|
||||||
|
|
||||||
uint8_t read_byte(uint64_t addr) {
|
uint8_t read_byte(uint64_t addr) {
|
||||||
if (addr >= MEM_SIZE) {
|
if (addr >= MEM_SIZE) {
|
||||||
printf("%s out of bounds\n", addr);
|
printf("%ld out of bounds\n", addr);
|
||||||
}
|
}
|
||||||
return memory[addr];
|
return memory[addr];
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_byte(uint64_t addr, uint8_t byte) {
|
void write_byte(uint64_t addr, uint8_t byte) {
|
||||||
if (addr >= MEM_SIZE) {
|
if (addr >= MEM_SIZE) {
|
||||||
printf("%s out of bounds\n", addr);
|
printf("%ld out of bounds\n", addr);
|
||||||
}
|
}
|
||||||
memory[addr] = byte;
|
memory[addr] = byte;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue