summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-06-25 23:18:57 -0700
committerMike Pavone <pavone@retrodev.com>2013-06-25 23:18:57 -0700
commit6183aae8b8ff8deb39d5e177896ef62bc72df7c0 (patch)
tree7bb86c36df373064142398f7bac6f7b075121a4d
parent1a1c4c4d151de9f058d829d794c7d99780291144 (diff)
Use the registers that were freed up by the memory map function changes
-rw-r--r--m68k_to_x86.c2
-rw-r--r--runtime.S6
2 files changed, 6 insertions, 2 deletions
diff --git a/m68k_to_x86.c b/m68k_to_x86.c
index 4f1cc6a..b35494e 100644
--- a/m68k_to_x86.c
+++ b/m68k_to_x86.c
@@ -4339,8 +4339,10 @@ void init_x86_68k_opts(x86_68k_options * opts, memmap_chunk * memmap, uint32_t n
opts->dregs[0] = R10;
opts->dregs[1] = R11;
opts->dregs[2] = R12;
+ opts->dregs[3] = R8;
opts->aregs[0] = R13;
opts->aregs[1] = R14;
+ opts->aregs[2] = R9;
opts->aregs[7] = R15;
opts->native_code_map = malloc(sizeof(native_map_slot) * NATIVE_MAP_CHUNKS);
memset(opts->native_code_map, 0, sizeof(native_map_slot) * NATIVE_MAP_CHUNKS);
diff --git a/runtime.S b/runtime.S
index 6c8496b..357eabe 100644
--- a/runtime.S
+++ b/runtime.S
@@ -222,8 +222,10 @@ m68k_save_context:
mov %r10d, 8(%rsi) /* d0 */
mov %r11d, 12(%rsi) /* d1 */
mov %r12d, 16(%rsi) /* d2 */
+ mov %r8d, 20(%rsi) /* d3 */
mov %r13d, 40(%rsi) /* a0 */
mov %r14d, 44(%rsi) /* a1 */
+ mov %r9d, 48(%rsi) /* a2 */
mov %r15d, 68(%rsi) /* a7 */
mov %eax, 80(%rsi) /* current cycle count */
ret
@@ -237,13 +239,13 @@ m68k_load_context:
mov 8(%rsi), %r10d /* d0 */
mov 12(%rsi), %r11d /* d1 */
mov 16(%rsi), %r12d /* d2 */
+ mov 20(%rsi), %r8d /* d3 */
mov 40(%rsi), %r13d /* a0 */
mov 44(%rsi), %r14d /* a1 */
+ mov 48(%rsi), %r9d /* a2 */
mov 68(%rsi), %r15d /* a7 */
mov 76(%rsi), %ebp /* target cycle count */
mov 80(%rsi), %eax /* current cycle count */
- mov 96(%rsi), %r8d /* cartridge address */
- mov 104(%rsi), %r9d /* work ram address */
ret
.global m68k_start_context