├── mednafen ├── NEWS ├── AUTHORS ├── include │ ├── mednafen │ ├── trio_external │ │ ├── trio.h │ │ ├── triop.h │ │ ├── triodef.h │ │ ├── trionan.h │ │ └── triostr.h │ ├── zstd_external │ │ └── zstd.h │ ├── minilzo_external │ │ └── minilzo.h │ └── minilzo_internal │ │ └── minilzo.h ├── tests │ ├── apple2 │ │ ├── decimal.bin │ │ ├── crctab-0.bin │ │ ├── crctab-1.bin │ │ ├── crctab-2.bin │ │ ├── crctab-3.bin │ │ ├── crctab-4.bin │ │ ├── crctab-5.bin │ │ ├── crctab-6.bin │ │ ├── crctab-7.bin │ │ ├── decimal │ │ │ ├── decimal.bin │ │ │ ├── decimal.dsk │ │ │ └── decimal.asm │ │ └── gencrctab.cpp │ ├── pce │ │ ├── vcectdump │ │ │ ├── make.sh │ │ │ └── vcectdump.pce │ │ ├── font.bin │ │ └── decimal │ │ │ ├── adc.pce │ │ │ ├── clean.sh │ │ │ ├── sbc.pce │ │ │ ├── adc.asm │ │ │ ├── make.sh │ │ │ └── sbc.asm │ └── psx │ │ ├── gpuprec.exe │ │ ├── linefuzz.exe │ │ ├── triorder.exe │ │ └── multires-newgpu.exe ├── po │ ├── stamp-po │ ├── LINGUAS │ ├── de.gmo │ ├── es.gmo │ ├── ru.gmo │ ├── quot.sed │ ├── boldquot.sed │ ├── remove-potcdate.sin │ ├── insert-header.sin │ └── ChangeLog ├── src │ ├── apple2 │ │ ├── notes │ │ │ └── CHROMA-ICS │ │ └── Makefile.am.inc │ ├── demo │ │ └── Makefile.am.inc │ ├── cdplay │ │ └── Makefile.am.inc │ ├── minilzo │ │ ├── Makefile.am.inc │ │ └── README.MEDNAFEN │ ├── resampler │ │ └── Makefile.am.inc │ ├── sasplay │ │ └── Makefile.am.inc │ ├── drivers │ │ ├── hqxx-common.cpp │ │ ├── win-icon.ico │ │ ├── README.WIN32 │ │ ├── help.h │ │ ├── cheat.h │ │ ├── video-state.h │ │ ├── win-manifest.xml │ │ ├── sound.h │ │ ├── remote.h │ │ ├── args.h │ │ ├── ers.h │ │ ├── prompt.h │ │ ├── fps.h │ │ ├── netplay.h │ │ ├── Makefile.am │ │ └── input.h │ ├── nes │ │ ├── ppu │ │ │ ├── Makefile.am.inc │ │ │ └── palette.h │ │ ├── nsfe.h │ │ ├── boards │ │ │ ├── mapinc.h │ │ │ ├── 107.cpp │ │ │ ├── 140.cpp │ │ │ ├── 87.cpp │ │ │ ├── 180.cpp │ │ │ ├── 94.cpp │ │ │ ├── 70.cpp │ │ │ ├── 93.cpp │ │ │ ├── 78.cpp │ │ │ ├── 152.cpp │ │ │ ├── emutypes.h │ │ │ ├── vrc7tone.h │ │ │ └── 184.cpp │ │ ├── fds.h │ │ ├── fds-sound.h │ │ ├── dis6502.h │ │ ├── input │ │ │ ├── share.h │ │ │ ├── cursor.h │ │ │ └── Makefile.am.inc │ │ ├── Makefile.am.inc │ │ ├── vsuni.h │ │ ├── x6502struct.h │ │ ├── debug.h │ │ ├── NES-TODO │ │ └── sound.h │ ├── drivers_libxxx │ │ ├── main.cpp │ │ └── Makefile.am │ ├── gba │ │ ├── arm.h │ │ ├── thumb.h │ │ ├── Makefile.am.inc │ │ └── sram.h │ ├── string │ │ ├── Makefile.am.inc │ │ └── escape.h │ ├── hash │ │ └── Makefile.am.inc │ ├── trio │ │ ├── CHANGES │ │ └── Makefile.am.inc │ ├── cputest │ │ ├── README │ │ └── Makefile.am.inc │ ├── snes │ │ ├── src │ │ │ ├── lib │ │ │ │ ├── libco │ │ │ │ │ ├── doc │ │ │ │ │ │ └── examples │ │ │ │ │ │ │ ├── .gitignore │ │ │ │ │ │ │ ├── test.h │ │ │ │ │ │ │ ├── build.bat │ │ │ │ │ │ │ └── build.sh │ │ │ │ │ ├── README.MEDNAFEN │ │ │ │ │ ├── libco.h │ │ │ │ │ ├── LICENSE.LIBCO │ │ │ │ │ ├── README.md │ │ │ │ │ └── libco.c │ │ │ │ └── nall │ │ │ │ │ ├── algorithm.hpp │ │ │ │ │ ├── static.hpp │ │ │ │ │ ├── utility.hpp │ │ │ │ │ ├── moduloarray.hpp │ │ │ │ │ └── detect.hpp │ │ │ ├── chip │ │ │ │ ├── superfx │ │ │ │ │ ├── mmio │ │ │ │ │ │ └── mmio.hpp │ │ │ │ │ ├── disasm │ │ │ │ │ │ └── disasm.hpp │ │ │ │ │ ├── memory │ │ │ │ │ │ └── memory.hpp │ │ │ │ │ ├── timing │ │ │ │ │ │ └── timing.hpp │ │ │ │ │ ├── superfx.hpp │ │ │ │ │ └── bus │ │ │ │ │ │ └── bus.hpp │ │ │ │ ├── st010 │ │ │ │ │ ├── serialization.cpp │ │ │ │ │ └── st010.hpp │ │ │ │ ├── srtc │ │ │ │ │ ├── serialization.cpp │ │ │ │ │ └── srtc.hpp │ │ │ │ ├── sa1 │ │ │ │ │ ├── memory │ │ │ │ │ │ ├── memory.hpp │ │ │ │ │ │ └── memory.cpp │ │ │ │ │ ├── dma │ │ │ │ │ │ └── dma.hpp │ │ │ │ │ └── sa1.hpp │ │ │ │ ├── bsx │ │ │ │ │ └── bsx.cpp │ │ │ │ ├── obc1 │ │ │ │ │ ├── serialization.cpp │ │ │ │ │ └── obc1.hpp │ │ │ │ ├── dsp3 │ │ │ │ │ ├── dsp3.hpp │ │ │ │ │ └── dsp3.cpp │ │ │ │ ├── dsp4 │ │ │ │ │ └── dsp4.hpp │ │ │ │ ├── chip.hpp │ │ │ │ ├── dsp1 │ │ │ │ │ └── dsp1.hpp │ │ │ │ ├── sdd1 │ │ │ │ │ └── serialization.cpp │ │ │ │ ├── dsp2 │ │ │ │ │ ├── serialization.cpp │ │ │ │ │ └── dsp2.hpp │ │ │ │ └── cx4 │ │ │ │ │ └── serialization.cpp │ │ │ ├── cheat │ │ │ │ ├── cheat-inline.hpp │ │ │ │ └── cheat.hpp │ │ │ ├── smp │ │ │ │ ├── smp.hpp │ │ │ │ ├── ssmp │ │ │ │ │ ├── memory │ │ │ │ │ │ └── memory.hpp │ │ │ │ │ ├── debugger │ │ │ │ │ │ └── debugger.hpp │ │ │ │ │ ├── ssmp.hpp │ │ │ │ │ ├── timing │ │ │ │ │ │ ├── timing.hpp │ │ │ │ │ │ └── timing.cpp │ │ │ │ │ └── serialization.cpp │ │ │ │ └── core │ │ │ │ │ ├── core.cpp │ │ │ │ │ ├── serialization.cpp │ │ │ │ │ └── memory.hpp │ │ │ ├── system │ │ │ │ ├── interface │ │ │ │ │ └── interface.hpp │ │ │ │ ├── audio │ │ │ │ │ └── audio.hpp │ │ │ │ ├── video │ │ │ │ │ └── video.hpp │ │ │ │ ├── config │ │ │ │ │ ├── config.cpp │ │ │ │ │ └── config.hpp │ │ │ │ └── debugger │ │ │ │ │ └── debugger.hpp │ │ │ ├── memory │ │ │ │ └── smemory │ │ │ │ │ ├── serialization.cpp │ │ │ │ │ ├── smemory.hpp │ │ │ │ │ ├── system.cpp │ │ │ │ │ └── smemory.cpp │ │ │ ├── ppu │ │ │ │ ├── memory │ │ │ │ │ └── memory.hpp │ │ │ │ └── render │ │ │ │ │ └── addsub.cpp │ │ │ ├── cpu │ │ │ │ ├── cpu.cpp │ │ │ │ ├── scpu │ │ │ │ │ ├── memory │ │ │ │ │ │ ├── memory.hpp │ │ │ │ │ │ └── memory.cpp │ │ │ │ │ └── timing │ │ │ │ │ │ ├── joypad.cpp │ │ │ │ │ │ ├── timing.hpp │ │ │ │ │ │ └── event.cpp │ │ │ │ ├── cpu.hpp │ │ │ │ └── core │ │ │ │ │ └── serialization.cpp │ │ │ ├── cartridge │ │ │ │ └── gameboyheader.cpp │ │ │ ├── interface.hpp │ │ │ └── sdsp │ │ │ │ └── misc.cpp │ │ └── VERSION.BSNES │ ├── hw_video │ │ └── Makefile.am.inc │ ├── cheat_formats │ │ ├── Makefile.am.inc │ │ ├── psx.h │ │ ├── gb.h │ │ └── snes.h │ ├── gb │ │ ├── Makefile.am.inc │ │ ├── z80.h │ │ └── sound.h │ ├── hw_misc │ │ └── Makefile.am.inc │ ├── zstd │ │ ├── README.MEDNAFEN │ │ └── Makefile.am.inc │ ├── hw_sound │ │ ├── ym2612 │ │ │ ├── Ym2612_Emu.cpp │ │ │ └── Ym2612_Emu.h │ │ ├── Makefile.am.inc │ │ ├── sms_apu │ │ │ └── Sms_Oscs.h │ │ └── gb_apu │ │ │ └── blargg_config.h │ ├── ss │ │ ├── cart │ │ │ └── common.h │ │ ├── input │ │ │ └── common.h │ │ ├── notes │ │ │ ├── HOST-CPU-INTENSIVE-GAMES │ │ │ ├── WIDESCREEN-GAMES │ │ │ ├── REFERENCES │ │ │ └── build_sh7095s_ctable.cpp │ │ ├── scu_dsp_misctab.inc │ │ ├── vdp2_common.h │ │ └── Makefile.am │ ├── time │ │ └── Makefile.am.inc │ ├── video │ │ ├── video-common.h │ │ ├── resize.h │ │ ├── README.FONTS │ │ ├── Makefile.am.inc │ │ └── png.h │ ├── lynx │ │ ├── Makefile.am.inc │ │ └── license.txt │ ├── md │ │ ├── cart │ │ │ ├── map_ff.h │ │ │ ├── map_rmx3.h │ │ │ ├── map_sbb.h │ │ │ ├── map_yase.h │ │ │ ├── map_rom.h │ │ │ ├── map_svp.h │ │ │ ├── map_sram.h │ │ │ ├── map_ssf2.h │ │ │ ├── map_realtec.h │ │ │ └── map_eeprom.h │ │ ├── cd │ │ │ ├── pcm.h │ │ │ ├── timer.h │ │ │ ├── interrupt.h │ │ │ ├── cd.h │ │ │ ├── cdc_cdd.h │ │ │ └── cdc_cdd.cpp │ │ ├── memvdp.h │ │ ├── input │ │ │ └── gamepad.h │ │ ├── debug.h │ │ ├── membnk.h │ │ ├── memz80.h │ │ ├── sound.h │ │ ├── Makefile.am.inc │ │ └── shared.h │ ├── mthreading │ │ └── Makefile.am.inc │ ├── vb │ │ └── Makefile.am.inc │ ├── sms │ │ ├── Makefile.am.inc │ │ ├── romdb.h │ │ ├── docs │ │ │ └── compatability.txt │ │ ├── cart.h │ │ ├── shared.h │ │ ├── tms.h │ │ ├── sound.h │ │ └── memz80.h │ ├── ngp │ │ ├── rtc.h │ │ ├── Makefile.am.inc │ │ └── T6W28_Oscs.h │ ├── sexyal │ │ ├── convert.h │ │ ├── README │ │ └── Makefile.am │ ├── net │ │ ├── Makefile.am.inc │ │ ├── Net_WS2.h │ │ └── Net_POSIX.h │ ├── pce │ │ ├── tsushin.h │ │ ├── input │ │ │ ├── gamepad.h │ │ │ ├── mouse.h │ │ │ └── tsushinkb.h │ │ ├── dis6280.h │ │ ├── Makefile.am.inc │ │ ├── hes.h │ │ ├── notes │ │ │ ├── EVENT_SYSTEM_NOTES │ │ │ └── PATENTS │ │ ├── pce.h │ │ └── huc.h │ ├── pce_fast │ │ ├── Makefile.am.inc │ │ ├── hes.h │ │ ├── input.h │ │ ├── pcecd.h │ │ └── pce.h │ ├── mpcdec │ │ ├── README │ │ ├── AUTHORS.MPCDEC │ │ ├── README.MEDNAFEN │ │ └── Makefile.am.inc │ ├── tests.h │ ├── desa68 │ │ └── Makefile.am.inc │ ├── movie-driver.h │ ├── compress │ │ └── Makefile.am.inc │ ├── drivers_dos │ │ └── Makefile.am │ ├── driver.h │ ├── video-driver.h │ ├── video.h │ ├── quicklz │ │ └── Makefile.am.inc │ ├── pcfx │ │ └── Makefile.am.inc │ ├── IPSPatcher.h │ ├── tremor │ │ ├── README.MEDNAFEN │ │ └── Makefile.am.inc │ ├── hw_cpu │ │ ├── Makefile.am.inc │ │ └── v810 │ │ │ └── v810_cpuD.h │ ├── wswan │ │ ├── Makefile.am.inc │ │ ├── eeprom.h │ │ └── wswan.h │ ├── sound │ │ ├── Makefile.am.inc │ │ └── fir_blargg_config.h │ ├── testsexp.h │ ├── player.h │ ├── state-common.h │ ├── cdrom │ │ ├── seektime_pce.h │ │ └── Makefile.am.inc │ ├── psx │ │ ├── Makefile.am.inc │ │ └── notes │ │ │ ├── MULTITAP │ │ │ └── SPU-IRQ │ ├── snes_faust │ │ ├── Makefile.am.inc │ │ └── ppu_common.h │ ├── netplay-driver.h │ ├── movie.h │ ├── state-driver.h │ ├── mempatcher.h │ └── general.h ├── Documentation │ ├── cheat.html │ ├── bwolf0.png │ ├── bwolf1.png │ ├── headerbg.png │ ├── mednafen.png │ ├── sapphire0.png │ ├── sapphire1.png │ ├── cdplay.php │ ├── ssfplay.php │ ├── cheats.txt │ ├── gg.php │ ├── sms.php │ ├── sasplay.php │ ├── generate.sh │ ├── pce_fast.php │ └── md.php ├── stamp-h1 ├── README.MSWIN ├── intl │ ├── ChangeLog │ ├── VERSION.txt │ ├── locale.alias │ ├── export.h │ ├── version.c │ ├── osdep.c │ └── ref-del.sin ├── Makefile.am ├── autogen.sh ├── package.sh ├── m4 │ ├── xsize.m4 │ ├── signed.m4 │ ├── wchar_t.m4 │ ├── codeset.m4 │ ├── glibc2.m4 │ ├── inttypes-h.m4 │ ├── glibc21.m4 │ ├── intldir.m4 │ ├── ulonglong.m4 │ ├── stdint_h.m4 │ ├── inttypes_h.m4 │ └── wint_t.m4 ├── .gitignore └── mswin │ ├── build-linux-gcc-4.9.4.sh │ ├── build-mednafen.sh │ ├── package-mednafen-win9x.sh │ ├── build-mednafen-win9x.sh │ ├── package-mednafen.sh │ └── gcc-4.9.4-linux-ucontext.patch ├── .gitignore └── .gitattributes /mednafen/NEWS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mednafen/AUTHORS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build64/* 2 | -------------------------------------------------------------------------------- /mednafen/include/mednafen: -------------------------------------------------------------------------------- 1 | ../src -------------------------------------------------------------------------------- /mednafen/tests/apple2/decimal.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mednafen/po/stamp-po: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /mednafen/src/apple2/notes/CHROMA-ICS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mednafen/Documentation/cheat.html: -------------------------------------------------------------------------------- 1 | TO BE WRITTEN 2 | -------------------------------------------------------------------------------- /mednafen/stamp-h1: -------------------------------------------------------------------------------- 1 | timestamp for config.h:config.h.in 2 | -------------------------------------------------------------------------------- /mednafen/include/trio_external/trio.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /mednafen/include/trio_external/triop.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /mednafen/include/zstd_external/zstd.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /mednafen/include/minilzo_external/minilzo.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /mednafen/include/trio_external/triodef.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /mednafen/include/trio_external/trionan.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /mednafen/include/trio_external/triostr.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /mednafen/src/demo/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += demo/demo.cpp 2 | -------------------------------------------------------------------------------- /mednafen/po/LINGUAS: -------------------------------------------------------------------------------- 1 | # Set of available languages. 2 | # en 3 | ru es de 4 | -------------------------------------------------------------------------------- /mednafen/src/cdplay/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += cdplay/cdplay.cpp 2 | -------------------------------------------------------------------------------- /mednafen/src/minilzo/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += minilzo/minilzo.c 2 | -------------------------------------------------------------------------------- /mednafen/README.MSWIN: -------------------------------------------------------------------------------- 1 | Refer to notes and scripts in the "mswin" directory. 2 | 3 | -------------------------------------------------------------------------------- /mednafen/src/resampler/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += resampler/resample.c 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /mednafen/include/minilzo_internal/minilzo.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /mednafen/src/sasplay/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += sasplay/sasplay.cpp 2 | 3 | -------------------------------------------------------------------------------- /mednafen/tests/pce/vcectdump/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | pceas -raw vcectdump.asm 4 | -------------------------------------------------------------------------------- /mednafen/src/drivers/hqxx-common.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | 3 | #include "hqxx-common.h" 4 | -------------------------------------------------------------------------------- /mednafen/po/de.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/po/de.gmo -------------------------------------------------------------------------------- /mednafen/po/es.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/po/es.gmo -------------------------------------------------------------------------------- /mednafen/po/ru.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/po/ru.gmo -------------------------------------------------------------------------------- /mednafen/src/nes/ppu/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += nes/ppu/ppu.cpp nes/ppu/palette.cpp 2 | -------------------------------------------------------------------------------- /mednafen/src/drivers_libxxx/main.cpp: -------------------------------------------------------------------------------- 1 | int main(int argc, char* argv[]) 2 | { 3 | return 0; 4 | } 5 | -------------------------------------------------------------------------------- /mednafen/src/gba/arm.h: -------------------------------------------------------------------------------- 1 | namespace MDFN_IEN_GBA 2 | { 3 | 4 | unsigned int RunARM(void); 5 | 6 | } 7 | -------------------------------------------------------------------------------- /mednafen/src/string/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += string/escape.cpp string/string.cpp 2 | 3 | -------------------------------------------------------------------------------- /mednafen/src/gba/thumb.h: -------------------------------------------------------------------------------- 1 | namespace MDFN_IEN_GBA 2 | { 3 | 4 | unsigned int RunTHUMB(void); 5 | 6 | } 7 | -------------------------------------------------------------------------------- /mednafen/intl/ChangeLog: -------------------------------------------------------------------------------- 1 | 2010-06-04 GNU 2 | 3 | * Version 0.18.1 released. 4 | 5 | -------------------------------------------------------------------------------- /mednafen/intl/VERSION.txt: -------------------------------------------------------------------------------- 1 | GNU gettext library from gettext-0.18.1, with Mednafen-specific changes for Win32 2 | -------------------------------------------------------------------------------- /mednafen/intl/locale.alias: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/intl/locale.alias -------------------------------------------------------------------------------- /mednafen/src/hash/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += hash/md5.cpp hash/sha1.cpp hash/sha256.cpp hash/crc.cpp 2 | -------------------------------------------------------------------------------- /mednafen/src/trio/CHANGES: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/src/trio/CHANGES -------------------------------------------------------------------------------- /mednafen/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = po intl src 2 | 3 | ACLOCAL_AMFLAGS = -I m4 4 | 5 | EXTRA_DIST = m4/ChangeLog 6 | -------------------------------------------------------------------------------- /mednafen/src/cputest/README: -------------------------------------------------------------------------------- 1 | modified slightly for usage in Mednafen 2 | 3 | ARM stuff not compiled in, for now. 4 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/libco/doc/examples/.gitignore: -------------------------------------------------------------------------------- 1 | test_args 2 | test_serialization 3 | test_timing 4 | *.o 5 | -------------------------------------------------------------------------------- /mednafen/tests/pce/font.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/pce/font.bin -------------------------------------------------------------------------------- /mednafen/tests/psx/gpuprec.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/psx/gpuprec.exe -------------------------------------------------------------------------------- /mednafen/tests/psx/linefuzz.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/psx/linefuzz.exe -------------------------------------------------------------------------------- /mednafen/tests/psx/triorder.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/psx/triorder.exe -------------------------------------------------------------------------------- /mednafen/Documentation/bwolf0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/Documentation/bwolf0.png -------------------------------------------------------------------------------- /mednafen/Documentation/bwolf1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/Documentation/bwolf1.png -------------------------------------------------------------------------------- /mednafen/src/drivers/win-icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/src/drivers/win-icon.ico -------------------------------------------------------------------------------- /mednafen/src/hw_video/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | if NEED_HUC6270_EMU 2 | mednafen_SOURCES += hw_video/huc6270/vdc.cpp 3 | endif 4 | 5 | -------------------------------------------------------------------------------- /mednafen/tests/apple2/crctab-0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/apple2/crctab-0.bin -------------------------------------------------------------------------------- /mednafen/tests/apple2/crctab-1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/apple2/crctab-1.bin -------------------------------------------------------------------------------- /mednafen/tests/apple2/crctab-2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/apple2/crctab-2.bin -------------------------------------------------------------------------------- /mednafen/tests/apple2/crctab-3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/apple2/crctab-3.bin -------------------------------------------------------------------------------- /mednafen/tests/apple2/crctab-4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/apple2/crctab-4.bin -------------------------------------------------------------------------------- /mednafen/tests/apple2/crctab-5.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/apple2/crctab-5.bin -------------------------------------------------------------------------------- /mednafen/tests/apple2/crctab-6.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/apple2/crctab-6.bin -------------------------------------------------------------------------------- /mednafen/tests/apple2/crctab-7.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/apple2/crctab-7.bin -------------------------------------------------------------------------------- /mednafen/tests/pce/decimal/adc.pce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/pce/decimal/adc.pce -------------------------------------------------------------------------------- /mednafen/tests/pce/decimal/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm gen-results adcresults.bin sbcresults.bin 4 | #rm adc.pce sbc.pce 5 | -------------------------------------------------------------------------------- /mednafen/tests/pce/decimal/sbc.pce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/pce/decimal/sbc.pce -------------------------------------------------------------------------------- /mednafen/Documentation/headerbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/Documentation/headerbg.png -------------------------------------------------------------------------------- /mednafen/Documentation/mednafen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/Documentation/mednafen.png -------------------------------------------------------------------------------- /mednafen/Documentation/sapphire0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/Documentation/sapphire0.png -------------------------------------------------------------------------------- /mednafen/Documentation/sapphire1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/Documentation/sapphire1.png -------------------------------------------------------------------------------- /mednafen/src/cheat_formats/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += cheat_formats/gb.cpp cheat_formats/psx.cpp cheat_formats/snes.cpp 2 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/superfx/mmio/mmio.hpp: -------------------------------------------------------------------------------- 1 | uint8 mmio_read(unsigned addr); 2 | void mmio_write(unsigned addr, uint8 data); 3 | -------------------------------------------------------------------------------- /mednafen/src/gb/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += gb/gb.cpp gb/gfx.cpp gb/gbGlobals.cpp gb/memory.cpp gb/sound.cpp gb/z80.cpp 2 | 3 | -------------------------------------------------------------------------------- /mednafen/src/hw_misc/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | if NEED_ARCADE_CARD_EMU 2 | mednafen_SOURCES += hw_misc/arcade_card/arcade_card.cpp 3 | endif 4 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/libco/README.MEDNAFEN: -------------------------------------------------------------------------------- 1 | libco from https://github.com/higan-emu/libco fba00e5d3404e1bcfe1007ee2e3bfc3b3bb888af 2 | -------------------------------------------------------------------------------- /mednafen/src/zstd/README.MEDNAFEN: -------------------------------------------------------------------------------- 1 | Zstandard 1.5.0 from https://facebook.github.io/zstd/ and stripped down for inclusion in Mednafen. 2 | -------------------------------------------------------------------------------- /mednafen/tests/psx/multires-newgpu.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/psx/multires-newgpu.exe -------------------------------------------------------------------------------- /mednafen/tests/apple2/decimal/decimal.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/apple2/decimal/decimal.bin -------------------------------------------------------------------------------- /mednafen/tests/apple2/decimal/decimal.dsk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/apple2/decimal/decimal.dsk -------------------------------------------------------------------------------- /mednafen/src/hw_sound/ym2612/Ym2612_Emu.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/src/hw_sound/ym2612/Ym2612_Emu.cpp -------------------------------------------------------------------------------- /mednafen/tests/pce/vcectdump/vcectdump.pce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pce-devel/mednafenPceDev/HEAD/mednafen/tests/pce/vcectdump/vcectdump.pce -------------------------------------------------------------------------------- /mednafen/src/drivers/README.WIN32: -------------------------------------------------------------------------------- 1 | Remember to use: __attribute__((force_align_arg_pointer)); 2 | on callback functions from the SDL and Win32 APIs! 3 | -------------------------------------------------------------------------------- /mednafen/src/ss/cart/common.h: -------------------------------------------------------------------------------- 1 | #include "../ss.h" 2 | #include "../cart.h" 3 | #include 4 | #include 5 | 6 | -------------------------------------------------------------------------------- /mednafen/src/time/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | if WIN32 2 | mednafen_SOURCES += time/Time_Win32.cpp 3 | else 4 | mednafen_SOURCES += time/Time_POSIX.cpp 5 | endif 6 | 7 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/st010/serialization.cpp: -------------------------------------------------------------------------------- 1 | #ifdef ST010_CPP 2 | 3 | void ST010::serialize(serializer &s) { 4 | s.array(ram); 5 | } 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /mednafen/po/quot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/libco/doc/examples/test.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | -------------------------------------------------------------------------------- /mednafen/src/video/video-common.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | -------------------------------------------------------------------------------- /mednafen/src/lynx/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += lynx/cart.cpp lynx/c65c02.cpp lynx/memmap.cpp lynx/mikie.cpp lynx/ram.cpp lynx/rom.cpp lynx/susie.cpp lynx/system.cpp 2 | -------------------------------------------------------------------------------- /mednafen/src/ss/input/common.h: -------------------------------------------------------------------------------- 1 | #include "../ss.h" 2 | #include 3 | #include "../smpc.h" 4 | #include "../smpc_iodevice.h" 5 | #include 6 | -------------------------------------------------------------------------------- /mednafen/src/md/cart/map_ff.h: -------------------------------------------------------------------------------- 1 | MD_Cart_Type *MD_Make_Cart_Type_FF(const md_game_info *ginfo, const uint8 *ROM, const uint32 ROM_size, const uint32 iparam, const char *sparam); 2 | 3 | -------------------------------------------------------------------------------- /mednafen/src/md/cart/map_rmx3.h: -------------------------------------------------------------------------------- 1 | MD_Cart_Type *MD_Make_Cart_Type_RMX3(const md_game_info *ginfo, const uint8 *ROM, const uint32 ROM_size, const uint32 iparam, const char *sparam); 2 | 3 | -------------------------------------------------------------------------------- /mednafen/src/md/cart/map_sbb.h: -------------------------------------------------------------------------------- 1 | MD_Cart_Type *MD_Make_Cart_Type_SBB(const md_game_info *ginfo, const uint8 *ROM, const uint32 ROM_size, const uint32 iparam, const char *sparam); 2 | 3 | -------------------------------------------------------------------------------- /mednafen/src/md/cart/map_yase.h: -------------------------------------------------------------------------------- 1 | MD_Cart_Type *MD_Make_Cart_Type_YaSe(const md_game_info *ginfo, const uint8 *ROM, const uint32 ROM_size, const uint32 iparam, const char *sparam); 2 | 3 | -------------------------------------------------------------------------------- /mednafen/src/mthreading/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | if WIN32 2 | mednafen_SOURCES += mthreading/MThreading_Win32.cpp 3 | else 4 | mednafen_SOURCES += mthreading/MThreading_POSIX.cpp 5 | endif 6 | 7 | -------------------------------------------------------------------------------- /mednafen/src/vb/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += vb/vb.cpp vb/timer.cpp vb/input.cpp vb/vip.cpp vb/vsu.cpp 2 | 3 | if WANT_DEBUGGER 4 | mednafen_SOURCES += vb/debug.cpp 5 | endif 6 | -------------------------------------------------------------------------------- /mednafen/tests/pce/decimal/adc.asm: -------------------------------------------------------------------------------- 1 | DMATHOP .macro 2 | adc \1 3 | .endm 4 | 5 | .include "XXc.inc" 6 | 7 | .org $8000 8 | Gwarg: .incbin "adcresults.bin" 9 | .bank $7F 10 | -------------------------------------------------------------------------------- /mednafen/tests/pce/decimal/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | g++ -Wall -O2 -o gen-results gen-results.cpp && \ 4 | ./gen-results && \ 5 | pceas -raw adc.asm && \ 6 | pceas -raw sbc.asm 7 | -------------------------------------------------------------------------------- /mednafen/tests/pce/decimal/sbc.asm: -------------------------------------------------------------------------------- 1 | DMATHOP .macro 2 | sbc \1 3 | .endm 4 | 5 | .include "XXc.inc" 6 | 7 | .org $8000 8 | Gwarg: .incbin "sbcresults.bin" 9 | .bank $7F 10 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/srtc/serialization.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SRTC_CPP 2 | 3 | void SRTC::serialize(serializer &s) { 4 | s.integer(rtc_mode); 5 | s.integer(rtc_index); 6 | } 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /mednafen/src/sms/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += sms/cart.cpp sms/memz80.cpp sms/pio.cpp sms/render.cpp sms/romdb.cpp sms/sms.cpp sms/sound.cpp sms/system.cpp sms/tms.cpp sms/vdp.cpp 2 | 3 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/cheat/cheat-inline.hpp: -------------------------------------------------------------------------------- 1 | bool Cheat::active() const { return system_enabled; } 2 | bool Cheat::exists(unsigned addr) const { return bitmask[addr >> 3] & 1 << (addr & 7); } 3 | -------------------------------------------------------------------------------- /mednafen/src/ss/notes/HOST-CPU-INTENSIVE-GAMES: -------------------------------------------------------------------------------- 1 | Burning Rangers 2 | Courier Crisis (most intensive game?) 3 | Dungeon Master Nexus 4 | DecAthlete 5 | Grandia (FMV) 6 | Last Bronx 7 | Sky Target 8 | -------------------------------------------------------------------------------- /mednafen/intl/export.h: -------------------------------------------------------------------------------- 1 | 2 | #if @HAVE_VISIBILITY@ && BUILDING_LIBINTL 3 | #define LIBINTL_DLL_EXPORTED __attribute__((__visibility__("default"))) 4 | #else 5 | #define LIBINTL_DLL_EXPORTED 6 | #endif 7 | -------------------------------------------------------------------------------- /mednafen/src/apple2/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += apple2/apple2.cpp 2 | 3 | #if WANT_DEBUGGER 4 | #mednafen_SOURCES += apple2/debug.cpp 5 | #mednafen_SOURCES += apple2/dis6502.cpp 6 | #endif 7 | -------------------------------------------------------------------------------- /mednafen/src/ngp/rtc.h: -------------------------------------------------------------------------------- 1 | #ifndef __NGP_RTC_H 2 | #define __NGP_RTC_H 3 | 4 | namespace MDFN_IEN_NGP 5 | { 6 | 7 | MDFN_FASTCALL uint8 rtc_read8(uint32 address); 8 | 9 | } 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /mednafen/src/sexyal/convert.h: -------------------------------------------------------------------------------- 1 | namespace Mednafen 2 | { 3 | void SexyALI_Convert(const SexyAL_format *srcformat, const SexyAL_format *destformat, const void *vsrc, void *vdest, uint32 frames); 4 | } 5 | -------------------------------------------------------------------------------- /mednafen/src/minilzo/README.MEDNAFEN: -------------------------------------------------------------------------------- 1 | Renamed "minilzo.h" to "_minilzo.h", and changed the #include statement in minilzo.c to match(to discourage accidentally 2 | including the wrong header file in Mednafen code). 3 | -------------------------------------------------------------------------------- /mednafen/src/nes/nsfe.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_NES_NSFE_H 2 | #define __MDFN_NES_NSFE_H 3 | 4 | namespace MDFN_IEN_NES 5 | { 6 | void LoadNSFE(NSFINFO *nfe, Stream* fp, int info_only); 7 | } 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /mednafen/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #gettextize --force --copy --intl 4 | autoheader 5 | aclocal -I m4 6 | autoconf -W syntax,cross 7 | automake -a -c -f 8 | 9 | rm autom4te.cache/* 10 | rmdir autom4te.cache 11 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/sa1/memory/memory.hpp: -------------------------------------------------------------------------------- 1 | alwaysinline void op_io(); 2 | alwaysinline uint8 op_read(unsigned addr); 3 | alwaysinline void op_write(unsigned addr, uint8 data); 4 | 5 | uint8_t vbr_read(unsigned addr); 6 | -------------------------------------------------------------------------------- /mednafen/src/video/resize.h: -------------------------------------------------------------------------------- 1 | namespace Mednafen 2 | { 3 | 4 | void MDFN_ResizeSurface(const MDFN_Surface *src, const MDFN_Rect *src_rect, const int32 *LineWidths, MDFN_Surface *dest, const MDFN_Rect *dest_rect); 5 | 6 | } 7 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/bsx/bsx.cpp: -------------------------------------------------------------------------------- 1 | #include <../base.hpp> 2 | 3 | #define BSX_CPP 4 | namespace bSNES_v059 { 5 | 6 | #include "bsx_base.cpp" 7 | #include "bsx_cart.cpp" 8 | #include "bsx_flash.cpp" 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /mednafen/src/md/cd/pcm.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_MD_PCM_H 2 | #define __MDFN_MD_PCM_H 3 | 4 | namespace MDFN_IEN_MD 5 | { 6 | 7 | void MDCD_PCM_Write(uint32 A, uint8 V); 8 | void MDCD_PCM_Reset(void); 9 | 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/mapinc.h: -------------------------------------------------------------------------------- 1 | #include "../nes.h" 2 | #include "../x6502.h" 3 | #include "../ppu/ppu.h" 4 | #include "../sound.h" 5 | #include "../cart.h" 6 | #include "../unif.h" 7 | #include 8 | -------------------------------------------------------------------------------- /mednafen/src/net/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += net/Net.cpp 2 | 3 | if HAVE_POSIX_SOCKETS 4 | mednafen_SOURCES += net/Net_POSIX.cpp 5 | endif 6 | 7 | if WIN32 8 | mednafen_SOURCES += net/Net_WS2.cpp 9 | endif 10 | 11 | -------------------------------------------------------------------------------- /mednafen/src/pce/tsushin.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_PCE_TSUSHIN_H 2 | #define __MDFN_PCE_TSUSHIN_H 3 | 4 | namespace MDFN_IEN_PCE 5 | { 6 | 7 | DECLFR(PCE_TsushinRead); 8 | DECLFW(PCE_TsushinWrite); 9 | 10 | }; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /mednafen/src/pce_fast/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += pce_fast/huc6280.cpp pce_fast/pce.cpp pce_fast/vdc.cpp pce_fast/input.cpp pce_fast/huc.cpp pce_fast/hes.cpp pce_fast/pcecd.cpp pce_fast/pcecd_drive.cpp pce_fast/psg.cpp 2 | 3 | -------------------------------------------------------------------------------- /mednafen/src/video/README.FONTS: -------------------------------------------------------------------------------- 1 | Bitmap font sources: 2 | 3 | http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html 4 | http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz 5 | http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts-asian.tar.gz 6 | -------------------------------------------------------------------------------- /mednafen/src/cputest/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += cputest/cputest.c 2 | 3 | if ARCH_X86 4 | mednafen_SOURCES += cputest/x86_cpu.c 5 | endif 6 | 7 | if ARCH_POWERPC 8 | mednafen_SOURCES += cputest/ppc_cpu.c 9 | endif 10 | 11 | -------------------------------------------------------------------------------- /mednafen/src/mpcdec/README: -------------------------------------------------------------------------------- 1 | Musepack Decoder Library: 2 | 3 | run "./configure [--prefix=/usr]; make" 4 | 5 | To create a sample app using the musepack decoder library 6 | Check ../mpcdec/mpcdec.c and ../include/mpc/mpcdec.h for more details. 7 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/obc1/serialization.cpp: -------------------------------------------------------------------------------- 1 | #ifdef OBC1_CPP 2 | 3 | void OBC1::serialize(serializer &s) { 4 | s.integer(status.address); 5 | s.integer(status.baseptr); 6 | s.integer(status.shift); 7 | } 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /mednafen/po/boldquot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | s/“/“/g 8 | s/”/”/g 9 | s/‘/‘/g 10 | s/’/’/g 11 | -------------------------------------------------------------------------------- /mednafen/src/ss/scu_dsp_misctab.inc: -------------------------------------------------------------------------------- 1 | { /* looped=0 */ MiscInstr, MiscInstr, MiscInstr, MiscInstr, }, 2 | { /* looped=1 */ MiscInstr, MiscInstr, MiscInstr, MiscInstr, }, 3 | -------------------------------------------------------------------------------- /mednafen/src/tests.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_TESTS_H 2 | #define __MDFN_TESTS_H 3 | 4 | namespace Mednafen 5 | { 6 | 7 | // Cheap is relative. ;) 8 | // See also testsexp.h 9 | void MDFN_RunCheapTests(void); 10 | 11 | } 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /mednafen/src/cheat_formats/psx.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_CHEAT_FORMATS_PSX_H 2 | #define __MDFN_CHEAT_FORMATS_PSX_H 3 | 4 | namespace Mednafen 5 | { 6 | 7 | MDFN_HIDE extern const std::vector CheatFormats_PSX; 8 | 9 | } 10 | #endif 11 | -------------------------------------------------------------------------------- /mednafen/src/desa68/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES += libdesa68.a 2 | libdesa68_a_CFLAGS = @AM_CFLAGS@ -Wno-multichar 3 | 4 | libdesa68_a_SOURCES = desa68/desa68.c 5 | 6 | mednafen_LDADD += libdesa68.a 7 | mednafen_DEPENDENCIES += libdesa68.a 8 | 9 | -------------------------------------------------------------------------------- /mednafen/src/md/cart/map_rom.h: -------------------------------------------------------------------------------- 1 | #ifndef __MD_MAP_ROM_H 2 | #define __MD_MAP_ROM_H 3 | 4 | MD_Cart_Type *MD_Make_Cart_Type_ROM(const md_game_info *ginfo, const uint8 *ROM, const uint32 ROM_size, const uint32 iparam, const char *sparam); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /mednafen/src/md/cart/map_svp.h: -------------------------------------------------------------------------------- 1 | #ifndef __MD_MAP_SVP_H 2 | #define __MD_MAP_SVP_H 3 | 4 | MD_Cart_Type *MD_Make_Cart_Type_SVP(const md_game_info *ginfo, const uint8 *ROM, const uint32 ROM_size, const uint32 iparam, const char *sparam); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /mednafen/src/snes/VERSION.BSNES: -------------------------------------------------------------------------------- 1 | bsnes v0.059 + Cx4 Op10 fix patch + blargg_libco_ppc64-5 + a few minor timing/scheduler related changes for Mednafen + LOTS OF OTHER CRAZY STUFF 2 | 3 | for ALT Linux: 4 | strlcat->nall_strlcat 5 | strlcpy->nall_strlcpy 6 | -------------------------------------------------------------------------------- /mednafen/src/cheat_formats/gb.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_CHEAT_FORMATS_GB_H 2 | #define __MDFN_CHEAT_FORMATS_GB_H 3 | 4 | namespace Mednafen 5 | { 6 | 7 | MDFN_HIDE extern const std::vector CheatFormats_GB; 8 | 9 | } 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /mednafen/src/cheat_formats/snes.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_CHEAT_FORMATS_SNES_H 2 | #define __MDFN_CHEAT_FORMATS_SNES_H 3 | 4 | namespace Mednafen 5 | { 6 | 7 | MDFN_HIDE extern const std::vector CheatFormats_SNES; 8 | 9 | } 10 | #endif 11 | -------------------------------------------------------------------------------- /mednafen/src/md/cart/map_sram.h: -------------------------------------------------------------------------------- 1 | #ifndef __MD_MAP_SRAM_H 2 | #define __MD_MAP_SRAM_H 3 | 4 | MD_Cart_Type *MD_Make_Cart_Type_SRAM(const md_game_info *ginfo, const uint8 *ROM, const uint32 ROM_size, const uint32 iparam, const char *sparam); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /mednafen/src/md/cart/map_ssf2.h: -------------------------------------------------------------------------------- 1 | #ifndef __MD_MAP_SSF2_H 2 | #define __MD_MAP_SSF2_H 3 | 4 | MD_Cart_Type *MD_Make_Cart_Type_SSF2(const md_game_info *ginfo, const uint8 *ROM, const uint32 ROM_size, const uint32 iparam, const char *sparam); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /mednafen/src/md/cd/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_MDCD_TIMER_H 2 | #define __MDFN_MDCD_TIMER_H 3 | 4 | void MDCD_Timer_Reset(void); 5 | void MDCD_Timer_Run(int32 clocks); 6 | void MDCD_Timer_Write(uint8 V); 7 | uint8 MDCD_Timer_Read(void); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /mednafen/src/md/memvdp.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MEMVDP_H_ 3 | #define _MEMVDP_H_ 4 | 5 | namespace MDFN_IEN_MD 6 | { 7 | 8 | 9 | /* Function prototypes */ 10 | unsigned int vdp_dma_r(unsigned int address); 11 | 12 | } 13 | 14 | #endif /* _MEMVDP_H_ */ 15 | -------------------------------------------------------------------------------- /mednafen/src/movie-driver.h: -------------------------------------------------------------------------------- 1 | namespace Mednafen 2 | { 3 | void MDFNI_SelectMovie(int); 4 | 5 | void MDFNI_SaveMovie(char *fname, const MDFN_Surface *surface, const MDFN_Rect *DisplayRect, const int32 *LineWidths); 6 | void MDFNI_LoadMovie(char *fname); 7 | } 8 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/superfx/disasm/disasm.hpp: -------------------------------------------------------------------------------- 1 | void disassemble_opcode(char *output); 2 | void disassemble_alt0(char *output); 3 | void disassemble_alt1(char *output); 4 | void disassemble_alt2(char *output); 5 | void disassemble_alt3(char *output); 6 | -------------------------------------------------------------------------------- /mednafen/src/md/cart/map_realtec.h: -------------------------------------------------------------------------------- 1 | #ifndef __MD_MAP_REALTEC_H 2 | #define __MD_MAP_REALTEC_H 3 | 4 | MD_Cart_Type *MD_Make_Cart_Type_REALTEC(const md_game_info *ginfo, const uint8 *ROM, const uint32 ROM_size, const uint32 iparam, const char *sparam); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /mednafen/src/compress/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += compress/ArchiveReader.cpp compress/ZIPReader.cpp 2 | mednafen_SOURCES += compress/GZFileStream.cpp 3 | mednafen_SOURCES += compress/DecompressFilter.cpp compress/ZstdDecompressFilter.cpp compress/ZLInflateFilter.cpp 4 | -------------------------------------------------------------------------------- /mednafen/src/pce/input/gamepad.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCE_INPUT_GAMEPAD_H 2 | #define __PCE_INPUT_GAMEPAD_H 3 | 4 | namespace MDFN_IEN_PCE 5 | { 6 | MDFN_HIDE extern const IDIISG PCE_GamepadIDII; 7 | PCE_Input_Device *PCEINPUT_MakeGamepad(void); 8 | }; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /mednafen/src/pce/input/mouse.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCE_INPUT_MOUSE_H 2 | #define __PCE_INPUT_MOUSE_H 3 | 4 | namespace MDFN_IEN_PCE 5 | { 6 | 7 | MDFN_HIDE extern const IDIISG PCE_MouseIDII; 8 | 9 | PCE_Input_Device *PCEINPUT_MakeMouse(void); 10 | 11 | }; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /mednafen/src/drivers_dos/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = subdir-objects 2 | DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ 3 | DEFAULT_INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_builddir)/intl 4 | 5 | noinst_LIBRARIES = libmdfndos.a 6 | 7 | libmdfndos_a_SOURCES = 8 | -------------------------------------------------------------------------------- /mednafen/src/trio/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES += libtrio.a 2 | libtrio_a_CFLAGS = @AM_CFLAGS@ @TRIO_CFLAGS@ @CFLAG_VISIBILITY@ 3 | 4 | libtrio_a_SOURCES = trio/trio.c trio/trionan.c trio/triostr.c 5 | 6 | mednafen_LDADD += libtrio.a 7 | mednafen_DEPENDENCIES += libtrio.a 8 | 9 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/dsp3/dsp3.hpp: -------------------------------------------------------------------------------- 1 | class DSP3 : public Memory { 2 | public: 3 | void init(); 4 | void enable(); 5 | void power(); 6 | void reset(); 7 | 8 | uint8 read (unsigned addr); 9 | void write(unsigned addr, uint8 data); 10 | }; 11 | 12 | extern DSP3 dsp3; 13 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/dsp4/dsp4.hpp: -------------------------------------------------------------------------------- 1 | class DSP4 : public Memory { 2 | public: 3 | void init(); 4 | void enable(); 5 | void power(); 6 | void reset(); 7 | 8 | uint8 read (unsigned addr); 9 | void write(unsigned addr, uint8 data); 10 | }; 11 | 12 | extern DSP4 dsp4; 13 | -------------------------------------------------------------------------------- /mednafen/src/nes/fds.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_NES_FDS_H 2 | #define __MDFN_NES_FDS_H 3 | 4 | namespace MDFN_IEN_NES 5 | { 6 | void FDSSoundReset(void) MDFN_COLD; 7 | void FDS_SetMedia(uint32 drive_idx, uint32 state_idx, uint32 media_idx, uint32 orientation_idx) MDFN_COLD; 8 | } 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /mednafen/src/pce/input/tsushinkb.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCE_INPUT_TSUSHINKB_H 2 | #define __PCE_INPUT_TSUSHINKB_H 3 | 4 | namespace MDFN_IEN_PCE 5 | { 6 | 7 | MDFN_HIDE extern const IDIISG PCE_TsushinKBIDII; 8 | 9 | PCE_Input_Device *PCEINPUT_MakeTsushinKB(void); 10 | 11 | }; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /mednafen/src/gb/z80.h: -------------------------------------------------------------------------------- 1 | #ifndef __GB_Z80_H 2 | #define __GB_Z80_H 3 | 4 | namespace MDFN_IEN_GB 5 | { 6 | 7 | int GBZ80_RunOp(void); 8 | void GBZ80_Reset(void); 9 | void GBZ80_Interrupt(int which); 10 | void GBZ80_StateAction(StateMem *sm, int load, int data_only); 11 | 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/superfx/memory/memory.hpp: -------------------------------------------------------------------------------- 1 | uint8 op_read(uint16 addr); 2 | alwaysinline uint8 peekpipe(); 3 | alwaysinline uint8 pipe(); 4 | 5 | void cache_flush(); 6 | uint8 cache_mmio_read(uint16 addr); 7 | void cache_mmio_write(uint16 addr, uint8 data); 8 | 9 | void memory_reset(); 10 | -------------------------------------------------------------------------------- /mednafen/src/string/escape.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_ESCAPE_H 2 | #define __MDFN_ESCAPE_H 3 | 4 | namespace Mednafen 5 | { 6 | // These functions are safe to call before calling MDFNI_Initialize(). 7 | 8 | void unescape_string(char *string); 9 | char* escape_string(const char *text); 10 | 11 | } 12 | #endif 13 | -------------------------------------------------------------------------------- /mednafen/src/pce/dis6280.h: -------------------------------------------------------------------------------- 1 | class Dis6280 2 | { 3 | public: 4 | Dis6280(void); 5 | ~Dis6280(); 6 | 7 | virtual uint8 Read(uint16 A); 8 | virtual uint8 GetX(void); 9 | virtual uint8 GetY(void); 10 | 11 | void Disassemble(uint16 &a, uint16 SpecialA, char *, uint8, bool); 12 | 13 | private: 14 | }; 15 | -------------------------------------------------------------------------------- /mednafen/src/driver.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_DRIVER_H 2 | #define __MDFN_DRIVER_H 3 | 4 | #include "mednafen.h" 5 | #include "mednafen-driver.h" 6 | #include "netplay-driver.h" 7 | #include "state-driver.h" 8 | #include "movie-driver.h" 9 | #include "mempatcher-driver.h" 10 | #include "video-driver.h" 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /mednafen/src/drivers/help.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_DRIVERS_HELP_H 2 | #define __MDFN_DRIVERS_HELP_H 3 | 4 | void Help_Draw(MDFN_Surface* surface, const MDFN_Rect& rect); 5 | bool Help_IsActive(void); 6 | bool Help_Toggle(void); 7 | void Help_Init(void) MDFN_COLD; 8 | void Help_Close(void) MDFN_COLD; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /mednafen/src/nes/fds-sound.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_NES_FDSSOUND_H 2 | #define __MDFN_NES_FDSSOUND_H 3 | 4 | namespace MDFN_IEN_NES 5 | { 6 | bool FDSSound_Init(void) MDFN_COLD; 7 | void FDSSound_Power(void) MDFN_COLD; 8 | void FDSSound_StateAction(StateMem *sm, const unsigned load, const bool data_only); 9 | } 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /mednafen/src/net/Net_WS2.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_NET_NETWS2_H 2 | #define __MDFN_NET_NETWS2_H 3 | 4 | #include "Net.h" 5 | 6 | namespace Net 7 | { 8 | 9 | std::unique_ptr WS2_Connect(const char* host, unsigned int port); 10 | std::unique_ptr WS2_Accept(unsigned int port); 11 | 12 | } 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /mednafen/src/video-driver.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_VIDEO_DRIVER_H 2 | #define __MDFN_VIDEO_DRIVER_H 3 | 4 | #include "video.h" 5 | 6 | namespace Mednafen 7 | { 8 | void MDFND_DispMessage(char* text); 9 | void MDFNI_SaveSnapshot(const MDFN_Surface *src, const MDFN_Rect *rect, const int32 *LineWidths); 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /mednafen/src/video.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_VIDEO_H 2 | #define __MDFN_VIDEO_H 3 | 4 | #include "video/surface.h" 5 | #include "video/primitives.h" 6 | #include "video/text.h" 7 | 8 | namespace Mednafen 9 | { 10 | void MDFN_InitFontData(void) MDFN_COLD; 11 | void MDFN_RunVideoBenchmarks(void) MDFN_COLD; 12 | } 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /mednafen/Documentation/cdplay.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CD-DA player, for dev testing purposes mostly. 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /mednafen/package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$1" = "" ]; then 4 | mednafen_version=`head -n1 mednafen/Documentation/modules.def` 5 | else 6 | mednafen_version="$1" 7 | fi 8 | mednafen_tarball="mednafen-$mednafen_version.tar.xz" 9 | git -C mednafen archive --format=tar --prefix=mednafen/ HEAD^{tree} | xz > "$mednafen_tarball" 10 | -------------------------------------------------------------------------------- /mednafen/src/net/Net_POSIX.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_NET_NETPOSIX_H 2 | #define __MDFN_NET_NETPOSIX_H 3 | 4 | #include "Net.h" 5 | 6 | namespace Net 7 | { 8 | 9 | std::unique_ptr POSIX_Connect(const char* host, unsigned int port); 10 | std::unique_ptr POSIX_Accept(unsigned int port); 11 | 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /mednafen/src/nes/dis6502.h: -------------------------------------------------------------------------------- 1 | namespace MDFN_IEN_NES 2 | { 3 | 4 | class Dis6502 5 | { 6 | public: 7 | Dis6502(void); 8 | virtual ~Dis6502(); 9 | 10 | virtual uint8 Read(uint16 A); 11 | virtual uint8 GetX(void); 12 | virtual uint8 GetY(void); 13 | 14 | void Disassemble(uint16 &a, uint16 SpecialA, char *); 15 | }; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /mednafen/src/nes/input/share.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_NES_INPUT_SHARE_H 2 | #define __MDFN_NES_INPUT_SHARE_H 3 | 4 | #include "../nes.h" 5 | #include "../input.h" 6 | #include "../ppu/ppu.h" 7 | #include "../x6502.h" 8 | #include "../ppu/palette.h" 9 | 10 | #include "cursor.h" 11 | 12 | using namespace MDFN_IEN_NES; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /mednafen/src/pce_fast/hes.h: -------------------------------------------------------------------------------- 1 | namespace MDFN_IEN_PCE_FAST 2 | { 3 | 4 | uint8 ReadIBP(unsigned int A); 5 | void HES_Draw(MDFN_Surface *surface, MDFN_Rect *DisplayRect, int16 *samples, int32 sampcount); 6 | 7 | void HES_Load(Stream* fp) MDFN_COLD; 8 | void HES_Reset(void) MDFN_COLD; 9 | void HES_Close(void) MDFN_COLD; 10 | 11 | }; 12 | -------------------------------------------------------------------------------- /mednafen/src/gba/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += gba/GBAinline.cpp gba/arm.cpp gba/thumb.cpp gba/bios.cpp gba/eeprom.cpp gba/flash.cpp 2 | mednafen_SOURCES += gba/GBA.cpp gba/Gfx.cpp gba/Globals.cpp gba/Mode0.cpp gba/Mode1.cpp gba/Mode2.cpp gba/Mode3.cpp gba/Mode4.cpp gba/Mode5.cpp 3 | mednafen_SOURCES += gba/RTC.cpp gba/Sound.cpp gba/sram.cpp 4 | -------------------------------------------------------------------------------- /mednafen/src/drivers/cheat.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_DRIVERS_CHEAT_H 2 | #define __MDFN_DRIVERS_CHEAT_H 3 | 4 | void CheatIF_GT_Show(bool show); 5 | bool CheatIF_Active(void); 6 | void CheatIF_MT_Draw(const MDFN_PixelFormat& pformat, const int32 screen_w, const int32 screen_h); 7 | int CheatIF_MT_EventHook(const SDL_Event *event); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /mednafen/src/quicklz/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES += libmdfnquicklz.a 2 | libmdfnquicklz_a_CFLAGS = @AM_CFLAGS@ @NO_STRICT_ALIASING_FLAGS@ -Wno-shadow -Wno-unused-but-set-variable 3 | 4 | libmdfnquicklz_a_SOURCES= quicklz/quicklz.c 5 | 6 | mednafen_LDADD += libmdfnquicklz.a 7 | mednafen_DEPENDENCIES += libmdfnquicklz.a 8 | 9 | -------------------------------------------------------------------------------- /mednafen/src/pcfx/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += pcfx/king.cpp pcfx/soundbox.cpp pcfx/pcfx.cpp pcfx/interrupt.cpp pcfx/input.cpp pcfx/timer.cpp pcfx/rainbow.cpp pcfx/idct.cpp pcfx/huc6273.cpp pcfx/fxscsi.cpp 2 | mednafen_SOURCES += pcfx/input/gamepad.cpp pcfx/input/mouse.cpp 3 | 4 | if WANT_DEBUGGER 5 | mednafen_SOURCES += pcfx/debug.cpp 6 | endif 7 | -------------------------------------------------------------------------------- /mednafen/src/sms/romdb.h: -------------------------------------------------------------------------------- 1 | #ifndef __ROMDB_H 2 | #define __ROMDB_H 3 | 4 | namespace MDFN_IEN_SMS 5 | { 6 | 7 | typedef struct { 8 | uint32 crc; 9 | int mapper; 10 | int display; 11 | int territory; 12 | const char *name; 13 | } rominfo_t; 14 | 15 | const rominfo_t *find_rom_in_db(uint32 crc); 16 | 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /mednafen/src/ss/notes/WIDESCREEN-GAMES: -------------------------------------------------------------------------------- 1 | -------------------------------------------- 2 | Saturn games with a widescreen(ワイド) option 3 | -------------------------------------------- 4 | 5 | Christmas Nights into Dreams 6 | Nights into Dreams 7 | Panzer Dragoon II Zwei 8 | Touge King the Spirits / High Velocity 9 | Touge King the Spirits 2 10 | 11 | -------------------------------------------------------------------------------- /mednafen/src/mpcdec/AUTHORS.MPCDEC: -------------------------------------------------------------------------------- 1 | libmpcdec is the result of the work of many people: 2 | 3 | * Andree Buschmann and Frank Klemm 4 | Original implementation and core development. 5 | 6 | * Peter Pawlowski and Benoit Amiaux 7 | Portability and further optimizations. 8 | 9 | * Miles Egan 10 | Port to pure C, documentation, and api refinements. 11 | -------------------------------------------------------------------------------- /mednafen/src/pce/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += pce/huc6280.cpp pce/pce.cpp pce/vce.cpp pce/input.cpp pce/huc.cpp pce/pcecd.cpp pce/hes.cpp pce/tsushin.cpp pce/mcgenjin.cpp 2 | mednafen_SOURCES += pce/input/gamepad.cpp pce/input/tsushinkb.cpp pce/input/mouse.cpp 3 | 4 | if WANT_DEBUGGER 5 | mednafen_SOURCES += pce/dis6280.cpp pce/debug.cpp 6 | endif 7 | 8 | -------------------------------------------------------------------------------- /mednafen/src/pce/hes.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_PCE_HES_H 2 | #define __MDFN_PCE_HES_H 3 | 4 | namespace MDFN_IEN_PCE 5 | { 6 | 7 | uint8 ReadIBP(unsigned int A); 8 | void HES_Load(Stream* s) MDFN_COLD; 9 | void HES_Reset(void); 10 | void HES_Update(EmulateSpecStruct *espec, uint16 jp_data); 11 | void HES_Close(void) MDFN_COLD; 12 | 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /mednafen/src/sms/docs/compatability.txt: -------------------------------------------------------------------------------- 1 | 2 | Cool Spot 3 | 4 | Menu area has gap after the screen blanking part. 5 | Caused by new interrupt handling code. 6 | 7 | F16 Fighting Falcon, Rozetta no Shouzou 8 | 9 | Uses TMS9918 display modes which are not supported yet. 10 | 11 | Y's (J) 12 | 13 | Uses specific features of SMS 1 VDP. 14 | 15 | -------------------------------------------------------------------------------- /mednafen/src/IPSPatcher.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_IPSPATCHER_H 2 | #define __MDFN_IPSPATCHER_H 3 | 4 | #include 5 | 6 | namespace Mednafen 7 | { 8 | 9 | struct IPSPatcher 10 | { 11 | // Returns the number of patches encountered(!= bytes patched, usually). 12 | static uint32 Apply(Stream* ips, Stream* targ); 13 | }; 14 | 15 | } 16 | #endif 17 | -------------------------------------------------------------------------------- /mednafen/src/md/input/gamepad.h: -------------------------------------------------------------------------------- 1 | namespace MDFN_IEN_MD 2 | { 3 | 4 | MDFN_HIDE extern const IDIISG Gamepad2IDII; 5 | MDFN_HIDE extern const IDIISG GamepadIDII; 6 | MDFN_HIDE extern const IDIISG Gamepad6IDII; 7 | MD_Input_Device *MDInput_MakeMS2B(void); 8 | MD_Input_Device *MDInput_MakeMD3B(void); 9 | MD_Input_Device *MDInput_MakeMD6B(void); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/smp/smp.hpp: -------------------------------------------------------------------------------- 1 | class SMP { 2 | public: 3 | static const uint8_t iplrom[64]; 4 | 5 | #include "core/core.hpp" 6 | #include "ssmp/ssmp.hpp" 7 | 8 | SMP() {} 9 | ~SMP() {} 10 | }; 11 | 12 | #if defined(DEBUGGER) 13 | #include "debugger/debugger.hpp" 14 | extern sSMPDebugger smp; 15 | #else 16 | extern SMP smp; 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /mednafen/src/tremor/README.MEDNAFEN: -------------------------------------------------------------------------------- 1 | tremor git 7c30a66346199f3f09017a09567c6c8a3a0eedc8 2 | libogg 1.3.2 3 | 4 | With modifications like: 5 | perl -p -i -e "s//\"ogg.h\"/g" ./* && perl -p -i -e "s//\"os_types.h\"/g" ./* 6 | 7 | Jan 20, 2013: 8 | Mednafen-specific modifications to os_types.h, os.h, and misc.h - config_types.h was removed. 9 | -------------------------------------------------------------------------------- /mednafen/src/hw_cpu/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | if NEED_68K_EMU 2 | mednafen_SOURCES += hw_cpu/m68k/m68k.cpp 3 | endif 4 | 5 | if NEED_Z80_EMU 6 | mednafen_SOURCES += hw_cpu/z80-fuse/z80.cpp hw_cpu/z80-fuse/z80_ops.cpp 7 | endif 8 | 9 | if NEED_V810_EMU 10 | mednafen_SOURCES += hw_cpu/v810/v810_cpu.cpp hw_cpu/v810/v810_cpuD.cpp hw_cpu/v810/v810_fp_ops.cpp 11 | endif 12 | 13 | -------------------------------------------------------------------------------- /mednafen/src/nes/input/cursor.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_NES_INPUT_CURSOR_H 2 | #define __MDFN_NES_INPUT_CURSOR_H 3 | 4 | namespace MDFN_IEN_NES 5 | { 6 | 7 | void NESCURSOR_PaletteChanged(void); 8 | void NESCURSOR_DrawCursor(uint8 *pix, int pix_y, int xc, int yc); 9 | void NESCURSOR_DrawGunSight(int w, uint8 *pix, int pix_y, int xc, int yc); 10 | 11 | } 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/sa1/dma/dma.hpp: -------------------------------------------------------------------------------- 1 | struct DMA { 2 | enum CDEN { DmaNormal = 0, DmaCharConversion = 1 }; 3 | enum SD { SourceROM = 0, SourceBWRAM = 1, SourceIRAM = 2 }; 4 | enum DD { DestIRAM = 0, DestBWRAM = 1 }; 5 | unsigned line; 6 | } dma; 7 | 8 | void dma_normal(); 9 | void dma_cc1(); 10 | uint8 dma_cc1_read(unsigned addr); 11 | void dma_cc2(); 12 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/system/interface/interface.hpp: -------------------------------------------------------------------------------- 1 | class Interface { 2 | public: 3 | void video_scanline(uint16_t *data, unsigned line, unsigned width, unsigned height, bool interlace, bool field); 4 | void audio_sample(uint16_t l_sample, uint16_t r_sample); 5 | void input_poll(); 6 | int16_t input_poll(bool port, unsigned device, unsigned index, unsigned id); 7 | }; 8 | -------------------------------------------------------------------------------- /mednafen/src/drivers_libxxx/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = subdir-objects 2 | DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ 3 | DEFAULT_INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_builddir)/intl 4 | 5 | noinst_LIBRARIES = libmdfnxxx.a libmdfnxxx_extra.a 6 | libmdfnxxx_a_SOURCES = main.cpp 7 | libmdfnxxx_extra_a_SOURCES = interface.cpp CDInterface_EXT.cpp 8 | -------------------------------------------------------------------------------- /mednafen/src/md/debug.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_MD_DEBUG_H 2 | #define __MDFN_MD_DEBUG_H 3 | 4 | #ifdef WANT_DEBUGGER 5 | namespace MDFN_IEN_MD 6 | { 7 | 8 | 9 | MDFN_HIDE extern DebuggerInfoStruct DBGInfo; 10 | void MDDBG_Init(void) MDFN_COLD; 11 | void MDDBG_CPUHook(void); 12 | 13 | MDFN_HIDE extern bool MD_DebugMode; 14 | 15 | 16 | }; 17 | 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /mednafen/src/mpcdec/README.MEDNAFEN: -------------------------------------------------------------------------------- 1 | http://svn.musepack.net/libmpc/trunk/ 2 | 3 | libmpcdec from r484 4 | 5 | perl -p -i -e "s/include ]*)>/include \"\1\"/" *.c *.h 6 | 7 | Added 8 | 9 | #ifdef HAVE_CONFIG_H 10 | #include 11 | #endif 12 | 13 | to: 14 | 15 | mpc_types.h 16 | 17 | 18 | 19 | Renamed "log2" LUT in mpc_bits_reader.c to "log2_tab" 20 | -------------------------------------------------------------------------------- /mednafen/Documentation/ssfplay.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sega Saturn Sound Format (ripped music format in the PSF family) player. 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /mednafen/src/nes/input/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += nes/input/cursor.cpp nes/input/zapper.cpp nes/input/powerpad.cpp nes/input/arkanoid.cpp nes/input/shadow.cpp nes/input/fkb.cpp nes/input/fkb.h nes/input/hypershot.cpp nes/input/mahjong.cpp nes/input/oekakids.cpp nes/input/ftrainer.cpp nes/input/partytap.cpp nes/input/toprider.cpp nes/input/bbattler2.cpp nes/input/suborkb.cpp 2 | -------------------------------------------------------------------------------- /mednafen/src/drivers/video-state.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_DRIVERS_VIDEO_STATE_H 2 | #define __MDFN_DRIVERS_VIDEO_STATE_H 3 | 4 | void DrawSaveStates(int32 screen_w, int32 screen_h, double, double, const MDFN_PixelFormat& pf); 5 | bool SaveStatesActive(void); 6 | 7 | void MT_SetStateStatus(StateStatusStruct *status); 8 | void MT_SetMovieStatus(StateStatusStruct *status); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /mednafen/src/wswan/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += wswan/gfx.cpp wswan/main.cpp wswan/memory.cpp wswan/comm.cpp wswan/v30mz.cpp wswan/sound.cpp wswan/tcache.cpp wswan/interrupt.cpp wswan/eeprom.cpp wswan/rtc.cpp 2 | 3 | if WANT_DEBUGGER 4 | mednafen_SOURCES += wswan/debug.cpp wswan/dis/dis_decode.cpp wswan/dis/dis_groups.cpp wswan/dis/resolve.cpp wswan/dis/syntax.cpp 5 | endif 6 | 7 | -------------------------------------------------------------------------------- /mednafen/src/sound/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | if NEED_BLIP_BUFFER 2 | mednafen_SOURCES += sound/Blip_Buffer.cpp sound/Stereo_Buffer.cpp 3 | endif 4 | 5 | mednafen_SOURCES += sound/Fir_Resampler.cpp 6 | 7 | mednafen_SOURCES += sound/WAVRecord.cpp 8 | mednafen_SOURCES += sound/okiadpcm.cpp 9 | 10 | mednafen_SOURCES += sound/DSPUtility.cpp 11 | mednafen_SOURCES += sound/SwiftResampler.cpp sound/OwlResampler.cpp 12 | 13 | -------------------------------------------------------------------------------- /mednafen/src/video/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += video/surface.cpp video/convert.cpp video/tblur.cpp 2 | mednafen_SOURCES += video/Deinterlacer.cpp video/Deinterlacer_Simple.cpp video/Deinterlacer_Blend.cpp 3 | mednafen_SOURCES += video/resize.cpp video/video.cpp video/primitives.cpp video/png.cpp 4 | mednafen_SOURCES += video/text.cpp video/font-data.cpp video/font-data-18x18.c video/font-data-12x13.c 5 | 6 | -------------------------------------------------------------------------------- /mednafen/src/drivers/win-manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true/pm 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /mednafen/src/md/cd/interrupt.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_MDCD_INTERRUPT_H 2 | #define __MDFN_MDCD_INTERRUPT_H 3 | 4 | bool MDCD_InterruptGetMask(int level); 5 | bool MDCD_InterruptGetAsserted(int level); 6 | int MDCD_InterruptAck(int level); 7 | void MDCD_InterruptAssert(int level, bool status); 8 | void MDCD_InterruptReset(void); 9 | 10 | uint8 MDCD_InterruptRead(void); 11 | void MDCD_InterruptWrite(uint8 V); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/chip.hpp: -------------------------------------------------------------------------------- 1 | #include "superfx/superfx.hpp" 2 | #include "sa1/sa1.hpp" 3 | #include "bsx/bsx.hpp" 4 | #include "srtc/srtc.hpp" 5 | #include "sdd1/sdd1.hpp" 6 | #include "spc7110/spc7110.hpp" 7 | #include "cx4/cx4.hpp" 8 | #include "dsp1/dsp1.hpp" 9 | #include "dsp2/dsp2.hpp" 10 | #include "dsp3/dsp3.hpp" 11 | #include "dsp4/dsp4.hpp" 12 | #include "obc1/obc1.hpp" 13 | #include "st010/st010.hpp" 14 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/nall/algorithm.hpp: -------------------------------------------------------------------------------- 1 | #ifndef NALL_ALGORITHM_HPP 2 | #define NALL_ALGORITHM_HPP 3 | 4 | #undef min 5 | #undef max 6 | 7 | namespace nall_v059 { 8 | template T min(const T& t, const U& u) { 9 | return t < u ? t : u; 10 | } 11 | 12 | template T max(const T& t, const U& u) { 13 | return t > u ? t : u; 14 | } 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/smp/ssmp/memory/memory.hpp: -------------------------------------------------------------------------------- 1 | uint8 ram_read(uint16 addr); 2 | void ram_write(uint16 addr, uint8 data); 3 | 4 | uint8 port_read(uint8 port); 5 | void port_write(uint8 port, uint8 data); 6 | 7 | uint8 op_busread(uint16 addr); 8 | void op_buswrite(uint16 addr, uint8 data); 9 | 10 | void op_io(); 11 | debugvirtual uint8 op_read(uint16 addr); 12 | debugvirtual void op_write(uint16 addr, uint8 data); 13 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/dsp1/dsp1.hpp: -------------------------------------------------------------------------------- 1 | #include "dsp1emu.hpp" 2 | 3 | class DSP1 : public Memory { 4 | public: 5 | void init(); 6 | void enable(); 7 | void power(); 8 | void reset(); 9 | 10 | uint8 read(unsigned addr); 11 | void write(unsigned addr, uint8 data); 12 | 13 | void serialize(serializer&); 14 | 15 | private: 16 | Dsp1 dsp1; 17 | bool addr_decode(uint16 addr); 18 | }; 19 | 20 | extern DSP1 dsp1; 21 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/memory/smemory/serialization.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SMEMORY_CPP 2 | 3 | void sBus::serialize(serializer &s) { 4 | s.array(memory::wram.data(), memory::wram.size()); 5 | s.array(memory::apuram.data(), memory::apuram.size()); 6 | s.array(memory::vram.data(), memory::vram.size()); 7 | s.array(memory::oam.data(), memory::oam.size()); 8 | s.array(memory::cgram.data(), memory::cgram.size()); 9 | } 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/ppu/memory/memory.hpp: -------------------------------------------------------------------------------- 1 | uint16 get_vram_address(); 2 | 3 | debugvirtual uint8 vram_mmio_read(uint16 addr); 4 | debugvirtual void vram_mmio_write(uint16 addr, uint8 data); 5 | 6 | debugvirtual uint8 oam_mmio_read(uint16 addr); 7 | debugvirtual void oam_mmio_write(uint16 addr, uint8 data); 8 | 9 | debugvirtual uint8 cgram_mmio_read(uint16 addr); 10 | debugvirtual void cgram_mmio_write(uint16 addr, uint8 data); 11 | -------------------------------------------------------------------------------- /mednafen/src/testsexp.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_TESTSEXP_H 2 | #define __MDFN_TESTSEXP_H 3 | 4 | namespace Mednafen 5 | { 6 | void MDFNI_RunExpensiveTests(const char* dirpath) MDFN_COLD; 7 | void MDFNI_RunSwiftResamplerTest(void) MDFN_COLD; 8 | void MDFNI_RunOwlResamplerTest(void) MDFN_COLD; 9 | // 10 | void MDFN_RunExceptionTests(const unsigned thread_count, const unsigned thread_delay); // Called from tests.cpp 11 | } 12 | 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /mednafen/src/ss/notes/REFERENCES: -------------------------------------------------------------------------------- 1 | M68000 Programmer's Reference Manual fifth edition (M68000UM/AD REV 4) (ISBN 0-13-541491-1) 2 | M68000 User's Manual Eighth Edition (M68000UM/AD REV 7) (ISBN 0-13-541665-5) 3 | 4 | http://bitsavers.informatik.uni-stuttgart.de/pdf/hitachi/superH/ 5 | http://ppcenter.webou.net/satcart/ 6 | http://dreamjam.co.uk/emuviews/saturn.php 7 | http://koti.kapsi.fi/~antime/sega/ 8 | http://wiki.yabause.org/index.php5?title=CDBlock 9 | -------------------------------------------------------------------------------- /mednafen/src/hw_cpu/v810/v810_cpuD.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////// 2 | // Defines for the V810 CPU debug 3 | 4 | #ifndef V810_CPU_D_H_ 5 | #define V810_CPU_D_H_ 6 | 7 | #include "v810_opt.h" 8 | 9 | namespace Mednafen 10 | { 11 | // Dissasemble num lines of code starting at tPC (If tPC == -1 start at PC) 12 | void v810_dis(uint32 &PC, int num, char *, uint16 (*rhword)(uint32), bool vbmode = false); 13 | } 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /mednafen/src/sms/cart.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMS_CART_H 2 | #define __SMS_CART_H 3 | 4 | namespace MDFN_IEN_SMS 5 | { 6 | 7 | void Cart_Init(GameFile* gf) MDFN_COLD; 8 | void Cart_Close(void) MDFN_COLD; 9 | 10 | void Cart_Reset(void); 11 | 12 | void Cart_LoadNV(void); 13 | void Cart_SaveNV(void); 14 | 15 | void Cart_Write(uint16 A, uint8 V); 16 | uint8 Cart_Read(uint16 A); 17 | 18 | void Cart_StateAction(StateMem *sm, int load, int data_only); 19 | 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/sdd1/serialization.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SDD1_CPP 2 | 3 | void SDD1::serialize(serializer &s) { 4 | s.integer(sdd1_enable); 5 | s.integer(xfer_enable); 6 | s.array(mmc); 7 | 8 | for(unsigned n = 0; n < 8; n++) { 9 | s.integer(dma[n].addr); 10 | s.integer(dma[n].size); 11 | } 12 | 13 | s.array(buffer.data); 14 | s.integer(buffer.offset); 15 | s.integer(buffer.size); 16 | s.integer(buffer.ready); 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/smp/ssmp/debugger/debugger.hpp: -------------------------------------------------------------------------------- 1 | class sSMPDebugger : public sSMP { 2 | public: 3 | function step_event; 4 | 5 | enum Usage { 6 | UsageRead = 0x80, 7 | UsageWrite = 0x40, 8 | UsageExec = 0x20, 9 | }; 10 | uint8 *usage; 11 | uint16 opcode_pc; 12 | 13 | void op_step(); 14 | uint8 op_read(uint16 addr); 15 | void op_write(uint16 addr, uint8 data); 16 | 17 | sSMPDebugger(); 18 | ~sSMPDebugger(); 19 | }; 20 | -------------------------------------------------------------------------------- /mednafen/src/drivers/sound.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_DRIVERS_SOUND_H 2 | #define __MDFN_DRIVERS_SOUND_H 3 | 4 | bool Sound_Init(MDFNGI *gi) MDFN_COLD; 5 | void Sound_Kill(void) noexcept MDFN_COLD; 6 | 7 | bool Sound_NeedReInit(void); 8 | 9 | void Sound_Write(int16 *Buffer, int Count); 10 | void Sound_WriteSilence(int ms); 11 | 12 | uint32 Sound_CanWrite(void); 13 | 14 | int16 *Sound_GetEmuModBuffer(int32 *max_size); 15 | 16 | double Sound_GetRate(void); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /mednafen/src/nes/ppu/palette.h: -------------------------------------------------------------------------------- 1 | #ifndef _PPU_PALETTEH 2 | #define _PPU_PALETTEH 3 | 4 | namespace MDFN_IEN_NES 5 | { 6 | 7 | typedef struct { 8 | uint8 r,g,b; 9 | } MDFNPalStruct; 10 | 11 | MDFN_HIDE extern MDFNPalStruct ActiveNESPalette[0x200]; 12 | 13 | MDFN_HIDE extern const CustomPalette_Spec NES_CPInfo[]; 14 | 15 | void MDFN_InitPalette(const unsigned int which, const uint8* custom_palette, const unsigned cp_numentries); 16 | 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /mednafen/src/player.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_PLAYER_H 2 | #define __MDFN_PLAYER_H 3 | 4 | namespace Mednafen 5 | { 6 | 7 | void Player_Init(int tsongs, const std::string &album, const std::string &artist, const std::string ©right, const std::vector &snames = std::vector(), bool override_gi = true) MDFN_COLD; 8 | void Player_Draw(MDFN_Surface *surface, MDFN_Rect *dr, int CurrentSong, int16 *samples, int32 sampcount); 9 | 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /mednafen/src/drivers/remote.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_DRIVERS_REMOTE_H 2 | #define __MDFN_DRIVERS_REMOTE_H 3 | 4 | // Call all of these from the game(emulation) thread(or main thread if we haven't split off yet). 5 | 6 | void CheckForSTDIOMessages(void); 7 | bool InitSTDIOInterface(const char *key); 8 | void Remote_SendInfoMessage(const char *message); 9 | void Remote_SendErrorMessage(const char *message); 10 | void Remote_SendWarningMessage(const char *message); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /mednafen/src/md/cd/cd.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_MD_CD_H 2 | #define __MDFN_MD_CD_H 3 | 4 | namespace MDFN_IEN_MD 5 | { 6 | 7 | MDFN_HIDE extern M68K Sub68K; 8 | 9 | void MDCD_Run(int32 md_master_cycles); 10 | void MDCD_PCM_Run(int32 cycles); 11 | void MDCD_Reset(bool poweron); 12 | void MDCD_Load(std::vector *CDInterfaces, md_game_info *); 13 | bool MDCD_TestMagic(std::vector *CDInterfaces); 14 | void MDCD_Close(void); 15 | 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /mednafen/src/sms/shared.h: -------------------------------------------------------------------------------- 1 | #ifndef _SHARED_H_ 2 | #define _SHARED_H_ 3 | 4 | #include 5 | #include 6 | 7 | using namespace Mednafen; 8 | 9 | #include "sms.h" 10 | #include "pio.h" 11 | #include "memz80.h" 12 | #include "vdp.h" 13 | #include "render.h" 14 | #include "sound.h" 15 | #include "system.h" 16 | #include "tms.h" 17 | #include "cart.h" 18 | 19 | using namespace MDFN_IEN_SMS; 20 | 21 | #endif /* _SHARED_H_ */ 22 | -------------------------------------------------------------------------------- /mednafen/src/state-common.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_STATE_COMMON_H 2 | #define __MDFN_STATE_COMMON_H 3 | 4 | namespace Mednafen 5 | { 6 | 7 | typedef struct 8 | { 9 | int status[10]; 10 | int current; 11 | int current_movie; // For movies only, status(recording/playback) 12 | 13 | // The most recently-saved-to slot 14 | int recently_saved; 15 | 16 | // R, G, B, R, G, B, R, G, B, ... for w * h * 3 17 | uint8 *gfx; 18 | uint32 w, h; 19 | } StateStatusStruct; 20 | 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /mednafen/src/mpcdec/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES += libmpcdec.a 2 | libmpcdec_a_CFLAGS = @AM_CFLAGS@ @CFLAG_VISIBILITY@ 3 | libmpcdec_a_CPPFLAGS = -DMPC_FIXED_POINT=1 4 | 5 | libmpcdec_a_SOURCES = mpcdec/huffman.c mpcdec/mpc_decoder.c mpcdec/mpc_reader.c \ 6 | mpcdec/requant.c mpcdec/streaminfo.c mpcdec/synth_filter.c mpcdec/mpc_bits_reader.c mpcdec/mpc_demux.c \ 7 | mpcdec/crc32.c 8 | 9 | mednafen_LDADD += libmpcdec.a 10 | mednafen_DEPENDENCIES += libmpcdec.a 11 | 12 | -------------------------------------------------------------------------------- /mednafen/src/ss/notes/build_sh7095s_ctable.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int main(int argc, char* argv[]) 5 | { 6 | // printf("static_assert(__COUNTER__ <= 11025, \"Unexpected __COUNTER__\");\n"); 7 | const unsigned base = 2*5000; //10000; 8 | const unsigned max_entries = 512; //512; 9 | for(int i = max_entries; i > 0; i--) 10 | { 11 | printf("#if __COUNTER__ >= %u\n", base + max_entries + 2); 12 | printf(" &&Resume_%u,\n", base + i); 13 | printf("#endif\n"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /mednafen/src/nes/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += nes/nes.cpp nes/x6502.cpp nes/cart.cpp nes/fds.cpp nes/ines.cpp nes/input.cpp nes/nsf.cpp nes/nsfe.cpp nes/unif.cpp nes/vsuni.cpp nes/sound.cpp nes/fds-sound.cpp 2 | 3 | if WANT_DEBUGGER 4 | mednafen_SOURCES += nes/debug.cpp 5 | mednafen_SOURCES += nes/dis6502.cpp 6 | endif 7 | 8 | include nes/ppu/Makefile.am.inc 9 | include nes/boards/Makefile.am.inc 10 | include nes/input/Makefile.am.inc 11 | 12 | mednafen_SOURCES += nes/ntsc/nes_ntsc.cpp 13 | -------------------------------------------------------------------------------- /mednafen/m4/xsize.m4: -------------------------------------------------------------------------------- 1 | # xsize.m4 serial 4 2 | dnl Copyright (C) 2003-2004, 2008-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | AC_DEFUN([gl_XSIZE], 8 | [ 9 | dnl Prerequisites of lib/xsize.h. 10 | AC_REQUIRE([gl_SIZE_MAX]) 11 | AC_REQUIRE([AC_C_INLINE]) 12 | AC_CHECK_HEADERS([stdint.h]) 13 | ]) 14 | -------------------------------------------------------------------------------- /mednafen/src/cdrom/seektime_pce.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================ 3 | Name : seektime.h 4 | Author : Dave Shadoff 5 | Version : 6 | Copyright : (C) 2022 Dave Shadoff 7 | Description : Program to determine seek time, based on start and end sector numbers 8 | ============================================================================ 9 | */ 10 | 11 | extern float get_pce_cd_seek_ms(int start_sector, int target_sector); 12 | 13 | -------------------------------------------------------------------------------- /mednafen/src/pce/notes/EVENT_SYSTEM_NOTES: -------------------------------------------------------------------------------- 1 | On virtual power/reset, don't reset event system(timestamps such as lastts and such; but recalculating events based on new emulated register settings caused by the 2 | power/reset is good). 3 | 4 | All Reset()/Power() functions should be passed a timestamp(of the reset/power event). 5 | 6 | All users of the event system should initialize internal timestamp(lastts) to 0 on initialization, and only reset to 0 when its EndFrame() or ResetTS() or similar 7 | function is called. 8 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/cpu/cpu.cpp: -------------------------------------------------------------------------------- 1 | #include <../base.hpp> 2 | 3 | #define CPU_CPP 4 | namespace bSNES_v059 { 5 | 6 | #if defined(DEBUGGER) 7 | #include "cpu-debugger.cpp" 8 | #endif 9 | 10 | void CPU::power() { 11 | cpu_version = config.cpu.version; 12 | } 13 | 14 | void CPU::reset() { 15 | PPUcounter::reset(); 16 | } 17 | 18 | void CPU::serialize(serializer &s) { 19 | PPUcounter::serialize(s); 20 | s.integer(cpu_version); 21 | } 22 | 23 | CPU::CPU() { 24 | } 25 | 26 | CPU::~CPU() { 27 | } 28 | 29 | }; 30 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/libco/doc/examples/build.bat: -------------------------------------------------------------------------------- 1 | cc -O3 -fomit-frame-pointer -I../.. -o libco.o -c ../../libco.c 2 | c++ -O3 -fomit-frame-pointer -I../.. -c test_timing.cpp 3 | c++ -O3 -fomit-frame-pointer -o test_timing libco.o test_timing.o 4 | c++ -O3 -fomit-frame-pointer -I../.. -c test_args.cpp 5 | c++ -O3 -fomit-frame-pointer -o test_args libco.o test_args.o 6 | c++ -O3 -fomit-frame-pointer -I../.. -c test_serialization.cpp 7 | c++ -O3 -fomit-frame-pointer -o test_serialization libco.o test_serialization.o 8 | @del *.o 9 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/libco/doc/examples/build.sh: -------------------------------------------------------------------------------- 1 | cc -O3 -fomit-frame-pointer -I../.. -o libco.o -c ../../libco.c 2 | c++ -O3 -fomit-frame-pointer -I../.. -c test_timing.cpp 3 | c++ -O3 -fomit-frame-pointer -o test_timing libco.o test_timing.o 4 | c++ -O3 -fomit-frame-pointer -I../.. -c test_args.cpp 5 | c++ -O3 -fomit-frame-pointer -o test_args libco.o test_args.o 6 | c++ -O3 -fomit-frame-pointer -I../.. -c test_serialization.cpp 7 | c++ -O3 -fomit-frame-pointer -o test_serialization libco.o test_serialization.o 8 | rm -f *.o 9 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/smp/core/core.cpp: -------------------------------------------------------------------------------- 1 | //#include <../base.hpp> 2 | 3 | #define SMPCORE_CPP 4 | namespace bSNES_v059 { 5 | 6 | #include "serialization.cpp" 7 | #include "algorithms.cpp" 8 | 9 | #define A 0 10 | #define X 1 11 | #define Y 2 12 | #define SP 3 13 | 14 | #include "opcode_mov.cpp" 15 | #include "opcode_pc.cpp" 16 | #include "opcode_read.cpp" 17 | #include "opcode_rmw.cpp" 18 | #include "opcode_misc.cpp" 19 | #include "table.cpp" 20 | 21 | #undef A 22 | #undef X 23 | #undef Y 24 | #undef SP 25 | 26 | }; 27 | -------------------------------------------------------------------------------- /mednafen/Documentation/cheats.txt: -------------------------------------------------------------------------------- 1 | Cheat file format: 2 | 3 | 4 | Cheat type: S(substitute on read), C(substitute on read with compare) or R(replace value before vblank) 5 | Cheat active: "A"ctive or "I"nactive 6 | 7 | 8 | Cheat value length in bytes(1,2,3,4,5,6,7,8), values in big(B) or little endian(L)?, (RESERVED), 9 | cheat address, cheat value, optionally the compare value, and the cheat name or description. 10 | 11 | Example for a cheat: 12 | 13 | R A 1 L 0 001f006d 09 Infinite time 14 | 1 L 0x1F00F5 & 0x2, 1 L 0x1F0058 > 0 15 | -------------------------------------------------------------------------------- /mednafen/po/remove-potcdate.sin: -------------------------------------------------------------------------------- 1 | # Sed script that remove the POT-Creation-Date line in the header entry 2 | # from a POT file. 3 | # 4 | # The distinction between the first and the following occurrences of the 5 | # pattern is achieved by looking at the hold space. 6 | /^"POT-Creation-Date: .*"$/{ 7 | x 8 | # Test if the hold space is empty. 9 | s/P/P/ 10 | ta 11 | # Yes it was empty. First occurrence. Remove the line. 12 | g 13 | d 14 | bb 15 | :a 16 | # The hold space was nonempty. Following occurrences. Do nothing. 17 | x 18 | :b 19 | } 20 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/superfx/timing/timing.hpp: -------------------------------------------------------------------------------- 1 | unsigned cache_access_speed; 2 | unsigned memory_access_speed; 3 | uint8 r15_NOT_modified; // stores 0 and 1 only. 4 | 5 | void add_clocks(unsigned clocks); 6 | 7 | void rombuffer_sync(); 8 | void rombuffer_update(); 9 | uint8 rombuffer_read(); 10 | 11 | void rambuffer_sync(); 12 | uint8 rambuffer_read(uint16 addr); 13 | void rambuffer_write(uint16 addr, uint8 data); 14 | 15 | void r14_modify(uint16); 16 | void r15_modify(uint16); 17 | 18 | void update_speed(); 19 | void timing_reset(); 20 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/nall/static.hpp: -------------------------------------------------------------------------------- 1 | #ifndef NALL_STATIC_HPP 2 | #define NALL_STATIC_HPP 3 | 4 | namespace nall_v059 { 5 | template struct nall_static_assert; 6 | template<> struct nall_static_assert {}; 7 | 8 | template struct static_if { 9 | typedef true_type type; 10 | }; 11 | 12 | template struct static_if { 13 | typedef false_type type; 14 | }; 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /mednafen/Documentation/gg.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Mednafen's Sega Game Gear emulation is based off of SMS Plus. 7 |

8 | Game Gear emulation in Mednafen is a low-priority system in terms of proactive maintenance and bugfixes. 9 |

10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /mednafen/.gitignore: -------------------------------------------------------------------------------- 1 | /src/mednafen* 2 | !/src/mednafen*.* 3 | *.o 4 | *.o2 5 | *.a 6 | .Tpo 7 | .deps 8 | .dirstamp 9 | /include/config.h.in~ 10 | /autom4te.cache 11 | /Makefile 12 | /config.log 13 | /config.status 14 | /include/config.h 15 | /include/minilzo/ 16 | /include/stamp-h1 17 | /include/trio/ 18 | /include/zstd/ 19 | /intl/Makefile 20 | /po/Makefile 21 | /po/Makefile.in 22 | /po/POTFILES 23 | /src/Makefile 24 | /src/drivers/Makefile 25 | /src/drivers_dos/Makefile 26 | /src/drivers_libxxx/Makefile 27 | /src/sexyal/Makefile 28 | /src/ss/Makefile 29 | 30 | -------------------------------------------------------------------------------- /mednafen/src/hw_sound/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | if NEED_YM2413_EMU 2 | mednafen_SOURCES += hw_sound/ym2413/emu2413.cpp 3 | endif 4 | 5 | if NEED_YM2612_EMU 6 | mednafen_SOURCES += hw_sound/ym2612/Ym2612_Emu.cpp 7 | endif 8 | 9 | if NEED_GB_APU_EMU 10 | mednafen_SOURCES += hw_sound/gb_apu/Gb_Apu.cpp hw_sound/gb_apu/Gb_Apu_State.cpp hw_sound/gb_apu/Gb_Oscs.cpp 11 | endif 12 | 13 | if NEED_SMS_APU_EMU 14 | mednafen_SOURCES += hw_sound/sms_apu/Sms_Apu.cpp 15 | endif 16 | 17 | if NEED_PCE_PSG_EMU 18 | mednafen_SOURCES += hw_sound/pce_psg/pce_psg.cpp 19 | endif 20 | 21 | -------------------------------------------------------------------------------- /mednafen/src/sms/tms.h: -------------------------------------------------------------------------------- 1 | #ifndef _TMS_H_ 2 | #define _TMS_H_ 3 | 4 | namespace MDFN_IEN_SMS 5 | { 6 | 7 | MDFN_HIDE extern int text_counter; 8 | 9 | 10 | void make_tms_tables(void); 11 | void render_bg_tms(int line); 12 | void render_bg_m0(int line); 13 | void render_bg_m1(int line); 14 | void render_bg_m1x(int line); 15 | void render_bg_inv(int line); 16 | void render_bg_m3(int line); 17 | void render_bg_m3x(int line); 18 | void render_bg_m2(int line); 19 | void render_obj_tms(int line); 20 | void parse_line(int line); 21 | 22 | } 23 | 24 | #endif /* _TMS_H_ */ 25 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/obc1/obc1.hpp: -------------------------------------------------------------------------------- 1 | class OBC1 : public Memory { 2 | public: 3 | void init(); 4 | void enable(); 5 | void power(); 6 | void reset(); 7 | 8 | uint8 read(unsigned addr); 9 | void write(unsigned addr, uint8 data); 10 | 11 | void serialize(serializer&); 12 | OBC1(); 13 | ~OBC1(); 14 | 15 | private: 16 | uint8 ram_read(unsigned addr); 17 | void ram_write(unsigned addr, uint8 data); 18 | 19 | struct { 20 | uint16 address; 21 | uint16 baseptr; 22 | uint16 shift; 23 | } status; 24 | }; 25 | 26 | extern OBC1 obc1; 27 | -------------------------------------------------------------------------------- /mednafen/src/ss/vdp2_common.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_SS_VDP2_COMMON_H 2 | #define __MDFN_SS_VDP2_COMMON_H 3 | 4 | enum 5 | { 6 | RDBS_UNUSED = 0x0, 7 | RDBS_COEFF = 0x1, 8 | RDBS_NAME = 0x2, 9 | RDBS_CHAR = 0x3 10 | }; 11 | 12 | enum 13 | { 14 | VCP_NBG0_NT = 0x0, 15 | VCP_NBG1_NT = 0x1, 16 | VCP_NBG2_NT = 0x2, 17 | VCP_NBG3_NT = 0x3, 18 | 19 | VCP_NBG0_CG = 0x4, 20 | VCP_NBG1_CG = 0x5, 21 | VCP_NBG2_CG = 0x6, 22 | VCP_NBG3_CG = 0x7, 23 | 24 | VCP_NBG0_VCS = 0xC, 25 | VCP_NBG1_VCS = 0xD, 26 | VCP_CPU = 0xE, 27 | VCP_NOP = 0xF 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /mednafen/Documentation/sms.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Mednafen's Sega Master System emulation is based off of SMS Plus. 7 |

8 | Sega Master System emulation in Mednafen is a low-priority system in terms of proactive maintenance and bugfixes. 9 |

10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /mednafen/src/md/cart/map_eeprom.h: -------------------------------------------------------------------------------- 1 | #ifndef __MD_MAP_EEPROM_H 2 | #define __MD_MAP_EEPROM_H 3 | 4 | enum 5 | { 6 | EEP_NONE = 0, 7 | EEP_ACCLAIM_24C02_OLD = 1, 8 | EEP_ACCLAIM_24C02, 9 | EEP_ACCLAIM_24C04, 10 | EEP_ACCLAIM_24C16, 11 | EEP_ACCLAIM_24C65, 12 | 13 | EEP_EA_24C01, 14 | 15 | EEP_SEGA_24C01, 16 | 17 | EEP_CM_24C08, 18 | EEP_CM_24C16, 19 | EEP_CM_24C65, 20 | EEP_TOTAL 21 | }; 22 | 23 | MD_Cart_Type *MD_Make_Cart_Type_EEPROM(const md_game_info *ginfo, const uint8 *ROM, const uint32 ROM_size, const uint32 iparam, const char *sparam); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /mednafen/src/psx/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += psx/psx.cpp psx/cpu.cpp psx/gte.cpp psx/irq.cpp psx/timer.cpp psx/dma.cpp psx/mdec.cpp psx/sio.cpp psx/cdc.cpp psx/spu.cpp psx/frontio.cpp 2 | mednafen_SOURCES += psx/input/gamepad.cpp psx/input/dualanalog.cpp psx/input/dualshock.cpp psx/input/memcard.cpp psx/input/multitap.cpp psx/input/mouse.cpp psx/input/negcon.cpp psx/input/guncon.cpp psx/input/justifier.cpp 3 | mednafen_SOURCES += psx/gpu.cpp psx/gpu_polygon.cpp psx/gpu_line.cpp psx/gpu_sprite.cpp 4 | 5 | if WANT_DEBUGGER 6 | mednafen_SOURCES += psx/debug.cpp psx/dis.cpp 7 | endif 8 | 9 | -------------------------------------------------------------------------------- /mednafen/src/psx/notes/MULTITAP: -------------------------------------------------------------------------------- 1 | Atari Collection 2 = Port 1 (and have to enable 4-player mode in a menu in Gauntlet; multitap technically also works on port 2, but not very conveniently) (but having multitap on port 1 breaks 2-player Marble Madness, ARGH) 2 | Capcom Generations 4 = Port 1 or 2 (3-player) 3 | Captain Commando = Port 1 or 2 (3-player) 4 | Crash Bash = Port 1 5 | Crash Team Racing = Port 1 6 | Need for Speed - P.U. = Port 1 7 | Quake II = Port 1 8 | Rampage - Through Time = Port 2? (3-player) 9 | Tales of Phantasia = Port 1 or 2 10 | Tales of Destiny II = Port 1 or 2 11 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/cpu/scpu/memory/memory.hpp: -------------------------------------------------------------------------------- 1 | //============================ 2 | //CPU<>APU communication ports 3 | //============================ 4 | 5 | uint8 apu_port[4]; 6 | uint8 port_read(uint8 port) { return apu_port[port & 3]; } 7 | void port_write(uint8 port, uint8 data) { apu_port[port & 3] = data; } 8 | 9 | //====================== 10 | //core CPU bus functions 11 | //====================== 12 | 13 | void op_io(); 14 | debugvirtual uint8 op_read(uint32 addr); 15 | debugvirtual void op_write(uint32 addr, uint8 data); 16 | alwaysinline unsigned speed(unsigned addr) const; 17 | -------------------------------------------------------------------------------- /mednafen/src/wswan/eeprom.h: -------------------------------------------------------------------------------- 1 | #ifndef __WSWAN_EEPROM_H 2 | #define __WSWAN_EEPROM_H 3 | 4 | namespace MDFN_IEN_WSWAN 5 | { 6 | 7 | extern uint8 iEEPROM[0x800]; 8 | 9 | uint8 WSwan_EEPROMRead(uint32 A); 10 | void WSwan_EEPROMWrite(uint32 A, uint8 V); 11 | void WSwan_EEPROMStateAction(StateMem *sm, const unsigned load, const bool data_only); 12 | void WSwan_EEPROMReset(void); 13 | void WSwan_EEPROMLock(bool locked); 14 | void WSwan_EEPROMInit(const char *Name, const uint16 BYear, const uint8 BMonth, const uint8 BDay, const uint8 Sex, const uint8 Blood) MDFN_COLD; 15 | 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /mednafen/src/zstd/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES += libzstd.a 2 | libzstd_a_CFLAGS = @AM_CFLAGS@ @CFLAG_VISIBILITY@ 3 | libzstd_a_CPPFLAGS = -DZSTD_NO_TRACE=1 -DZSTD_HAVE_WEAK_SYMBOLS=0 4 | 5 | libzstd_a_SOURCES = zstd/common/entropy_common.c zstd/common/error_private.c zstd/common/fse_decompress.c zstd/common/xxhash.c zstd/common/zstd_common.c \ 6 | zstd/decompress/huf_decompress.c zstd/decompress/zstd_ddict.c zstd/decompress/zstd_decompress_block.c zstd/decompress/zstd_decompress.c 7 | 8 | mednafen_LDADD += libzstd.a 9 | mednafen_DEPENDENCIES += libzstd.a 10 | 11 | -------------------------------------------------------------------------------- /mednafen/src/gb/sound.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_GB_SOUND_H 2 | #define __MDFN_GB_SOUND_H 3 | 4 | namespace MDFN_IEN_GB 5 | { 6 | 7 | MDFN_FASTCALL uint32 SOUND_Read(int ts, uint32_t addr); 8 | MDFN_FASTCALL void SOUND_Write(int ts, uint32 addr, uint8 val); 9 | 10 | int32 SOUND_Flush(int ts, int16 *SoundBuf, const int32 MaxSoundFrames); 11 | void SOUND_Init(void) MDFN_COLD; 12 | void SOUND_Kill(void) MDFN_COLD; 13 | void SOUND_Reset(void) MDFN_COLD; 14 | void SOUND_StateAction(StateMem *sm, int load, int data_only); 15 | 16 | bool MDFNGB_SetSoundRate(uint32 rate); 17 | 18 | } 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /mednafen/src/md/membnk.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MEMBNK_H_ 3 | #define _MEMBNK_H_ 4 | 5 | namespace MDFN_IEN_MD 6 | { 7 | 8 | /* Function prototypes */ 9 | void z80_write_banked_memory(unsigned int address, unsigned int data); 10 | int z80_read_banked_memory(unsigned int address); 11 | 12 | void z80bank_vdp_w(int address, int data); 13 | int z80bank_vdp_r(int address); 14 | 15 | void z80bank_unused_w(int address, int data); 16 | int z80bank_unused_r(int address); 17 | void z80bank_lockup_w(int address, int data); 18 | int z80bank_lockup_r(int address); 19 | 20 | } 21 | 22 | #endif /* _MEMBNK_H_ */ 23 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/superfx/superfx.hpp: -------------------------------------------------------------------------------- 1 | #include "bus/bus.hpp" 2 | 3 | class SuperFX : public MMIO { 4 | public: 5 | #include "core/core.hpp" 6 | #include "memory/memory.hpp" 7 | #include "mmio/mmio.hpp" 8 | #include "timing/timing.hpp" 9 | #include "disasm/disasm.hpp" 10 | 11 | void enter(); 12 | 13 | void init(); 14 | void enable(); 15 | void power(); 16 | void reset(); 17 | 18 | void serialize(serializer&); 19 | 20 | private: 21 | unsigned clockmode; 22 | unsigned instruction_counter; 23 | }; 24 | 25 | extern SuperFX superfx; 26 | extern SuperFXBus superfxbus; 27 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/libco/libco.h: -------------------------------------------------------------------------------- 1 | /* 2 | libco v20 (2019-10-16) 3 | author: byuu 4 | license: ISC 5 | */ 6 | 7 | #ifndef LIBCO_H 8 | #define LIBCO_H 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef void* cothread_t; 15 | 16 | cothread_t co_active(void); 17 | cothread_t co_derive(void*, unsigned int, void (*)(void)); 18 | cothread_t co_create(unsigned int, void (*)(void)); 19 | void co_delete(cothread_t); 20 | void co_switch(cothread_t); 21 | int co_serializable(void); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | /* ifndef LIBCO_H */ 28 | #endif 29 | -------------------------------------------------------------------------------- /mednafen/src/snes_faust/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += snes_faust/cpu.cpp snes_faust/snes.cpp snes_faust/apu.cpp snes_faust/cart.cpp snes_faust/input.cpp snes_faust/ppu.cpp snes_faust/ppu_st.cpp snes_faust/ppu_mt.cpp 2 | mednafen_SOURCES += snes_faust/cart/dsp1.cpp snes_faust/cart/dsp2.cpp snes_faust/cart/sdd1.cpp snes_faust/cart/cx4.cpp snes_faust/cart/superfx.cpp 3 | mednafen_SOURCES += snes_faust/cart/sa1.cpp snes_faust/cart/sa1cpu.cpp 4 | mednafen_SOURCES += snes_faust/msu1.cpp 5 | mednafen_SOURCES += snes_faust/debug.cpp snes_faust/dis65816.cpp 6 | # 7 | mednafen_SOURCES += snes_faust/ppu_mtrender.cpp 8 | -------------------------------------------------------------------------------- /mednafen/src/drivers/args.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_DRIVERS_ARGS_H 2 | #define __MDFN_DRIVERS_ARGS_H 3 | 4 | enum 5 | { 6 | SUBSTYPE_INTEGER = 0, 7 | SUBSTYPE_STRING = 1, 8 | SUBSTYPE_DOUBLE = 2, 9 | 10 | SUBSTYPE_FUNCTION = 0x2000, 11 | 12 | SUBSTYPE_STRING_ALLOC = 0x4001, 13 | }; 14 | 15 | typedef struct { 16 | const char *name; 17 | const char *description; 18 | int *var; 19 | 20 | void *subs; 21 | int substype; 22 | } ARGPSTRUCT; 23 | 24 | int ParseArguments(int argc, char *argv[], ARGPSTRUCT *argsps, char **); 25 | int ShowArgumentsHelp(ARGPSTRUCT *argsps, bool show_linked = true); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /mednafen/src/drivers/ers.h: -------------------------------------------------------------------------------- 1 | class EmuRealSyncher 2 | { 3 | public: 4 | EmuRealSyncher(); 5 | ~EmuRealSyncher() 6 | { 7 | 8 | } 9 | 10 | void SetEmuClock(int64 EmuClock_arg); 11 | 12 | bool NeedFrameSkip(void); 13 | void Sync(); 14 | void AddEmuTime(const int64 zetime, bool frame_end = true); 15 | 16 | void SetETtoRT(void); 17 | 18 | private: 19 | int64 EmuClock; 20 | 21 | int64 EmuTime; 22 | 23 | int64 ForcedCatchupTH; 24 | int64 FrameSkipTH; 25 | int64 NoFrameSkipTH; 26 | 27 | int64 LastNoFrameSkipTime; 28 | 29 | int64 AvgTimePerFrame; // 56.8 30 | 31 | int64 tmp_frame_accumtime; 32 | }; 33 | 34 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/srtc/srtc.hpp: -------------------------------------------------------------------------------- 1 | class SRTC : public MMIO { 2 | public: 3 | void init(); 4 | void enable(); 5 | void power(); 6 | void reset(); 7 | 8 | uint8 mmio_read(unsigned addr); 9 | void mmio_write(unsigned addr, uint8 data); 10 | 11 | void serialize(serializer&); 12 | SRTC(); 13 | 14 | private: 15 | static const unsigned months[12]; 16 | enum RtcMode { RtcReady, RtcCommand, RtcRead, RtcWrite }; 17 | unsigned rtc_mode; 18 | signed rtc_index; 19 | 20 | void update_time(); 21 | unsigned weekday(unsigned year, unsigned month, unsigned day); 22 | }; 23 | 24 | extern SRTC srtc; 25 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/smp/core/serialization.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SMPCORE_CPP 2 | 3 | void SMP::core_serialize(serializer &s) { 4 | s.integer(regs.pc); 5 | s.integer(regs.a); 6 | s.integer(regs.x); 7 | s.integer(regs.y); 8 | s.integer(regs.sp); 9 | s.integer(regs.p.n); 10 | s.integer(regs.p.v); 11 | s.integer(regs.p.p); 12 | s.integer(regs.p.b); 13 | s.integer(regs.p.h); 14 | s.integer(regs.p.i); 15 | s.integer(regs.p.z); 16 | s.integer(regs.p.c); 17 | 18 | s.integer(dp); 19 | s.integer(sp); 20 | s.integer(rd); 21 | s.integer(wr); 22 | s.integer(bit); 23 | s.integer(ya); 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /mednafen/src/md/memz80.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MEMZ80_H_ 3 | #define _MEMZ80_H_ 4 | 5 | namespace MDFN_IEN_MD 6 | { 7 | 8 | /* Function prototypes */ 9 | uint8 MD_Z80_ReadByte(uint16 address); 10 | void MD_Z80_WriteByte(uint16 address, uint8 data); 11 | uint8 MD_Z80_ReadPort(uint16 address); 12 | void MD_Z80_WritePort(uint16 address, uint8 data); 13 | 14 | void z80_unused_w(int address, int data); 15 | int z80_unused_r(int address); 16 | void z80_lockup_w(int address, int data); 17 | int z80_lockup_r(int address); 18 | int z80_vdp_r(int address); 19 | void z80_vdp_w(int address, int data); 20 | 21 | } 22 | 23 | #endif /* _MEMZ80_H_ */ 24 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/cheat/cheat.hpp: -------------------------------------------------------------------------------- 1 | struct CheatCode { 2 | unsigned addr; 3 | uint8 data; 4 | signed compare; 5 | }; 6 | 7 | class Cheat : public vector { 8 | public: 9 | bool enabled() const; 10 | void enable(bool); 11 | void synchronize(); 12 | void read(unsigned, uint8&) const; 13 | 14 | inline bool active() const; 15 | inline bool exists(unsigned addr) const; 16 | 17 | Cheat(); 18 | 19 | void remove_read_patches(void); 20 | void install_read_patch(const CheatCode& c); 21 | 22 | private: 23 | uint8 bitmask[0x200000]; 24 | bool system_enabled; 25 | }; 26 | 27 | extern Cheat cheat; 28 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/system/audio/audio.hpp: -------------------------------------------------------------------------------- 1 | class Audio { 2 | public: 3 | void coprocessor_enable(bool state); 4 | void coprocessor_frequency(double frequency); 5 | void sample(int16 left, int16 right); 6 | void coprocessor_sample(int16 left, int16 right); 7 | void init(); 8 | 9 | private: 10 | bool coprocessor; 11 | uint32 dsp_buffer[32768], cop_buffer[32768]; 12 | unsigned dsp_rdoffset, cop_rdoffset; 13 | unsigned dsp_wroffset, cop_wroffset; 14 | unsigned dsp_length, cop_length; 15 | 16 | double r_step, r_frac; 17 | int r_sum_l, r_sum_r; 18 | 19 | void flush(); 20 | }; 21 | 22 | extern Audio audio; 23 | -------------------------------------------------------------------------------- /mednafen/src/pce_fast/input.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCE_INPUT_H 2 | #define __PCE_INPUT_H 3 | 4 | namespace MDFN_IEN_PCE_FAST 5 | { 6 | 7 | void PCEINPUT_Init(void) MDFN_COLD; 8 | void PCEINPUT_SettingChanged(const char *name); 9 | void PCEINPUT_SetInput(unsigned port, const char *type, uint8 *ptr); 10 | uint8 INPUT_Read(unsigned int A); 11 | void INPUT_Write(unsigned int A, uint8 V); 12 | void INPUT_Frame(void); 13 | void INPUT_TransformInput(void); 14 | void INPUT_StateAction(StateMem *sm, int load, int data_only); 15 | MDFN_HIDE extern const std::vector PCEPortInfo; 16 | void INPUT_FixTS(void); 17 | 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /mednafen/src/sms/sound.h: -------------------------------------------------------------------------------- 1 | #ifndef __SMS_SOUND_H 2 | #define __SMS_SOUND_H 3 | 4 | namespace MDFN_IEN_SMS 5 | { 6 | 7 | /* Function prototypes */ 8 | void psg_write(int data); 9 | void psg_stereo_w(int data); 10 | int fmunit_detect_r(void); 11 | void fmunit_detect_w(int data); 12 | void fmunit_write(int offset, int data); 13 | 14 | void SMS_SoundClose(void); 15 | int32 SMS_SoundFlush(int16 *SoundBuf, int32 MaxSoundFrames); 16 | void SMS_SoundReset(void); 17 | bool SMS_SetSoundRate(uint32 rate); 18 | void SMS_SoundStateAction(StateMem *sm, int load, int data_only); 19 | void SMS_SoundInit(uint32 clock, bool WantFM); 20 | 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/system/video/video.hpp: -------------------------------------------------------------------------------- 1 | class Video { 2 | public: 3 | enum Mode { 4 | ModeNTSC, 5 | ModePAL, 6 | }; 7 | void set_mode(Mode); 8 | 9 | private: 10 | Mode mode; 11 | bool frame_interlace; 12 | bool frame_field; 13 | 14 | void update(); 15 | void scanline(); 16 | void render_scanline(unsigned line); 17 | void init(); 18 | 19 | static const uint8_t cursor[15][16]; 20 | void draw_cursor(const int rline, const bool hires, const uint16_t color, const int x, const int y); 21 | 22 | friend class System; 23 | friend class PPU; // Just for render_scanline() 24 | }; 25 | 26 | extern Video video; 27 | -------------------------------------------------------------------------------- /mednafen/src/md/cd/cdc_cdd.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_MDCD_CDCCDD_H 2 | #define __MDFN_MDCD_CDCCDD_H 3 | 4 | void MDCD_CDC_MainWrite8(uint32 A, uint8 V); 5 | void MDCD_CDC_MainWrite16(uint32 A, uint16 V); 6 | uint8 MDCD_CDC_MainRead8(uint32 A); 7 | uint16 MDCD_CDC_MainRead16(uint32 A); 8 | 9 | void MDCD_CDC_SubWrite8(uint32 A, uint8 V); 10 | void MDCD_CDC_SubWrite16(uint32 A, uint16 V); 11 | uint8 MDCD_CDC_SubRead8(uint32 A); 12 | uint16 MDCD_CDC_SubRead16(uint32 A); 13 | 14 | 15 | void MDCD_CDD_Write8(uint32 A, uint8 V); 16 | void MDCD_CDD_Write16(uint32 A, uint16 V); 17 | uint8 MDCD_CDD_Read8(uint32 A); 18 | uint16 MDCD_CDD_Read16(uint32 A); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /mednafen/src/pce/notes/PATENTS: -------------------------------------------------------------------------------- 1 | 5,319,786 - Apparatus for controlling a scanning type video display to be divided into plural display regions 2 | 5,226,140 - Apparatus for controlling the transfer of data 3 | 5,059,955 - Apparatus for producing video signals 4 | 5,034,886 - Computer system for reducing number of dedicated registers using memory stock and sharing of address and general purpose registers 5 | 5,030,946 - Apparatus for the control of an access to a video memory 6 | 4,970,642 - An apparatus for accessing a memory 7 | 4,951,038 - Apparatus for displaying a sprite on a screen 8 | 4,924,744 - Apparatus for generating sound through low frequency and noise modulation 9 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/superfx/bus/bus.hpp: -------------------------------------------------------------------------------- 1 | struct SuperFXBus 2 | { 3 | void init(); 4 | void power(); 5 | void reset(); 6 | uint8 read(uint32 addr); 7 | void write(uint32 addr, uint8 val); 8 | uint8* rom_ptr; 9 | uint8* ram_ptr; 10 | uint32 ram_mask; 11 | }; 12 | 13 | struct SuperFXCPUROM : Memory { 14 | unsigned size() const; 15 | uint8 read(unsigned); 16 | void write(unsigned, uint8); 17 | }; 18 | 19 | struct SuperFXCPURAM : Memory { 20 | unsigned size() const; 21 | uint8 read(unsigned); 22 | void write(unsigned, uint8); 23 | }; 24 | 25 | namespace memory { 26 | extern SuperFXCPUROM fxrom; 27 | extern SuperFXCPURAM fxram; 28 | } 29 | -------------------------------------------------------------------------------- /mednafen/src/netplay-driver.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_NETPLAY_DRIVER_H 2 | #define __MDFN_NETPLAY_DRIVER_H 3 | 4 | namespace Mednafen 5 | { 6 | 7 | void MDFNI_NetplayConnect(void); 8 | void MDFNI_NetplayDisconnect(void); 9 | 10 | /* Parse and handle a line of UI text(may include / commands) */ 11 | void MDFNI_NetplayLine(const char *text, bool &inputable, bool &viewable); 12 | 13 | /* Display netplay-related text. */ 14 | /* NetEcho will be set to true if the displayed text is a network 15 | echo of what we typed. 16 | */ 17 | void MDFND_NetplayText(const char* text, bool NetEcho); 18 | void MDFND_NetplaySetHints(bool active, bool behind, uint32 local_players_mask); 19 | 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /mednafen/mswin/build-linux-gcc-4.9.4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # apt-get install build-essential pkg-config libmpfr-dev libgmp-dev libmpc-dev gawk 5 | # 6 | CROSS_SOURCES="$HOME/mednafen-cross-sources" 7 | 8 | PKGNAME_GCC="gcc-4.9.4" 9 | 10 | cd $CROSS_SOURCES && \ 11 | tar -jxf $PKGNAME_GCC.tar.bz2 && \ 12 | patch -p0 < "$CROSS_SOURCES/$PKGNAME_GCC-linux-ucontext.patch" && \ 13 | cd $PKGNAME_GCC && \ 14 | ./configure --prefix=$HOME/$PKGNAME_GCC --enable-languages=c,c++ --disable-multilib --disable-libsanitizer --disable-libcilkrts && \ 15 | make -j$(nproc) && \ 16 | make install && \ 17 | cd .. && \ 18 | rm --one-file-system -rf $PKGNAME_GCC && \ 19 | 20 | # 21 | # 22 | # 23 | echo "Done." 24 | -------------------------------------------------------------------------------- /mednafen/src/nes/vsuni.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_NES_VSUNI_H 2 | #define __MDFN_NES_VSUNI_H 3 | 4 | namespace MDFN_IEN_NES 5 | { 6 | 7 | void MDFN_VSUniPower(void) MDFN_COLD; 8 | void MDFN_VSUniCheck(uint64 md5partial, int *, int *) MDFN_COLD; 9 | void MDFN_VSUniDraw(MDFN_Surface *surface); 10 | 11 | void MDFN_VSUniToggleDIPView(void); 12 | void MDFN_VSUniToggleDIP(int); /* For movies and netplay */ 13 | void MDFN_VSUniCoin(void); 14 | void MDFN_VSUniSwap(uint8 *j0, uint8 *j1); 15 | 16 | void MDFNNES_VSUNIStateAction(StateMem *sm, const unsigned load, const bool data_only); 17 | 18 | void MDFN_VSUniInstallRWHooks(void); 19 | 20 | unsigned int MDFN_VSUniGetPaletteNum(void); 21 | 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/memory/smemory/smemory.hpp: -------------------------------------------------------------------------------- 1 | class sBus : public Bus { 2 | public: 3 | bool load_cart(); 4 | void unload_cart(); 5 | 6 | void power(); 7 | void reset(); 8 | 9 | inline uint8 read(unsigned addr) 10 | { 11 | uint8 r; 12 | 13 | r = Bus::read(addr); 14 | 15 | #if defined(CHEAT_SYSTEM) 16 | if(cheat.active() && cheat.exists(addr)) { 17 | cheat.read(addr, r); 18 | } 19 | #endif 20 | 21 | return r; 22 | } 23 | 24 | void serialize(serializer&); 25 | sBus(); 26 | ~sBus(); 27 | 28 | private: 29 | void map_reset(); 30 | void map_system(); 31 | void map_generic(); 32 | void map_generic_sram(); 33 | }; 34 | 35 | extern sBus bus; 36 | -------------------------------------------------------------------------------- /mednafen/m4/signed.m4: -------------------------------------------------------------------------------- 1 | # signed.m4 serial 1 (gettext-0.10.40) 2 | dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([bh_C_SIGNED], 10 | [ 11 | AC_CACHE_CHECK([for signed], bh_cv_c_signed, 12 | [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) 13 | if test $bh_cv_c_signed = no; then 14 | AC_DEFINE(signed, , 15 | [Define to empty if the C compiler doesn't support this keyword.]) 16 | fi 17 | ]) 18 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/memory/smemory/system.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SMEMORY_CPP 2 | 3 | void sBus::map_reset() { 4 | map(MapDirect, 0x00, 0xff, 0x0000, 0xffff, memory::memory_unmapped); 5 | for(unsigned i = 0x2000; i <= 0x5fff; i++) memory::mmio.map(i, memory::mmio_unmapped); 6 | } 7 | 8 | void sBus::map_system() { 9 | map(MapDirect, 0x00, 0x3f, 0x2000, 0x5fff, memory::mmio); 10 | map(MapDirect, 0x80, 0xbf, 0x2000, 0x5fff, memory::mmio); 11 | 12 | map(MapLinear, 0x00, 0x3f, 0x0000, 0x1fff, memory::wram, 0x000000, 0x002000); 13 | map(MapLinear, 0x80, 0xbf, 0x0000, 0x1fff, memory::wram, 0x000000, 0x002000); 14 | 15 | map(MapLinear, 0x7e, 0x7f, 0x0000, 0xffff, memory::wram); 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /mednafen/src/tremor/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES += libvorbisidec.a 2 | libvorbisidec_a_CFLAGS = @AM_CFLAGS@ @CFLAG_VISIBILITY@ -Wno-shadow -Wno-unused 3 | libvorbisidec_a_CPPFLAGS= -I$(srcdir)/tremor 4 | 5 | libvorbisidec_a_SOURCES = tremor/mdct.c tremor/block.c tremor/window.c \ 6 | tremor/synthesis.c tremor/info.c \ 7 | tremor/floor1.c tremor/floor0.c tremor/vorbisfile.c \ 8 | tremor/res012.c tremor/mapping0.c tremor/registry.c tremor/codebook.c \ 9 | tremor/sharedbook.c tremor/framing.c tremor/bitwise.c 10 | 11 | mednafen_LDADD += libvorbisidec.a 12 | mednafen_DEPENDENCIES += libvorbisidec.a 13 | 14 | -------------------------------------------------------------------------------- /mednafen/src/drivers/prompt.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_DRIVERS_PROMPT_H 2 | #define __MDFN_DRIVERS_PROMPT_H 3 | 4 | #include "TextEntry.h" 5 | 6 | class HappyPrompt 7 | { 8 | public: 9 | HappyPrompt(const std::string &ptext, const std::string &zestring); 10 | HappyPrompt(); 11 | 12 | virtual ~HappyPrompt(); 13 | 14 | void Draw(MDFN_Surface *surface, const MDFN_Rect *rect); 15 | void Event(const SDL_Event *event); 16 | void SetText(const std::string &ptext); 17 | void InsertKBB(const std::string &zestring); 18 | 19 | virtual void TheEnd(const std::string &pstring); 20 | 21 | 22 | protected: 23 | std::string PromptText; 24 | 25 | private: 26 | 27 | TextEntry te; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/cartridge/gameboyheader.cpp: -------------------------------------------------------------------------------- 1 | #ifdef CARTRIDGE_CPP 2 | 3 | unsigned Cartridge::gameboy_ram_size() const { 4 | if(memory::gbrom.size() < 512) return 0; 5 | switch(memory::gbrom[0x0149]) { 6 | case 0x00: return 0 * 1024; 7 | case 0x01: return 8 * 1024; 8 | case 0x02: return 8 * 1024; 9 | case 0x03: return 32 * 1024; 10 | case 0x04: return 128 * 1024; 11 | case 0x05: return 128 * 1024; 12 | default: return 128 * 1024; 13 | } 14 | } 15 | 16 | unsigned Cartridge::gameboy_rtc_size() const { 17 | if(memory::gbrom.size() < 512) return 0; 18 | if(memory::gbrom[0x0147] == 0x0f || memory::gbrom[0x0147] == 0x10) return 4; 19 | return 0; 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /mednafen/src/md/sound.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SOUND_H_ 3 | #define _SOUND_H_ 4 | 5 | namespace MDFN_IEN_MD 6 | { 7 | 8 | /* Function prototypes */ 9 | void fm_write(int address, int data); 10 | void psg_write(int data); 11 | 12 | void MDSound_SetYM2612Reset(bool new_reset); 13 | int MDSound_ReadFM(int address); 14 | void MDSound_SetSoundMultiplier(double multiplier); 15 | bool MDSound_SetSoundRate(uint32 rate); 16 | int32 MDSound_Flush(int16 *SoundBuf, const int32 MaxSoundFrames); 17 | void MDSound_Init(void) MDFN_COLD; 18 | void MDSound_Kill(void) MDFN_COLD; 19 | void MDSound_Power(void); 20 | 21 | void MDSound_StateAction(StateMem *sm, const unsigned load, const bool data_only); 22 | 23 | }; 24 | 25 | #endif /* _SOUND_H_ */ 26 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/sa1/memory/memory.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SA1_CPP 2 | 3 | //ROM, I-RAM and MMIO registers are accessed at ~10.74MHz (2 clock ticks) 4 | //BW-RAM is accessed at ~5.37MHz (4 clock ticks) 5 | //tick() == 2 clock ticks 6 | //note: bus conflict delays are not emulated at this time 7 | 8 | void SA1::op_io() { 9 | tick(); 10 | } 11 | 12 | uint8 SA1::op_read(unsigned addr) { 13 | tick(); 14 | if(((addr & 0x40e000) == 0x006000) || ((addr & 0xd00000) == 0x400000)) tick(); 15 | return sa1bus.read(addr); 16 | } 17 | 18 | void SA1::op_write(unsigned addr, uint8 data) { 19 | tick(); 20 | if(((addr & 0x40e000) == 0x006000) || ((addr & 0xd00000) == 0x400000)) tick(); 21 | sa1bus.write(addr, data); 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/cpu/cpu.hpp: -------------------------------------------------------------------------------- 1 | #if defined(DEBUGGER) 2 | #include "cpu-debugger.hpp" 3 | #endif 4 | 5 | class CPU : public PPUcounter, public MMIO { 6 | public: 7 | virtual void enter() = 0; 8 | 9 | //CPU version number 10 | //* 1 and 2 are known 11 | //* reported by $4210 12 | //* affects timing (DRAM refresh, HDMA init, etc) 13 | uint8 cpu_version; 14 | 15 | virtual uint8 pio() = 0; 16 | virtual bool joylatch() = 0; 17 | virtual uint8 port_read(uint8 port) = 0; 18 | virtual void port_write(uint8 port, uint8 value) = 0; 19 | 20 | virtual void scanline() = 0; 21 | virtual void power(); 22 | virtual void reset(); 23 | 24 | virtual void serialize(serializer&); 25 | CPU(); 26 | virtual ~CPU(); 27 | }; 28 | -------------------------------------------------------------------------------- /mednafen/src/cdrom/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += cdrom/crc32.cpp cdrom/galois.cpp cdrom/l-ec.cpp cdrom/recover-raw.cpp cdrom/lec.cpp 2 | mednafen_SOURCES += cdrom/CDUtility.cpp 3 | mednafen_SOURCES += cdrom/CDInterface.cpp cdrom/CDInterface_MT.cpp cdrom/CDInterface_ST.cpp 4 | mednafen_SOURCES += cdrom/CDAccess.cpp cdrom/CDAccess_Image.cpp cdrom/CDAccess_CCD.cpp 5 | mednafen_SOURCES += cdrom/seektime_pce.cpp 6 | 7 | mednafen_SOURCES += cdrom/CDAFReader.cpp 8 | mednafen_SOURCES += cdrom/CDAFReader_Vorbis.cpp 9 | mednafen_SOURCES += cdrom/CDAFReader_MPC.cpp 10 | if HAVE_LIBFLAC 11 | mednafen_SOURCES += cdrom/CDAFReader_FLAC.cpp 12 | endif 13 | mednafen_SOURCES += cdrom/CDAFReader_PCM.cpp 14 | 15 | mednafen_SOURCES += cdrom/scsicd.cpp 16 | 17 | -------------------------------------------------------------------------------- /mednafen/src/drivers/fps.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_DRIVERS_FPS_H 2 | #define __MDFN_DRIVERS_FPS_H 3 | 4 | enum 5 | { 6 | FPSPOS_UPPER_LEFT = 0, 7 | FPSPOS_UPPER_RIGHT, 8 | FPSPOS_UPPER_CENTER, 9 | FPSPOS_CENTER 10 | }; 11 | 12 | void FPS_Init(const unsigned fps_pos, const unsigned fps_scale, const unsigned fps_font, const uint32 fps_tcolor, const uint32 fps_bgcolor) MDFN_COLD; // GT 13 | void FPS_Kill(void) MDFN_COLD; 14 | void FPS_IncVirtual(int64 vcycles); // GT 15 | void FPS_IncDrawn(void); // GT 16 | void FPS_IncBlitted(void); // GT 17 | void FPS_UpdateCalc(void); // GT 18 | 19 | void FPS_DrawToScreen(const MDFN_PixelFormat& pf, const MDFN_Rect& cr, unsigned min_screen_w_h); // MT 20 | 21 | void FPS_ToggleView(void); // GT 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/smp/ssmp/ssmp.hpp: -------------------------------------------------------------------------------- 1 | void enter(); 2 | debugvirtual void op_step(); 3 | 4 | #include "memory/memory.hpp" 5 | #include "timing/timing.hpp" 6 | 7 | struct { 8 | 9 | uint8 opcode; 10 | bool in_opcode; 11 | 12 | //timing 13 | uint32 clock_counter; 14 | uint32 dsp_counter; 15 | 16 | //$00f0 17 | uint8 clock_speed; 18 | bool mmio_disabled; 19 | bool ram_writable; 20 | 21 | //$00f1 22 | bool iplrom_enabled; 23 | 24 | //$00f2 25 | uint8 dsp_addr; 26 | 27 | //$00f8,$00f9 28 | uint8 smp_f8, smp_f9; 29 | } status; 30 | 31 | //ssmp.cpp 32 | void power(); 33 | void reset(); 34 | 35 | void serialize(serializer&); 36 | 37 | friend class sSMPDebug; 38 | -------------------------------------------------------------------------------- /mednafen/src/wswan/wswan.h: -------------------------------------------------------------------------------- 1 | #ifndef __WSWAN_H 2 | #define __WSWAN_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace Mednafen; 9 | 10 | #include "interrupt.h" 11 | 12 | namespace MDFN_IEN_WSWAN 13 | { 14 | 15 | #define mBCD(value) (((value)/10)<<4)|((value)%10) 16 | 17 | MDFN_HIDE extern uint16 WSButtonStatus; 18 | MDFN_HIDE extern uint32 WS_InDebug; 19 | MDFN_HIDE extern uint32 rom_size; 20 | MDFN_HIDE extern int wsc; 21 | 22 | enum 23 | { 24 | WSWAN_SEX_MALE = 1, 25 | WSWAN_SEX_FEMALE = 2 26 | }; 27 | 28 | enum 29 | { 30 | WSWAN_BLOOD_A = 1, 31 | WSWAN_BLOOD_B = 2, 32 | WSWAN_BLOOD_O = 3, 33 | WSWAN_BLOOD_AB = 4 34 | }; 35 | 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /mednafen/src/sms/memz80.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _MEMZ80_H_ 3 | #define _MEMZ80_H_ 4 | 5 | namespace MDFN_IEN_SMS 6 | { 7 | 8 | /* Global data */ 9 | MDFN_HIDE extern uint8 data_bus_pullup; 10 | MDFN_HIDE extern uint8 data_bus_pulldown; 11 | 12 | /* Function prototypes */ 13 | uint8 z80_read_unmapped(void); 14 | void gg_port_w(uint16 port, uint8 data); 15 | uint8 gg_port_r(uint16 port); 16 | void ggms_port_w(uint16 port, uint8 data); 17 | uint8 ggms_port_r(uint16 port); 18 | void sms_port_w(uint16 port, uint8 data); 19 | uint8 sms_port_r(uint16 port); 20 | void smsj_port_w(uint16 port, uint8 data); 21 | uint8 smsj_port_r(uint16 port); 22 | void md_port_w(uint16 port, uint8 data); 23 | uint8 md_port_r(uint16 port); 24 | 25 | } 26 | 27 | #endif /* _MEMZ80_H_ */ 28 | -------------------------------------------------------------------------------- /mednafen/src/md/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | mednafen_SOURCES += md/vdp.cpp md/genesis.cpp md/genio.cpp md/header.cpp md/mem68k.cpp md/membnk.cpp md/memvdp.cpp md/memz80.cpp md/sound.cpp md/system.cpp 2 | 3 | mednafen_SOURCES += md/cart/cart.cpp md/cart/map_eeprom.cpp md/cart/map_realtec.cpp md/cart/map_ssf2.cpp md/cart/map_ff.cpp md/cart/map_rom.cpp md/cart/map_sbb.cpp md/cart/map_yase.cpp md/cart/map_rmx3.cpp md/cart/map_sram.cpp md/cart/map_svp.cpp 4 | # md/cart/ssp16.c 5 | 6 | mednafen_SOURCES += md/input/multitap.cpp md/input/4way.cpp md/input/megamouse.cpp md/input/gamepad.cpp 7 | 8 | mednafen_SOURCES += md/cd/cd.cpp md/cd/timer.cpp md/cd/interrupt.cpp md/cd/pcm.cpp md/cd/cdc_cdd.cpp 9 | 10 | if WANT_DEBUGGER 11 | mednafen_SOURCES += md/debug.cpp 12 | endif 13 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/smp/core/memory.hpp: -------------------------------------------------------------------------------- 1 | alwaysinline uint8_t op_readpc() { 2 | return op_read(regs.pc++); 3 | } 4 | 5 | alwaysinline uint8_t op_readstack() { 6 | return op_read(0x0100 | ++regs.sp); 7 | } 8 | 9 | alwaysinline void op_writestack(uint8_t data) { 10 | op_write(0x0100 | regs.sp--, data); 11 | } 12 | 13 | alwaysinline uint8_t op_readaddr(uint16_t addr) { 14 | return op_read(addr); 15 | } 16 | 17 | alwaysinline void op_writeaddr(uint16_t addr, uint8_t data) { 18 | op_write(addr, data); 19 | } 20 | 21 | alwaysinline uint8_t op_readdp(uint8_t addr) { 22 | return op_read(((unsigned)regs.p.p << 8) + addr); 23 | } 24 | 25 | alwaysinline void op_writedp(uint8_t addr, uint8_t data) { 26 | op_write(((unsigned)regs.p.p << 8) + addr, data); 27 | } 28 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/cpu/scpu/timing/joypad.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SCPU_CPP 2 | 3 | void sCPU::run_auto_joypad_poll() { 4 | uint16 joy1 = 0, joy2 = 0, joy3 = 0, joy4 = 0; 5 | for(unsigned i = 0; i < 16; i++) { 6 | uint8 port0 = input.port_read(0); 7 | uint8 port1 = input.port_read(1); 8 | 9 | joy1 |= (port0 & 1) ? (0x8000 >> i) : 0; 10 | joy2 |= (port1 & 1) ? (0x8000 >> i) : 0; 11 | joy3 |= (port0 & 2) ? (0x8000 >> i) : 0; 12 | joy4 |= (port1 & 2) ? (0x8000 >> i) : 0; 13 | } 14 | 15 | status.joy1l = joy1; 16 | status.joy1h = joy1 >> 8; 17 | 18 | status.joy2l = joy2; 19 | status.joy2h = joy2 >> 8; 20 | 21 | status.joy3l = joy3; 22 | status.joy3h = joy3 >> 8; 23 | 24 | status.joy4l = joy4; 25 | status.joy4h = joy4 >> 8; 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /mednafen/src/movie.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_MOVIE_H 2 | #define __MDFN_MOVIE_H 3 | 4 | namespace Mednafen 5 | { 6 | class MemoryStream; 7 | } 8 | 9 | #include "movie-driver.h" 10 | #include "state.h" 11 | 12 | namespace Mednafen 13 | { 14 | void MDFNMOV_ProcessInput(uint8 *PortData[], uint32 PortLen[], int NumPorts) noexcept; 15 | void MDFNMOV_Stop(void) noexcept; 16 | void MDFNMOV_AddCommand(uint8 cmd, uint32 data_len = 0, uint8* data = NULL) noexcept; 17 | bool MDFNMOV_IsPlaying(void) noexcept; 18 | bool MDFNMOV_IsRecording(void) noexcept; 19 | void MDFNMOV_RecordState(void) noexcept; 20 | 21 | // For state rewinding only. 22 | void MDFNMOV_StateAction(StateMem* sm, const unsigned load); 23 | 24 | void MDFNI_SelectMovie(int); 25 | void MDFNMOV_CheckMovies(void); 26 | 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/dsp2/serialization.cpp: -------------------------------------------------------------------------------- 1 | #ifdef DSP2_CPP 2 | 3 | void DSP2::serialize(serializer &s) { 4 | s.integer(status.waiting_for_command); 5 | s.integer(status.command); 6 | s.integer(status.in_count); 7 | s.integer(status.in_index); 8 | s.integer(status.out_count); 9 | s.integer(status.out_index); 10 | 11 | s.array(status.parameters); 12 | s.array(status.output); 13 | 14 | s.integer(status.op05transparent); 15 | s.integer(status.op05haslen); 16 | s.integer(status.op05len); 17 | s.integer(status.op06haslen); 18 | s.integer(status.op06len); 19 | s.integer(status.op09word1); 20 | s.integer(status.op09word2); 21 | s.integer(status.op0dhaslen); 22 | s.integer(status.op0doutlen); 23 | s.integer(status.op0dinlen); 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /mednafen/po/insert-header.sin: -------------------------------------------------------------------------------- 1 | # Sed script that inserts the file called HEADER before the header entry. 2 | # 3 | # At each occurrence of a line starting with "msgid ", we execute the following 4 | # commands. At the first occurrence, insert the file. At the following 5 | # occurrences, do nothing. The distinction between the first and the following 6 | # occurrences is achieved by looking at the hold space. 7 | /^msgid /{ 8 | x 9 | # Test if the hold space is empty. 10 | s/m/m/ 11 | ta 12 | # Yes it was empty. First occurrence. Read the file. 13 | r HEADER 14 | # Output the file's contents by reading the next line. But don't lose the 15 | # current line while doing this. 16 | g 17 | N 18 | bb 19 | :a 20 | # The hold space was nonempty. Following occurrences. Do nothing. 21 | x 22 | :b 23 | } 24 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/system/config/config.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SYSTEM_CPP 2 | 3 | Configuration config; 4 | 5 | Configuration::Configuration() { 6 | controller_port1 = Input::DeviceJoypad; 7 | controller_port2 = Input::DeviceJoypad; 8 | expansion_port = System::ExpansionBSX; 9 | region = System::Autodetect; 10 | 11 | cpu.version = 2; 12 | cpu.ntsc_clock_rate = 21477272; 13 | cpu.pal_clock_rate = 21281370; 14 | cpu.alu_mul_delay = 2; 15 | cpu.alu_div_delay = 2; 16 | cpu.wram_init_value = 0x55; 17 | 18 | smp.ntsc_clock_rate = 24607104; //32040.5 * 768 19 | smp.pal_clock_rate = 24607104; 20 | 21 | ppu1.version = 1; 22 | ppu2.version = 3; 23 | 24 | superfx.speed = 0; //0 = auto-select, 1 = force 10.74MHz, 2 = force 21.48MHz 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /mednafen/src/md/shared.h: -------------------------------------------------------------------------------- 1 | #ifndef _SHARED_H_ 2 | #define _SHARED_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | using namespace Mednafen; 11 | 12 | namespace MDFN_IEN_MD 13 | { 14 | 15 | enum 16 | { 17 | CLOCK_NTSC = 53693175, 18 | CLOCK_PAL = 53203424 // Is this correct? 19 | }; 20 | 21 | } 22 | 23 | #include "macros.h" 24 | #include "header.h" 25 | #include "debug.h" 26 | #include "genesis.h" 27 | #include "mem68k.h" 28 | #include "memz80.h" 29 | #include "membnk.h" 30 | #include "memvdp.h" 31 | #include "system.h" 32 | #include "genio.h" 33 | #include "sound.h" 34 | #include "vdp.h" 35 | 36 | using namespace MDFN_IEN_MD; 37 | 38 | #endif /* _SHARED_H_ */ 39 | 40 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/libco/LICENSE.LIBCO: -------------------------------------------------------------------------------- 1 | ISC License (ISC) 2 | 3 | Copyright byuu and the higan team 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 8 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/memory/smemory/smemory.cpp: -------------------------------------------------------------------------------- 1 | #include <../base.hpp> 2 | 3 | #define SMEMORY_CPP 4 | namespace bSNES_v059 { 5 | 6 | sBus bus; 7 | 8 | #include "system.cpp" 9 | #include "generic.cpp" 10 | #include "serialization.cpp" 11 | 12 | void sBus::power() { 13 | for(unsigned i = 0x2000; i <= 0x5fff; i++) memory::mmio.map(i, memory::mmio_unmapped); 14 | for(unsigned i = 0; i < memory::wram.size(); i++) memory::wram[i] = config.cpu.wram_init_value; 15 | } 16 | 17 | void sBus::reset() { 18 | } 19 | 20 | bool sBus::load_cart() { 21 | if(cartridge.loaded() == true) return false; 22 | 23 | map_reset(); 24 | map_generic(); 25 | map_system(); 26 | return true; 27 | } 28 | 29 | void sBus::unload_cart() { 30 | } 31 | 32 | sBus::sBus() { 33 | } 34 | 35 | sBus::~sBus() { 36 | } 37 | 38 | }; 39 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/system/config/config.hpp: -------------------------------------------------------------------------------- 1 | struct Configuration { 2 | unsigned controller_port1; 3 | unsigned controller_port2; 4 | unsigned expansion_port; 5 | unsigned region; 6 | 7 | struct CPU { 8 | unsigned version; 9 | unsigned ntsc_clock_rate; 10 | unsigned pal_clock_rate; 11 | unsigned alu_mul_delay; 12 | unsigned alu_div_delay; 13 | unsigned wram_init_value; 14 | } cpu; 15 | 16 | struct SMP { 17 | unsigned ntsc_clock_rate; 18 | unsigned pal_clock_rate; 19 | } smp; 20 | 21 | struct PPU1 { 22 | unsigned version; 23 | } ppu1; 24 | 25 | struct PPU2 { 26 | unsigned version; 27 | } ppu2; 28 | 29 | struct SuperFX { 30 | unsigned speed; 31 | } superfx; 32 | 33 | Configuration(); 34 | }; 35 | 36 | extern Configuration config; 37 | -------------------------------------------------------------------------------- /mednafen/src/drivers/netplay.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_DRIVERS_NETPLAY_H 2 | #define __MDFN_DRIVERS_NETPLAY_H 3 | 4 | void NetplayText_InMainThread(uint8 *text, bool NetEcho); 5 | 6 | int NetplayEventHook(const SDL_Event *event); 7 | int NetplayEventHook_GT(const SDL_Event *event); 8 | 9 | void Netplay_ToggleTextView(void); 10 | int Netplay_GetTextView(void); 11 | bool Netplay_IsTextInput(void); 12 | bool Netplay_TryTextExit(void); 13 | 14 | // Returns local player mask if netplay is active, (uint32)-1 otherwise 15 | uint32 Netplay_GetLPM(void); 16 | 17 | MDFN_HIDE extern int MDFNDnetplay; 18 | 19 | 20 | // 21 | // 22 | // 23 | void Netplay_GT_CheckPendingLine(void); 24 | 25 | // 26 | // 27 | // 28 | 29 | void Netplay_MT_Draw(const MDFN_PixelFormat& pformat, const int32 screen_w, const int32 screen_h); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /mednafen/src/psx/notes/SPU-IRQ: -------------------------------------------------------------------------------- 1 | Castlevania Chronicles - Music. 2 | Chrono Cross - FMV. 3 | Dance Dance Revolution - Gameplay music. 4 | Dance Dance Revolution: Disney Mix - Gameplay music. 5 | Eithea - Sneaky evil usage, along with manual loop address override abuse. 6 | Final Fantasy 8 - Some FMV 7 | Koudelka 8 | Legend of Mana - FMV(really finicky about DMA timing). 9 | Medal of Honor 10 | Misadventures of Tron Bonne - Dialogue. 11 | Nicktoons Racing - FMV, gameplay music. 12 | Tales of Destiny - Battle voices. Japanese version 1.0 is particularly sensitive to how SPU IRQs are emulated, and tends to lock up after Mary's "Moushuuken" is used if emulated improperly. 13 | Thousand Arms - Dialogue. 14 | Um Jammer Lammy 15 | Valkyrie Profile - Used extensively for dialogue, in-battle and out. 16 | Wing Commander 4 - FMV. 17 | -------------------------------------------------------------------------------- /mednafen/mswin/build-mednafen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CROSS_BASE="$HOME/mednafen-cross" 4 | CROSS32_PATH="$CROSS_BASE/win32" 5 | CROSS64_PATH="$CROSS_BASE/win64" 6 | CROSS9X_PATH="$CROSS_BASE/win9x" 7 | export PATH="$CROSS64_PATH/bin:$PATH" 8 | 9 | rm --one-file-system -r build64 10 | mkdir build64 && \ 11 | cd build64 && \ 12 | cp "$CROSS64_PATH/x86_64-w64-mingw32/lib/"*.dll . && \ 13 | cp "$CROSS64_PATH/bin/"*.dll . && \ 14 | PKG_CONFIG_PATH="$CROSS64_PATH/lib/pkgconfig" PATH="$CROSS64_PATH/bin:$PATH" CPPFLAGS="-I$CROSS64_PATH/include -DUNICODE=1 -D_UNICODE=1" LDFLAGS="-L$CROSS64_PATH/lib -static-libstdc++" ../mednafen/configure --host=x86_64-w64-mingw32 --disable-alsa --disable-jack --enable-threads=win32 --with-sdl-prefix="$CROSS64_PATH" && \ 15 | make -j4 V=0 && \ 16 | cd .. && \ 17 | # 18 | # 19 | # 20 | echo "Done." 21 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/ppu/render/addsub.cpp: -------------------------------------------------------------------------------- 1 | #ifdef PPU_CPP 2 | 3 | //color addition / subtraction 4 | //thanks go to blargg for the optimized algorithms 5 | inline uint16 PPU::addsub(uint32 x, uint32 y, bool halve) { 6 | if(!regs.color_mode) { 7 | if(!halve) { 8 | unsigned sum = x + y; 9 | unsigned carry = (sum - ((x ^ y) & 0x0421)) & 0x8420; 10 | return (sum - carry) | (carry - (carry >> 5)); 11 | } else { 12 | return (x + y - ((x ^ y) & 0x0421)) >> 1; 13 | } 14 | } else { 15 | unsigned diff = x - y + 0x8420; 16 | unsigned borrow = (diff - ((x ^ y) & 0x8420)) & 0x8420; 17 | if(!halve) { 18 | return (diff - borrow) & (borrow - (borrow >> 5)); 19 | } else { 20 | return (((diff - borrow) & (borrow - (borrow >> 5))) & 0x7bde) >> 1; 21 | } 22 | } 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /mednafen/m4/wchar_t.m4: -------------------------------------------------------------------------------- 1 | # wchar_t.m4 serial 3 (gettext-0.18) 2 | dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether has the 'wchar_t' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_WCHAR_T], 12 | [ 13 | AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t], 14 | [AC_TRY_COMPILE([#include 15 | wchar_t foo = (wchar_t)'\0';], , 16 | [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])]) 17 | if test $gt_cv_c_wchar_t = yes; then 18 | AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) 19 | fi 20 | ]) 21 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/cpu/core/serialization.cpp: -------------------------------------------------------------------------------- 1 | #ifdef CPUCORE_CPP 2 | 3 | void CPUcore::core_serialize(serializer &s) { 4 | s.integer(regs.pc); //.d); 5 | 6 | s.integer(regs.a.w); 7 | s.integer(regs.x.w); 8 | s.integer(regs.y.w); 9 | s.integer(regs.z.w); 10 | s.integer(regs.s.w); 11 | s.integer(regs.d.w); 12 | 13 | s.integer(regs.p.n); 14 | s.integer(regs.p.v); 15 | s.integer(regs.p.m); 16 | s.integer(regs.p.x); 17 | s.integer(regs.p.d); 18 | s.integer(regs.p.i); 19 | s.integer(regs.p.z); 20 | s.integer(regs.p.c); 21 | 22 | s.integer(regs.db); 23 | s.integer(regs.e); 24 | s.integer(regs.irq); 25 | s.integer(regs.wai); 26 | s.integer(regs.mdr); 27 | 28 | s.integer(aa); //.d); 29 | s.integer(rd); //.d); 30 | s.integer(sp); 31 | s.integer(dp); 32 | 33 | update_table(); 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /mednafen/mswin/package-mednafen-win9x.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | VERSION=`head -n 1 mednafen/Documentation/modules.def` 3 | 4 | cd build9x && \ 5 | cp src/mednafen.exe . && \ 6 | i486-w64-mingw32-strip mednafen.exe && \ 7 | i486-w64-mingw32-strip libcharset-1.dll libiconv-2.dll && \ 8 | mkdir -p de/LC_MESSAGES ru/LC_MESSAGES && \ 9 | cp ../mednafen/po/de.gmo de/LC_MESSAGES/mednafen.mo && \ 10 | cp ../mednafen/po/ru.gmo ru/LC_MESSAGES/mednafen.mo && \ 11 | 7za a -mtc- -mx9 -mfb=258 -mpass=15 ../mednafen-"$VERSION"-win9x.zip mednafen.exe libgcc_s_dw2-1.dll libcharset-1.dll libiconv-2.dll de/ ru/ && \ 12 | cd ../mednafen && \ 13 | 7za a -mtc- -mx9 -mfb=258 -mpass=15 ../mednafen-"$VERSION"-win9x.zip COPYING ChangeLog Documentation/*.html Documentation/*.css Documentation/*.png Documentation/*.txt && \ 14 | cd .. && \ 15 | # 16 | # 17 | # 18 | echo "Done." 19 | 20 | -------------------------------------------------------------------------------- /mednafen/src/ngp/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES += libngp.a 2 | libngp_a_CFLAGS = @AM_CFLAGS@ @NO_STRICT_ALIASING_FLAGS@ 3 | libngp_a_CXXFLAGS = @AM_CXXFLAGS@ @NO_STRICT_ALIASING_FLAGS@ 4 | libngp_a_SOURCES = ngp/bios.cpp ngp/biosHLE.cpp ngp/dma.cpp ngp/flash.cpp ngp/gfx.cpp ngp/T6W28_Apu.cpp \ 5 | ngp/gfx_scanline_mono.cpp ngp/gfx_scanline_colour.cpp ngp/interrupt.cpp ngp/mem.cpp ngp/neopop.cpp \ 6 | ngp/rom.cpp ngp/rtc.cpp ngp/sound.cpp ngp/Z80_interface.cpp \ 7 | ngp/TLCS-900h/TLCS900h_interpret_single.cpp \ 8 | ngp/TLCS-900h/TLCS900h_interpret.cpp \ 9 | ngp/TLCS-900h/TLCS900h_registers.cpp \ 10 | ngp/TLCS-900h/TLCS900h_interpret_reg.cpp \ 11 | ngp/TLCS-900h/TLCS900h_interpret_src.cpp \ 12 | ngp/TLCS-900h/TLCS900h_interpret_dst.cpp 13 | 14 | mednafen_LDADD += libngp.a 15 | mednafen_DEPENDENCIES += libngp.a 16 | 17 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/interface.hpp: -------------------------------------------------------------------------------- 1 | #ifdef DEBUGGER 2 | #define debugvirtual virtual 3 | #else 4 | #define debugvirtual 5 | #endif 6 | 7 | namespace bSNES_v059 { 8 | #include "system/scheduler/scheduler.hpp" 9 | #include "cheat/cheat.hpp" 10 | #include "memory/memory.hpp" 11 | #include "memory/smemory/smemory.hpp" 12 | 13 | #include "ppu/ppu.hpp" 14 | 15 | #include "cpu/cpu.hpp" 16 | #include "cpu/core/core.hpp" 17 | #include "cpu/scpu/scpu.hpp" 18 | 19 | #include "smp/smp.hpp" 20 | 21 | #include "sdsp/sdsp.hpp" 22 | 23 | #include "system/system.hpp" 24 | #include "chip/chip.hpp" 25 | #include "cartridge/cartridge.hpp" 26 | //#include "cheat/cheat.hpp" 27 | 28 | #include "memory/memory-inline.hpp" 29 | #include "ppu/ppu-inline.hpp" 30 | #include "cheat/cheat-inline.hpp" 31 | }; 32 | 33 | #undef debugvirtual 34 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/sa1/sa1.hpp: -------------------------------------------------------------------------------- 1 | #include "bus/bus.hpp" 2 | 3 | class SA1 : public CPUcore, public MMIO { 4 | public: 5 | #include "dma/dma.hpp" 6 | #include "memory/memory.hpp" 7 | #include "mmio/mmio.hpp" 8 | 9 | struct Status { 10 | uint8 tick_counter; 11 | 12 | bool interrupt_pending; 13 | uint16 interrupt_vector; 14 | 15 | uint16 scanlines; 16 | uint16 vcounter; 17 | uint16 hcounter; 18 | } status; 19 | 20 | void enter(); 21 | void interrupt(uint16 vector); 22 | void tick(); 23 | 24 | alwaysinline void trigger_irq(); 25 | alwaysinline void last_cycle(); 26 | alwaysinline bool interrupt_pending(); 27 | 28 | void init(); 29 | void enable(); 30 | void power(); 31 | void reset(); 32 | 33 | void serialize(serializer&); 34 | SA1(); 35 | }; 36 | 37 | extern SA1 sa1; 38 | extern SA1Bus sa1bus; 39 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/smp/ssmp/timing/timing.hpp: -------------------------------------------------------------------------------- 1 | template 2 | class sSMPTimer { 3 | public: 4 | uint8 target; 5 | uint8 stage1_ticks, stage2_ticks, stage3_ticks; 6 | bool enabled; 7 | 8 | void tick() { 9 | //stage 1 increment 10 | stage1_ticks++; 11 | if(stage1_ticks < cycle_frequency) return; 12 | 13 | stage1_ticks -= cycle_frequency; 14 | if(enabled == false) return; 15 | 16 | //stage 2 increment 17 | stage2_ticks++; 18 | 19 | if(stage2_ticks != target) return; 20 | 21 | //stage 3 increment 22 | stage2_ticks = 0; 23 | stage3_ticks++; 24 | stage3_ticks &= 15; 25 | } 26 | }; 27 | 28 | sSMPTimer<128> t0; 29 | sSMPTimer<128> t1; 30 | sSMPTimer< 16> t2; 31 | 32 | alwaysinline void add_clocks(unsigned clocks); 33 | alwaysinline void tick_timers(); 34 | uint32 clocks_executed(); 35 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/nall/utility.hpp: -------------------------------------------------------------------------------- 1 | #ifndef NALL_UTILITY_HPP 2 | #define NALL_UTILITY_HPP 3 | 4 | namespace nall_v059 { 5 | template 6 | inline void swap(T &x, T &y) { 7 | T temp(x); 8 | x = y; 9 | y = temp; 10 | } 11 | 12 | template 13 | struct base_from_member { 14 | T value; 15 | base_from_member(T value_) : value(value_) {} 16 | }; 17 | 18 | class noncopyable { 19 | protected: 20 | noncopyable() {} 21 | ~noncopyable() {} 22 | 23 | private: 24 | noncopyable(const noncopyable&); 25 | const noncopyable& operator=(const noncopyable&); 26 | }; 27 | 28 | template 29 | inline T* allocate(size_t size, const T &value) { 30 | T *array = new T[size]; 31 | for(size_t i = 0; i < size; i++) array[i] = value; 32 | return array; 33 | } 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /mednafen/m4/codeset.m4: -------------------------------------------------------------------------------- 1 | # codeset.m4 serial 4 (gettext-0.18) 2 | dnl Copyright (C) 2000-2002, 2006, 2008-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([AM_LANGINFO_CODESET], 10 | [ 11 | AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset], 12 | [AC_TRY_LINK([#include ], 13 | [char* cs = nl_langinfo(CODESET); return !cs;], 14 | [am_cv_langinfo_codeset=yes], 15 | [am_cv_langinfo_codeset=no]) 16 | ]) 17 | if test $am_cv_langinfo_codeset = yes; then 18 | AC_DEFINE([HAVE_LANGINFO_CODESET], [1], 19 | [Define if you have and nl_langinfo(CODESET).]) 20 | fi 21 | ]) 22 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/107.cpp: -------------------------------------------------------------------------------- 1 | #include "mapinc.h" 2 | 3 | static uint8 latch; 4 | 5 | static void Sync(void) 6 | { 7 | setprg32(0x8000, latch >> 1); 8 | setchr8(latch & 0x07); 9 | } 10 | 11 | static DECLFW(m107w) 12 | { 13 | latch = V; 14 | Sync(); 15 | } 16 | 17 | static void Power(CartInfo *info) 18 | { 19 | latch = 0; 20 | Sync(); 21 | } 22 | 23 | static int StateAction(StateMem *sm, int load, int data_only) 24 | { 25 | SFORMAT StateRegs[] = 26 | { 27 | SFVAR(latch), 28 | SFEND 29 | }; 30 | 31 | int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAPR"); 32 | if(load) 33 | Sync(); 34 | return(ret); 35 | } 36 | 37 | int Mapper107_Init(CartInfo *info) 38 | { 39 | info->Power = Power; 40 | info->StateAction = StateAction; 41 | SetWriteHandler(0x8000,0xffff,m107w); 42 | SetReadHandler(0x8000, 0xFFFF, CartBR); 43 | 44 | return(1); 45 | } 46 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/140.cpp: -------------------------------------------------------------------------------- 1 | #include "mapinc.h" 2 | 3 | static uint8 latch; 4 | 5 | static void Sync(void) 6 | { 7 | setchr8(latch & 0xF); 8 | setprg32(0x8000, (latch >> 4)); 9 | } 10 | 11 | static int StateAction(StateMem *sm, int load, int data_only) 12 | { 13 | SFORMAT StateRegs[] = 14 | { 15 | SFVAR(latch), 16 | SFEND 17 | }; 18 | 19 | int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAPR"); 20 | if(load) 21 | Sync(); 22 | return(ret); 23 | } 24 | 25 | static void Power(CartInfo *info) 26 | { 27 | latch = 0; 28 | Sync(); 29 | } 30 | 31 | 32 | static DECLFW(Write) 33 | { 34 | latch = V; 35 | Sync(); 36 | } 37 | 38 | int Mapper140_Init(CartInfo *info) 39 | { 40 | SetWriteHandler(0x6000, 0x7FFF, Write); 41 | SetReadHandler(0x8000, 0xFFFF, CartBR); 42 | info->StateAction = StateAction; 43 | info->Power = Power; 44 | return(1); 45 | } 46 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/cx4/serialization.cpp: -------------------------------------------------------------------------------- 1 | #ifdef CX4_CPP 2 | 3 | void Cx4::serialize(serializer &s) { 4 | s.array(ram); 5 | s.array(reg); 6 | 7 | s.integer(r0); 8 | s.integer(r1); 9 | s.integer(r2); 10 | s.integer(r3); 11 | s.integer(r4); 12 | s.integer(r5); 13 | s.integer(r6); 14 | s.integer(r7); 15 | s.integer(r8); 16 | s.integer(r9); 17 | s.integer(r10); 18 | s.integer(r11); 19 | s.integer(r12); 20 | s.integer(r13); 21 | s.integer(r14); 22 | s.integer(r15); 23 | 24 | s.integer(C4WFXVal); 25 | s.integer(C4WFYVal); 26 | s.integer(C4WFZVal); 27 | s.integer(C4WFX2Val); 28 | s.integer(C4WFY2Val); 29 | s.integer(C4WFDist); 30 | s.integer(C4WFScale); 31 | 32 | s.integer(C41FXVal); 33 | s.integer(C41FYVal); 34 | s.integer(C41FAngleRes); 35 | s.integer(C41FDist); 36 | s.integer(C41FDistVal); 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/87.cpp: -------------------------------------------------------------------------------- 1 | #include "mapinc.h" 2 | 3 | static uint8 latch; 4 | 5 | static void Sync(void) 6 | { 7 | setchr8(latch); 8 | } 9 | 10 | static DECLFW(Mapper87_write) 11 | { 12 | latch = V >> 1; 13 | Sync(); 14 | } 15 | 16 | static void Power(CartInfo *info) 17 | { 18 | latch = 0; 19 | setprg32(0x8000, 0); 20 | Sync(); 21 | } 22 | 23 | static int StateAction(StateMem *sm, int load, int data_only) 24 | { 25 | SFORMAT StateRegs[] = 26 | { 27 | SFVAR(latch), 28 | SFEND 29 | }; 30 | 31 | int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAPR"); 32 | if(load) 33 | Sync(); 34 | return(ret); 35 | } 36 | 37 | int Mapper87_Init(CartInfo *info) 38 | { 39 | info->Power = Power; 40 | info->StateAction = StateAction; 41 | SetWriteHandler(0x6000,0x7fff,Mapper87_write); 42 | SetReadHandler(0x8000, 0xFFFF, CartBR); 43 | 44 | return(1); 45 | } 46 | -------------------------------------------------------------------------------- /mednafen/src/sexyal/README: -------------------------------------------------------------------------------- 1 | SexyAL current bugs and limitations: 2 | 3 | Only supports one input sample format right now: SEXYAL_FMT_PCMS16 4 | 5 | Does not perform sample-rate conversion. 6 | 7 | The SDL driver is intended to be integrated in an application that already uses SDL, and calls SDL_Init() 8 | before a SexyAL device is opened, and SDL_Quit() after it is closed(the SexyAL SDL sound driver will handle 9 | initializing any SDL subsystems it needs if they're not already initialized, however). 10 | If you want to use it in an application that otherwise does not use SDL, you will need to set the environment 11 | variable "SEXYAL_SDL_STANDALONE" to a non-zero positive integer value before you open the SexyAL device. 12 | 13 | Pause() and Clear() are not completely implemented in drivers yet. 14 | 15 | CanWrite() semantics can be weird, read the comment in "sexyal.h". 16 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/smp/ssmp/timing/timing.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SSMP_CPP 2 | 3 | void SMP::add_clocks(unsigned clocks) { 4 | scheduler.addclocks_smp(clocks); 5 | #if !defined(DSP_STATE_MACHINE) 6 | scheduler.sync_smpdsp(); 7 | #else 8 | while(scheduler.clock.smpdsp < 0) dsp.enter(); 9 | #endif 10 | 11 | // Mednafen change. 12 | scheduler.sync_smpcpu(); 13 | } 14 | 15 | void SMP::tick_timers() { 16 | t0.tick(); 17 | t1.tick(); 18 | t2.tick(); 19 | 20 | //forcefully sync S-SMP to S-CPU in case chips are not communicating 21 | //sync if S-SMP is more than 24 samples ahead of S-CPU 22 | //if(scheduler.clock.cpusmp > +(768 * 24 * (int64)24000000)) scheduler.sync_smpcpu(); 23 | 24 | // Mednafen change - Make the check for only about 1 sample ahead. 25 | //if(scheduler.clock.cpusmp > +(768 * 1 * (int64)24000000)) scheduler.sync_smpcpu(); 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /mednafen/src/nes/x6502struct.h: -------------------------------------------------------------------------------- 1 | #ifndef _X6502STRUCTH 2 | 3 | typedef struct __X6502 4 | { 5 | int32 tcount; /* Temporary cycle counter */ 6 | uint32 PC; 7 | uint8 A,X,Y,S,P,mooPI; 8 | uint8 jammed; 9 | 10 | int32 count; 11 | uint32 IRQlow; /* Simulated IRQ pin held low(or is it high?). 12 | And other junk hooked on for speed reasons.*/ 13 | uint8 DB; /* Data bus "cache" for reads from certain areas */ 14 | 15 | int preexec; /* Pre-exec'ing for debug breakpoints. */ 16 | int cpoint; 17 | 18 | #ifdef WANT_DEBUGGER 19 | void (*CPUHook)(uint32); 20 | uint8 (*ReadHook)(struct __X6502 *, unsigned int); 21 | void (*WriteHook)(struct __X6502 *, unsigned int, uint8); 22 | #endif 23 | } X6502; 24 | #define _X6502STRUCTH 25 | #endif 26 | -------------------------------------------------------------------------------- /mednafen/src/video/png.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_PNG_H 2 | #define __MDFN_PNG_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Mednafen 8 | { 9 | 10 | class PNGWrite 11 | { 12 | public: 13 | 14 | PNGWrite(const std::string& path, const MDFN_Surface *src, const MDFN_Rect &rect, const int32 *LineWidths); 15 | ~PNGWrite(); 16 | 17 | 18 | static void WriteChunk(FileStream &pngfile, uint32 size, const char *type, const uint8 *data); 19 | 20 | private: 21 | 22 | void WriteIt(FileStream &pngfile, const MDFN_Surface *src, const MDFN_Rect &rect, const int32 *LineWidths); 23 | void EncodeImage(const MDFN_Surface *src, const MDFN_PixelFormat &format, const MDFN_Rect &rect, const int32 *LineWidths, const int png_width); 24 | 25 | FileStream ownfile; 26 | std::vector compmem; 27 | std::vector tmp_buffer; 28 | }; 29 | 30 | } 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /mednafen/po/ChangeLog: -------------------------------------------------------------------------------- 1 | 2012-01-03 gettextize 2 | 3 | * Makefile.in.in: Upgrade to gettext-0.18.1. 4 | * Rules-quot: Upgrade to gettext-0.18.1. 5 | 6 | 2009-12-30 gettextize 7 | 8 | * Makefile.in.in: Upgrade to gettext-0.17. 9 | 10 | 2008-06-09 gettextize 11 | 12 | * Makefile.in.in: Upgrade to gettext-0.17. 13 | 14 | 2005-05-18 gettextize 15 | 16 | * Makefile.in.in: New file, from gettext-0.14.1. 17 | * boldquot.sed: New file, from gettext-0.14.1. 18 | * en@boldquot.header: New file, from gettext-0.14.1. 19 | * en@quot.header: New file, from gettext-0.14.1. 20 | * insert-header.sin: New file, from gettext-0.14.1. 21 | * quot.sed: New file, from gettext-0.14.1. 22 | * remove-potcdate.sin: New file, from gettext-0.14.1. 23 | * Rules-quot: New file, from gettext-0.14.1. 24 | 25 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/dsp3/dsp3.cpp: -------------------------------------------------------------------------------- 1 | #include <../base.hpp> 2 | 3 | #define DSP3_CPP 4 | namespace bSNES_v059 { 5 | 6 | DSP3 dsp3; 7 | 8 | namespace DSP3i { 9 | #define bool8 uint8 10 | #include "dsp3emu.c" 11 | #undef bool8 12 | }; 13 | 14 | void DSP3::init() { 15 | } 16 | 17 | void DSP3::enable() { 18 | bus.map(Bus::MapDirect, 0x20, 0x3f, 0x8000, 0xffff, *this); 19 | bus.map(Bus::MapDirect, 0xa0, 0xbf, 0x8000, 0xffff, *this); 20 | } 21 | 22 | void DSP3::power() { 23 | reset(); 24 | } 25 | 26 | void DSP3::reset() { 27 | DSP3i::DSP3_Reset(); 28 | } 29 | 30 | uint8 DSP3::read(unsigned addr) { 31 | DSP3i::dsp3_address = addr & 0xffff; 32 | DSP3i::DSP3GetByte(); 33 | return DSP3i::dsp3_byte; 34 | } 35 | 36 | void DSP3::write(unsigned addr, uint8 data) { 37 | DSP3i::dsp3_address = addr & 0xffff; 38 | DSP3i::dsp3_byte = data; 39 | DSP3i::DSP3SetByte(); 40 | } 41 | 42 | }; 43 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/cpu/scpu/memory/memory.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SCPU_CPP 2 | 3 | void sCPU::op_io() { 4 | status.clock_count = 6; 5 | cycle_edge(); 6 | add_clocks(6); 7 | } 8 | 9 | uint8 sCPU::op_read(uint32 addr) { 10 | status.clock_count = speed(addr); 11 | cycle_edge(); 12 | add_clocks(status.clock_count - 4); 13 | regs.mdr = bus.read(addr); 14 | add_clocks(4); 15 | return regs.mdr; 16 | } 17 | 18 | void sCPU::op_write(uint32 addr, uint8 data) { 19 | status.clock_count = speed(addr); 20 | cycle_edge(); 21 | add_clocks(status.clock_count); 22 | bus.write(addr, regs.mdr = data); 23 | } 24 | 25 | unsigned sCPU::speed(unsigned addr) const { 26 | if(addr & 0x408000) { 27 | if(addr & 0x800000) return status.rom_speed; 28 | return 8; 29 | } 30 | if((addr + 0x6000) & 0x4000) return 8; 31 | if((addr - 0x4000) & 0x7e00) return 6; 32 | return 12; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/180.cpp: -------------------------------------------------------------------------------- 1 | #include "mapinc.h" 2 | 3 | static uint8 latch; 4 | 5 | static void Sync(void) 6 | { 7 | setprg16(0xc000, latch & 0xF); 8 | } 9 | 10 | static DECLFW(Mapper180_write) 11 | { 12 | latch = V & 0xF; 13 | Sync(); 14 | } 15 | 16 | static void Power(CartInfo *info) 17 | { 18 | setchr8(0); 19 | setprg16(0x8000, 0); 20 | latch = 0xF; 21 | Sync(); 22 | } 23 | 24 | static int StateAction(StateMem *sm, int load, int data_only) 25 | { 26 | SFORMAT StateRegs[] = 27 | { SFVAR(latch), SFEND }; 28 | 29 | int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAPR"); 30 | if(load) 31 | Sync(); 32 | return(ret); 33 | } 34 | 35 | int Mapper180_Init(CartInfo *info) 36 | { 37 | SetWriteHandler(0x8000,0xffff,Mapper180_write); 38 | SetReadHandler(0x8000, 0xFFFF, CartBR); 39 | info->Power = Power; 40 | info->StateAction = StateAction; 41 | 42 | return(1); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/94.cpp: -------------------------------------------------------------------------------- 1 | #include "mapinc.h" 2 | 3 | static uint8 latch; 4 | 5 | static void Sync(void) 6 | { 7 | setprg16(0x8000, latch >> 2); 8 | } 9 | 10 | static int StateAction(StateMem *sm, int load, int data_only) 11 | { 12 | SFORMAT StateRegs[] = 13 | { 14 | SFVAR(latch), 15 | SFEND 16 | }; 17 | 18 | int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAPR"); 19 | if(load) 20 | Sync(); 21 | return(ret); 22 | } 23 | 24 | static void Power(CartInfo *info) 25 | { 26 | latch = 0; 27 | setchr8(0); 28 | setprg16(0xc000, 0x3F); 29 | Sync(); 30 | } 31 | 32 | 33 | static DECLFW(Write) 34 | { 35 | latch = V & CartBR(A); 36 | Sync(); 37 | } 38 | 39 | int Mapper94_Init(CartInfo *info) 40 | { 41 | SetWriteHandler(0x8000, 0xFFFF, Write); 42 | SetReadHandler(0x8000, 0xFFFF, CartBR); 43 | info->StateAction = StateAction; 44 | info->Power = Power; 45 | return(1); 46 | } 47 | -------------------------------------------------------------------------------- /mednafen/src/state-driver.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_STATE_DRIVER_H 2 | #define __MDFN_STATE_DRIVER_H 3 | 4 | #include "video.h" 5 | #include "state-common.h" 6 | 7 | namespace Mednafen 8 | { 9 | // 10 | // "fname", when non-NULL, overrides the default save state filename generation. 11 | // "suffix", when non-NULL, just override the default suffix(mc0-mc9). 12 | // 13 | // Returns true on success, false on failure. Error messages outputted via MDFND_PrintError() as usual. 14 | // 15 | bool MDFNI_SaveState(const char *fname, const char *suffix, const MDFN_Surface *surface, const MDFN_Rect *DisplayRect, const int32 *LineWidths) noexcept; 16 | bool MDFNI_LoadState(const char *fname, const char *suffix) noexcept; 17 | 18 | void MDFNI_SelectState(int) noexcept; 19 | 20 | void MDFND_SetStateStatus(StateStatusStruct *status) noexcept; 21 | void MDFND_SetMovieStatus(StateStatusStruct *status) noexcept; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /mednafen/mswin/build-mednafen-win9x.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CROSS_BASE="$HOME/mednafen-cross" 4 | CROSS32_PATH="$CROSS_BASE/win32" 5 | CROSS64_PATH="$CROSS_BASE/win64" 6 | CROSS9X_PATH="$CROSS_BASE/win9x" 7 | export PATH="$CROSS32_PATH/bin:$CROSS64_PATH/bin:$CROSS9X_PATH/bin:$PATH" 8 | 9 | rm --one-file-system -r build9x 10 | mkdir build9x && \ 11 | cd build9x && \ 12 | cp "$CROSS9X_PATH/i486-w64-mingw32/lib/"*.dll . && \ 13 | cp "$CROSS9X_PATH/bin/"*.dll . && \ 14 | PKG_CONFIG_PATH="$CROSS9X_PATH/lib/pkgconfig" PATH="$CROSS9X_PATH/bin:$PATH" CPPFLAGS="-I$CROSS9X_PATH/include -DNTDDI_VERSION=0x0410" LDFLAGS="-L$CROSS9X_PATH/lib -static-libstdc++" CFLAGS="-O2 -march=i686 -mtune=pentium2" CXXFLAGS="$CFLAGS" ../mednafen/configure --host=i486-w64-mingw32 --disable-alsa --disable-jack --enable-threads=win32 --with-sdl-prefix="$CROSS9X_PATH" && \ 15 | make -j4 V=0 && \ 16 | cd .. && \ 17 | # 18 | # 19 | # 20 | echo "Done." 21 | 22 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/70.cpp: -------------------------------------------------------------------------------- 1 | #include "mapinc.h" 2 | 3 | static uint8 latch; 4 | 5 | static void Sync(void) 6 | { 7 | setprg16(0x8000, (latch >> 4) & 0x0f); 8 | setchr8(latch & 0x0F); 9 | } 10 | 11 | static DECLFW(Mapper70_write) 12 | { 13 | latch = V; 14 | Sync(); 15 | } 16 | 17 | static void Power(CartInfo *info) 18 | { 19 | latch = 0; 20 | setprg16(0xc000, 0x0F); 21 | Sync(); 22 | } 23 | 24 | static int StateAction(StateMem *sm, int load, int data_only) 25 | { 26 | SFORMAT StateRegs[] = 27 | { 28 | SFVAR(latch), 29 | SFEND 30 | }; 31 | 32 | int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAPR"); 33 | if(load) 34 | Sync(); 35 | return(ret); 36 | } 37 | 38 | int Mapper70_Init(CartInfo *info) 39 | { 40 | info->Power = Power; 41 | info->StateAction = StateAction; 42 | SetWriteHandler(0x6000,0xffff,Mapper70_write); 43 | SetReadHandler(0x8000, 0xFFFF, CartBR); 44 | 45 | return(1); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/nall/moduloarray.hpp: -------------------------------------------------------------------------------- 1 | #ifndef NALL_MODULO_HPP 2 | #define NALL_MODULO_HPP 3 | 4 | #include 5 | 6 | namespace nall_v059 { 7 | template class modulo_array { 8 | public: 9 | inline T operator[](int index) const { 10 | return buffer[size + index]; 11 | } 12 | 13 | inline T read(int index) const { 14 | return buffer[size + index]; 15 | } 16 | 17 | inline void write(unsigned index, const T value) { 18 | buffer[index] = 19 | buffer[index + size] = 20 | buffer[index + size + size] = value; 21 | } 22 | 23 | void serialize(serializer &s) { 24 | s.array(buffer, size * 3); 25 | } 26 | 27 | modulo_array() { 28 | buffer = new T[size * 3](); 29 | } 30 | 31 | ~modulo_array() { 32 | delete[] buffer; 33 | } 34 | 35 | private: 36 | T *buffer; 37 | }; 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /mednafen/m4/glibc2.m4: -------------------------------------------------------------------------------- 1 | # glibc2.m4 serial 2 2 | dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Test for the GNU C Library, version 2.0 or newer. 8 | # From Bruno Haible. 9 | 10 | AC_DEFUN([gt_GLIBC2], 11 | [ 12 | AC_CACHE_CHECK([whether we are using the GNU C Library 2 or newer], 13 | [ac_cv_gnu_library_2], 14 | [AC_EGREP_CPP([Lucky GNU user], 15 | [ 16 | #include 17 | #ifdef __GNU_LIBRARY__ 18 | #if (__GLIBC__ >= 2) 19 | Lucky GNU user 20 | #endif 21 | #endif 22 | ], 23 | [ac_cv_gnu_library_2=yes], 24 | [ac_cv_gnu_library_2=no]) 25 | ] 26 | ) 27 | AC_SUBST([GLIBC2]) 28 | GLIBC2="$ac_cv_gnu_library_2" 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /mednafen/src/nes/debug.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_NES_DEBUG_H 2 | #define __MDFN_NES_DEBUG_H 3 | 4 | #ifdef WANT_DEBUGGER 5 | 6 | namespace MDFN_IEN_NES 7 | { 8 | #include "x6502struct.h" 9 | 10 | uint32 NESDBG_MemPeek(uint32 A, unsigned int bsize, bool hl, bool logical); 11 | void NESDBG_MemPoke(uint32 A, uint32 V, unsigned int bsize, bool, bool logical); 12 | void NESDBG_IRQ(int level); 13 | uint32 NESDBG_GetVector(int level); 14 | void NESDBG_Disassemble(uint32 &a, uint32 SpecialA, char *); 15 | 16 | void NESDBG_AddBranchTrace(uint32 from, uint32 to, uint32 vector); 17 | 18 | void NESDBG_GetAddressSpaceBytes(const char *name, uint32 Address, uint32 Length, uint8 *Buffer); 19 | void NESDBG_PutAddressSpaceBytes(const char *name, uint32 Address, uint32 Length, uint32 Granularity, bool hl, const uint8 *Buffer); 20 | 21 | bool NESDBG_Init(void) MDFN_COLD; 22 | 23 | MDFN_HIDE extern DebuggerInfoStruct NESDBGInfo; 24 | } 25 | 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /mednafen/src/pce/pce.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_PCE_PCE_H 2 | #define __MDFN_PCE_PCE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace Mednafen; 9 | 10 | namespace MDFN_IEN_PCE 11 | { 12 | 13 | #define PCE_MASTER_CLOCK 21477272.727273 14 | 15 | #define DECLFR(x) MDFN_FASTCALL uint8 x (uint32 A) 16 | #define DECLFW(x) MDFN_FASTCALL void x (uint32 A, uint8 V) 17 | 18 | }; 19 | 20 | #include "huc6280.h" 21 | 22 | namespace MDFN_IEN_PCE 23 | { 24 | MDFN_HIDE extern HuC6280 HuCPU; 25 | 26 | MDFN_HIDE extern uint32 PCE_InDebug; 27 | MDFN_HIDE extern bool PCE_ACEnabled; // Arcade Card emulation enabled? 28 | void PCE_Power(void); 29 | 30 | bool PCE_IsBRAMEnabled(void); 31 | 32 | uint8 PCE_PeekMainRAM(uint32 A); 33 | void PCE_PokeMainRAM(uint32 A, uint8 V); 34 | 35 | uint8 PCE_PeekNaviROM(uint32 A); 36 | void PCE_PokeNaviROM(uint32 A, uint8 V); 37 | 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /mednafen/Documentation/sasplay.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | This module supports playing the SCSP-generated music from most Sega Model 2A, 2B, 2C and 3 games. Model 3 4-channel audio is downmixed to stereo. 7 | Original Model 2 games using the Sega MultiPCM chips are not supported. MPEG music is not supported. 8 |

9 | MAME-style ROM image filenames are expected. A game's ROM image set should be loaded either via ZIP archive, ideally with no extraneous files in the archive, or by 10 | specifying the path of the sound program ROM image. 11 |

12 | Output volume is adjusted on a per-game basis via an internal database. Some games(e.g. "Virtua Fighter 3") also have per-song/composition volume adjustments as well. 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /mednafen/m4/inttypes-h.m4: -------------------------------------------------------------------------------- 1 | # inttypes-h.m4 serial 1 (gettext-0.15) 2 | dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_INTTYPES_H if exists and doesn't clash with 10 | # . 11 | 12 | AC_DEFUN([gl_HEADER_INTTYPES_H], 13 | [ 14 | AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, 15 | [ 16 | AC_TRY_COMPILE( 17 | [#include 18 | #include ], 19 | [], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no) 20 | ]) 21 | if test $gl_cv_header_inttypes_h = yes; then 22 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, 23 | [Define if exists and doesn't clash with .]) 24 | fi 25 | ]) 26 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/sdsp/misc.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SDSP_CPP 2 | 3 | alwaysinline void sDSP::misc_27() { 4 | state.t_pmon = REG(pmon) & ~1; //voice 0 doesn't support PMON 5 | } 6 | 7 | alwaysinline void sDSP::misc_28() { 8 | state.t_non = REG(non); 9 | state.t_eon = REG(eon); 10 | state.t_dir = REG(dir); 11 | } 12 | 13 | alwaysinline void sDSP::misc_29() { 14 | state.every_other_sample ^= 1; 15 | if(state.every_other_sample) { 16 | state.new_kon &= ~state.kon; //clears KON 63 clocks after it was last read 17 | } 18 | } 19 | 20 | alwaysinline void sDSP::misc_30() { 21 | if(state.every_other_sample) { 22 | state.kon = state.new_kon; 23 | state.t_koff = REG(koff); 24 | } 25 | 26 | counter_tick(); 27 | 28 | //noise 29 | if(counter_poll(REG(flg) & 0x1f) == true) { 30 | int feedback = (state.noise << 13) ^ (state.noise << 14); 31 | state.noise = (feedback & 0x4000) ^ (state.noise >> 1); 32 | } 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /mednafen/Documentation/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ../src/mednafen -dump_settings_def settings.def -dump_modules_def modules.def 4 | 5 | # TODO: Dump to settings.def.tmp, and move to settings.def if different for more useful "last modified" time. 6 | 7 | php apple2.php > apple2.html 8 | php cdplay.php > cdplay.html 9 | php gba.php > gba.html 10 | php gb.php > gb.html 11 | php gg.php > gg.html 12 | php lynx.php > lynx.html 13 | php md.php > md.html 14 | php nes.php > nes.html 15 | php ngp.php > ngp.html 16 | php pce.php > pce.html 17 | php pce_fast.php > pce_fast.html 18 | php pcfx.php > pcfx.html 19 | php psx.php > psx.html 20 | php sasplay.php > sasplay.html 21 | php sms.php > sms.html 22 | php snes.php > snes.html 23 | php snes_faust.php > snes_faust.html 24 | php ss.php > ss.html 25 | php ssfplay.php > ssfplay.html 26 | php vb.php > vb.html 27 | php wswan.php > wswan.html 28 | 29 | php netplay.php > netplay.html 30 | 31 | php mednafen.php > mednafen.html 32 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/93.cpp: -------------------------------------------------------------------------------- 1 | #include "mapinc.h" 2 | 3 | static uint8 latch; 4 | 5 | static void Sync(void) 6 | { 7 | setmirror((latch & 1) ? MI_H : MI_V); 8 | setchr8(latch & 0xF); 9 | setprg16(0x8000, (latch >> 4)); 10 | } 11 | 12 | static int StateAction(StateMem *sm, int load, int data_only) 13 | { 14 | SFORMAT StateRegs[] = 15 | { 16 | SFVAR(latch), 17 | SFEND 18 | }; 19 | 20 | int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAPR"); 21 | if(load) 22 | Sync(); 23 | return(ret); 24 | } 25 | 26 | static void Power(CartInfo *info) 27 | { 28 | latch = 0; 29 | setchr8(0); 30 | setprg16(0xc000, 0xF); 31 | Sync(); 32 | } 33 | 34 | 35 | static DECLFW(Write) 36 | { 37 | latch = V; 38 | Sync(); 39 | } 40 | 41 | int Mapper93_Init(CartInfo *info) 42 | { 43 | SetWriteHandler(0x8000, 0xFFFF, Write); 44 | SetReadHandler(0x8000, 0xFFFF, CartBR); 45 | info->StateAction = StateAction; 46 | info->Power = Power; 47 | return(1); 48 | } 49 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/78.cpp: -------------------------------------------------------------------------------- 1 | #include "mapinc.h" 2 | 3 | static uint8 latch; 4 | 5 | static void Sync(void) 6 | { 7 | setprg16(0x8000, latch & 0x7); 8 | setmirror(((latch >> 3) & 1) ? MI_1 : MI_0); 9 | setchr8(latch >> 4); 10 | } 11 | 12 | static DECLFW(Mapper78_write) 13 | { 14 | latch = V; 15 | Sync(); 16 | } 17 | 18 | static void Power(CartInfo *info) 19 | { 20 | latch = 0; 21 | setprg16(0xc000, 0x0F); 22 | Sync(); 23 | } 24 | 25 | static int StateAction(StateMem *sm, int load, int data_only) 26 | { 27 | SFORMAT StateRegs[] = 28 | { 29 | SFVAR(latch), 30 | SFEND 31 | }; 32 | 33 | int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAPR"); 34 | if(load) 35 | Sync(); 36 | return(ret); 37 | } 38 | 39 | int Mapper78_Init(CartInfo *info) 40 | { 41 | info->Power = Power; 42 | info->StateAction = StateAction; 43 | SetWriteHandler(0x8000,0xffff,Mapper78_write); 44 | SetReadHandler(0x8000, 0xFFFF, CartBR); 45 | 46 | return(1); 47 | } 48 | -------------------------------------------------------------------------------- /mednafen/src/hw_sound/sms_apu/Sms_Oscs.h: -------------------------------------------------------------------------------- 1 | // Private oscillators used by Sms_Apu 2 | 3 | // Sms_Snd_Emu 0.1.4 4 | #ifndef SMS_OSCS_H 5 | #define SMS_OSCS_H 6 | 7 | #include 8 | 9 | struct Sms_Osc 10 | { 11 | Blip_Buffer* outputs [4]; // NULL, right, left, center 12 | Blip_Buffer* output; 13 | int output_select; 14 | 15 | int delay; 16 | int last_amp; 17 | int volume; 18 | 19 | Sms_Osc(); 20 | void reset(); 21 | }; 22 | 23 | struct Sms_Square : Sms_Osc 24 | { 25 | int period; 26 | int phase; 27 | 28 | typedef Blip_Synth Synth; 29 | const Synth* synth; 30 | 31 | void reset(); 32 | void run( blip_time_t, blip_time_t ); 33 | }; 34 | 35 | struct Sms_Noise : Sms_Osc 36 | { 37 | const int* period; 38 | unsigned shifter; 39 | unsigned feedback; 40 | 41 | typedef Blip_Synth Synth; 42 | Synth synth; 43 | 44 | void reset(); 45 | void run( blip_time_t, blip_time_t ); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /mednafen/src/nes/NES-TODO: -------------------------------------------------------------------------------- 1 | ************ 2 | **Old TODO**: 3 | ************ 4 | 5 | The following games are broken to some extent: 6 | 7 | Crystalis: Mostly working, but the screen jumps around during 8 | dialogue. It apparently resets the MMC3 IRQ counter 9 | mid-scanline. It'll require low-level PPU and MMC3 10 | IRQ counter emulation to function properly. 11 | 12 | Kickmaster: IRQ occurs a few CPU cycles too late, interferes with NMI routine, 13 | and causes the game to lock up after the second boss. Luckily, there 14 | are passwords, at least. 15 | *"FIXED" BY HACK* 16 | 17 | Star Wars(PAL Beam Software version): 18 | MMC3 IRQ occurs when it shouldn't, similar to the problem in 19 | Kickmaster. 20 | *"FIXED" BY HACK* 21 | 22 | *** Emulation: 23 | 24 | Figure out what mapper 113 really is. 25 | 26 | Sound frame count stuff on PAL games(is it correct?). 27 | 28 | Fix Zapper emulation(one version of Chiller still doesn't always work correctly). 29 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/152.cpp: -------------------------------------------------------------------------------- 1 | #include "mapinc.h" 2 | 3 | static uint8 latch; 4 | 5 | static void Sync(void) 6 | { 7 | setprg16(0x8000, (latch >> 4) & 0x07); 8 | setchr8(latch & 0x0F); 9 | setmirror((latch >> 7) ? MI_1 : MI_0); 10 | } 11 | 12 | static DECLFW(Mapper152_write) 13 | { 14 | latch = V; 15 | Sync(); 16 | } 17 | 18 | static void Power(CartInfo *info) 19 | { 20 | latch = 0; 21 | setprg16(0xc000, 0x07); 22 | Sync(); 23 | } 24 | 25 | static int StateAction(StateMem *sm, int load, int data_only) 26 | { 27 | SFORMAT StateRegs[] = 28 | { 29 | SFVAR(latch), 30 | SFEND 31 | }; 32 | 33 | int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAPR"); 34 | if(load) 35 | Sync(); 36 | return(ret); 37 | } 38 | 39 | int Mapper152_Init(CartInfo *info) 40 | { 41 | info->Power = Power; 42 | info->StateAction = StateAction; 43 | SetWriteHandler(0x6000,0xffff,Mapper152_write); 44 | SetReadHandler(0x8000, 0xFFFF, CartBR); 45 | 46 | return(1); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /mednafen/src/mempatcher.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_MEMPATCHER_H 2 | #define __MDFN_MEMPATCHER_H 3 | 4 | #include "mempatcher-driver.h" 5 | #include "Stream.h" 6 | 7 | namespace Mednafen 8 | { 9 | 10 | // Substitution cheat/patch stuff 11 | struct SUBCHEAT 12 | { 13 | uint32 addr; 14 | uint8 value; 15 | int compare; // < 0 on no compare 16 | }; 17 | 18 | MDFN_HIDE extern std::vector SubCheats[8]; 19 | MDFN_HIDE extern bool SubCheatsOn; 20 | 21 | 22 | void MDFNMP_Init(uint32 ps, uint32 numpages) MDFN_COLD; 23 | void MDFNMP_AddRAM(uint32 size, uint32 address, uint8 *RAM, bool use_in_search = true); // Deprecated 24 | void MDFNMP_RegSearchable(uint32 addr, uint32 size); 25 | void MDFNMP_Kill(void) MDFN_COLD; 26 | 27 | void MDFN_LoadGameCheats(Stream* override = NULL); 28 | void MDFNMP_InstallReadPatches(void); 29 | void MDFNMP_RemoveReadPatches(void); 30 | 31 | void MDFNMP_ApplyPeriodicCheats(void); 32 | 33 | MDFN_HIDE extern const MDFNSetting MDFNMP_Settings[]; 34 | 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /mednafen/src/sound/fir_blargg_config.h: -------------------------------------------------------------------------------- 1 | // Library configuration. Modify this file as necessary. 2 | 3 | #ifndef BLARGG_CONFIG_H 4 | #define BLARGG_CONFIG_H 5 | 6 | // Uncomment to use zlib for transparent decompression of gzipped files 7 | //#define HAVE_ZLIB_H 8 | 9 | // Uncomment to support only the listed game music types. See gme_type_list.cpp 10 | // for a list of all types. 11 | //#define GME_TYPE_LIST gme_nsf_type, gme_gbs_type 12 | 13 | // Uncomment to enable platform-specific optimizations 14 | //#define BLARGG_NONPORTABLE 1 15 | 16 | // Uncomment to use faster, lower quality sound synthesis 17 | //#define BLIP_BUFFER_FAST 1 18 | 19 | // Uncomment if automatic byte-order determination doesn't work 20 | //#define BLARGG_BIG_ENDIAN 1 21 | 22 | // Uncomment if you get errors in the bool section of blargg_common.h 23 | //#define BLARGG_COMPILER_HAS_BOOL 1 24 | 25 | // Use standard config.h if present 26 | #ifdef HAVE_CONFIG_H 27 | #include "config.h" 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /mednafen/m4/glibc21.m4: -------------------------------------------------------------------------------- 1 | # glibc21.m4 serial 4 2 | dnl Copyright (C) 2000-2002, 2004, 2008-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Test for the GNU C Library, version 2.1 or newer. 8 | # From Bruno Haible. 9 | 10 | AC_DEFUN([gl_GLIBC21], 11 | [ 12 | AC_CACHE_CHECK([whether we are using the GNU C Library 2.1 or newer], 13 | [ac_cv_gnu_library_2_1], 14 | [AC_EGREP_CPP([Lucky GNU user], 15 | [ 16 | #include 17 | #ifdef __GNU_LIBRARY__ 18 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) 19 | Lucky GNU user 20 | #endif 21 | #endif 22 | ], 23 | [ac_cv_gnu_library_2_1=yes], 24 | [ac_cv_gnu_library_2_1=no]) 25 | ] 26 | ) 27 | AC_SUBST([GLIBC21]) 28 | GLIBC21="$ac_cv_gnu_library_2_1" 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/emutypes.h: -------------------------------------------------------------------------------- 1 | #ifndef _EMUTYPES_H_ 2 | #define _EMUTYPES_H_ 3 | 4 | #ifndef INLINE 5 | 6 | #if defined(_MSC_VER) 7 | #define INLINE __forceinline 8 | #elif defined(__GNUC__) 9 | #define INLINE __inline__ __attribute__((always_inline)) 10 | #elif defined(_MWERKS_) 11 | #define INLINE inline 12 | #else 13 | #define INLINE 14 | #endif 15 | #endif 16 | 17 | #if defined(EMU_DLL_IMPORTS) 18 | #define EMU2149_DLL_IMPORTS 19 | #define EMU2212_DLL_IMPORTS 20 | #define EMU2413_DLL_IMPORTS 21 | #define EMU8950_DLL_IMPORTS 22 | #define EMU76489_DLL_IMPORTS 23 | #endif 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | typedef unsigned int e_uint; 30 | typedef signed int e_int; 31 | 32 | typedef unsigned char e_uint8 ; 33 | typedef signed char e_int8 ; 34 | 35 | typedef unsigned short e_uint16 ; 36 | typedef signed short e_int16 ; 37 | 38 | typedef unsigned int e_uint32 ; 39 | typedef signed int e_int32 ; 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | #endif 45 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/cpu/scpu/timing/timing.hpp: -------------------------------------------------------------------------------- 1 | enum { 2 | EventNone, 3 | EventIrqLockRelease, 4 | EventAluLockRelease, 5 | EventDramRefresh, 6 | EventHdmaInit, 7 | EventHdmaRun, 8 | 9 | //cycle edge 10 | EventFlagHdmaInit = 1 << 0, 11 | EventFlagHdmaRun = 1 << 1, 12 | }; 13 | unsigned cycle_edge_state; 14 | 15 | //timing.cpp 16 | unsigned dma_counter(); 17 | 18 | void add_clocks(unsigned clocks); 19 | void scanline(); 20 | 21 | alwaysinline void cycle_edge(); 22 | alwaysinline void last_cycle(); 23 | 24 | void timing_power(); 25 | void timing_reset(); 26 | 27 | //irq.cpp 28 | alwaysinline void poll_interrupts(); 29 | void nmitimen_update(uint8 data); 30 | bool rdnmi(); 31 | bool timeup(); 32 | 33 | alwaysinline bool nmi_test(); 34 | alwaysinline bool irq_test(); 35 | 36 | //joypad.cpp 37 | void run_auto_joypad_poll(); 38 | 39 | //event.cpp 40 | void queue_event(unsigned); //priorityqueue callback function 41 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/system/debugger/debugger.hpp: -------------------------------------------------------------------------------- 1 | class Debugger { 2 | public: 3 | enum BreakEvent { 4 | None, 5 | BreakpointHit, 6 | CPUStep, 7 | SMPStep, 8 | } break_event; 9 | 10 | enum { Breakpoints = 8 }; 11 | struct Breakpoint { 12 | bool enabled; 13 | unsigned addr; 14 | signed data; //-1 = unused 15 | enum Mode { Exec, Read, Write } mode; 16 | enum Source { CPUBus, APURAM, VRAM, OAM, CGRAM } source; 17 | unsigned counter; //number of times breakpoint has been hit since being set 18 | } breakpoint[Breakpoints]; 19 | unsigned breakpoint_hit; 20 | void breakpoint_test(Breakpoint::Source source, Breakpoint::Mode mode, unsigned addr, uint8 data); 21 | 22 | bool step_cpu; 23 | bool step_smp; 24 | 25 | enum MemorySource { CPUBus, APURAM, VRAM, OAM, CGRAM }; 26 | uint8 read(MemorySource, unsigned addr); 27 | void write(MemorySource, unsigned addr, uint8 data); 28 | 29 | Debugger(); 30 | }; 31 | 32 | extern Debugger debugger; 33 | -------------------------------------------------------------------------------- /mednafen/src/lynx/license.txt: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2004 K. Wilkins 3 | // 4 | // This software is provided 'as-is', without any express or implied warranty. 5 | // In no event will the authors be held liable for any damages arising from 6 | // the use of this software. 7 | // 8 | // Permission is granted to anyone to use this software for any purpose, 9 | // including commercial applications, and to alter it and redistribute it 10 | // freely, subject to the following restrictions: 11 | // 12 | // 1. The origin of this software must not be misrepresented; you must not 13 | // claim that you wrote the original software. If you use this software 14 | // in a product, an acknowledgment in the product documentation would be 15 | // appreciated but is not required. 16 | // 17 | // 2. Altered source versions must be plainly marked as such, and must not 18 | // be misrepresented as being the original software. 19 | // 20 | // 3. This notice may not be removed or altered from any source distribution. 21 | // -------------------------------------------------------------------------------- /mednafen/m4/intldir.m4: -------------------------------------------------------------------------------- 1 | # intldir.m4 serial 2 (gettext-0.18) 2 | dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | AC_PREREQ([2.52]) 17 | 18 | dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory. 19 | AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], []) 20 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/dsp2/dsp2.hpp: -------------------------------------------------------------------------------- 1 | class DSP2 : public Memory { 2 | public: 3 | struct { 4 | bool waiting_for_command; 5 | unsigned command; 6 | unsigned in_count, in_index; 7 | unsigned out_count, out_index; 8 | 9 | uint8 parameters[512]; 10 | uint8 output[512]; 11 | 12 | uint8 op05transparent; 13 | bool op05haslen; 14 | int op05len; 15 | bool op06haslen; 16 | int op06len; 17 | uint16 op09word1; 18 | uint16 op09word2; 19 | bool op0dhaslen; 20 | int op0doutlen; 21 | int op0dinlen; 22 | } status; 23 | 24 | void init(); 25 | void enable(); 26 | void power(); 27 | void reset(); 28 | 29 | uint8 read(unsigned addr); 30 | void write(unsigned addr, uint8 data); 31 | 32 | void serialize(serializer&); 33 | DSP2(); 34 | ~DSP2(); 35 | 36 | protected: 37 | void op01(); 38 | void op03(); 39 | void op05(); 40 | void op06(); 41 | void op09(); 42 | void op0d(); 43 | }; 44 | 45 | extern DSP2 dsp2; 46 | -------------------------------------------------------------------------------- /mednafen/tests/apple2/decimal/decimal.asm: -------------------------------------------------------------------------------- 1 | ; 2 | ; xa -o decimal.bin decimal.asm && ../bintodsk decimal.bin decimal.dsk 3 | ; 4 | PRBYTE = $FDDA 5 | HOME = $FC58 6 | CROUT = $FD8E 7 | 8 | * = $800 9 | .byte $10 10 | 11 | entry: 12 | jsr HOME 13 | 14 | instr_loop: 15 | jsr init_crc 16 | ; 17 | ; 18 | ; 19 | instridx: ldx #$01 20 | lda instrtab, X 21 | sta instr+0 22 | 23 | lda #$07 24 | sta flags+1 25 | flags_loop: 26 | arg_loop: 27 | accum_loop: 28 | 29 | flags: ldx #$00 30 | lda flagstab, X 31 | pha 32 | accum: lda #$00 33 | plp 34 | instr: adc #$00 35 | php 36 | jsr update_crc 37 | pla 38 | jsr update_crc 39 | 40 | inc accum+1 41 | bne accum_loop 42 | inc instr+1 43 | bne arg_loop 44 | 45 | dec flags+1 46 | bpl flags_loop 47 | 48 | cld 49 | jsr print_crc 50 | 51 | dec instridx+1 52 | bpl instr_loop 53 | 54 | end: 55 | jmp end 56 | 57 | #include "../crc.inc" 58 | 59 | instrtab: 60 | .byte $E9, $69 61 | 62 | flagstab: 63 | .byt $00, $01, $08, $09, $f6, $f7, $fe, $ff 64 | -------------------------------------------------------------------------------- /mednafen/Documentation/pce_fast.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

7 | The "pce_fast" emulation module is an experimental alternative to the pce emulation module. It is 8 | a fork of 0.8.x modified for speed at the expense of (usually) unneeded accuracy(this compares to the "pce" module, 9 | which traded speed away in favor of accuracy). 10 |

11 |

12 | To use this module rather than the "pce" module, you must either set the "pce.enable" setting to "0", or pass 13 | "-force_module pce_fast" to Mednafen each time it is invoked. 14 |

15 |

16 | WARNING: Save states, movies, and netplay are definitely not compatible between the "pce" module and the "pce_fast" module. 17 |

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /mednafen/m4/ulonglong.m4: -------------------------------------------------------------------------------- 1 | # ulonglong.m4 serial 4 2 | dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. 10 | 11 | AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], 12 | [ 13 | AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, 14 | [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], 15 | [unsigned long long ullmax = (unsigned long long) -1; 16 | return ull << i | ull >> i | ullmax / ull | ullmax % ull;], 17 | ac_cv_type_unsigned_long_long=yes, 18 | ac_cv_type_unsigned_long_long=no)]) 19 | if test $ac_cv_type_unsigned_long_long = yes; then 20 | AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, 21 | [Define if you have the 'unsigned long long' type.]) 22 | fi 23 | ]) 24 | -------------------------------------------------------------------------------- /mednafen/src/general.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_GENERAL_H 2 | #define __MDFN_GENERAL_H 3 | 4 | namespace Mednafen 5 | { 6 | 7 | void MDFN_SetBaseDirectory(const std::string& dir); 8 | std::string MDFN_GetBaseDirectory(void); 9 | 10 | void MDFN_SetFileBase(const std::string& dir_path, const std::string& file_base, const std::string& file_ext); 11 | 12 | std::string MDFN_MakeFName(int type, int id1, const char *cd1); 13 | 14 | typedef enum 15 | { 16 | MDFNMKF_STATE = 0, 17 | MDFNMKF_SNAP, 18 | MDFNMKF_SAV, 19 | MDFNMKF_SAVBACK, 20 | MDFNMKF_FIXEDSAV, 21 | MDFNMKF_CHEAT, 22 | MDFNMKF_PALETTE, 23 | MDFNMKF_PATCH, 24 | MDFNMKF_MOVIE, 25 | MDFNMKF_SNAP_DAT, 26 | MDFNMKF_CHEAT_TMP, 27 | MDFNMKF_FIRMWARE, 28 | MDFNMKF_PGCONFIG, 29 | MDFNMKF_PMCONFIG 30 | } MakeFName_Type; 31 | 32 | std::string MDFN_MakeFName(MakeFName_Type type, int id1, const char *cd1); 33 | INLINE std::string MDFN_MakeFName(MakeFName_Type type, int id1, const std::string& cd1) { return MDFN_MakeFName(type, id1, cd1.c_str()); } 34 | 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/vrc7tone.h: -------------------------------------------------------------------------------- 1 | /* VRC7 instruments, January 17, 2004 update -Xodnizel */ 2 | {0x03, 0x21, 0x04, 0x06, 0x8D, 0xF2, 0x42, 0x17}, 3 | {0x13, 0x41, 0x05, 0x0E, 0x99, 0x96, 0x63, 0x12}, 4 | {0x31, 0x11, 0x10, 0x0A, 0xF0, 0x9C, 0x32, 0x02}, 5 | {0x21, 0x61, 0x1D, 0x07, 0x9F, 0x64, 0x20, 0x27}, 6 | {0x22, 0x21, 0x1E, 0x06, 0xF0, 0x76, 0x08, 0x28}, 7 | {0x02, 0x01, 0x06, 0x00, 0xF0, 0xF2, 0x03, 0x95}, 8 | {0x21, 0x61, 0x1C, 0x07, 0x82, 0x81, 0x16, 0x07}, 9 | {0x23, 0x21, 0x1A, 0x17, 0xEF, 0x82, 0x25, 0x15}, 10 | {0x25, 0x11, 0x1F, 0x00, 0x86, 0x41, 0x20, 0x11}, 11 | {0x85, 0x01, 0x1F, 0x0F, 0xE4, 0xA2, 0x11, 0x12}, 12 | {0x07, 0xC1, 0x2B, 0x45, 0xB4, 0xF1, 0x24, 0xF4}, 13 | {0x61, 0x23, 0x11, 0x06, 0x96, 0x96, 0x13, 0x16}, 14 | {0x01, 0x02, 0xD3, 0x05, 0x82, 0xA2, 0x31, 0x51}, 15 | {0x61, 0x22, 0x0D, 0x02, 0xC3, 0x7F, 0x24, 0x05}, 16 | {0x21, 0x62, 0x0E, 0x00, 0xA1, 0xA0, 0x44, 0x17}, 17 | 18 | -------------------------------------------------------------------------------- /mednafen/mswin/package-mednafen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | VERSION=`head -n 1 mednafen/Documentation/modules.def` 3 | 4 | CROSS_BASE="$HOME/mednafen-cross" 5 | CROSS32_PATH="$CROSS_BASE/win32" 6 | CROSS64_PATH="$CROSS_BASE/win64" 7 | CROSS9X_PATH="$CROSS_BASE/win9x" 8 | export PATH="$CROSS64_PATH/bin:$PATH" 9 | 10 | cd build64 && \ 11 | cp src/mednafen.exe . && \ 12 | x86_64-w64-mingw32-strip mednafen.exe && \ 13 | x86_64-w64-mingw32-strip libgcc_s_seh-1.dll libcharset-1.dll libiconv-2.dll SDL2.dll && \ 14 | mkdir -p de/LC_MESSAGES ru/LC_MESSAGES && \ 15 | cp ../mednafen/po/de.gmo de/LC_MESSAGES/mednafen.mo && \ 16 | cp ../mednafen/po/ru.gmo ru/LC_MESSAGES/mednafen.mo && \ 17 | 7za a -mtc- -mx9 -mfb=258 -mpass=15 ../mednafen-"$VERSION"-win64.zip mednafen.exe libgcc_s_seh-1.dll libcharset-1.dll libiconv-2.dll SDL2.dll de/ ru/ && \ 18 | cd ../mednafen && \ 19 | 7za a -mtc- -mx9 -mfb=258 -mpass=15 ../mednafen-"$VERSION"-win64.zip COPYING ChangeLog Documentation/*.html Documentation/*.css Documentation/*.png Documentation/*.txt && \ 20 | cd .. 21 | 22 | -------------------------------------------------------------------------------- /mednafen/src/md/cd/cdc_cdd.cpp: -------------------------------------------------------------------------------- 1 | #include "../shared.h" 2 | #include "cd.h" 3 | #include "cdc_cdd.h" 4 | 5 | void MDCD_CDC_MainWrite8(uint32 A, uint8 V) 6 | { 7 | 8 | } 9 | 10 | 11 | void MDCD_CDC_MainWrite16(uint32 A, uint16 V) 12 | { 13 | 14 | } 15 | 16 | uint8 MDCD_CDC_MainRead8(uint32 A) 17 | { 18 | 19 | return 0; 20 | } 21 | 22 | uint16 MDCD_CDC_MainRead16(uint32 A) 23 | { 24 | 25 | return 0; 26 | } 27 | 28 | 29 | void MDCD_CDC_SubWrite8(uint32 A, uint8 V) 30 | { 31 | 32 | } 33 | 34 | void MDCD_CDC_SubWrite16(uint32 A, uint16 V) 35 | { 36 | 37 | } 38 | 39 | uint8 MDCD_CDC_SubRead8(uint32 A) 40 | { 41 | return 0; 42 | } 43 | 44 | uint16 MDCD_CDC_SubRead16(uint32 A) 45 | { 46 | return 0; 47 | } 48 | 49 | 50 | 51 | 52 | void MDCD_CDD_Write8(uint32 A, uint8 V) 53 | { 54 | 55 | } 56 | 57 | 58 | void MDCD_CDD_Write16(uint32 A, uint16 V) 59 | { 60 | 61 | } 62 | 63 | uint8 MDCD_CDD_Read8(uint32 A) 64 | { 65 | 66 | return 0; 67 | } 68 | 69 | uint16 MDCD_CDD_Read16(uint32 A) 70 | { 71 | 72 | return 0; 73 | } 74 | 75 | -------------------------------------------------------------------------------- /mednafen/m4/stdint_h.m4: -------------------------------------------------------------------------------- 1 | # stdint_h.m4 serial 8 2 | dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_STDINT_H_WITH_UINTMAX if exists, 10 | # doesn't clash with , and declares uintmax_t. 11 | 12 | AC_DEFUN([gl_AC_HEADER_STDINT_H], 13 | [ 14 | AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], 15 | [AC_TRY_COMPILE( 16 | [#include 17 | #include ], 18 | [uintmax_t i = (uintmax_t) -1; return !i;], 19 | [gl_cv_header_stdint_h=yes], 20 | [gl_cv_header_stdint_h=no])]) 21 | if test $gl_cv_header_stdint_h = yes; then 22 | AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], 23 | [Define if exists, doesn't clash with , 24 | and declares uintmax_t. ]) 25 | fi 26 | ]) 27 | -------------------------------------------------------------------------------- /mednafen/src/hw_sound/gb_apu/blargg_config.h: -------------------------------------------------------------------------------- 1 | // $package user configuration file. Don't replace when updating library. 2 | 3 | #ifndef BLARGG_CONFIG_H 4 | #define BLARGG_CONFIG_H 5 | 6 | // Uncomment to have Gb_Apu run at 4x normal clock rate (16777216 Hz), useful in 7 | // a Game Boy Advance emulator. 8 | #define GB_APU_OVERCLOCK 4 9 | 10 | // Uncomment to enable platform-specific (and possibly non-portable) optimizations. 11 | //#define BLARGG_NONPORTABLE 1 12 | 13 | // Uncomment if automatic byte-order determination doesn't work 14 | //#define BLARGG_BIG_ENDIAN 1 15 | 16 | // Uncomment to use zlib for transparent decompression of gzipped files 17 | //#define HAVE_ZLIB_H 18 | 19 | // Uncomment if you get errors in the bool section of blargg_common.h 20 | //#define BLARGG_COMPILER_HAS_BOOL 1 21 | 22 | // Uncomment to disable out-of-memory exceptions 23 | //#include 24 | //#define BLARGG_NEW new (std::nothrow) 25 | 26 | // Use standard config.h if present 27 | #ifdef HAVE_CONFIG_H 28 | #include "config.h" 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/libco/README.md: -------------------------------------------------------------------------------- 1 | # libco 2 | 3 | libco is a cooperative multithreading library written in C89. 4 | 5 | Although cooperative multithreading is limited to a single CPU core, it scales substantially better than preemptive multithreading. 6 | 7 | For applications that need 100,000 or more context switches per second, the kernel overhead involved in preemptive multithreading can end up becoming the bottleneck in the application. libco can easily scale to 10,000,000 or more context switches per second. 8 | 9 | Ideal use cases include servers (HTTP, RDBMS) and emulators (CPU cores, etc.) 10 | 11 | It currently includes backends for: 12 | 13 | * x86 CPUs 14 | * amd64 CPUs 15 | * PowerPC CPUs 16 | * PowerPC64 ELFv1 CPUs 17 | * PowerPC64 ELFv2 CPUs 18 | * ARM 32-bit CPUs 19 | * ARM 64-bit (AArch64) CPUs 20 | * POSIX platforms (setjmp) 21 | * Windows platforms (fibers) 22 | 23 | See [doc/targets.md] for details. 24 | 25 | See [doc/usage.md] for documentation. 26 | 27 | ## License 28 | 29 | libco is released under the ISC license. 30 | -------------------------------------------------------------------------------- /mednafen/tests/apple2/gencrctab.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | uint64_t r = 0; //~(uint64_t)0; 8 | FILE* ofp[8]; 9 | uint64_t table[256]; 10 | 11 | for(unsigned i = 0; i < 8; i++) 12 | { 13 | char fn[64]; 14 | snprintf(fn, sizeof(fn), "crctab-%u.bin", i); 15 | ofp[i] = fopen(fn, "wb"); 16 | } 17 | 18 | for(unsigned i = 0; i < 256; i++) 19 | { 20 | r = (uint64_t)(i) << 56; 21 | for(unsigned b = 8; b; b--) 22 | r = (r << 1) ^ (((int64_t)r >> 63) & 0x42F0E1EBA9EA3693ULL); 23 | 24 | printf("0x%016llx,\n", (unsigned long long)r); 25 | table[i] = r; 26 | for(unsigned j = 0; j < 8; j++) 27 | { 28 | fputc((uint8_t)r, ofp[j]); 29 | r >>= 8; 30 | } 31 | } 32 | 33 | for(unsigned i = 0; i < 8; i++) 34 | { 35 | fclose(ofp[i]); 36 | } 37 | 38 | uint64_t crc64 = ~(uint64_t)0; 39 | 40 | crc64 = (crc64 << 8) ^ table[(crc64 >> 56) ^ 0xAA]; 41 | 42 | printf("0x%016llx\n", (unsigned long long)~crc64); 43 | 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /mednafen/src/pce_fast/pcecd.h: -------------------------------------------------------------------------------- 1 | #ifndef __PCE_CDROM_H 2 | #define __PCE_CDROM_H 3 | 4 | #include 5 | 6 | namespace MDFN_IEN_PCE_FAST 7 | { 8 | 9 | typedef struct 10 | { 11 | float CDDA_Volume; // Max 2.000... 12 | float ADPCM_Volume; // Max 2.000... 13 | 14 | unsigned int CD_Speed; 15 | 16 | bool ADPCM_LPF; 17 | } PCECD_Settings; 18 | 19 | MDFN_FASTCALL void PCECD_Run(uint32 in_timestamp); 20 | void PCECD_ResetTS(void); 21 | 22 | void PCECD_Init(const PCECD_Settings *settings, void (*irqcb)(bool), double master_clock, unsigned int ocm, Blip_Buffer* soundbufs) MDFN_COLD; 23 | bool PCECD_SetSettings(const PCECD_Settings *settings) MDFN_COLD; 24 | void PCECD_Close(void) MDFN_COLD; 25 | void PCECD_Power(uint32 timestamp) MDFN_COLD; 26 | 27 | 28 | MDFN_FASTCALL uint8 PCECD_Read(uint32 timestamp, uint32); 29 | MDFN_FASTCALL void PCECD_Write(uint32 timestamp, uint32, uint8 data); 30 | 31 | bool PCECD_IsBRAMEnabled(void); 32 | 33 | void PCECD_StateAction(StateMem *sm, int load, int data_only); 34 | 35 | } 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /mednafen/src/ss/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = subdir-objects 2 | DEFS = @DEFS@ 3 | AM_CXXFLAGS = @AM_CXXFLAGS@ @SS_EXTRA_FLAGS@ @NO_STACK_PROTECTOR_FLAGS@ 4 | # -Wpedantic 5 | DEFAULT_INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_builddir)/intl 6 | 7 | noinst_LIBRARIES = 8 | 9 | if WANT_SS_EMU 10 | noinst_LIBRARIES += libss.a 11 | endif 12 | 13 | if WANT_SSFPLAY_EMU 14 | noinst_LIBRARIES += libssfplay.a 15 | endif 16 | 17 | libss_a_SOURCES = db.cpp cdb.cpp sound.cpp 18 | libss_a_SOURCES += cart.cpp cart/backup.cpp cart/cs1ram.cpp cart/debug.cpp cart/extram.cpp cart/rom.cpp cart/ar4mp.cpp 19 | libss_a_SOURCES += ss.cpp scu_dsp_gen.cpp scu_dsp_mvi.cpp scu_dsp_jmp.cpp scu_dsp_misc.cpp 20 | libss_a_SOURCES += vdp1.cpp vdp1_line.cpp vdp1_sprite.cpp vdp1_poly.cpp 21 | libss_a_SOURCES += vdp2.cpp vdp2_render.cpp 22 | libss_a_SOURCES += smpc.cpp input/multitap.cpp input/gamepad.cpp input/3dpad.cpp input/mouse.cpp input/wheel.cpp input/mission.cpp input/gun.cpp input/keyboard.cpp input/jpkeyboard.cpp 23 | 24 | libssfplay_a_SOURCES = ssf.cpp 25 | -------------------------------------------------------------------------------- /mednafen/m4/inttypes_h.m4: -------------------------------------------------------------------------------- 1 | # inttypes_h.m4 serial 9 2 | dnl Copyright (C) 1997-2004, 2006, 2008-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Paul Eggert. 8 | 9 | # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, 10 | # doesn't clash with , and declares uintmax_t. 11 | 12 | AC_DEFUN([gl_AC_HEADER_INTTYPES_H], 13 | [ 14 | AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], 15 | [AC_TRY_COMPILE( 16 | [#include 17 | #include ], 18 | [uintmax_t i = (uintmax_t) -1; return !i;], 19 | [gl_cv_header_inttypes_h=yes], 20 | [gl_cv_header_inttypes_h=no])]) 21 | if test $gl_cv_header_inttypes_h = yes; then 22 | AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], 23 | [Define if exists, doesn't clash with , 24 | and declares uintmax_t. ]) 25 | fi 26 | ]) 27 | -------------------------------------------------------------------------------- /mednafen/mswin/gcc-4.9.4-linux-ucontext.patch: -------------------------------------------------------------------------------- 1 | diff -Naur gcc-4.9.4-pure/libgcc/config/i386/linux-unwind.h gcc-4.9.4/libgcc/config/i386/linux-unwind.h 2 | --- gcc-4.9.4-pure/libgcc/config/i386/linux-unwind.h 2014-01-02 14:25:22.000000000 -0800 3 | +++ gcc-4.9.4/libgcc/config/i386/linux-unwind.h 2021-09-26 05:46:54.683945961 -0700 4 | @@ -58,7 +58,7 @@ 5 | if (*(unsigned char *)(pc+0) == 0x48 6 | && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL) 7 | { 8 | - struct ucontext *uc_ = context->cfa; 9 | + ucontext_t *uc_ = context->cfa; 10 | /* The void * cast is necessary to avoid an aliasing warning. 11 | The aliasing warning is correct, but should not be a problem 12 | because it does not alias anything. */ 13 | @@ -138,7 +138,7 @@ 14 | siginfo_t *pinfo; 15 | void *puc; 16 | siginfo_t info; 17 | - struct ucontext uc; 18 | + ucontext_t uc; 19 | } *rt_ = context->cfa; 20 | /* The void * cast is necessary to avoid an aliasing warning. 21 | The aliasing warning is correct, but should not be a problem 22 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/smp/ssmp/serialization.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SSMP_CPP 2 | 3 | void SMP::serialize(serializer &s) { 4 | //SMP::serialize(s); 5 | core_serialize(s); 6 | 7 | s.integer(status.opcode); 8 | s.integer(status.in_opcode); 9 | s.integer(status.clock_counter); 10 | s.integer(status.dsp_counter); 11 | s.integer(status.clock_speed); 12 | s.integer(status.mmio_disabled); 13 | s.integer(status.ram_writable); 14 | s.integer(status.iplrom_enabled); 15 | s.integer(status.dsp_addr); 16 | s.integer(status.smp_f8); 17 | s.integer(status.smp_f9); 18 | 19 | s.integer(t0.target); 20 | s.integer(t0.stage1_ticks); 21 | s.integer(t0.stage2_ticks); 22 | s.integer(t0.stage3_ticks); 23 | s.integer(t0.enabled); 24 | 25 | s.integer(t1.target); 26 | s.integer(t1.stage1_ticks); 27 | s.integer(t1.stage2_ticks); 28 | s.integer(t1.stage3_ticks); 29 | s.integer(t1.enabled); 30 | 31 | s.integer(t2.target); 32 | s.integer(t2.stage1_ticks); 33 | s.integer(t2.stage2_ticks); 34 | s.integer(t2.stage3_ticks); 35 | s.integer(t2.enabled); 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /mednafen/src/nes/sound.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_NES_SOUND_H 2 | #define __MDFN_NES_SOUND_H 3 | 4 | namespace MDFN_IEN_NES 5 | { 6 | 7 | typedef struct __EXPSOUND { 8 | void (*HiFill)(void); 9 | void (*HiSync)(int32 ts); 10 | 11 | void (*Kill)(void); 12 | } EXPSOUND; 13 | 14 | MDFN_HIDE extern std::vector GameExpSound; 15 | 16 | int FlushEmulateSound(int reverse, int16 *SoundBuf, int32 MaxSoundFrames); 17 | 18 | alignas(16) MDFN_HIDE extern int16 WaveHiEx[2 * 40000]; 19 | 20 | MDFN_HIDE extern uint32 soundtsoffs; 21 | #define SOUNDTS (timestamp + soundtsoffs) 22 | 23 | int MDFNSND_Init(bool IsPAL) MDFN_COLD; 24 | void MDFNSND_Close(void) MDFN_COLD; 25 | void MDFNSND_Power(void) MDFN_COLD; 26 | void MDFNSND_Reset(void) MDFN_COLD; 27 | 28 | void MDFN_FASTCALL MDFN_SoundCPUHook(int); 29 | void MDFNSND_StateAction(StateMem *sm, const unsigned load, const bool data_only); 30 | void MDFNNES_SetSoundVolume(uint32 volume) MDFN_COLD; 31 | void MDFNNES_SetSoundMultiplier(double multiplier) MDFN_COLD; 32 | bool MDFNNES_SetSoundRate(double Rate) MDFN_COLD; 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /mednafen/intl/version.c: -------------------------------------------------------------------------------- 1 | /* libintl library version. 2 | Copyright (C) 2005 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #ifdef HAVE_CONFIG_H 20 | # include 21 | #endif 22 | 23 | #include "libgnuintl.h" 24 | 25 | /* Version number: (major<<16) + (minor<<8) + subminor */ 26 | int libintl_version = LIBINTL_VERSION; 27 | -------------------------------------------------------------------------------- /mednafen/src/hw_sound/ym2612/Ym2612_Emu.h: -------------------------------------------------------------------------------- 1 | // YM2612 FM sound chip emulator interface 2 | #ifndef YM2612_EMU_H 3 | #define YM2612_EMU_H 4 | 5 | #include 6 | #include 7 | 8 | namespace Mednafen 9 | { 10 | 11 | struct Ym2612_Impl; 12 | 13 | class Ym2612_Emu { 14 | Ym2612_Impl* impl; 15 | public: 16 | Ym2612_Emu() MDFN_COLD; 17 | ~Ym2612_Emu() MDFN_COLD; 18 | 19 | // Reset to power-up state 20 | void reset() MDFN_COLD; 21 | 22 | // Mute voice n if bit n (1 << n) of mask is set 23 | enum { channel_count = 6 }; 24 | void mute_voices( int mask ); 25 | 26 | // Write addr to register 0 then data to register 1 27 | void write0( int addr, int data ); 28 | 29 | // Write addr to register 2 then data to register 3 30 | void write1( int addr, int data ); 31 | 32 | int read(void); 33 | 34 | // Run and add nt samples into current output buffer contents 35 | typedef short sample_t; 36 | enum { out_chan_count = 2 }; // stereo 37 | void run( sample_t* out ); 38 | 39 | void serialize(Mednafen::LEPacker &slizer, bool load); 40 | }; 41 | 42 | } 43 | #endif 44 | -------------------------------------------------------------------------------- /mednafen/intl/osdep.c: -------------------------------------------------------------------------------- 1 | /* OS dependent parts of libintl. 2 | Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 17 | USA. */ 18 | 19 | #if defined __CYGWIN__ 20 | # include "intl-exports.c" 21 | #elif defined __EMX__ 22 | # include "os2compat.c" 23 | #else 24 | /* Avoid AIX compiler warning. */ 25 | typedef int dummy; 26 | #endif 27 | -------------------------------------------------------------------------------- /mednafen/m4/wint_t.m4: -------------------------------------------------------------------------------- 1 | # wint_t.m4 serial 4 (gettext-0.18) 2 | dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether has the 'wint_t' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_WINT_T], 12 | [ 13 | AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], 14 | [AC_TRY_COMPILE([ 15 | /* Tru64 with Desktop Toolkit C has a bug: must be included before 16 | . 17 | BSD/OS 4.0.1 has a bug: , and must be included 18 | before . */ 19 | #include 20 | #include 21 | #include 22 | #include 23 | wint_t foo = (wchar_t)'\0';], , 24 | [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])]) 25 | if test $gt_cv_c_wint_t = yes; then 26 | AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) 27 | fi 28 | ]) 29 | -------------------------------------------------------------------------------- /mednafen/src/pce_fast/pce.h: -------------------------------------------------------------------------------- 1 | #ifndef _PCE_H 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace Mednafen; 9 | 10 | #define PCE_MASTER_CLOCK 21477272.727273 11 | 12 | #define DECLFR(x) uint8 MDFN_FASTCALL x (uint32 A) 13 | #define DECLFW(x) void MDFN_FASTCALL x (uint32 A, uint8 V) 14 | 15 | namespace MDFN_IEN_PCE_FAST 16 | { 17 | MDFN_HIDE extern uint8 ROMSpace[0x88 * 8192 + 8192]; 18 | 19 | typedef void (MDFN_FASTCALL *writefunc)(uint32 A, uint8 V); 20 | typedef uint8 (MDFN_FASTCALL *readfunc)(uint32 A); 21 | 22 | MDFN_HIDE extern uint8 PCEIODataBuffer; 23 | 24 | void PCE_InitCD(void) MDFN_COLD; 25 | 26 | }; 27 | 28 | #include "huc6280.h" 29 | 30 | namespace MDFN_IEN_PCE_FAST 31 | { 32 | MDFN_HIDE extern bool PCE_ACEnabled; // Arcade Card emulation enabled? 33 | void PCE_Power(void) MDFN_COLD; 34 | 35 | MDFN_HIDE extern int pce_overclocked; 36 | 37 | MDFN_HIDE extern uint8 BaseRAM[32768 + 8192]; 38 | 39 | }; 40 | 41 | using namespace MDFN_IEN_PCE_FAST; 42 | 43 | #define _PCE_H 44 | #endif 45 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/nall/detect.hpp: -------------------------------------------------------------------------------- 1 | #ifndef NALL_DETECT_HPP 2 | #define NALL_DETECT_HPP 3 | 4 | /* Compiler detection */ 5 | 6 | #if defined(__GNUC__) 7 | #define COMPILER_GCC 8 | #elif defined(_MSC_VER) 9 | #define COMPILER_VISUALC 10 | #endif 11 | 12 | /* Platform detection */ 13 | 14 | #if defined(_WIN32) 15 | #define PLATFORM_WIN 16 | #elif defined(__APPLE__) 17 | #define PLATFORM_OSX 18 | #elif defined(linux) || defined(__sun__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 19 | #define PLATFORM_X 20 | #endif 21 | 22 | /* Endian detection */ 23 | 24 | #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 25 | #define ARCH_LSB 26 | #elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 27 | #define ARCH_MSB 28 | #elif defined(__LITTLE_ENDIAN__) 29 | #define ARCH_LSB 30 | #elif defined(__BIG_ENDIAN__) 31 | #define ARCH_MSB 32 | #elif defined(__i386__) || defined(__amd64__) || defined(_M_IX86) || defined(_M_AMD64) 33 | #define ARCH_LSB 34 | #elif defined(__powerpc__) || defined(_M_PPC) 35 | #define ARCH_MSB 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /mednafen/Documentation/md.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Mednafen's Sega Genesis/Megadrive emulation is based off of Genesis Plus and 7 | information and code from Genesis Plus GX(old GPL-licensed version). The GPL-incompatible 8 | CPU and sound emulation cores in the aforementioned projects have been replaced with GPLed or GPL-compatible alternatives; 9 | heavily-modified and improved YM2612 emulation from Gens, and Z80 emulation core from FUSE. 10 |

11 | Sega Genesis/Megadrive emulation should still be considered experimental; there are still likely timing bugs in the 68K 12 | emulation code, the YM2612 emulation code is not particularly accurate, and the VDP code has timing-related issues. 13 |

14 | 15 |

16 | Sega 32X and Sega CD are not currently supported, though there is a bit of stub Sega CD code present currently. 17 |

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /mednafen/src/ngp/T6W28_Oscs.h: -------------------------------------------------------------------------------- 1 | 2 | // Private oscillators used by T6W28_Apu 3 | 4 | // T6W28_Snd_Emu 5 | 6 | #ifndef SMS_OSCS_H 7 | #define SMS_OSCS_H 8 | 9 | #include 10 | 11 | namespace MDFN_IEN_NGP 12 | { 13 | 14 | struct T6W28_Osc 15 | { 16 | Blip_Buffer* outputs [4]; // NULL, right, left, center 17 | Blip_Buffer* output; 18 | int output_select; 19 | 20 | int delay; 21 | int last_amp_left; 22 | int last_amp_right; 23 | 24 | int volume_left; 25 | int volume_right; 26 | 27 | T6W28_Osc(); 28 | void reset(); 29 | }; 30 | 31 | struct T6W28_Square : T6W28_Osc 32 | { 33 | int period; 34 | int phase; 35 | 36 | typedef Blip_Synth Synth; 37 | const Synth* synth; 38 | 39 | void reset(); 40 | void run( sms_time_t, sms_time_t ); 41 | }; 42 | 43 | struct T6W28_Noise : T6W28_Osc 44 | { 45 | const int* period; 46 | int period_extra; 47 | unsigned shifter; 48 | unsigned tap; 49 | 50 | typedef Blip_Synth Synth; 51 | Synth synth; 52 | 53 | void reset(); 54 | void run( sms_time_t, sms_time_t ); 55 | }; 56 | 57 | } 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/lib/libco/libco.c: -------------------------------------------------------------------------------- 1 | #if defined(__clang__) 2 | #pragma clang diagnostic ignored "-Wparentheses" 3 | 4 | /* placing code in section(text) does not mark it executable with Clang. */ 5 | #undef LIBCO_MPROTECT 6 | #define LIBCO_MPROTECT 7 | #endif 8 | 9 | #if defined(__clang__) || defined(__GNUC__) 10 | #if defined(__i386__) 11 | #include "x86.c" 12 | #elif defined(__amd64__) 13 | #include "amd64.c" 14 | #elif defined(__arm__) 15 | #include "arm.c" 16 | #elif defined(__aarch64__) 17 | #include "aarch64.c" 18 | #elif defined(__powerpc64__) && defined(_CALL_ELF) && _CALL_ELF == 2 19 | #include "ppc64v2.c" 20 | #elif defined(_ARCH_PPC) && !defined(__LITTLE_ENDIAN__) 21 | #include "ppc.c" 22 | #elif defined(_WIN32) 23 | #include "fiber.c" 24 | #else 25 | #include "sjlj.c" 26 | #endif 27 | #elif defined(_MSC_VER) 28 | #if defined(_M_IX86) 29 | #include "x86.c" 30 | #elif defined(_M_AMD64) 31 | #include "amd64.c" 32 | #else 33 | #include "fiber.c" 34 | #endif 35 | #else 36 | #error "libco: unsupported processor, compiler or operating system" 37 | #endif 38 | -------------------------------------------------------------------------------- /mednafen/src/nes/boards/184.cpp: -------------------------------------------------------------------------------- 1 | #include "mapinc.h" 2 | 3 | static uint8 latch; 4 | static bool fzalt; 5 | 6 | static void Sync(void) 7 | { 8 | if(fzalt) 9 | { 10 | setprg16(0x8000, latch & 0x7); 11 | } 12 | else 13 | { 14 | setchr4(0x0000, latch & 0x7); 15 | setchr4(0x1000, (latch >> 4) & 0x7); 16 | } 17 | } 18 | 19 | static DECLFW(Mapper184_write) 20 | { 21 | latch = V & 0x77; 22 | Sync(); 23 | } 24 | 25 | static void Power(CartInfo *info) 26 | { 27 | latch = 0; 28 | setchr8(0); 29 | setprg32(0x8000, ~0U); 30 | Sync(); 31 | } 32 | 33 | static int StateAction(StateMem *sm, int load, int data_only) 34 | { 35 | SFORMAT StateRegs[] = 36 | { 37 | SFVAR(latch), 38 | SFEND 39 | }; 40 | 41 | int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAPR"); 42 | if(load) 43 | Sync(); 44 | return(ret); 45 | } 46 | 47 | int Mapper184_Init(CartInfo *info) 48 | { 49 | fzalt = (CHRsize[0] <= 8192 && PRGsize[0] > 32768); 50 | 51 | SetWriteHandler(0x6000, 0x7FFF, Mapper184_write); 52 | SetReadHandler(0x8000, 0xFFFF, CartBR); 53 | 54 | info->Power = Power; 55 | info->StateAction = StateAction; 56 | 57 | return(1); 58 | } 59 | 60 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/chip/st010/st010.hpp: -------------------------------------------------------------------------------- 1 | class ST010 : public Memory { 2 | public: 3 | void init(); 4 | void enable(); 5 | void power(); 6 | void reset(); 7 | 8 | uint8 read(unsigned addr); 9 | void write(unsigned addr, uint8 data); 10 | 11 | void serialize(serializer&); 12 | 13 | private: 14 | uint8 ram[0x1000]; 15 | static const int16 sin_table[256]; 16 | static const int16 mode7_scale[176]; 17 | static const uint8 arctan[32][32]; 18 | 19 | //interfaces to sin table 20 | int16 sin(int16 theta); 21 | int16 cos(int16 theta); 22 | 23 | //interfaces to ram buffer 24 | uint8 readb (uint16 addr); 25 | uint16 readw (uint16 addr); 26 | uint32 readd (uint16 addr); 27 | void writeb(uint16 addr, uint8 data); 28 | void writew(uint16 addr, uint16 data); 29 | void writed(uint16 addr, uint32 data); 30 | 31 | //opcodes 32 | void op_01(); 33 | void op_02(); 34 | void op_03(); 35 | void op_04(); 36 | void op_05(); 37 | void op_06(); 38 | void op_07(); 39 | void op_08(); 40 | 41 | void op_01(int16 x0, int16 y0, int16 &x1, int16 &y1, int16 &quadrant, int16 &theta); 42 | }; 43 | 44 | extern ST010 st010; 45 | -------------------------------------------------------------------------------- /mednafen/src/pce/huc.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_PCE_HUC_H 2 | #define __MDFN_PCE_HUC_H 3 | 4 | namespace MDFN_IEN_PCE 5 | { 6 | 7 | typedef enum 8 | { 9 | SYSCARD_NONE = 0, 10 | SYSCARD_1, 11 | SYSCARD_2, 12 | SYSCARD_3, 13 | SYSCARD_ARCADE // 3.0 + extras 14 | } SysCardType; 15 | 16 | uint32 HuC_Load(Stream* s, bool DisableBRAM = false, SysCardType syscard = SYSCARD_NONE) MDFN_COLD; 17 | void HuC_SaveNV(void); 18 | void HuC_Kill(void) MDFN_COLD; 19 | 20 | void HuC_Update(int32 timestamp); 21 | void HuC_ResetTS(int32 ts_base); 22 | 23 | void HuC_StateAction(StateMem *sm, const unsigned load, const bool data_only); 24 | 25 | void HuC_Power(void); 26 | 27 | DECLFR(PCE_ACRead); 28 | DECLFW(PCE_ACWrite); 29 | 30 | MDFN_HIDE extern bool PCE_IsCD; 31 | MDFN_HIDE extern bool IsTsushin; 32 | 33 | // Debugger support functions. 34 | uint8 HuC_PeekHuCROM(uint32 A); 35 | void HuC_PokeHuCROM(uint32 A, uint8 V); 36 | 37 | bool HuC_IsBRAMAvailable(void); 38 | uint8 HuC_PeekBRAM(uint32 A); 39 | void HuC_PokeBRAM(uint32 A, uint8 V); 40 | 41 | bool HuC_IsMB128Available(void); 42 | uint8 HuC_PeekMB128(uint32 A); 43 | void HuC_PokeMB128(uint32 A, uint8 V); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /mednafen/intl/ref-del.sin: -------------------------------------------------------------------------------- 1 | # Remove this package from a list of references stored in a text file. 2 | # 3 | # Copyright (C) 2000 Free Software Foundation, Inc. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Library General Public License as published 7 | # by the Free Software Foundation; either version 2, or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Library General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Library General Public 16 | # License along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | # USA. 19 | # 20 | # Written by Bruno Haible . 21 | # 22 | /^# Packages using this file: / { 23 | s/# Packages using this file:// 24 | s/ @PACKAGE@ / / 25 | s/^/# Packages using this file:/ 26 | } 27 | -------------------------------------------------------------------------------- /mednafen/src/drivers/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = subdir-objects 2 | DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ @SDL_CFLAGS@ 3 | DEFAULT_INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_builddir)/intl 4 | 5 | noinst_LIBRARIES = libmdfnsdl.a 6 | 7 | libmdfnsdl_a_SOURCES = main.cpp args.cpp help.cpp ers.cpp sound.cpp netplay.cpp 8 | 9 | libmdfnsdl_a_SOURCES += input.cpp mouse.cpp keyboard.cpp 10 | libmdfnsdl_a_SOURCES += Joystick.cpp Joystick_SDL.cpp 11 | 12 | if HAVE_LINUX_JOYSTICK 13 | libmdfnsdl_a_SOURCES += Joystick_Linux.cpp 14 | endif 15 | 16 | if WIN32 17 | libmdfnsdl_a_SOURCES += Joystick_XInput.cpp 18 | libmdfnsdl_a_SOURCES += Joystick_DX5.cpp 19 | endif 20 | 21 | libmdfnsdl_a_SOURCES += TextEntry.cpp console.cpp cheat.cpp fps.cpp video-state.cpp remote.cpp rmdui.cpp 22 | 23 | libmdfnsdl_a_SOURCES += opengl.cpp shader.cpp nongl.cpp nnx.cpp video.cpp 24 | 25 | if WANT_FANCY_SCALERS 26 | libmdfnsdl_a_SOURCES += hqxx-common.cpp hq2x.cpp hq3x.cpp hq4x.cpp scale2x.c scale3x.c scalebit.c 2xSaI.cpp 27 | endif 28 | 29 | if WANT_DEBUGGER 30 | libmdfnsdl_a_SOURCES += debugger.cpp gfxdebugger.cpp memdebugger.cpp logdebugger.cpp prompt.cpp 31 | endif 32 | -------------------------------------------------------------------------------- /mednafen/src/snes_faust/ppu_common.h: -------------------------------------------------------------------------------- 1 | snes_event_handler PPU_GetEventHandler(void) MDFN_COLD; 2 | snes_event_handler PPU_GetLineIRQEventHandler(void) MDFN_COLD; 3 | void PPU_SetGetVideoParams(MDFNGI* gi, const unsigned caspect, const unsigned hfilter, const unsigned sls, const unsigned sle) MDFN_COLD; 4 | void PPU_Kill(void) MDFN_COLD; 5 | void PPU_Reset(bool powering_up) MDFN_COLD; 6 | void PPU_ResetTS(void); 7 | 8 | void PPU_StateAction(StateMem* sm, const unsigned load, const bool data_only); 9 | 10 | void PPU_StartFrame(EmulateSpecStruct* espec); 11 | // 12 | // 13 | // 14 | uint16 PPU_PeekVRAM(uint32 addr) MDFN_COLD; 15 | uint16 PPU_PeekCGRAM(uint32 addr) MDFN_COLD; 16 | uint8 PPU_PeekOAM(uint32 addr) MDFN_COLD; 17 | uint8 PPU_PeekOAMHI(uint32 addr) MDFN_COLD; 18 | uint32 PPU_GetRegister(const unsigned id, char* const special, const uint32 special_len) MDFN_COLD; 19 | 20 | void PPU_PokeVRAM(uint32 addr, uint16 val) MDFN_COLD; 21 | void PPU_PokeCGRAM(uint32 addr, uint16 val) MDFN_COLD; 22 | void PPU_PokeOAM(uint32 addr, uint8 val) MDFN_COLD; 23 | void PPU_PokeOAMHI(uint32 addr, uint8 val) MDFN_COLD; 24 | void PPU_SetRegister(const unsigned id, const uint32 value) MDFN_COLD; 25 | 26 | -------------------------------------------------------------------------------- /mednafen/src/sexyal/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = subdir-objects 2 | DEFS = @DEFS@ @SDL_CFLAGS@ @ALSA_CFLAGS@ @JACK_CFLAGS@ 3 | DEFAULT_INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_builddir)/intl 4 | 5 | noinst_LIBRARIES = libsexyal.a 6 | 7 | libsexyal_a_SOURCES = sexyal.cpp convert.cpp drivers/dummy.cpp 8 | 9 | if HAVE_DIRECTSOUND 10 | TMP_DIRECTSOUND = drivers/dsound.cpp 11 | endif 12 | 13 | if HAVE_WASAPI 14 | TMP_WASAPI = drivers/wasapi.cpp drivers/wasapish.cpp 15 | endif 16 | 17 | if HAVE_OSSDSP 18 | TMP_OSSDSP = drivers/oss.cpp 19 | endif 20 | 21 | if HAVE_OPENBSD_AUDIO 22 | TMP_OPENBSD = drivers/openbsd.cpp 23 | endif 24 | 25 | if HAVE_JACK 26 | TMP_JACK = drivers/jack.cpp 27 | endif 28 | 29 | if HAVE_SDL 30 | TMP_SDL = drivers/sdl.cpp 31 | libsexyal_a_CFLAGS = @SDL_CFLAGS@ 32 | endif 33 | 34 | if HAVE_ALSA 35 | TMP_ALSA = drivers/alsa.cpp 36 | endif 37 | 38 | if DOS 39 | TMP_DOS = drivers/dos_common.cpp drivers/cmi8738.cpp drivers/es1370.cpp drivers/es1371.cpp drivers/sb.cpp 40 | endif 41 | 42 | libsexyal_a_SOURCES += $(TMP_DIRECTSOUND) $(TMP_WASAPI) $(TMP_OSSDSP) $(TMP_OPENBSD) $(TMP_JACK) $(TMP_SDL) $(TMP_ALSA) $(TMP_DOS) 43 | -------------------------------------------------------------------------------- /mednafen/src/snes/src/cpu/scpu/timing/event.cpp: -------------------------------------------------------------------------------- 1 | #ifdef SCPU_CPP 2 | 3 | void sCPU::queue_event(unsigned id) { 4 | switch(id) { 5 | //interrupts triggered during (H)DMA do not trigger immediately after 6 | case EventIrqLockRelease: { 7 | status.irq_lock = false; 8 | } break; 9 | 10 | //ALU multiplication / division results are not immediately calculated; 11 | //the exact formula for the calculations are unknown, but this lock at least 12 | //allows emulation to avoid returning to fully computed results too soon. 13 | case EventAluLockRelease: { 14 | status.alu_lock = false; 15 | } break; 16 | 17 | //S-CPU WRAM consists of two 64kbyte DRAM chips, which must be refreshed 18 | //once per scanline to avoid memory decay. 19 | case EventDramRefresh: { 20 | add_clocks(40); 21 | } break; 22 | 23 | //HDMA init routine; occurs once per frame 24 | case EventHdmaInit: { 25 | cycle_edge_state |= EventFlagHdmaInit; 26 | } break; 27 | 28 | //HDMA run routine; occurs once per scanline 29 | case EventHdmaRun: { 30 | cycle_edge_state |= EventFlagHdmaRun; 31 | } break; 32 | } 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /mednafen/src/drivers/input.h: -------------------------------------------------------------------------------- 1 | #ifndef __MDFN_DRIVERS_INPUT_H 2 | #define __MDFN_DRIVERS_INPUT_H 3 | 4 | enum : uint8 5 | { 6 | BUTTC_NONE = 0, // Must be zero. 7 | BUTTC_KEYBOARD, 8 | BUTTC_JOYSTICK, 9 | BUTTC_MOUSE 10 | }; 11 | 12 | enum : uint8 13 | { 14 | BUTTC_FLAG_09XDEVID = 0x01, 15 | }; 16 | 17 | struct ButtConfig 18 | { 19 | INLINE constexpr ButtConfig() : DeviceType(BUTTC_NONE), DeviceNum(0), ANDGroupCont(false), Flags(0), ButtonNum(0), Scale(0), DeviceID({0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}) { } 20 | uint8 DeviceType; 21 | uint8 DeviceNum; 22 | int8 ANDGroupCont; 23 | uint8 Flags; 24 | uint16 ButtonNum; 25 | uint16 Scale; 26 | std::array DeviceID; 27 | }; 28 | 29 | void Input_Event(const SDL_Event* event); 30 | 31 | void Input_GameLoaded(MDFNGI* gi) MDFN_COLD; 32 | void Input_GameClosed(void) MDFN_COLD; 33 | 34 | void Input_Update(bool VirtualDevicesOnly = false, bool UpdateRapidFire = true); 35 | 36 | void Input_MakeSettings(void); 37 | 38 | void Input_NetplayLPMChanged(void); 39 | 40 | MDFN_HIDE extern bool DNeedRewind; // Only read/write in game thread(or before creating game thread). 41 | MDFN_HIDE extern bool RewindState; // " " " " 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /mednafen/src/gba/sram.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 | // Copyright (C) 1999-2003 Forgotten 4 | // Copyright (C) 2004 Forgotten and the VBA development team 5 | 6 | // This program is free software; you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation; either version 2, or(at your option) 9 | // any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program; if not, write to the Free Software Foundation, 18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | 20 | #ifndef VBA_SRAM_H 21 | #define VBA_SRAM_H 22 | 23 | namespace MDFN_IEN_GBA 24 | { 25 | 26 | uint8 sramRead(uint32 address); 27 | void sramWrite(uint32 address, uint8 byte); 28 | 29 | } 30 | 31 | #endif // VBA_SRAM_H 32 | --------------------------------------------------------------------------------