1 // basic, incomplete SSP160x (SSP1601?) interpreter
3 // (c) Copyright 2008, Grazvydas "notaz" Ignotas
4 // Free for non-commercial use.
6 // For commercial use, separate licencing terms must be obtained.
11 SSP_GR0, SSP_X, SSP_Y, SSP_A,
12 SSP_ST, SSP_STACK, SSP_PC, SSP_P,
13 SSP_PM0, SSP_PM1, SSP_PM2, SSP_XST,
14 SSP_PM4, SSP_gr13, SSP_PMC, SSP_AL
29 unsigned short RAM[256*2]; // 000 2 internal RAM banks
31 unsigned short RAM0[256];
32 unsigned short RAM1[256];
35 ssp_reg_t gr[16]; // 400 general registers
37 unsigned char r[8]; // 440 BANK pointers
43 unsigned short stack[6]; // 448
44 unsigned int pmac_read[6]; // 454 read modes/addrs for PM0-PM5
45 unsigned int pmac_write[6]; // 46c write ...
47 #define SSP_PMC_HAVE_ADDR 0x0001 // address written to PMAC, waiting for mode
48 #define SSP_PMC_SET 0x0002 // PMAC is set
49 #define SSP_WAIT_PM0 0x2000 // bit1 in PM0
50 #define SSP_WAIT_30FE06 0x4000 // ssp tight loops on 30FE06 to become non-zero
51 #define SSP_WAIT_30FE08 0x8000 // same for 30FE06
52 #define SSP_WAIT_MASK 0xe000
53 unsigned int emu_status; // 484
54 /* used by recompiler only: */
56 unsigned int ptr_rom; // 488
57 unsigned int ptr_iram_rom; // 48c
58 unsigned int ptr_dram; // 490
59 unsigned int iram_dirty; // 494
60 unsigned int iram_context; // 498
61 unsigned int ptr_btable; // 49c
62 unsigned int ptr_btable_iram; // 4a0
63 unsigned int tmp0; // 4a4
64 unsigned int tmp1; // 4a8
65 unsigned int tmp2; // 4ac
70 void ssp1601_reset(ssp1601_t *ssp);
71 void ssp1601_run(int cycles);