From 048db615b953f6170a1f80ba33e86449c257f8f9 Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Sat, 5 Mar 2022 21:17:33 -0600 Subject: [PATCH] Add basic io header --- sw/Makefile | 6 ++++-- sw/io.h | 6 ++++++ sw/main.c | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 sw/io.h diff --git a/sw/Makefile b/sw/Makefile index 011f486..b2a834e 100644 --- a/sw/Makefile +++ b/sw/Makefile @@ -1,5 +1,5 @@ CC=cl65 -CFLAGS=-t none +CFLAGS=-t none -I. LDFLAGS=-C link.ld NAME=bootrom @@ -11,7 +11,9 @@ SRCS=$(wildcard *.S) $(wildcard *.c) OBJS+=$(patsubst %.S,%.o,$(filter %S,$(SRCS))) OBJS+=$(patsubst %.c,%.o,$(filter %c,$(SRCS))) -all: $(BIN) +all: $(HEX) + +$(HEX): $(BIN) objcopy --input-target=binary --output-target=ihex $(BIN) $(HEX) diff --git a/sw/io.h b/sw/io.h new file mode 100644 index 0000000..c46ae2c --- /dev/null +++ b/sw/io.h @@ -0,0 +1,6 @@ +#ifndef _IO_H +#define IO_H + +#define IO_REMAP *(unsigned char*)0x7f00 + +#endif diff --git a/sw/main.c b/sw/main.c index 499dad1..0125093 100644 --- a/sw/main.c +++ b/sw/main.c @@ -1,4 +1,5 @@ +#include int main() { - return 1; + IO_REMAP = 1; }