src/memory.c

branch
experimental_memory_mapper_v2
changeset 133
84ed5ec1d1e0
parent 132
8a7dc9b5b1db
child 140
1e4c45b144c4
     1.1 diff -r 8a7dc9b5b1db -r 84ed5ec1d1e0 src/memory.c
     1.2 --- a/src/memory.c	Fri Jan 18 22:52:43 2013 +0000
     1.3 +++ b/src/memory.c	Wed Mar 13 00:40:42 2013 +0000
     1.4 @@ -19,9 +19,9 @@
     1.5   ******************/
     1.6  
     1.7  /// Set a page bit
     1.8 -#define MAP_SET_PAGEBIT(addr, bit) state.map[(((addr) >> 12) & 0x3FF)*2] |=  (bit << 2)
     1.9 +#define MAP_SET_PAGEBIT(addr, bit) state.map[(MAP_ADDR_TO_PAGE(addr))*2] |=  ((uint8_t)bit << 2)
    1.10  /// Clear a page bit
    1.11 -#define MAP_CLR_PAGEBIT(addr, bit) state.map[(((addr) >> 12) & 0x3FF)*2] &= ~(bit << 2)
    1.12 +#define MAP_CLR_PAGEBIT(addr, bit) state.map[(MAP_ADDR_TO_PAGE(addr))*2] &= ~((uint8_t)bit << 2)
    1.13  
    1.14  
    1.15  /********************************************************