| 1 | /* Mednafen - Multi-system Emulator |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation; either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program; if not, write to the Free Software |
| 15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 16 | */ |
| 17 | |
| 18 | #include "pce.h"cxx . . $ `<file>/mednafen/pce_fast/pce.h`/ |
| 19 | #include "vdc.h"cxx . . $ `<file>/mednafen/pce_fast/vdc.h`/ |
| 20 | |
| 21 | HuC6280cxx . . $ HuC6280# HuCPUcxx . . $ HuCPU.; |
| 22 | uint8cxx . . $ uint8# *HuCPUFastMapcxx . . $ HuCPUFastMap.[0x100]; |
| 23 | |
| 24 | #define HU_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:24:9`! PC_localcxx . . $ `mednafen/pce_fast/huc6280.cpp:555:9`! //HuCPU.PC |
| 25 | #define HU_PC_basecxx . . $ `mednafen/pce_fast/huc6280.cpp:25:9`! HuCPU.PC_base |
| 26 | #define HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`! HuCPU.A |
| 27 | #define HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`! X_local //HuCPU.X |
| 28 | #define HU_Ycxx . . $ `mednafen/pce_fast/huc6280.cpp:28:9`! Y_local //HuCPU.Y |
| 29 | #define HU_Scxx . . $ `mednafen/pce_fast/huc6280.cpp:29:9`! HuCPU.S |
| 30 | #define HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! P_localcxx . . $ `mednafen/pce_fast/huc6280.cpp:731:9`! //HuCPU.P |
| 31 | #define HU_PIcxx . . $ `mednafen/pce_fast/huc6280.cpp:31:9`! HuCPU.mooPI |
| 32 | #define HU_IRQlowcxx . . $ `mednafen/pce_fast/huc6280.cpp:32:9`! HuCPU.IRQlow |
| 33 | #define HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`! Page1_local |
| 34 | //HuCPU.Page1 |
| 35 | //Page1_local //HuCPU.Page1 |
| 36 | |
| 37 | #ifdef HUC6280_LAZY_FLAGScxx . . $ `mednafen/pce_fast/huc6280.h:6:9`! |
| 38 | #define HU_ZNFlagscxx . . $ `mednafen/pce_fast/huc6280.cpp:38:10`! HuCPU.ZNFlags |
| 39 | #endif |
| 40 | |
| 41 | |
| 42 | #ifdef HUC6280_CRAZY_VERSIONcxx . . $ `mednafen/pce_fast/huc6280.h:3:9`! |
| 43 | #define LOAD_LOCALS_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:43:9`!() register uint8 *PC_local = HuCPU.PC; |
| 44 | #else |
| 45 | #define LOAD_LOCALS_PC() register uint32 PC_local /*asm ("edi")*/ = HuCPU.PC; // asm ("edi") = HuCPU.PC; |
| 46 | #endif |
| 47 | |
| 48 | #define LOAD_LOCALScxx . . $ `mednafen/pce_fast/huc6280.cpp:48:9`!() \ |
| 49 | LOAD_LOCALS_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:43:9`!(); \ |
| 50 | uint8 X_local = HuCPU.X; \ |
| 51 | uint8 Y_local = HuCPU.Y; \ |
| 52 | uint8 P_local = HuCPU.P; \ |
| 53 | uint8 *Page1_local = HuCPU.Page1; |
| 54 | |
| 55 | #define SAVE_LOCALScxx . . $ `mednafen/pce_fast/huc6280.cpp:55:9`!() HuCPU.PC = PC_local; \ |
| 56 | HuCPU.X = X_local; \ |
| 57 | HuCPU.Y = Y_local; \ |
| 58 | HuCPU.P = P_local; \ |
| 59 | HuCPU.Page1 = Page1_local; |
| 60 | |
| 61 | #ifdef HUC6280_LAZY_FLAGScxx . . $ `mednafen/pce_fast/huc6280.h:6:9`! |
| 62 | #define COMPRESS_FLAGScxx . . $ `mednafen/pce_fast/huc6280.cpp:62:10`!() HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! &= ~(N_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:53:9`! | Z_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:59:9`!); HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! |= ((HU_ZNFlagscxx . . $ `mednafen/pce_fast/huc6280.cpp:38:10`! >> 24) & 0x80) | ((HU_ZNFlagscxx . . $ `mednafen/pce_fast/huc6280.cpp:38:10`! & 0xFF) ? 0 : Z_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:59:9`!); |
| 63 | //((((HU_ZNFlags & 0xFF) - 1) >> 8) & Z_FLAG); |
| 64 | #define EXPAND_FLAGScxx . . $ `mednafen/pce_fast/huc6280.cpp:64:10`!() HU_ZNFlagscxx . . $ `mednafen/pce_fast/huc6280.cpp:38:10`! = (HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! << 24) | ((HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! & Z_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:59:9`!) ^ Z_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:59:9`!); |
| 65 | #else |
| 66 | #define COMPRESS_FLAGS() |
| 67 | #define EXPAND_FLAGS() |
| 68 | #endif |
| 69 | |
| 70 | #ifdef HUC6280_CRAZY_VERSIONcxx . . $ `mednafen/pce_fast/huc6280.h:3:9`! |
| 71 | #define GetRealPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:71:10`!() ((unsigned int)(HU_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:24:9`! - HU_PC_basecxx . . $ `mednafen/pce_fast/huc6280.cpp:25:9`!)) |
| 72 | #define GetRealPC_EXTERNALcxx . . $ `mednafen/pce_fast/huc6280.cpp:72:10`!() ((unsigned int)(HuCPU.PC - HuCPU.PC_base)) |
| 73 | #else |
| 74 | #define GetRealPC() (HU_PC) |
| 75 | #define GetRealPC_EXTERNAL() (HuCPU.PC) |
| 76 | #endif |
| 77 | |
| 78 | #ifdef HUC6280_CRAZY_VERSIONcxx . . $ `mednafen/pce_fast/huc6280.h:3:9`! |
| 79 | #define SetPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:79:10`!(value) { unsigned int tempmoo = value; HU_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:24:9`! = &HuCPU.FastPageR[tempmoo >> 13][tempmoo]; \ |
| 80 | HU_PC_basecxx . . $ `mednafen/pce_fast/huc6280.cpp:25:9`! = HU_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:24:9`! - tempmoo; } |
| 81 | #define SetPC_EXTERNALcxx . . $ `mednafen/pce_fast/huc6280.cpp:81:10`!(value) { unsigned int tempmoo = value; \ |
| 82 | HuCPU.PC = &HuCPU.FastPageR[tempmoo >> 13][tempmoo]; HuCPU.PC_base = HuCPU.PC - tempmoo; } |
| 83 | #else |
| 84 | #define SetPC(value) { HU_PC = (value); } |
| 85 | #define SetPC_EXTERNAL(value) { HuCPU.PC = (value); } |
| 86 | #endif |
| 87 | |
| 88 | // Page change PC, GET IT?! |
| 89 | #ifdef HUC6280_CRAZY_VERSIONcxx . . $ `mednafen/pce_fast/huc6280.h:3:9`! |
| 90 | #define FixPC_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:90:10`!() SetPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:79:10`!(GetRealPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:71:10`!()); |
| 91 | #else |
| 92 | #define FixPC_PC() |
| 93 | #endif |
| 94 | |
| 95 | //#define IncPC() { HU_PC++; if(!(GetRealPC() & 0x1FFF)) printf("Bank crossing: %04x\n", GetRealPC()); } |
| 96 | //#define IncPC() HU_PC++; |
| 97 | #if 0 |
| 98 | #define IncPC() { HU_PC++; if(!(GetRealPC() & 0x1FFF) && \ |
| 99 | HuCPU.MPR[(GetRealPC() - 1) >> 13] != (HuCPU.MPR[(GetRealPC()) >> 13] - 1)) \ |
| 100 | printf("Bank crossing: %04x, %02x, %02x\n", GetRealPC(), HuCPU.MPR[(GetRealPC() - 1) >> 13], \ |
| 101 | HuCPU.MPR[GetRealPC() >> 13]); } |
| 102 | #else |
| 103 | #define IncPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:103:9`!() HU_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:24:9`!++; |
| 104 | #endif |
| 105 | |
| 106 | #ifdef HUC6280_CRAZY_VERSIONcxx . . $ `mednafen/pce_fast/huc6280.h:3:9`! |
| 107 | #define RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!() (*HU_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:24:9`!) |
| 108 | //#define RdAtAndIncPC_16() (HU_PC += 2, *(uint16 *)(HU_PC - 2)) |
| 109 | #else |
| 110 | #define RdAtPC() RdOp(HU_PC) |
| 111 | //#define RdAtAndIncPC_16() (RdOp(HU_PC++) | ((RdOp(HU_PC++) << 8))) |
| 112 | #endif |
| 113 | |
| 114 | // If we change this definition, we'll need to also fix HuC6280_StealCycle() in huc6280.h |
| 115 | #define ADDCYCcxx . . $ `mednafen/pce_fast/huc6280.cpp:115:9`!(x) { HuCPU.timestamp += x; } |
| 116 | |
| 117 | static uint8cxx . . $ uint8# dummy_bankcxx . . $ dummy_bank.[8192 + 8192]; // + 8192 for PC-as-ptr safety padding |
| 118 | |
| 119 | #define SET_MPRcxx . . $ `mednafen/pce_fast/huc6280.cpp:119:9`!(arg_i, arg_v) \ |
| 120 | { \ |
| 121 | const unsigned int wmpr = arg_i, wbank = arg_v; \ |
| 122 | if(wmpr == 1) \ |
| 123 | { \ |
| 124 | HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`! = HuCPUFastMap[wbank] ? HuCPUFastMap[wbank] + wbank * 8192 : dummy_bank; \ |
| 125 | } \ |
| 126 | HuCPU.MPR[wmpr] = wbank; \ |
| 127 | HuCPU.FastPageR[wmpr] = HuCPUFastMap[wbank] ? (HuCPUFastMap[wbank] + wbank * 8192) - wmpr * 8192 : (dummy_bank - wmpr * 8192); \ |
| 128 | } |
| 129 | |
| 130 | void HuC6280_SetMPRcxx . . $ HuC6280_SetMPR(3e454b8ccf442868).(int i, int v) |
| 131 | { |
| 132 | uint8cxx . . $ uint8# *Page1_local = HuCPUcxx . . $ HuCPU..Page1cxx . . $ __HuC6280#Page1.; |
| 133 | |
| 134 | SET_MPRcxx . . $ `mednafen/pce_fast/huc6280.cpp:119:9`!(i, v); |
| 135 | |
| 136 | HuCPUcxx . . $ HuCPU..Page1cxx . . $ __HuC6280#Page1. = Page1_local; |
| 137 | } |
| 138 | |
| 139 | |
| 140 | static void HuC6280_FlushMPRCachecxx . . $ HuC6280_FlushMPRCache(49f6e7a06ebc5aa8).(void) |
| 141 | { |
| 142 | for(int x = 0; x < 9; x++) |
| 143 | HuC6280_SetMPRcxx . . $ HuC6280_SetMPR(3e454b8ccf442868).(x, HuCPUcxx . . $ HuCPU..MPRcxx . . $ __HuC6280#MPR.[x & 0x7]); |
| 144 | } |
| 145 | |
| 146 | static INLINEcxx . . $ `mednafen/mednafen-types.h:21:11`! uint8cxx . . $ uint8# RdMemcxx . . $ RdMem(32407b39b2dfce37).(unsigned int A) |
| 147 | { |
| 148 | uint8cxx . . $ uint8# wmpr = HuCPUcxx . . $ HuCPU..MPRcxx . . $ __HuC6280#MPR.[A >> 13]; |
| 149 | return(PCEReadcxx . . $ PCERead.[wmpr]((wmpr << 13) | (A & 0x1FFF))); |
| 150 | } |
| 151 | |
| 152 | static INLINEcxx . . $ `mednafen/mednafen-types.h:21:11`! uint16cxx . . $ uint16# RdMem16cxx . . $ RdMem16(6557041c941ab807).(unsigned int A) |
| 153 | { |
| 154 | return(RdMemcxx . . $ RdMem(32407b39b2dfce37).(A) | (RdMemcxx . . $ RdMem(32407b39b2dfce37).(A + 1) << 8)); |
| 155 | } |
| 156 | |
| 157 | static INLINEcxx . . $ `mednafen/mednafen-types.h:21:11`! void WrMemcxx . . $ WrMem(cc289a6b3dfc48da).(unsigned int A, uint8cxx . . $ uint8# V) |
| 158 | { |
| 159 | uint8cxx . . $ uint8# wmpr = HuCPUcxx . . $ HuCPU..MPRcxx . . $ __HuC6280#MPR.[A >> 13]; |
| 160 | PCEWritecxx . . $ PCEWrite.[wmpr]((wmpr << 13) | (A & 0x1FFF), V); |
| 161 | } |
| 162 | |
| 163 | static INLINEcxx . . $ `mednafen/mednafen-types.h:21:11`! uint8cxx . . $ uint8# RdOpcxx . . $ RdOp(32407b39b2dfce37).(unsigned int A) |
| 164 | { |
| 165 | return(HuCPUcxx . . $ HuCPU..FastPageRcxx . . $ __HuC6280#FastPageR.[A >> 13][A]); |
| 166 | } |
| 167 | |
| 168 | #define PUSHcxx . . $ `mednafen/pce_fast/huc6280.cpp:168:9`!(V) \ |
| 169 | { \ |
| 170 | HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![0x100 + HU_Scxx . . $ `mednafen/pce_fast/huc6280.cpp:29:9`!] = V; \ |
| 171 | HU_Scxx . . $ `mednafen/pce_fast/huc6280.cpp:29:9`!--; \ |
| 172 | } |
| 173 | |
| 174 | #define PUSH_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:174:9`!() \ |
| 175 | { \ |
| 176 | unsigned int real_pc = GetRealPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:71:10`!(); \ |
| 177 | PUSHcxx . . $ `mednafen/pce_fast/huc6280.cpp:168:9`!(real_pc >> 8); \ |
| 178 | PUSHcxx . . $ `mednafen/pce_fast/huc6280.cpp:168:9`!(real_pc); \ |
| 179 | } |
| 180 | |
| 181 | #define POPcxx . . $ `mednafen/pce_fast/huc6280.cpp:181:9`!() HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![0x100 + ++HU_Scxx . . $ `mednafen/pce_fast/huc6280.cpp:29:9`!] |
| 182 | |
| 183 | #define POP_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:183:9`!() \ |
| 184 | { \ |
| 185 | unsigned int npc; \ |
| 186 | npc = POPcxx . . $ `mednafen/pce_fast/huc6280.cpp:181:9`!(); \ |
| 187 | npc |= POPcxx . . $ `mednafen/pce_fast/huc6280.cpp:181:9`!() << 8; \ |
| 188 | SetPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:79:10`!(npc); \ |
| 189 | } |
| 190 | |
| 191 | // Hopefully we never RTS to 0x0000. ;) |
| 192 | #define POP_PC_APcxx . . $ `mednafen/pce_fast/huc6280.cpp:192:9`!() \ |
| 193 | { \ |
| 194 | uint32 npc; \ |
| 195 | npc = POPcxx . . $ `mednafen/pce_fast/huc6280.cpp:181:9`!(); \ |
| 196 | npc |= POPcxx . . $ `mednafen/pce_fast/huc6280.cpp:181:9`!() << 8; \ |
| 197 | npc++; \ |
| 198 | SetPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:79:10`!(npc); \ |
| 199 | } |
| 200 | |
| 201 | /* Some of these operations will only make sense if you know what the flag |
| 202 | constants are. */ |
| 203 | |
| 204 | #ifdef HUC6280_LAZY_FLAGScxx . . $ `mednafen/pce_fast/huc6280.h:6:9`! |
| 205 | #define X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(zort) { HU_ZNFlagscxx . . $ `mednafen/pce_fast/huc6280.cpp:38:10`! = (int32)(int8)(uint8)(zort); } |
| 206 | #define X_ZN_BITcxx . . $ `mednafen/pce_fast/huc6280.cpp:206:9`!(opres, argie) { HU_ZNFlagscxx . . $ `mednafen/pce_fast/huc6280.cpp:38:10`! = (opres) | ((argie) << 24); } |
| 207 | #else |
| 208 | static uint8 ZNTable[256]; |
| 209 | #define X_ZN(zort) HU_P&=~(Z_FLAG|N_FLAG);HU_P|=ZNTable[zort] |
| 210 | #define X_ZN_BIT(opres, argie) { HU_P &= ~(Z_FLAG | N_FLAG); HU_P |= ZNTable[opres] & Z_FLAG; HU_P |= argie & N_FLAG; } |
| 211 | #endif |
| 212 | |
| 213 | #define JRcxx . . $ `mednafen/pce_fast/huc6280.cpp:213:9`!(cond) \ |
| 214 | { \ |
| 215 | if(cond) \ |
| 216 | { \ |
| 217 | int32 disp; \ |
| 218 | disp = 1 + (int8)RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!(); \ |
| 219 | ADDCYCcxx . . $ `mednafen/pce_fast/huc6280.cpp:115:9`!(2); \ |
| 220 | HU_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:24:9`!+=disp; \ |
| 221 | } \ |
| 222 | else IncPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:103:9`!(); \ |
| 223 | } |
| 224 | |
| 225 | #define BRAcxx . . $ `mednafen/pce_fast/huc6280.cpp:225:9`! \ |
| 226 | { \ |
| 227 | int32 disp; \ |
| 228 | disp = 1 + (int8)RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!(); \ |
| 229 | HU_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:24:9`!+=disp; \ |
| 230 | } |
| 231 | |
| 232 | #define BBRicxx . . $ `mednafen/pce_fast/huc6280.cpp:232:9`!(bitto) JRcxx . . $ `mednafen/pce_fast/huc6280.cpp:213:9`!(!(x & (1 << bitto))) |
| 233 | #define BBSicxx . . $ `mednafen/pce_fast/huc6280.cpp:233:9`!(bitto) JRcxx . . $ `mednafen/pce_fast/huc6280.cpp:213:9`!(x & (1 << bitto)) |
| 234 | |
| 235 | #define ST0cxx . . $ `mednafen/pce_fast/huc6280.cpp:235:9`! VDC_Write_ST(0, x) |
| 236 | #define ST1cxx . . $ `mednafen/pce_fast/huc6280.cpp:236:9`! VDC_Write_ST(2, x) |
| 237 | #define ST2cxx . . $ `mednafen/pce_fast/huc6280.cpp:237:9`! VDC_Write_ST(3, x) |
| 238 | |
| 239 | #define LDAcxx . . $ `mednafen/pce_fast/huc6280.cpp:239:9`! HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!=x;X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!) |
| 240 | #define LDXcxx . . $ `mednafen/pce_fast/huc6280.cpp:240:9`! HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`!=x;X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`!) |
| 241 | #define LDYcxx . . $ `mednafen/pce_fast/huc6280.cpp:241:9`! HU_Ycxx . . $ `mednafen/pce_fast/huc6280.cpp:28:9`!=x;X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(HU_Ycxx . . $ `mednafen/pce_fast/huc6280.cpp:28:9`!) |
| 242 | |
| 243 | /* All of the freaky arithmetic operations. */ |
| 244 | #define ANDcxx . . $ `mednafen/pce_fast/huc6280.cpp:244:9`! HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!&=x;X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!); |
| 245 | |
| 246 | // FIXME: |
| 247 | #define BITcxx . . $ `mednafen/pce_fast/huc6280.cpp:247:9`! HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&=~V_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:54:9`!; X_ZN_BITcxx . . $ `mednafen/pce_fast/huc6280.cpp:206:9`!(x & HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!, x); HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! |= x & V_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:54:9`!; |
| 248 | #define EORcxx . . $ `mednafen/pce_fast/huc6280.cpp:248:9`! HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!^=x;X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!); |
| 249 | #define ORAcxx . . $ `mednafen/pce_fast/huc6280.cpp:249:9`! HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!|=x;X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!); |
| 250 | |
| 251 | #define ADCcxx . . $ `mednafen/pce_fast/huc6280.cpp:251:9`! { \ |
| 252 | if(HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! & D_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:57:9`!) \ |
| 253 | { \ |
| 254 | uint32 tmp; \ |
| 255 | tmp = (HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`! & 0x0F) + (x & 0x0F) + (HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! & 1); \ |
| 256 | if(tmp >= 0x0A) \ |
| 257 | tmp += 0x06; \ |
| 258 | tmp += (HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`! & 0xF0) + (x & 0xF0); \ |
| 259 | if(tmp >= 0xA0) \ |
| 260 | tmp += 0x60; \ |
| 261 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! &= ~C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!; \ |
| 262 | if(tmp & 0xFF00) \ |
| 263 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! |= C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!; \ |
| 264 | HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`! = tmp; \ |
| 265 | X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!); \ |
| 266 | } \ |
| 267 | else \ |
| 268 | { \ |
| 269 | uint32 l=HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!+x+(HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&1); \ |
| 270 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&=~(C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!|V_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:54:9`!); \ |
| 271 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!|=((((HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!^x)&0x80)^0x80) & ((HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!^l)&0x80))>>1; \ |
| 272 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!|=(l>>8)&C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!; \ |
| 273 | HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!=l; \ |
| 274 | X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!); \ |
| 275 | } \ |
| 276 | } |
| 277 | |
| 278 | #define SBCcxx . . $ `mednafen/pce_fast/huc6280.cpp:278:9`! if(HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! & D_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:57:9`!) \ |
| 279 | { \ |
| 280 | const uint8 m = (HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`! & 0xF) - (x & 0xF) - ((HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! & 1) ^ 1); \ |
| 281 | const uint8 n = (HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`! >> 4) - (x >> 4) - ((m >> 4) & 1); \ |
| 282 | uint8 res = (n << 4) | (m & 0xF); \ |
| 283 | if(m & 0x10) \ |
| 284 | res -= 0x06; \ |
| 285 | if(n & 0x10) \ |
| 286 | res -= 0x60; \ |
| 287 | HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`! = res; \ |
| 288 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! &= ~C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!; \ |
| 289 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! |= ((n >> 4) & 0x1) ^ 1; \ |
| 290 | X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!); \ |
| 291 | } else { \ |
| 292 | uint32 l=HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!-x-((HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&1)^1); \ |
| 293 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&=~(C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!|V_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:54:9`!); \ |
| 294 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!|=((HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!^l)&(HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!^x)&0x80)>>1; \ |
| 295 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!|=((l>>8)&C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!)^C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!; \ |
| 296 | HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!=l; \ |
| 297 | X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!); \ |
| 298 | } |
| 299 | |
| 300 | #define CMPLcxx . . $ `mednafen/pce_fast/huc6280.cpp:300:9`!(a1,a2) { \ |
| 301 | uint32 t=a1-a2; \ |
| 302 | X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(t&0xFF); \ |
| 303 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&=~C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!; \ |
| 304 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!|=((t>>8)&C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!)^C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!; \ |
| 305 | } |
| 306 | |
| 307 | #define TAMcxx . . $ `mednafen/pce_fast/huc6280.cpp:307:9`! for(int i = 0; i < 8; i ++) { \ |
| 308 | if(x & (1 << i)) \ |
| 309 | { \ |
| 310 | SET_MPRcxx . . $ `mednafen/pce_fast/huc6280.cpp:119:9`!(i, HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!); \ |
| 311 | } \ |
| 312 | } SET_MPRcxx . . $ `mednafen/pce_fast/huc6280.cpp:119:9`!(8, HuCPU.MPR[0]); |
| 313 | |
| 314 | #define TMAcxx . . $ `mednafen/pce_fast/huc6280.cpp:314:9`! for(int i = 0; i < 8; i ++) { \ |
| 315 | if(x & (1 << i)) \ |
| 316 | HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`! = HuCPU.MPR[i]; \ |
| 317 | } |
| 318 | |
| 319 | #define CSLcxx . . $ `mednafen/pce_fast/huc6280.cpp:319:9`! |
| 320 | #define CSHcxx . . $ `mednafen/pce_fast/huc6280.cpp:320:9`! |
| 321 | |
| 322 | #define RMBcxx . . $ `mednafen/pce_fast/huc6280.cpp:322:9`!(bitto) x &= ~(1 << (bitto & 7)) |
| 323 | #define SMBcxx . . $ `mednafen/pce_fast/huc6280.cpp:323:9`!(bitto) x |= 1 << (bitto & 7) |
| 324 | |
| 325 | // FIXME |
| 326 | #define TSBcxx . . $ `mednafen/pce_fast/huc6280.cpp:326:9`! { HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! &= ~V_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:54:9`!; X_ZN_BITcxx . . $ `mednafen/pce_fast/huc6280.cpp:206:9`!(x | HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!, x); HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! |= x & V_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:54:9`!; x |= HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!; } |
| 327 | #define TRBcxx . . $ `mednafen/pce_fast/huc6280.cpp:327:9`! { HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! &= ~V_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:54:9`!; X_ZN_BITcxx . . $ `mednafen/pce_fast/huc6280.cpp:206:9`!(x & ~HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!, x); HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! |= x & V_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:54:9`!; x &= ~HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!; } |
| 328 | #define TSTcxx . . $ `mednafen/pce_fast/huc6280.cpp:328:9`! { HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! &= ~V_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:54:9`!; X_ZN_BITcxx . . $ `mednafen/pce_fast/huc6280.cpp:206:9`!(x & zoomhack, x); HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! |= x & V_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:54:9`!; } |
| 329 | |
| 330 | #define CMPcxx . . $ `mednafen/pce_fast/huc6280.cpp:330:9`! CMPLcxx . . $ `mednafen/pce_fast/huc6280.cpp:300:9`!(HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!,x) |
| 331 | #define CPXcxx . . $ `mednafen/pce_fast/huc6280.cpp:331:9`! CMPLcxx . . $ `mednafen/pce_fast/huc6280.cpp:300:9`!(HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`!,x) |
| 332 | #define CPYcxx . . $ `mednafen/pce_fast/huc6280.cpp:332:9`! CMPLcxx . . $ `mednafen/pce_fast/huc6280.cpp:300:9`!(HU_Ycxx . . $ `mednafen/pce_fast/huc6280.cpp:28:9`!,x) |
| 333 | |
| 334 | /* The following operations modify the byte being worked on. */ |
| 335 | #define DECcxx . . $ `mednafen/pce_fast/huc6280.cpp:335:9`! x--;X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(x) |
| 336 | #define INCcxx . . $ `mednafen/pce_fast/huc6280.cpp:336:9`! x++;X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(x) |
| 337 | |
| 338 | #define ASLcxx . . $ `mednafen/pce_fast/huc6280.cpp:338:9`! HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&=~C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!;HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!|=x>>7;x<<=1;X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(x) |
| 339 | #define LSRcxx . . $ `mednafen/pce_fast/huc6280.cpp:339:9`! HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&=~C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!;HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!|=x&1;x>>=1;X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(x) |
| 340 | |
| 341 | #define ROLcxx . . $ `mednafen/pce_fast/huc6280.cpp:341:9`! { \ |
| 342 | uint8 l=x>>7; \ |
| 343 | x<<=1; \ |
| 344 | x|=HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!; \ |
| 345 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&=~C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!; \ |
| 346 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!|=l; \ |
| 347 | X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(x); \ |
| 348 | } |
| 349 | #define RORcxx . . $ `mednafen/pce_fast/huc6280.cpp:349:9`! { \ |
| 350 | uint8 l=x&1; \ |
| 351 | x>>=1; \ |
| 352 | x|=(HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!)<<7; \ |
| 353 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&=~C_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:60:9`!; \ |
| 354 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!|=l; \ |
| 355 | X_ZNcxx . . $ `mednafen/pce_fast/huc6280.cpp:205:9`!(x); \ |
| 356 | } |
| 357 | |
| 358 | /* Absolute */ |
| 359 | #define GetABcxx . . $ `mednafen/pce_fast/huc6280.cpp:359:9`!(target) \ |
| 360 | { \ |
| 361 | target=RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!(); \ |
| 362 | IncPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:103:9`!(); \ |
| 363 | target|=RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!()<<8; \ |
| 364 | IncPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:103:9`!(); \ |
| 365 | } |
| 366 | |
| 367 | /* Absolute Indexed(for reads) */ |
| 368 | #define GetABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:368:9`!(target, i) \ |
| 369 | { \ |
| 370 | unsigned int tmp; \ |
| 371 | GetABcxx . . $ `mednafen/pce_fast/huc6280.cpp:359:9`!(tmp); \ |
| 372 | target=tmp; \ |
| 373 | target+=i; \ |
| 374 | } |
| 375 | |
| 376 | /* Zero Page */ |
| 377 | #define GetZPcxx . . $ `mednafen/pce_fast/huc6280.cpp:377:9`!(target) \ |
| 378 | { \ |
| 379 | target=RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!(); \ |
| 380 | IncPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:103:9`!(); \ |
| 381 | } |
| 382 | |
| 383 | /* Zero Page Indexed */ |
| 384 | #define GetZPIcxx . . $ `mednafen/pce_fast/huc6280.cpp:384:9`!(target,i) \ |
| 385 | { \ |
| 386 | target=i+RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!(); \ |
| 387 | IncPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:103:9`!(); \ |
| 388 | } |
| 389 | |
| 390 | /* Indirect */ |
| 391 | #define GetINDcxx . . $ `mednafen/pce_fast/huc6280.cpp:391:9`!(target) \ |
| 392 | { \ |
| 393 | uint8 tmp; \ |
| 394 | tmp=RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!(); \ |
| 395 | IncPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:103:9`!(); \ |
| 396 | target=HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![tmp]; \ |
| 397 | tmp++; \ |
| 398 | target|=HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![tmp]<<8; \ |
| 399 | } |
| 400 | |
| 401 | |
| 402 | /* Indexed Indirect */ |
| 403 | #define GetIXcxx . . $ `mednafen/pce_fast/huc6280.cpp:403:9`!(target) \ |
| 404 | { \ |
| 405 | uint8 tmp; \ |
| 406 | tmp=RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!(); \ |
| 407 | IncPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:103:9`!(); \ |
| 408 | tmp+=HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`!; \ |
| 409 | target=HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![tmp]; \ |
| 410 | tmp++; \ |
| 411 | target|=HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![tmp] <<8; \ |
| 412 | } |
| 413 | |
| 414 | /* Indirect Indexed(for reads) */ |
| 415 | #define GetIYcxx . . $ `mednafen/pce_fast/huc6280.cpp:415:9`!(target) \ |
| 416 | { \ |
| 417 | unsigned int rt; \ |
| 418 | uint8 tmp; \ |
| 419 | tmp=RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!(); \ |
| 420 | rt=HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![tmp]; \ |
| 421 | tmp++; \ |
| 422 | rt|=HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![tmp]<<8; \ |
| 423 | target = (rt + HU_Ycxx . . $ `mednafen/pce_fast/huc6280.cpp:28:9`!); \ |
| 424 | IncPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:103:9`!(); \ |
| 425 | } |
| 426 | |
| 427 | /* Now come the macros to wrap up all of the above stuff addressing mode functions |
| 428 | and operation macros. Note that operation macros will always operate(redundant |
| 429 | redundant) on the variable "x". |
| 430 | */ |
| 431 | |
| 432 | #define RMW_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:432:9`!(op) {uint8 x=HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!; op; HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!=x; break; } /* Meh... */ |
| 433 | #define RMW_ABcxx . . $ `mednafen/pce_fast/huc6280.cpp:433:9`!(op) {unsigned int EA; uint8 x; GetABcxx . . $ `mednafen/pce_fast/huc6280.cpp:359:9`!(EA); x=RdMem(EA); op; WrMem(EA,x); break; } |
| 434 | #define RMW_ABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:434:9`!(reg,op) {unsigned int EA; uint8 x; GetABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:368:9`!(EA,reg); x=RdMem(EA); op; WrMem(EA,x); break; } |
| 435 | #define RMW_ABXcxx . . $ `mednafen/pce_fast/huc6280.cpp:435:9`!(op) RMW_ABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:434:9`!(HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`!,op) |
| 436 | #define RMW_ABYcxx . . $ `mednafen/pce_fast/huc6280.cpp:436:9`!(op) RMW_ABI(HU_Y,op) |
| 437 | #define RMW_INDcxx . . $ `mednafen/pce_fast/huc6280.cpp:437:9`!(op) { unsigned int EA; uint8 x; GetIND(EA); x = RdMem(EA); op; WrMem(EA, x); break; } |
| 438 | #define RMW_IXcxx . . $ `mednafen/pce_fast/huc6280.cpp:438:9`!(op) { unsigned int EA; uint8 x; GetIX(EA); x=RdMem(EA); op; WrMem(EA,x); break; } |
| 439 | #define RMW_IYcxx . . $ `mednafen/pce_fast/huc6280.cpp:439:9`!(op) { unsigned int EA; uint8 x; GetIY(EA); x=RdMem(EA); op; WrMem(EA,x); break; } |
| 440 | #define RMW_ZPcxx . . $ `mednafen/pce_fast/huc6280.cpp:440:9`!(op) { uint8 EA; uint8 x; GetZPcxx . . $ `mednafen/pce_fast/huc6280.cpp:377:9`!(EA); x=HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![EA]; op; HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![EA] = x; break; } |
| 441 | #define RMW_ZPXcxx . . $ `mednafen/pce_fast/huc6280.cpp:441:9`!(op) { uint8 EA; uint8 x; GetZPIcxx . . $ `mednafen/pce_fast/huc6280.cpp:384:9`!(EA,HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`!); x=HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![EA]; op; HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![EA] = x; break;} |
| 442 | |
| 443 | #define LD_IMcxx . . $ `mednafen/pce_fast/huc6280.cpp:443:9`!(op) { uint8 x; x=RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!(); IncPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:103:9`!(); op; break; } |
| 444 | #define LD_ZPcxx . . $ `mednafen/pce_fast/huc6280.cpp:444:9`!(op) { uint8 EA; uint8 x; GetZPcxx . . $ `mednafen/pce_fast/huc6280.cpp:377:9`!(EA); x=HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![EA]; op; break; } |
| 445 | #define LD_ZPXcxx . . $ `mednafen/pce_fast/huc6280.cpp:445:9`!(op) { uint8 EA; uint8 x; GetZPIcxx . . $ `mednafen/pce_fast/huc6280.cpp:384:9`!(EA,HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`!); x=HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![EA]; op; break; } |
| 446 | #define LD_ZPYcxx . . $ `mednafen/pce_fast/huc6280.cpp:446:9`!(op) { uint8 EA; uint8 x; GetZPIcxx . . $ `mednafen/pce_fast/huc6280.cpp:384:9`!(EA,HU_Ycxx . . $ `mednafen/pce_fast/huc6280.cpp:28:9`!); x=HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![EA]; op; break; } |
| 447 | #define LD_ABcxx . . $ `mednafen/pce_fast/huc6280.cpp:447:9`!(op) { unsigned int EA; uint8 x; GetABcxx . . $ `mednafen/pce_fast/huc6280.cpp:359:9`!(EA); x=RdMem(EA); op; break; } |
| 448 | #define LD_ABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:448:9`!(reg,op) { unsigned int EA; uint8 x; GetABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:368:9`!(EA,reg); x=RdMem(EA); op; break; } |
| 449 | #define LD_ABXcxx . . $ `mednafen/pce_fast/huc6280.cpp:449:9`!(op) LD_ABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:448:9`!(HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`!,op) |
| 450 | #define LD_ABYcxx . . $ `mednafen/pce_fast/huc6280.cpp:450:9`!(op) LD_ABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:448:9`!(HU_Ycxx . . $ `mednafen/pce_fast/huc6280.cpp:28:9`!,op) |
| 451 | |
| 452 | #define LD_INDcxx . . $ `mednafen/pce_fast/huc6280.cpp:452:9`!(op) { unsigned int EA; uint8 x; GetINDcxx . . $ `mednafen/pce_fast/huc6280.cpp:391:9`!(EA); x=RdMem(EA); op; break; } |
| 453 | #define LD_IXcxx . . $ `mednafen/pce_fast/huc6280.cpp:453:9`!(op) { unsigned int EA; uint8 x; GetIXcxx . . $ `mednafen/pce_fast/huc6280.cpp:403:9`!(EA); x=RdMem(EA); op; break; } |
| 454 | #define LD_IYcxx . . $ `mednafen/pce_fast/huc6280.cpp:454:9`!(op) { unsigned int EA; uint8 x; GetIYcxx . . $ `mednafen/pce_fast/huc6280.cpp:415:9`!(EA); x=RdMem(EA); op; break; } |
| 455 | |
| 456 | #define BMT_PREHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:456:9`!(pork) HuCPU.in_block_move = IBM_##pork; |
| 457 | #define BMT_HONKHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:457:9`!(pork) if(HuCPU.timestamp >= next_user_event) goto GetOutBMT; continue_the_##pork: |
| 458 | |
| 459 | #define BMT_TDDcxx . . $ `mednafen/pce_fast/huc6280.cpp:459:9`! BMT_PREHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:456:9`!(TDD); do { ADDCYCcxx . . $ `mednafen/pce_fast/huc6280.cpp:115:9`!(6); WrMem(HuCPU.bmt_dest, RdMem(HuCPU.bmt_src)); HuCPU.bmt_src--; HuCPU.bmt_dest--; BMT_HONKHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:457:9`!(TDD); HuCPU.bmt_length--; } while(HuCPU.bmt_length); |
| 460 | #define BMT_TAIcxx . . $ `mednafen/pce_fast/huc6280.cpp:460:9`! BMT_PREHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:456:9`!(TAI); {HuCPU.bmt_alternate = 0; do { ADDCYCcxx . . $ `mednafen/pce_fast/huc6280.cpp:115:9`!(6); WrMem(HuCPU.bmt_dest, RdMem(HuCPU.bmt_src + HuCPU.bmt_alternate)); HuCPU.bmt_dest++; HuCPU.bmt_alternate ^= 1; BMT_HONKHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:457:9`!(TAI); HuCPU.bmt_length--; } while(HuCPU.bmt_length); } |
| 461 | #define BMT_TIAcxx . . $ `mednafen/pce_fast/huc6280.cpp:461:9`! BMT_PREHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:456:9`!(TIA); {HuCPU.bmt_alternate = 0; do { ADDCYCcxx . . $ `mednafen/pce_fast/huc6280.cpp:115:9`!(6); WrMem(HuCPU.bmt_dest + HuCPU.bmt_alternate, RdMem(HuCPU.bmt_src)); HuCPU.bmt_src++; HuCPU.bmt_alternate ^= 1; BMT_HONKHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:457:9`!(TIA); HuCPU.bmt_length--; } while(HuCPU.bmt_length); } |
| 462 | #define BMT_TIIcxx . . $ `mednafen/pce_fast/huc6280.cpp:462:9`! BMT_PREHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:456:9`!(TII); do { ADDCYCcxx . . $ `mednafen/pce_fast/huc6280.cpp:115:9`!(6); WrMem(HuCPU.bmt_dest, RdMem(HuCPU.bmt_src)); HuCPU.bmt_src++; HuCPU.bmt_dest++; BMT_HONKHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:457:9`!(TII); HuCPU.bmt_length--; } while(HuCPU.bmt_length); |
| 463 | #define BMT_TINcxx . . $ `mednafen/pce_fast/huc6280.cpp:463:9`! BMT_PREHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:456:9`!(TIN); do { ADDCYCcxx . . $ `mednafen/pce_fast/huc6280.cpp:115:9`!(6); WrMem(HuCPU.bmt_dest, RdMem(HuCPU.bmt_src)); HuCPU.bmt_src++; BMT_HONKHONKcxx . . $ `mednafen/pce_fast/huc6280.cpp:457:9`!(TIN); HuCPU.bmt_length--; } while(HuCPU.bmt_length); |
| 464 | |
| 465 | // Block memory transfer load |
| 466 | #define LD_BMTcxx . . $ `mednafen/pce_fast/huc6280.cpp:466:9`!(op) { PUSHcxx . . $ `mednafen/pce_fast/huc6280.cpp:168:9`!(HU_Ycxx . . $ `mednafen/pce_fast/huc6280.cpp:28:9`!); PUSHcxx . . $ `mednafen/pce_fast/huc6280.cpp:168:9`!(HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`!); PUSHcxx . . $ `mednafen/pce_fast/huc6280.cpp:168:9`!(HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`!); GetABcxx . . $ `mednafen/pce_fast/huc6280.cpp:359:9`!(HuCPU.bmt_src); GetABcxx . . $ `mednafen/pce_fast/huc6280.cpp:359:9`!(HuCPU.bmt_dest); GetABcxx . . $ `mednafen/pce_fast/huc6280.cpp:359:9`!(HuCPU.bmt_length); op; HuCPU.in_block_move = 0; HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`! = POPcxx . . $ `mednafen/pce_fast/huc6280.cpp:181:9`!(); HU_Acxx . . $ `mednafen/pce_fast/huc6280.cpp:26:9`! = POPcxx . . $ `mednafen/pce_fast/huc6280.cpp:181:9`!(); HU_Ycxx . . $ `mednafen/pce_fast/huc6280.cpp:28:9`! = POPcxx . . $ `mednafen/pce_fast/huc6280.cpp:181:9`!(); break; } |
| 467 | |
| 468 | #define ST_ZPcxx . . $ `mednafen/pce_fast/huc6280.cpp:468:9`!(r) {uint8 EA; GetZPcxx . . $ `mednafen/pce_fast/huc6280.cpp:377:9`!(EA); HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![EA] = r; break;} |
| 469 | #define ST_ZPXcxx . . $ `mednafen/pce_fast/huc6280.cpp:469:9`!(r) {uint8 EA; GetZPIcxx . . $ `mednafen/pce_fast/huc6280.cpp:384:9`!(EA,HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`!); HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![EA] = r; break;} |
| 470 | #define ST_ZPYcxx . . $ `mednafen/pce_fast/huc6280.cpp:470:9`!(r) {uint8 EA; GetZPIcxx . . $ `mednafen/pce_fast/huc6280.cpp:384:9`!(EA,HU_Ycxx . . $ `mednafen/pce_fast/huc6280.cpp:28:9`!); HU_Page1cxx . . $ `mednafen/pce_fast/huc6280.cpp:33:9`![EA] = r; break;} |
| 471 | #define ST_ABcxx . . $ `mednafen/pce_fast/huc6280.cpp:471:9`!(r) {unsigned int EA; GetABcxx . . $ `mednafen/pce_fast/huc6280.cpp:359:9`!(EA); WrMem(EA, r); break;} |
| 472 | #define ST_ABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:472:9`!(reg,r) {unsigned int EA; GetABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:368:9`!(EA,reg); WrMem(EA,r); break; } |
| 473 | #define ST_ABXcxx . . $ `mednafen/pce_fast/huc6280.cpp:473:9`!(r) ST_ABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:472:9`!(HU_Xcxx . . $ `mednafen/pce_fast/huc6280.cpp:27:9`!,r) |
| 474 | #define ST_ABYcxx . . $ `mednafen/pce_fast/huc6280.cpp:474:9`!(r) ST_ABIcxx . . $ `mednafen/pce_fast/huc6280.cpp:472:9`!(HU_Ycxx . . $ `mednafen/pce_fast/huc6280.cpp:28:9`!,r) |
| 475 | |
| 476 | #define ST_INDcxx . . $ `mednafen/pce_fast/huc6280.cpp:476:9`!(r) {unsigned int EA; GetINDcxx . . $ `mednafen/pce_fast/huc6280.cpp:391:9`!(EA); WrMem(EA,r); break; } |
| 477 | #define ST_IXcxx . . $ `mednafen/pce_fast/huc6280.cpp:477:9`!(r) {unsigned int EA; GetIXcxx . . $ `mednafen/pce_fast/huc6280.cpp:403:9`!(EA); WrMem(EA,r); break; } |
| 478 | #define ST_IYcxx . . $ `mednafen/pce_fast/huc6280.cpp:478:9`!(r) {unsigned int EA; GetIYcxx . . $ `mednafen/pce_fast/huc6280.cpp:415:9`!(EA); WrMem(EA,r); break; } |
| 479 | |
| 480 | static const uint8cxx . . $ uint8# CycTablecxx . . $ CycTable.[256] = |
| 481 | { |
| 482 | /*0x00*/ 8, 7, 3, 4, 6, 4, 6, 7, 3, 2, 2, 2, 7, 5, 7, 6, |
| 483 | /*0x10*/ 2, 7, 7, 4, 6, 4, 6, 7, 2, 5, 2, 2, 7, 5, 7, 6, |
| 484 | /*0x20*/ 7, 7, 3, 4, 4, 4, 6, 7, 4, 2, 2, 2, 5, 5, 7, 6, |
| 485 | /*0x30*/ 2, 7, 7, 2, 4, 4, 6, 7, 2, 5, 2, 2, 5, 5, 7, 6, |
| 486 | /*0x40*/ 7, 7, 3, 4, 8, 4, 6, 7, 3, 2, 2, 2, 4, 5, 7, 6, |
| 487 | /*0x50*/ 2, 7, 7, 5, 3, 4, 6, 7, 2, 5, 3, 2, 2, 5, 7, 6, |
| 488 | /*0x60*/ 7, 7, 2, 2, 4, 4, 6, 7, 4, 2, 2, 2, 7, 5, 7, 6, |
| 489 | /*0x70*/ 2, 7, 7, 17, 4, 4, 6, 7, 2, 5, 4, 2, 7, 5, 7, 6, |
| 490 | |
| 491 | /*0x80*/ 4, 7, 2, 7, 4, 4, 4, 7, 2, 2, 2, 2, 5, 5, 5, 6, |
| 492 | /*0x90*/ 2, 7, 7, 8, 4, 4, 4, 7, 2, 5, 2, 2, 5, 5, 5, 6, |
| 493 | /*0xA0*/ 2, 7, 2, 7, 4, 4, 4, 7, 2, 2, 2, 2, 5, 5, 5, 6, |
| 494 | /*0xB0*/ 2, 7, 7, 8, 4, 4, 4, 7, 2, 5, 2, 2, 5, 5, 5, 6, |
| 495 | /*0xC0*/ 2, 7, 2, 17, 4, 4, 6, 7, 2, 2, 2, 2, 5, 5, 7, 6, |
| 496 | /*0xD0*/ 2, 7, 7, 17, 3, 4, 6, 7, 2, 5, 3, 2, 2, 5, 7, 6, |
| 497 | /*0xE0*/ 2, 7, 2, 17, 4, 4, 6, 7, 2, 2, 2, 2, 5, 5, 7, 6, |
| 498 | /*0xF0*/ 2, 7, 7, 17, 2, 4, 6, 7, 2, 5, 4, 2, 2, 5, 7, 6, |
| 499 | }; |
| 500 | #if 0 |
| 501 | static bool WillIRQOccur(void) NO_INLINE; |
| 502 | static bool WillIRQOccur(void) |
| 503 | { |
| 504 | bool ret = false; |
| 505 | |
| 506 | if(HU_IRQlow) |
| 507 | { |
| 508 | if(!(HU_PI&I_FLAG)) |
| 509 | { |
| 510 | if(HU_IRQlow & MDFN_IQTIMER & HuCPU.IRQMaskDelay) |
| 511 | ret = true; |
| 512 | else if((HU_IRQlow & MDFN_IQIRQ1 & HuCPU.IRQMaskDelay) || ((HU_IRQlow >> 8) & MDFN_IQIRQ1 & HuCPU.IRQMaskDelay)) |
| 513 | ret = true; |
| 514 | else if(HU_IRQlow & MDFN_IQIRQ2 & HuCPU.IRQMaskDelay) |
| 515 | ret = true; |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | return(true); |
| 520 | } |
| 521 | #endif |
| 522 | |
| 523 | void HuC6280_IRQBegincxx . . $ HuC6280_IRQBegin(d4f767463ce0a6b3).(int w) |
| 524 | { |
| 525 | HU_IRQlowcxx . . $ `mednafen/pce_fast/huc6280.cpp:32:9`!|=w; |
| 526 | } |
| 527 | |
| 528 | void HuC6280_IRQEndcxx . . $ HuC6280_IRQEnd(d4f767463ce0a6b3).(int w) |
| 529 | { |
| 530 | HU_IRQlowcxx . . $ `mednafen/pce_fast/huc6280.cpp:32:9`!&=~w; |
| 531 | } |
| 532 | |
| 533 | void HuC6280_Resetcxx . . $ HuC6280_Reset(49f6e7a06ebc5aa8).(void) |
| 534 | { |
| 535 | HuCPUcxx . . $ HuCPU..timer_next_timestampcxx . . $ __HuC6280#timer_next_timestamp. = HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. + 1024; |
| 536 | |
| 537 | HuCPUcxx . . $ HuCPU..timer_loadcxx . . $ __HuC6280#timer_load. = 0; |
| 538 | HuCPUcxx . . $ HuCPU..timer_valuecxx . . $ __HuC6280#timer_value. = 0; |
| 539 | HuCPUcxx . . $ HuCPU..timer_statuscxx . . $ __HuC6280#timer_status. = 0; |
| 540 | HuCPUcxx . . $ HuCPU..in_block_movecxx . . $ __HuC6280#in_block_move. = 0; |
| 541 | |
| 542 | unsigned int npc; |
| 543 | |
| 544 | HuCPUcxx . . $ HuCPU..IRQMaskcxx . . $ __HuC6280#IRQMask. = HuCPUcxx . . $ HuCPU..IRQMaskDelaycxx . . $ __HuC6280#IRQMaskDelay. = 7; |
| 545 | |
| 546 | HuC6280_SetMPRcxx . . $ HuC6280_SetMPR(3e454b8ccf442868).(0, 0xFF); |
| 547 | HuC6280_SetMPRcxx . . $ HuC6280_SetMPR(3e454b8ccf442868).(8, 0xFF); |
| 548 | HuC6280_SetMPRcxx . . $ HuC6280_SetMPR(3e454b8ccf442868).(1, 0xF8); |
| 549 | |
| 550 | for(int i = 2; i < 8; i++) |
| 551 | HuC6280_SetMPRcxx . . $ HuC6280_SetMPR(3e454b8ccf442868).(i, 0); |
| 552 | |
| 553 | npc = RdMem16cxx . . $ RdMem16(6557041c941ab807).(0xFFFE); |
| 554 | |
| 555 | #define PC_localcxx . . $ `mednafen/pce_fast/huc6280.cpp:555:9`! HuCPU.PC |
| 556 | SetPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:79:10`!(npc); |
| 557 | #undef PC_localcxx . . $ `mednafen/pce_fast/huc6280.cpp:555:9`! |
| 558 | |
| 559 | HuCPUcxx . . $ HuCPU..mooPIcxx . . $ __HuC6280#mooPI. = I_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:58:9`!; |
| 560 | HuCPUcxx . . $ HuCPU..Pcxx . . $ __HuC6280#P. = I_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:58:9`!; |
| 561 | |
| 562 | HU_IRQlowcxx . . $ `mednafen/pce_fast/huc6280.cpp:32:9`! = 0; |
| 563 | } |
| 564 | |
| 565 | void HuC6280_Initcxx . . $ HuC6280_Init(49f6e7a06ebc5aa8).(void) |
| 566 | { |
| 567 | memset((void *)&HuCPUcxx . . $ HuCPU.,0,sizeof(HuCPUcxx . . $ HuCPU.)); |
| 568 | memset(dummy_bankcxx . . $ dummy_bank., 0, sizeof(dummy_bankcxx . . $ dummy_bank.)); |
| 569 | |
| 570 | #ifdef HUC6280_LAZY_FLAGScxx . . $ `mednafen/pce_fast/huc6280.h:6:9`! |
| 571 | |
| 572 | #else |
| 573 | for(int x=0; x < 256; x++) |
| 574 | if(!x) ZNTable[x]=Z_FLAG; |
| 575 | else if (x&0x80) ZNTable[x]=N_FLAG; |
| 576 | else ZNTable[x]=0; |
| 577 | #endif |
| 578 | } |
| 579 | |
| 580 | void HuC6280_Powercxx . . $ HuC6280_Power(49f6e7a06ebc5aa8).(void) |
| 581 | { |
| 582 | HuCPUcxx . . $ HuCPU..IRQlowcxx . . $ __HuC6280#IRQlow. = 0; |
| 583 | |
| 584 | HuCPUcxx . . $ HuCPU..Acxx . . $ __HuC6280#A. = 0; |
| 585 | HuCPUcxx . . $ HuCPU..Xcxx . . $ __HuC6280#X. = 0; |
| 586 | HuCPUcxx . . $ HuCPU..Ycxx . . $ __HuC6280#Y. = 0; |
| 587 | HuCPUcxx . . $ HuCPU..Scxx . . $ __HuC6280#S. = 0; |
| 588 | HuCPUcxx . . $ HuCPU..Pcxx . . $ __HuC6280#P. = 0; |
| 589 | HuCPUcxx . . $ HuCPU..mooPIcxx . . $ __HuC6280#mooPI. = 0; |
| 590 | |
| 591 | #if 0 |
| 592 | HU_PC = HU_PC_base = NULL; |
| 593 | #else |
| 594 | HuCPUcxx . . $ HuCPU..PCcxx . . $ __HuC6280#PC. = 0; |
| 595 | #endif |
| 596 | |
| 597 | HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. = 0; |
| 598 | |
| 599 | for(int i = 0; i < 9; i++) |
| 600 | { |
| 601 | HuCPUcxx . . $ HuCPU..MPRcxx . . $ __HuC6280#MPR.[i] = 0; |
| 602 | HuCPUcxx . . $ HuCPU..FastPageRcxx . . $ __HuC6280#FastPageR.[i] = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 603 | } |
| 604 | HuC6280_Resetcxx . . $ HuC6280_Reset(49f6e7a06ebc5aa8).(); |
| 605 | } |
| 606 | |
| 607 | void HuC6280_Runcxx . . $ HuC6280_Run(d4f767463ce0a6b3).(int32cxx . . $ int32# cycles) |
| 608 | { |
| 609 | const int32cxx . . $ int32# next_user_event = HuCPUcxx . . $ HuCPU..previous_next_user_eventcxx . . $ __HuC6280#previous_next_user_event. + cycles * pce_overclockedcxx . . $ pce_overclocked.; |
| 610 | |
| 611 | HuCPUcxx . . $ HuCPU..previous_next_user_eventcxx . . $ __HuC6280#previous_next_user_event. = next_user_event; |
| 612 | |
| 613 | LOAD_LOCALScxx . . $ `mednafen/pce_fast/huc6280.cpp:48:9`!(); |
| 614 | |
| 615 | if(HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. >= next_user_event) |
| 616 | return; |
| 617 | |
| 618 | int32cxx . . $ int32# next_event; |
| 619 | |
| 620 | if(HuCPUcxx . . $ HuCPU..in_block_movecxx . . $ __HuC6280#in_block_move.) |
| 621 | { |
| 622 | next_event = (next_user_event < HuCPUcxx . . $ HuCPU..timer_next_timestampcxx . . $ __HuC6280#timer_next_timestamp.) ? next_user_event : HuCPUcxx . . $ HuCPU..timer_next_timestampcxx . . $ __HuC6280#timer_next_timestamp.; |
| 623 | |
| 624 | switch(HuCPUcxx . . $ HuCPU..in_block_movecxx . . $ __HuC6280#in_block_move.) |
| 625 | { |
| 626 | case IBM_TIAcxx . . $ `mednafen/pce_fast/huc6280.h:38:10`!: goto continue_the_TIA; |
| 627 | case IBM_TAIcxx . . $ `mednafen/pce_fast/huc6280.h:39:10`!: goto continue_the_TAI; |
| 628 | case IBM_TDDcxx . . $ `mednafen/pce_fast/huc6280.h:40:10`!: goto continue_the_TDD; |
| 629 | case IBM_TIIcxx . . $ `mednafen/pce_fast/huc6280.h:41:10`!: goto continue_the_TII; |
| 630 | case IBM_TINcxx . . $ `mednafen/pce_fast/huc6280.h:42:10`!: goto continue_the_TIN; |
| 631 | } |
| 632 | } |
| 633 | |
| 634 | while(MDFN_LIKELYcxx . . $ `mednafen/mednafen-types.h:19:9`!(HuCPU.timestamp < next_user_event)) |
| 635 | { |
| 636 | next_event = (next_user_event < HuCPUcxx . . $ HuCPU..timer_next_timestampcxx . . $ __HuC6280#timer_next_timestamp.) ? next_user_event : HuCPUcxx . . $ HuCPU..timer_next_timestampcxx . . $ __HuC6280#timer_next_timestamp.; |
| 637 | |
| 638 | while(MDFN_LIKELYcxx . . $ `mednafen/mednafen-types.h:19:9`!(HuCPU.timestamp < next_event)) |
| 639 | { |
| 640 | uint8cxx . . $ uint8# b1; |
| 641 | |
| 642 | if(HU_IRQlowcxx . . $ `mednafen/pce_fast/huc6280.cpp:32:9`!) |
| 643 | { |
| 644 | if(!(HU_PIcxx . . $ `mednafen/pce_fast/huc6280.cpp:31:9`!&I_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:58:9`!)) |
| 645 | { |
| 646 | uint32cxx . . $ uint32# tmpa = 0; |
| 647 | |
| 648 | if(HU_IRQlowcxx . . $ `mednafen/pce_fast/huc6280.cpp:32:9`! & MDFN_IQTIMERcxx . . $ `mednafen/pce_fast/huc6280.h:67:9`! & HuCPUcxx . . $ HuCPU..IRQMaskDelaycxx . . $ __HuC6280#IRQMaskDelay.) |
| 649 | tmpa = 0xFFFA; |
| 650 | else if((HU_IRQlowcxx . . $ `mednafen/pce_fast/huc6280.cpp:32:9`! & MDFN_IQIRQ1cxx . . $ `mednafen/pce_fast/huc6280.h:65:9`! & HuCPUcxx . . $ HuCPU..IRQMaskDelaycxx . . $ __HuC6280#IRQMaskDelay.) || ((HU_IRQlowcxx . . $ `mednafen/pce_fast/huc6280.cpp:32:9`! >> 8) & MDFN_IQIRQ1cxx . . $ `mednafen/pce_fast/huc6280.h:65:9`! & HuCPUcxx . . $ HuCPU..IRQMaskDelaycxx . . $ __HuC6280#IRQMaskDelay.)) |
| 651 | tmpa = 0xFFF8; |
| 652 | else if(HU_IRQlowcxx . . $ `mednafen/pce_fast/huc6280.cpp:32:9`! & MDFN_IQIRQ2cxx . . $ `mednafen/pce_fast/huc6280.h:66:9`! & HuCPUcxx . . $ HuCPU..IRQMaskDelaycxx . . $ __HuC6280#IRQMaskDelay.) |
| 653 | tmpa = 0xFFF6; |
| 654 | |
| 655 | if(tmpa) |
| 656 | { |
| 657 | unsigned int npc; |
| 658 | |
| 659 | ADDCYCcxx . . $ `mednafen/pce_fast/huc6280.cpp:115:9`!(8); |
| 660 | PUSH_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:174:9`!(); |
| 661 | |
| 662 | COMPRESS_FLAGScxx . . $ `mednafen/pce_fast/huc6280.cpp:62:10`!(); |
| 663 | PUSHcxx . . $ `mednafen/pce_fast/huc6280.cpp:168:9`!((HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!&~B_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:56:9`!)); |
| 664 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! |= I_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:58:9`!; |
| 665 | HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`! &= ~(T_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:55:9`! | D_FLAGcxx . . $ `mednafen/pce_fast/huc6280.h:57:9`!); |
| 666 | HU_PIcxx . . $ `mednafen/pce_fast/huc6280.cpp:31:9`! = HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!; |
| 667 | |
| 668 | npc = RdMem16cxx . . $ RdMem16(6557041c941ab807).(tmpa); |
| 669 | SetPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:79:10`!(npc); |
| 670 | |
| 671 | if(tmpa == 0xFFF8) |
| 672 | HU_IRQlowcxx . . $ `mednafen/pce_fast/huc6280.cpp:32:9`! &= ~0x200; |
| 673 | |
| 674 | continue; |
| 675 | } |
| 676 | } |
| 677 | } // end if(HU_IRQlow) |
| 678 | |
| 679 | //printf("%04x\n", GetRealPC()); |
| 680 | HU_PIcxx . . $ `mednafen/pce_fast/huc6280.cpp:31:9`! = HU_Pcxx . . $ `mednafen/pce_fast/huc6280.cpp:30:9`!; |
| 681 | HuCPUcxx . . $ HuCPU..IRQMaskDelaycxx . . $ __HuC6280#IRQMaskDelay. = HuCPUcxx . . $ HuCPU..IRQMaskcxx . . $ __HuC6280#IRQMask.; |
| 682 | |
| 683 | b1 = RdAtPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:107:10`!(); |
| 684 | |
| 685 | ADDCYCcxx . . $ `mednafen/pce_fast/huc6280.cpp:115:9`!(CycTable[b1]); |
| 686 | |
| 687 | IncPCcxx . . $ `mednafen/pce_fast/huc6280.cpp:103:9`!(); |
| 688 | |
| 689 | switch(b1) |
| 690 | { |
| 691 | #include "huc6280_ops.inc"cxx . . $ `<file>/mednafen/pce_fast/huc6280_ops.inc`/ |
| 692 | } |
| 693 | |
| 694 | #ifndef HUC6280_EXTRA_CRAZY |
| 695 | FixPC_PCcxx . . $ `mednafen/pce_fast/huc6280.cpp:90:10`!(); |
| 696 | #endif |
| 697 | } // end while(HuCPU.timestamp < next_event) |
| 698 | |
| 699 | while(HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. >= HuCPUcxx . . $ HuCPU..timer_next_timestampcxx . . $ __HuC6280#timer_next_timestamp.) |
| 700 | { |
| 701 | HuCPUcxx . . $ HuCPU..timer_next_timestampcxx . . $ __HuC6280#timer_next_timestamp. += 1024 * pce_overclockedcxx . . $ pce_overclocked.; |
| 702 | |
| 703 | if(HuCPUcxx . . $ HuCPU..timer_statuscxx . . $ __HuC6280#timer_status.) |
| 704 | { |
| 705 | HuCPUcxx . . $ HuCPU..timer_valuecxx . . $ __HuC6280#timer_value. --; |
| 706 | if(HuCPUcxx . . $ HuCPU..timer_valuecxx . . $ __HuC6280#timer_value. < 0) |
| 707 | { |
| 708 | HuCPUcxx . . $ HuCPU..timer_valuecxx . . $ __HuC6280#timer_value. = HuCPUcxx . . $ HuCPU..timer_loadcxx . . $ __HuC6280#timer_load.; |
| 709 | HuC6280_IRQBegincxx . . $ HuC6280_IRQBegin(d4f767463ce0a6b3).(MDFN_IQTIMERcxx . . $ `mednafen/pce_fast/huc6280.h:67:9`!); |
| 710 | } |
| 711 | } |
| 712 | } |
| 713 | } // end while(HuCPU.timestamp < next_user_event) |
| 714 | |
| 715 | GetOutBMT: |
| 716 | |
| 717 | SAVE_LOCALScxx . . $ `mednafen/pce_fast/huc6280.cpp:55:9`!(); |
| 718 | } |
| 719 | |
| 720 | void HuC6280_ResetTScxx . . $ HuC6280_ResetTS(49f6e7a06ebc5aa8).(void) |
| 721 | { |
| 722 | HuCPUcxx . . $ HuCPU..timer_next_timestampcxx . . $ __HuC6280#timer_next_timestamp. -= HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp.; |
| 723 | HuCPUcxx . . $ HuCPU..previous_next_user_eventcxx . . $ __HuC6280#previous_next_user_event. -= HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp.; |
| 724 | HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. = 0; |
| 725 | } |
| 726 | |
| 727 | int HuC6280_StateActioncxx . . $ HuC6280_StateAction(a45b884b8cf568d5).(StateMemcxx . . $ StateMem# *sm, int load, int data_only) |
| 728 | { |
| 729 | uint16cxx . . $ uint16# tmp_PC = GetRealPC_EXTERNALcxx . . $ `mednafen/pce_fast/huc6280.cpp:72:10`!(); |
| 730 | |
| 731 | #define P_localcxx . . $ `mednafen/pce_fast/huc6280.cpp:731:9`! HuCPU.P |
| 732 | COMPRESS_FLAGScxx . . $ `mednafen/pce_fast/huc6280.cpp:62:10`!(); |
| 733 | |
| 734 | SFORMATcxx . . $ SFORMAT# SFCPU[]= |
| 735 | { |
| 736 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(tmp_PC, "PC"), |
| 737 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.A, "A"), |
| 738 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.P, "P"), |
| 739 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.X, "X"), |
| 740 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.Y, "Y"), |
| 741 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.S, "S"), |
| 742 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.mooPI, "PI"), |
| 743 | |
| 744 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.IRQMask, "IRQMask"), |
| 745 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.IRQMaskDelay, "IRQMaskDelay"), |
| 746 | SFARRAYNcxx . . $ `mednafen/state.h:72:9`!(HuCPU.MPR, 8, "MPR"), |
| 747 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.timer_status, "timer_status"), |
| 748 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.timer_value, "timer_value"), |
| 749 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.timer_load, "timer_load"), |
| 750 | |
| 751 | |
| 752 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.IRQlow, "IRQlow"), |
| 753 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.in_block_move, "IBM"), |
| 754 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.bmt_src, "IBM_SRC"), |
| 755 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.bmt_dest, "IBM_DEST"), |
| 756 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.bmt_length, "IBM_LENGTH"), |
| 757 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.bmt_alternate, "IBM_ALTERNATE"), |
| 758 | |
| 759 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.timestamp, "timestamp"), |
| 760 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.timer_next_timestamp, "timer_next_timestamp"), |
| 761 | SFVARNcxx . . $ `mednafen/state.h:69:9`!(HuCPU.previous_next_user_event, "previous_next_user_event"), |
| 762 | |
| 763 | SFENDcxx . . $ `mednafen/state.h:94:9`! |
| 764 | }; |
| 765 | |
| 766 | int ret = MDFNSS_StateActioncxx . . $ MDFNSS_StateAction(3f628545d3b0df83).(sm, load, data_only, SFCPU, "CPU"); |
| 767 | |
| 768 | if(load) |
| 769 | { |
| 770 | // Update MPR cache |
| 771 | HuC6280_FlushMPRCachecxx . . $ HuC6280_FlushMPRCache(49f6e7a06ebc5aa8).(); |
| 772 | |
| 773 | // This must be after the MPR cache is updated: |
| 774 | SetPC_EXTERNALcxx . . $ `mednafen/pce_fast/huc6280.cpp:81:10`!(tmp_PC); |
| 775 | } |
| 776 | |
| 777 | EXPAND_FLAGScxx . . $ `mednafen/pce_fast/huc6280.cpp:64:10`!(); |
| 778 | #undef P_localcxx . . $ `mednafen/pce_fast/huc6280.cpp:731:9`! |
| 779 | |
| 780 | return(ret); |
| 781 | } |