mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
32x: drc: inline dispatcher and irq handling; do write-caused irqs
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@849 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
efd100fc0a
commit
e05b81fc5b
10 changed files with 535 additions and 246 deletions
|
@ -1,6 +1,12 @@
|
|||
#ifndef __SH2_H__
|
||||
#define __SH2_H__
|
||||
|
||||
#if !defined(REGPARM) && defined(__i386__)
|
||||
#define REGPARM(x) __attribute__((regparm(x)))
|
||||
#else
|
||||
#define REGPARM(x)
|
||||
#endif
|
||||
|
||||
// registers - matches structure order
|
||||
typedef enum {
|
||||
SHR_R0 = 0, SHR_SP = 15,
|
||||
|
@ -8,7 +14,7 @@ typedef enum {
|
|||
SHR_GBR, SHR_VBR, SHR_MACH, SHR_MACL,
|
||||
} sh2_reg_e;
|
||||
|
||||
typedef struct
|
||||
typedef struct SH2_
|
||||
{
|
||||
unsigned int r[16]; // 00
|
||||
unsigned int pc; // 40
|
||||
|
@ -26,6 +32,7 @@ typedef struct
|
|||
|
||||
// drc stuff
|
||||
int drc_tmp; // 70
|
||||
int irq_cycles;
|
||||
|
||||
// interpreter stuff
|
||||
int icount; // cycles left in current timeslice
|
||||
|
@ -37,7 +44,7 @@ typedef struct
|
|||
int pending_irl;
|
||||
int pending_int_irq; // internal irq
|
||||
int pending_int_vector;
|
||||
void (*irq_callback)(int id, int level);
|
||||
int REGPARM(2) (*irq_callback)(struct SH2_ *sh2, int level);
|
||||
int is_slave;
|
||||
|
||||
unsigned int cycles_aim; // subtract sh2_icount to get global counter
|
||||
|
@ -57,17 +64,11 @@ void sh2_execute(SH2 *sh2, int cycles);
|
|||
|
||||
// pico memhandlers
|
||||
// XXX: move somewhere else
|
||||
#if !defined(REGPARM) && defined(__i386__)
|
||||
#define REGPARM(x) __attribute__((regparm(x)))
|
||||
#else
|
||||
#define REGPARM(x)
|
||||
#endif
|
||||
|
||||
unsigned int REGPARM(2) p32x_sh2_read8(unsigned int a, SH2 *sh2);
|
||||
unsigned int REGPARM(2) p32x_sh2_read16(unsigned int a, SH2 *sh2);
|
||||
unsigned int REGPARM(2) p32x_sh2_read32(unsigned int a, SH2 *sh2);
|
||||
void REGPARM(3) p32x_sh2_write8(unsigned int a, unsigned int d, SH2 *sh2);
|
||||
void REGPARM(3) p32x_sh2_write16(unsigned int a, unsigned int d, SH2 *sh2);
|
||||
void REGPARM(3) p32x_sh2_write32(unsigned int a, unsigned int d, SH2 *sh2);
|
||||
int REGPARM(3) p32x_sh2_write8 (unsigned int a, unsigned int d, SH2 *sh2);
|
||||
int REGPARM(3) p32x_sh2_write16(unsigned int a, unsigned int d, SH2 *sh2);
|
||||
int REGPARM(3) p32x_sh2_write32(unsigned int a, unsigned int d, SH2 *sh2);
|
||||
|
||||
#endif /* __SH2_H__ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue