Mercurial > audlegacy-plugins
annotate src/psf2/psx.c @ 3047:4434b4c4a715
ported EsounD plugin
author | Andrew O. Shadoura <bugzilla@tut.by> |
---|---|
date | Fri, 17 Apr 2009 16:17:10 +0300 |
parents | fe2ba1a712cd |
children |
rev | line source |
---|---|
2737
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1 /* |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2 * Sony CXD8530AQ/CXD8530BQ/CXD8530CQ/CXD8661R |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
3 * |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
4 * PSX CPU emulator for the MAME project written by smf |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
5 * Thanks to Farfetch'd for information on the delay slot bug |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
6 * |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
7 * The PSX CPU is a custom r3000a with a built in |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
8 * geometry transform engine, no mmu & no data cache. |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
9 * |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
10 * There is a stall circuit for load delays, but |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
11 * it doesn't work if the load occurs in a branch |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
12 * delay slot. |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
13 * |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
14 */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
15 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
16 #include <stdio.h> |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
17 #include "ao.h" |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
18 #include "cpuintrf.h" |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
19 #include "psx.h" |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
20 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
21 #define EXC_INT ( 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
22 #define EXC_ADEL ( 4 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
23 #define EXC_ADES ( 5 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
24 #define EXC_SYS ( 8 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
25 #define EXC_BP ( 9 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
26 #define EXC_RI ( 10 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
27 #define EXC_CPU ( 11 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
28 #define EXC_OVF ( 12 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
29 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
30 #define CP0_RANDOM ( 1 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
31 #define CP0_BADVADDR ( 8 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
32 #define CP0_SR ( 12 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
33 #define CP0_CAUSE ( 13 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
34 #define CP0_EPC ( 14 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
35 #define CP0_PRID ( 15 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
36 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
37 #define SR_IEC ( 1L << 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
38 #define SR_KUC ( 1L << 1 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
39 #define SR_ISC ( 1L << 16 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
40 #define SR_SWC ( 1L << 17 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
41 #define SR_TS ( 1L << 21 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
42 #define SR_BEV ( 1L << 22 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
43 #define SR_RE ( 1L << 25 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
44 #define SR_CU0 ( 1L << 28 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
45 #define SR_CU1 ( 1L << 29 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
46 #define SR_CU2 ( 1L << 30 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
47 #define SR_CU3 ( 1L << 31 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
48 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
49 #define CAUSE_EXC ( 31L << 2 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
50 #define CAUSE_IP ( 255L << 8 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
51 #define CAUSE_IP2 ( 1L << 10 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
52 #define CAUSE_IP3 ( 1L << 11 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
53 #define CAUSE_IP4 ( 1L << 12 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
54 #define CAUSE_IP5 ( 1L << 13 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
55 #define CAUSE_IP6 ( 1L << 14 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
56 #define CAUSE_IP7 ( 1L << 15 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
57 #define CAUSE_CE ( 3L << 28 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
58 #define CAUSE_CE0 ( 0L << 28 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
59 #define CAUSE_CE1 ( 1L << 28 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
60 #define CAUSE_CE2 ( 2L << 28 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
61 #define CAUSE_BD ( 1L << 31 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
62 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
63 extern void psx_bios_hle(uint32 pc); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
64 extern void psx_iop_call(uint32 pc, uint32 callnum); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
65 extern uint8 program_read_byte_32le(offs_t address); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
66 extern uint16 program_read_word_32le(offs_t address); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
67 extern uint32 program_read_dword_32le(offs_t address); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
68 extern void program_write_byte_32le(offs_t address, uint8 data); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
69 extern void program_write_word_32le(offs_t address, uint16 data); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
70 extern void program_write_dword_32le(offs_t address, uint32 data); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
71 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
72 static UINT8 mips_reg_layout[] = |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
73 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
74 MIPS_PC, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
75 MIPS_DELAYV, MIPS_DELAYR, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
76 MIPS_HI, MIPS_LO, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
77 -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
78 MIPS_R0, MIPS_R1, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
79 MIPS_R2, MIPS_R3, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
80 MIPS_R4, MIPS_R5, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
81 MIPS_R6, MIPS_R7, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
82 MIPS_R8, MIPS_R9, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
83 MIPS_R10, MIPS_R11, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
84 MIPS_R12, MIPS_R13, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
85 MIPS_R14, MIPS_R15, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
86 MIPS_R16, MIPS_R17, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
87 MIPS_R18, MIPS_R19, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
88 MIPS_R20, MIPS_R21, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
89 MIPS_R22, MIPS_R23, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
90 MIPS_R24, MIPS_R25, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
91 MIPS_R26, MIPS_R27, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
92 MIPS_R28, MIPS_R29, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
93 MIPS_R30, MIPS_R31, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
94 -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
95 MIPS_CP0R0, MIPS_CP0R1, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
96 MIPS_CP0R2, MIPS_CP0R3, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
97 MIPS_CP0R4, MIPS_CP0R5, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
98 MIPS_CP0R6, MIPS_CP0R7, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
99 MIPS_CP0R8, MIPS_CP0R9, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
100 MIPS_CP0R10, MIPS_CP0R11, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
101 MIPS_CP0R12, MIPS_CP0R13, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
102 MIPS_CP0R14, MIPS_CP0R15, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
103 MIPS_CP0R16, MIPS_CP0R17, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
104 MIPS_CP0R18, MIPS_CP0R19, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
105 MIPS_CP0R20, MIPS_CP0R21, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
106 MIPS_CP0R22, MIPS_CP0R23, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
107 MIPS_CP0R24, MIPS_CP0R25, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
108 MIPS_CP0R26, MIPS_CP0R27, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
109 MIPS_CP0R28, MIPS_CP0R29, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
110 MIPS_CP0R30, MIPS_CP0R31, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
111 -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
112 MIPS_CP2DR0, MIPS_CP2DR1, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
113 MIPS_CP2DR2, MIPS_CP2DR3, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
114 MIPS_CP2DR4, MIPS_CP2DR5, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
115 MIPS_CP2DR6, MIPS_CP2DR7, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
116 MIPS_CP2DR8, MIPS_CP2DR9, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
117 MIPS_CP2DR10, MIPS_CP2DR11, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
118 MIPS_CP2DR12, MIPS_CP2DR13, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
119 MIPS_CP2DR14, MIPS_CP2DR15, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
120 MIPS_CP2DR16, MIPS_CP2DR17, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
121 MIPS_CP2DR18, MIPS_CP2DR19, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
122 MIPS_CP2DR20, MIPS_CP2DR21, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
123 MIPS_CP2DR22, MIPS_CP2DR23, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
124 MIPS_CP2DR24, MIPS_CP2DR25, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
125 MIPS_CP2DR26, MIPS_CP2DR27, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
126 MIPS_CP2DR28, MIPS_CP2DR29, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
127 MIPS_CP2DR30, MIPS_CP2DR31, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
128 -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
129 MIPS_CP2CR0, MIPS_CP2CR1, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
130 MIPS_CP2CR2, MIPS_CP2CR3, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
131 MIPS_CP2CR4, MIPS_CP2CR5, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
132 MIPS_CP2CR6, MIPS_CP2CR7, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
133 MIPS_CP2CR8, MIPS_CP2CR9, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
134 MIPS_CP2CR10, MIPS_CP2CR11, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
135 MIPS_CP2CR12, MIPS_CP2CR13, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
136 MIPS_CP2CR14, MIPS_CP2CR15, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
137 MIPS_CP2CR16, MIPS_CP2CR17, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
138 MIPS_CP2CR18, MIPS_CP2CR19, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
139 MIPS_CP2CR20, MIPS_CP2CR21, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
140 MIPS_CP2CR22, MIPS_CP2CR23, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
141 MIPS_CP2CR24, MIPS_CP2CR25, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
142 MIPS_CP2CR26, MIPS_CP2CR27, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
143 MIPS_CP2CR28, MIPS_CP2CR29, -1, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
144 MIPS_CP2CR30, MIPS_CP2CR31, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
145 0 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
146 }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
147 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
148 static UINT8 mips_win_layout[] = { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
149 45, 0,35,13, /* register window (top right) */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
150 0, 0,44,13, /* disassembler window (left, upper) */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
151 0,14,44, 8, /* memory #1 window (left, middle) */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
152 45,14,35, 8, /* memory #2 window (lower) */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
153 0,23,80, 1 /* command line window (bottom rows) */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
154 }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
155 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
156 #define REGPC ( 32 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
157 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
158 typedef struct |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
159 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
160 UINT32 op; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
161 UINT32 pc; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
162 UINT32 prevpc; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
163 UINT32 delayv; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
164 UINT32 delayr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
165 UINT32 hi; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
166 UINT32 lo; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
167 UINT32 r[ 32 ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
168 UINT32 cp0r[ 32 ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
169 PAIR cp2cr[ 32 ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
170 PAIR cp2dr[ 32 ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
171 int (*irq_callback)(int irqline); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
172 } mips_cpu_context; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
173 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
174 static mips_cpu_context mipscpu; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
175 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
176 static int mips_ICount = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
177 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
178 static UINT32 mips_mtc0_writemask[]= |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
179 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
180 0xffffffff, /* INDEX */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
181 0x00000000, /* RANDOM */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
182 0xffffff00, /* ENTRYLO */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
183 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
184 0xffe00000, /* CONTEXT */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
185 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
186 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
187 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
188 0x00000000, /* BADVADDR */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
189 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
190 0xffffffc0, /* ENTRYHI */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
191 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
192 0xf27fff3f, /* SR */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
193 0x00000300, /* CAUSE */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
194 0x00000000, /* EPC */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
195 0x00000000, /* PRID */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
196 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
197 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
198 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
199 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
200 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
201 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
202 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
203 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
204 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
205 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
206 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
207 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
208 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
209 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
210 0x00000000, |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
211 0x00000000 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
212 }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
213 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
214 #if 0 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
215 void GTELOG(const char *a,...) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
216 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
217 va_list va; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
218 char s_text[ 1024 ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
219 va_start( va, a ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
220 vsprintf( s_text, a, va ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
221 va_end( va ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
222 logerror( "%08x: GTE: %08x %s\n", mipscpu.pc, INS_COFUN( mipscpu.op ), s_text ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
223 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
224 #else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
225 INLINE void GTELOG(const char *a, ...) {} |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
226 #endif |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
227 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
228 static UINT32 getcp2dr( int n_reg ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
229 static void setcp2dr( int n_reg, UINT32 n_value ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
230 static UINT32 getcp2cr( int n_reg ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
231 static void setcp2cr( int n_reg, UINT32 n_value ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
232 static void docop2( int gteop ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
233 static void mips_exception( int exception ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
234 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
235 void mips_stop( void ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
236 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
237 #ifdef MAME_DEBUG |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
238 extern int debug_key_pressed; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
239 debug_key_pressed = 1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
240 CALL_MAME_DEBUG; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
241 #endif |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
242 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
243 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
244 INLINE void mips_set_cp0r( int reg, UINT32 value ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
245 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
246 mipscpu.cp0r[ reg ] = value; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
247 if( reg == CP0_SR || reg == CP0_CAUSE ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
248 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
249 if( ( mipscpu.cp0r[ CP0_SR ] & SR_IEC ) != 0 && ( mipscpu.cp0r[ CP0_SR ] & mipscpu.cp0r[ CP0_CAUSE ] & CAUSE_IP ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
250 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
251 mips_exception( EXC_INT ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
252 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
253 else if( mipscpu.delayr != REGPC && ( mipscpu.pc & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 3 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
254 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
255 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
256 mips_set_cp0r( CP0_BADVADDR, mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
257 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
258 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
259 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
260 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
261 INLINE void mips_commit_delayed_load( void ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
262 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
263 if( mipscpu.delayr != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
264 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
265 mipscpu.r[ mipscpu.delayr ] = mipscpu.delayv; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
266 mipscpu.delayr = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
267 mipscpu.delayv = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
268 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
269 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
270 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
271 INLINE void mips_delayed_branch( UINT32 n_adr ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
272 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
273 if( ( n_adr & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 3 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
274 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
275 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
276 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
277 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
278 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
279 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
280 mips_commit_delayed_load(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
281 mipscpu.delayr = REGPC; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
282 mipscpu.delayv = n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
283 mipscpu.pc += 4; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
284 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
285 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
286 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
287 INLINE void mips_set_pc( unsigned val ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
288 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
289 mipscpu.pc = val; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
290 change_pc( val ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
291 mipscpu.delayr = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
292 mipscpu.delayv = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
293 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
294 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
295 INLINE void mips_advance_pc( void ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
296 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
297 if( mipscpu.delayr == REGPC ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
298 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
299 mips_set_pc( mipscpu.delayv ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
300 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
301 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
302 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
303 mips_commit_delayed_load(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
304 mipscpu.pc += 4; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
305 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
306 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
307 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
308 INLINE void mips_load( UINT32 n_r, UINT32 n_v ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
309 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
310 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
311 if( n_r != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
312 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
313 mipscpu.r[ n_r ] = n_v; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
314 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
315 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
316 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
317 INLINE void mips_delayed_load( UINT32 n_r, UINT32 n_v ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
318 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
319 if( mipscpu.delayr == REGPC ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
320 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
321 mips_set_pc( mipscpu.delayv ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
322 mipscpu.delayr = n_r; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
323 mipscpu.delayv = n_v; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
324 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
325 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
326 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
327 mips_commit_delayed_load(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
328 mipscpu.pc += 4; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
329 if( n_r != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
330 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
331 mipscpu.r[ n_r ] = n_v; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
332 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
333 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
334 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
335 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
336 static void mips_exception( int exception ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
337 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
338 mips_set_cp0r( CP0_SR, ( mipscpu.cp0r[ CP0_SR ] & ~0x3f ) | ( ( mipscpu.cp0r[ CP0_SR ] << 2 ) & 0x3f ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
339 if( mipscpu.delayr == REGPC ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
340 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
341 mips_set_cp0r( CP0_EPC, mipscpu.pc - 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
342 mips_set_cp0r( CP0_CAUSE, ( mipscpu.cp0r[ CP0_CAUSE ] & ~CAUSE_EXC ) | CAUSE_BD | ( exception << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
343 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
344 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
345 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
346 mips_commit_delayed_load(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
347 mips_set_cp0r( CP0_EPC, mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
348 mips_set_cp0r( CP0_CAUSE, ( mipscpu.cp0r[ CP0_CAUSE ] & ~( CAUSE_EXC | CAUSE_BD ) ) | ( exception << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
349 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
350 if( mipscpu.cp0r[ CP0_SR ] & SR_BEV ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
351 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
352 mips_set_pc( 0xbfc00180 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
353 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
354 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
355 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
356 mips_set_pc( 0x80000080 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
357 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
358 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
359 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
360 void mips_init( void ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
361 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
362 #if 0 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
363 int cpu = cpu_getactivecpu(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
364 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
365 state_save_register_UINT32( "psxcpu", cpu, "op", &mipscpu.op, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
366 state_save_register_UINT32( "psxcpu", cpu, "pc", &mipscpu.pc, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
367 state_save_register_UINT32( "psxcpu", cpu, "delayv", &mipscpu.delayv, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
368 state_save_register_UINT32( "psxcpu", cpu, "delayr", &mipscpu.delayr, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
369 state_save_register_UINT32( "psxcpu", cpu, "hi", &mipscpu.hi, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
370 state_save_register_UINT32( "psxcpu", cpu, "lo", &mipscpu.lo, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
371 state_save_register_UINT32( "psxcpu", cpu, "r", &mipscpu.r[ 0 ], 32 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
372 state_save_register_UINT32( "psxcpu", cpu, "cp0r", &mipscpu.cp0r[ 0 ], 32 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
373 state_save_register_UINT32( "psxcpu", cpu, "cp2cr", &mipscpu.cp2cr[ 0 ].d, 32 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
374 state_save_register_UINT32( "psxcpu", cpu, "cp2dr", &mipscpu.cp2dr[ 0 ].d, 32 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
375 #endif |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
376 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
377 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
378 void mips_reset( void *param ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
379 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
380 mips_set_cp0r( CP0_SR, ( mipscpu.cp0r[ CP0_SR ] & ~( SR_TS | SR_SWC | SR_KUC | SR_IEC ) ) | SR_BEV ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
381 mips_set_cp0r( CP0_RANDOM, 63 ); /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
382 mips_set_cp0r( CP0_PRID, 0x00000200 ); /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
383 mips_set_pc( 0xbfc00000 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
384 mipscpu.prevpc = 0xffffffff; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
385 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
386 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
387 static void mips_exit( void ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
388 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
389 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
390 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
391 void mips_shorten_frame(void) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
392 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
393 mips_ICount = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
394 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
395 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
396 void psx_hw_runcounters(void); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
397 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
398 int psxcpu_verbose = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
399 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
400 int mips_execute( int cycles ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
401 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
402 UINT32 n_res; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
403 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
404 mips_ICount = cycles; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
405 do |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
406 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
407 // CALL_MAME_DEBUG; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
408 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
409 // psx_hw_runcounters(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
410 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
411 mipscpu.op = cpu_readop32( mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
412 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
413 // if we're not in a delay slot, update |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
414 // if we're in a delay slot and the delay instruction is not NOP, update |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
415 if (( mipscpu.delayr == 0 ) || ((mipscpu.delayr != 0) && (mipscpu.op != 0))) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
416 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
417 mipscpu.prevpc = mipscpu.pc; |
2959
95d7d8546e7b
Unbreak PS2 IRQ timings...
William Pitcock <nenolod@atheme.org>
parents:
2958
diff
changeset
|
418 } |
2960
fe2ba1a712cd
More code simplification.
William Pitcock <nenolod@atheme.org>
parents:
2959
diff
changeset
|
419 |
2737
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
420 switch( INS_OP( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
421 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
422 case OP_SPECIAL: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
423 switch( INS_FUNCT( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
424 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
425 case FUNCT_HLECALL: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
426 // printf("HLECALL, PC = %08x\n", mipscpu.pc); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
427 psx_bios_hle(mipscpu.pc); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
428 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
429 case FUNCT_SLL: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
430 mips_load( INS_RD( mipscpu.op ), mipscpu.r[ INS_RT( mipscpu.op ) ] << INS_SHAMT( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
431 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
432 case FUNCT_SRL: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
433 mips_load( INS_RD( mipscpu.op ), mipscpu.r[ INS_RT( mipscpu.op ) ] >> INS_SHAMT( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
434 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
435 case FUNCT_SRA: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
436 mips_load( INS_RD( mipscpu.op ), (INT32)mipscpu.r[ INS_RT( mipscpu.op ) ] >> INS_SHAMT( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
437 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
438 case FUNCT_SLLV: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
439 mips_load( INS_RD( mipscpu.op ), mipscpu.r[ INS_RT( mipscpu.op ) ] << ( mipscpu.r[ INS_RS( mipscpu.op ) ] & 31 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
440 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
441 case FUNCT_SRLV: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
442 mips_load( INS_RD( mipscpu.op ), mipscpu.r[ INS_RT( mipscpu.op ) ] >> ( mipscpu.r[ INS_RS( mipscpu.op ) ] & 31 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
443 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
444 case FUNCT_SRAV: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
445 mips_load( INS_RD( mipscpu.op ), (INT32)mipscpu.r[ INS_RT( mipscpu.op ) ] >> ( mipscpu.r[ INS_RS( mipscpu.op ) ] & 31 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
446 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
447 case FUNCT_JR: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
448 if( INS_RD( mipscpu.op ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
449 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
450 mips_exception( EXC_RI ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
451 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
452 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
453 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
454 mips_delayed_branch( mipscpu.r[ INS_RS( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
455 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
456 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
457 case FUNCT_JALR: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
458 n_res = mipscpu.pc + 8; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
459 mips_delayed_branch( mipscpu.r[ INS_RS( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
460 if( INS_RD( mipscpu.op ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
461 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
462 mipscpu.r[ INS_RD( mipscpu.op ) ] = n_res; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
463 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
464 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
465 case FUNCT_SYSCALL: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
466 mips_exception( EXC_SYS ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
467 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
468 case FUNCT_BREAK: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
469 printf("BREAK!\n"); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
470 exit(-1); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
471 // mips_exception( EXC_BP ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
472 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
473 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
474 case FUNCT_MFHI: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
475 mips_load( INS_RD( mipscpu.op ), mipscpu.hi ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
476 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
477 case FUNCT_MTHI: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
478 if( INS_RD( mipscpu.op ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
479 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
480 mips_exception( EXC_RI ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
481 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
482 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
483 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
484 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
485 mipscpu.hi = mipscpu.r[ INS_RS( mipscpu.op ) ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
486 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
487 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
488 case FUNCT_MFLO: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
489 mips_load( INS_RD( mipscpu.op ), mipscpu.lo ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
490 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
491 case FUNCT_MTLO: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
492 if( INS_RD( mipscpu.op ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
493 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
494 mips_exception( EXC_RI ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
495 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
496 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
497 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
498 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
499 mipscpu.lo = mipscpu.r[ INS_RS( mipscpu.op ) ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
500 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
501 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
502 case FUNCT_MULT: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
503 if( INS_RD( mipscpu.op ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
504 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
505 mips_exception( EXC_RI ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
506 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
507 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
508 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
509 INT64 n_res64; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
510 n_res64 = MUL_64_32_32( (INT32)mipscpu.r[ INS_RS( mipscpu.op ) ], (INT32)mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
511 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
512 mipscpu.lo = LO32_32_64( n_res64 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
513 mipscpu.hi = HI32_32_64( n_res64 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
514 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
515 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
516 case FUNCT_MULTU: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
517 if( INS_RD( mipscpu.op ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
518 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
519 mips_exception( EXC_RI ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
520 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
521 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
522 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
523 UINT64 n_res64; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
524 n_res64 = MUL_U64_U32_U32( mipscpu.r[ INS_RS( mipscpu.op ) ], mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
525 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
526 mipscpu.lo = LO32_U32_U64( n_res64 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
527 mipscpu.hi = HI32_U32_U64( n_res64 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
528 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
529 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
530 case FUNCT_DIV: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
531 if( INS_RD( mipscpu.op ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
532 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
533 mips_exception( EXC_RI ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
534 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
535 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
536 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
537 UINT32 n_div; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
538 UINT32 n_mod; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
539 if( mipscpu.r[ INS_RT( mipscpu.op ) ] != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
540 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
541 n_div = (INT32)mipscpu.r[ INS_RS( mipscpu.op ) ] / (INT32)mipscpu.r[ INS_RT( mipscpu.op ) ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
542 n_mod = (INT32)mipscpu.r[ INS_RS( mipscpu.op ) ] % (INT32)mipscpu.r[ INS_RT( mipscpu.op ) ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
543 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
544 mipscpu.lo = n_div; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
545 mipscpu.hi = n_mod; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
546 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
547 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
548 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
549 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
550 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
551 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
552 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
553 case FUNCT_DIVU: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
554 if( INS_RD( mipscpu.op ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
555 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
556 mips_exception( EXC_RI ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
557 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
558 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
559 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
560 UINT32 n_div; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
561 UINT32 n_mod; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
562 if( mipscpu.r[ INS_RT( mipscpu.op ) ] != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
563 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
564 n_div = mipscpu.r[ INS_RS( mipscpu.op ) ] / mipscpu.r[ INS_RT( mipscpu.op ) ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
565 n_mod = mipscpu.r[ INS_RS( mipscpu.op ) ] % mipscpu.r[ INS_RT( mipscpu.op ) ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
566 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
567 mipscpu.lo = n_div; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
568 mipscpu.hi = n_mod; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
569 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
570 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
571 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
572 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
573 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
574 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
575 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
576 case FUNCT_ADD: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
577 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
578 n_res = mipscpu.r[ INS_RS( mipscpu.op ) ] + mipscpu.r[ INS_RT( mipscpu.op ) ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
579 if( (INT32)( ~( mipscpu.r[ INS_RS( mipscpu.op ) ] ^ mipscpu.r[ INS_RT( mipscpu.op ) ] ) & ( mipscpu.r[ INS_RS( mipscpu.op ) ] ^ n_res ) ) < 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
580 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
581 mips_exception( EXC_OVF ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
582 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
583 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
584 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
585 mips_load( INS_RD( mipscpu.op ), n_res ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
586 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
587 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
588 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
589 case FUNCT_ADDU: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
590 mips_load( INS_RD( mipscpu.op ), mipscpu.r[ INS_RS( mipscpu.op ) ] + mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
591 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
592 case FUNCT_SUB: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
593 n_res = mipscpu.r[ INS_RS( mipscpu.op ) ] - mipscpu.r[ INS_RT( mipscpu.op ) ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
594 if( (INT32)( ( mipscpu.r[ INS_RS( mipscpu.op ) ] ^ mipscpu.r[ INS_RT( mipscpu.op ) ] ) & ( mipscpu.r[ INS_RS( mipscpu.op ) ] ^ n_res ) ) < 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
595 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
596 mips_exception( EXC_OVF ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
597 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
598 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
599 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
600 mips_load( INS_RD( mipscpu.op ), n_res ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
601 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
602 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
603 case FUNCT_SUBU: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
604 mips_load( INS_RD( mipscpu.op ), mipscpu.r[ INS_RS( mipscpu.op ) ] - mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
605 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
606 case FUNCT_AND: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
607 mips_load( INS_RD( mipscpu.op ), mipscpu.r[ INS_RS( mipscpu.op ) ] & mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
608 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
609 case FUNCT_OR: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
610 mips_load( INS_RD( mipscpu.op ), mipscpu.r[ INS_RS( mipscpu.op ) ] | mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
611 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
612 case FUNCT_XOR: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
613 mips_load( INS_RD( mipscpu.op ), mipscpu.r[ INS_RS( mipscpu.op ) ] ^ mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
614 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
615 case FUNCT_NOR: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
616 mips_load( INS_RD( mipscpu.op ), ~( mipscpu.r[ INS_RS( mipscpu.op ) ] | mipscpu.r[ INS_RT( mipscpu.op ) ] ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
617 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
618 case FUNCT_SLT: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
619 mips_load( INS_RD( mipscpu.op ), (INT32)mipscpu.r[ INS_RS( mipscpu.op ) ] < (INT32)mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
620 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
621 case FUNCT_SLTU: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
622 mips_load( INS_RD( mipscpu.op ), mipscpu.r[ INS_RS( mipscpu.op ) ] < mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
623 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
624 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
625 mips_exception( EXC_RI ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
626 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
627 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
628 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
629 case OP_REGIMM: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
630 switch( INS_RT( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
631 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
632 case RT_BLTZ: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
633 if( (INT32)mipscpu.r[ INS_RS( mipscpu.op ) ] < 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
634 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
635 mips_delayed_branch( mipscpu.pc + 4 + ( MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ) << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
636 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
637 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
638 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
639 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
640 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
641 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
642 case RT_BGEZ: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
643 if( (INT32)mipscpu.r[ INS_RS( mipscpu.op ) ] >= 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
644 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
645 mips_delayed_branch( mipscpu.pc + 4 + ( MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ) << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
646 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
647 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
648 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
649 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
650 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
651 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
652 case RT_BLTZAL: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
653 n_res = mipscpu.pc + 8; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
654 if( (INT32)mipscpu.r[ INS_RS( mipscpu.op ) ] < 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
655 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
656 mips_delayed_branch( mipscpu.pc + 4 + ( MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ) << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
657 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
658 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
659 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
660 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
661 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
662 mipscpu.r[ 31 ] = n_res; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
663 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
664 case RT_BGEZAL: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
665 n_res = mipscpu.pc + 8; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
666 if( (INT32)mipscpu.r[ INS_RS( mipscpu.op ) ] >= 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
667 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
668 mips_delayed_branch( mipscpu.pc + 4 + ( MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ) << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
669 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
670 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
671 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
672 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
673 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
674 mipscpu.r[ 31 ] = n_res; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
675 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
676 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
677 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
678 case OP_J: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
679 mips_delayed_branch( ( ( mipscpu.pc + 4 ) & 0xf0000000 ) + ( INS_TARGET( mipscpu.op ) << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
680 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
681 case OP_JAL: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
682 n_res = mipscpu.pc + 8; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
683 mips_delayed_branch( ( ( mipscpu.pc + 4 ) & 0xf0000000 ) + ( INS_TARGET( mipscpu.op ) << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
684 mipscpu.r[ 31 ] = n_res; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
685 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
686 case OP_BEQ: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
687 if( mipscpu.r[ INS_RS( mipscpu.op ) ] == mipscpu.r[ INS_RT( mipscpu.op ) ] ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
688 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
689 mips_delayed_branch( mipscpu.pc + 4 + ( MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ) << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
690 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
691 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
692 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
693 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
694 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
695 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
696 case OP_BNE: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
697 if( mipscpu.r[ INS_RS( mipscpu.op ) ] != mipscpu.r[ INS_RT( mipscpu.op ) ] ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
698 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
699 mips_delayed_branch( mipscpu.pc + 4 + ( MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ) << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
700 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
701 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
702 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
703 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
704 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
705 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
706 case OP_BLEZ: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
707 if( INS_RT( mipscpu.op ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
708 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
709 mips_exception( EXC_RI ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
710 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
711 else if( (INT32)mipscpu.r[ INS_RS( mipscpu.op ) ] <= 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
712 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
713 mips_delayed_branch( mipscpu.pc + 4 + ( MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ) << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
714 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
715 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
716 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
717 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
718 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
719 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
720 case OP_BGTZ: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
721 if( INS_RT( mipscpu.op ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
722 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
723 mips_exception( EXC_RI ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
724 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
725 else if( (INT32)mipscpu.r[ INS_RS( mipscpu.op ) ] > 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
726 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
727 mips_delayed_branch( mipscpu.pc + 4 + ( MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ) << 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
728 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
729 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
730 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
731 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
732 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
733 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
734 case OP_ADDI: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
735 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
736 UINT32 n_imm; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
737 n_imm = MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
738 n_res = mipscpu.r[ INS_RS( mipscpu.op ) ] + n_imm; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
739 if( (INT32)( ~( mipscpu.r[ INS_RS( mipscpu.op ) ] ^ n_imm ) & ( mipscpu.r[ INS_RS( mipscpu.op ) ] ^ n_res ) ) < 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
740 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
741 mips_exception( EXC_OVF ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
742 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
743 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
744 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
745 mips_load( INS_RT( mipscpu.op ), n_res ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
746 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
747 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
748 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
749 case OP_ADDIU: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
750 if (INS_RT( mipscpu.op ) == 0) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
751 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
752 psx_iop_call(mipscpu.pc, INS_IMMEDIATE(mipscpu.op)); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
753 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
754 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
755 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
756 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
757 mips_load( INS_RT( mipscpu.op ), mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
758 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
759 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
760 case OP_SLTI: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
761 mips_load( INS_RT( mipscpu.op ), (INT32)mipscpu.r[ INS_RS( mipscpu.op ) ] < MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
762 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
763 case OP_SLTIU: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
764 mips_load( INS_RT( mipscpu.op ), mipscpu.r[ INS_RS( mipscpu.op ) ] < (UINT32)MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
765 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
766 case OP_ANDI: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
767 mips_load( INS_RT( mipscpu.op ), mipscpu.r[ INS_RS( mipscpu.op ) ] & INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
768 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
769 case OP_ORI: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
770 mips_load( INS_RT( mipscpu.op ), mipscpu.r[ INS_RS( mipscpu.op ) ] | INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
771 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
772 case OP_XORI: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
773 mips_load( INS_RT( mipscpu.op ), mipscpu.r[ INS_RS( mipscpu.op ) ] ^ INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
774 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
775 case OP_LUI: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
776 mips_load( INS_RT( mipscpu.op ), INS_IMMEDIATE( mipscpu.op ) << 16 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
777 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
778 case OP_COP0: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
779 if( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) != 0 && ( mipscpu.cp0r[ CP0_SR ] & SR_CU0 ) == 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
780 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
781 mips_exception( EXC_CPU ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
782 mips_set_cp0r( CP0_CAUSE, ( mipscpu.cp0r[ CP0_CAUSE ] & ~CAUSE_CE ) | CAUSE_CE0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
783 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
784 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
785 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
786 switch( INS_RS( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
787 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
788 case RS_MFC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
789 mips_delayed_load( INS_RT( mipscpu.op ), mipscpu.cp0r[ INS_RD( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
790 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
791 case RS_CFC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
792 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
793 logerror( "%08x: COP0 CFC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
794 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
795 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
796 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
797 case RS_MTC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
798 n_res = ( mipscpu.cp0r[ INS_RD( mipscpu.op ) ] & ~mips_mtc0_writemask[ INS_RD( mipscpu.op ) ] ) | |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
799 ( mipscpu.r[ INS_RT( mipscpu.op ) ] & mips_mtc0_writemask[ INS_RD( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
800 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
801 mips_set_cp0r( INS_RD( mipscpu.op ), n_res ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
802 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
803 case RS_CTC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
804 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
805 logerror( "%08x: COP0 CTC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
806 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
807 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
808 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
809 case RS_BC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
810 switch( INS_RT( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
811 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
812 case RT_BCF: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
813 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
814 logerror( "%08x: COP0 BCF not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
815 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
816 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
817 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
818 case RT_BCT: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
819 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
820 logerror( "%08x: COP0 BCT not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
821 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
822 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
823 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
824 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
825 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
826 logerror( "%08x: COP0 unknown command %08x\n", mipscpu.pc, mipscpu.op ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
827 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
828 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
829 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
830 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
831 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
832 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
833 switch( INS_CO( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
834 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
835 case 1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
836 switch( INS_CF( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
837 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
838 case CF_RFE: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
839 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
840 mips_set_cp0r( CP0_SR, ( mipscpu.cp0r[ CP0_SR ] & ~0xf ) | ( ( mipscpu.cp0r[ CP0_SR ] >> 2 ) & 0xf ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
841 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
842 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
843 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
844 logerror( "%08x: COP0 unknown command %08x\n", mipscpu.pc, mipscpu.op ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
845 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
846 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
847 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
848 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
849 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
850 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
851 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
852 logerror( "%08x: COP0 unknown command %08x\n", mipscpu.pc, mipscpu.op ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
853 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
854 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
855 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
856 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
857 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
858 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
859 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
860 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
861 case OP_COP1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
862 if( ( mipscpu.cp0r[ CP0_SR ] & SR_CU1 ) == 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
863 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
864 mips_exception( EXC_CPU ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
865 mips_set_cp0r( CP0_CAUSE, ( mipscpu.cp0r[ CP0_CAUSE ] & ~CAUSE_CE ) | CAUSE_CE1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
866 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
867 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
868 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
869 switch( INS_RS( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
870 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
871 case RS_MFC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
872 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
873 logerror( "%08x: COP1 BCT not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
874 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
875 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
876 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
877 case RS_CFC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
878 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
879 logerror( "%08x: COP1 CFC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
880 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
881 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
882 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
883 case RS_MTC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
884 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
885 logerror( "%08x: COP1 MTC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
886 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
887 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
888 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
889 case RS_CTC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
890 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
891 logerror( "%08x: COP1 CTC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
892 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
893 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
894 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
895 case RS_BC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
896 switch( INS_RT( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
897 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
898 case RT_BCF: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
899 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
900 logerror( "%08x: COP1 BCF not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
901 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
902 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
903 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
904 case RT_BCT: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
905 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
906 logerror( "%08x: COP1 BCT not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
907 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
908 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
909 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
910 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
911 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
912 logerror( "%08x: COP1 unknown command %08x\n", mipscpu.pc, mipscpu.op ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
913 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
914 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
915 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
916 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
917 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
918 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
919 switch( INS_CO( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
920 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
921 case 1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
922 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
923 logerror( "%08x: COP1 unknown command %08x\n", mipscpu.pc, mipscpu.op ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
924 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
925 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
926 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
927 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
928 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
929 logerror( "%08x: COP1 unknown command %08x\n", mipscpu.pc, mipscpu.op ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
930 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
931 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
932 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
933 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
934 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
935 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
936 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
937 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
938 case OP_COP2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
939 if( ( mipscpu.cp0r[ CP0_SR ] & SR_CU2 ) == 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
940 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
941 mips_exception( EXC_CPU ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
942 mips_set_cp0r( CP0_CAUSE, ( mipscpu.cp0r[ CP0_CAUSE ] & ~CAUSE_CE ) | CAUSE_CE2 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
943 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
944 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
945 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
946 switch( INS_RS( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
947 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
948 case RS_MFC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
949 mips_delayed_load( INS_RT( mipscpu.op ), getcp2dr( INS_RD( mipscpu.op ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
950 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
951 case RS_CFC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
952 mips_delayed_load( INS_RT( mipscpu.op ), getcp2cr( INS_RD( mipscpu.op ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
953 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
954 case RS_MTC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
955 setcp2dr( INS_RD( mipscpu.op ), mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
956 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
957 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
958 case RS_CTC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
959 setcp2cr( INS_RD( mipscpu.op ), mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
960 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
961 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
962 case RS_BC: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
963 switch( INS_RT( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
964 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
965 case RT_BCF: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
966 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
967 logerror( "%08x: COP2 BCF not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
968 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
969 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
970 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
971 case RT_BCT: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
972 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
973 logerror( "%08x: COP2 BCT not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
974 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
975 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
976 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
977 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
978 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
979 logerror( "%08x: COP2 unknown command %08x\n", mipscpu.pc, mipscpu.op ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
980 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
981 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
982 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
983 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
984 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
985 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
986 switch( INS_CO( mipscpu.op ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
987 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
988 case 1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
989 docop2( INS_COFUN( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
990 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
991 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
992 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
993 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
994 logerror( "%08x: COP2 unknown command %08x\n", mipscpu.pc, mipscpu.op ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
995 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
996 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
997 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
998 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
999 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1000 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1001 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1002 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1003 case OP_LB: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1004 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1005 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1006 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1007 logerror( "%08x: LB SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1008 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1009 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1010 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1011 else if( ( mipscpu.cp0r[ CP0_SR ] & ( SR_RE | SR_KUC ) ) == ( SR_RE | SR_KUC ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1012 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1013 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1014 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1015 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1016 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1017 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1018 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1019 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1020 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1021 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1022 mips_delayed_load( INS_RT( mipscpu.op ), MIPS_BYTE_EXTEND( program_read_byte_32le( n_adr ^ 3 ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1023 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1024 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1025 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1026 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1027 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1028 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1029 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1030 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1031 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1032 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1033 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1034 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1035 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1036 mips_delayed_load( INS_RT( mipscpu.op ), MIPS_BYTE_EXTEND( program_read_byte_32le( n_adr ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1037 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1038 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1039 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1040 case OP_LH: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1041 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1042 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1043 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1044 logerror( "%08x: LH SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1045 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1046 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1047 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1048 else if( ( mipscpu.cp0r[ CP0_SR ] & ( SR_RE | SR_KUC ) ) == ( SR_RE | SR_KUC ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1049 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1050 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1051 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1052 if( ( n_adr & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 1 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1053 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1054 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1055 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1056 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1057 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1058 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1059 mips_delayed_load( INS_RT( mipscpu.op ), MIPS_WORD_EXTEND( program_read_word_32le( n_adr ^ 2 ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1060 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1061 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1062 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1063 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1064 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1065 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1066 if( ( n_adr & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 1 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1067 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1068 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1069 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1070 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1071 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1072 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1073 mips_delayed_load( INS_RT( mipscpu.op ), MIPS_WORD_EXTEND( program_read_word_32le( n_adr ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1074 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1075 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1076 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1077 case OP_LWL: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1078 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1079 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1080 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1081 logerror( "%08x: LWL SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1082 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1083 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1084 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1085 else if( ( mipscpu.cp0r[ CP0_SR ] & ( SR_RE | SR_KUC ) ) == ( SR_RE | SR_KUC ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1086 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1087 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1088 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1089 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1090 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1091 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1092 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1093 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1094 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1095 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1096 switch( n_adr & 3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1097 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1098 case 0: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1099 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0x00ffffff ) | ( (UINT32)program_read_byte_32le( n_adr + 3 ) << 24 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1100 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1101 case 1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1102 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0x0000ffff ) | ( (UINT32)program_read_word_32le( n_adr + 1 ) << 16 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1103 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1104 case 2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1105 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0x000000ff ) | ( (UINT32)program_read_byte_32le( n_adr - 1 ) << 8 ) | ( (UINT32)program_read_word_32le( n_adr ) << 16 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1106 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1107 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1108 n_res = program_read_dword_32le( n_adr - 3 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1109 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1110 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1111 mips_delayed_load( INS_RT( mipscpu.op ), n_res ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1112 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1113 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1114 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1115 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1116 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1117 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1118 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1119 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1120 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1121 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1122 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1123 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1124 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1125 switch( n_adr & 3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1126 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1127 case 0: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1128 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0x00ffffff ) | ( (UINT32)program_read_byte_32le( n_adr ) << 24 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1129 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1130 case 1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1131 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0x0000ffff ) | ( (UINT32)program_read_word_32le( n_adr - 1 ) << 16 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1132 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1133 case 2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1134 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0x000000ff ) | ( (UINT32)program_read_word_32le( n_adr - 2 ) << 8 ) | ( (UINT32)program_read_byte_32le( n_adr ) << 24 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1135 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1136 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1137 n_res = program_read_dword_32le( n_adr - 3 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1138 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1139 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1140 mips_delayed_load( INS_RT( mipscpu.op ), n_res ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1141 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1142 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1143 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1144 case OP_LW: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1145 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1146 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1147 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1148 logerror( "%08x: LW SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1149 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1150 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1151 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1152 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1153 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1154 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1155 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
2960
fe2ba1a712cd
More code simplification.
William Pitcock <nenolod@atheme.org>
parents:
2959
diff
changeset
|
1156 |
2737
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1157 if( ( n_adr & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 3 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1158 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1159 printf("ADEL\n"); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1160 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1161 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1162 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1163 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1164 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1165 mips_delayed_load( INS_RT( mipscpu.op ), program_read_dword_32le( n_adr ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1166 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1167 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1168 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1169 case OP_LBU: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1170 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1171 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1172 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1173 logerror( "%08x: LBU SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1174 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1175 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1176 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1177 else if( ( mipscpu.cp0r[ CP0_SR ] & ( SR_RE | SR_KUC ) ) == ( SR_RE | SR_KUC ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1178 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1179 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1180 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1181 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1182 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1183 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1184 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1185 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1186 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1187 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1188 mips_delayed_load( INS_RT( mipscpu.op ), program_read_byte_32le( n_adr ^ 3 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1189 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1190 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1191 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1192 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1193 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1194 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1195 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1196 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1197 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1198 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1199 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1200 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1201 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1202 mips_delayed_load( INS_RT( mipscpu.op ), program_read_byte_32le( n_adr ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1203 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1204 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1205 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1206 case OP_LHU: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1207 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1208 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1209 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1210 logerror( "%08x: LHU SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1211 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1212 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1213 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1214 else if( ( mipscpu.cp0r[ CP0_SR ] & ( SR_RE | SR_KUC ) ) == ( SR_RE | SR_KUC ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1215 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1216 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1217 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1218 if( ( n_adr & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 1 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1219 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1220 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1221 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1222 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1223 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1224 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1225 mips_delayed_load( INS_RT( mipscpu.op ), program_read_word_32le( n_adr ^ 2 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1226 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1227 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1228 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1229 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1230 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1231 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1232 if( ( n_adr & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 1 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1233 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1234 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1235 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1236 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1237 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1238 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1239 mips_delayed_load( INS_RT( mipscpu.op ), program_read_word_32le( n_adr ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1240 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1241 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1242 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1243 case OP_LWR: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1244 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1245 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1246 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1247 logerror( "%08x: LWR SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1248 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1249 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1250 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1251 else if( ( mipscpu.cp0r[ CP0_SR ] & ( SR_RE | SR_KUC ) ) == ( SR_RE | SR_KUC ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1252 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1253 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1254 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1255 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1256 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1257 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1258 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1259 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1260 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1261 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1262 switch( n_adr & 3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1263 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1264 case 3: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1265 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0xffffff00 ) | program_read_byte_32le( n_adr - 3 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1266 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1267 case 2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1268 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0xffff0000 ) | program_read_word_32le( n_adr - 2 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1269 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1270 case 1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1271 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0xff000000 ) | program_read_word_32le( n_adr - 1 ) | ( (UINT32)program_read_byte_32le( n_adr + 1 ) << 16 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1272 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1273 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1274 n_res = program_read_dword_32le( n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1275 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1276 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1277 mips_delayed_load( INS_RT( mipscpu.op ), n_res ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1278 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1279 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1280 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1281 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1282 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1283 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1284 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1285 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1286 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1287 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1288 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1289 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1290 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1291 switch( n_adr & 3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1292 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1293 case 3: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1294 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0xffffff00 ) | program_read_byte_32le( n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1295 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1296 case 2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1297 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0xffff0000 ) | program_read_word_32le( n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1298 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1299 case 1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1300 n_res = ( mipscpu.r[ INS_RT( mipscpu.op ) ] & 0xff000000 ) | program_read_byte_32le( n_adr ) | ( (UINT32)program_read_word_32le( n_adr + 1 ) << 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1301 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1302 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1303 n_res = program_read_dword_32le( n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1304 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1305 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1306 mips_delayed_load( INS_RT( mipscpu.op ), n_res ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1307 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1308 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1309 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1310 case OP_SB: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1311 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1312 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1313 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1314 logerror( "%08x: SB SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1315 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1316 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1317 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1318 else if( ( mipscpu.cp0r[ CP0_SR ] & ( SR_RE | SR_KUC ) ) == ( SR_RE | SR_KUC ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1319 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1320 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1321 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1322 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1323 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1324 mips_exception( EXC_ADES ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1325 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1326 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1327 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1328 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1329 program_write_byte_32le( n_adr ^ 3, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1330 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1331 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1332 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1333 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1334 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1335 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1336 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1337 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1338 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1339 mips_exception( EXC_ADES ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1340 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1341 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1342 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1343 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1344 program_write_byte_32le( n_adr, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1345 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1346 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1347 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1348 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1349 case OP_SH: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1350 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1351 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1352 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1353 logerror( "%08x: SH SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1354 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1355 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1356 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1357 else if( ( mipscpu.cp0r[ CP0_SR ] & ( SR_RE | SR_KUC ) ) == ( SR_RE | SR_KUC ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1358 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1359 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1360 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1361 if( ( n_adr & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 1 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1362 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1363 mips_exception( EXC_ADES ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1364 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1365 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1366 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1367 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1368 program_write_word_32le( n_adr ^ 2, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1369 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1370 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1371 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1372 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1373 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1374 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1375 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1376 if( ( n_adr & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 1 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1377 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1378 mips_exception( EXC_ADES ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1379 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1380 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1381 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1382 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1383 program_write_word_32le( n_adr, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1384 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1385 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1386 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1387 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1388 case OP_SWL: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1389 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1390 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1391 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1392 printf("SR_ISC not supported\n"); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1393 logerror( "%08x: SWL SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1394 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1395 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1396 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1397 else if( ( mipscpu.cp0r[ CP0_SR ] & ( SR_RE | SR_KUC ) ) == ( SR_RE | SR_KUC ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1398 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1399 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1400 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1401 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1402 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1403 printf("permission violation?\n"); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1404 mips_exception( EXC_ADES ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1405 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1406 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1407 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1408 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1409 switch( n_adr & 3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1410 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1411 case 0: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1412 program_write_byte_32le( n_adr + 3, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 24 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1413 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1414 case 1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1415 program_write_word_32le( n_adr + 1, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 16 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1416 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1417 case 2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1418 program_write_byte_32le( n_adr - 1, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1419 program_write_word_32le( n_adr, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 16 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1420 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1421 case 3: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1422 program_write_dword_32le( n_adr - 3, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1423 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1424 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1425 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1426 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1427 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1428 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1429 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1430 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1431 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1432 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1433 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1434 printf("permission violation 2\n"); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1435 mips_exception( EXC_ADES ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1436 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1437 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1438 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1439 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1440 switch( n_adr & 3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1441 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1442 case 0: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1443 program_write_byte_32le( n_adr, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 24 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1444 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1445 case 1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1446 program_write_word_32le( n_adr - 1, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 16 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1447 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1448 case 2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1449 program_write_word_32le( n_adr - 2, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1450 program_write_byte_32le( n_adr, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 24 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1451 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1452 case 3: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1453 program_write_dword_32le( n_adr - 3, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1454 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1455 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1456 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1457 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1458 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1459 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1460 case OP_SW: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1461 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1462 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1463 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1464 /* used by bootstrap |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1465 logerror( "%08x: SW SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1466 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1467 */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1468 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1469 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1470 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1471 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1472 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1473 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1474 if(0) // ( n_adr & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 3 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1475 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1476 mips_exception( EXC_ADES ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1477 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1478 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1479 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1480 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1481 program_write_dword_32le( n_adr, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1482 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1483 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1484 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1485 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1486 case OP_SWR: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1487 if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1488 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1489 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1490 logerror( "%08x: SWR SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1491 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1492 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1493 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1494 else if( ( mipscpu.cp0r[ CP0_SR ] & ( SR_RE | SR_KUC ) ) == ( SR_RE | SR_KUC ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1495 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1496 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1497 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1498 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1499 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1500 mips_exception( EXC_ADES ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1501 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1502 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1503 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1504 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1505 switch( n_adr & 3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1506 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1507 case 0: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1508 program_write_dword_32le( n_adr, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1509 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1510 case 1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1511 program_write_word_32le( n_adr - 1, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1512 program_write_byte_32le( n_adr + 1, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 16 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1513 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1514 case 2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1515 program_write_word_32le( n_adr - 2, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1516 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1517 case 3: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1518 program_write_byte_32le( n_adr - 3, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1519 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1520 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1521 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1522 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1523 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1524 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1525 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1526 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1527 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1528 if( ( n_adr & ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1529 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1530 mips_exception( EXC_ADES ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1531 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1532 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1533 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1534 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1535 switch( n_adr & 3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1536 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1537 case 0: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1538 program_write_dword_32le( n_adr, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1539 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1540 case 1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1541 program_write_byte_32le( n_adr, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1542 program_write_word_32le( n_adr + 1, mipscpu.r[ INS_RT( mipscpu.op ) ] >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1543 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1544 case 2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1545 program_write_word_32le( n_adr, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1546 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1547 case 3: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1548 program_write_byte_32le( n_adr, mipscpu.r[ INS_RT( mipscpu.op ) ] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1549 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1550 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1551 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1552 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1553 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1554 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1555 case OP_LWC1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1556 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1557 logerror( "%08x: COP1 LWC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1558 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1559 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1560 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1561 case OP_LWC2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1562 if( ( mipscpu.cp0r[ CP0_SR ] & SR_CU2 ) == 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1563 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1564 mips_exception( EXC_CPU ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1565 mips_set_cp0r( CP0_CAUSE, ( mipscpu.cp0r[ CP0_CAUSE ] & ~CAUSE_CE ) | CAUSE_CE2 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1566 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1567 else if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1568 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1569 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1570 logerror( "%08x: LWC2 SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1571 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1572 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1573 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1574 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1575 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1576 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1577 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1578 if( ( n_adr & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 3 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1579 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1580 mips_exception( EXC_ADEL ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1581 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1582 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1583 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1584 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1585 /* todo: delay? */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1586 setcp2dr( INS_RT( mipscpu.op ), program_read_dword_32le( n_adr ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1587 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1588 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1589 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1590 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1591 case OP_SWC1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1592 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1593 logerror( "%08x: COP1 SWC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1594 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1595 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1596 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1597 case OP_SWC2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1598 if( ( mipscpu.cp0r[ CP0_SR ] & SR_CU2 ) == 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1599 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1600 mips_exception( EXC_CPU ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1601 mips_set_cp0r( CP0_CAUSE, ( mipscpu.cp0r[ CP0_CAUSE ] & ~CAUSE_CE ) | CAUSE_CE2 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1602 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1603 else if( ( mipscpu.cp0r[ CP0_SR ] & SR_ISC ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1604 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1605 /* todo: */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1606 logerror( "%08x: SWC2 SR_ISC not supported\n", mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1607 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1608 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1609 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1610 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1611 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1612 UINT32 n_adr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1613 n_adr = mipscpu.r[ INS_RS( mipscpu.op ) ] + MIPS_WORD_EXTEND( INS_IMMEDIATE( mipscpu.op ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1614 if( ( n_adr & ( ( ( mipscpu.cp0r[ CP0_SR ] & SR_KUC ) << 30 ) | 3 ) ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1615 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1616 mips_exception( EXC_ADES ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1617 mips_set_cp0r( CP0_BADVADDR, n_adr ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1618 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1619 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1620 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1621 program_write_dword_32le( n_adr, getcp2dr( INS_RT( mipscpu.op ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1622 mips_advance_pc(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1623 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1624 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1625 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1626 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1627 // printf( "%08x: unknown opcode %08x (prev %08x, RA %08x)\n", mipscpu.pc, mipscpu.op, mipscpu.prevpc, mipscpu.r[31] ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1628 // mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1629 // mips_exception( EXC_RI ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1630 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1631 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1632 mips_ICount--; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1633 } while( mips_ICount > 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1634 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1635 return cycles - mips_ICount; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1636 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1637 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1638 static void mips_get_context( void *dst ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1639 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1640 if( dst ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1641 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1642 *(mips_cpu_context *)dst = mipscpu; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1643 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1644 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1645 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1646 static void mips_set_context( void *src ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1647 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1648 if( src ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1649 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1650 mipscpu = *(mips_cpu_context *)src; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1651 change_pc( mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1652 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1653 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1654 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1655 static void set_irq_line( int irqline, int state ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1656 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1657 UINT32 ip; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1658 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1659 switch( irqline ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1660 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1661 case MIPS_IRQ0: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1662 ip = CAUSE_IP2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1663 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1664 case MIPS_IRQ1: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1665 ip = CAUSE_IP3; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1666 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1667 case MIPS_IRQ2: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1668 ip = CAUSE_IP4; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1669 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1670 case MIPS_IRQ3: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1671 ip = CAUSE_IP5; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1672 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1673 case MIPS_IRQ4: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1674 ip = CAUSE_IP6; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1675 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1676 case MIPS_IRQ5: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1677 ip = CAUSE_IP7; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1678 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1679 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1680 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1681 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1682 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1683 switch( state ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1684 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1685 case CLEAR_LINE: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1686 mips_set_cp0r( CP0_CAUSE, mipscpu.cp0r[ CP0_CAUSE ] & ~ip ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1687 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1688 case ASSERT_LINE: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1689 mips_set_cp0r( CP0_CAUSE, mipscpu.cp0r[ CP0_CAUSE ] |= ip ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1690 if( mipscpu.irq_callback ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1691 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1692 /* HOLD_LINE interrupts are not supported by the architecture. |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1693 By acknowledging the interupt here they are treated like PULSE_LINE |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1694 interrupts, so if the interrupt isn't enabled it will be ignored. |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1695 There is also a problem with PULSE_LINE interrupts as the interrupt |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1696 pending bits aren't latched the emulated code won't know what caused |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1697 the interrupt. */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1698 (*mipscpu.irq_callback)( irqline ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1699 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1700 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1701 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1702 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1703 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1704 /**************************************************************************** |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1705 * Return a formatted string for a register |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1706 ****************************************************************************/ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1707 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1708 offs_t mips_dasm( char *buffer, offs_t pc ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1709 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1710 offs_t ret; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1711 change_pc( pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1712 #ifdef MAME_DEBUG |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1713 ret = DasmMIPS( buffer, pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1714 #else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1715 sprintf( buffer, "$%08x", cpu_readop32( pc ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1716 ret = 4; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1717 #endif |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1718 change_pc( mipscpu.pc ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1719 return ret; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1720 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1721 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1722 /* preliminary gte code */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1723 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1724 #define VXY0 ( mipscpu.cp2dr[ 0 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1725 #define VX0 ( mipscpu.cp2dr[ 0 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1726 #define VY0 ( mipscpu.cp2dr[ 0 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1727 #define VZ0 ( mipscpu.cp2dr[ 1 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1728 #define VXY1 ( mipscpu.cp2dr[ 2 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1729 #define VX1 ( mipscpu.cp2dr[ 2 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1730 #define VY1 ( mipscpu.cp2dr[ 2 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1731 #define VZ1 ( mipscpu.cp2dr[ 3 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1732 #define VXY2 ( mipscpu.cp2dr[ 4 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1733 #define VX2 ( mipscpu.cp2dr[ 4 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1734 #define VY2 ( mipscpu.cp2dr[ 4 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1735 #define VZ2 ( mipscpu.cp2dr[ 5 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1736 #define RGB ( mipscpu.cp2dr[ 6 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1737 #define R ( mipscpu.cp2dr[ 6 ].b.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1738 #define G ( mipscpu.cp2dr[ 6 ].b.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1739 #define B ( mipscpu.cp2dr[ 6 ].b.h2 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1740 #define CODE ( mipscpu.cp2dr[ 6 ].b.h3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1741 #define OTZ ( mipscpu.cp2dr[ 7 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1742 #define IR0 ( mipscpu.cp2dr[ 8 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1743 #define IR1 ( mipscpu.cp2dr[ 9 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1744 #define IR2 ( mipscpu.cp2dr[ 10 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1745 #define IR3 ( mipscpu.cp2dr[ 11 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1746 #define SXY0 ( mipscpu.cp2dr[ 12 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1747 #define SX0 ( mipscpu.cp2dr[ 12 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1748 #define SY0 ( mipscpu.cp2dr[ 12 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1749 #define SXY1 ( mipscpu.cp2dr[ 13 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1750 #define SX1 ( mipscpu.cp2dr[ 13 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1751 #define SY1 ( mipscpu.cp2dr[ 13 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1752 #define SXY2 ( mipscpu.cp2dr[ 14 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1753 #define SX2 ( mipscpu.cp2dr[ 14 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1754 #define SY2 ( mipscpu.cp2dr[ 14 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1755 #define SXYP ( mipscpu.cp2dr[ 15 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1756 #define SXP ( mipscpu.cp2dr[ 15 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1757 #define SYP ( mipscpu.cp2dr[ 15 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1758 #define SZ0 ( mipscpu.cp2dr[ 16 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1759 #define SZ1 ( mipscpu.cp2dr[ 17 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1760 #define SZ2 ( mipscpu.cp2dr[ 18 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1761 #define SZ3 ( mipscpu.cp2dr[ 19 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1762 #define RGB0 ( mipscpu.cp2dr[ 20 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1763 #define R0 ( mipscpu.cp2dr[ 20 ].b.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1764 #define G0 ( mipscpu.cp2dr[ 20 ].b.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1765 #define B0 ( mipscpu.cp2dr[ 20 ].b.h2 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1766 #define CD0 ( mipscpu.cp2dr[ 20 ].b.h3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1767 #define RGB1 ( mipscpu.cp2dr[ 21 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1768 #define R1 ( mipscpu.cp2dr[ 21 ].b.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1769 #define G1 ( mipscpu.cp2dr[ 21 ].b.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1770 #define B1 ( mipscpu.cp2dr[ 21 ].b.h2 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1771 #define CD1 ( mipscpu.cp2dr[ 21 ].b.h3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1772 #define RGB2 ( mipscpu.cp2dr[ 22 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1773 #define R2 ( mipscpu.cp2dr[ 22 ].b.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1774 #define G2 ( mipscpu.cp2dr[ 22 ].b.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1775 #define B2 ( mipscpu.cp2dr[ 22 ].b.h2 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1776 #define CD2 ( mipscpu.cp2dr[ 22 ].b.h3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1777 #define RES1 ( mipscpu.cp2dr[ 23 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1778 #define MAC0 ( mipscpu.cp2dr[ 24 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1779 #define MAC1 ( mipscpu.cp2dr[ 25 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1780 #define MAC2 ( mipscpu.cp2dr[ 26 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1781 #define MAC3 ( mipscpu.cp2dr[ 27 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1782 #define IRGB ( mipscpu.cp2dr[ 28 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1783 #define ORGB ( mipscpu.cp2dr[ 29 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1784 #define LZCS ( mipscpu.cp2dr[ 30 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1785 #define LZCR ( mipscpu.cp2dr[ 31 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1786 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1787 #define D1 ( mipscpu.cp2cr[ 0 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1788 #define R11 ( mipscpu.cp2cr[ 0 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1789 #define R12 ( mipscpu.cp2cr[ 0 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1790 #define R13 ( mipscpu.cp2cr[ 1 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1791 #define R21 ( mipscpu.cp2cr[ 1 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1792 #define D2 ( mipscpu.cp2cr[ 2 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1793 #define R22 ( mipscpu.cp2cr[ 2 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1794 #define R23 ( mipscpu.cp2cr[ 2 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1795 #define R31 ( mipscpu.cp2cr[ 3 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1796 #define R32 ( mipscpu.cp2cr[ 3 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1797 #define D3 ( mipscpu.cp2cr[ 4 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1798 #define R33 ( mipscpu.cp2cr[ 4 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1799 #define TRX ( mipscpu.cp2cr[ 5 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1800 #define TRY ( mipscpu.cp2cr[ 6 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1801 #define TRZ ( mipscpu.cp2cr[ 7 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1802 #define L11 ( mipscpu.cp2cr[ 8 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1803 #define L12 ( mipscpu.cp2cr[ 8 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1804 #define L13 ( mipscpu.cp2cr[ 9 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1805 #define L21 ( mipscpu.cp2cr[ 9 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1806 #define L22 ( mipscpu.cp2cr[ 10 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1807 #define L23 ( mipscpu.cp2cr[ 10 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1808 #define L31 ( mipscpu.cp2cr[ 11 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1809 #define L32 ( mipscpu.cp2cr[ 11 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1810 #define L33 ( mipscpu.cp2cr[ 12 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1811 #define RBK ( mipscpu.cp2cr[ 13 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1812 #define GBK ( mipscpu.cp2cr[ 14 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1813 #define BBK ( mipscpu.cp2cr[ 15 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1814 #define LR1 ( mipscpu.cp2cr[ 16 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1815 #define LR2 ( mipscpu.cp2cr[ 16 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1816 #define LR3 ( mipscpu.cp2cr[ 17 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1817 #define LG1 ( mipscpu.cp2cr[ 17 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1818 #define LG2 ( mipscpu.cp2cr[ 18 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1819 #define LG3 ( mipscpu.cp2cr[ 18 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1820 #define LB1 ( mipscpu.cp2cr[ 19 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1821 #define LB2 ( mipscpu.cp2cr[ 19 ].w.h ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1822 #define LB3 ( mipscpu.cp2cr[ 20 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1823 #define RFC ( mipscpu.cp2cr[ 21 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1824 #define GFC ( mipscpu.cp2cr[ 22 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1825 #define BFC ( mipscpu.cp2cr[ 23 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1826 #define OFX ( mipscpu.cp2cr[ 24 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1827 #define OFY ( mipscpu.cp2cr[ 25 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1828 #define H ( mipscpu.cp2cr[ 26 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1829 #define DQA ( mipscpu.cp2cr[ 27 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1830 #define DQB ( mipscpu.cp2cr[ 28 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1831 #define ZSF3 ( mipscpu.cp2cr[ 29 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1832 #define ZSF4 ( mipscpu.cp2cr[ 30 ].w.l ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1833 #define FLAG ( mipscpu.cp2cr[ 31 ].d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1834 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1835 static UINT32 getcp2dr( int n_reg ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1836 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1837 if( n_reg == 1 || n_reg == 3 || n_reg == 5 || n_reg == 8 || n_reg == 9 || n_reg == 10 || n_reg == 11 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1838 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1839 mipscpu.cp2dr[ n_reg ].d = (INT32)(INT16)mipscpu.cp2dr[ n_reg ].d; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1840 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1841 else if( n_reg == 17 || n_reg == 18 || n_reg == 19 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1842 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1843 mipscpu.cp2dr[ n_reg ].d = (UINT32)(UINT16)mipscpu.cp2dr[ n_reg ].d; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1844 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1845 else if( n_reg == 29 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1846 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1847 ORGB = ( ( IR1 >> 7 ) & 0x1f ) | ( ( IR2 >> 2 ) & 0x3e0 ) | ( ( IR3 << 3 ) & 0x7c00 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1848 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1849 GTELOG( "get CP2DR%u=%08x", n_reg, mipscpu.cp2dr[ n_reg ].d ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1850 return mipscpu.cp2dr[ n_reg ].d; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1851 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1852 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1853 static void setcp2dr( int n_reg, UINT32 n_value ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1854 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1855 GTELOG( "set CP2DR%u=%08x", n_reg, n_value ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1856 mipscpu.cp2dr[ n_reg ].d = n_value; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1857 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1858 if( n_reg == 15 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1859 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1860 SXY0 = SXY1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1861 SXY1 = SXY2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1862 SXY2 = SXYP; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1863 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1864 else if( n_reg == 28 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1865 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1866 IR1 = ( IRGB & 0x1f ) << 4; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1867 IR2 = ( IRGB & 0x3e0 ) >> 1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1868 IR3 = ( IRGB & 0x7c00 ) >> 6; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1869 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1870 else if( n_reg == 30 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1871 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1872 UINT32 n_lzcs = LZCS; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1873 UINT32 n_lzcr = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1874 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1875 if( ( n_lzcs & 0x80000000 ) == 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1876 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1877 n_lzcs = ~n_lzcs; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1878 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1879 while( ( n_lzcs & 0x80000000 ) != 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1880 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1881 n_lzcr++; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1882 n_lzcs <<= 1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1883 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1884 LZCR = n_lzcr; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1885 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1886 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1887 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1888 static UINT32 getcp2cr( int n_reg ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1889 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1890 GTELOG( "get CP2CR%u=%08x", n_reg, mipscpu.cp2cr[ n_reg ].d ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1891 return mipscpu.cp2cr[ n_reg ].d; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1892 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1893 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1894 static void setcp2cr( int n_reg, UINT32 n_value ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1895 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1896 GTELOG( "set CP2CR%u=%08x", n_reg, n_value ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1897 mipscpu.cp2cr[ n_reg ].d = n_value; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1898 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1899 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1900 INLINE INT32 LIM( INT32 n_value, INT32 n_max, INT32 n_min, UINT32 n_flag ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1901 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1902 if( n_value > n_max ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1903 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1904 FLAG |= n_flag; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1905 return n_max; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1906 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1907 else if( n_value < n_min ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1908 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1909 FLAG |= n_flag; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1910 return n_min; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1911 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1912 return n_value; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1913 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1914 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1915 INLINE INT64 BOUNDS( INT64 n_value, INT64 n_max, int n_maxflag, INT64 n_min, int n_minflag ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1916 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1917 if( n_value > n_max ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1918 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1919 FLAG |= n_maxflag; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1920 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1921 else if( n_value < n_min ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1922 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1923 FLAG |= n_minflag; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1924 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1925 return n_value; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1926 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1927 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1928 #define A1( a ) BOUNDS( ( a ), 0x7fffffff, 30, -(INT64)0x80000000, ( 1 << 27 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1929 #define A2( a ) BOUNDS( ( a ), 0x7fffffff, 29, -(INT64)0x80000000, ( 1 << 26 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1930 #define A3( a ) BOUNDS( ( a ), 0x7fffffff, 28, -(INT64)0x80000000, ( 1 << 25 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1931 #define Lm_B1( a, l ) LIM( ( a ), 0x7fff, -0x8000 * !l, ( 1 << 31 ) | ( 1 << 24 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1932 #define Lm_B2( a, l ) LIM( ( a ), 0x7fff, -0x8000 * !l, ( 1 << 31 ) | ( 1 << 23 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1933 #define Lm_B3( a, l ) LIM( ( a ), 0x7fff, -0x8000 * !l, ( 1 << 22 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1934 #define Lm_C1( a ) LIM( ( a ), 0x00ff, 0x0000, ( 1 << 21 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1935 #define Lm_C2( a ) LIM( ( a ), 0x00ff, 0x0000, ( 1 << 20 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1936 #define Lm_C3( a ) LIM( ( a ), 0x00ff, 0x0000, ( 1 << 19 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1937 #define Lm_D( a ) LIM( ( a ), 0xffff, 0x0000, ( 1 << 31 ) | ( 1 << 18 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1938 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1939 INLINE UINT32 Lm_E( UINT32 n_z ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1940 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1941 if( n_z <= H / 2 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1942 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1943 n_z = H / 2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1944 FLAG |= ( 1 << 31 ) | ( 1 << 17 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1945 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1946 if( n_z == 0 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1947 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1948 n_z = 1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1949 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1950 return n_z; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1951 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1952 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1953 #define F( a ) BOUNDS( ( a ), 0x7fffffff, ( 1 << 31 ) | ( 1 << 16 ), -(INT64)0x80000000, ( 1 << 31 ) | ( 1 << 15 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1954 #define Lm_G1( a ) LIM( ( a ), 0x3ff, -0x400, ( 1 << 31 ) | ( 1 << 14 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1955 #define Lm_G2( a ) LIM( ( a ), 0x3ff, -0x400, ( 1 << 31 ) | ( 1 << 13 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1956 #define Lm_H( a ) LIM( ( a ), 0xfff, 0x000, ( 1 << 12 ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1957 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1958 static void docop2( int gteop ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1959 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1960 int n_sf; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1961 int n_v; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1962 int n_lm; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1963 int n_pass; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1964 UINT16 n_v1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1965 UINT16 n_v2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1966 UINT16 n_v3; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1967 const UINT16 **p_n_mx; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1968 const UINT32 **p_n_cv; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1969 static const UINT16 n_zm = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1970 static const UINT32 n_zc = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1971 static const UINT16 *p_n_vx[] = { &VX0, &VX1, &VX2 }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1972 static const UINT16 *p_n_vy[] = { &VY0, &VY1, &VY2 }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1973 static const UINT16 *p_n_vz[] = { &VZ0, &VZ1, &VZ2 }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1974 static const UINT16 *p_n_rm[] = { &R11, &R12, &R13, &R21, &R22, &R23, &R31, &R32, &R33 }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1975 static const UINT16 *p_n_lm[] = { &L11, &L12, &L13, &L21, &L22, &L23, &L31, &L32, &L33 }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1976 static const UINT16 *p_n_cm[] = { &LR1, &LR2, &LR3, &LG1, &LG2, &LG3, &LB1, &LB2, &LB3 }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1977 static const UINT16 *p_n_zm[] = { &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1978 static const UINT16 **p_p_n_mx[] = { p_n_rm, p_n_lm, p_n_cm, p_n_zm }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1979 static const UINT32 *p_n_tr[] = { &TRX, &TRY, &TRZ }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1980 static const UINT32 *p_n_bk[] = { &RBK, &GBK, &BBK }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1981 static const UINT32 *p_n_fc[] = { &RFC, &GFC, &BFC }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1982 static const UINT32 *p_n_zc[] = { &n_zc, &n_zc, &n_zc }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1983 static const UINT32 **p_p_n_cv[] = { p_n_tr, p_n_bk, p_n_fc, p_n_zc }; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1984 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1985 switch( GTE_FUNCT( gteop ) ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1986 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1987 case 0x01: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1988 if( gteop == 0x0180001 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1989 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1990 GTELOG( "RTPS" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1991 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1992 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1993 MAC1 = A1( ( ( (INT64)(INT32)TRX << 12 ) + ( (INT16)R11 * (INT16)VX0 ) + ( (INT16)R12 * (INT16)VY0 ) + ( (INT16)R13 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1994 MAC2 = A2( ( ( (INT64)(INT32)TRY << 12 ) + ( (INT16)R21 * (INT16)VX0 ) + ( (INT16)R22 * (INT16)VY0 ) + ( (INT16)R23 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1995 MAC3 = A3( ( ( (INT64)(INT32)TRZ << 12 ) + ( (INT16)R31 * (INT16)VX0 ) + ( (INT16)R32 * (INT16)VY0 ) + ( (INT16)R33 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1996 IR1 = Lm_B1( (INT32)MAC1, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1997 IR2 = Lm_B2( (INT32)MAC2, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1998 IR3 = Lm_B3( (INT32)MAC3, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
1999 SZ0 = SZ1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2000 SZ1 = SZ2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2001 SZ2 = SZ3; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2002 SZ3 = Lm_D( (INT32)MAC3 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2003 SXY0 = SXY1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2004 SXY1 = SXY2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2005 SX2 = Lm_G1( F( (INT64)(INT32)OFX + ( (INT64)(INT16)IR1 * ( ( (UINT32)H << 16 ) / Lm_E( SZ3 ) ) ) ) >> 16 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2006 SY2 = Lm_G2( F( (INT64)(INT32)OFY + ( (INT64)(INT16)IR2 * ( ( (UINT32)H << 16 ) / Lm_E( SZ3 ) ) ) ) >> 16 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2007 MAC0 = F( (INT64)(INT32)DQB + ( (INT64)(INT16)DQA * ( ( (UINT32)H << 16 ) / Lm_E( SZ3 ) ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2008 IR0 = Lm_H( (INT32)MAC0 >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2009 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2010 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2011 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2012 case 0x06: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2013 if( gteop == 0x0400006 || |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2014 gteop == 0x1400006 || |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2015 gteop == 0x0155cc6 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2016 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2017 GTELOG( "NCLIP" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2018 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2019 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2020 MAC0 = F( ( (INT64)(INT16)SX0 * (INT16)SY1 ) + ( (INT16)SX1 * (INT16)SY2 ) + ( (INT16)SX2 * (INT16)SY0 ) - ( (INT16)SX0 * (INT16)SY2 ) - ( (INT16)SX1 * (INT16)SY0 ) - ( (INT16)SX2 * (INT16)SY1 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2021 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2022 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2023 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2024 case 0x0c: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2025 if( GTE_OP( gteop ) == 0x17 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2026 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2027 GTELOG( "OP" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2028 n_sf = 12 * GTE_SF( gteop ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2029 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2030 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2031 MAC1 = A1( ( ( (INT64)(INT32)D2 * (INT16)IR3 ) - ( (INT64)(INT32)D3 * (INT16)IR2 ) ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2032 MAC2 = A2( ( ( (INT64)(INT32)D3 * (INT16)IR1 ) - ( (INT64)(INT32)D1 * (INT16)IR3 ) ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2033 MAC3 = A3( ( ( (INT64)(INT32)D1 * (INT16)IR2 ) - ( (INT64)(INT32)D2 * (INT16)IR1 ) ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2034 IR1 = Lm_B1( (INT32)MAC1, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2035 IR2 = Lm_B2( (INT32)MAC2, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2036 IR3 = Lm_B3( (INT32)MAC3, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2037 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2038 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2039 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2040 case 0x10: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2041 if( gteop == 0x0780010 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2042 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2043 GTELOG( "DPCS" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2044 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2045 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2046 MAC1 = A1( ( ( (INT64)R << 16 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)RFC - ( R << 4 ), 0 ) ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2047 MAC2 = A2( ( ( (INT64)G << 16 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)GFC - ( G << 4 ), 0 ) ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2048 MAC3 = A3( ( ( (INT64)B << 16 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)BFC - ( B << 4 ), 0 ) ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2049 IR1 = Lm_B1( (INT32)MAC1, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2050 IR2 = Lm_B2( (INT32)MAC2, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2051 IR3 = Lm_B3( (INT32)MAC3, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2052 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2053 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2054 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2055 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2056 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2057 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2058 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2059 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2060 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2061 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2062 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2063 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2064 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2065 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2066 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2067 case 0x11: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2068 if( gteop == 0x0980011 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2069 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2070 GTELOG( "INTPL" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2071 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2072 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2073 MAC1 = A1( ( ( (INT64)(INT16)IR1 << 12 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)RFC - (INT16)IR1, 0 ) ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2074 MAC2 = A2( ( ( (INT64)(INT16)IR2 << 12 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)GFC - (INT16)IR2, 0 ) ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2075 MAC3 = A3( ( ( (INT64)(INT16)IR3 << 12 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)BFC - (INT16)IR3, 0 ) ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2076 IR1 = Lm_B1( (INT32)MAC1, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2077 IR2 = Lm_B2( (INT32)MAC2, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2078 IR3 = Lm_B3( (INT32)MAC3, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2079 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2080 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2081 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2082 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2083 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2084 R2 = Lm_C1( (INT32)MAC1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2085 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2086 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2087 G2 = Lm_C2( (INT32)MAC2 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2088 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2089 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2090 B2 = Lm_C3( (INT32)MAC3 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2091 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2092 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2093 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2094 case 0x12: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2095 if( GTE_OP( gteop ) == 0x04 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2096 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2097 GTELOG( "MVMVA" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2098 n_sf = 12 * GTE_SF( gteop ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2099 p_n_mx = p_p_n_mx[ GTE_MX( gteop ) ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2100 n_v = GTE_V( gteop ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2101 if( n_v < 3 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2102 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2103 n_v1 = *p_n_vx[ n_v ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2104 n_v2 = *p_n_vy[ n_v ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2105 n_v3 = *p_n_vz[ n_v ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2106 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2107 else |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2108 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2109 n_v1 = IR1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2110 n_v2 = IR2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2111 n_v3 = IR3; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2112 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2113 p_n_cv = p_p_n_cv[ GTE_CV( gteop ) ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2114 n_lm = GTE_LM( gteop ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2115 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2116 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2117 MAC1 = A1( ( ( (INT64)(INT32)*p_n_cv[ 0 ] << 12 ) + ( (INT16)*p_n_mx[ 0 ] * (INT16)n_v1 ) + ( (INT16)*p_n_mx[ 1 ] * (INT16)n_v2 ) + ( (INT16)*p_n_mx[ 2 ] * (INT16)n_v3 ) ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2118 MAC2 = A2( ( ( (INT64)(INT32)*p_n_cv[ 1 ] << 12 ) + ( (INT16)*p_n_mx[ 3 ] * (INT16)n_v1 ) + ( (INT16)*p_n_mx[ 4 ] * (INT16)n_v2 ) + ( (INT16)*p_n_mx[ 5 ] * (INT16)n_v3 ) ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2119 MAC3 = A3( ( ( (INT64)(INT32)*p_n_cv[ 2 ] << 12 ) + ( (INT16)*p_n_mx[ 6 ] * (INT16)n_v1 ) + ( (INT16)*p_n_mx[ 7 ] * (INT16)n_v2 ) + ( (INT16)*p_n_mx[ 8 ] * (INT16)n_v3 ) ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2120 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2121 IR1 = Lm_B1( (INT32)MAC1, n_lm ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2122 IR2 = Lm_B2( (INT32)MAC2, n_lm ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2123 IR3 = Lm_B3( (INT32)MAC3, n_lm ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2124 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2125 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2126 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2127 case 0x13: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2128 if( gteop == 0x0e80413 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2129 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2130 GTELOG( "NCDS" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2131 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2132 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2133 MAC1 = A1( ( ( (INT64)(INT16)L11 * (INT16)VX0 ) + ( (INT16)L12 * (INT16)VY0 ) + ( (INT16)L13 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2134 MAC2 = A2( ( ( (INT64)(INT16)L21 * (INT16)VX0 ) + ( (INT16)L22 * (INT16)VY0 ) + ( (INT16)L23 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2135 MAC3 = A3( ( ( (INT64)(INT16)L31 * (INT16)VX0 ) + ( (INT16)L32 * (INT16)VY0 ) + ( (INT16)L33 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2136 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2137 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2138 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2139 MAC1 = A1( ( ( (INT64)RBK << 12 ) + ( (INT16)LR1 * (INT16)IR1 ) + ( (INT16)LR2 * (INT16)IR2 ) + ( (INT16)LR3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2140 MAC2 = A2( ( ( (INT64)GBK << 12 ) + ( (INT16)LG1 * (INT16)IR1 ) + ( (INT16)LG2 * (INT16)IR2 ) + ( (INT16)LG3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2141 MAC3 = A3( ( ( (INT64)BBK << 12 ) + ( (INT16)LB1 * (INT16)IR1 ) + ( (INT16)LB2 * (INT16)IR2 ) + ( (INT16)LB3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2142 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2143 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2144 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2145 MAC1 = A1( ( ( ( (INT64)R << 4 ) * (INT16)IR1 ) + ( (INT16)IR0 * Lm_B1( (INT32)RFC - ( ( R * (INT16)IR1 ) >> 8 ), 0 ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2146 MAC2 = A2( ( ( ( (INT64)G << 4 ) * (INT16)IR2 ) + ( (INT16)IR0 * Lm_B2( (INT32)GFC - ( ( G * (INT16)IR2 ) >> 8 ), 0 ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2147 MAC3 = A3( ( ( ( (INT64)B << 4 ) * (INT16)IR3 ) + ( (INT16)IR0 * Lm_B3( (INT32)BFC - ( ( B * (INT16)IR3 ) >> 8 ), 0 ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2148 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2149 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2150 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2151 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2152 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2153 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2154 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2155 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2156 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2157 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2158 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2159 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2160 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2161 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2162 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2163 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2164 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2165 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2166 case 0x14: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2167 if( gteop == 0x1280414 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2168 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2169 GTELOG( "CDP" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2170 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2171 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2172 MAC1 = A1( ( ( (INT64)RBK << 12 ) + ( (INT16)LR1 * (INT16)IR1 ) + ( (INT16)LR2 * (INT16)IR2 ) + ( (INT16)LR3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2173 MAC2 = A2( ( ( (INT64)GBK << 12 ) + ( (INT16)LG1 * (INT16)IR1 ) + ( (INT16)LG2 * (INT16)IR2 ) + ( (INT16)LG3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2174 MAC3 = A3( ( ( (INT64)BBK << 12 ) + ( (INT16)LB1 * (INT16)IR1 ) + ( (INT16)LB2 * (INT16)IR2 ) + ( (INT16)LB3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2175 IR1 = Lm_B1( MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2176 IR2 = Lm_B2( MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2177 IR3 = Lm_B3( MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2178 MAC1 = A1( ( ( ( (INT64)R << 4 ) * (INT16)IR1 ) + ( (INT16)IR0 * Lm_B1( (INT32)RFC - ( ( R * (INT16)IR1 ) >> 8 ), 0 ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2179 MAC2 = A2( ( ( ( (INT64)G << 4 ) * (INT16)IR2 ) + ( (INT16)IR0 * Lm_B2( (INT32)GFC - ( ( G * (INT16)IR2 ) >> 8 ), 0 ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2180 MAC3 = A3( ( ( ( (INT64)B << 4 ) * (INT16)IR3 ) + ( (INT16)IR0 * Lm_B3( (INT32)BFC - ( ( B * (INT16)IR3 ) >> 8 ), 0 ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2181 IR1 = Lm_B1( MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2182 IR2 = Lm_B2( MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2183 IR3 = Lm_B3( MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2184 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2185 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2186 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2187 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2188 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2189 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2190 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2191 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2192 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2193 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2194 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2195 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2196 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2197 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2198 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2199 case 0x16: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2200 if( gteop == 0x0f80416 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2201 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2202 GTELOG( "NCDT" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2203 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2204 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2205 for( n_v = 0; n_v < 3; n_v++ ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2206 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2207 MAC1 = A1( ( ( (INT64)(INT16)L11 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)L12 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)L13 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2208 MAC2 = A2( ( ( (INT64)(INT16)L21 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)L22 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)L23 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2209 MAC3 = A3( ( ( (INT64)(INT16)L31 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)L32 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)L33 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2210 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2211 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2212 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2213 MAC1 = A1( ( ( (INT64)RBK << 12 ) + ( (INT16)LR1 * (INT16)IR1 ) + ( (INT16)LR2 * (INT16)IR2 ) + ( (INT16)LR3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2214 MAC2 = A2( ( ( (INT64)GBK << 12 ) + ( (INT16)LG1 * (INT16)IR1 ) + ( (INT16)LG2 * (INT16)IR2 ) + ( (INT16)LG3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2215 MAC3 = A3( ( ( (INT64)BBK << 12 ) + ( (INT16)LB1 * (INT16)IR1 ) + ( (INT16)LB2 * (INT16)IR2 ) + ( (INT16)LB3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2216 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2217 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2218 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2219 MAC1 = A1( ( ( ( (INT64)R << 4 ) * (INT16)IR1 ) + ( (INT16)IR0 * Lm_B1( (INT32)RFC - ( ( R * (INT16)IR1 ) >> 8 ), 0 ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2220 MAC2 = A2( ( ( ( (INT64)G << 4 ) * (INT16)IR2 ) + ( (INT16)IR0 * Lm_B2( (INT32)GFC - ( ( G * (INT16)IR2 ) >> 8 ), 0 ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2221 MAC3 = A3( ( ( ( (INT64)B << 4 ) * (INT16)IR3 ) + ( (INT16)IR0 * Lm_B3( (INT32)BFC - ( ( B * (INT16)IR3 ) >> 8 ), 0 ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2222 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2223 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2224 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2225 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2226 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2227 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2228 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2229 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2230 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2231 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2232 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2233 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2234 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2235 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2236 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2237 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2238 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2239 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2240 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2241 case 0x1b: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2242 if( gteop == 0x108041b ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2243 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2244 GTELOG( "NCCS" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2245 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2246 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2247 MAC1 = A1( ( ( (INT64)(INT16)L11 * (INT16)VX0 ) + ( (INT16)L12 * (INT16)VY0 ) + ( (INT16)L13 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2248 MAC2 = A2( ( ( (INT64)(INT16)L21 * (INT16)VX0 ) + ( (INT16)L22 * (INT16)VY0 ) + ( (INT16)L23 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2249 MAC3 = A3( ( ( (INT64)(INT16)L31 * (INT16)VX0 ) + ( (INT16)L32 * (INT16)VY0 ) + ( (INT16)L33 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2250 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2251 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2252 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2253 MAC1 = A1( ( ( (INT64)RBK << 12 ) + ( (INT16)LR1 * (INT16)IR1 ) + ( (INT16)LR2 * (INT16)IR2 ) + ( (INT16)LR3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2254 MAC2 = A2( ( ( (INT64)GBK << 12 ) + ( (INT16)LG1 * (INT16)IR1 ) + ( (INT16)LG2 * (INT16)IR2 ) + ( (INT16)LG3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2255 MAC3 = A3( ( ( (INT64)BBK << 12 ) + ( (INT16)LB1 * (INT16)IR1 ) + ( (INT16)LB2 * (INT16)IR2 ) + ( (INT16)LB3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2256 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2257 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2258 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2259 MAC1 = A1( ( (INT64)R * (INT16)IR1 ) >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2260 MAC2 = A2( ( (INT64)G * (INT16)IR2 ) >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2261 MAC3 = A3( ( (INT64)B * (INT16)IR3 ) >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2262 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2263 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2264 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2265 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2266 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2267 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2268 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2269 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2270 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2271 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2272 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2273 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2274 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2275 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2276 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2277 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2278 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2279 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2280 case 0x1c: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2281 if( gteop == 0x138041c ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2282 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2283 GTELOG( "CC" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2284 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2285 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2286 MAC1 = A1( ( ( (INT64)RBK << 12 ) + ( (INT16)LR1 * (INT16)IR1 ) + ( (INT16)LR2 * (INT16)IR2 ) + ( (INT16)LR3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2287 MAC2 = A2( ( ( (INT64)GBK << 12 ) + ( (INT16)LG1 * (INT16)IR1 ) + ( (INT16)LG2 * (INT16)IR2 ) + ( (INT16)LG3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2288 MAC3 = A3( ( ( (INT64)BBK << 12 ) + ( (INT16)LB1 * (INT16)IR1 ) + ( (INT16)LB2 * (INT16)IR2 ) + ( (INT16)LB3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2289 IR1 = Lm_B1( MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2290 IR2 = Lm_B2( MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2291 IR3 = Lm_B3( MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2292 MAC1 = A1( ( (INT64)R * (INT16)IR1 ) >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2293 MAC2 = A2( ( (INT64)G * (INT16)IR2 ) >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2294 MAC3 = A3( ( (INT64)B * (INT16)IR3 ) >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2295 IR1 = Lm_B1( MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2296 IR2 = Lm_B2( MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2297 IR3 = Lm_B3( MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2298 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2299 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2300 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2301 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2302 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2303 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2304 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2305 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2306 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2307 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2308 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2309 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2310 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2311 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2312 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2313 case 0x1e: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2314 if( gteop == 0x0c8041e ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2315 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2316 GTELOG( "NCS" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2317 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2318 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2319 MAC1 = A1( ( ( (INT64)(INT16)L11 * (INT16)VX0 ) + ( (INT16)L12 * (INT16)VY0 ) + ( (INT16)L13 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2320 MAC2 = A2( ( ( (INT64)(INT16)L21 * (INT16)VX0 ) + ( (INT16)L22 * (INT16)VY0 ) + ( (INT16)L23 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2321 MAC3 = A3( ( ( (INT64)(INT16)L31 * (INT16)VX0 ) + ( (INT16)L32 * (INT16)VY0 ) + ( (INT16)L33 * (INT16)VZ0 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2322 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2323 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2324 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2325 MAC1 = A1( ( ( (INT64)RBK << 12 ) + ( (INT16)LR1 * (INT16)IR1 ) + ( (INT16)LR2 * (INT16)IR2 ) + ( (INT16)LR3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2326 MAC2 = A2( ( ( (INT64)GBK << 12 ) + ( (INT16)LG1 * (INT16)IR1 ) + ( (INT16)LG2 * (INT16)IR2 ) + ( (INT16)LG3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2327 MAC3 = A3( ( ( (INT64)BBK << 12 ) + ( (INT16)LB1 * (INT16)IR1 ) + ( (INT16)LB2 * (INT16)IR2 ) + ( (INT16)LB3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2328 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2329 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2330 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2331 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2332 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2333 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2334 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2335 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2336 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2337 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2338 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2339 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2340 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2341 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2342 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2343 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2344 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2345 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2346 case 0x20: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2347 if( gteop == 0x0d80420 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2348 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2349 GTELOG( "NCT" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2350 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2351 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2352 for( n_v = 0; n_v < 3; n_v++ ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2353 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2354 MAC1 = A1( ( ( (INT64)(INT16)L11 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)L12 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)L13 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2355 MAC2 = A2( ( ( (INT64)(INT16)L21 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)L22 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)L23 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2356 MAC3 = A3( ( ( (INT64)(INT16)L31 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)L32 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)L33 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2357 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2358 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2359 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2360 MAC1 = A1( ( ( (INT64)RBK << 12 ) + ( (INT16)LR1 * (INT16)IR1 ) + ( (INT16)LR2 * (INT16)IR2 ) + ( (INT16)LR3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2361 MAC2 = A2( ( ( (INT64)GBK << 12 ) + ( (INT16)LG1 * (INT16)IR1 ) + ( (INT16)LG2 * (INT16)IR2 ) + ( (INT16)LG3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2362 MAC3 = A3( ( ( (INT64)BBK << 12 ) + ( (INT16)LB1 * (INT16)IR1 ) + ( (INT16)LB2 * (INT16)IR2 ) + ( (INT16)LB3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2363 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2364 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2365 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2366 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2367 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2368 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2369 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2370 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2371 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2372 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2373 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2374 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2375 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2376 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2377 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2378 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2379 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2380 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2381 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2382 case 0x28: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2383 if( GTE_OP( gteop ) == 0x0a && GTE_LM( gteop ) == 1 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2384 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2385 GTELOG( "SQR" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2386 n_sf = 12 * GTE_SF( gteop ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2387 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2388 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2389 MAC1 = A1( ( (INT64)(INT16)IR1 * (INT16)IR1 ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2390 MAC2 = A2( ( (INT64)(INT16)IR2 * (INT16)IR2 ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2391 MAC3 = A3( ( (INT64)(INT16)IR3 * (INT16)IR3 ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2392 IR1 = Lm_B1( MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2393 IR2 = Lm_B2( MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2394 IR3 = Lm_B3( MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2395 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2396 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2397 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2398 // DCPL 0x29 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2399 case 0x2a: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2400 if( gteop == 0x0f8002a ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2401 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2402 GTELOG( "DPCT" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2403 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2404 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2405 for( n_pass = 0; n_pass < 3; n_pass++ ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2406 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2407 MAC1 = A1( ( ( (INT64)R0 << 16 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)RFC - ( R0 << 4 ), 0 ) ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2408 MAC2 = A2( ( ( (INT64)G0 << 16 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)GFC - ( G0 << 4 ), 0 ) ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2409 MAC3 = A3( ( ( (INT64)B0 << 16 ) + ( (INT64)(INT16)IR0 * ( Lm_B1( (INT32)BFC - ( B0 << 4 ), 0 ) ) ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2410 IR1 = Lm_B1( (INT32)MAC1, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2411 IR2 = Lm_B2( (INT32)MAC2, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2412 IR3 = Lm_B3( (INT32)MAC3, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2413 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2414 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2415 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2416 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2417 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2418 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2419 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2420 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2421 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2422 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2423 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2424 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2425 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2426 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2427 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2428 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2429 case 0x2d: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2430 if( gteop == 0x158002d ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2431 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2432 GTELOG( "AVSZ3" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2433 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2434 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2435 MAC0 = F( ( (INT64)(INT16)ZSF3 * SZ1 ) + ( (INT16)ZSF3 * SZ2 ) + ( (INT16)ZSF3 * SZ3 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2436 OTZ = Lm_D( (INT32)MAC0 >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2437 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2438 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2439 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2440 case 0x2e: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2441 if( gteop == 0x168002e ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2442 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2443 GTELOG( "AVSZ4" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2444 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2445 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2446 MAC0 = F( ( (INT64)(INT16)ZSF4 * SZ0 ) + ( (INT16)ZSF4 * SZ1 ) + ( (INT16)ZSF4 * SZ2 ) + ( (INT16)ZSF4 * SZ3 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2447 OTZ = Lm_D( (INT32)MAC0 >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2448 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2449 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2450 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2451 case 0x30: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2452 if( gteop == 0x0280030 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2453 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2454 GTELOG( "RTPT" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2455 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2456 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2457 for( n_v = 0; n_v < 3; n_v++ ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2458 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2459 MAC1 = A1( ( ( (INT64)(INT32)TRX << 12 ) + ( (INT16)R11 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)R12 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)R13 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2460 MAC2 = A2( ( ( (INT64)(INT32)TRY << 12 ) + ( (INT16)R21 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)R22 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)R23 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2461 MAC3 = A3( ( ( (INT64)(INT32)TRZ << 12 ) + ( (INT16)R31 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)R32 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)R33 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2462 IR1 = Lm_B1( (INT32)MAC1, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2463 IR2 = Lm_B2( (INT32)MAC2, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2464 IR3 = Lm_B3( (INT32)MAC3, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2465 SZ0 = SZ1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2466 SZ1 = SZ2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2467 SZ2 = SZ3; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2468 SZ3 = Lm_D( (INT32)MAC3 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2469 SXY0 = SXY1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2470 SXY1 = SXY2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2471 SX2 = Lm_G1( F( ( (INT64)(INT32)OFX + ( (INT64)(INT16)IR1 * ( ( (UINT32)H << 16 ) / Lm_E( SZ3 ) ) ) ) >> 16 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2472 SY2 = Lm_G2( F( ( (INT64)(INT32)OFY + ( (INT64)(INT16)IR2 * ( ( (UINT32)H << 16 ) / Lm_E( SZ3 ) ) ) ) >> 16 ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2473 MAC0 = F( (INT64)(INT32)DQB + ( (INT64)(INT16)DQA * ( ( (UINT32)H << 16 ) / Lm_E( SZ3 ) ) ) ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2474 IR0 = Lm_H( (INT32)MAC0 >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2475 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2476 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2477 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2478 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2479 case 0x3d: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2480 if( GTE_OP( gteop ) == 0x09 || |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2481 GTE_OP( gteop ) == 0x19 ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2482 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2483 GTELOG( "GPF" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2484 n_sf = 12 * GTE_SF( gteop ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2485 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2486 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2487 MAC1 = A1( ( (INT64)(INT16)IR0 * (INT16)IR1 ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2488 MAC2 = A2( ( (INT64)(INT16)IR0 * (INT16)IR2 ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2489 MAC3 = A3( ( (INT64)(INT16)IR0 * (INT16)IR3 ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2490 IR1 = Lm_B1( (INT32)MAC1, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2491 IR2 = Lm_B2( (INT32)MAC2, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2492 IR3 = Lm_B3( (INT32)MAC3, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2493 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2494 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2495 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2496 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2497 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2498 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2499 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2500 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2501 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2502 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2503 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2504 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2505 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2506 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2507 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2508 case 0x3e: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2509 if( GTE_OP( gteop ) == 0x1a ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2510 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2511 GTELOG( "GPL" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2512 n_sf = 12 * GTE_SF( gteop ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2513 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2514 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2515 MAC1 = A1( ( ( (INT64)(INT32)MAC1 << n_sf ) + ( (INT16)IR0 * (INT16)IR1 ) ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2516 MAC2 = A2( ( ( (INT64)(INT32)MAC2 << n_sf ) + ( (INT16)IR0 * (INT16)IR2 ) ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2517 MAC3 = A3( ( ( (INT64)(INT32)MAC3 << n_sf ) + ( (INT16)IR0 * (INT16)IR3 ) ) >> n_sf ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2518 IR1 = Lm_B1( (INT32)MAC1, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2519 IR2 = Lm_B2( (INT32)MAC2, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2520 IR3 = Lm_B3( (INT32)MAC3, 0 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2521 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2522 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2523 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2524 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2525 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2526 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2527 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2528 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2529 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2530 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2531 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2532 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2533 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2534 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2535 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2536 case 0x3f: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2537 if( gteop == 0x108043f || |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2538 gteop == 0x118043f ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2539 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2540 GTELOG( "NCCT" ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2541 FLAG = 0; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2542 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2543 for( n_v = 0; n_v < 3; n_v++ ) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2544 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2545 MAC1 = A1( ( ( (INT64)(INT16)L11 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)L12 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)L13 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2546 MAC2 = A2( ( ( (INT64)(INT16)L21 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)L22 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)L23 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2547 MAC3 = A3( ( ( (INT64)(INT16)L31 * (INT16)*p_n_vx[ n_v ] ) + ( (INT16)L32 * (INT16)*p_n_vy[ n_v ] ) + ( (INT16)L33 * (INT16)*p_n_vz[ n_v ] ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2548 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2549 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2550 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2551 MAC1 = A1( ( ( (INT64)RBK << 12 ) + ( (INT16)LR1 * (INT16)IR1 ) + ( (INT16)LR2 * (INT16)IR2 ) + ( (INT16)LR3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2552 MAC2 = A2( ( ( (INT64)GBK << 12 ) + ( (INT16)LG1 * (INT16)IR1 ) + ( (INT16)LG2 * (INT16)IR2 ) + ( (INT16)LG3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2553 MAC3 = A3( ( ( (INT64)BBK << 12 ) + ( (INT16)LB1 * (INT16)IR1 ) + ( (INT16)LB2 * (INT16)IR2 ) + ( (INT16)LB3 * (INT16)IR3 ) ) >> 12 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2554 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2555 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2556 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2557 MAC1 = A1( ( (INT64)R * (INT16)IR1 ) >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2558 MAC2 = A2( ( (INT64)G * (INT16)IR2 ) >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2559 MAC3 = A3( ( (INT64)B * (INT16)IR3 ) >> 8 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2560 IR1 = Lm_B1( (INT32)MAC1, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2561 IR2 = Lm_B2( (INT32)MAC2, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2562 IR3 = Lm_B3( (INT32)MAC3, 1 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2563 CD0 = CD1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2564 CD1 = CD2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2565 CD2 = CODE; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2566 R0 = R1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2567 R1 = R2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2568 R2 = Lm_C1( (INT32)MAC1 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2569 G0 = G1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2570 G1 = G2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2571 G2 = Lm_C2( (INT32)MAC2 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2572 B0 = B1; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2573 B1 = B2; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2574 B2 = Lm_C3( (INT32)MAC3 >> 4 ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2575 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2576 return; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2577 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2578 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2579 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2580 // usrintf_showmessage_secs( 1, "unknown GTE op %08x", gteop ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2581 logerror( "%08x: unknown GTE op %08x\n", mipscpu.pc, gteop ); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2582 mips_stop(); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2583 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2584 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2585 /************************************************************************** |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2586 * Generic set_info |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2587 **************************************************************************/ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2588 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2589 void mips_set_info(UINT32 state, union cpuinfo *info) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2590 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2591 switch (state) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2592 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2593 /* --- the following bits of info are set as 64-bit signed integers --- */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2594 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ0: set_irq_line(MIPS_IRQ0, info->i); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2595 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ1: set_irq_line(MIPS_IRQ1, info->i); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2596 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ2: set_irq_line(MIPS_IRQ2, info->i); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2597 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ3: set_irq_line(MIPS_IRQ3, info->i); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2598 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ4: set_irq_line(MIPS_IRQ4, info->i); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2599 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ5: set_irq_line(MIPS_IRQ5, info->i); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2600 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2601 case CPUINFO_INT_PC: mips_set_pc( info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2602 case CPUINFO_INT_REGISTER + MIPS_PC: mips_set_pc( info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2603 case CPUINFO_INT_SP: /* no stack */ break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2604 case CPUINFO_INT_REGISTER + MIPS_DELAYV: mipscpu.delayv = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2605 case CPUINFO_INT_REGISTER + MIPS_DELAYR: if( info->i <= REGPC ) mipscpu.delayr = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2606 case CPUINFO_INT_REGISTER + MIPS_HI: mipscpu.hi = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2607 case CPUINFO_INT_REGISTER + MIPS_LO: mipscpu.lo = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2608 case CPUINFO_INT_REGISTER + MIPS_R0: mipscpu.r[ 0 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2609 case CPUINFO_INT_REGISTER + MIPS_R1: mipscpu.r[ 1 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2610 case CPUINFO_INT_REGISTER + MIPS_R2: mipscpu.r[ 2 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2611 case CPUINFO_INT_REGISTER + MIPS_R3: mipscpu.r[ 3 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2612 case CPUINFO_INT_REGISTER + MIPS_R4: mipscpu.r[ 4 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2613 case CPUINFO_INT_REGISTER + MIPS_R5: mipscpu.r[ 5 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2614 case CPUINFO_INT_REGISTER + MIPS_R6: mipscpu.r[ 6 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2615 case CPUINFO_INT_REGISTER + MIPS_R7: mipscpu.r[ 7 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2616 case CPUINFO_INT_REGISTER + MIPS_R8: mipscpu.r[ 8 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2617 case CPUINFO_INT_REGISTER + MIPS_R9: mipscpu.r[ 9 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2618 case CPUINFO_INT_REGISTER + MIPS_R10: mipscpu.r[ 10 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2619 case CPUINFO_INT_REGISTER + MIPS_R11: mipscpu.r[ 11 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2620 case CPUINFO_INT_REGISTER + MIPS_R12: mipscpu.r[ 12 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2621 case CPUINFO_INT_REGISTER + MIPS_R13: mipscpu.r[ 13 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2622 case CPUINFO_INT_REGISTER + MIPS_R14: mipscpu.r[ 14 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2623 case CPUINFO_INT_REGISTER + MIPS_R15: mipscpu.r[ 15 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2624 case CPUINFO_INT_REGISTER + MIPS_R16: mipscpu.r[ 16 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2625 case CPUINFO_INT_REGISTER + MIPS_R17: mipscpu.r[ 17 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2626 case CPUINFO_INT_REGISTER + MIPS_R18: mipscpu.r[ 18 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2627 case CPUINFO_INT_REGISTER + MIPS_R19: mipscpu.r[ 19 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2628 case CPUINFO_INT_REGISTER + MIPS_R20: mipscpu.r[ 20 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2629 case CPUINFO_INT_REGISTER + MIPS_R21: mipscpu.r[ 21 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2630 case CPUINFO_INT_REGISTER + MIPS_R22: mipscpu.r[ 22 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2631 case CPUINFO_INT_REGISTER + MIPS_R23: mipscpu.r[ 23 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2632 case CPUINFO_INT_REGISTER + MIPS_R24: mipscpu.r[ 24 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2633 case CPUINFO_INT_REGISTER + MIPS_R25: mipscpu.r[ 25 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2634 case CPUINFO_INT_REGISTER + MIPS_R26: mipscpu.r[ 26 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2635 case CPUINFO_INT_REGISTER + MIPS_R27: mipscpu.r[ 27 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2636 case CPUINFO_INT_REGISTER + MIPS_R28: mipscpu.r[ 28 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2637 case CPUINFO_INT_REGISTER + MIPS_R29: mipscpu.r[ 29 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2638 case CPUINFO_INT_REGISTER + MIPS_R30: mipscpu.r[ 30 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2639 case CPUINFO_INT_REGISTER + MIPS_R31: mipscpu.r[ 31 ] = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2640 case CPUINFO_INT_REGISTER + MIPS_CP0R0: mips_set_cp0r( 0, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2641 case CPUINFO_INT_REGISTER + MIPS_CP0R1: mips_set_cp0r( 1, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2642 case CPUINFO_INT_REGISTER + MIPS_CP0R2: mips_set_cp0r( 2, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2643 case CPUINFO_INT_REGISTER + MIPS_CP0R3: mips_set_cp0r( 3, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2644 case CPUINFO_INT_REGISTER + MIPS_CP0R4: mips_set_cp0r( 4, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2645 case CPUINFO_INT_REGISTER + MIPS_CP0R5: mips_set_cp0r( 5, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2646 case CPUINFO_INT_REGISTER + MIPS_CP0R6: mips_set_cp0r( 6, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2647 case CPUINFO_INT_REGISTER + MIPS_CP0R7: mips_set_cp0r( 7, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2648 case CPUINFO_INT_REGISTER + MIPS_CP0R8: mips_set_cp0r( 8, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2649 case CPUINFO_INT_REGISTER + MIPS_CP0R9: mips_set_cp0r( 9, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2650 case CPUINFO_INT_REGISTER + MIPS_CP0R10: mips_set_cp0r( 10, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2651 case CPUINFO_INT_REGISTER + MIPS_CP0R11: mips_set_cp0r( 11, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2652 case CPUINFO_INT_REGISTER + MIPS_CP0R12: mips_set_cp0r( 12, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2653 case CPUINFO_INT_REGISTER + MIPS_CP0R13: mips_set_cp0r( 13, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2654 case CPUINFO_INT_REGISTER + MIPS_CP0R14: mips_set_cp0r( 14, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2655 case CPUINFO_INT_REGISTER + MIPS_CP0R15: mips_set_cp0r( 15, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2656 case CPUINFO_INT_REGISTER + MIPS_CP0R16: mips_set_cp0r( 16, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2657 case CPUINFO_INT_REGISTER + MIPS_CP0R17: mips_set_cp0r( 17, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2658 case CPUINFO_INT_REGISTER + MIPS_CP0R18: mips_set_cp0r( 18, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2659 case CPUINFO_INT_REGISTER + MIPS_CP0R19: mips_set_cp0r( 19, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2660 case CPUINFO_INT_REGISTER + MIPS_CP0R20: mips_set_cp0r( 20, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2661 case CPUINFO_INT_REGISTER + MIPS_CP0R21: mips_set_cp0r( 21, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2662 case CPUINFO_INT_REGISTER + MIPS_CP0R22: mips_set_cp0r( 22, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2663 case CPUINFO_INT_REGISTER + MIPS_CP0R23: mips_set_cp0r( 23, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2664 case CPUINFO_INT_REGISTER + MIPS_CP0R24: mips_set_cp0r( 24, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2665 case CPUINFO_INT_REGISTER + MIPS_CP0R25: mips_set_cp0r( 25, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2666 case CPUINFO_INT_REGISTER + MIPS_CP0R26: mips_set_cp0r( 26, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2667 case CPUINFO_INT_REGISTER + MIPS_CP0R27: mips_set_cp0r( 27, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2668 case CPUINFO_INT_REGISTER + MIPS_CP0R28: mips_set_cp0r( 28, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2669 case CPUINFO_INT_REGISTER + MIPS_CP0R29: mips_set_cp0r( 29, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2670 case CPUINFO_INT_REGISTER + MIPS_CP0R30: mips_set_cp0r( 30, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2671 case CPUINFO_INT_REGISTER + MIPS_CP0R31: mips_set_cp0r( 31, info->i ); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2672 case CPUINFO_INT_REGISTER + MIPS_CP2DR0: mipscpu.cp2dr[ 0 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2673 case CPUINFO_INT_REGISTER + MIPS_CP2DR1: mipscpu.cp2dr[ 1 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2674 case CPUINFO_INT_REGISTER + MIPS_CP2DR2: mipscpu.cp2dr[ 2 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2675 case CPUINFO_INT_REGISTER + MIPS_CP2DR3: mipscpu.cp2dr[ 3 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2676 case CPUINFO_INT_REGISTER + MIPS_CP2DR4: mipscpu.cp2dr[ 4 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2677 case CPUINFO_INT_REGISTER + MIPS_CP2DR5: mipscpu.cp2dr[ 5 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2678 case CPUINFO_INT_REGISTER + MIPS_CP2DR6: mipscpu.cp2dr[ 6 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2679 case CPUINFO_INT_REGISTER + MIPS_CP2DR7: mipscpu.cp2dr[ 7 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2680 case CPUINFO_INT_REGISTER + MIPS_CP2DR8: mipscpu.cp2dr[ 8 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2681 case CPUINFO_INT_REGISTER + MIPS_CP2DR9: mipscpu.cp2dr[ 9 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2682 case CPUINFO_INT_REGISTER + MIPS_CP2DR10: mipscpu.cp2dr[ 10 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2683 case CPUINFO_INT_REGISTER + MIPS_CP2DR11: mipscpu.cp2dr[ 11 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2684 case CPUINFO_INT_REGISTER + MIPS_CP2DR12: mipscpu.cp2dr[ 12 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2685 case CPUINFO_INT_REGISTER + MIPS_CP2DR13: mipscpu.cp2dr[ 13 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2686 case CPUINFO_INT_REGISTER + MIPS_CP2DR14: mipscpu.cp2dr[ 14 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2687 case CPUINFO_INT_REGISTER + MIPS_CP2DR15: mipscpu.cp2dr[ 15 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2688 case CPUINFO_INT_REGISTER + MIPS_CP2DR16: mipscpu.cp2dr[ 16 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2689 case CPUINFO_INT_REGISTER + MIPS_CP2DR17: mipscpu.cp2dr[ 17 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2690 case CPUINFO_INT_REGISTER + MIPS_CP2DR18: mipscpu.cp2dr[ 18 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2691 case CPUINFO_INT_REGISTER + MIPS_CP2DR19: mipscpu.cp2dr[ 19 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2692 case CPUINFO_INT_REGISTER + MIPS_CP2DR20: mipscpu.cp2dr[ 20 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2693 case CPUINFO_INT_REGISTER + MIPS_CP2DR21: mipscpu.cp2dr[ 21 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2694 case CPUINFO_INT_REGISTER + MIPS_CP2DR22: mipscpu.cp2dr[ 22 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2695 case CPUINFO_INT_REGISTER + MIPS_CP2DR23: mipscpu.cp2dr[ 23 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2696 case CPUINFO_INT_REGISTER + MIPS_CP2DR24: mipscpu.cp2dr[ 24 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2697 case CPUINFO_INT_REGISTER + MIPS_CP2DR25: mipscpu.cp2dr[ 25 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2698 case CPUINFO_INT_REGISTER + MIPS_CP2DR26: mipscpu.cp2dr[ 26 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2699 case CPUINFO_INT_REGISTER + MIPS_CP2DR27: mipscpu.cp2dr[ 27 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2700 case CPUINFO_INT_REGISTER + MIPS_CP2DR28: mipscpu.cp2dr[ 28 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2701 case CPUINFO_INT_REGISTER + MIPS_CP2DR29: mipscpu.cp2dr[ 29 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2702 case CPUINFO_INT_REGISTER + MIPS_CP2DR30: mipscpu.cp2dr[ 30 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2703 case CPUINFO_INT_REGISTER + MIPS_CP2DR31: mipscpu.cp2dr[ 31 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2704 case CPUINFO_INT_REGISTER + MIPS_CP2CR0: mipscpu.cp2cr[ 0 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2705 case CPUINFO_INT_REGISTER + MIPS_CP2CR1: mipscpu.cp2cr[ 1 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2706 case CPUINFO_INT_REGISTER + MIPS_CP2CR2: mipscpu.cp2cr[ 2 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2707 case CPUINFO_INT_REGISTER + MIPS_CP2CR3: mipscpu.cp2cr[ 3 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2708 case CPUINFO_INT_REGISTER + MIPS_CP2CR4: mipscpu.cp2cr[ 4 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2709 case CPUINFO_INT_REGISTER + MIPS_CP2CR5: mipscpu.cp2cr[ 5 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2710 case CPUINFO_INT_REGISTER + MIPS_CP2CR6: mipscpu.cp2cr[ 6 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2711 case CPUINFO_INT_REGISTER + MIPS_CP2CR7: mipscpu.cp2cr[ 7 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2712 case CPUINFO_INT_REGISTER + MIPS_CP2CR8: mipscpu.cp2cr[ 8 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2713 case CPUINFO_INT_REGISTER + MIPS_CP2CR9: mipscpu.cp2cr[ 9 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2714 case CPUINFO_INT_REGISTER + MIPS_CP2CR10: mipscpu.cp2cr[ 10 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2715 case CPUINFO_INT_REGISTER + MIPS_CP2CR11: mipscpu.cp2cr[ 11 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2716 case CPUINFO_INT_REGISTER + MIPS_CP2CR12: mipscpu.cp2cr[ 12 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2717 case CPUINFO_INT_REGISTER + MIPS_CP2CR13: mipscpu.cp2cr[ 13 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2718 case CPUINFO_INT_REGISTER + MIPS_CP2CR14: mipscpu.cp2cr[ 14 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2719 case CPUINFO_INT_REGISTER + MIPS_CP2CR15: mipscpu.cp2cr[ 15 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2720 case CPUINFO_INT_REGISTER + MIPS_CP2CR16: mipscpu.cp2cr[ 16 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2721 case CPUINFO_INT_REGISTER + MIPS_CP2CR17: mipscpu.cp2cr[ 17 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2722 case CPUINFO_INT_REGISTER + MIPS_CP2CR18: mipscpu.cp2cr[ 18 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2723 case CPUINFO_INT_REGISTER + MIPS_CP2CR19: mipscpu.cp2cr[ 19 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2724 case CPUINFO_INT_REGISTER + MIPS_CP2CR20: mipscpu.cp2cr[ 20 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2725 case CPUINFO_INT_REGISTER + MIPS_CP2CR21: mipscpu.cp2cr[ 21 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2726 case CPUINFO_INT_REGISTER + MIPS_CP2CR22: mipscpu.cp2cr[ 22 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2727 case CPUINFO_INT_REGISTER + MIPS_CP2CR23: mipscpu.cp2cr[ 23 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2728 case CPUINFO_INT_REGISTER + MIPS_CP2CR24: mipscpu.cp2cr[ 24 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2729 case CPUINFO_INT_REGISTER + MIPS_CP2CR25: mipscpu.cp2cr[ 25 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2730 case CPUINFO_INT_REGISTER + MIPS_CP2CR26: mipscpu.cp2cr[ 26 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2731 case CPUINFO_INT_REGISTER + MIPS_CP2CR27: mipscpu.cp2cr[ 27 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2732 case CPUINFO_INT_REGISTER + MIPS_CP2CR28: mipscpu.cp2cr[ 28 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2733 case CPUINFO_INT_REGISTER + MIPS_CP2CR29: mipscpu.cp2cr[ 29 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2734 case CPUINFO_INT_REGISTER + MIPS_CP2CR30: mipscpu.cp2cr[ 30 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2735 case CPUINFO_INT_REGISTER + MIPS_CP2CR31: mipscpu.cp2cr[ 31 ].d = info->i; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2736 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2737 /* --- the following bits of info are set as pointers to data or functions --- */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2738 case CPUINFO_PTR_IRQ_CALLBACK: mipscpu.irq_callback = info->irqcallback; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2739 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2740 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2741 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2742 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2743 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2744 /************************************************************************** |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2745 * Generic get_info |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2746 **************************************************************************/ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2747 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2748 void mips_get_info(UINT32 state, union cpuinfo *info) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2749 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2750 switch (state) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2751 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2752 /* --- the following bits of info are returned as 64-bit signed integers --- */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2753 case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(mipscpu); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2754 case CPUINFO_INT_INPUT_LINES: info->i = 6; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2755 case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2756 case CPUINFO_INT_ENDIANNESS: info->i = CPU_IS_LE; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2757 case CPUINFO_INT_CLOCK_DIVIDER: info->i = 1; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2758 case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 4; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2759 case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 4; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2760 case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2761 case CPUINFO_INT_MAX_CYCLES: info->i = 40; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2762 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2763 case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2764 case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2765 case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2766 case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2767 case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA: info->i = 0; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2768 case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA: info->i = 0; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2769 case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2770 case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO: info->i = 0; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2771 case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO: info->i = 0; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2772 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2773 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ0: info->i = (mipscpu.cp0r[ CP0_CAUSE ] & 0x400) ? ASSERT_LINE : CLEAR_LINE; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2774 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ1: info->i = (mipscpu.cp0r[ CP0_CAUSE ] & 0x800) ? ASSERT_LINE : CLEAR_LINE; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2775 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ2: info->i = (mipscpu.cp0r[ CP0_CAUSE ] & 0x1000) ? ASSERT_LINE : CLEAR_LINE; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2776 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ3: info->i = (mipscpu.cp0r[ CP0_CAUSE ] & 0x2000) ? ASSERT_LINE : CLEAR_LINE; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2777 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ4: info->i = (mipscpu.cp0r[ CP0_CAUSE ] & 0x4000) ? ASSERT_LINE : CLEAR_LINE; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2778 case CPUINFO_INT_INPUT_STATE + MIPS_IRQ5: info->i = (mipscpu.cp0r[ CP0_CAUSE ] & 0x8000) ? ASSERT_LINE : CLEAR_LINE; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2779 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2780 case CPUINFO_INT_PREVIOUSPC: /* not implemented */ break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2781 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2782 case CPUINFO_INT_PC: info->i = mipscpu.pc; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2783 case CPUINFO_INT_REGISTER + MIPS_PC: info->i = mipscpu.pc; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2784 case CPUINFO_INT_SP: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2785 /* because there is no hardware stack and the pipeline causes the cpu to execute the |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2786 instruction after a subroutine call before the subroutine is executed there is little |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2787 chance of cmd_step_over() in mamedbg.c working. */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2788 info->i = 0; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2789 case CPUINFO_INT_REGISTER + MIPS_DELAYV: info->i = mipscpu.delayv; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2790 case CPUINFO_INT_REGISTER + MIPS_DELAYR: info->i = mipscpu.delayr; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2791 case CPUINFO_INT_REGISTER + MIPS_HI: info->i = mipscpu.hi; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2792 case CPUINFO_INT_REGISTER + MIPS_LO: info->i = mipscpu.lo; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2793 case CPUINFO_INT_REGISTER + MIPS_R0: info->i = mipscpu.r[ 0 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2794 case CPUINFO_INT_REGISTER + MIPS_R1: info->i = mipscpu.r[ 1 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2795 case CPUINFO_INT_REGISTER + MIPS_R2: info->i = mipscpu.r[ 2 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2796 case CPUINFO_INT_REGISTER + MIPS_R3: info->i = mipscpu.r[ 3 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2797 case CPUINFO_INT_REGISTER + MIPS_R4: info->i = mipscpu.r[ 4 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2798 case CPUINFO_INT_REGISTER + MIPS_R5: info->i = mipscpu.r[ 5 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2799 case CPUINFO_INT_REGISTER + MIPS_R6: info->i = mipscpu.r[ 6 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2800 case CPUINFO_INT_REGISTER + MIPS_R7: info->i = mipscpu.r[ 7 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2801 case CPUINFO_INT_REGISTER + MIPS_R8: info->i = mipscpu.r[ 8 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2802 case CPUINFO_INT_REGISTER + MIPS_R9: info->i = mipscpu.r[ 9 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2803 case CPUINFO_INT_REGISTER + MIPS_R10: info->i = mipscpu.r[ 10 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2804 case CPUINFO_INT_REGISTER + MIPS_R11: info->i = mipscpu.r[ 11 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2805 case CPUINFO_INT_REGISTER + MIPS_R12: info->i = mipscpu.r[ 12 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2806 case CPUINFO_INT_REGISTER + MIPS_R13: info->i = mipscpu.r[ 13 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2807 case CPUINFO_INT_REGISTER + MIPS_R14: info->i = mipscpu.r[ 14 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2808 case CPUINFO_INT_REGISTER + MIPS_R15: info->i = mipscpu.r[ 15 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2809 case CPUINFO_INT_REGISTER + MIPS_R16: info->i = mipscpu.r[ 16 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2810 case CPUINFO_INT_REGISTER + MIPS_R17: info->i = mipscpu.r[ 17 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2811 case CPUINFO_INT_REGISTER + MIPS_R18: info->i = mipscpu.r[ 18 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2812 case CPUINFO_INT_REGISTER + MIPS_R19: info->i = mipscpu.r[ 19 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2813 case CPUINFO_INT_REGISTER + MIPS_R20: info->i = mipscpu.r[ 20 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2814 case CPUINFO_INT_REGISTER + MIPS_R21: info->i = mipscpu.r[ 21 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2815 case CPUINFO_INT_REGISTER + MIPS_R22: info->i = mipscpu.r[ 22 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2816 case CPUINFO_INT_REGISTER + MIPS_R23: info->i = mipscpu.r[ 23 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2817 case CPUINFO_INT_REGISTER + MIPS_R24: info->i = mipscpu.r[ 24 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2818 case CPUINFO_INT_REGISTER + MIPS_R25: info->i = mipscpu.r[ 25 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2819 case CPUINFO_INT_REGISTER + MIPS_R26: info->i = mipscpu.r[ 26 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2820 case CPUINFO_INT_REGISTER + MIPS_R27: info->i = mipscpu.r[ 27 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2821 case CPUINFO_INT_REGISTER + MIPS_R28: info->i = mipscpu.r[ 28 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2822 case CPUINFO_INT_REGISTER + MIPS_R29: info->i = mipscpu.r[ 29 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2823 case CPUINFO_INT_REGISTER + MIPS_R30: info->i = mipscpu.r[ 30 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2824 case CPUINFO_INT_REGISTER + MIPS_R31: info->i = mipscpu.r[ 31 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2825 case CPUINFO_INT_REGISTER + MIPS_CP0R0: info->i = mipscpu.cp0r[ 0 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2826 case CPUINFO_INT_REGISTER + MIPS_CP0R1: info->i = mipscpu.cp0r[ 1 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2827 case CPUINFO_INT_REGISTER + MIPS_CP0R2: info->i = mipscpu.cp0r[ 2 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2828 case CPUINFO_INT_REGISTER + MIPS_CP0R3: info->i = mipscpu.cp0r[ 3 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2829 case CPUINFO_INT_REGISTER + MIPS_CP0R4: info->i = mipscpu.cp0r[ 4 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2830 case CPUINFO_INT_REGISTER + MIPS_CP0R5: info->i = mipscpu.cp0r[ 5 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2831 case CPUINFO_INT_REGISTER + MIPS_CP0R6: info->i = mipscpu.cp0r[ 6 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2832 case CPUINFO_INT_REGISTER + MIPS_CP0R7: info->i = mipscpu.cp0r[ 7 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2833 case CPUINFO_INT_REGISTER + MIPS_CP0R8: info->i = mipscpu.cp0r[ 8 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2834 case CPUINFO_INT_REGISTER + MIPS_CP0R9: info->i = mipscpu.cp0r[ 9 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2835 case CPUINFO_INT_REGISTER + MIPS_CP0R10: info->i = mipscpu.cp0r[ 10 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2836 case CPUINFO_INT_REGISTER + MIPS_CP0R11: info->i = mipscpu.cp0r[ 11 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2837 case CPUINFO_INT_REGISTER + MIPS_CP0R12: info->i = mipscpu.cp0r[ 12 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2838 case CPUINFO_INT_REGISTER + MIPS_CP0R13: info->i = mipscpu.cp0r[ 13 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2839 case CPUINFO_INT_REGISTER + MIPS_CP0R14: info->i = mipscpu.cp0r[ 14 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2840 case CPUINFO_INT_REGISTER + MIPS_CP0R15: info->i = mipscpu.cp0r[ 15 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2841 case CPUINFO_INT_REGISTER + MIPS_CP0R16: info->i = mipscpu.cp0r[ 16 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2842 case CPUINFO_INT_REGISTER + MIPS_CP0R17: info->i = mipscpu.cp0r[ 17 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2843 case CPUINFO_INT_REGISTER + MIPS_CP0R18: info->i = mipscpu.cp0r[ 18 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2844 case CPUINFO_INT_REGISTER + MIPS_CP0R19: info->i = mipscpu.cp0r[ 19 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2845 case CPUINFO_INT_REGISTER + MIPS_CP0R20: info->i = mipscpu.cp0r[ 20 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2846 case CPUINFO_INT_REGISTER + MIPS_CP0R21: info->i = mipscpu.cp0r[ 21 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2847 case CPUINFO_INT_REGISTER + MIPS_CP0R22: info->i = mipscpu.cp0r[ 22 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2848 case CPUINFO_INT_REGISTER + MIPS_CP0R23: info->i = mipscpu.cp0r[ 23 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2849 case CPUINFO_INT_REGISTER + MIPS_CP0R24: info->i = mipscpu.cp0r[ 24 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2850 case CPUINFO_INT_REGISTER + MIPS_CP0R25: info->i = mipscpu.cp0r[ 25 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2851 case CPUINFO_INT_REGISTER + MIPS_CP0R26: info->i = mipscpu.cp0r[ 26 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2852 case CPUINFO_INT_REGISTER + MIPS_CP0R27: info->i = mipscpu.cp0r[ 27 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2853 case CPUINFO_INT_REGISTER + MIPS_CP0R28: info->i = mipscpu.cp0r[ 28 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2854 case CPUINFO_INT_REGISTER + MIPS_CP0R29: info->i = mipscpu.cp0r[ 29 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2855 case CPUINFO_INT_REGISTER + MIPS_CP0R30: info->i = mipscpu.cp0r[ 30 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2856 case CPUINFO_INT_REGISTER + MIPS_CP0R31: info->i = mipscpu.cp0r[ 31 ]; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2857 case CPUINFO_INT_REGISTER + MIPS_CP2DR0: info->i = mipscpu.cp2dr[ 0 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2858 case CPUINFO_INT_REGISTER + MIPS_CP2DR1: info->i = mipscpu.cp2dr[ 1 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2859 case CPUINFO_INT_REGISTER + MIPS_CP2DR2: info->i = mipscpu.cp2dr[ 2 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2860 case CPUINFO_INT_REGISTER + MIPS_CP2DR3: info->i = mipscpu.cp2dr[ 3 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2861 case CPUINFO_INT_REGISTER + MIPS_CP2DR4: info->i = mipscpu.cp2dr[ 4 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2862 case CPUINFO_INT_REGISTER + MIPS_CP2DR5: info->i = mipscpu.cp2dr[ 5 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2863 case CPUINFO_INT_REGISTER + MIPS_CP2DR6: info->i = mipscpu.cp2dr[ 6 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2864 case CPUINFO_INT_REGISTER + MIPS_CP2DR7: info->i = mipscpu.cp2dr[ 7 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2865 case CPUINFO_INT_REGISTER + MIPS_CP2DR8: info->i = mipscpu.cp2dr[ 8 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2866 case CPUINFO_INT_REGISTER + MIPS_CP2DR9: info->i = mipscpu.cp2dr[ 9 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2867 case CPUINFO_INT_REGISTER + MIPS_CP2DR10: info->i = mipscpu.cp2dr[ 10 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2868 case CPUINFO_INT_REGISTER + MIPS_CP2DR11: info->i = mipscpu.cp2dr[ 11 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2869 case CPUINFO_INT_REGISTER + MIPS_CP2DR12: info->i = mipscpu.cp2dr[ 12 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2870 case CPUINFO_INT_REGISTER + MIPS_CP2DR13: info->i = mipscpu.cp2dr[ 13 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2871 case CPUINFO_INT_REGISTER + MIPS_CP2DR14: info->i = mipscpu.cp2dr[ 14 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2872 case CPUINFO_INT_REGISTER + MIPS_CP2DR15: info->i = mipscpu.cp2dr[ 15 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2873 case CPUINFO_INT_REGISTER + MIPS_CP2DR16: info->i = mipscpu.cp2dr[ 16 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2874 case CPUINFO_INT_REGISTER + MIPS_CP2DR17: info->i = mipscpu.cp2dr[ 17 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2875 case CPUINFO_INT_REGISTER + MIPS_CP2DR18: info->i = mipscpu.cp2dr[ 18 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2876 case CPUINFO_INT_REGISTER + MIPS_CP2DR19: info->i = mipscpu.cp2dr[ 19 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2877 case CPUINFO_INT_REGISTER + MIPS_CP2DR20: info->i = mipscpu.cp2dr[ 20 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2878 case CPUINFO_INT_REGISTER + MIPS_CP2DR21: info->i = mipscpu.cp2dr[ 21 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2879 case CPUINFO_INT_REGISTER + MIPS_CP2DR22: info->i = mipscpu.cp2dr[ 22 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2880 case CPUINFO_INT_REGISTER + MIPS_CP2DR23: info->i = mipscpu.cp2dr[ 23 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2881 case CPUINFO_INT_REGISTER + MIPS_CP2DR24: info->i = mipscpu.cp2dr[ 24 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2882 case CPUINFO_INT_REGISTER + MIPS_CP2DR25: info->i = mipscpu.cp2dr[ 25 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2883 case CPUINFO_INT_REGISTER + MIPS_CP2DR26: info->i = mipscpu.cp2dr[ 26 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2884 case CPUINFO_INT_REGISTER + MIPS_CP2DR27: info->i = mipscpu.cp2dr[ 27 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2885 case CPUINFO_INT_REGISTER + MIPS_CP2DR28: info->i = mipscpu.cp2dr[ 28 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2886 case CPUINFO_INT_REGISTER + MIPS_CP2DR29: info->i = mipscpu.cp2dr[ 29 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2887 case CPUINFO_INT_REGISTER + MIPS_CP2DR30: info->i = mipscpu.cp2dr[ 30 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2888 case CPUINFO_INT_REGISTER + MIPS_CP2DR31: info->i = mipscpu.cp2dr[ 31 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2889 case CPUINFO_INT_REGISTER + MIPS_CP2CR0: info->i = mipscpu.cp2cr[ 0 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2890 case CPUINFO_INT_REGISTER + MIPS_CP2CR1: info->i = mipscpu.cp2cr[ 1 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2891 case CPUINFO_INT_REGISTER + MIPS_CP2CR2: info->i = mipscpu.cp2cr[ 2 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2892 case CPUINFO_INT_REGISTER + MIPS_CP2CR3: info->i = mipscpu.cp2cr[ 3 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2893 case CPUINFO_INT_REGISTER + MIPS_CP2CR4: info->i = mipscpu.cp2cr[ 4 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2894 case CPUINFO_INT_REGISTER + MIPS_CP2CR5: info->i = mipscpu.cp2cr[ 5 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2895 case CPUINFO_INT_REGISTER + MIPS_CP2CR6: info->i = mipscpu.cp2cr[ 6 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2896 case CPUINFO_INT_REGISTER + MIPS_CP2CR7: info->i = mipscpu.cp2cr[ 7 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2897 case CPUINFO_INT_REGISTER + MIPS_CP2CR8: info->i = mipscpu.cp2cr[ 8 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2898 case CPUINFO_INT_REGISTER + MIPS_CP2CR9: info->i = mipscpu.cp2cr[ 9 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2899 case CPUINFO_INT_REGISTER + MIPS_CP2CR10: info->i = mipscpu.cp2cr[ 10 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2900 case CPUINFO_INT_REGISTER + MIPS_CP2CR11: info->i = mipscpu.cp2cr[ 11 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2901 case CPUINFO_INT_REGISTER + MIPS_CP2CR12: info->i = mipscpu.cp2cr[ 12 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2902 case CPUINFO_INT_REGISTER + MIPS_CP2CR13: info->i = mipscpu.cp2cr[ 13 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2903 case CPUINFO_INT_REGISTER + MIPS_CP2CR14: info->i = mipscpu.cp2cr[ 14 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2904 case CPUINFO_INT_REGISTER + MIPS_CP2CR15: info->i = mipscpu.cp2cr[ 15 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2905 case CPUINFO_INT_REGISTER + MIPS_CP2CR16: info->i = mipscpu.cp2cr[ 16 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2906 case CPUINFO_INT_REGISTER + MIPS_CP2CR17: info->i = mipscpu.cp2cr[ 17 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2907 case CPUINFO_INT_REGISTER + MIPS_CP2CR18: info->i = mipscpu.cp2cr[ 18 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2908 case CPUINFO_INT_REGISTER + MIPS_CP2CR19: info->i = mipscpu.cp2cr[ 19 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2909 case CPUINFO_INT_REGISTER + MIPS_CP2CR20: info->i = mipscpu.cp2cr[ 20 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2910 case CPUINFO_INT_REGISTER + MIPS_CP2CR21: info->i = mipscpu.cp2cr[ 21 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2911 case CPUINFO_INT_REGISTER + MIPS_CP2CR22: info->i = mipscpu.cp2cr[ 22 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2912 case CPUINFO_INT_REGISTER + MIPS_CP2CR23: info->i = mipscpu.cp2cr[ 23 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2913 case CPUINFO_INT_REGISTER + MIPS_CP2CR24: info->i = mipscpu.cp2cr[ 24 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2914 case CPUINFO_INT_REGISTER + MIPS_CP2CR25: info->i = mipscpu.cp2cr[ 25 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2915 case CPUINFO_INT_REGISTER + MIPS_CP2CR26: info->i = mipscpu.cp2cr[ 26 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2916 case CPUINFO_INT_REGISTER + MIPS_CP2CR27: info->i = mipscpu.cp2cr[ 27 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2917 case CPUINFO_INT_REGISTER + MIPS_CP2CR28: info->i = mipscpu.cp2cr[ 28 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2918 case CPUINFO_INT_REGISTER + MIPS_CP2CR29: info->i = mipscpu.cp2cr[ 29 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2919 case CPUINFO_INT_REGISTER + MIPS_CP2CR30: info->i = mipscpu.cp2cr[ 30 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2920 case CPUINFO_INT_REGISTER + MIPS_CP2CR31: info->i = mipscpu.cp2cr[ 31 ].d; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2921 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2922 /* --- the following bits of info are returned as pointers to data or functions --- */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2923 case CPUINFO_PTR_SET_INFO: info->setinfo = mips_set_info; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2924 case CPUINFO_PTR_GET_CONTEXT: info->getcontext = mips_get_context; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2925 case CPUINFO_PTR_SET_CONTEXT: info->setcontext = mips_set_context; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2926 case CPUINFO_PTR_INIT: info->init = mips_init; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2927 case CPUINFO_PTR_RESET: info->reset = mips_reset; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2928 case CPUINFO_PTR_EXIT: info->exit = mips_exit; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2929 case CPUINFO_PTR_EXECUTE: info->execute = mips_execute; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2930 case CPUINFO_PTR_BURN: info->burn = NULL; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2931 case CPUINFO_PTR_DISASSEMBLE: info->disassemble = mips_dasm; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2932 case CPUINFO_PTR_IRQ_CALLBACK: info->irqcallback = mipscpu.irq_callback; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2933 case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &mips_ICount; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2934 case CPUINFO_PTR_REGISTER_LAYOUT: info->p = mips_reg_layout; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2935 case CPUINFO_PTR_WINDOW_LAYOUT: info->p = mips_win_layout; break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2936 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2937 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2938 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2939 uint32 mips_get_cause(void) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2940 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2941 return mipscpu.cp0r[ CP0_CAUSE ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2942 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2943 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2944 uint32 mips_get_status(void) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2945 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2946 return mipscpu.cp0r[ CP0_SR ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2947 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2948 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2949 void mips_set_status(uint32 status) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2950 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2951 mipscpu.cp0r[ CP0_SR ] = status; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2952 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2953 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2954 uint32 mips_get_ePC(void) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2955 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2956 return mipscpu.cp0r[ CP0_EPC ]; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2957 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2958 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2959 int mips_get_icount(void) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2960 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2961 return mips_ICount; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2962 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2963 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2964 void mips_set_icount(int count) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2965 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2966 mips_ICount = count; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2967 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2968 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2969 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2970 #if (HAS_PSXCPU) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2971 /************************************************************************** |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2972 * CPU-specific set_info |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2973 **************************************************************************/ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2974 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2975 void psxcpu_get_info(UINT32 state, union cpuinfo *info) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2976 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2977 switch (state) |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2978 { |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2979 /* --- the following bits of info are returned as NULL-terminated strings --- */ |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2980 // case CPUINFO_STR_NAME: strcpy(info->s = cpuintrf_temp_str(), "PSX CPU"); break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2981 |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2982 default: |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2983 mips_get_info(state, info); |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2984 break; |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2985 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2986 } |
62cc6d667119
Import a bunch of stuff for new psf2 plugin.
William Pitcock <nenolod@atheme.org>
parents:
diff
changeset
|
2987 #endif |