From 276025c2488166d5a4495b93f1b64d7d574dc9a6 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sun, 27 Oct 2013 22:26:43 -0400 Subject: [PATCH] Limit default external memory size to 1024 bytes Emulator is running very slow if external memory is at its maximum of 64K. --- src/memory.h | 1 + src/options.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/memory.h b/src/memory.h index 4166da9..faaba95 100644 --- a/src/memory.h +++ b/src/memory.h @@ -28,6 +28,7 @@ #define INT_MEM_SIZE 256 /* IRAM = Direct addresses $00 to $7F * SFR = Direct addresses $80 to $FF */ #define EXT_MEM_SIZE 65536 +#define EXT_MEM_DEFAULT_SIZE 1024 enum { PGM_MEM_ID, diff --git a/src/options.c b/src/options.c index c5833b3..7b6143d 100644 --- a/src/options.c +++ b/src/options.c @@ -46,7 +46,7 @@ static const char args_doc[] = "[FILENAME]"; static struct argp_option argp_options[] = { {"debug", 'd', "level", 0, "Produce debugging output" }, {"iram", 'i', "size", 0, "Set internal ram size" }, - {"xram", 'x', "size", 0, "Set external ram size" }, + {"xram", 'x', "size", 0, "Set external ram size (default is 1024)" }, { 0 } }; @@ -156,7 +156,7 @@ parse_command_line_options(int argc, char *argv[]) /* Setting default values. */ options.filename = NULL; options.iram_size = INT_MEM_SIZE; - options.xram_size = EXT_MEM_SIZE; + options.xram_size = EXT_MEM_DEFAULT_SIZE; /* Parse our arguments. */ argp_parse(&argp, argc, argv, 0, 0, NULL); -- 2.20.1