From 5e6a1c3434b96ea16485b160c25732df3b00b2b8 Mon Sep 17 00:00:00 2001 From: Ian C Date: Thu, 12 May 2016 15:28:32 +0100 Subject: 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. --- src/state.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/state.c') 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; + } } -- cgit v1.2.3