Fix and optimize CpuSet and CpuFastSet a bit
Jeffrey Pfau jeffrey@endrift.com
Fri, 04 Jul 2014 17:48:38 -0700
2 files changed,
16 insertions(+),
20 deletions(-)
M
src/gba/hle-bios.c
→
src/gba/hle-bios.c
@@ -2,7 +2,7 @@ #include "hle-bios.h"
#include "gba-memory.h" -const size_t hleBiosLength = 488; +const size_t hleBiosLength = 480; const uint8_t hleBios[SIZE_BIOS] = { 0x06, 0x00, 0x00, 0xea, 0xfe, 0xff, 0xff, 0xea, 0x05, 0x00, 0x00, 0xea, 0xfe, 0xff, 0xff, 0xea, 0xfe, 0xff, 0xff, 0xea, 0x00, 0x00, 0xa0, 0xe1,@@ -24,7 +24,7 @@ 0x01, 0x20, 0xa0, 0xe3, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x03, 0xc4, 0xe5,
0x08, 0x02, 0xc4, 0xe5, 0xb8, 0x30, 0x54, 0xe1, 0x01, 0x30, 0x13, 0xe0, 0x01, 0x30, 0x23, 0x10, 0xb8, 0x30, 0x44, 0x11, 0x08, 0x22, 0xc4, 0xe5, 0xf7, 0xff, 0xff, 0x0a, 0x93, 0xf0, 0x29, 0xe3, 0x05, 0xf0, 0x69, 0xe1, - 0x00, 0x80, 0xbd, 0xe8, 0x9f, 0xf0, 0x29, 0xe3, 0x02, 0x36, 0xa0, 0xe1, + 0x00, 0x80, 0xbd, 0xe8, 0x1f, 0xf0, 0x29, 0xe3, 0x02, 0x36, 0xa0, 0xe1, 0x23, 0x36, 0xa0, 0xe1, 0x01, 0x04, 0x12, 0xe3, 0x0d, 0x00, 0x00, 0x0a, 0x01, 0x03, 0x12, 0xe3, 0x04, 0x00, 0x00, 0x0a, 0x04, 0x00, 0xb0, 0xe8, 0x04, 0x00, 0xa1, 0xe8, 0x01, 0x30, 0x53, 0xe2, 0xfc, 0xff, 0xff, 0x1a,@@ -35,14 +35,13 @@ 0x04, 0x00, 0x00, 0x0a, 0x04, 0x00, 0xb0, 0xe8, 0x04, 0x00, 0xa1,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x00, 0x0a, 0x10, 0x00, 0xb0, 0xe8, + 0x04, 0x50, 0xa0, 0xe1, 0x04, 0x30, 0xa0, 0xe1, 0x04, 0x60, 0xa0, 0xe1, + 0x04, 0x70, 0xa0, 0xe1, 0x04, 0x80, 0xa0, 0xe1, 0x04, 0x90, 0xa0, 0xe1, + 0x04, 0xa0, 0xa0, 0xe1, 0xf8, 0x07, 0xa1, 0xe8, 0x08, 0x20, 0x52, 0xe2, + 0xfc, 0xff, 0xff, 0xca, 0x03, 0x00, 0x00, 0xea, 0xf8, 0x07, 0xb0, 0xe8, + 0xf8, 0x07, 0xa1, 0xe8, 0x08, 0x20, 0x52, 0xe2, 0xfb, 0xff, 0xff, 0xca, + 0xf0, 0x07, 0xbd, 0xe8, 0x93, 0xf0, 0x29, 0xe3, 0x1e, 0xff, 0x2f, 0xe1 };
M
src/gba/hle-bios.s
→
src/gba/hle-bios.s
@@ -83,7 +83,7 @@ msr spsr, r5
ldmfd sp!, {pc} CpuSet: -msr cpsr, #0x9F +msr cpsr, #0x1F mov r3, r2, lsl #12 mov r3, r3, lsr #12 tst r2, #0x01000000@@ -133,15 +133,14 @@ msr cpsr, #0x93
bx lr CpuFastSet: -msr cpsr, #0x9F +msr cpsr, #0x1F stmfd sp!, {r4-r10} -mov r3, r2, lsl #12 -mov r3, r3, lsr #12 tst r2, #0x01000000 +mov r3, r2, lsl #12 +mov r2, r3, lsr #12 beq 0f # Fill ldmia r0!, {r4} -mov r2, r3 mov r5, r4 mov r3, r4 mov r6, r4@@ -156,12 +155,10 @@ bgt 1b
b 2f # Copy 0: -mov r2, r3 -1: ldmia r0!, {r3-r10} stmia r1!, {r3-r10} subs r2, #8 -bgt 1b +bgt 0b 2: ldmfd sp!, {r4-r10} msr cpsr, #0x93