mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 23:37:46 -04:00
preserve r9 for apple
This commit is contained in:
parent
f3fe3e5ba2
commit
2dbc96b1c7
2 changed files with 35 additions and 8 deletions
|
@ -270,6 +270,8 @@ typedef struct {
|
||||||
#ifdef __arm__
|
#ifdef __arm__
|
||||||
#include "../drc/emit_arm.c"
|
#include "../drc/emit_arm.c"
|
||||||
|
|
||||||
|
#ifndef __MACH__
|
||||||
|
|
||||||
static const int reg_map_g2h[] = {
|
static const int reg_map_g2h[] = {
|
||||||
4, 5, 6, 7,
|
4, 5, 6, 7,
|
||||||
8, -1, -1, -1,
|
8, -1, -1, -1,
|
||||||
|
@ -279,6 +281,20 @@ static const int reg_map_g2h[] = {
|
||||||
-1, -1, -1, -1, // SHR_GBR, SHR_VBR, SHR_MACH, SHR_MACL,
|
-1, -1, -1, -1, // SHR_GBR, SHR_VBR, SHR_MACH, SHR_MACL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// no r9..
|
||||||
|
static const int reg_map_g2h[] = {
|
||||||
|
4, 5, 6, 7,
|
||||||
|
-1, -1, -1, -1,
|
||||||
|
-1, -1, -1, -1,
|
||||||
|
-1, -1, -1, 8, // r12 .. sp
|
||||||
|
-1, -1, -1, 10, // SHR_PC, SHR_PPC, SHR_PR, SHR_SR,
|
||||||
|
-1, -1, -1, -1, // SHR_GBR, SHR_VBR, SHR_MACH, SHR_MACL,
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
static temp_reg_t reg_temp[] = {
|
static temp_reg_t reg_temp[] = {
|
||||||
{ 0, },
|
{ 0, },
|
||||||
{ 1, },
|
{ 1, },
|
||||||
|
|
|
@ -12,14 +12,6 @@
|
||||||
.text
|
.text
|
||||||
.align 2
|
.align 2
|
||||||
|
|
||||||
@ externals
|
|
||||||
#define cache_flush_d_inval_i ESYM(cache_flush_d_inval_i)
|
|
||||||
#define ssp_get_iram_context ESYM(ssp_get_iram_context)
|
|
||||||
#define ssp_pm_read ESYM(ssp_pm_read)
|
|
||||||
#define ssp_pm_write ESYM(ssp_pm_write)
|
|
||||||
#define ssp_translate_block ESYM(ssp_translate_block)
|
|
||||||
#define tr_unhandled ESYM(tr_unhandled)
|
|
||||||
|
|
||||||
@ SSP_GR0, SSP_X, SSP_Y, SSP_A,
|
@ SSP_GR0, SSP_X, SSP_Y, SSP_A,
|
||||||
@ SSP_ST, SSP_STACK, SSP_PC, SSP_P,
|
@ SSP_ST, SSP_STACK, SSP_PC, SSP_P,
|
||||||
@ SSP_PM0, SSP_PM1, SSP_PM2, SSP_XST,
|
@ SSP_PM0, SSP_PM1, SSP_PM2, SSP_XST,
|
||||||
|
@ -613,4 +605,23 @@ hle_07_036_ending2:
|
||||||
mov r0, #0x87
|
mov r0, #0x87
|
||||||
b ssp_drc_next @ let the dispatcher finish this
|
b ssp_drc_next @ let the dispatcher finish this
|
||||||
|
|
||||||
|
|
||||||
|
@ ios stuff - preserving r9 on external calls
|
||||||
|
#ifdef __MACH__
|
||||||
|
|
||||||
|
#define APPLE_WRAP(f) \
|
||||||
|
f:; \
|
||||||
|
push {r9,lr}; \
|
||||||
|
bl _##f; \
|
||||||
|
pop {r9,pc}
|
||||||
|
|
||||||
|
APPLE_WRAP(cache_flush_d_inval_i)
|
||||||
|
APPLE_WRAP(ssp_get_iram_context)
|
||||||
|
APPLE_WRAP(ssp_pm_read)
|
||||||
|
APPLE_WRAP(ssp_pm_write)
|
||||||
|
APPLE_WRAP(ssp_translate_block)
|
||||||
|
APPLE_WRAP(tr_unhandled)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
@ vim:filetype=armasm
|
@ vim:filetype=armasm
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue