From 87c8a20489b69b2901eba6b1b70fba75b21bca61 Mon Sep 17 00:00:00 2001 From: Daniel Loffgren Date: Tue, 22 Dec 2015 08:08:31 +0000 Subject: [PATCH] Automatically load BASIC into memory, if available git-svn-id: svn+ssh://svn.phoenixbox.net/svn/apple1/trunk@78 64f78de7-aa59-e511-a0e8-0002a5492df0 --- apple1/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apple1/main.c b/apple1/main.c index 45e98e1..c1e9ca0 100644 --- a/apple1/main.c +++ b/apple1/main.c @@ -22,6 +22,7 @@ #include "pia.h" +#define BASIC_LOAD_ADDRESS 0xE000 #define ROM_START 0xF000 #define ROM_SIZE 0x00FF #define RESET_VECTOR 0xFF00 @@ -110,6 +111,14 @@ int main(int argc, const char * argv[]) fclose(file); } + // Load integer BASIC + file = fopen("apple1basic.bin", "r"); + if (file) { + fclose(file); + printf("Loading BASIC tape at 0x%4x...\n", BASIC_LOAD_ADDRESS); + v6502_loadFileAtAddress(cpu->memory, "apple1basic.bin", BASIC_LOAD_ADDRESS); + } + // Attach PIA printf("Initializing PIA...\n"); pia = pia_create(cpu);