Automatically load BASIC into memory, if available

git-svn-id: svn+ssh://svn.phoenixbox.net/svn/apple1/trunk@78 64f78de7-aa59-e511-a0e8-0002a5492df0
This commit is contained in:
Daniel Loffgren 2015-12-22 08:08:31 +00:00
parent 0b697efa40
commit 87c8a20489
1 changed files with 9 additions and 0 deletions

View File

@ -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);