aboutsummaryrefslogtreecommitdiff
path: root/src/state.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/state.c b/src/state.c
index 8a8d227..d9a9d01 100644
--- a/src/state.c
+++ b/src/state.c
@@ -40,6 +40,7 @@ static int pass = 1;
static int maxpass = 2;
static int pc = 0;
static int num_banks = 0;
+static int address_space = 0;
static unsigned currbank = 0;
static WordMode wmode = LSB_Word;
@@ -200,9 +201,25 @@ void SetWordMode(WordMode mode)
}
+void SetAddressSpace(int size)
+{
+ address_space = size;
+}
+
+
void SetPC(int i)
{
pc = i;
+
+ if (address_space > 0)
+ {
+ while (pc < 0)
+ {
+ pc += address_space;
+ }
+
+ pc = pc % address_space;
+ }
}