Loading 8/16 bits from ROM

This commit is contained in:
Jeffrey Pfau 2013-04-08 02:13:40 -07:00
parent 67c00f378a
commit 93a2f16066
1 changed files with 4 additions and 0 deletions

View File

@ -129,6 +129,7 @@ int16_t GBALoad16(struct ARMMemory* memory, uint32_t address) {
case BASE_CART1_EX: case BASE_CART1_EX:
case BASE_CART2: case BASE_CART2:
case BASE_CART2_EX: case BASE_CART2_EX:
return ((int16_t*) gbaMemory->rom)[(address & (SIZE_CART0 - 1)) >> 1];
break; break;
case BASE_CART_SRAM: case BASE_CART_SRAM:
break; break;
@ -163,6 +164,7 @@ uint16_t GBALoadU16(struct ARMMemory* memory, uint32_t address) {
case BASE_CART1_EX: case BASE_CART1_EX:
case BASE_CART2: case BASE_CART2:
case BASE_CART2_EX: case BASE_CART2_EX:
return ((uint16_t*) gbaMemory->rom)[(address & (SIZE_CART0 - 1)) >> 1];
break; break;
case BASE_CART_SRAM: case BASE_CART_SRAM:
break; break;
@ -197,6 +199,7 @@ int8_t GBALoad8(struct ARMMemory* memory, uint32_t address) {
case BASE_CART1_EX: case BASE_CART1_EX:
case BASE_CART2: case BASE_CART2:
case BASE_CART2_EX: case BASE_CART2_EX:
return ((int8_t*) gbaMemory->rom)[(address & (SIZE_CART0 - 1))];
break; break;
case BASE_CART_SRAM: case BASE_CART_SRAM:
break; break;
@ -231,6 +234,7 @@ uint8_t GBALoadU8(struct ARMMemory* memory, uint32_t address) {
case BASE_CART1_EX: case BASE_CART1_EX:
case BASE_CART2: case BASE_CART2:
case BASE_CART2_EX: case BASE_CART2_EX:
return ((uint8_t*) gbaMemory->rom)[(address & (SIZE_CART0 - 1))];
break; break;
case BASE_CART_SRAM: case BASE_CART_SRAM:
break; break;