| 1 | #cxx . . $ `<file>/libretro.cpp`/include <stdarg.h> |
| 2 | #include "mednafen/mednafen.h"cxx . . $ `<file>/mednafen/mednafen.h`/ |
| 3 | #include "mednafen/git.h"cxx . . $ `<file>/mednafen/git.h`/ |
| 4 | #include "mednafen/general.h"cxx . . $ `<file>/mednafen/general.h`/ |
| 5 | #include "libretro.h"cxx . . $ `<file>/libretro.h`/ |
| 6 | |
| 7 | #include <rthreads/rthreads.h>cxx . . $ `<file>/libretro-common/include/rthreads/rthreads.h`/ |
| 8 | #include <string/stdstring.h>cxx . . $ `<file>/libretro-common/include/string/stdstring.h`/ |
| 9 | |
| 10 | #include "mednafen/pce_fast/pce.h"cxx . . $ `<file>/mednafen/pce_fast/pce.h`/ |
| 11 | #include "mednafen/pce_fast/vdc.h"cxx . . $ `<file>/mednafen/pce_fast/vdc.h`/ |
| 12 | #include "mednafen/pce_fast/psg.h"cxx . . $ `<file>/mednafen/pce_fast/psg.h`/ |
| 13 | #include "mednafen/pce_fast/input.h"cxx . . $ `<file>/mednafen/pce_fast/input.h`/ |
| 14 | #include "mednafen/pce_fast/huc.h"cxx . . $ `<file>/mednafen/pce_fast/huc.h`/ |
| 15 | #include "mednafen/pce_fast/pcecd.h"cxx . . $ `<file>/mednafen/pce_fast/pcecd.h`/ |
| 16 | #include "mednafen/pce_fast/pcecd_drive.h"cxx . . $ `<file>/mednafen/pce_fast/pcecd_drive.h`/ |
| 17 | #include "mednafen/hw_misc/arcade_card/arcade_card.h"cxx . . $ `<file>/mednafen/hw_misc/arcade_card/arcade_card.h`/ |
| 18 | #include "mednafen/mempatcher.h"cxx . . $ `<file>/mednafen/mempatcher.h`/ |
| 19 | #include "mednafen/cdrom/cdromif.h"cxx . . $ `<file>/mednafen/cdrom/cdromif.h`/ |
| 20 | #include "mednafen/cdrom/CDUtility.h"cxx . . $ `<file>/mednafen/cdrom/CDUtility.h`/ |
| 21 | |
| 22 | #ifdef _MSC_VER |
| 23 | #include "mednafen/msvc_compat.h" |
| 24 | #endif |
| 25 | |
| 26 | static bool old_cdimagecachecxx . . $ old_cdimagecache. = false; |
| 27 | |
| 28 | extern MDFNGIcxx . . $ MDFNGI# EmulatedPCE_Fastcxx . . $ EmulatedPCE_Fast.; |
| 29 | MDFNGIcxx . . $ MDFNGI# *MDFNGameInfocxx . . $ MDFNGameInfo. = &EmulatedPCE_Fastcxx . . $ EmulatedPCE_Fast.; |
| 30 | |
| 31 | /* Mednafen - Multi-system Emulator |
| 32 | * |
| 33 | * This program is free software; you can redistribute it and/or modify |
| 34 | * it under the terms of the GNU General Public License as published by |
| 35 | * the Free Software Foundation; either version 2 of the License, or |
| 36 | * (at your option) any later version. |
| 37 | * |
| 38 | * This program is distributed in the hope that it will be useful, |
| 39 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 40 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 41 | * GNU General Public License for more details. |
| 42 | * |
| 43 | * You should have received a copy of the GNU General Public License |
| 44 | * along with this program; if not, write to the Free Software |
| 45 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 46 | */ |
| 47 | |
| 48 | extern "C" unsigned long crc32(unsigned long crc, const unsigned char *buf, unsigned int len); |
| 49 | |
| 50 | static PCEFast_PSGcxx . . $ PCEFast_PSG# *psgcxx . . $ psg. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 51 | extern ArcadeCardcxx . . $ ArcadeCard# *arcade_cardcxx . . $ arcade_card.; // Bah, lousy globals. |
| 52 | |
| 53 | static Blip_Buffercxx . . $ Blip_Buffer# sbufcxx . . $ sbuf.[2]; |
| 54 | |
| 55 | bool PCE_ACEnabledcxx . . $ PCE_ACEnabled.; |
| 56 | |
| 57 | int pce_overclockedcxx . . $ pce_overclocked.; |
| 58 | |
| 59 | // Statically allocated for speed...or something. |
| 60 | uint8cxx . . $ uint8# ROMSpacecxx . . $ ROMSpace.[0x88 * 8192 + 8192]; // + 8192 for PC-as-pointer safety padding |
| 61 | |
| 62 | uint8cxx . . $ uint8# BaseRAMcxx . . $ BaseRAM.[32768 + 8192]; // 8KB for PCE, 32KB for Super Grafx // + 8192 for PC-as-pointer safety padding |
| 63 | |
| 64 | uint8cxx . . $ uint8# PCEIODataBuffercxx . . $ PCEIODataBuffer.; |
| 65 | readfunccxx . . $ readfunc# PCEReadcxx . . $ PCERead.[0x100]; |
| 66 | writefunccxx . . $ writefunc# PCEWritecxx . . $ PCEWrite.[0x100]; |
| 67 | |
| 68 | static DECLFRcxx . . $ `mednafen/pce_fast/pce.h:11:9`!(PCEBusRead) |
| 69 | { |
| 70 | //printf("BUS Read: %02x %04x\n", A >> 13, A); |
| 71 | return(0xFF); |
| 72 | } |
| 73 | |
| 74 | static DECLFWcxx . . $ `mednafen/pce_fast/pce.h:12:9`!(PCENullWrite) |
| 75 | { |
| 76 | //printf("Null Write: %02x, %08x %02x\n", A >> 13, A, V); |
| 77 | } |
| 78 | |
| 79 | static DECLFRcxx . . $ `mednafen/pce_fast/pce.h:11:9`!(BaseRAMRead) |
| 80 | { |
| 81 | return((BaseRAMcxx . . $ BaseRAM. - (0xF8 * 8192))[A]); |
| 82 | } |
| 83 | |
| 84 | static DECLFRcxx . . $ `mednafen/pce_fast/pce.h:11:9`!(BaseRAMRead_Mirrored) |
| 85 | { |
| 86 | return(BaseRAMcxx . . $ BaseRAM.[A & 0x1FFF]); |
| 87 | } |
| 88 | |
| 89 | static DECLFWcxx . . $ `mednafen/pce_fast/pce.h:12:9`!(BaseRAMWrite) |
| 90 | { |
| 91 | (BaseRAMcxx . . $ BaseRAM. - (0xF8 * 8192))[A] = V; |
| 92 | } |
| 93 | |
| 94 | static DECLFWcxx . . $ `mednafen/pce_fast/pce.h:12:9`!(BaseRAMWrite_Mirrored) |
| 95 | { |
| 96 | BaseRAMcxx . . $ BaseRAM.[A & 0x1FFF] = V; |
| 97 | } |
| 98 | |
| 99 | static DECLFRcxx . . $ `mednafen/pce_fast/pce.h:11:9`!(IORead) |
| 100 | { |
| 101 | #include "mednafen/pce_fast/ioread.inc"cxx . . $ `<file>/mednafen/pce_fast/ioread.inc`/ |
| 102 | } |
| 103 | |
| 104 | static DECLFWcxx . . $ `mednafen/pce_fast/pce.h:12:9`!(IOWrite) |
| 105 | { |
| 106 | A &= 0x1FFF; |
| 107 | |
| 108 | switch(A >> 10) |
| 109 | { |
| 110 | case 0: HuC6280_StealCyclecxx . . $ HuC6280_StealCycle(49f6e7a06ebc5aa8).(); |
| 111 | VDC_Writecxx . . $ VDC_Write(cc289a6b3dfc48da).(A, V); |
| 112 | break; |
| 113 | |
| 114 | case 1: HuC6280_StealCyclecxx . . $ HuC6280_StealCycle(49f6e7a06ebc5aa8).(); |
| 115 | VCE_Writecxx . . $ VCE_Write(cc289a6b3dfc48da).(A, V); |
| 116 | break; |
| 117 | |
| 118 | case 2: PCEIODataBuffercxx . . $ PCEIODataBuffer. = V; |
| 119 | psgcxx . . $ psg.->Writecxx . . $ PCEFast_PSG#Write(109a18db49cfadc0).(HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. / pce_overclockedcxx . . $ pce_overclocked., A, V); |
| 120 | break; |
| 121 | |
| 122 | case 3: PCEIODataBuffercxx . . $ PCEIODataBuffer. = V; |
| 123 | HuC6280_TimerWritecxx . . $ HuC6280_TimerWrite(cc289a6b3dfc48da).(A, V); |
| 124 | break; |
| 125 | |
| 126 | case 4: PCEIODataBuffercxx . . $ PCEIODataBuffer. = V; INPUT_Writecxx . . $ INPUT_Write(cc289a6b3dfc48da).(A, V); break; |
| 127 | case 5: PCEIODataBuffercxx . . $ PCEIODataBuffer. = V; HuC6280_IRQStatusWritecxx . . $ HuC6280_IRQStatusWrite(cc289a6b3dfc48da).(A, V); break; |
| 128 | case 6: |
| 129 | if(!PCE_IsCDcxx . . $ PCE_IsCD.) |
| 130 | break; |
| 131 | |
| 132 | if((A & 0x1E00) == 0x1A00) |
| 133 | { |
| 134 | if(arcade_cardcxx . . $ arcade_card.) |
| 135 | arcade_cardcxx . . $ arcade_card.->Writecxx . . $ ArcadeCard#Write(cc289a6b3dfc48da).(A & 0x1FFF, V); |
| 136 | } |
| 137 | else |
| 138 | { |
| 139 | PCECD_Writecxx . . $ PCECD_Write(10e3fdc6547212ea).(HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. * 3, A, V); |
| 140 | } |
| 141 | break; |
| 142 | |
| 143 | case 7: break; // Expansion. |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | static void PCECDIRQCBcxx . . $ PCECDIRQCB(b45ddcbc8423892c).(bool asserted) |
| 148 | { |
| 149 | if(asserted) |
| 150 | HuC6280_IRQBegincxx . . $ HuC6280_IRQBegin(d4f767463ce0a6b3).(MDFN_IQIRQ2cxx . . $ `mednafen/pce_fast/huc6280.h:66:9`!); |
| 151 | else |
| 152 | HuC6280_IRQEndcxx . . $ HuC6280_IRQEnd(d4f767463ce0a6b3).(MDFN_IQIRQ2cxx . . $ `mednafen/pce_fast/huc6280.h:66:9`!); |
| 153 | } |
| 154 | |
| 155 | bool PCE_InitCDcxx . . $ PCE_InitCD(c9857a73d68e59ba).(void) |
| 156 | { |
| 157 | PCECD_Settingscxx . . $ PCECD_Settings# cd_settings; |
| 158 | memset(&cd_settings, 0, sizeof(PCECD_Settingscxx . . $ PCECD_Settings#)); |
| 159 | |
| 160 | cd_settings.CDDA_Volumecxx . . $ $anonymous_type_f432417630a7227e_0#CDDA_Volume. = (double)MDFN_GetSettingUIcxx . . $ MDFN_GetSettingUI(751346f8406fd082).("pce_fast.cddavolume") / 100; |
| 161 | cd_settings.CD_Speedcxx . . $ $anonymous_type_f432417630a7227e_0#CD_Speed. = MDFN_GetSettingUIcxx . . $ MDFN_GetSettingUI(751346f8406fd082).("pce_fast.cdspeed"); |
| 162 | |
| 163 | cd_settings.ADPCM_Volumecxx . . $ $anonymous_type_f432417630a7227e_0#ADPCM_Volume. = (double)MDFN_GetSettingUIcxx . . $ MDFN_GetSettingUI(751346f8406fd082).("pce_fast.adpcmvolume") / 100; |
| 164 | cd_settings.ADPCM_LPFcxx . . $ $anonymous_type_f432417630a7227e_0#ADPCM_LPF. = MDFN_GetSettingBcxx . . $ MDFN_GetSettingB(c5f7da30cbc0f4e9).("pce_fast.adpcmlp"); |
| 165 | |
| 166 | if(cd_settings.CDDA_Volumecxx . . $ $anonymous_type_f432417630a7227e_0#CDDA_Volume. != 1.0) |
| 167 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("CD-DA Volume: %d%%\n"), (int)(100 * cd_settings.CDDA_Volumecxx . . $ $anonymous_type_f432417630a7227e_0#CDDA_Volume.)); |
| 168 | |
| 169 | if(cd_settings.ADPCM_Volumecxx . . $ $anonymous_type_f432417630a7227e_0#ADPCM_Volume. != 1.0) |
| 170 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("ADPCM Volume: %d%%\n"), (int)(100 * cd_settings.ADPCM_Volumecxx . . $ $anonymous_type_f432417630a7227e_0#ADPCM_Volume.)); |
| 171 | |
| 172 | return(PCECD_Initcxx . . $ PCECD_Init(55ea6bcbc11777af).(&cd_settings, PCECDIRQCBcxx . . $ PCECDIRQCB(b45ddcbc8423892c)., PCE_MASTER_CLOCKcxx . . $ `mednafen/pce_fast/pce.h:9:9`!, pce_overclockedcxx . . $ pce_overclocked., &sbufcxx . . $ sbuf.[0], &sbufcxx . . $ sbuf.[1])); |
| 173 | } |
| 174 | |
| 175 | |
| 176 | static int LoadCommoncxx . . $ LoadCommon(b126dc7c1de90089).(void); |
| 177 | static void LoadCommonPrecxx . . $ LoadCommonPre(49f6e7a06ebc5aa8).(void); |
| 178 | |
| 179 | static bool TestMagiccxx . . $ TestMagic(ac45b4c5cbf1681).(const char *name, MDFNFILEcxx . . $ MDFNFILE# *fp) |
| 180 | { |
| 181 | return(TRUEcxx . . $ `mednafen/mednafen-types.h:113:9`!); |
| 182 | } |
| 183 | |
| 184 | static int Loadcxx . . $ Load(c185cac771729fac).(const char *name, MDFNFILEcxx . . $ MDFNFILE# *fp) |
| 185 | { |
| 186 | uint32cxx . . $ uint32# headerlen = 0; |
| 187 | uint32cxx . . $ uint32# r_size; |
| 188 | |
| 189 | LoadCommonPrecxx . . $ LoadCommonPre(49f6e7a06ebc5aa8).(); |
| 190 | |
| 191 | { |
| 192 | if(GET_FSIZE_PTRcxx . . $ `mednafen/mednafen.h:23:9`!(fp) & 0x200) // 512 byte header! |
| 193 | headerlen = 512; |
| 194 | } |
| 195 | |
| 196 | r_size = GET_FSIZE_PTRcxx . . $ `mednafen/mednafen.h:23:9`!(fp) - headerlen; |
| 197 | if(r_size > 4096 * 1024) r_size = 4096 * 1024; |
| 198 | |
| 199 | for(int x = 0; x < 0x100; x++) |
| 200 | { |
| 201 | PCEReadcxx . . $ PCERead.[x] = PCEBusReadcxx . . $ PCEBusRead(32407b39b2dfce37).; |
| 202 | PCEWritecxx . . $ PCEWrite.[x] = PCENullWritecxx . . $ PCENullWrite(cc289a6b3dfc48da).; |
| 203 | } |
| 204 | |
| 205 | uint32cxx . . $ uint32# crc = crc32(0, GET_FDATA_PTRcxx . . $ `mednafen/mednafen.h:22:9`!(fp) + headerlen, GET_FSIZE_PTRcxx . . $ `mednafen/mednafen.h:23:9`!(fp) - headerlen); |
| 206 | |
| 207 | HuCLoadcxx . . $ HuCLoad(eb174da03ea1718f).(GET_FDATA_PTRcxx . . $ `mednafen/mednafen.h:22:9`!(fp) + headerlen, GET_FSIZE_PTRcxx . . $ `mednafen/mednafen.h:23:9`!(fp) - headerlen, crc); |
| 208 | |
| 209 | return(LoadCommoncxx . . $ LoadCommon(b126dc7c1de90089).()); |
| 210 | } |
| 211 | |
| 212 | static void LoadCommonPrecxx . . $ LoadCommonPre(49f6e7a06ebc5aa8).(void) |
| 213 | { |
| 214 | // FIXME: Make these globals less global! |
| 215 | pce_overclockedcxx . . $ pce_overclocked. = MDFN_GetSettingUIcxx . . $ MDFN_GetSettingUI(751346f8406fd082).("pce_fast.ocmultiplier"); |
| 216 | PCE_ACEnabledcxx . . $ PCE_ACEnabled. = MDFN_GetSettingBcxx . . $ MDFN_GetSettingB(c5f7da30cbc0f4e9).("pce_fast.arcadecard"); |
| 217 | |
| 218 | if(pce_overclockedcxx . . $ pce_overclocked. > 1) |
| 219 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("CPU overclock: %dx\n"), pce_overclockedcxx . . $ pce_overclocked.); |
| 220 | |
| 221 | if(MDFN_GetSettingUIcxx . . $ MDFN_GetSettingUI(751346f8406fd082).("pce_fast.cdspeed") > 1) |
| 222 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("CD-ROM speed: %ux\n"), (unsigned int)MDFN_GetSettingUIcxx . . $ MDFN_GetSettingUI(751346f8406fd082).("pce_fast.cdspeed")); |
| 223 | |
| 224 | memset(HuCPUFastMapcxx . . $ HuCPUFastMap., 0, sizeof(HuCPUFastMapcxx . . $ HuCPUFastMap.)); |
| 225 | for(int x = 0; x < 0x100; x++) |
| 226 | { |
| 227 | PCEReadcxx . . $ PCERead.[x] = PCEBusReadcxx . . $ PCEBusRead(32407b39b2dfce37).; |
| 228 | PCEWritecxx . . $ PCEWrite.[x] = PCENullWritecxx . . $ PCENullWrite(cc289a6b3dfc48da).; |
| 229 | } |
| 230 | |
| 231 | MDFNMP_Initcxx . . $ MDFNMP_Init(8e1b545ea3aecce3).(1024, (1 << 21) / 1024); |
| 232 | } |
| 233 | |
| 234 | static int LoadCommoncxx . . $ LoadCommon(b126dc7c1de90089).(void) |
| 235 | { |
| 236 | VDC_Initcxx . . $ VDC_Init(d4f767463ce0a6b3).(false); |
| 237 | |
| 238 | { |
| 239 | PCEReadcxx . . $ PCERead.[0xF8] = BaseRAMReadcxx . . $ BaseRAMRead(32407b39b2dfce37).; |
| 240 | PCEReadcxx . . $ PCERead.[0xF9] = PCEReadcxx . . $ PCERead.[0xFA] = PCEReadcxx . . $ PCERead.[0xFB] = BaseRAMRead_Mirroredcxx . . $ BaseRAMRead_Mirrored(32407b39b2dfce37).; |
| 241 | |
| 242 | PCEWritecxx . . $ PCEWrite.[0xF8] = BaseRAMWritecxx . . $ BaseRAMWrite(cc289a6b3dfc48da).; |
| 243 | PCEWritecxx . . $ PCEWrite.[0xF9] = PCEWritecxx . . $ PCEWrite.[0xFA] = PCEWritecxx . . $ PCEWrite.[0xFB] = BaseRAMWrite_Mirroredcxx . . $ BaseRAMWrite_Mirrored(cc289a6b3dfc48da).; |
| 244 | |
| 245 | for(int x = 0xf8; x < 0xfb; x++) |
| 246 | HuCPUFastMapcxx . . $ HuCPUFastMap.[x] = BaseRAMcxx . . $ BaseRAM. - x * 8192; |
| 247 | |
| 248 | PCEReadcxx . . $ PCERead.[0xFF] = IOReadcxx . . $ IORead(32407b39b2dfce37).; |
| 249 | } |
| 250 | |
| 251 | MDFNMP_AddRAMcxx . . $ MDFNMP_AddRAM(f9255d7bf06fcbb).(8192, 0xf8 * 8192, BaseRAMcxx . . $ BaseRAM.); |
| 252 | |
| 253 | PCEWritecxx . . $ PCEWrite.[0xFF] = IOWritecxx . . $ IOWrite(cc289a6b3dfc48da).; |
| 254 | |
| 255 | HuC6280_Initcxx . . $ HuC6280_Init(49f6e7a06ebc5aa8).(); |
| 256 | |
| 257 | psgcxx . . $ psg. = new PCEFast_PSGcxx . . $ PCEFast_PSG#PCEFast_PSG(ad7d7afb16d524bd).(&sbufcxx . . $ sbuf.[0], &sbufcxx . . $ sbuf.[1]); |
| 258 | |
| 259 | psgcxx . . $ psg.->SetVolumecxx . . $ PCEFast_PSG#SetVolume(ba8836b59fb42830).(1.0); |
| 260 | |
| 261 | if(PCE_IsCDcxx . . $ PCE_IsCD.) |
| 262 | { |
| 263 | unsigned int cdpsgvolume = MDFN_GetSettingUIcxx . . $ MDFN_GetSettingUI(751346f8406fd082).("pce_fast.cdpsgvolume"); |
| 264 | |
| 265 | if(cdpsgvolume != 100) |
| 266 | { |
| 267 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("CD PSG Volume: %d%%\n"), cdpsgvolume); |
| 268 | } |
| 269 | |
| 270 | psgcxx . . $ psg.->SetVolumecxx . . $ PCEFast_PSG#SetVolume(ba8836b59fb42830).(0.678 * cdpsgvolume / 100); |
| 271 | |
| 272 | } |
| 273 | |
| 274 | PCEINPUT_Initcxx . . $ PCEINPUT_Init(49f6e7a06ebc5aa8).(); |
| 275 | |
| 276 | PCE_Powercxx . . $ PCE_Power(49f6e7a06ebc5aa8).(); |
| 277 | |
| 278 | MDFNGameInfocxx . . $ MDFNGameInfo.->LayerNamescxx . . $ $anonymous_type_643ef407c229d02_12#LayerNames. = "Background\0Sprites\0"; |
| 279 | MDFNGameInfocxx . . $ MDFNGameInfo.->fpscxx . . $ $anonymous_type_643ef407c229d02_12#fps. = (uint32cxx . . $ uint32#)((double)7159090.90909090 / 455 / 263 * 65536 * 256); |
| 280 | |
| 281 | // Clean this up: |
| 282 | if(!MDFN_GetSettingBcxx . . $ MDFN_GetSettingB(c5f7da30cbc0f4e9).("pce_fast.correct_aspect")) |
| 283 | MDFNGameInfocxx . . $ MDFNGameInfo.->fb_widthcxx . . $ $anonymous_type_643ef407c229d02_12#fb_width. = 682; |
| 284 | |
| 285 | MDFNGameInfocxx . . $ MDFNGameInfo.->nominal_widthcxx . . $ $anonymous_type_643ef407c229d02_12#nominal_width. = MDFN_GetSettingBcxx . . $ MDFN_GetSettingB(c5f7da30cbc0f4e9).("pce_fast.correct_aspect") ? 288 : 341; |
| 286 | MDFNGameInfocxx . . $ MDFNGameInfo.->nominal_heightcxx . . $ $anonymous_type_643ef407c229d02_12#nominal_height. = MDFN_GetSettingUIcxx . . $ MDFN_GetSettingUI(751346f8406fd082).("pce_fast.slend") - MDFN_GetSettingUIcxx . . $ MDFN_GetSettingUI(751346f8406fd082).("pce_fast.slstart") + 1; |
| 287 | |
| 288 | MDFNGameInfocxx . . $ MDFNGameInfo.->lcm_widthcxx . . $ $anonymous_type_643ef407c229d02_12#lcm_width. = MDFN_GetSettingBcxx . . $ MDFN_GetSettingB(c5f7da30cbc0f4e9).("pce_fast.correct_aspect") ? 1024 : 341; |
| 289 | MDFNGameInfocxx . . $ MDFNGameInfo.->lcm_heightcxx . . $ $anonymous_type_643ef407c229d02_12#lcm_height. = MDFNGameInfocxx . . $ MDFNGameInfo.->nominal_heightcxx . . $ $anonymous_type_643ef407c229d02_12#nominal_height.; |
| 290 | |
| 291 | return(1); |
| 292 | } |
| 293 | |
| 294 | static bool TestMagicCDcxx . . $ TestMagicCD(aaf3bd88f6d508ce).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<CDIFcxx . . $ CDIF# *> *CDInterfaces) |
| 295 | { |
| 296 | static const uint8cxx . . $ uint8# magic_test[0x20] = { 0x82, 0xB1, 0x82, 0xCC, 0x83, 0x76, 0x83, 0x8D, 0x83, 0x4F, 0x83, 0x89, 0x83, 0x80, 0x82, 0xCC, |
| 297 | 0x92, 0x98, 0x8D, 0xEC, 0x8C, 0xA0, 0x82, 0xCD, 0x8A, 0x94, 0x8E, 0xAE, 0x89, 0xEF, 0x8E, 0xD0 |
| 298 | }; |
| 299 | uint8cxx . . $ uint8# sector_buffer[2048]; |
| 300 | CDIFcxx . . $ CDIF# *cdiface = (*CDInterfaces)[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0]; |
| 301 | CDUtilitycxx . . $ CDUtility/::TOCcxx . . $ CDUtility/TOC# toccxx . . $ CDUtility/TOC#TOC(49f6e7a06ebc5aa8).; |
| 302 | bool ret = FALSEcxx . . $ `mednafen/mednafen-types.h:109:9`!; |
| 303 | |
| 304 | memset(sector_buffer, 0, sizeof(sector_buffer)); |
| 305 | |
| 306 | cdiface->ReadTOCcxx . . $ CDIF#ReadTOC(421bcafe44c737e9).(&toc); |
| 307 | |
| 308 | for(int32cxx . . $ int32# track = toc.first_trackcxx . . $ CDUtility/TOC#first_track.; track <= toc.last_trackcxx . . $ CDUtility/TOC#last_track.; track++) |
| 309 | { |
| 310 | if(toc.trackscxx . . $ CDUtility/TOC#tracks.[track].controlcxx . . $ CDUtility/TOC_Track#control. & 0x4) |
| 311 | { |
| 312 | cdiface->ReadSectorcxx . . $ CDIF#ReadSector(47d6add1f5feae6f).(sector_buffer, toc.trackscxx . . $ CDUtility/TOC#tracks.[track].lbacxx . . $ CDUtility/TOC_Track#lba., 1); |
| 313 | |
| 314 | if(!memcmp((char*)sector_buffer, (char *)magic_test, 0x20)) |
| 315 | ret = TRUEcxx . . $ `mednafen/mednafen-types.h:113:9`!; |
| 316 | |
| 317 | // PCE CD BIOS apparently only looks at the first data track. |
| 318 | break; |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | |
| 323 | // If it's a PC-FX CD(Battle Heat), return false. |
| 324 | // This is very kludgy. |
| 325 | for(int32cxx . . $ int32# track = toc.first_trackcxx . . $ CDUtility/TOC#first_track.; track <= toc.last_trackcxx . . $ CDUtility/TOC#last_track.; track++) |
| 326 | { |
| 327 | if(toc.trackscxx . . $ CDUtility/TOC#tracks.[track].controlcxx . . $ CDUtility/TOC_Track#control. & 0x4) |
| 328 | { |
| 329 | cdiface->ReadSectorcxx . . $ CDIF#ReadSector(47d6add1f5feae6f).(sector_buffer, toc.trackscxx . . $ CDUtility/TOC#tracks.[track].lbacxx . . $ CDUtility/TOC_Track#lba., 1); |
| 330 | if(!strncmp("PC-FX:Hu_CD-ROM", (char*)sector_buffer, strlen("PC-FX:Hu_CD-ROM"))) |
| 331 | { |
| 332 | return(false); |
| 333 | } |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | |
| 338 | // Now, test for the Games Express CD games. The GE BIOS seems to always look at sector 0x10, but only if the first track is a |
| 339 | // data track. |
| 340 | if(toc.first_trackcxx . . $ CDUtility/TOC#first_track. == 1 && (toc.trackscxx . . $ CDUtility/TOC#tracks.[1].controlcxx . . $ CDUtility/TOC_Track#control. & 0x4)) |
| 341 | { |
| 342 | if(cdiface->ReadSectorcxx . . $ CDIF#ReadSector(47d6add1f5feae6f).(sector_buffer, 0x10, 1)) |
| 343 | { |
| 344 | if(!memcmp((char *)sector_buffer + 0x8, "HACKER CD ROM SYSTEM", 0x14)) |
| 345 | { |
| 346 | ret = TRUEcxx . . $ `mednafen/mednafen-types.h:113:9`!; |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | return(ret); |
| 352 | } |
| 353 | |
| 354 | static int LoadCDcxx . . $ LoadCD(23534a0a66bd214a).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<CDIFcxx . . $ CDIF# *> *CDInterfaces) |
| 355 | { |
| 356 | stdcxx . . $ std/::stringcxx . . $ std/string# bios_path = MDFN_MakeFNamecxx . . $ MDFN_MakeFName(cb505ca63a9252bc).(MDFNMKF_FIRMWAREcxx . . $ MDFNMKF_FIRMWARE., 0, MDFN_GetSettingScxx . . $ MDFN_GetSettingS(d06bf7adff8c4caf).("pce_fast.cdbios").c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).() ); |
| 357 | |
| 358 | LoadCommonPrecxx . . $ LoadCommonPre(49f6e7a06ebc5aa8).(); |
| 359 | |
| 360 | if(!HuCLoadCDcxx . . $ HuCLoadCD(5c4306d8553b3696).(bios_path.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).())) |
| 361 | return(0); |
| 362 | |
| 363 | PCECD_Drive_SetDisccxx . . $ PCECD_Drive_SetDisc(d51decba753f8c21).(true, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, true); |
| 364 | PCECD_Drive_SetDisccxx . . $ PCECD_Drive_SetDisc(d51decba753f8c21).(false, (*CDInterfaces)[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0], true); |
| 365 | |
| 366 | return(LoadCommoncxx . . $ LoadCommon(b126dc7c1de90089).()); |
| 367 | } |
| 368 | |
| 369 | static void Cleanup_PCEcxx . . $ Cleanup_PCE(49f6e7a06ebc5aa8).(void) |
| 370 | { |
| 371 | HuC_Closecxx . . $ HuC_Close(49f6e7a06ebc5aa8).(); |
| 372 | |
| 373 | VDC_Closecxx . . $ VDC_Close(49f6e7a06ebc5aa8).(); |
| 374 | |
| 375 | if(psgcxx . . $ psg.) |
| 376 | delete psgcxx . . $ psg.; |
| 377 | psgcxx . . $ psg. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 378 | } |
| 379 | |
| 380 | static void CloseGamecxx . . $ CloseGame(49f6e7a06ebc5aa8).(void) |
| 381 | { |
| 382 | Cleanup_PCEcxx . . $ Cleanup_PCE(49f6e7a06ebc5aa8).(); |
| 383 | } |
| 384 | |
| 385 | static void Emulatecxx . . $ Emulate(c2dd9660813a5292).(EmulateSpecStructcxx . . $ EmulateSpecStruct# *espec) |
| 386 | { |
| 387 | INPUT_Framecxx . . $ INPUT_Frame(49f6e7a06ebc5aa8).(); |
| 388 | |
| 389 | MDFNMP_ApplyPeriodicCheatscxx . . $ MDFNMP_ApplyPeriodicCheats(49f6e7a06ebc5aa8).(); |
| 390 | |
| 391 | #if 0 |
| 392 | { |
| 393 | static bool firstcat = true; |
| 394 | MDFN_PixelFormat nf; |
| 395 | |
| 396 | nf.bpp = 16; |
| 397 | nf.colorspace = MDFN_COLORSPACE_RGB; |
| 398 | nf.Rshift = 11; |
| 399 | nf.Gshift = 5; |
| 400 | nf.Bshift = 0; |
| 401 | nf.Ashift = 16; |
| 402 | |
| 403 | nf.Rprec = 5; |
| 404 | nf.Gprec = 6; |
| 405 | nf.Bprec = 5; |
| 406 | nf.Aprec = 8; |
| 407 | |
| 408 | espec->surface->SetFormat(nf, false); |
| 409 | espec->VideoFormatChanged = firstcat; |
| 410 | firstcat = false; |
| 411 | } |
| 412 | #endif |
| 413 | |
| 414 | |
| 415 | if(espec->SoundFormatChangedcxx . . $ $anonymous_type_643ef407c229d02_10#SoundFormatChanged.) |
| 416 | { |
| 417 | for(int y = 0; y < 2; y++) |
| 418 | { |
| 419 | sbufcxx . . $ sbuf.[y].set_sample_ratecxx . . $ Blip_Buffer#set_sample_rate(ee827314cdea73de).(espec->SoundRatecxx . . $ $anonymous_type_643ef407c229d02_10#SoundRate. ? espec->SoundRatecxx . . $ $anonymous_type_643ef407c229d02_10#SoundRate. : 44100, 50); |
| 420 | sbufcxx . . $ sbuf.[y].clock_ratecxx . . $ Blip_Buffer#clock_rate(1624ee8275b10bda).((long)(PCE_MASTER_CLOCKcxx . . $ `mednafen/pce_fast/pce.h:9:9`! / 3)); |
| 421 | sbufcxx . . $ sbuf.[y].bass_freqcxx . . $ Blip_Buffer#bass_freq(d4f767463ce0a6b3).(10); |
| 422 | } |
| 423 | } |
| 424 | VDC_RunFramecxx . . $ VDC_RunFrame(5ce680368ac0bb61).(espec, false); |
| 425 | |
| 426 | if(PCE_IsCDcxx . . $ PCE_IsCD.) |
| 427 | { |
| 428 | PCECD_Runcxx . . $ PCECD_Run(cb2f890c2fdad230).(HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. * 3); |
| 429 | } |
| 430 | |
| 431 | psgcxx . . $ psg.->EndFramecxx . . $ PCEFast_PSG#EndFrame(d4f767463ce0a6b3).(HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. / pce_overclockedcxx . . $ pce_overclocked.); |
| 432 | |
| 433 | if(espec->SoundBufcxx . . $ $anonymous_type_643ef407c229d02_10#SoundBuf.) |
| 434 | { |
| 435 | for(int y = 0; y < 2; y++) |
| 436 | { |
| 437 | sbufcxx . . $ sbuf.[y].end_framecxx . . $ Blip_Buffer#end_frame(d4f767463ce0a6b3).(HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. / pce_overclockedcxx . . $ pce_overclocked.); |
| 438 | espec->SoundBufSizecxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufSize. = sbufcxx . . $ sbuf.[y].read_samplescxx . . $ Blip_Buffer#read_samples(44cf187bb4d07f06).(espec->SoundBufcxx . . $ $anonymous_type_643ef407c229d02_10#SoundBuf. + y, espec->SoundBufMaxSizecxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufMaxSize., 1); |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | espec->MasterCyclescxx . . $ $anonymous_type_643ef407c229d02_10#MasterCycles. = HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. * 3; |
| 443 | |
| 444 | INPUT_FixTScxx . . $ INPUT_FixTS(49f6e7a06ebc5aa8).(); |
| 445 | |
| 446 | HuC6280_ResetTScxx . . $ HuC6280_ResetTS(49f6e7a06ebc5aa8).(); |
| 447 | |
| 448 | if(PCE_IsCDcxx . . $ PCE_IsCD.) |
| 449 | PCECD_ResetTScxx . . $ PCECD_ResetTS(49f6e7a06ebc5aa8).(); |
| 450 | } |
| 451 | |
| 452 | static int StateActioncxx . . $ StateAction(a45b884b8cf568d5).(StateMemcxx . . $ StateMem# *sm, int load, int data_only) |
| 453 | { |
| 454 | SFORMATcxx . . $ SFORMAT# StateRegs[] = |
| 455 | { |
| 456 | SFARRAYcxx . . $ `mednafen/state.h:73:9`!(BaseRAM, 8192), |
| 457 | SFVARcxx . . $ `mednafen/state.h:70:9`!(PCEIODataBuffer), |
| 458 | SFENDcxx . . $ `mednafen/state.h:94:9`! |
| 459 | }; |
| 460 | |
| 461 | //for(int i = 8192; i < 32768; i++) |
| 462 | // if(BaseRAM[i] != 0xFF) |
| 463 | // printf("%d %02x\n", i, BaseRAM[i]); |
| 464 | |
| 465 | int ret = MDFNSS_StateActioncxx . . $ MDFNSS_StateAction(3f628545d3b0df83).(sm, load, data_only, StateRegs, "MAIN"); |
| 466 | |
| 467 | ret &= HuC6280_StateActioncxx . . $ HuC6280_StateAction(a45b884b8cf568d5).(sm, load, data_only); |
| 468 | ret &= VDC_StateActioncxx . . $ VDC_StateAction(a45b884b8cf568d5).(sm, load, data_only); |
| 469 | ret &= psgcxx . . $ psg.->StateActioncxx . . $ PCEFast_PSG#StateAction(a45b884b8cf568d5).(sm, load, data_only); |
| 470 | ret &= INPUT_StateActioncxx . . $ INPUT_StateAction(a45b884b8cf568d5).(sm, load, data_only); |
| 471 | ret &= HuC_StateActioncxx . . $ HuC_StateAction(a45b884b8cf568d5).(sm, load, data_only); |
| 472 | |
| 473 | if(load) |
| 474 | { |
| 475 | |
| 476 | } |
| 477 | |
| 478 | return(ret); |
| 479 | } |
| 480 | |
| 481 | void PCE_Powercxx . . $ PCE_Power(49f6e7a06ebc5aa8).(void) |
| 482 | { |
| 483 | memset(BaseRAMcxx . . $ BaseRAM., 0x00, sizeof(BaseRAMcxx . . $ BaseRAM.)); |
| 484 | |
| 485 | for(int i = 8192; i < 32768; i++) |
| 486 | BaseRAMcxx . . $ BaseRAM.[i] = 0xFF; |
| 487 | |
| 488 | PCEIODataBuffercxx . . $ PCEIODataBuffer. = 0xFF; |
| 489 | |
| 490 | HuC6280_Powercxx . . $ HuC6280_Power(49f6e7a06ebc5aa8).(); |
| 491 | VDC_Powercxx . . $ VDC_Power(49f6e7a06ebc5aa8).(); |
| 492 | psgcxx . . $ psg.->Powercxx . . $ PCEFast_PSG#Power(d4f767463ce0a6b3).(HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. / pce_overclockedcxx . . $ pce_overclocked.); |
| 493 | HuC_Powercxx . . $ HuC_Power(49f6e7a06ebc5aa8).(); |
| 494 | |
| 495 | if(PCE_IsCDcxx . . $ PCE_IsCD.) |
| 496 | { |
| 497 | PCECD_Powercxx . . $ PCECD_Power(cb2f890c2fdad230).(HuCPUcxx . . $ HuCPU..timestampcxx . . $ __HuC6280#timestamp. * 3); |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | static void DoSimpleCommandcxx . . $ DoSimpleCommand(d4f767463ce0a6b3).(int cmd) |
| 502 | { |
| 503 | switch(cmd) |
| 504 | { |
| 505 | case MDFN_MSC_RESETcxx . . $ MDFN_MSC_RESET.: PCE_Powercxx . . $ PCE_Power(49f6e7a06ebc5aa8).(); break; |
| 506 | case MDFN_MSC_POWERcxx . . $ MDFN_MSC_POWER.: PCE_Powercxx . . $ PCE_Power(49f6e7a06ebc5aa8).(); break; |
| 507 | } |
| 508 | } |
| 509 | |
| 510 | static MDFNSettingcxx . . $ MDFNSetting# PCESettingscxx . . $ PCESettings.[] = |
| 511 | { |
| 512 | { "pce_fast.correct_aspect", MDFNSF_CAT_VIDEOcxx . . $ `mednafen/settings-common.h:24:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("Correct the aspect ratio."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_BOOLcxx . . $ MDFNST_BOOL., "1" }, |
| 513 | { "pce_fast.slstart", MDFNSF_NOFLAGScxx . . $ `mednafen/settings-common.h:19:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("First rendered scanline."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_UINTcxx . . $ MDFNST_UINT., "4", "0", "239" }, |
| 514 | { "pce_fast.slend", MDFNSF_NOFLAGScxx . . $ `mednafen/settings-common.h:19:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("Last rendered scanline."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_UINTcxx . . $ MDFNST_UINT., "235", "0", "239" }, |
| 515 | { "pce_fast.mouse_sensitivity", MDFNSF_NOFLAGScxx . . $ `mednafen/settings-common.h:19:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("Mouse sensitivity."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_FLOATcxx . . $ MDFNST_FLOAT., "0.50", NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, PCEINPUT_SettingChangedcxx . . $ PCEINPUT_SettingChanged(85c52e162fed56f9). }, |
| 516 | { "pce_fast.disable_softreset", MDFNSF_NOFLAGScxx . . $ `mednafen/settings-common.h:19:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("If set, when RUN+SEL are pressed simultaneously, disable both buttons temporarily."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_BOOLcxx . . $ MDFNST_BOOL., "0", NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, PCEINPUT_SettingChangedcxx . . $ PCEINPUT_SettingChanged(85c52e162fed56f9). }, |
| 517 | { "pce_fast.arcadecard", MDFNSF_EMU_STATEcxx . . $ `mednafen/settings-common.h:26:9`! | MDFNSF_UNTRUSTED_SAFEcxx . . $ `mednafen/settings-common.h:27:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("Enable Arcade Card emulation."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_BOOLcxx . . $ MDFNST_BOOL., "1" }, |
| 518 | { "pce_fast.ocmultiplier", MDFNSF_EMU_STATEcxx . . $ `mednafen/settings-common.h:26:9`! | MDFNSF_UNTRUSTED_SAFEcxx . . $ `mednafen/settings-common.h:27:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("CPU overclock multiplier."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_UINTcxx . . $ MDFNST_UINT., "1", "1", "100"}, |
| 519 | { "pce_fast.cdspeed", MDFNSF_EMU_STATEcxx . . $ `mednafen/settings-common.h:26:9`! | MDFNSF_UNTRUSTED_SAFEcxx . . $ `mednafen/settings-common.h:27:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("CD-ROM data transfer speed multiplier."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_UINTcxx . . $ MDFNST_UINT., "1", "1", "100" }, |
| 520 | { "pce_fast.nospritelimit", MDFNSF_NOFLAGScxx . . $ `mednafen/settings-common.h:19:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("Remove 16-sprites-per-scanline hardware limit."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_BOOLcxx . . $ MDFNST_BOOL., "0" }, |
| 521 | |
| 522 | { "pce_fast.cdbios", MDFNSF_EMU_STATEcxx . . $ `mednafen/settings-common.h:26:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("Path to the CD BIOS"), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_STRINGcxx . . $ MDFNST_STRING., "syscard3.pce" }, |
| 523 | |
| 524 | { "pce_fast.adpcmlp", MDFNSF_NOFLAGScxx . . $ `mednafen/settings-common.h:19:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("Enable dynamic ADPCM lowpass filter."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_BOOLcxx . . $ MDFNST_BOOL., "0" }, |
| 525 | { "pce_fast.cdpsgvolume", MDFNSF_NOFLAGScxx . . $ `mednafen/settings-common.h:19:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("PSG volume when playing a CD game."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_UINTcxx . . $ MDFNST_UINT., "100", "0", "200" }, |
| 526 | { "pce_fast.cddavolume", MDFNSF_NOFLAGScxx . . $ `mednafen/settings-common.h:19:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("CD-DA volume."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_UINTcxx . . $ MDFNST_UINT., "100", "0", "200" }, |
| 527 | { "pce_fast.adpcmvolume", MDFNSF_NOFLAGScxx . . $ `mednafen/settings-common.h:19:9`!, gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("ADPCM volume."), NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, MDFNST_UINTcxx . . $ MDFNST_UINT., "100", "0", "200" }, |
| 528 | { NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! } |
| 529 | }; |
| 530 | |
| 531 | static uint8cxx . . $ uint8# MemReadcxx . . $ MemRead(32407b39b2dfce37).(uint32cxx . . $ uint32# addr) |
| 532 | { |
| 533 | return(PCEReadcxx . . $ PCERead.[(addr / 8192) & 0xFF](addr)); |
| 534 | } |
| 535 | |
| 536 | static const FileExtensionSpecStructcxx . . $ FileExtensionSpecStruct# KnownExtensionscxx . . $ KnownExtensions.[] = |
| 537 | { |
| 538 | { ".pce", gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("PC Engine ROM Image") }, |
| 539 | { NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! } |
| 540 | }; |
| 541 | |
| 542 | static const uint8cxx . . $ uint8# BRAM_Init_Stringcxx . . $ BRAM_Init_String.[8] = { 'H', 'U', 'B', 'M', 0x00, 0x88, 0x10, 0x80 }; //"HUBM\x00\x88\x10\x80"; |
| 543 | |
| 544 | ArcadeCardcxx . . $ ArcadeCard# *arcade_cardcxx . . $ arcade_card. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 545 | |
| 546 | static uint8cxx . . $ uint8# *HuCROMcxx . . $ HuCROM. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 547 | |
| 548 | static bool IsPopulouscxx . . $ IsPopulous.; |
| 549 | bool PCE_IsCDcxx . . $ PCE_IsCD.; |
| 550 | |
| 551 | uint8cxx . . $ uint8# SaveRAMcxx . . $ SaveRAM.[2048]; |
| 552 | |
| 553 | static DECLFWcxx . . $ `mednafen/pce_fast/pce.h:12:9`!(ACPhysWrite) |
| 554 | { |
| 555 | arcade_cardcxx . . $ arcade_card.->PhysWritecxx . . $ ArcadeCard#PhysWrite(cc289a6b3dfc48da).(A, V); |
| 556 | } |
| 557 | |
| 558 | static DECLFRcxx . . $ `mednafen/pce_fast/pce.h:11:9`!(ACPhysRead) |
| 559 | { |
| 560 | return(arcade_cardcxx . . $ arcade_card.->PhysReadcxx . . $ ArcadeCard#PhysRead(caa7d1c0e7e3236b).(A)); |
| 561 | } |
| 562 | |
| 563 | static DECLFRcxx . . $ `mednafen/pce_fast/pce.h:11:9`!(SaveRAMRead) |
| 564 | { |
| 565 | if((!PCE_IsCDcxx . . $ PCE_IsCD. || PCECD_IsBRAMEnabledcxx . . $ PCECD_IsBRAMEnabled(c9857a73d68e59ba).()) && (A & 8191) < 2048) |
| 566 | return(SaveRAMcxx . . $ SaveRAM.[A & 2047]); |
| 567 | else |
| 568 | return(0xFF); |
| 569 | } |
| 570 | |
| 571 | static DECLFWcxx . . $ `mednafen/pce_fast/pce.h:12:9`!(SaveRAMWrite) |
| 572 | { |
| 573 | if((!PCE_IsCDcxx . . $ PCE_IsCD. || PCECD_IsBRAMEnabledcxx . . $ PCECD_IsBRAMEnabled(c9857a73d68e59ba).()) && (A & 8191) < 2048) |
| 574 | SaveRAMcxx . . $ SaveRAM.[A & 2047] = V; |
| 575 | } |
| 576 | |
| 577 | static DECLFRcxx . . $ `mednafen/pce_fast/pce.h:11:9`!(HuCRead) |
| 578 | { |
| 579 | return ROMSpacecxx . . $ ROMSpace.[A]; |
| 580 | } |
| 581 | |
| 582 | static DECLFWcxx . . $ `mednafen/pce_fast/pce.h:12:9`!(HuCRAMWrite) |
| 583 | { |
| 584 | ROMSpacecxx . . $ ROMSpace.[A] = V; |
| 585 | } |
| 586 | |
| 587 | static DECLFWcxx . . $ `mednafen/pce_fast/pce.h:12:9`!(HuCRAMWriteCDSpecial) // Hyper Dyne Special hack |
| 588 | { |
| 589 | BaseRAMcxx . . $ BaseRAM.[0x2000 | (A & 0x1FFF)] = V; |
| 590 | ROMSpacecxx . . $ ROMSpace.[A] = V; |
| 591 | } |
| 592 | |
| 593 | static uint8cxx . . $ uint8# HuCSF2Latchcxx . . $ HuCSF2Latch. = 0; |
| 594 | |
| 595 | static DECLFRcxx . . $ `mednafen/pce_fast/pce.h:11:9`!(HuCSF2Read) |
| 596 | { |
| 597 | return(HuCROMcxx . . $ HuCROM.[(A & 0x7FFFF) + 0x80000 + HuCSF2Latchcxx . . $ HuCSF2Latch. * 0x80000 ]); // | (HuCSF2Latch << 19) ]); |
| 598 | } |
| 599 | |
| 600 | static DECLFWcxx . . $ `mednafen/pce_fast/pce.h:12:9`!(HuCSF2Write) |
| 601 | { |
| 602 | if((A & 0x1FFC) == 0x1FF0) |
| 603 | { |
| 604 | HuCSF2Latchcxx . . $ HuCSF2Latch. = (A & 0x3); |
| 605 | } |
| 606 | } |
| 607 | |
| 608 | static void Cleanupcxx . . $ Cleanup(49f6e7a06ebc5aa8).(void) |
| 609 | { |
| 610 | if(arcade_cardcxx . . $ arcade_card.) |
| 611 | delete arcade_cardcxx . . $ arcade_card.; |
| 612 | arcade_cardcxx . . $ arcade_card. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 613 | |
| 614 | if(PCE_IsCDcxx . . $ PCE_IsCD.) |
| 615 | PCECD_Closecxx . . $ PCECD_Close(49f6e7a06ebc5aa8).(); |
| 616 | |
| 617 | if(HuCROMcxx . . $ HuCROM.) |
| 618 | free(HuCROMcxx . . $ HuCROM.); |
| 619 | HuCROMcxx . . $ HuCROM. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 620 | } |
| 621 | |
| 622 | int HuCLoadcxx . . $ HuCLoad(eb174da03ea1718f).(const uint8cxx . . $ uint8# *data, uint32cxx . . $ uint32# len, uint32cxx . . $ uint32# crc32) |
| 623 | { |
| 624 | uint32cxx . . $ uint32# sf2_threshold = 2048 * 1024; |
| 625 | uint32cxx . . $ uint32# sf2_required_size = 2048 * 1024 + 512 * 1024; |
| 626 | uint32cxx . . $ uint32# m_len = (len + 8191)&~8191; |
| 627 | bool sf2_mapper = FALSEcxx . . $ `mednafen/mednafen-types.h:109:9`!; |
| 628 | |
| 629 | if(m_len >= sf2_threshold) |
| 630 | { |
| 631 | sf2_mapper = TRUEcxx . . $ `mednafen/mednafen-types.h:113:9`!; |
| 632 | |
| 633 | if(m_len != sf2_required_size) |
| 634 | m_len = sf2_required_size; |
| 635 | } |
| 636 | |
| 637 | IsPopulouscxx . . $ IsPopulous. = 0; |
| 638 | PCE_IsCDcxx . . $ PCE_IsCD. = 0; |
| 639 | |
| 640 | |
| 641 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("ROM: %dKiB\n"), (len + 1023) / 1024); |
| 642 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("ROM CRC32: 0x%04x\n"), crc32); |
| 643 | |
| 644 | if(!(HuCROMcxx . . $ HuCROM. = (uint8cxx . . $ uint8# *)malloc(m_len))) |
| 645 | { |
| 646 | return(0); |
| 647 | } |
| 648 | |
| 649 | memset(HuCROMcxx . . $ HuCROM., 0xFF, m_len); |
| 650 | memcpy(HuCROMcxx . . $ HuCROM., data, (m_len < len) ? m_len : len); |
| 651 | |
| 652 | memset(ROMSpacecxx . . $ ROMSpace., 0xFF, 0x88 * 8192 + 8192); |
| 653 | |
| 654 | if(m_len == 0x60000) |
| 655 | { |
| 656 | memcpy(ROMSpacecxx . . $ ROMSpace. + 0x00 * 8192, HuCROMcxx . . $ HuCROM., 0x20 * 8192); |
| 657 | memcpy(ROMSpacecxx . . $ ROMSpace. + 0x20 * 8192, HuCROMcxx . . $ HuCROM., 0x20 * 8192); |
| 658 | memcpy(ROMSpacecxx . . $ ROMSpace. + 0x40 * 8192, HuCROMcxx . . $ HuCROM. + 0x20 * 8192, 0x10 * 8192); |
| 659 | memcpy(ROMSpacecxx . . $ ROMSpace. + 0x50 * 8192, HuCROMcxx . . $ HuCROM. + 0x20 * 8192, 0x10 * 8192); |
| 660 | memcpy(ROMSpacecxx . . $ ROMSpace. + 0x60 * 8192, HuCROMcxx . . $ HuCROM. + 0x20 * 8192, 0x10 * 8192); |
| 661 | memcpy(ROMSpacecxx . . $ ROMSpace. + 0x70 * 8192, HuCROMcxx . . $ HuCROM. + 0x20 * 8192, 0x10 * 8192); |
| 662 | } |
| 663 | else if(m_len == 0x80000) |
| 664 | { |
| 665 | memcpy(ROMSpacecxx . . $ ROMSpace. + 0x00 * 8192, HuCROMcxx . . $ HuCROM., 0x40 * 8192); |
| 666 | memcpy(ROMSpacecxx . . $ ROMSpace. + 0x40 * 8192, HuCROMcxx . . $ HuCROM. + 0x20 * 8192, 0x20 * 8192); |
| 667 | memcpy(ROMSpacecxx . . $ ROMSpace. + 0x60 * 8192, HuCROMcxx . . $ HuCROM. + 0x20 * 8192, 0x20 * 8192); |
| 668 | } |
| 669 | else |
| 670 | { |
| 671 | memcpy(ROMSpacecxx . . $ ROMSpace. + 0x00 * 8192, HuCROMcxx . . $ HuCROM., (m_len < 1024 * 1024) ? m_len : 1024 * 1024); |
| 672 | } |
| 673 | |
| 674 | for(int x = 0x00; x < 0x80; x++) |
| 675 | { |
| 676 | HuCPUFastMapcxx . . $ HuCPUFastMap.[x] = ROMSpacecxx . . $ ROMSpace.; |
| 677 | PCEReadcxx . . $ PCERead.[x] = HuCReadcxx . . $ HuCRead(32407b39b2dfce37).; |
| 678 | } |
| 679 | |
| 680 | if(!memcmp(HuCROMcxx . . $ HuCROM. + 0x1F26, "POPULOUS", strlen("POPULOUS"))) |
| 681 | { |
| 682 | uint8cxx . . $ uint8# *PopRAM = ROMSpacecxx . . $ ROMSpace. + 0x40 * 8192; |
| 683 | |
| 684 | memset(PopRAM, 0xFF, 32768); |
| 685 | |
| 686 | IsPopulouscxx . . $ IsPopulous. = 1; |
| 687 | |
| 688 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).("Populous\n"); |
| 689 | |
| 690 | for(int x = 0x40; x < 0x44; x++) |
| 691 | { |
| 692 | HuCPUFastMapcxx . . $ HuCPUFastMap.[x] = &PopRAM[(x & 3) * 8192] - x * 8192; |
| 693 | PCEReadcxx . . $ PCERead.[x] = HuCReadcxx . . $ HuCRead(32407b39b2dfce37).; |
| 694 | PCEWritecxx . . $ PCEWrite.[x] = HuCRAMWritecxx . . $ HuCRAMWrite(cc289a6b3dfc48da).; |
| 695 | } |
| 696 | MDFNMP_AddRAMcxx . . $ MDFNMP_AddRAM(f9255d7bf06fcbb).(32768, 0x40 * 8192, PopRAM); |
| 697 | } |
| 698 | else |
| 699 | { |
| 700 | memset(SaveRAMcxx . . $ SaveRAM., 0x00, 2048); |
| 701 | memcpy(SaveRAMcxx . . $ SaveRAM., BRAM_Init_Stringcxx . . $ BRAM_Init_String., 8); // So users don't have to manually intialize the file cabinet |
| 702 | // in the CD BIOS screen. |
| 703 | PCEWritecxx . . $ PCEWrite.[0xF7] = SaveRAMWritecxx . . $ SaveRAMWrite(cc289a6b3dfc48da).; |
| 704 | PCEReadcxx . . $ PCERead.[0xF7] = SaveRAMReadcxx . . $ SaveRAMRead(32407b39b2dfce37).; |
| 705 | MDFNMP_AddRAMcxx . . $ MDFNMP_AddRAM(f9255d7bf06fcbb).(2048, 0xF7 * 8192, SaveRAMcxx . . $ SaveRAM.); |
| 706 | } |
| 707 | |
| 708 | // 0x1A558 |
| 709 | //if(len >= 0x20000 && !memcmp(HuCROM + 0x1A558, "STREET FIGHTER#", strlen("STREET FIGHTER#"))) |
| 710 | if(sf2_mapper) |
| 711 | { |
| 712 | for(int x = 0x40; x < 0x80; x++) |
| 713 | { |
| 714 | // FIXME: PCE_FAST |
| 715 | HuCPUFastMapcxx . . $ HuCPUFastMap.[x] = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; // Make sure our reads go through our read function, and not a table lookup |
| 716 | PCEReadcxx . . $ PCERead.[x] = HuCSF2Readcxx . . $ HuCSF2Read(32407b39b2dfce37).; |
| 717 | } |
| 718 | PCEWritecxx . . $ PCEWrite.[0] = HuCSF2Writecxx . . $ HuCSF2Write(cc289a6b3dfc48da).; |
| 719 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).("Street Fighter 2 Mapper\n"); |
| 720 | HuCSF2Latchcxx . . $ HuCSF2Latch. = 0; |
| 721 | } |
| 722 | |
| 723 | return(1); |
| 724 | } |
| 725 | |
| 726 | bool IsBRAMUsedcxx . . $ IsBRAMUsed(c9857a73d68e59ba).(void) |
| 727 | { |
| 728 | if(memcmp(SaveRAMcxx . . $ SaveRAM., BRAM_Init_Stringcxx . . $ BRAM_Init_String., 8)) // HUBM string is modified/missing |
| 729 | return(1); |
| 730 | |
| 731 | for(int x = 8; x < 2048; x++) |
| 732 | if(SaveRAMcxx . . $ SaveRAM.[x]) return(1); |
| 733 | |
| 734 | return(0); |
| 735 | } |
| 736 | |
| 737 | int HuCLoadCDcxx . . $ HuCLoadCD(5c4306d8553b3696).(const char *bios_path) |
| 738 | { |
| 739 | static const FileExtensionSpecStructcxx . . $ FileExtensionSpecStruct# KnownBIOSExtensions[] = |
| 740 | { |
| 741 | { ".pce", gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("PC Engine ROM Image") }, |
| 742 | { ".bin", gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("PC Engine ROM Image") }, |
| 743 | { ".bios", gettext_noopcxx . . $ `mednafen/mednafen.h:43:9`!("BIOS Image") }, |
| 744 | { NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! } |
| 745 | }; |
| 746 | |
| 747 | MDFNFILEcxx . . $ MDFNFILE# fpcxx . . $ MDFNFILE#MDFNFILE(49f6e7a06ebc5aa8).; |
| 748 | |
| 749 | if(!fp.Opencxx . . $ MDFNFILE#Open(eb4f300025480a43).(bios_path, KnownBIOSExtensions, _cxx . . $ `mednafen/mednafen.h:9:9`!("CD BIOS"))) |
| 750 | { |
| 751 | return(0); |
| 752 | } |
| 753 | |
| 754 | memset(ROMSpacecxx . . $ ROMSpace., 0xFF, 262144); |
| 755 | |
| 756 | memcpy(ROMSpacecxx . . $ ROMSpace., GET_FDATAcxx . . $ `mednafen/mednafen.h:19:9`!(fp) + (GET_FSIZEcxx . . $ `mednafen/mednafen.h:20:9`!(fp) & 512), ((GET_FSIZEcxx . . $ `mednafen/mednafen.h:20:9`!(fp) & ~512) > 262144) ? 262144 : (GET_FSIZEcxx . . $ `mednafen/mednafen.h:20:9`!(fp) &~ 512) ); |
| 757 | |
| 758 | fp.Closecxx . . $ MDFNFILE#Close(c9857a73d68e59ba).(); |
| 759 | |
| 760 | PCE_IsCDcxx . . $ PCE_IsCD. = 1; |
| 761 | PCE_InitCDcxx . . $ PCE_InitCD(c9857a73d68e59ba).(); |
| 762 | |
| 763 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("Arcade Card Emulation: %s\n"), PCE_ACEnabledcxx . . $ PCE_ACEnabled. ? _cxx . . $ `mednafen/mednafen.h:9:9`!("Enabled") : _cxx . . $ `mednafen/mednafen.h:9:9`!("Disabled")); |
| 764 | for(int x = 0; x < 0x40; x++) |
| 765 | { |
| 766 | HuCPUFastMapcxx . . $ HuCPUFastMap.[x] = ROMSpacecxx . . $ ROMSpace.; |
| 767 | PCEReadcxx . . $ PCERead.[x] = HuCReadcxx . . $ HuCRead(32407b39b2dfce37).; |
| 768 | } |
| 769 | |
| 770 | for(int x = 0x68; x < 0x88; x++) |
| 771 | { |
| 772 | HuCPUFastMapcxx . . $ HuCPUFastMap.[x] = ROMSpacecxx . . $ ROMSpace.; |
| 773 | PCEReadcxx . . $ PCERead.[x] = HuCReadcxx . . $ HuCRead(32407b39b2dfce37).; |
| 774 | PCEWritecxx . . $ PCEWrite.[x] = HuCRAMWritecxx . . $ HuCRAMWrite(cc289a6b3dfc48da).; |
| 775 | } |
| 776 | PCEWritecxx . . $ PCEWrite.[0x80] = HuCRAMWriteCDSpecialcxx . . $ HuCRAMWriteCDSpecial(cc289a6b3dfc48da).; // Hyper Dyne Special hack |
| 777 | MDFNMP_AddRAMcxx . . $ MDFNMP_AddRAM(f9255d7bf06fcbb).(262144, 0x68 * 8192, ROMSpacecxx . . $ ROMSpace. + 0x68 * 8192); |
| 778 | |
| 779 | if(PCE_ACEnabledcxx . . $ PCE_ACEnabled.) |
| 780 | { |
| 781 | if (!(arcade_cardcxx . . $ arcade_card. = new ArcadeCardcxx . . $ ArcadeCard#())) |
| 782 | { |
| 783 | MDFN_PrintErrorcxx . . $ MDFN_PrintError(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("Error creating %s object.\n"), "ArcadeCard"); |
| 784 | Cleanupcxx . . $ Cleanup(49f6e7a06ebc5aa8).(); |
| 785 | return(0); |
| 786 | } |
| 787 | |
| 788 | for(int x = 0x40; x < 0x44; x++) |
| 789 | { |
| 790 | HuCPUFastMapcxx . . $ HuCPUFastMap.[x] = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 791 | PCEReadcxx . . $ PCERead.[x] = ACPhysReadcxx . . $ ACPhysRead(32407b39b2dfce37).; |
| 792 | PCEWritecxx . . $ PCEWrite.[x] = ACPhysWritecxx . . $ ACPhysWrite(cc289a6b3dfc48da).; |
| 793 | } |
| 794 | } |
| 795 | |
| 796 | memset(SaveRAMcxx . . $ SaveRAM., 0x00, 2048); |
| 797 | memcpy(SaveRAMcxx . . $ SaveRAM., BRAM_Init_Stringcxx . . $ BRAM_Init_String., 8); // So users don't have to manually intialize the file cabinet |
| 798 | // in the CD BIOS screen. |
| 799 | |
| 800 | PCEWritecxx . . $ PCEWrite.[0xF7] = SaveRAMWritecxx . . $ SaveRAMWrite(cc289a6b3dfc48da).; |
| 801 | PCEReadcxx . . $ PCERead.[0xF7] = SaveRAMReadcxx . . $ SaveRAMRead(32407b39b2dfce37).; |
| 802 | MDFNMP_AddRAMcxx . . $ MDFNMP_AddRAM(f9255d7bf06fcbb).(2048, 0xF7 * 8192, SaveRAMcxx . . $ SaveRAM.); |
| 803 | return(1); |
| 804 | } |
| 805 | |
| 806 | int HuC_StateActioncxx . . $ HuC_StateAction(a45b884b8cf568d5).(StateMemcxx . . $ StateMem# *sm, int load, int data_only) |
| 807 | { |
| 808 | SFORMATcxx . . $ SFORMAT# StateRegs[] = |
| 809 | { |
| 810 | SFARRAYcxx . . $ `mednafen/state.h:73:9`!(ROMSpace + 0x40 * 8192, IsPopulous ? 32768 : 0), |
| 811 | SFARRAYcxx . . $ `mednafen/state.h:73:9`!(SaveRAM, IsPopulous ? 0 : 2048), |
| 812 | SFARRAYcxx . . $ `mednafen/state.h:73:9`!(ROMSpace + 0x68 * 8192, PCE_IsCD ? 262144 : 0), |
| 813 | SFVARcxx . . $ `mednafen/state.h:70:9`!(HuCSF2Latch), |
| 814 | SFENDcxx . . $ `mednafen/state.h:94:9`! |
| 815 | }; |
| 816 | int ret = MDFNSS_StateActioncxx . . $ MDFNSS_StateAction(3f628545d3b0df83).(sm, load, data_only, StateRegs, "HuC"); |
| 817 | |
| 818 | if(load) |
| 819 | HuCSF2Latchcxx . . $ HuCSF2Latch. &= 0x3; |
| 820 | |
| 821 | if(PCE_IsCDcxx . . $ PCE_IsCD.) |
| 822 | { |
| 823 | ret &= PCECD_StateActioncxx . . $ PCECD_StateAction(a45b884b8cf568d5).(sm, load, data_only); |
| 824 | |
| 825 | if(arcade_cardcxx . . $ arcade_card.) |
| 826 | ret &= arcade_cardcxx . . $ arcade_card.->StateActioncxx . . $ ArcadeCard#StateAction(a45b884b8cf568d5).(sm, load, data_only); |
| 827 | } |
| 828 | return(ret); |
| 829 | } |
| 830 | |
| 831 | void HuC_Closecxx . . $ HuC_Close(49f6e7a06ebc5aa8).(void) |
| 832 | { |
| 833 | Cleanupcxx . . $ Cleanup(49f6e7a06ebc5aa8).(); |
| 834 | } |
| 835 | |
| 836 | void HuC_Powercxx . . $ HuC_Power(49f6e7a06ebc5aa8).(void) |
| 837 | { |
| 838 | if(PCE_IsCDcxx . . $ PCE_IsCD.) |
| 839 | memset(ROMSpacecxx . . $ ROMSpace. + 0x68 * 8192, 0x00, 262144); |
| 840 | |
| 841 | if(arcade_cardcxx . . $ arcade_card.) |
| 842 | arcade_cardcxx . . $ arcade_card.->Powercxx . . $ ArcadeCard#Power(49f6e7a06ebc5aa8).(); |
| 843 | } |
| 844 | |
| 845 | MDFNGIcxx . . $ MDFNGI# EmulatedPCE_Fastcxx . . $ EmulatedPCE_Fast. = |
| 846 | { |
| 847 | "pce_fast", |
| 848 | "PC Engine (CD)/TurboGrafx 16 (CD)/SuperGrafx", |
| 849 | KnownExtensionscxx . . $ KnownExtensions., |
| 850 | MODPRIO_INTERNAL_LOWcxx . . $ MODPRIO_INTERNAL_LOW., |
| 851 | NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, |
| 852 | &PCEInputInfocxx . . $ PCEInputInfo., |
| 853 | Loadcxx . . $ Load(c185cac771729fac)., |
| 854 | TestMagiccxx . . $ TestMagic(ac45b4c5cbf1681)., |
| 855 | LoadCDcxx . . $ LoadCD(23534a0a66bd214a)., |
| 856 | TestMagicCDcxx . . $ TestMagicCD(aaf3bd88f6d508ce)., |
| 857 | CloseGamecxx . . $ CloseGame(49f6e7a06ebc5aa8)., |
| 858 | VDC_SetLayerEnableMaskcxx . . $ VDC_SetLayerEnableMask(2c44cd906ae4e829)., |
| 859 | NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, |
| 860 | NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, |
| 861 | NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, |
| 862 | NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, |
| 863 | NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, |
| 864 | MemReadcxx . . $ MemRead(32407b39b2dfce37)., |
| 865 | NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, |
| 866 | false, |
| 867 | StateActioncxx . . $ StateAction(a45b884b8cf568d5)., |
| 868 | Emulatecxx . . $ Emulate(c2dd9660813a5292)., |
| 869 | PCEINPUT_SetInputcxx . . $ PCEINPUT_SetInput(d29b3d01ccfd77ca)., |
| 870 | DoSimpleCommandcxx . . $ DoSimpleCommand(d4f767463ce0a6b3)., |
| 871 | PCESettingscxx . . $ PCESettings., |
| 872 | MDFN_MASTERCLOCK_FIXEDcxx . . $ `mednafen/git.h:342:10`!(PCE_MASTER_CLOCKcxx . . $ `mednafen/pce_fast/pce.h:9:9`!), |
| 873 | 0, |
| 874 | |
| 875 | true, // Multires possible? |
| 876 | |
| 877 | 0, // lcm_width |
| 878 | 0, // lcm_height |
| 879 | NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, // Dummy |
| 880 | |
| 881 | 288, // Nominal width |
| 882 | 232, // Nominal height |
| 883 | |
| 884 | 512, // Framebuffer width |
| 885 | 242, // Framebuffer height |
| 886 | |
| 887 | 2, // Number of output sound channels |
| 888 | }; |
| 889 | |
| 890 | #ifdef NEED_CDcxx . . $ `<built-in>:487:9`! |
| 891 | static void ReadM3Ucxx . . $ ReadM3U(b86665ccd67f00c3).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> &file_list, stdcxx . . $ std/::stringcxx . . $ std/string# path, unsigned depth = 0) |
| 892 | { |
| 893 | stdcxx . . $ std/::stringcxx . . $ std/string# dir_pathcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).; |
| 894 | char linebuf[2048]; |
| 895 | FILEcxx . . $ FILE# *fp = fopen(path.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), "rb"); |
| 896 | |
| 897 | if (fp == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 898 | return; |
| 899 | |
| 900 | MDFN_GetFilePathComponentscxx . . $ MDFN_GetFilePathComponents(f608b903cc9a02a6).(path, &dir_path); |
| 901 | |
| 902 | while(fgets(linebuf, sizeof(linebuf), fp)) |
| 903 | { |
| 904 | stdcxx . . $ std/::stringcxx . . $ std/string# efpcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).; |
| 905 | |
| 906 | if(linebuf[0] == '#') |
| 907 | continue; |
| 908 | string_trim_whitespace_right(linebuf); |
| 909 | if(linebuf[0] == 0) |
| 910 | continue; |
| 911 | |
| 912 | efp =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). MDFN_EvalFIPcxx . . $ MDFN_EvalFIP(2007729dd81cc85).(dir_path, stdcxx . . $ std/::stringcxx . . $ std/string#(linebuf)); |
| 913 | |
| 914 | if(efp.sizecxx . . $ std/__cxx11/basic_string#size(6f8bd5c0ea8fb29a).() >= 4 && efp.substrcxx . . $ std/__cxx11/basic_string#substr(149c655009c9bbd2).(efp.sizecxx . . $ std/__cxx11/basic_string#size(6f8bd5c0ea8fb29a).() - 4) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). ".m3u") |
| 915 | { |
| 916 | if(efp ==cxx . . $ std/`operator==`(5ea818b58063a774). path) |
| 917 | throw(MDFN_Errorcxx . . $ MDFN_Error#MDFN_Error(3021f9d48bee4f7).(0, _cxx . . $ `mednafen/mednafen.h:9:9`!("M3U at \"%s\" references self."), efp.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).())); |
| 918 | |
| 919 | if(depth == 99) |
| 920 | throw(MDFN_Errorcxx . . $ MDFN_Error#MDFN_Error(3021f9d48bee4f7).(0, _cxx . . $ `mednafen/mednafen.h:9:9`!("M3U load recursion too deep!"))); |
| 921 | |
| 922 | ReadM3Ucxx . . $ ReadM3U(b86665ccd67f00c3).(file_list, efpcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5)., depth++); |
| 923 | } |
| 924 | else |
| 925 | file_list.push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(efp); |
| 926 | } |
| 927 | |
| 928 | fclose(fp); |
| 929 | } |
| 930 | |
| 931 | #ifdef NEED_CDcxx . . $ `<built-in>:487:9`! |
| 932 | static stdcxx . . $ std/::vectorcxx . . $ std/vector#<CDIFcxx . . $ CDIF# *> CDInterfacescxx . . $ CDInterfaces.; // FIXME: Cleanup on error out. |
| 933 | #endif |
| 934 | // TODO: LoadCommon() |
| 935 | |
| 936 | MDFNGIcxx . . $ MDFNGI# *MDFNI_LoadCDcxx . . $ MDFNI_LoadCD(acefc047a690e6dc).(const char *force_module, const char *devicename) |
| 937 | { |
| 938 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("Loading %s...\n\n"), devicename ? devicename : _cxx . . $ `mednafen/mednafen.h:9:9`!("PHYSICAL CD")); |
| 939 | |
| 940 | try |
| 941 | { |
| 942 | if(devicename && strlen(devicename) > 4 && !strcasecmp(devicename + strlen(devicename) - 4, ".m3u")) |
| 943 | { |
| 944 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> file_listcxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 945 | |
| 946 | ReadM3Ucxx . . $ ReadM3U(b86665ccd67f00c3).(file_list, devicenamecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 947 | |
| 948 | for(unsigned i = 0; i < file_list.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) |
| 949 | { |
| 950 | CDInterfacescxx . . $ CDInterfaces..push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(CDIF_Opencxx . . $ CDIF_Open(c10ccd82c5204030).(file_list[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i].c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), false, old_cdimagecachecxx . . $ old_cdimagecache.)); |
| 951 | } |
| 952 | } |
| 953 | else |
| 954 | { |
| 955 | CDInterfacescxx . . $ CDInterfaces..push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(CDIF_Opencxx . . $ CDIF_Open(c10ccd82c5204030).(devicename, false, old_cdimagecachecxx . . $ old_cdimagecache.)); |
| 956 | } |
| 957 | } |
| 958 | catch(stdcxx . . $ std/::exception &e) |
| 959 | { |
| 960 | MDFND_PrintErrorcxx . . $ MDFND_PrintError(85c52e162fed56f9).(e.what()); |
| 961 | MDFN_PrintErrorcxx . . $ MDFN_PrintError(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("Error opening CD.")); |
| 962 | return(0); |
| 963 | } |
| 964 | |
| 965 | // |
| 966 | // Print out a track list for all discs. |
| 967 | // |
| 968 | MDFN_indentcxx . . $ MDFN_indent(d4f767463ce0a6b3).(1); |
| 969 | for(unsigned i = 0; i < CDInterfacescxx . . $ CDInterfaces..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) |
| 970 | { |
| 971 | CDUtilitycxx . . $ CDUtility/::TOCcxx . . $ CDUtility/TOC# toccxx . . $ CDUtility/TOC#TOC(49f6e7a06ebc5aa8).; |
| 972 | |
| 973 | CDInterfacescxx . . $ CDInterfaces.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i]->ReadTOCcxx . . $ CDIF#ReadTOC(421bcafe44c737e9).(&toc); |
| 974 | |
| 975 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("CD %d Layout:\n"), i + 1); |
| 976 | MDFN_indentcxx . . $ MDFN_indent(d4f767463ce0a6b3).(1); |
| 977 | |
| 978 | for(int32cxx . . $ int32# track = toc.first_trackcxx . . $ CDUtility/TOC#first_track.; track <= toc.last_trackcxx . . $ CDUtility/TOC#last_track.; track++) |
| 979 | { |
| 980 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("Track %2d, LBA: %6d %s\n"), track, toc.trackscxx . . $ CDUtility/TOC#tracks.[track].lbacxx . . $ CDUtility/TOC_Track#lba., (toc.trackscxx . . $ CDUtility/TOC#tracks.[track].controlcxx . . $ CDUtility/TOC_Track#control. & 0x4) ? "DATA" : "AUDIO"); |
| 981 | } |
| 982 | |
| 983 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).("Leadout: %6d\n", toc.trackscxx . . $ CDUtility/TOC#tracks.[100].lbacxx . . $ CDUtility/TOC_Track#lba.); |
| 984 | MDFN_indentcxx . . $ MDFN_indent(d4f767463ce0a6b3).(-1); |
| 985 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).("\n"); |
| 986 | } |
| 987 | MDFN_indentcxx . . $ MDFN_indent(d4f767463ce0a6b3).(-1); |
| 988 | |
| 989 | // This if statement will be true if force_module references a system without CDROM support. |
| 990 | if(!MDFNGameInfocxx . . $ MDFNGameInfo.->LoadCDcxx . . $ $anonymous_type_643ef407c229d02_12#LoadCD.) |
| 991 | { |
| 992 | MDFN_PrintErrorcxx . . $ MDFN_PrintError(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("Specified system \"%s\" doesn't support CDs!"), force_module); |
| 993 | return(0); |
| 994 | } |
| 995 | |
| 996 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("Using module: %s(%s)\n\n"), MDFNGameInfocxx . . $ MDFNGameInfo.->shortnamecxx . . $ $anonymous_type_643ef407c229d02_12#shortname., MDFNGameInfocxx . . $ MDFNGameInfo.->fullnamecxx . . $ $anonymous_type_643ef407c229d02_12#fullname.); |
| 997 | |
| 998 | if(!(MDFNGameInfocxx . . $ MDFNGameInfo.->LoadCDcxx . . $ $anonymous_type_643ef407c229d02_12#LoadCD.(&CDInterfacescxx . . $ CDInterfaces.))) |
| 999 | { |
| 1000 | for(unsigned i = 0; i < CDInterfacescxx . . $ CDInterfaces..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) |
| 1001 | delete CDInterfacescxx . . $ CDInterfaces.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i]; |
| 1002 | CDInterfacescxx . . $ CDInterfaces..clearcxx . . $ std/vector#clear(ced63f7c635d850d).(); |
| 1003 | |
| 1004 | MDFNGameInfocxx . . $ MDFNGameInfo. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1005 | return(0); |
| 1006 | } |
| 1007 | |
| 1008 | //MDFNI_SetLayerEnableMask(~0ULL); |
| 1009 | |
| 1010 | MDFN_LoadGameCheatscxx . . $ MDFN_LoadGameCheats(5d22bdacc48458e8).(NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!); |
| 1011 | MDFNMP_InstallReadPatchescxx . . $ MDFNMP_InstallReadPatches(49f6e7a06ebc5aa8).(); |
| 1012 | |
| 1013 | return(MDFNGameInfocxx . . $ MDFNGameInfo.); |
| 1014 | } |
| 1015 | #endif |
| 1016 | |
| 1017 | MDFNGIcxx . . $ MDFNGI# *MDFNI_LoadGamecxx . . $ MDFNI_LoadGame(acefc047a690e6dc).(const char *force_module, const char *name) |
| 1018 | { |
| 1019 | MDFNFILEcxx . . $ MDFNFILE# GameFilecxx . . $ MDFNFILE#MDFNFILE(49f6e7a06ebc5aa8).; |
| 1020 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<FileExtensionSpecStructcxx . . $ FileExtensionSpecStruct#> valid_iaecxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 1021 | MDFNGameInfocxx . . $ MDFNGameInfo. = &EmulatedPCE_Fastcxx . . $ EmulatedPCE_Fast.; |
| 1022 | |
| 1023 | #ifdef NEED_CDcxx . . $ `<built-in>:487:9`! |
| 1024 | if(strlen(name) > 4 && (!strcasecmp(name + strlen(name) - 4, ".cue") || !strcasecmp(name + strlen(name) - 4, ".ccd") || !strcasecmp(name + strlen(name) - 4, ".toc") || !strcasecmp(name + strlen(name) - 4, ".m3u"))) |
| 1025 | return(MDFNI_LoadCDcxx . . $ MDFNI_LoadCD(acefc047a690e6dc).(force_module, name)); |
| 1026 | #endif |
| 1027 | |
| 1028 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("Loading %s...\n"),name); |
| 1029 | |
| 1030 | MDFN_indentcxx . . $ MDFN_indent(d4f767463ce0a6b3).(1); |
| 1031 | |
| 1032 | // Construct a NULL-delimited list of known file extensions for MDFN_fopen() |
| 1033 | const FileExtensionSpecStructcxx . . $ FileExtensionSpecStruct# *curexts = MDFNGameInfocxx . . $ MDFNGameInfo.->FileExtensionscxx . . $ $anonymous_type_643ef407c229d02_12#FileExtensions.; |
| 1034 | |
| 1035 | while(curexts->extensioncxx . . $ $anonymous_type_643ef407c229d02_0#extension. && curexts->descriptioncxx . . $ $anonymous_type_643ef407c229d02_0#description.) |
| 1036 | { |
| 1037 | valid_iae.push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(*curexts); |
| 1038 | curexts++; |
| 1039 | } |
| 1040 | |
| 1041 | if(!GameFile.Opencxx . . $ MDFNFILE#Open(eb4f300025480a43).(name, &valid_iae[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0], _cxx . . $ `mednafen/mednafen.h:9:9`!("game"))) |
| 1042 | { |
| 1043 | MDFNGameInfocxx . . $ MDFNGameInfo. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1044 | return 0; |
| 1045 | } |
| 1046 | |
| 1047 | MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(_cxx . . $ `mednafen/mednafen.h:9:9`!("Using module: %s(%s)\n\n"), MDFNGameInfocxx . . $ MDFNGameInfo.->shortnamecxx . . $ $anonymous_type_643ef407c229d02_12#shortname., MDFNGameInfocxx . . $ MDFNGameInfo.->fullnamecxx . . $ $anonymous_type_643ef407c229d02_12#fullname.); |
| 1048 | MDFN_indentcxx . . $ MDFN_indent(d4f767463ce0a6b3).(1); |
| 1049 | |
| 1050 | // |
| 1051 | // Load per-game settings |
| 1052 | // |
| 1053 | // Maybe we should make a "pgcfg" subdir, and automatically load all files in it? |
| 1054 | // End load per-game settings |
| 1055 | // |
| 1056 | |
| 1057 | if(MDFNGameInfocxx . . $ MDFNGameInfo.->Loadcxx . . $ $anonymous_type_643ef407c229d02_12#Load.(name, &GameFile) <= 0) |
| 1058 | { |
| 1059 | GameFile.Closecxx . . $ MDFNFILE#Close(c9857a73d68e59ba).(); |
| 1060 | MDFN_indentcxx . . $ MDFN_indent(d4f767463ce0a6b3).(-2); |
| 1061 | MDFNGameInfocxx . . $ MDFNGameInfo. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1062 | return(0); |
| 1063 | } |
| 1064 | |
| 1065 | MDFN_LoadGameCheatscxx . . $ MDFN_LoadGameCheats(5d22bdacc48458e8).(NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!); |
| 1066 | MDFNMP_InstallReadPatchescxx . . $ MDFNMP_InstallReadPatches(49f6e7a06ebc5aa8).(); |
| 1067 | |
| 1068 | MDFN_indentcxx . . $ MDFN_indent(d4f767463ce0a6b3).(-2); |
| 1069 | |
| 1070 | if(!MDFNGameInfocxx . . $ MDFNGameInfo.->namecxx . . $ $anonymous_type_643ef407c229d02_12#name.) |
| 1071 | { |
| 1072 | unsigned int x; |
| 1073 | char *tmp; |
| 1074 | |
| 1075 | MDFNGameInfocxx . . $ MDFNGameInfo.->namecxx . . $ $anonymous_type_643ef407c229d02_12#name. = (UTF8cxx . . $ UTF8# *)strdup(GetFNComponentcxx . . $ GetFNComponent(fb58d2e09a2a1ce6).(name)); |
| 1076 | |
| 1077 | for(x=0;x<strlen((char *)MDFNGameInfocxx . . $ MDFNGameInfo.->namecxx . . $ $anonymous_type_643ef407c229d02_12#name.);x++) |
| 1078 | { |
| 1079 | if(MDFNGameInfocxx . . $ MDFNGameInfo.->namecxx . . $ $anonymous_type_643ef407c229d02_12#name.[x] == '_') |
| 1080 | MDFNGameInfocxx . . $ MDFNGameInfo.->namecxx . . $ $anonymous_type_643ef407c229d02_12#name.[x] = ' '; |
| 1081 | } |
| 1082 | if((tmp = strrchr((char *)MDFNGameInfocxx . . $ MDFNGameInfo.->namecxx . . $ $anonymous_type_643ef407c229d02_12#name., '.'))) |
| 1083 | *tmp = 0; |
| 1084 | } |
| 1085 | |
| 1086 | return(MDFNGameInfocxx . . $ MDFNGameInfo.); |
| 1087 | } |
| 1088 | |
| 1089 | static int curindentcxx . . $ curindent. = 0; |
| 1090 | |
| 1091 | void MDFN_indentcxx . . $ MDFN_indent(d4f767463ce0a6b3).(int indent) |
| 1092 | { |
| 1093 | curindentcxx . . $ curindent. += indent; |
| 1094 | } |
| 1095 | |
| 1096 | static uint8cxx . . $ uint8# lastcharcxx . . $ lastchar. = 0; |
| 1097 | |
| 1098 | void MDFN_printfcxx . . $ MDFN_printf(326aeb464d16410c).(const char *format, ...) |
| 1099 | { |
| 1100 | char *format_temp; |
| 1101 | char *temp; |
| 1102 | unsigned int x, newlen; |
| 1103 | |
| 1104 | va_listcxx . . $ va_list# ap; |
| 1105 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(ap,format); |
| 1106 | |
| 1107 | |
| 1108 | // First, determine how large our format_temp buffer needs to be. |
| 1109 | uint8cxx . . $ uint8# lastchar_backup = lastcharcxx . . $ lastchar.; // Save lastchar! |
| 1110 | for(newlen=x=0;x<strlen(format);x++) |
| 1111 | { |
| 1112 | if(lastcharcxx . . $ lastchar. == '\n' && format[x] != '\n') |
| 1113 | { |
| 1114 | int y; |
| 1115 | for(y=0;y<curindentcxx . . $ curindent.;y++) |
| 1116 | newlen++; |
| 1117 | } |
| 1118 | newlen++; |
| 1119 | lastcharcxx . . $ lastchar. = format[x]; |
| 1120 | } |
| 1121 | |
| 1122 | format_temp = (char *)malloc(newlen + 1); // Length + NULL character, duh |
| 1123 | |
| 1124 | // Now, construct our format_temp string |
| 1125 | lastcharcxx . . $ lastchar. = lastchar_backup; // Restore lastchar |
| 1126 | for(newlen=x=0;x<strlen(format);x++) |
| 1127 | { |
| 1128 | if(lastcharcxx . . $ lastchar. == '\n' && format[x] != '\n') |
| 1129 | { |
| 1130 | int y; |
| 1131 | for(y=0;y<curindentcxx . . $ curindent.;y++) |
| 1132 | format_temp[newlen++] = ' '; |
| 1133 | } |
| 1134 | format_temp[newlen++] = format[x]; |
| 1135 | lastcharcxx . . $ lastchar. = format[x]; |
| 1136 | } |
| 1137 | |
| 1138 | format_temp[newlen] = 0; |
| 1139 | |
| 1140 | temp = new char[4096]; |
| 1141 | vsnprintf(temp, 4096, format_temp, ap); |
| 1142 | free(format_temp); |
| 1143 | |
| 1144 | MDFND_Messagecxx . . $ MDFND_Message(85c52e162fed56f9).(temp); |
| 1145 | free(temp); |
| 1146 | |
| 1147 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 1148 | } |
| 1149 | |
| 1150 | void MDFN_PrintErrorcxx . . $ MDFN_PrintError(326aeb464d16410c).(const char *format, ...) |
| 1151 | { |
| 1152 | char *temp; |
| 1153 | |
| 1154 | va_listcxx . . $ va_list# ap; |
| 1155 | |
| 1156 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(ap, format); |
| 1157 | |
| 1158 | temp = new char[4096]; |
| 1159 | vsnprintf(temp, 4096, format, ap); |
| 1160 | MDFND_PrintErrorcxx . . $ MDFND_PrintError(85c52e162fed56f9).(temp); |
| 1161 | free(temp); |
| 1162 | |
| 1163 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 1164 | } |
| 1165 | |
| 1166 | void MDFN_DebugPrintRealcxx . . $ MDFN_DebugPrintReal(b8982657348efbf7).(const char *file, const int line, const char *format, ...) |
| 1167 | { |
| 1168 | char *temp; |
| 1169 | |
| 1170 | va_listcxx . . $ va_list# ap; |
| 1171 | |
| 1172 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(ap, format); |
| 1173 | |
| 1174 | temp = new char[4096]; |
| 1175 | vsnprintf(temp, 4096, format, ap); |
| 1176 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "%s:%d %s\n", file, line, temp); |
| 1177 | free(temp); |
| 1178 | |
| 1179 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 1180 | } |
| 1181 | |
| 1182 | |
| 1183 | static MDFNGIcxx . . $ MDFNGI# *gamecxx . . $ game.; |
| 1184 | |
| 1185 | struct retro_perf_callback perf_cbcxx . . $ perf_cb.; |
| 1186 | retro_get_cpu_features_t perf_get_cpu_features_cbcxx . . $ perf_get_cpu_features_cb. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1187 | retro_log_printf_t log_cbcxx . . $ log_cb.; |
| 1188 | static retro_video_refresh_t video_cbcxx . . $ video_cb.; |
| 1189 | static retro_audio_sample_t audio_cbcxx . . $ audio_cb.; |
| 1190 | static retro_audio_sample_batch_t audio_batch_cbcxx . . $ audio_batch_cb.; |
| 1191 | static retro_environment_t environ_cbcxx . . $ environ_cb.; |
| 1192 | static retro_input_poll_t input_poll_cbcxx . . $ input_poll_cb.; |
| 1193 | static retro_input_state_t input_state_cbcxx . . $ input_state_cb.; |
| 1194 | |
| 1195 | static bool overscancxx . . $ overscan.; |
| 1196 | static double last_sound_ratecxx . . $ last_sound_rate.; |
| 1197 | |
| 1198 | static MDFN_Surface *surfcxx . . $ surf.; |
| 1199 | |
| 1200 | static bool failed_initcxx . . $ failed_init.; |
| 1201 | |
| 1202 | stdcxx . . $ std/::stringcxx . . $ std/string# retro_base_directorycxx . . $ retro_base_directory.; |
| 1203 | stdcxx . . $ std/::stringcxx . . $ std/string# retro_base_namecxx . . $ retro_base_name.; |
| 1204 | stdcxx . . $ std/::stringcxx . . $ std/string# retro_save_directorycxx . . $ retro_save_directory.; |
| 1205 | |
| 1206 | static void set_basenamecxx . . $ set_basename(85c52e162fed56f9).(const char *path) |
| 1207 | { |
| 1208 | const char *base = strrchr(path, '/'); |
| 1209 | if (!base) |
| 1210 | base = strrchr(path, '\\'); |
| 1211 | |
| 1212 | if (base) |
| 1213 | retro_base_namecxx . . $ retro_base_name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). base + 1; |
| 1214 | else |
| 1215 | retro_base_namecxx . . $ retro_base_name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). path; |
| 1216 | |
| 1217 | retro_base_namecxx . . $ retro_base_name. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). retro_base_namecxx . . $ retro_base_name..substrcxx . . $ std/__cxx11/basic_string#substr(149c655009c9bbd2).(0, retro_base_namecxx . . $ retro_base_name..find_last_ofcxx . . $ std/__cxx11/basic_string#find_last_of(2dda2fc6b78abe68).('.')); |
| 1218 | } |
| 1219 | |
| 1220 | #include "mednafen/pce_fast/pcecd.h"cxx . . $ `<file>/mednafen/pce_fast/pcecd.h`/ |
| 1221 | |
| 1222 | #define MEDNAFEN_CORE_NAME_MODULEcxx . . $ `libretro.cpp:1222:9`! "pce_fast" |
| 1223 | #define MEDNAFEN_CORE_NAMEcxx . . $ `libretro.cpp:1223:9`! "Mednafen PCE Fast" |
| 1224 | #define MEDNAFEN_CORE_VERSIONcxx . . $ `libretro.cpp:1224:9`! "v0.9.38.7" |
| 1225 | #define MEDNAFEN_CORE_EXTENSIONScxx . . $ `libretro.cpp:1225:9`! "pce|cue|ccd" |
| 1226 | #define MEDNAFEN_CORE_TIMING_FPScxx . . $ `libretro.cpp:1226:9`! 59.82 |
| 1227 | #define MEDNAFEN_CORE_GEOMETRY_BASE_Wcxx . . $ `libretro.cpp:1227:9`! 288 |
| 1228 | #define MEDNAFEN_CORE_GEOMETRY_BASE_Hcxx . . $ `libretro.cpp:1228:9`! 232 |
| 1229 | #define MEDNAFEN_CORE_GEOMETRY_MAX_Wcxx . . $ `libretro.cpp:1229:9`! 512 |
| 1230 | #define MEDNAFEN_CORE_GEOMETRY_MAX_Hcxx . . $ `libretro.cpp:1230:9`! 242 |
| 1231 | #define MEDNAFEN_CORE_GEOMETRY_ASPECT_RATIOcxx . . $ `libretro.cpp:1231:9`! (4.0 / 3.0) |
| 1232 | #define FB_WIDTHcxx . . $ `libretro.cpp:1232:9`! 512 |
| 1233 | #define FB_HEIGHTcxx . . $ `libretro.cpp:1233:9`! 242 |
| 1234 | |
| 1235 | #define FB_MAX_HEIGHTcxx . . $ `libretro.cpp:1235:9`! FB_HEIGHTcxx . . $ `libretro.cpp:1233:9`! |
| 1236 | |
| 1237 | static void check_system_specscxx . . $ check_system_specs(49f6e7a06ebc5aa8).(void) |
| 1238 | { |
| 1239 | unsigned level = 5; |
| 1240 | environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVELcxx . . $ `libretro.h:482:9`!, &level); |
| 1241 | } |
| 1242 | |
| 1243 | void retro_initcxx . . $ retro_init(49f6e7a06ebc5aa8).(void) |
| 1244 | { |
| 1245 | struct retro_log_callback log; |
| 1246 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_LOG_INTERFACEcxx . . $ `libretro.h:711:9`!, &log)) |
| 1247 | log_cbcxx . . $ log_cb. = log.log; |
| 1248 | else |
| 1249 | log_cbcxx . . $ log_cb. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1250 | |
| 1251 | #ifdef NEED_CDcxx . . $ `<built-in>:487:9`! |
| 1252 | CDUtilitycxx . . $ CDUtility/::CDUtility_Initcxx . . $ CDUtility/CDUtility_Init(49f6e7a06ebc5aa8).(); |
| 1253 | #endif |
| 1254 | |
| 1255 | const char *dir = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1256 | |
| 1257 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORYcxx . . $ `libretro.h:499:9`!, &dir) && dir) |
| 1258 | { |
| 1259 | retro_base_directorycxx . . $ retro_base_directory. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). dir; |
| 1260 | // Make sure that we don't have any lingering slashes, etc, as they break Windows. |
| 1261 | size_t last = retro_base_directorycxx . . $ retro_base_directory..find_last_not_ofcxx . . $ std/__cxx11/basic_string#find_last_not_of(b733e800f6f8fb8b).("/\\"); |
| 1262 | if (last != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.) |
| 1263 | last++; |
| 1264 | |
| 1265 | retro_base_directorycxx . . $ retro_base_directory. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). retro_base_directorycxx . . $ retro_base_directory..substrcxx . . $ std/__cxx11/basic_string#substr(149c655009c9bbd2).(0, last); |
| 1266 | } |
| 1267 | else |
| 1268 | { |
| 1269 | /* TODO: Add proper fallback */ |
| 1270 | if (log_cbcxx . . $ log_cb.) |
| 1271 | log_cbcxx . . $ log_cb.(RETRO_LOG_WARN, "System directory is not defined. Fallback on using same dir as ROM for system directory later ...\n"); |
| 1272 | failed_initcxx . . $ failed_init. = true; |
| 1273 | } |
| 1274 | |
| 1275 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORYcxx . . $ `libretro.h:745:9`!, &dir) && dir) |
| 1276 | { |
| 1277 | // If save directory is defined use it, otherwise use system directory |
| 1278 | retro_save_directorycxx . . $ retro_save_directory. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). *dir ? dircxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d). : retro_base_directorycxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).; |
| 1279 | // Make sure that we don't have any lingering slashes, etc, as they break Windows. |
| 1280 | size_t last = retro_save_directorycxx . . $ retro_save_directory..find_last_not_ofcxx . . $ std/__cxx11/basic_string#find_last_not_of(b733e800f6f8fb8b).("/\\"); |
| 1281 | if (last != stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos.) |
| 1282 | last++; |
| 1283 | |
| 1284 | retro_save_directorycxx . . $ retro_save_directory. =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). retro_save_directorycxx . . $ retro_save_directory..substrcxx . . $ std/__cxx11/basic_string#substr(149c655009c9bbd2).(0, last); |
| 1285 | } |
| 1286 | else |
| 1287 | { |
| 1288 | /* TODO: Add proper fallback */ |
| 1289 | if (log_cbcxx . . $ log_cb.) |
| 1290 | log_cbcxx . . $ log_cb.(RETRO_LOG_WARN, "Save directory is not defined. Fallback on using SYSTEM directory ...\n"); |
| 1291 | retro_save_directorycxx . . $ retro_save_directory. =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). retro_base_directorycxx . . $ retro_base_directory.; |
| 1292 | } |
| 1293 | |
| 1294 | enum retro_pixel_format rgb565 = RETRO_PIXEL_FORMAT_RGB565; |
| 1295 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_SET_PIXEL_FORMATcxx . . $ `libretro.h:513:9`!, &rgb565) && log_cbcxx . . $ log_cb.) |
| 1296 | log_cbcxx . . $ log_cb.(RETRO_LOG_INFO, "Frontend supports RGB565 - will use that instead of XRGB1555.\n"); |
| 1297 | |
| 1298 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_PERF_INTERFACEcxx . . $ `libretro.h:721:9`!, &perf_cbcxx . . $ perf_cb.)) |
| 1299 | perf_get_cpu_features_cbcxx . . $ perf_get_cpu_features_cb. = perf_cbcxx . . $ perf_cb..get_cpu_features; |
| 1300 | else |
| 1301 | perf_get_cpu_features_cbcxx . . $ perf_get_cpu_features_cb. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1302 | |
| 1303 | bool yes = true; |
| 1304 | environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_SET_SUPPORT_ACHIEVEMENTScxx . . $ `libretro.h:949:9`!, &yes); |
| 1305 | |
| 1306 | setting_initial_scanlinecxx . . $ setting_initial_scanline. = 0; |
| 1307 | setting_last_scanlinecxx . . $ setting_last_scanline. = 242; |
| 1308 | |
| 1309 | check_system_specscxx . . $ check_system_specs(49f6e7a06ebc5aa8).(); |
| 1310 | } |
| 1311 | |
| 1312 | void retro_resetcxx . . $ retro_reset(49f6e7a06ebc5aa8).(void) |
| 1313 | { |
| 1314 | DoSimpleCommandcxx . . $ DoSimpleCommand(d4f767463ce0a6b3).(MDFN_MSC_RESETcxx . . $ MDFN_MSC_RESET.); |
| 1315 | } |
| 1316 | |
| 1317 | bool retro_load_game_specialcxx . . $ retro_load_game_special(bd3da2cb0fb3e69a).(unsigned, const struct retro_game_info *, size_t) |
| 1318 | { |
| 1319 | return false; |
| 1320 | } |
| 1321 | |
| 1322 | static void set_volumecxx . . $ set_volume(d89196f67e9c91e5). (uint32_tcxx . . $ uint32_t# *ptr, unsigned number) |
| 1323 | { |
| 1324 | switch(number) |
| 1325 | { |
| 1326 | default: |
| 1327 | *ptr = number; |
| 1328 | break; |
| 1329 | } |
| 1330 | } |
| 1331 | |
| 1332 | |
| 1333 | static void check_variablescxx . . $ check_variables(49f6e7a06ebc5aa8).(void) |
| 1334 | { |
| 1335 | struct retro_variable var = {0}; |
| 1336 | |
| 1337 | var.key = "pce_fast_cdimagecache"; |
| 1338 | |
| 1339 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_VARIABLEcxx . . $ `libretro.h:556:9`!, &var) && var.value) |
| 1340 | { |
| 1341 | bool cdimage_cache = true; |
| 1342 | |
| 1343 | if (strcmp(var.value, "enabled") == 0) |
| 1344 | cdimage_cache = true; |
| 1345 | else if (strcmp(var.value, "disabled") == 0) |
| 1346 | cdimage_cache = false; |
| 1347 | |
| 1348 | if (cdimage_cache != old_cdimagecachecxx . . $ old_cdimagecache.) |
| 1349 | old_cdimagecachecxx . . $ old_cdimagecache. = cdimage_cache; |
| 1350 | } |
| 1351 | |
| 1352 | var.key = "pce_nospritelimit"; |
| 1353 | |
| 1354 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_VARIABLEcxx . . $ `libretro.h:556:9`!, &var) && var.value) |
| 1355 | { |
| 1356 | if (strcmp(var.value, "disabled") == 0) |
| 1357 | setting_pce_fast_nospritelimitcxx . . $ setting_pce_fast_nospritelimit. = 0; |
| 1358 | else if (strcmp(var.value, "enabled") == 0) |
| 1359 | setting_pce_fast_nospritelimitcxx . . $ setting_pce_fast_nospritelimit. = 1; |
| 1360 | } |
| 1361 | |
| 1362 | var.key = "pce_keepaspect"; |
| 1363 | |
| 1364 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_VARIABLEcxx . . $ `libretro.h:556:9`!, &var) && var.value) |
| 1365 | { |
| 1366 | if (strcmp(var.value, "disabled") == 0) |
| 1367 | { |
| 1368 | setting_pce_keepaspectcxx . . $ setting_pce_keepaspect. = 0; |
| 1369 | EmulatedPCE_Fastcxx . . $ EmulatedPCE_Fast..fb_widthcxx . . $ $anonymous_type_643ef407c229d02_12#fb_width. = 512; |
| 1370 | EmulatedPCE_Fastcxx . . $ EmulatedPCE_Fast..nominal_widthcxx . . $ $anonymous_type_643ef407c229d02_12#nominal_width. = 341; |
| 1371 | EmulatedPCE_Fastcxx . . $ EmulatedPCE_Fast..lcm_widthcxx . . $ $anonymous_type_643ef407c229d02_12#lcm_width. = 341; |
| 1372 | } |
| 1373 | else if (strcmp(var.value, "enabled") == 0) |
| 1374 | { |
| 1375 | setting_pce_keepaspectcxx . . $ setting_pce_keepaspect. = 1; |
| 1376 | EmulatedPCE_Fastcxx . . $ EmulatedPCE_Fast..fb_widthcxx . . $ $anonymous_type_643ef407c229d02_12#fb_width. = 682; |
| 1377 | EmulatedPCE_Fastcxx . . $ EmulatedPCE_Fast..nominal_widthcxx . . $ $anonymous_type_643ef407c229d02_12#nominal_width. = 288; |
| 1378 | EmulatedPCE_Fastcxx . . $ EmulatedPCE_Fast..lcm_widthcxx . . $ $anonymous_type_643ef407c229d02_12#lcm_width. = 1024; |
| 1379 | } |
| 1380 | } |
| 1381 | |
| 1382 | var.key = "pce_initial_scanline"; |
| 1383 | |
| 1384 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_VARIABLEcxx . . $ `libretro.h:556:9`!, &var) && var.value) |
| 1385 | { |
| 1386 | setting_initial_scanlinecxx . . $ setting_initial_scanline. = atoi(var.value); |
| 1387 | } |
| 1388 | |
| 1389 | var.key = "pce_last_scanline"; |
| 1390 | |
| 1391 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_VARIABLEcxx . . $ `libretro.h:556:9`!, &var) && var.value) |
| 1392 | { |
| 1393 | setting_last_scanlinecxx . . $ setting_last_scanline. = atoi(var.value); |
| 1394 | } |
| 1395 | |
| 1396 | bool do_cdsettings = false; |
| 1397 | var.key = "pce_cddavolume"; |
| 1398 | |
| 1399 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_VARIABLEcxx . . $ `libretro.h:556:9`!, &var) && var.value) |
| 1400 | { |
| 1401 | do_cdsettings = true; |
| 1402 | setting_pce_fast_cddavolumecxx . . $ setting_pce_fast_cddavolume. = atoi(var.value); |
| 1403 | } |
| 1404 | |
| 1405 | var.key = "pce_adpcmvolume"; |
| 1406 | |
| 1407 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_VARIABLEcxx . . $ `libretro.h:556:9`!, &var) && var.value) |
| 1408 | { |
| 1409 | do_cdsettings = true; |
| 1410 | setting_pce_fast_adpcmvolumecxx . . $ setting_pce_fast_adpcmvolume. = atoi(var.value); |
| 1411 | } |
| 1412 | |
| 1413 | var.key = "pce_cdpsgvolume"; |
| 1414 | |
| 1415 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_VARIABLEcxx . . $ `libretro.h:556:9`!, &var) && var.value) |
| 1416 | { |
| 1417 | do_cdsettings = true; |
| 1418 | setting_pce_fast_cdpsgvolumecxx . . $ setting_pce_fast_cdpsgvolume. = atoi(var.value); |
| 1419 | } |
| 1420 | |
| 1421 | var.key = "pce_cdspeed"; |
| 1422 | |
| 1423 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_VARIABLEcxx . . $ `libretro.h:556:9`!, &var) && var.value) |
| 1424 | { |
| 1425 | do_cdsettings = true; |
| 1426 | setting_pce_fast_cdspeedcxx . . $ setting_pce_fast_cdspeed. = atoi(var.value); |
| 1427 | } |
| 1428 | |
| 1429 | if (do_cdsettings) |
| 1430 | { |
| 1431 | PCECD_Settingscxx . . $ PCECD_Settings# settings = {0}; |
| 1432 | settings.CDDA_Volumecxx . . $ $anonymous_type_f432417630a7227e_0#CDDA_Volume. = (double)setting_pce_fast_cddavolumecxx . . $ setting_pce_fast_cddavolume. / 100; |
| 1433 | settings.CD_Speedcxx . . $ $anonymous_type_f432417630a7227e_0#CD_Speed. = setting_pce_fast_cdspeedcxx . . $ setting_pce_fast_cdspeed.; |
| 1434 | settings.ADPCM_Volumecxx . . $ $anonymous_type_f432417630a7227e_0#ADPCM_Volume. = (double)setting_pce_fast_adpcmvolumecxx . . $ setting_pce_fast_adpcmvolume. / 100; |
| 1435 | |
| 1436 | if (PCECD_SetSettingscxx . . $ PCECD_SetSettings(d3cabfadec164be7).(&settings) && log_cbcxx . . $ log_cb.) |
| 1437 | log_cbcxx . . $ log_cb.(RETRO_LOG_INFO, "PCE CD Audio settings changed.\n"); |
| 1438 | } |
| 1439 | } |
| 1440 | |
| 1441 | #define MAX_PLAYERScxx . . $ `libretro.cpp:1441:9`! 5 |
| 1442 | #define MAX_BUTTONScxx . . $ `libretro.cpp:1442:9`! 13 |
| 1443 | static uint8_tcxx . . $ uint8_t# input_bufcxx . . $ input_buf.[MAX_PLAYERScxx . . $ `libretro.cpp:1441:9`!][2] = {0}; |
| 1444 | |
| 1445 | bool retro_load_gamecxx . . $ retro_load_game(19e33f369b94c047).(const struct retro_game_info *info) |
| 1446 | { |
| 1447 | if (failed_initcxx . . $ failed_init.) |
| 1448 | return false; |
| 1449 | |
| 1450 | struct retro_input_descriptor desc[] = { |
| 1451 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_LEFTcxx . . $ `libretro.h:184:9`!, "D-Pad Left" }, |
| 1452 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_UPcxx . . $ `libretro.h:182:9`!, "D-Pad Up" }, |
| 1453 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_DOWNcxx . . $ `libretro.h:183:9`!, "D-Pad Down" }, |
| 1454 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_RIGHTcxx . . $ `libretro.h:185:9`!, "D-Pad Right" }, |
| 1455 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Bcxx . . $ `libretro.h:178:9`!, "II" }, |
| 1456 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Acxx . . $ `libretro.h:186:9`!, "I" }, |
| 1457 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Xcxx . . $ `libretro.h:187:9`!, "IV" }, |
| 1458 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Ycxx . . $ `libretro.h:179:9`!, "III" }, |
| 1459 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Lcxx . . $ `libretro.h:188:9`!, "V" }, |
| 1460 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Rcxx . . $ `libretro.h:189:9`!, "VI" }, |
| 1461 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_L2cxx . . $ `libretro.h:190:9`!, "Mode Switch" }, |
| 1462 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_SELECTcxx . . $ `libretro.h:180:9`!, "Select" }, |
| 1463 | { 0, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_STARTcxx . . $ `libretro.h:181:9`!, "Run" }, |
| 1464 | |
| 1465 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_LEFTcxx . . $ `libretro.h:184:9`!, "D-Pad Left" }, |
| 1466 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_UPcxx . . $ `libretro.h:182:9`!, "D-Pad Up" }, |
| 1467 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_DOWNcxx . . $ `libretro.h:183:9`!, "D-Pad Down" }, |
| 1468 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_RIGHTcxx . . $ `libretro.h:185:9`!, "D-Pad Right" }, |
| 1469 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Bcxx . . $ `libretro.h:178:9`!, "II" }, |
| 1470 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Acxx . . $ `libretro.h:186:9`!, "I" }, |
| 1471 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Xcxx . . $ `libretro.h:187:9`!, "IV" }, |
| 1472 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Ycxx . . $ `libretro.h:179:9`!, "III" }, |
| 1473 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Lcxx . . $ `libretro.h:188:9`!, "V" }, |
| 1474 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Rcxx . . $ `libretro.h:189:9`!, "VI" }, |
| 1475 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_L2cxx . . $ `libretro.h:190:9`!, "Mode Switch" }, |
| 1476 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_SELECTcxx . . $ `libretro.h:180:9`!, "Select" }, |
| 1477 | { 1, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_STARTcxx . . $ `libretro.h:181:9`!, "Run" }, |
| 1478 | |
| 1479 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_LEFTcxx . . $ `libretro.h:184:9`!, "D-Pad Left" }, |
| 1480 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_UPcxx . . $ `libretro.h:182:9`!, "D-Pad Up" }, |
| 1481 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_DOWNcxx . . $ `libretro.h:183:9`!, "D-Pad Down" }, |
| 1482 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_RIGHTcxx . . $ `libretro.h:185:9`!, "D-Pad Right" }, |
| 1483 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Bcxx . . $ `libretro.h:178:9`!, "II" }, |
| 1484 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Acxx . . $ `libretro.h:186:9`!, "I" }, |
| 1485 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Xcxx . . $ `libretro.h:187:9`!, "IV" }, |
| 1486 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Ycxx . . $ `libretro.h:179:9`!, "III" }, |
| 1487 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Lcxx . . $ `libretro.h:188:9`!, "V" }, |
| 1488 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Rcxx . . $ `libretro.h:189:9`!, "VI" }, |
| 1489 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_L2cxx . . $ `libretro.h:190:9`!, "Mode Switch" }, |
| 1490 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_SELECTcxx . . $ `libretro.h:180:9`!, "Select" }, |
| 1491 | { 2, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_STARTcxx . . $ `libretro.h:181:9`!, "Run" }, |
| 1492 | |
| 1493 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_LEFTcxx . . $ `libretro.h:184:9`!, "D-Pad Left" }, |
| 1494 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_UPcxx . . $ `libretro.h:182:9`!, "D-Pad Up" }, |
| 1495 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_DOWNcxx . . $ `libretro.h:183:9`!, "D-Pad Down" }, |
| 1496 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_RIGHTcxx . . $ `libretro.h:185:9`!, "D-Pad Right" }, |
| 1497 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Bcxx . . $ `libretro.h:178:9`!, "II" }, |
| 1498 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Acxx . . $ `libretro.h:186:9`!, "I" }, |
| 1499 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Xcxx . . $ `libretro.h:187:9`!, "IV" }, |
| 1500 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Ycxx . . $ `libretro.h:179:9`!, "III" }, |
| 1501 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Lcxx . . $ `libretro.h:188:9`!, "V" }, |
| 1502 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Rcxx . . $ `libretro.h:189:9`!, "VI" }, |
| 1503 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_L2cxx . . $ `libretro.h:190:9`!, "Mode Switch" }, |
| 1504 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_SELECTcxx . . $ `libretro.h:180:9`!, "Select" }, |
| 1505 | { 3, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_STARTcxx . . $ `libretro.h:181:9`!, "Run" }, |
| 1506 | |
| 1507 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_LEFTcxx . . $ `libretro.h:184:9`!, "D-Pad Left" }, |
| 1508 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_UPcxx . . $ `libretro.h:182:9`!, "D-Pad Up" }, |
| 1509 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_DOWNcxx . . $ `libretro.h:183:9`!, "D-Pad Down" }, |
| 1510 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_RIGHTcxx . . $ `libretro.h:185:9`!, "D-Pad Right" }, |
| 1511 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Bcxx . . $ `libretro.h:178:9`!, "II" }, |
| 1512 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Acxx . . $ `libretro.h:186:9`!, "I" }, |
| 1513 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Xcxx . . $ `libretro.h:187:9`!, "IV" }, |
| 1514 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Ycxx . . $ `libretro.h:179:9`!, "III" }, |
| 1515 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Lcxx . . $ `libretro.h:188:9`!, "V" }, |
| 1516 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_Rcxx . . $ `libretro.h:189:9`!, "VI" }, |
| 1517 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_L2cxx . . $ `libretro.h:190:9`!, "Mode Switch" }, |
| 1518 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_SELECTcxx . . $ `libretro.h:180:9`!, "Select" }, |
| 1519 | { 4, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, RETRO_DEVICE_ID_JOYPAD_STARTcxx . . $ `libretro.h:181:9`!, "Run" }, |
| 1520 | |
| 1521 | { 0 }, |
| 1522 | }; |
| 1523 | |
| 1524 | environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORScxx . . $ `libretro.h:524:9`!, desc); |
| 1525 | |
| 1526 | overscancxx . . $ overscan. = false; |
| 1527 | environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_OVERSCANcxx . . $ `libretro.h:457:9`!, &overscancxx . . $ overscan.); |
| 1528 | |
| 1529 | set_basenamecxx . . $ set_basename(85c52e162fed56f9).(info->path); |
| 1530 | |
| 1531 | check_variablescxx . . $ check_variables(49f6e7a06ebc5aa8).(); |
| 1532 | |
| 1533 | gamecxx . . $ game. = MDFNI_LoadGamecxx . . $ MDFNI_LoadGame(acefc047a690e6dc).(MEDNAFEN_CORE_NAME_MODULEcxx . . $ `libretro.cpp:1222:9`!, info->path); |
| 1534 | if (!gamecxx . . $ game.) |
| 1535 | return false; |
| 1536 | |
| 1537 | surfcxx . . $ surf. = (MDFN_Surface*)calloc(1, sizeof(*surfcxx . . $ surf.)); |
| 1538 | |
| 1539 | if (!surfcxx . . $ surf.) |
| 1540 | return false; |
| 1541 | |
| 1542 | surfcxx . . $ surf.->width = FB_WIDTHcxx . . $ `libretro.cpp:1232:9`!; |
| 1543 | surfcxx . . $ surf.->height = FB_HEIGHTcxx . . $ `libretro.cpp:1233:9`!; |
| 1544 | surfcxx . . $ surf.->pitch = FB_WIDTHcxx . . $ `libretro.cpp:1232:9`!; |
| 1545 | |
| 1546 | surfcxx . . $ surf.->pixels = (uint16_tcxx . . $ uint16_t#*)calloc(1, FB_WIDTHcxx . . $ `libretro.cpp:1232:9`! * FB_HEIGHTcxx . . $ `libretro.cpp:1233:9`! * 3); |
| 1547 | |
| 1548 | if (!surfcxx . . $ surf.->pixels) |
| 1549 | { |
| 1550 | free(surfcxx . . $ surf.); |
| 1551 | return false; |
| 1552 | } |
| 1553 | |
| 1554 | // Possible endian bug ... |
| 1555 | for (unsigned i = 0; i < MAX_PLAYERScxx . . $ `libretro.cpp:1441:9`!; i++) |
| 1556 | PCEINPUT_SetInputcxx . . $ PCEINPUT_SetInput(d29b3d01ccfd77ca).(i, "gamepad", &input_bufcxx . . $ input_buf.[i][0]); |
| 1557 | |
| 1558 | VDC_SetPixelFormatcxx . . $ VDC_SetPixelFormat(49f6e7a06ebc5aa8).(); |
| 1559 | |
| 1560 | return gamecxx . . $ game.; |
| 1561 | } |
| 1562 | |
| 1563 | void retro_unload_gamecxx . . $ retro_unload_game(49f6e7a06ebc5aa8).(void) |
| 1564 | { |
| 1565 | if(!MDFNGameInfocxx . . $ MDFNGameInfo.) |
| 1566 | return; |
| 1567 | |
| 1568 | MDFN_FlushGameCheatscxx . . $ MDFN_FlushGameCheats(d4f767463ce0a6b3).(0); |
| 1569 | |
| 1570 | MDFNGameInfocxx . . $ MDFNGameInfo.->CloseGamecxx . . $ $anonymous_type_643ef407c229d02_12#CloseGame.(); |
| 1571 | |
| 1572 | if(MDFNGameInfocxx . . $ MDFNGameInfo.->namecxx . . $ $anonymous_type_643ef407c229d02_12#name.) |
| 1573 | free(MDFNGameInfocxx . . $ MDFNGameInfo.->namecxx . . $ $anonymous_type_643ef407c229d02_12#name.); |
| 1574 | MDFNGameInfocxx . . $ MDFNGameInfo.->namecxx . . $ $anonymous_type_643ef407c229d02_12#name. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1575 | |
| 1576 | MDFNMP_Killcxx . . $ MDFNMP_Kill(49f6e7a06ebc5aa8).(); |
| 1577 | |
| 1578 | MDFNGameInfocxx . . $ MDFNGameInfo. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1579 | |
| 1580 | #ifdef NEED_CDcxx . . $ `<built-in>:487:9`! |
| 1581 | for(unsigned i = 0; i < CDInterfacescxx . . $ CDInterfaces..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); i++) |
| 1582 | delete CDInterfacescxx . . $ CDInterfaces.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i]; |
| 1583 | CDInterfacescxx . . $ CDInterfaces..clearcxx . . $ std/vector#clear(ced63f7c635d850d).(); |
| 1584 | #endif |
| 1585 | } |
| 1586 | |
| 1587 | static void update_inputcxx . . $ update_input(49f6e7a06ebc5aa8).(void) |
| 1588 | { |
| 1589 | static unsigned map[] = { |
| 1590 | RETRO_DEVICE_ID_JOYPAD_Acxx . . $ `libretro.h:186:9`!, |
| 1591 | RETRO_DEVICE_ID_JOYPAD_Bcxx . . $ `libretro.h:178:9`!, |
| 1592 | RETRO_DEVICE_ID_JOYPAD_SELECTcxx . . $ `libretro.h:180:9`!, |
| 1593 | RETRO_DEVICE_ID_JOYPAD_STARTcxx . . $ `libretro.h:181:9`!, |
| 1594 | RETRO_DEVICE_ID_JOYPAD_UPcxx . . $ `libretro.h:182:9`!, |
| 1595 | RETRO_DEVICE_ID_JOYPAD_RIGHTcxx . . $ `libretro.h:185:9`!, |
| 1596 | RETRO_DEVICE_ID_JOYPAD_DOWNcxx . . $ `libretro.h:183:9`!, |
| 1597 | RETRO_DEVICE_ID_JOYPAD_LEFTcxx . . $ `libretro.h:184:9`!, |
| 1598 | RETRO_DEVICE_ID_JOYPAD_Ycxx . . $ `libretro.h:179:9`!, |
| 1599 | RETRO_DEVICE_ID_JOYPAD_Xcxx . . $ `libretro.h:187:9`!, |
| 1600 | RETRO_DEVICE_ID_JOYPAD_Lcxx . . $ `libretro.h:188:9`!, |
| 1601 | RETRO_DEVICE_ID_JOYPAD_Rcxx . . $ `libretro.h:189:9`!, |
| 1602 | RETRO_DEVICE_ID_JOYPAD_L2cxx . . $ `libretro.h:190:9`! |
| 1603 | }; |
| 1604 | |
| 1605 | for (unsigned j = 0; j < MAX_PLAYERScxx . . $ `libretro.cpp:1441:9`!; j++) |
| 1606 | { |
| 1607 | uint16_tcxx . . $ uint16_t# input_state = 0; |
| 1608 | for (unsigned i = 0; i < MAX_BUTTONScxx . . $ `libretro.cpp:1442:9`!; i++) |
| 1609 | input_state |= input_state_cbcxx . . $ input_state_cb.(j, RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!, 0, map[i]) ? (1 << i) : 0; |
| 1610 | |
| 1611 | // Input data must be little endian. |
| 1612 | input_bufcxx . . $ input_buf.[j][0] = (input_state >> 0) & 0xff; |
| 1613 | input_bufcxx . . $ input_buf.[j][1] = (input_state >> 8) & 0xff; |
| 1614 | } |
| 1615 | } |
| 1616 | |
| 1617 | static uint64_tcxx . . $ uint64_t# video_framescxx . . $ video_frames., audio_framescxx . . $ audio_frames.; |
| 1618 | |
| 1619 | void retro_runcxx . . $ retro_run(49f6e7a06ebc5aa8).(void) |
| 1620 | { |
| 1621 | MDFNGIcxx . . $ MDFNGI# *curgame = (MDFNGIcxx . . $ MDFNGI#*)gamecxx . . $ game.; |
| 1622 | |
| 1623 | input_poll_cbcxx . . $ input_poll_cb.(); |
| 1624 | |
| 1625 | update_inputcxx . . $ update_input(49f6e7a06ebc5aa8).(); |
| 1626 | |
| 1627 | static int16_tcxx . . $ int16_t# sound_buf[0x10000]; |
| 1628 | static int32_tcxx . . $ int32_t# rects[FB_MAX_HEIGHTcxx . . $ `libretro.cpp:1235:9`!]; |
| 1629 | rects[0] = ~0; |
| 1630 | |
| 1631 | EmulateSpecStructcxx . . $ EmulateSpecStruct# spec = {0}; |
| 1632 | spec.surfacecxx . . $ $anonymous_type_643ef407c229d02_10#surface. = surfcxx . . $ surf.; |
| 1633 | spec.SoundRatecxx . . $ $anonymous_type_643ef407c229d02_10#SoundRate. = 44100; |
| 1634 | spec.SoundBufcxx . . $ $anonymous_type_643ef407c229d02_10#SoundBuf. = sound_buf; |
| 1635 | spec.LineWidthscxx . . $ $anonymous_type_643ef407c229d02_10#LineWidths. = rects; |
| 1636 | spec.SoundBufMaxSizecxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufMaxSize. = sizeof(sound_buf) / 2; |
| 1637 | spec.SoundVolumecxx . . $ $anonymous_type_643ef407c229d02_10#SoundVolume. = 1.0; |
| 1638 | spec.soundmultipliercxx . . $ $anonymous_type_643ef407c229d02_10#soundmultiplier. = 1.0; |
| 1639 | spec.SoundBufSizecxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufSize. = 0; |
| 1640 | spec.VideoFormatChangedcxx . . $ $anonymous_type_643ef407c229d02_10#VideoFormatChanged. = false; |
| 1641 | spec.SoundFormatChangedcxx . . $ $anonymous_type_643ef407c229d02_10#SoundFormatChanged. = false; |
| 1642 | |
| 1643 | if (spec.SoundRatecxx . . $ $anonymous_type_643ef407c229d02_10#SoundRate. != last_sound_ratecxx . . $ last_sound_rate.) |
| 1644 | { |
| 1645 | spec.SoundFormatChangedcxx . . $ $anonymous_type_643ef407c229d02_10#SoundFormatChanged. = true; |
| 1646 | last_sound_ratecxx . . $ last_sound_rate. = spec.SoundRatecxx . . $ $anonymous_type_643ef407c229d02_10#SoundRate.; |
| 1647 | } |
| 1648 | |
| 1649 | Emulatecxx . . $ Emulate(c2dd9660813a5292).(&spec); |
| 1650 | |
| 1651 | int16cxx . . $ int16# *const SoundBuf = spec.SoundBufcxx . . $ $anonymous_type_643ef407c229d02_10#SoundBuf. + spec.SoundBufSizeALMScxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufSizeALMS. * curgame->soundchancxx . . $ $anonymous_type_643ef407c229d02_12#soundchan.; |
| 1652 | int32cxx . . $ int32# SoundBufSize = spec.SoundBufSizecxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufSize. - spec.SoundBufSizeALMScxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufSizeALMS.; |
| 1653 | const int32cxx . . $ int32# SoundBufMaxSize = spec.SoundBufMaxSizecxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufMaxSize. - spec.SoundBufSizeALMScxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufSizeALMS.; |
| 1654 | |
| 1655 | spec.SoundBufSizecxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufSize. = spec.SoundBufSizeALMScxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufSizeALMS. + SoundBufSize; |
| 1656 | |
| 1657 | unsigned width = spec.DisplayRectcxx . . $ $anonymous_type_643ef407c229d02_10#DisplayRect..w & ~0x1; |
| 1658 | unsigned height = spec.DisplayRectcxx . . $ $anonymous_type_643ef407c229d02_10#DisplayRect..h; |
| 1659 | |
| 1660 | video_cbcxx . . $ video_cb.(surfcxx . . $ surf.->pixels + surfcxx . . $ surf.->pitch * spec.DisplayRectcxx . . $ $anonymous_type_643ef407c229d02_10#DisplayRect..y, width, height, FB_WIDTHcxx . . $ `libretro.cpp:1232:9`! << 1); |
| 1661 | |
| 1662 | video_framescxx . . $ video_frames.++; |
| 1663 | audio_framescxx . . $ audio_frames. += spec.SoundBufSizecxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufSize.; |
| 1664 | |
| 1665 | audio_batch_cbcxx . . $ audio_batch_cb.(spec.SoundBufcxx . . $ $anonymous_type_643ef407c229d02_10#SoundBuf., spec.SoundBufSizecxx . . $ $anonymous_type_643ef407c229d02_10#SoundBufSize.); |
| 1666 | |
| 1667 | bool updated = false; |
| 1668 | if (environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATEcxx . . $ `libretro.h:599:9`!, &updated) && updated) |
| 1669 | check_variablescxx . . $ check_variables(49f6e7a06ebc5aa8).(); |
| 1670 | } |
| 1671 | |
| 1672 | void retro_get_system_infocxx . . $ retro_get_system_info(f259f269f40171e3).(struct retro_system_info *info) |
| 1673 | { |
| 1674 | memset(info, 0, sizeof(*info)); |
| 1675 | info->library_name = MEDNAFEN_CORE_NAMEcxx . . $ `libretro.cpp:1223:9`!; |
| 1676 | info->library_version = MEDNAFEN_CORE_VERSIONcxx . . $ `libretro.cpp:1224:9`!; |
| 1677 | info->need_fullpath = true; |
| 1678 | info->valid_extensions = MEDNAFEN_CORE_EXTENSIONScxx . . $ `libretro.cpp:1225:9`!; |
| 1679 | info->block_extract = false; |
| 1680 | } |
| 1681 | |
| 1682 | void retro_get_system_av_infocxx . . $ retro_get_system_av_info(ec42bac1c52c94e9).(struct retro_system_av_info *info) |
| 1683 | { |
| 1684 | memset(info, 0, sizeof(*info)); |
| 1685 | info->timing.fps = MEDNAFEN_CORE_TIMING_FPScxx . . $ `libretro.cpp:1226:9`!; |
| 1686 | info->timing.sample_rate = 44100; |
| 1687 | info->geometry.base_width = MEDNAFEN_CORE_GEOMETRY_BASE_Wcxx . . $ `libretro.cpp:1227:9`!; |
| 1688 | info->geometry.base_height = MEDNAFEN_CORE_GEOMETRY_BASE_Hcxx . . $ `libretro.cpp:1228:9`!; |
| 1689 | info->geometry.max_width = MEDNAFEN_CORE_GEOMETRY_MAX_Wcxx . . $ `libretro.cpp:1229:9`!; |
| 1690 | info->geometry.max_height = MEDNAFEN_CORE_GEOMETRY_MAX_Hcxx . . $ `libretro.cpp:1230:9`!; |
| 1691 | info->geometry.aspect_ratio = MEDNAFEN_CORE_GEOMETRY_ASPECT_RATIOcxx . . $ `libretro.cpp:1231:9`!; |
| 1692 | } |
| 1693 | |
| 1694 | void retro_deinitcxx . . $ retro_deinit(49f6e7a06ebc5aa8).() |
| 1695 | { |
| 1696 | if (surfcxx . . $ surf.) |
| 1697 | free(surfcxx . . $ surf.); |
| 1698 | surfcxx . . $ surf. = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1699 | |
| 1700 | if (log_cbcxx . . $ log_cb.) |
| 1701 | { |
| 1702 | log_cbcxx . . $ log_cb.(RETRO_LOG_INFO, "[%s]: Samples / Frame: %.5f\n", |
| 1703 | MEDNAFEN_CORE_NAMEcxx . . $ `libretro.cpp:1223:9`!, (double)audio_framescxx . . $ audio_frames. / video_framescxx . . $ video_frames.); |
| 1704 | log_cbcxx . . $ log_cb.(RETRO_LOG_INFO, "[%s]: Estimated FPS: %.5f\n", |
| 1705 | MEDNAFEN_CORE_NAMEcxx . . $ `libretro.cpp:1223:9`!, (double)video_framescxx . . $ video_frames. * 44100 / audio_framescxx . . $ audio_frames.); |
| 1706 | } |
| 1707 | } |
| 1708 | |
| 1709 | unsigned retro_get_regioncxx . . $ retro_get_region(db52760e79bf9054).(void) |
| 1710 | { |
| 1711 | return RETRO_REGION_NTSCcxx . . $ `libretro.h:227:9`!; // FIXME: Regions for other cores. |
| 1712 | } |
| 1713 | |
| 1714 | unsigned retro_api_versioncxx . . $ retro_api_version(db52760e79bf9054).(void) |
| 1715 | { |
| 1716 | return RETRO_API_VERSIONcxx . . $ `libretro.h:84:9`!; |
| 1717 | } |
| 1718 | |
| 1719 | void retro_set_controller_port_devicecxx . . $ retro_set_controller_port_device(b4d55b1286ff73e8).(unsigned in_port, unsigned device) |
| 1720 | { |
| 1721 | MDFNGIcxx . . $ MDFNGI# *currgame = (MDFNGIcxx . . $ MDFNGI#*)gamecxx . . $ game.; |
| 1722 | |
| 1723 | if (!currgame) |
| 1724 | return; |
| 1725 | |
| 1726 | switch(device) |
| 1727 | { |
| 1728 | case RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`!: |
| 1729 | PCEINPUT_SetInputcxx . . $ PCEINPUT_SetInput(d29b3d01ccfd77ca).(in_port, "gamepad", &input_bufcxx . . $ input_buf.[in_port][0]); |
| 1730 | break; |
| 1731 | case RETRO_DEVICE_MOUSEcxx . . $ `libretro.h:119:9`!: |
| 1732 | PCEINPUT_SetInputcxx . . $ PCEINPUT_SetInput(d29b3d01ccfd77ca).(in_port, "mouse", &input_bufcxx . . $ input_buf.[in_port][0]); |
| 1733 | break; |
| 1734 | } |
| 1735 | } |
| 1736 | |
| 1737 | void retro_set_environmentcxx . . $ retro_set_environment(ca2745877d29563).(retro_environment_t cb) |
| 1738 | { |
| 1739 | environ_cbcxx . . $ environ_cb. = cb; |
| 1740 | |
| 1741 | static const struct retro_variable vars[] = { |
| 1742 | { "pce_fast_cdimagecache", "CD Image Cache (Restart); disabled|enabled" }, |
| 1743 | { "pce_nospritelimit", "No Sprite Limit; disabled|enabled" }, |
| 1744 | { "pce_keepaspect", "Keep Aspect; enabled|disabled" }, |
| 1745 | { "pce_initial_scanline", "Initial scanline; 3|4|5|6|7|8|9|10|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|0|1|2" }, |
| 1746 | { "pce_last_scanline", "Last scanline; 241|242|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240" }, |
| 1747 | { "pce_cddavolume", "(CD) CDDA Volume; 100|0|10|20|30|40|50|60|70|80|90" }, |
| 1748 | { "pce_adpcmvolume", "(CD) ADPCM Volume; 100|0|10|20|30|40|50|60|70|80|90" }, |
| 1749 | { "pce_cdpsgvolume", "(CD) CD PSG Volume; 100|0|10|20|30|40|50|60|70|80|90" }, |
| 1750 | { "pce_cdspeed", "(CD) CD Speed; 1|2|4|8" }, |
| 1751 | { NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! }, |
| 1752 | }; |
| 1753 | |
| 1754 | static const struct retro_controller_description pads[] = { |
| 1755 | { "PCE Joypad", RETRO_DEVICE_JOYPADcxx . . $ `libretro.h:110:9`! }, |
| 1756 | { "Mouse", RETRO_DEVICE_MOUSEcxx . . $ `libretro.h:119:9`! }, |
| 1757 | }; |
| 1758 | |
| 1759 | static const struct retro_controller_info ports[] = { |
| 1760 | { pads, 2 }, |
| 1761 | { pads, 2 }, |
| 1762 | { 0 }, |
| 1763 | }; |
| 1764 | |
| 1765 | cb(RETRO_ENVIRONMENT_SET_VARIABLEScxx . . $ `libretro.h:564:9`!, (void*)vars); |
| 1766 | environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_SET_CONTROLLER_INFOcxx . . $ `libretro.h:822:9`!, (void*)ports); |
| 1767 | } |
| 1768 | |
| 1769 | void retro_set_audio_samplecxx . . $ retro_set_audio_sample(c6279dcb374ccd32).(retro_audio_sample_t cb) |
| 1770 | { |
| 1771 | audio_cbcxx . . $ audio_cb. = cb; |
| 1772 | } |
| 1773 | |
| 1774 | void retro_set_audio_sample_batchcxx . . $ retro_set_audio_sample_batch(6b2060791f2f1bd1).(retro_audio_sample_batch_t cb) |
| 1775 | { |
| 1776 | audio_batch_cbcxx . . $ audio_batch_cb. = cb; |
| 1777 | } |
| 1778 | |
| 1779 | void retro_set_input_pollcxx . . $ retro_set_input_poll(964b12a25712bdc3).(retro_input_poll_t cb) |
| 1780 | { |
| 1781 | input_poll_cbcxx . . $ input_poll_cb. = cb; |
| 1782 | } |
| 1783 | |
| 1784 | void retro_set_input_statecxx . . $ retro_set_input_state(ebf409fe3ace00ad).(retro_input_state_t cb) |
| 1785 | { |
| 1786 | input_state_cbcxx . . $ input_state_cb. = cb; |
| 1787 | } |
| 1788 | |
| 1789 | void retro_set_video_refreshcxx . . $ retro_set_video_refresh(185c2191abec6d3b).(retro_video_refresh_t cb) |
| 1790 | { |
| 1791 | video_cbcxx . . $ video_cb. = cb; |
| 1792 | } |
| 1793 | |
| 1794 | static size_t serialize_sizecxx . . $ serialize_size.; |
| 1795 | |
| 1796 | size_t retro_serialize_sizecxx . . $ retro_serialize_size(f708dce9a8856c70).(void) |
| 1797 | { |
| 1798 | StateMemcxx . . $ StateMem# st; |
| 1799 | memset(&st, 0, sizeof(st)); |
| 1800 | |
| 1801 | if (!MDFNSS_SaveSMcxx . . $ MDFNSS_SaveSM(d855d810c36bab0b).(&st, 0, 0, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!)) |
| 1802 | return 0; |
| 1803 | |
| 1804 | free(st.datacxx . . $ $anonymous_type_8d6ca9fa7c8baca5_0#data.); |
| 1805 | return serialize_sizecxx . . $ serialize_size. = st.lencxx . . $ $anonymous_type_8d6ca9fa7c8baca5_0#len.; |
| 1806 | } |
| 1807 | |
| 1808 | bool retro_serializecxx . . $ retro_serialize(ba504f6f2e89cb92).(void *data, size_t size) |
| 1809 | { |
| 1810 | StateMemcxx . . $ StateMem# st; |
| 1811 | memset(&st, 0, sizeof(st)); |
| 1812 | st.datacxx . . $ $anonymous_type_8d6ca9fa7c8baca5_0#data. = (uint8_tcxx . . $ uint8_t#*)data; |
| 1813 | st.mallocedcxx . . $ $anonymous_type_8d6ca9fa7c8baca5_0#malloced. = size; |
| 1814 | |
| 1815 | return MDFNSS_SaveSMcxx . . $ MDFNSS_SaveSM(d855d810c36bab0b).(&st, 0, 0, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!); |
| 1816 | } |
| 1817 | |
| 1818 | bool retro_unserializecxx . . $ retro_unserialize(d7c96d367a6f87f1).(const void *data, size_t size) |
| 1819 | { |
| 1820 | StateMemcxx . . $ StateMem# st; |
| 1821 | memset(&st, 0, sizeof(st)); |
| 1822 | st.datacxx . . $ $anonymous_type_8d6ca9fa7c8baca5_0#data. = (uint8_tcxx . . $ uint8_t#*)data; |
| 1823 | st.lencxx . . $ $anonymous_type_8d6ca9fa7c8baca5_0#len. = size; |
| 1824 | |
| 1825 | return MDFNSS_LoadSMcxx . . $ MDFNSS_LoadSM(4d015e8c0eefb98e).(&st, 0, 0); |
| 1826 | } |
| 1827 | |
| 1828 | void *retro_get_memory_datacxx . . $ retro_get_memory_data(52408c21a1e21ff7).(unsigned type) |
| 1829 | { |
| 1830 | switch (type) |
| 1831 | { |
| 1832 | case RETRO_MEMORY_SAVE_RAMcxx . . $ `libretro.h:264:9`!: |
| 1833 | if (IsPopulouscxx . . $ IsPopulous.) |
| 1834 | return (uint8_tcxx . . $ uint8_t#*)(ROMSpacecxx . . $ ROMSpace. + 0x40 * 8192); |
| 1835 | return (uint8_tcxx . . $ uint8_t#*)SaveRAMcxx . . $ SaveRAM.; |
| 1836 | case RETRO_MEMORY_SYSTEM_RAMcxx . . $ `libretro.h:272:9`!: |
| 1837 | return BaseRAMcxx . . $ BaseRAM.; |
| 1838 | default: |
| 1839 | break; |
| 1840 | } |
| 1841 | |
| 1842 | return NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 1843 | } |
| 1844 | |
| 1845 | size_t retro_get_memory_sizecxx . . $ retro_get_memory_size(1892545c1754497d).(unsigned type) |
| 1846 | { |
| 1847 | switch (type) |
| 1848 | { |
| 1849 | case RETRO_MEMORY_SAVE_RAMcxx . . $ `libretro.h:264:9`!: |
| 1850 | if (IsPopulouscxx . . $ IsPopulous.) |
| 1851 | return 32768; |
| 1852 | return 2048; |
| 1853 | case RETRO_MEMORY_SYSTEM_RAMcxx . . $ `libretro.h:272:9`!: |
| 1854 | return sizeof(BaseRAMcxx . . $ BaseRAM.) - 8192; |
| 1855 | default: |
| 1856 | break; |
| 1857 | } |
| 1858 | |
| 1859 | return 0; |
| 1860 | } |
| 1861 | |
| 1862 | void retro_cheat_resetcxx . . $ retro_cheat_reset(49f6e7a06ebc5aa8).(void) |
| 1863 | {} |
| 1864 | |
| 1865 | void retro_cheat_setcxx . . $ retro_cheat_set(f058bf27fe81fd03).(unsigned, bool, const char *) |
| 1866 | {} |
| 1867 | |
| 1868 | MDFN_Threadcxx . . $ MDFN_Thread# *MDFND_CreateThreadcxx . . $ MDFND_CreateThread(b48b9d196977390a).(int (*fn)(void *), void *data) |
| 1869 | { |
| 1870 | return (MDFN_Threadcxx . . $ MDFN_Thread#*)sthread_create((void (*)(void*))fn, data); |
| 1871 | } |
| 1872 | |
| 1873 | void MDFND_WaitThreadcxx . . $ MDFND_WaitThread(f485867f39a32832).(MDFN_Threadcxx . . $ MDFN_Thread# *thr, int *val) |
| 1874 | { |
| 1875 | sthread_join((sthread_t*)thr); |
| 1876 | |
| 1877 | if (val) |
| 1878 | { |
| 1879 | *val = 0; |
| 1880 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "WaitThread relies on return value.\n"); |
| 1881 | } |
| 1882 | } |
| 1883 | |
| 1884 | void MDFND_KillThreadcxx . . $ MDFND_KillThread(af3eab09d0a7a892).(MDFN_Threadcxx . . $ MDFN_Thread# *) |
| 1885 | { |
| 1886 | fprintf(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Killing a thread is a BAD IDEA!\n"); |
| 1887 | } |
| 1888 | |
| 1889 | MDFN_Mutexcxx . . $ MDFN_Mutex# *MDFND_CreateMutexcxx . . $ MDFND_CreateMutex(f7c2dfbe153feeb5).(void) |
| 1890 | { |
| 1891 | return (MDFN_Mutexcxx . . $ MDFN_Mutex#*)slock_new(); |
| 1892 | } |
| 1893 | |
| 1894 | void MDFND_DestroyMutexcxx . . $ MDFND_DestroyMutex(502f45e477e15126).(MDFN_Mutexcxx . . $ MDFN_Mutex# *lock) |
| 1895 | { |
| 1896 | slock_free((slock_t*)lock); |
| 1897 | } |
| 1898 | |
| 1899 | int MDFND_LockMutexcxx . . $ MDFND_LockMutex(79be6db43f041c4c).(MDFN_Mutexcxx . . $ MDFN_Mutex# *lock) |
| 1900 | { |
| 1901 | slock_lock((slock_t*)lock); |
| 1902 | return 0; |
| 1903 | } |
| 1904 | |
| 1905 | int MDFND_UnlockMutexcxx . . $ MDFND_UnlockMutex(79be6db43f041c4c).(MDFN_Mutexcxx . . $ MDFN_Mutex# *lock) |
| 1906 | { |
| 1907 | slock_unlock((slock_t*)lock); |
| 1908 | return 0; |
| 1909 | } |
| 1910 | |
| 1911 | MDFN_Condcxx . . $ MDFN_Cond# *MDFND_CreateCondcxx . . $ MDFND_CreateCond(23e52bc52ccd0781).(void) |
| 1912 | { |
| 1913 | return (MDFN_Condcxx . . $ MDFN_Cond#*)scond_new(); |
| 1914 | } |
| 1915 | |
| 1916 | void MDFND_DestroyCondcxx . . $ MDFND_DestroyCond(141e1457c38d37d).(MDFN_Condcxx . . $ MDFN_Cond# *cond) |
| 1917 | { |
| 1918 | scond_free((scond_t*)cond); |
| 1919 | } |
| 1920 | |
| 1921 | int MDFND_WaitCondcxx . . $ MDFND_WaitCond(97039b30e819d6aa).(MDFN_Condcxx . . $ MDFN_Cond# *cond, MDFN_Mutexcxx . . $ MDFN_Mutex# *mutex) |
| 1922 | { |
| 1923 | scond_wait((scond_t*)cond, (slock_t*)mutex); |
| 1924 | return 0; // not sure about this return |
| 1925 | } |
| 1926 | |
| 1927 | int MDFND_SignalCondcxx . . $ MDFND_SignalCond(81be31d010abce54).(MDFN_Condcxx . . $ MDFN_Cond# *cond) |
| 1928 | { |
| 1929 | scond_signal((scond_t*)cond); |
| 1930 | return 0; // not sure about this return |
| 1931 | } |
| 1932 | |
| 1933 | #ifdef _WIN32 |
| 1934 | static void sanitize_path(std::string &path) |
| 1935 | { |
| 1936 | size_t size = path.size(); |
| 1937 | for (size_t i = 0; i < size; i++) |
| 1938 | if (path[i] == '/') |
| 1939 | path[i] = '\\'; |
| 1940 | } |
| 1941 | #endif |
| 1942 | |
| 1943 | // Use a simpler approach to make sure that things go right for libretro. |
| 1944 | stdcxx . . $ std/::stringcxx . . $ std/string# MDFN_MakeFNamecxx . . $ MDFN_MakeFName(cb505ca63a9252bc).(MakeFName_Typecxx . . $ MakeFName_Type# type, int id1, const char *cd1) |
| 1945 | { |
| 1946 | char slash; |
| 1947 | #ifdef _WIN32 |
| 1948 | slash = '\\'; |
| 1949 | #else |
| 1950 | slash = '/'; |
| 1951 | #endif |
| 1952 | stdcxx . . $ std/::stringcxx . . $ std/string# retcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).; |
| 1953 | switch (type) |
| 1954 | { |
| 1955 | case MDFNMKF_SAVcxx . . $ MDFNMKF_SAV.: |
| 1956 | ret =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). retro_save_directorycxx . . $ retro_save_directory. +cxx . . $ std/operator+(4f1c09d7d89f005e).slash +cxx . . $ std/operator+(db5dc2ea912c6495). retro_base_namecxx . . $ retro_base_name. +cxx . . $ std/operator+(aa1c00e85b87da6b). |
| 1957 | stdcxx . . $ std/::stringcxx . . $ std/string#(".") +cxx . . $ std/operator+(aa1c00e85b87da6b). stdcxx . . $ std/::stringcxx . . $ std/string#(cd1); |
| 1958 | break; |
| 1959 | case MDFNMKF_FIRMWAREcxx . . $ MDFNMKF_FIRMWARE.: |
| 1960 | ret =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). retro_base_directorycxx . . $ retro_base_directory. +cxx . . $ std/operator+(4f1c09d7d89f005e). slash +cxx . . $ std/operator+(aa1c00e85b87da6b). stdcxx . . $ std/::stringcxx . . $ std/string#(cd1); |
| 1961 | #ifdef _WIN32 |
| 1962 | sanitize_path(ret); // Because Windows path handling is mongoloid. |
| 1963 | #endif |
| 1964 | break; |
| 1965 | default: |
| 1966 | break; |
| 1967 | } |
| 1968 | |
| 1969 | if (log_cbcxx . . $ log_cb.) |
| 1970 | log_cbcxx . . $ log_cb.(RETRO_LOG_INFO, "MDFN_MakeFName: %s\n", ret.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).()); |
| 1971 | return retcxx . . $ std/__cxx11/basic_string#basic_string(8f3aaafa33d05d0b).; |
| 1972 | } |
| 1973 | |
| 1974 | void MDFND_Messagecxx . . $ MDFND_Message(85c52e162fed56f9).(const char *str) |
| 1975 | { |
| 1976 | if (log_cbcxx . . $ log_cb.) |
| 1977 | log_cbcxx . . $ log_cb.(RETRO_LOG_INFO, "%s\n", str); |
| 1978 | } |
| 1979 | |
| 1980 | void MDFND_MidSynccxx . . $ MDFND_MidSync(e58a7dfd4bdcb556).(const EmulateSpecStructcxx . . $ EmulateSpecStruct# *) |
| 1981 | {} |
| 1982 | |
| 1983 | void MDFN_MidLineUpdatecxx . . $ MDFN_MidLineUpdate(387ada12a6f698cd).(EmulateSpecStructcxx . . $ EmulateSpecStruct# *espec, int y) |
| 1984 | { |
| 1985 | //MDFND_MidLineUpdate(espec, y); |
| 1986 | } |
| 1987 | |
| 1988 | void MDFND_PrintErrorcxx . . $ MDFND_PrintError(85c52e162fed56f9).(const char* err) |
| 1989 | { |
| 1990 | if (log_cbcxx . . $ log_cb.) |
| 1991 | log_cbcxx . . $ log_cb.(RETRO_LOG_ERROR, "%s\n", err); |
| 1992 | } |
| 1993 | |
| 1994 | void MDFND_Sleepcxx . . $ MDFND_Sleep(cb2f890c2fdad230).(unsigned int time) |
| 1995 | { |
| 1996 | retro_sleepcxx . . $ retro_sleep(cb2f890c2fdad230).(time); |
| 1997 | } |
| 1998 | |
| 1999 | /* forward declarations */ |
| 2000 | extern void MDFND_DispMessagecxx . . $ MDFND_DispMessage(f25546b61a629de7).(unsigned char *str); |
| 2001 | |
| 2002 | void MDFND_DispMessagecxx . . $ MDFND_DispMessage(f25546b61a629de7).(unsigned char *str) |
| 2003 | { |
| 2004 | const char *strc = (const char*)str; |
| 2005 | struct retro_message msg = |
| 2006 | { |
| 2007 | strc, |
| 2008 | 180 |
| 2009 | }; |
| 2010 | |
| 2011 | environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_SET_MESSAGEcxx . . $ `libretro.h:470:9`!, &msg); |
| 2012 | } |
| 2013 | |
| 2014 | void MDFN_DispMessagecxx . . $ MDFN_DispMessage(326aeb464d16410c).(const char *format, ...) |
| 2015 | { |
| 2016 | struct retro_message msg; |
| 2017 | va_listcxx . . $ va_list# ap; |
| 2018 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(ap,format); |
| 2019 | char *str = new char[4096]; |
| 2020 | const char *strc = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!; |
| 2021 | |
| 2022 | vsnprintf(str, 4096, format,ap); |
| 2023 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(ap); |
| 2024 | strc = str; |
| 2025 | |
| 2026 | msg.frames = 180; |
| 2027 | msg.msg = strc; |
| 2028 | |
| 2029 | environ_cbcxx . . $ environ_cb.(RETRO_ENVIRONMENT_SET_MESSAGEcxx . . $ `libretro.h:470:9`!, &msg); |
| 2030 | } |
| 2031 | |
| 2032 | void MDFN_ResetMessagescxx . . $ MDFN_ResetMessages(49f6e7a06ebc5aa8).(void) |
| 2033 | { |
| 2034 | } |