| 1 | // |
| 2 | // dsp.h |
| 3 | // |
| 4 | |
| 5 | #ifndef __DSP_H__ |
| 6 | #define __DSP_H__ |
| 7 | |
| 8 | #include "memory.h" |
| 9 | |
| 10 | #define DSP_CONTROL_RAM_BASE 0x00F1A100 |
| 11 | #define DSP_WORK_RAM_BASE 0x00F1B000 |
| 12 | |
| 13 | void DSPInit(void); |
| 14 | void DSPReset(void); |
| 15 | void DSPExec(int32_t); |
| 16 | void DSPDone(void); |
| 17 | void DSPUpdateRegisterBanks(void); |
| 18 | void DSPHandleIRQs(void); |
| 19 | void DSPSetIRQLine(int irqline, int state); |
| 20 | uint8_t DSPReadByte(uint32_t offset, uint32_t who = UNKNOWN); |
| 21 | uint16_t DSPReadWord(uint32_t offset, uint32_t who = UNKNOWN); |
| 22 | uint32_t DSPReadLong(uint32_t offset, uint32_t who = UNKNOWN); |
| 23 | void DSPWriteByte(uint32_t offset, uint8_t data, uint32_t who = UNKNOWN); |
| 24 | void DSPWriteWord(uint32_t offset, uint16_t data, uint32_t who = UNKNOWN); |
| 25 | void DSPWriteLong(uint32_t offset, uint32_t data, uint32_t who = UNKNOWN); |
| 26 | void DSPReleaseTimeslice(void); |
| 27 | bool DSPIsRunning(void); |
| 28 | |
| 29 | void DSPExecP(int32_t cycles); |
| 30 | void DSPExecP2(int32_t cycles); |
| 31 | //void DSPExecP3(int32_t cycles); |
| 32 | void DSPExecComp(int32_t cycles); |
| 33 | |
| 34 | // Exported vars |
| 35 | |
| 36 | extern bool doDSPDis; |
| 37 | extern uint32_t dsp_reg_bank_0[], dsp_reg_bank_1[]; |
| 38 | |
| 39 | // DSP interrupt numbers (in $F1A100, bits 4-8 & 16) |
| 40 | |
| 41 | enum { DSPIRQ_CPU = 0, DSPIRQ_SSI, DSPIRQ_TIMER0, DSPIRQ_TIMER1, DSPIRQ_EXT0, DSPIRQ_EXT1 }; |
| 42 | |
| 43 | #endif // __DSP_H__ |