Fix run on linux

This commit is contained in:
2026-08-31 04:43:52 +02:00
parent f5672ee9c3
commit d37d434228
13 changed files with 151 additions and 98 deletions
+2 -4
View File
@@ -1,16 +1,14 @@
#ifndef IO_H
#define IO_H
#include "ram.h"
#include <stdint.h>
#define IO_SIZE (1 * 1024) // 1KiB
#define IO_BASE (RAM_SIZE) // 55KiB RAM
#define IO_BASE (55 * 1024) // 55KiB RAM, hard coded
#define SCREEN_ADDRESS 0
#define KEYBOARD_ADDRESS 1
#define ROM_BANKED_OUT 2
int putChar(uint8_t c);
int getChar(void);
+1 -1
View File
@@ -8,7 +8,7 @@
#include <stdint.h>
uint8_t readMemory(uint16_t address, uint8_t *ram, uint8_t *rom);
void writeMemory(uint16_t address, uint8_t value, uint8_t *ram, uint8_t *rom);
void writeMemory(uint16_t address, uint8_t value, uint8_t *ram);
uint8_t readStack(uint8_t address, uint8_t *ram);
void writeStack(uint8_t address, uint8_t value, uint8_t *ram);
+1 -3
View File
@@ -3,9 +3,7 @@
#include "stdint.h"
#define RAM_SIZE (55 * 1024) // 55KiB
//#define RAM_SIZE (64 * 1024) // Full range, DEBUG mode
#define RAM_SIZE (64 * 1024) // 55KiB
#define RAM_BASE (0x00) // 0
int createRAM(uint8_t **ram);
+3 -5
View File
@@ -1,14 +1,12 @@
#ifndef ROM_H
#define ROM_H
#include "io.h"
#include <stdint.h>
#define ROM_SIZE (8 * 1024) // 8KiB
#define ROM_BASE (IO_BASE + IO_SIZE) // 55KiB RAM + 1KiB IO
#define ROM_SIZE (8 * 1024) // 8KiB
#define ROM_BASE (56 * 1024) // 55KiB RAM + 1KiB IO, hard coded
uint8_t rom[ROM_SIZE];
extern uint8_t rom[ROM_SIZE];
void initRom(uint8_t *rom);