mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
32x: split sh2 code, compiler stub
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@810 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
1d29444dfc
commit
4139770121
16 changed files with 227 additions and 205 deletions
|
@ -4,6 +4,7 @@
|
|||
// Free for non-commercial use.
|
||||
|
||||
#include "../../pico_int.h"
|
||||
#include "../../../cpu/drc/cmn.h"
|
||||
#include "compiler.h"
|
||||
|
||||
#define u32 unsigned int
|
||||
|
@ -23,10 +24,6 @@ extern ssp1601_t *ssp;
|
|||
|
||||
#ifndef ARM
|
||||
#define DUMP_BLOCK 0x0c9a
|
||||
u32 tcache[SSP_TCACHE_SIZE/4];
|
||||
u32 *ssp_block_table[0x5090/2];
|
||||
u32 *ssp_block_table_iram[15][0x800/2];
|
||||
char ssp_align[SSP_BLOCKTAB_ALIGN_SIZE];
|
||||
void ssp_drc_next(void){}
|
||||
void ssp_drc_next_patch(void){}
|
||||
void ssp_drc_end(void){}
|
||||
|
@ -1795,6 +1792,8 @@ static void ssp1601_state_load(void)
|
|||
|
||||
int ssp1601_dyn_startup(void)
|
||||
{
|
||||
drc_cmn_init();
|
||||
|
||||
memset(tcache, 0, SSP_TCACHE_SIZE);
|
||||
memset(ssp_block_table, 0, sizeof(ssp_block_table));
|
||||
memset(ssp_block_table_iram, 0, sizeof(ssp_block_table_iram));
|
||||
|
|
|
@ -1,13 +1,3 @@
|
|||
#define SSP_TCACHE_SIZE (512*1024)
|
||||
#define SSP_BLOCKTAB_SIZE (0x5090/2*4)
|
||||
#define SSP_BLOCKTAB_IRAM_SIZE (15*0x800/2*4)
|
||||
#define SSP_BLOCKTAB_ALIGN_SIZE 3808
|
||||
#define SSP_DRC_SIZE (SSP_TCACHE_SIZE + SSP_BLOCKTAB_SIZE + SSP_BLOCKTAB_IRAM_SIZE + SSP_BLOCKTAB_ALIGN_SIZE)
|
||||
|
||||
extern unsigned int tcache[SSP_TCACHE_SIZE/4];
|
||||
extern unsigned int *ssp_block_table[0x5090/2];
|
||||
extern unsigned int *ssp_block_table_iram[15][0x800/2];
|
||||
|
||||
int ssp_drc_entry(int cycles);
|
||||
void ssp_drc_next(void);
|
||||
void ssp_drc_next_patch(void);
|
||||
|
|
|
@ -5,14 +5,6 @@
|
|||
@ (c) Copyright 2008, Grazvydas "notaz" Ignotas
|
||||
@ Free for non-commercial use.
|
||||
|
||||
.if 0
|
||||
#include "compiler.h"
|
||||
.endif
|
||||
|
||||
.global tcache
|
||||
.global ssp_block_table
|
||||
.global ssp_block_table_iram
|
||||
|
||||
.global ssp_drc_entry
|
||||
.global ssp_drc_next
|
||||
.global ssp_drc_next_patch
|
||||
|
@ -26,24 +18,9 @@
|
|||
.global ssp_hle_11_384
|
||||
.global ssp_hle_11_38a
|
||||
|
||||
@ translation cache buffer + pointer table
|
||||
.data
|
||||
.align 12 @ 4096
|
||||
@.size tcache, SSP_TCACHE_SIZE
|
||||
@.size ssp_block_table, SSP_BLOCKTAB_SIZE
|
||||
@.size ssp_block_table_iram, SSP_BLOCKTAB_IRAM_SIZE
|
||||
tcache:
|
||||
.space SSP_TCACHE_SIZE
|
||||
ssp_block_table:
|
||||
.space SSP_BLOCKTAB_SIZE
|
||||
ssp_block_table_iram:
|
||||
.space SSP_BLOCKTAB_IRAM_SIZE
|
||||
.space SSP_BLOCKTAB_ALIGN_SIZE
|
||||
|
||||
.text
|
||||
.align 2
|
||||
|
||||
|
||||
@ SSP_GR0, SSP_X, SSP_Y, SSP_A,
|
||||
@ SSP_ST, SSP_STACK, SSP_PC, SSP_P,
|
||||
@ SSP_PM0, SSP_PM1, SSP_PM2, SSP_XST,
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
|
||||
#include "../../pico_int.h"
|
||||
#include "compiler.h"
|
||||
#if defined(__linux__) && defined(ARM)
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
svp_t *svp = NULL;
|
||||
int PicoSVPCycles = 850; // cycles/line, just a guess
|
||||
|
@ -100,20 +97,6 @@ static int PicoSVPDma(unsigned int source, int len, unsigned short **srcp, unsig
|
|||
|
||||
void PicoSVPInit(void)
|
||||
{
|
||||
#if defined(__linux__) && defined(ARM)
|
||||
int ret;
|
||||
ret = munmap(tcache, SSP_DRC_SIZE);
|
||||
printf("munmap tcache: %i\n", ret);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void PicoSVPShutdown(void)
|
||||
{
|
||||
#if defined(__linux__) && defined(ARM)
|
||||
// also unmap tcache
|
||||
PicoSVPInit();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,16 +118,12 @@ void PicoSVPStartup(void)
|
|||
svp = (void *) ((char *)tmp + 0x200000);
|
||||
memset(svp, 0, sizeof(*svp));
|
||||
|
||||
#if defined(__linux__) && defined(ARM)
|
||||
tmp = mmap(tcache, SSP_DRC_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_SHARED|MAP_ANONYMOUS, -1, 0);
|
||||
printf("mmap tcache: %p, asked %p\n", tmp, tcache);
|
||||
#endif
|
||||
|
||||
// init SVP compiler
|
||||
svp_dyn_ready = 0;
|
||||
#ifndef PSP
|
||||
if (PicoOpt&POPT_EN_SVP_DRC) {
|
||||
if (ssp1601_dyn_startup()) return;
|
||||
if (PicoOpt & POPT_EN_SVP_DRC) {
|
||||
if (ssp1601_dyn_startup())
|
||||
return;
|
||||
svp_dyn_ready = 1;
|
||||
}
|
||||
#endif
|
||||
|
@ -154,7 +133,6 @@ void PicoSVPStartup(void)
|
|||
PicoDmaHook = PicoSVPDma;
|
||||
PicoResetHook = PicoSVPReset;
|
||||
PicoLineHook = PicoSVPLine;
|
||||
PicoCartUnloadHook = PicoSVPShutdown;
|
||||
|
||||
// save state stuff
|
||||
svp_states[0].ptr = svp->iram_rom;
|
||||
|
|
|
@ -237,14 +237,14 @@ typedef void (z80_write_f)(unsigned int a, unsigned char data);
|
|||
|
||||
// ----------------------- SH2 CPU -----------------------
|
||||
|
||||
#include "cpu/sh2mame/sh2.h"
|
||||
#include "cpu/sh2/sh2.h"
|
||||
|
||||
extern SH2 sh2s[2];
|
||||
#define msh2 sh2s[0]
|
||||
#define ssh2 sh2s[1]
|
||||
|
||||
#define ash2_end_run(after) if (sh2_icount > (after)) sh2_icount = after
|
||||
#define ash2_cycles_done() (sh2->cycles_aim - sh2_icount)
|
||||
#define ash2_end_run(after) if (sh2->icount > (after)) sh2->icount = after
|
||||
#define ash2_cycles_done() (sh2->cycles_aim - sh2->icount)
|
||||
|
||||
#define sh2_pc(c) (c) ? ssh2.ppc : msh2.ppc
|
||||
#define sh2_reg(c, x) (c) ? ssh2.r[x] : msh2.r[x]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue