Fix BSR0 UDS/LDS bit polarity

Tue, 15 Nov 2011 09:30:57 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Tue, 15 Nov 2011 09:30:57 +0000
changeset 108
5f7faf5ecbf4
parent 107
566cfc70ef33
child 109
2f8afb9e5baa

Fix BSR0 UDS/LDS bit polarity

Patch-Author: Andrew Warkentin <andreww591!gmail>
Patch-MessageID: <4EC200CE.2020304@gmail.com>

... "The second bug is simpler - you had the UDS and LDS bits in BSR0 inverted (they are supposed to be active low)."

src/memory.c file | annotate | diff | revisions
     1.1 --- a/src/memory.c	Fri Mar 04 02:12:25 2011 +0000
     1.2 +++ b/src/memory.c	Tue Nov 15 09:30:57 2011 +0000
     1.3 @@ -153,7 +153,7 @@
     1.4  			if (bits >= 16)											\
     1.5  				state.bsr0 = 0x7C00;								\
     1.6  			else													\
     1.7 -				state.bsr0 = (address & 1) ? 0x7D00 : 0x7E00;		\
     1.8 +				state.bsr0 = (address & 1) ? 0x7E00 : 0x7D00;		\
     1.9  			state.bsr0 |= (address >> 16);							\
    1.10  			state.bsr1 = address & 0xffff;							\
    1.11  			LOG("Bus Error while writing, addr %08X, statcode %d", address, st);		\
    1.12 @@ -203,7 +203,7 @@
    1.13  			if (bits >= 16)											\
    1.14  				state.bsr0 = 0x7C00;								\
    1.15  			else													\
    1.16 -				state.bsr0 = (address & 1) ? 0x7D00 : 0x7E00;		\
    1.17 +				state.bsr0 = (address & 1) ? 0x7E00 : 0x7D00;		\
    1.18  			state.bsr0 |= (address >> 16);							\
    1.19  			state.bsr1 = address & 0xffff;							\
    1.20  			LOG("Bus Error while reading, addr %08X, statcode %d", address, st);		\