| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#ifndef _SSP16_H_ |
| 14 |
#define _SSP16_H_ |
| 15 |
|
| 16 |
|
| 17 |
#ifdef LOG_SVP |
| 18 |
#define EL_SVP 0x00004000 |
| 19 |
#define EL_ANOMALY 0x80000000 |
| 20 |
#define elprintf(w,f,...) error("%d(%d): " f "\n",frame_count,v_counter,##__VA_ARGS__); |
| 21 |
#endif |
| 22 |
|
| 23 |
|
| 24 |
enum { |
| 25 |
SSP_GR0, SSP_X, SSP_Y, SSP_A, |
| 26 |
SSP_ST, SSP_STACK, SSP_PC, SSP_P, |
| 27 |
SSP_PM0, SSP_PM1, SSP_PM2, SSP_XST, |
| 28 |
SSP_PM4, SSP_gr13, SSP_PMC, SSP_AL |
| 29 |
}; |
| 30 |
|
| 31 |
typedef union |
| 32 |
{ |
| 33 |
unsigned int v; |
| 34 |
struct { |
| 35 |
#ifdef LSB_FIRST |
| 36 |
unsigned short l; |
| 37 |
unsigned short h; |
| 38 |
#else |
| 39 |
unsigned short h; |
| 40 |
unsigned short l; |
| 41 |
#endif |
| 42 |
} byte; |
| 43 |
} ssp_reg_t; |
| 44 |
|
| 45 |
typedef struct |
| 46 |
{ |
| 47 |
union { |
| 48 |
unsigned short RAM[256*2]; |
| 49 |
struct { |
| 50 |
unsigned short RAM0[256]; |
| 51 |
unsigned short RAM1[256]; |
| 52 |
} bank; |
| 53 |
} mem; |
| 54 |
ssp_reg_t gr[16]; |
| 55 |
union { |
| 56 |
unsigned char r[8]; |
| 57 |
struct { |
| 58 |
unsigned char r0[4]; |
| 59 |
unsigned char r1[4]; |
| 60 |
} bank; |
| 61 |
} ptr; |
| 62 |
unsigned short stack[6]; |
| 63 |
unsigned int pmac[2][6]; |
| 64 |
#define SSP_PMC_HAVE_ADDR 0x0001 |
| 65 |
#define SSP_PMC_SET 0x0002 |
| 66 |
#define SSP_HANG 0x1000 |
| 67 |
#define SSP_WAIT_PM0 0x2000 |
| 68 |
#define SSP_WAIT_30FE06 0x4000 |
| 69 |
#define SSP_WAIT_30FE08 0x8000 |
| 70 |
#define SSP_WAIT_MASK 0xf000 |
| 71 |
unsigned int emu_status; |
| 72 |
unsigned int pad[30]; |
| 73 |
} ssp1601_t; |
| 74 |
|
| 75 |
|
| 76 |
void ssp1601_reset(ssp1601_t *ssp); |
| 77 |
void ssp1601_run(int cycles); |
| 78 |
|
| 79 |
#endif |