merge in changes from default branch experimental_memory_mapper_v2

Fri, 18 Jan 2013 22:52:43 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Fri, 18 Jan 2013 22:52:43 +0000
branch
experimental_memory_mapper_v2
changeset 132
8a7dc9b5b1db
parent 128
3246b74d96bc
parent 131
21c770fcee50
child 133
84ed5ec1d1e0

merge in changes from default branch

src/memory.c file | annotate | diff | revisions
src/wd2010.c file | annotate | diff | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/TODO	Fri Jan 18 22:52:43 2013 +0000
     1.3 @@ -0,0 +1,6 @@
     1.4 +TODO -- things to check
     1.5 +
     1.6 +* Realtime clock
     1.7 +* WD2010 command handler logic
     1.8 +* Disabling page write protect logic allows userspace to run up but HDD won't mount
     1.9 +* DMA Page Fault issues (see wd2010.c and test code)
     2.1 --- a/src/memory.c	Fri Jan 18 17:03:48 2013 +0000
     2.2 +++ b/src/memory.c	Fri Jan 18 22:52:43 2013 +0000
     2.3 @@ -11,7 +11,8 @@
     2.4  // The value which will be returned if the CPU attempts to read from empty memory
     2.5  // TODO (FIXME?) - need to figure out if R/W ops wrap around. This seems to appease the UNIX kernel and P4TEST.
     2.6  #define EMPTY 0xFFFFFFFFUL
     2.7 -// #define EMPTY 0x55555555UL
     2.8 +//#define EMPTY 0x55555555UL
     2.9 +//#define EMPTY 0x00000000UL
    2.10  
    2.11  /******************
    2.12   * Memory mapping
    2.13 @@ -742,10 +743,8 @@
    2.14  		uint32_t newAddr = MAP_ADDR(address);
    2.15  
    2.16  		if (newAddr <= 0x1fffff) {
    2.17 -			if (newAddr >= state.base_ram_size)
    2.18 -				return EMPTY & 0xffffffff;
    2.19 -			else
    2.20 -				return RD32(state.base_ram, newAddr, state.base_ram_size - 1);
    2.21 +			// Base memory wraps around
    2.22 +			return RD32(state.base_ram, newAddr, state.base_ram_size - 1);
    2.23  		} else {
    2.24  			if ((newAddr <= (state.exp_ram_size + 0x200000 - 1)) && (newAddr >= 0x200000))
    2.25  				return RD32(state.exp_ram, newAddr - 0x200000, state.exp_ram_size - 1);
    2.26 @@ -795,10 +794,8 @@
    2.27  		uint32_t newAddr = MAP_ADDR(address);
    2.28  
    2.29  		if (newAddr <= 0x1fffff) {
    2.30 -			if (newAddr >= state.base_ram_size)
    2.31 -				return EMPTY & 0xffff;
    2.32 -			else
    2.33 -				return RD16(state.base_ram, newAddr, state.base_ram_size - 1);
    2.34 +			// Base memory wraps around
    2.35 +			return RD16(state.base_ram, newAddr, state.base_ram_size - 1);
    2.36  		} else {
    2.37  			if ((newAddr <= (state.exp_ram_size + 0x200000 - 1)) && (newAddr >= 0x200000))
    2.38  				return RD16(state.exp_ram, newAddr - 0x200000, state.exp_ram_size - 1);
    2.39 @@ -848,10 +845,8 @@
    2.40  		uint32_t newAddr = MAP_ADDR(address);
    2.41  
    2.42  		if (newAddr <= 0x1fffff) {
    2.43 -			if (newAddr >= state.base_ram_size)
    2.44 -				return EMPTY & 0xff;
    2.45 -			else
    2.46 -				return RD8(state.base_ram, newAddr, state.base_ram_size - 1);
    2.47 +			// Base memory wraps around
    2.48 +			return RD8(state.base_ram, newAddr, state.base_ram_size - 1);
    2.49  		} else {
    2.50  			if ((newAddr <= (state.exp_ram_size + 0x200000 - 1)) && (newAddr >= 0x200000))
    2.51  				return RD8(state.exp_ram, newAddr - 0x200000, state.exp_ram_size - 1);