aboutsummaryrefslogtreecommitdiff
path: root/src/state.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2016-05-12 15:28:32 +0100
committerIan C <ianc@noddybox.co.uk>2016-05-12 15:28:32 +0100
commit5e6a1c3434b96ea16485b160c25732df3b00b2b8 (patch)
treec86331cb1c74fbff18a8b7ef0ebd5989a0a1f182 /src/state.c
parente60cc5a36c148ef5ea0e38bcc848cf32f2b54a18 (diff)
Started on SPC700
Also: * Added offset to import command. Realised fairly useless, but may as well keep it. * Added setting of address space size to state for PC.
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;
+ }
}