├── .editorconfig ├── .gitattributes ├── .github └── FUNDING.yml ├── .gitignore ├── COMPILING.md ├── Core ├── AluMulDiv.cpp ├── AluMulDiv.h ├── Assembler.cpp ├── Assembler.h ├── BaseCartridge.cpp ├── BaseCartridge.h ├── BaseControlDevice.cpp ├── BaseControlDevice.h ├── BaseCoprocessor.h ├── BaseEventManager.h ├── BaseRenderer.cpp ├── BaseRenderer.h ├── BaseSoundManager.cpp ├── BaseSoundManager.h ├── BaseVideoFilter.cpp ├── BaseVideoFilter.h ├── BatteryManager.cpp ├── BatteryManager.h ├── Breakpoint.cpp ├── Breakpoint.h ├── BreakpointManager.cpp ├── BreakpointManager.h ├── BsxCart.cpp ├── BsxCart.h ├── BsxMemoryPack.cpp ├── BsxMemoryPack.h ├── BsxSatellaview.cpp ├── BsxSatellaview.h ├── BsxStream.cpp ├── BsxStream.h ├── CallstackManager.cpp ├── CallstackManager.h ├── CartTypes.h ├── CheatManager.cpp ├── CheatManager.h ├── ClientConnectionData.h ├── CodeDataLogger.cpp ├── CodeDataLogger.h ├── Console.cpp ├── Console.h ├── ConsoleLock.cpp ├── ConsoleLock.h ├── ControlDeviceState.h ├── ControlManager.cpp ├── ControlManager.h ├── Core.vcxproj ├── Core.vcxproj.filters ├── Cpu.Instructions.h ├── Cpu.Shared.h ├── Cpu.cpp ├── Cpu.h ├── CpuBwRamHandler.h ├── CpuDebugger.cpp ├── CpuDebugger.h ├── CpuDisUtils.cpp ├── CpuDisUtils.h ├── CpuTypes.h ├── Cx4.Instructions.cpp ├── Cx4.cpp ├── Cx4.h ├── Cx4Debugger.cpp ├── Cx4Debugger.h ├── Cx4DisUtils.cpp ├── Cx4DisUtils.h ├── Cx4Types.h ├── DebugBreakHelper.h ├── DebugHud.cpp ├── DebugHud.h ├── DebugStats.cpp ├── DebugStats.h ├── DebugTypes.h ├── DebugUtilities.h ├── Debugger.cpp ├── Debugger.h ├── DefaultVideoFilter.cpp ├── DefaultVideoFilter.h ├── Disassembler.cpp ├── Disassembler.h ├── DisassemblyInfo.cpp ├── DisassemblyInfo.h ├── DmaController.cpp ├── DmaController.h ├── DmaControllerTypes.h ├── DrawCommand.h ├── DrawLineCommand.h ├── DrawPixelCommand.h ├── DrawRectangleCommand.h ├── DrawScreenBufferCommand.h ├── DrawStringCommand.h ├── DummyCpu.h ├── DummySpc.h ├── EmuSettings.cpp ├── EmuSettings.h ├── EventManager.cpp ├── EventManager.h ├── EventType.h ├── ExpressionEvaluator.cpp ├── ExpressionEvaluator.h ├── FirmwareHelper.h ├── ForceDisconnectMessage.h ├── FrameLimiter.h ├── GameClient.cpp ├── GameClient.h ├── GameClientConnection.cpp ├── GameClientConnection.h ├── GameConnection.cpp ├── GameConnection.h ├── GameInformationMessage.h ├── GameServer.cpp ├── GameServer.h ├── GameServerConnection.cpp ├── GameServerConnection.h ├── Gameboy.cpp ├── Gameboy.h ├── GameboyDisUtils.cpp ├── GameboyDisUtils.h ├── GameboyHeader.h ├── GbApu.cpp ├── GbApu.h ├── GbAssembler.cpp ├── GbAssembler.h ├── GbBootRom.h ├── GbCart.h ├── GbCartFactory.h ├── GbCpu.cpp ├── GbCpu.h ├── GbDebugger.cpp ├── GbDebugger.h ├── GbDmaController.cpp ├── GbDmaController.h ├── GbEventManager.cpp ├── GbEventManager.h ├── GbMbc1.h ├── GbMbc2.h ├── GbMbc3.h ├── GbMbc5.h ├── GbMemoryManager.cpp ├── GbMemoryManager.h ├── GbNoiseChannel.cpp ├── GbNoiseChannel.h ├── GbPpu.cpp ├── GbPpu.h ├── GbSquareChannel.cpp ├── GbSquareChannel.h ├── GbTimer.cpp ├── GbTimer.h ├── GbTypes.h ├── GbWaveChannel.cpp ├── GbWaveChannel.h ├── Gsu.Instructions.cpp ├── Gsu.cpp ├── Gsu.h ├── GsuDebugger.cpp ├── GsuDebugger.h ├── GsuDisUtils.cpp ├── GsuDisUtils.h ├── GsuRamHandler.h ├── GsuRomHandler.h ├── GsuTypes.h ├── HandShakeMessage.h ├── IAssembler.h ├── IAudioDevice.h ├── IDebugger.h ├── IInputProvider.h ├── IInputRecorder.h ├── IKeyManager.h ├── IMemoryHandler.h ├── IMessageManager.h ├── INotificationListener.h ├── IRenderingDevice.h ├── InputDataMessage.h ├── InputHud.cpp ├── InputHud.h ├── InternalRegisterTypes.h ├── InternalRegisters.cpp ├── InternalRegisters.h ├── KeyManager.cpp ├── KeyManager.h ├── LabelManager.cpp ├── LabelManager.h ├── LuaApi.cpp ├── LuaApi.h ├── LuaCallHelper.cpp ├── LuaCallHelper.h ├── LuaScriptingContext.cpp ├── LuaScriptingContext.h ├── MemoryAccessCounter.cpp ├── MemoryAccessCounter.h ├── MemoryDumper.cpp ├── MemoryDumper.h ├── MemoryManager.cpp ├── MemoryManager.h ├── MemoryMappings.cpp ├── MemoryMappings.h ├── MesenMovie.cpp ├── MesenMovie.h ├── MessageManager.cpp ├── MessageManager.h ├── MessageType.h ├── MovieDataMessage.h ├── MovieManager.cpp ├── MovieManager.h ├── MovieRecorder.cpp ├── MovieRecorder.h ├── MovieTypes.h ├── Msu1.cpp ├── Msu1.h ├── Multitap.cpp ├── Multitap.h ├── NecDsp.cpp ├── NecDsp.h ├── NecDspDebugger.cpp ├── NecDspDebugger.h ├── NecDspDisUtils.cpp ├── NecDspDisUtils.h ├── NecDspTypes.h ├── NetMessage.h ├── NotificationManager.cpp ├── NotificationManager.h ├── NtscFilter.cpp ├── NtscFilter.h ├── Obc1.cpp ├── Obc1.h ├── PcmReader.cpp ├── PcmReader.h ├── PlayerListMessage.h ├── Ppu.cpp ├── Ppu.h ├── PpuTools.cpp ├── PpuTools.h ├── PpuTypes.h ├── Profiler.cpp ├── Profiler.h ├── RamHandler.h ├── RecordedRomTest.cpp ├── RecordedRomTest.h ├── RegisterHandlerA.h ├── RegisterHandlerB.cpp ├── RegisterHandlerB.h ├── RewindData.cpp ├── RewindData.h ├── RewindManager.cpp ├── RewindManager.h ├── RomFinder.h ├── RomHandler.h ├── Rtc4513.cpp ├── Rtc4513.h ├── SPC_DSP.cpp ├── SPC_DSP.h ├── SPC_Filter.cpp ├── SPC_Filter.h ├── Sa1.cpp ├── Sa1.h ├── Sa1BwRamHandler.h ├── Sa1Cpu.cpp ├── Sa1Cpu.h ├── Sa1IRamHandler.h ├── Sa1Types.h ├── Sa1VectorHandler.h ├── SaveStateManager.cpp ├── SaveStateManager.h ├── SaveStateMessage.h ├── ScaleFilter.cpp ├── ScaleFilter.h ├── ScriptHost.cpp ├── ScriptHost.h ├── ScriptManager.cpp ├── ScriptManager.h ├── ScriptingContext.cpp ├── ScriptingContext.h ├── Sdd1.cpp ├── Sdd1.h ├── Sdd1Decomp.cpp ├── Sdd1Decomp.h ├── Sdd1Mmc.cpp ├── Sdd1Mmc.h ├── Sdd1Types.h ├── SelectControllerMessage.h ├── ServerInformationMessage.h ├── SettingTypes.h ├── ShortcutKeyHandler.cpp ├── ShortcutKeyHandler.h ├── SnesController.cpp ├── SnesController.h ├── SnesMemoryType.h ├── SnesMouse.h ├── SoundMixer.cpp ├── SoundMixer.h ├── SoundResampler.cpp ├── SoundResampler.h ├── Spc.Instructions.cpp ├── Spc.cpp ├── Spc.h ├── Spc7110.cpp ├── Spc7110.h ├── Spc7110Decomp.cpp ├── Spc7110Decomp.h ├── SpcDebugger.cpp ├── SpcDebugger.h ├── SpcDisUtils.cpp ├── SpcDisUtils.h ├── SpcFileData.h ├── SpcHud.cpp ├── SpcHud.h ├── SpcTimer.h ├── SpcTypes.h ├── SuperGameboy.cpp ├── SuperGameboy.h ├── SuperScope.h ├── SystemActionManager.h ├── TraceLogger.cpp ├── TraceLogger.h ├── VideoDecoder.cpp ├── VideoDecoder.h ├── VideoRenderer.cpp ├── VideoRenderer.h ├── WaveRecorder.cpp ├── WaveRecorder.h ├── blargg_common.h ├── blargg_config.h ├── blargg_endian.h ├── blargg_source.h ├── stdafx.cpp └── stdafx.h ├── Dependencies ├── DirectXTK.Debug.Static.x64.lib ├── DirectXTK.Debug.Static.x86.lib ├── DirectXTK.Release.Static.x64.lib └── DirectXTK.Release.Static.x86.lib ├── DependencyPacker ├── DependencyPacker.csproj ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── Docs ├── README.md ├── build.cmd ├── config.toml ├── content │ ├── _index.md │ ├── apireference │ │ ├── Callbacks.md │ │ ├── Changelog.md │ │ ├── Drawing.md │ │ ├── Emulation.md │ │ ├── Enums.md │ │ ├── Input.md │ │ ├── Logging.md │ │ ├── MemoryAccess.md │ │ ├── Misc.md │ │ └── _index.md │ ├── configuration │ │ ├── Audio.md │ │ ├── Emulation.md │ │ ├── GameBoy.md │ │ ├── Input.md │ │ ├── Preferences.md │ │ ├── Video.md │ │ └── _index.md │ ├── debugging │ │ ├── Assembler.md │ │ ├── DebugLog.md │ │ ├── Debugger.md │ │ ├── DebuggerIntegration.md │ │ ├── EventViewer.md │ │ ├── MemoryTools.md │ │ ├── PerformanceProfiler.md │ │ ├── PpuViewers.md │ │ ├── RegisterViewer.md │ │ ├── ScriptWindow.md │ │ ├── TraceLogger.md │ │ └── _index.md │ ├── gettingstarted │ │ └── _index.md │ └── tools │ │ └── _index.md ├── static │ ├── css │ │ └── custom.css │ └── images │ │ ├── Assembler.png │ │ ├── AudioOptions_Advanced.png │ │ ├── AudioOptions_General.png │ │ ├── BMC-btn-logo.svg │ │ ├── BreakpointList.png │ │ ├── CallStack.png │ │ ├── CheatDbImport.png │ │ ├── CheatList.png │ │ ├── CodeWindow.png │ │ ├── ConfigWizard.png │ │ ├── DebugLog.png │ │ ├── DebuggerWindow.png │ │ ├── EditBreakpoint.png │ │ ├── EditCheat.png │ │ ├── EditLabel.png │ │ ├── EmulationSettings_Advanced.png │ │ ├── EmulationSettings_Bsx.png │ │ ├── EmulationSettings_General.png │ │ ├── EmulationSettings_Overclocking.png │ │ ├── EmulationStatus.png │ │ ├── EventViewer.png │ │ ├── EventViewer_ListView.png │ │ ├── GameMenu.png │ │ ├── GameSelectionScreen.png │ │ ├── Gameboy_Audio.png │ │ ├── Gameboy_General.png │ │ ├── Gameboy_Video.png │ │ ├── GoToAll.png │ │ ├── ImportExportMenu.png │ │ ├── InputOptions_Advanced.png │ │ ├── InputOptions_Controller.png │ │ ├── InputOptions_General.png │ │ ├── IntegrationSettings.png │ │ ├── LabelList.png │ │ ├── LogWindow.png │ │ ├── MemoryAccessCounters.png │ │ ├── MemoryMappings.png │ │ ├── MemoryViewer.png │ │ ├── MemoryViewerTbl.png │ │ ├── MesenIcon.png │ │ ├── MovieRecordingOptions.png │ │ ├── NetplayConnect.png │ │ ├── NetplayHost.png │ │ ├── OptionsMenu.png │ │ ├── PaletteViewer.png │ │ ├── Preferences_Advanced.png │ │ ├── Preferences_FoldersFiles.png │ │ ├── Preferences_General.png │ │ ├── Preferences_ShortcutKeys.png │ │ ├── Profiler.png │ │ ├── RegisterViewer.png │ │ ├── ScriptWindow.png │ │ ├── SourceView.png │ │ ├── SpcPlayer.png │ │ ├── SpriteViewer.png │ │ ├── TileViewer.png │ │ ├── TilemapViewer.png │ │ ├── ToolsMenu.png │ │ ├── TraceLogger.png │ │ ├── VideoOptions_Advanced.png │ │ ├── VideoOptions_General.png │ │ ├── VideoOptions_Overscan.png │ │ ├── VideoOptions_Picture.png │ │ ├── VideoRecording.png │ │ ├── WatchList.png │ │ ├── favicon.png │ │ └── patreon.png └── themes │ └── learn │ ├── .gitignore │ ├── LICENSE.md │ ├── README.md │ ├── archetypes │ ├── chapter.md │ └── default.md │ ├── i18n │ ├── en.toml │ └── fr.toml │ ├── layouts │ ├── 404.html │ ├── _default │ │ ├── list.html │ │ └── single.html │ ├── index.html │ ├── index.json │ ├── partials │ │ ├── custom-footer.html │ │ ├── custom-header.html │ │ ├── favicon.html │ │ ├── footer.html │ │ ├── header.html │ │ ├── logo.html │ │ ├── menu-footer.html │ │ ├── menu.html │ │ ├── meta.html │ │ ├── search.html │ │ └── toc.html │ └── shortcodes │ │ ├── attachments.html │ │ ├── button.html │ │ ├── children.html │ │ ├── expand.html │ │ ├── mermaid.html │ │ ├── notice.html │ │ └── relref.html │ ├── static │ ├── css │ │ ├── featherlight.min.css │ │ ├── font-awesome.min.css │ │ ├── horsey.css │ │ ├── hugo-theme.css │ │ ├── hybrid.css │ │ ├── nucleus.css │ │ ├── perfect-scrollbar.min.css │ │ ├── theme-blue.css │ │ ├── theme-green.css │ │ ├── theme-red.css │ │ └── theme.css │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── Inconsolata.eot │ │ ├── Inconsolata.svg │ │ ├── Inconsolata.ttf │ │ ├── Inconsolata.woff │ │ ├── Novecentosanswide-Normal-webfont.eot │ │ ├── Novecentosanswide-Normal-webfont.svg │ │ ├── Novecentosanswide-Normal-webfont.ttf │ │ ├── Novecentosanswide-Normal-webfont.woff │ │ ├── Novecentosanswide-Normal-webfont.woff2 │ │ ├── Novecentosanswide-UltraLight-webfont.eot │ │ ├── Novecentosanswide-UltraLight-webfont.svg │ │ ├── Novecentosanswide-UltraLight-webfont.ttf │ │ ├── Novecentosanswide-UltraLight-webfont.woff │ │ ├── Novecentosanswide-UltraLight-webfont.woff2 │ │ ├── Work_Sans_200.eot │ │ ├── Work_Sans_200.svg │ │ ├── Work_Sans_200.ttf │ │ ├── Work_Sans_200.woff │ │ ├── Work_Sans_200.woff2 │ │ ├── Work_Sans_300.eot │ │ ├── Work_Sans_300.svg │ │ ├── Work_Sans_300.ttf │ │ ├── Work_Sans_300.woff │ │ ├── Work_Sans_300.woff2 │ │ ├── Work_Sans_500.eot │ │ ├── Work_Sans_500.svg │ │ ├── Work_Sans_500.ttf │ │ ├── Work_Sans_500.woff │ │ ├── Work_Sans_500.woff2 │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── images │ │ ├── clippy.svg │ │ ├── favicon.png │ │ └── gopher-404.jpg │ ├── js │ │ ├── clipboard.min.js │ │ ├── featherlight.min.js │ │ ├── highlight.pack.js │ │ ├── horsey.js │ │ ├── html5shiv-printshiv.min.js │ │ ├── hugo-learn.js │ │ ├── jquery-2.x.min.js │ │ ├── jquery.sticky-kit.min.js │ │ ├── learn.js │ │ ├── lunr.min.js │ │ ├── modernizr.custom.71422.js │ │ ├── perfect-scrollbar.jquery.min.js │ │ ├── perfect-scrollbar.min.js │ │ └── search.js │ └── mermaid │ │ ├── mermaid.css │ │ ├── mermaid.dark.css │ │ ├── mermaid.forest.css │ │ └── mermaid.js │ ├── theme.toml │ └── wercker.yml ├── InteropDLL ├── ConfigApiWrapper.cpp ├── DebugApiWrapper.cpp ├── EmuApiWrapper.cpp ├── InputApiWrapper.cpp ├── InteropDLL.vcxproj ├── InteropDLL.vcxproj.filters ├── InteropNotificationListener.h ├── InteropNotificationListeners.h ├── NetplayApiWrapper.cpp ├── RecordApiWrapper.cpp ├── TestApiWrapper.cpp ├── stdafx.cpp └── stdafx.h ├── LICENSE ├── Libretro ├── .gitignore ├── Libretro.vcxproj ├── Libretro.vcxproj.filters ├── LibretroKeyManager.h ├── LibretroMessageManager.h ├── LibretroRenderer.h ├── LibretroSoundManager.h ├── Makefile ├── Makefile.common ├── jni │ ├── Android.mk │ └── Application.mk ├── libretro.cpp ├── libretro.h └── link.T ├── Linux ├── LinuxGameController.cpp ├── LinuxGameController.h ├── LinuxKeyManager.cpp ├── LinuxKeyManager.h ├── SdlRenderer.cpp ├── SdlRenderer.h ├── SdlSoundManager.cpp ├── SdlSoundManager.h ├── SpriteFont.cpp ├── SpriteFont.h └── libevdev │ ├── event-names.h │ ├── libevdev-int.h │ ├── libevdev-util.h │ ├── libevdev.c │ └── libevdev.h ├── Lua ├── Lua.vcxproj ├── Lua.vcxproj.filters ├── auxiliar.c ├── auxiliar.h ├── buffer.c ├── buffer.h ├── compat.c ├── compat.h ├── except.c ├── except.h ├── inet.c ├── inet.h ├── io.c ├── io.h ├── lapi.c ├── lapi.h ├── lauxlib.c ├── lauxlib.h ├── lbaselib.c ├── lbitlib.c ├── lcode.c ├── lcode.h ├── lcorolib.c ├── lctype.c ├── lctype.h ├── ldblib.c ├── ldebug.c ├── ldebug.h ├── ldo.c ├── ldo.h ├── ldump.c ├── lfunc.c ├── lfunc.h ├── lgc.c ├── lgc.h ├── linit.c ├── liolib.c ├── llex.c ├── llex.h ├── llimits.h ├── lmathlib.c ├── lmem.c ├── lmem.h ├── loadlib.c ├── lobject.c ├── lobject.h ├── lopcodes.c ├── lopcodes.h ├── loslib.c ├── lparser.c ├── lparser.h ├── lprefix.h ├── lstate.c ├── lstate.h ├── lstring.c ├── lstring.h ├── lstrlib.c ├── ltable.c ├── ltable.h ├── ltablib.c ├── ltm.c ├── ltm.h ├── lua.h ├── lua.hpp ├── luaconf.h ├── lualib.h ├── luasocket.c ├── luasocket.h ├── luasocket.hpp ├── lundump.c ├── lundump.h ├── lutf8lib.c ├── lvm.c ├── lvm.h ├── lzio.c ├── lzio.h ├── mime.c ├── mime.h ├── options.c ├── options.h ├── pierror.h ├── select.c ├── select.h ├── socket.h ├── tcp.c ├── tcp.h ├── timeout.c ├── timeout.h ├── udp.c ├── udp.h ├── usocket.c ├── usocket.h ├── wsocket.c └── wsocket.h ├── Mesen-S.sln ├── PGOHelper ├── PGOGames │ └── readme.md ├── PGOHelper.cpp ├── PGOHelper.vcxproj └── PGOHelper.vcxproj.filters ├── README.md ├── SevenZip ├── 7z.h ├── 7zAlloc.c ├── 7zAlloc.h ├── 7zArcIn.c ├── 7zBuf.c ├── 7zBuf.h ├── 7zCrc.c ├── 7zCrc.h ├── 7zCrcOpt.c ├── 7zDec.c ├── 7zFile.c ├── 7zFile.h ├── 7zMemBuffer.c ├── 7zMemBuffer.h ├── 7zStream.c ├── 7zTypes.h ├── Bcj2.c ├── Bcj2.h ├── Bra.c ├── Bra.h ├── Bra86.c ├── BraIA64.c ├── Compiler.h ├── CpuArch.c ├── CpuArch.h ├── Delta.c ├── Delta.h ├── Lzma2Dec.c ├── Lzma2Dec.h ├── LzmaDec.c ├── LzmaDec.h ├── Ppmd.h ├── Ppmd7.c ├── Ppmd7.h ├── Ppmd7Dec.c ├── Precomp.c ├── Precomp.h ├── SevenZip.vcxproj └── SevenZip.vcxproj.filters ├── UI ├── Config │ ├── AudioConfig.cs │ ├── AviRecordConfig.cs │ ├── BaseConfig.cs │ ├── CheatCodes.cs │ ├── CheatWindowConfig.cs │ ├── ConfigAttributes.cs │ ├── ConfigManager.cs │ ├── Configuration.cs │ ├── DbgIntegrationConfig.cs │ ├── EmulationConfig.cs │ ├── FileAssociationHelper.cs │ ├── GameboyConfig.cs │ ├── InputConfig.cs │ ├── MovieRecordConfig.cs │ ├── NetplayConfig.cs │ ├── PreferencesConfig.cs │ ├── RecentItems.cs │ ├── Shortcuts │ │ ├── EmulatorShortcut.cs │ │ ├── KeyCombination.cs │ │ └── ShortcutKeyInfo.cs │ └── VideoConfig.cs ├── Controls │ ├── BaseControl.cs │ ├── MesenNumericUpDown.cs │ ├── MesenNumericUpDown.resx │ ├── MyListView.cs │ ├── ctrlAutoGrowLabel.cs │ ├── ctrlHorizontalTrackbar.Designer.cs │ ├── ctrlHorizontalTrackbar.cs │ ├── ctrlHorizontalTrackbar.resx │ ├── ctrlLinkLabel.cs │ ├── ctrlLoadingRom.Designer.cs │ ├── ctrlLoadingRom.cs │ ├── ctrlLoadingRom.resx │ ├── ctrlMesenContextMenuStrip.cs │ ├── ctrlMesenMenuStrip.cs │ ├── ctrlMesenPictureBox.cs │ ├── ctrlMesenToolStrip.cs │ ├── ctrlPathSelection.Designer.cs │ ├── ctrlPathSelection.cs │ ├── ctrlPathSelection.resx │ ├── ctrlRecentGame.Designer.cs │ ├── ctrlRecentGame.cs │ ├── ctrlRecentGame.resx │ ├── ctrlRecentGames.Designer.cs │ ├── ctrlRecentGames.cs │ ├── ctrlRecentGames.resx │ ├── ctrlRenderer.Designer.cs │ ├── ctrlRenderer.cs │ ├── ctrlRenderer.resx │ ├── ctrlRiskyOption.Designer.cs │ ├── ctrlRiskyOption.cs │ ├── ctrlRiskyOption.resx │ ├── ctrlSplitContainer.cs │ ├── ctrlTrackbar.Designer.cs │ ├── ctrlTrackbar.cs │ └── ctrlTrackbar.resx ├── Debugger │ ├── Breakpoints │ │ ├── Breakpoint.cs │ │ ├── BreakpointManager.cs │ │ ├── InteropBreakpoint.cs │ │ ├── ctrlBreakpoints.Designer.cs │ │ ├── ctrlBreakpoints.cs │ │ ├── ctrlBreakpoints.resx │ │ ├── frmBreakpoint.Designer.cs │ │ ├── frmBreakpoint.cs │ │ └── frmBreakpoint.resx │ ├── Code │ │ ├── BaseStyleProvider.cs │ │ ├── CodeDataProvider.cs │ │ ├── CodeHighlighting.cs │ │ ├── CpuDisassemblyManager.cs │ │ ├── CpuLineStyleProvider.cs │ │ ├── Cx4DisassemblyManager.cs │ │ ├── Cx4LineStyleProvider.cs │ │ ├── GbDisassemblyManager.cs │ │ ├── GbLineStyleProvider.cs │ │ ├── GsuDisassemblyManager.cs │ │ ├── GsuLineStyleProvider.cs │ │ ├── IDisassemblyManager.cs │ │ ├── NecDspDisassemblyManager.cs │ │ ├── NecDspLineStyleProvider.cs │ │ ├── Sa1DisassemblyManager.cs │ │ ├── Sa1LineStyleProvider.cs │ │ ├── SpcDisassemblyManager.cs │ │ ├── SpcLineStyleProvider.cs │ │ └── SymbolCodeDataProvider.cs │ ├── CodeLineData.cs │ ├── Config │ │ ├── AssemblerConfig.cs │ │ ├── DebugInfo.cs │ │ ├── DebugLogConfig.cs │ │ ├── DebuggerInfo.cs │ │ ├── DebuggerShortcutsConfig.cs │ │ ├── EventViewerConfig.cs │ │ ├── HexEditorInfo.cs │ │ ├── ProfilerConfig.cs │ │ ├── RegisterViewerConfig.cs │ │ ├── ScriptWindowConfig.cs │ │ ├── SpriteViewerConfig.cs │ │ ├── TileViewerConfig.cs │ │ ├── TilemapViewerConfig.cs │ │ └── TraceLoggerInfo.cs │ ├── Controls │ │ ├── ComboBoxWithSeparator.cs │ │ ├── TextboxHistory.cs │ │ ├── ctrlCallstack.Designer.cs │ │ ├── ctrlCallstack.cs │ │ ├── ctrlCallstack.resx │ │ ├── ctrlCodeScrollbar.cs │ │ ├── ctrlColorPicker.cs │ │ ├── ctrlCpuStatus.Designer.cs │ │ ├── ctrlCpuStatus.cs │ │ ├── ctrlCpuStatus.resx │ │ ├── ctrlCx4Status.Designer.cs │ │ ├── ctrlCx4Status.cs │ │ ├── ctrlCx4Status.resx │ │ ├── ctrlDbgShortcuts.Designer.cs │ │ ├── ctrlDbgShortcuts.cs │ │ ├── ctrlDbgShortcuts.resx │ │ ├── ctrlDisassemblyView.Designer.cs │ │ ├── ctrlDisassemblyView.cs │ │ ├── ctrlDisassemblyView.resx │ │ ├── ctrlGameboyStatus.Designer.cs │ │ ├── ctrlGameboyStatus.cs │ │ ├── ctrlGameboyStatus.resx │ │ ├── ctrlGsuStatus.Designer.cs │ │ ├── ctrlGsuStatus.cs │ │ ├── ctrlGsuStatus.resx │ │ ├── ctrlMemoryMapping.cs │ │ ├── ctrlMemoryType.cs │ │ ├── ctrlNecDspStatus.Designer.cs │ │ ├── ctrlNecDspStatus.cs │ │ ├── ctrlNecDspStatus.resx │ │ ├── ctrlPanel.cs │ │ ├── ctrlPpuStatus.Designer.cs │ │ ├── ctrlPpuStatus.cs │ │ ├── ctrlPpuStatus.resx │ │ ├── ctrlScrollableTextbox.Designer.cs │ │ ├── ctrlScrollableTextbox.cs │ │ ├── ctrlScrollableTextbox.resx │ │ ├── ctrlSearchResult.Designer.cs │ │ ├── ctrlSearchResult.cs │ │ ├── ctrlSpcStatus.Designer.cs │ │ ├── ctrlSpcStatus.cs │ │ ├── ctrlSpcStatus.resx │ │ ├── ctrlTextbox.Designer.cs │ │ ├── ctrlTextbox.cs │ │ ├── ctrlWatch.Designer.cs │ │ ├── ctrlWatch.cs │ │ └── ctrlWatch.resx │ ├── DebugWindowManager.cs │ ├── EventViewer │ │ ├── ctrlEventViewerFilters.Designer.cs │ │ ├── ctrlEventViewerFilters.cs │ │ ├── ctrlEventViewerFilters.resx │ │ ├── ctrlEventViewerListView.Designer.cs │ │ ├── ctrlEventViewerListView.cs │ │ ├── ctrlEventViewerListView.resx │ │ ├── ctrlEventViewerPpuView.Designer.cs │ │ ├── ctrlEventViewerPpuView.cs │ │ ├── ctrlEventViewerPpuView.resx │ │ ├── frmEventViewer.Designer.cs │ │ ├── frmEventViewer.cs │ │ └── frmEventViewer.resx │ ├── FontDialogHelper.cs │ ├── GraphicsExtensions.cs │ ├── HexBox │ │ ├── BuiltInContextMenu.cs │ │ ├── ByteCharConverters.cs │ │ ├── ByteCollection.cs │ │ ├── BytePositionInfo.cs │ │ ├── DataBlock.cs │ │ ├── DataMap.cs │ │ ├── DynamicByteProvider.cs │ │ ├── FileDataBlock.cs │ │ ├── FindOptions.cs │ │ ├── HexBox.cs │ │ ├── HexBox.resx │ │ ├── HexCasing.cs │ │ ├── IByteColorProvider.cs │ │ ├── IByteProvider.cs │ │ ├── MemoryDataBlock.cs │ │ ├── NativeMethods.cs │ │ ├── StaticByteProvider.cs │ │ └── Util.cs │ ├── Integration │ │ ├── BassLabelFile.cs │ │ ├── DbgImporter.cs │ │ ├── ISymbolProvider.cs │ │ ├── RgbdsSymbolFile.cs │ │ ├── WlaDxImporter.cs │ │ ├── frmIntegrationSettings.Designer.cs │ │ ├── frmIntegrationSettings.cs │ │ └── frmIntegrationSettings.resx │ ├── Labels │ │ ├── CodeLabel.cs │ │ ├── LabelManager.cs │ │ ├── MslLabelFile.cs │ │ ├── ctrlLabelList.Designer.cs │ │ ├── ctrlLabelList.cs │ │ ├── ctrlLabelList.resx │ │ ├── frmEditLabel.Designer.cs │ │ ├── frmEditLabel.cs │ │ └── frmEditLabel.resx │ ├── MemoryTools │ │ ├── ByteColorProvider.cs │ │ ├── TblByteCharConverter.cs │ │ ├── TblLoader.cs │ │ ├── ctrlHexViewer.Designer.cs │ │ ├── ctrlHexViewer.cs │ │ ├── ctrlHexViewer.resx │ │ ├── ctrlMemoryAccessCounters.Designer.cs │ │ ├── ctrlMemoryAccessCounters.cs │ │ ├── ctrlMemoryAccessCounters.resx │ │ ├── frmFadeSpeed.Designer.cs │ │ ├── frmFadeSpeed.cs │ │ ├── frmFadeSpeed.resx │ │ ├── frmMemoryTools.Designer.cs │ │ ├── frmMemoryTools.cs │ │ ├── frmMemoryTools.resx │ │ ├── frmMemoryViewerColors.Designer.cs │ │ ├── frmMemoryViewerColors.cs │ │ └── frmMemoryViewerColors.resx │ ├── PpuViewer │ │ ├── SpriteInfo.cs │ │ ├── WindowRefreshManager.cs │ │ ├── ctrlImagePanel.Designer.cs │ │ ├── ctrlImagePanel.cs │ │ ├── ctrlImagePanel.resx │ │ ├── ctrlImageViewer.cs │ │ ├── ctrlPaletteViewer.cs │ │ ├── ctrlPropertyList.Designer.cs │ │ ├── ctrlPropertyList.cs │ │ ├── ctrlPropertyList.resx │ │ ├── ctrlScanlineCycleSelect.Designer.cs │ │ ├── ctrlScanlineCycleSelect.cs │ │ ├── ctrlScanlineCycleSelect.resx │ │ ├── ctrlSpriteList.Designer.cs │ │ ├── ctrlSpriteList.cs │ │ ├── ctrlSpriteList.resx │ │ ├── frmPaletteViewer.Designer.cs │ │ ├── frmPaletteViewer.cs │ │ ├── frmPaletteViewer.resx │ │ ├── frmRegisterViewer.Designer.cs │ │ ├── frmRegisterViewer.cs │ │ ├── frmRegisterViewer.resx │ │ ├── frmSpriteViewer.Designer.cs │ │ ├── frmSpriteViewer.cs │ │ ├── frmSpriteViewer.resx │ │ ├── frmTileViewer.Designer.cs │ │ ├── frmTileViewer.cs │ │ ├── frmTileViewer.resx │ │ ├── frmTilemapViewer.Designer.cs │ │ ├── frmTilemapViewer.cs │ │ └── frmTilemapViewer.resx │ ├── Profiler │ │ ├── ctrlProfiler.Designer.cs │ │ ├── ctrlProfiler.cs │ │ ├── ctrlProfiler.resx │ │ ├── frmProfiler.Designer.cs │ │ ├── frmProfiler.cs │ │ └── frmProfiler.resx │ ├── Scripts │ │ ├── FastColoredTextBox │ │ │ ├── AutocompleteItem.cs │ │ │ ├── AutocompleteMenu.cs │ │ │ ├── Bookmarks.cs │ │ │ ├── Char.cs │ │ │ ├── CommandManager.cs │ │ │ ├── Commands.cs │ │ │ ├── DocumentMap.cs │ │ │ ├── EncodingDetector.cs │ │ │ ├── ExportToHTML.cs │ │ │ ├── ExportToRTF.cs │ │ │ ├── FastColoredTextBox.cs │ │ │ ├── FastColoredTextBox.resx │ │ │ ├── FileTextSource.cs │ │ │ ├── FindForm.cs │ │ │ ├── FindForm.designer.cs │ │ │ ├── FindForm.resx │ │ │ ├── GoToForm.cs │ │ │ ├── GoToForm.designer.cs │ │ │ ├── GoToForm.resx │ │ │ ├── Hints.cs │ │ │ ├── Hotkeys.cs │ │ │ ├── HotkeysEditorForm.cs │ │ │ ├── HotkeysEditorForm.designer.cs │ │ │ ├── HotkeysEditorForm.resx │ │ │ ├── LimitedStack.cs │ │ │ ├── Line.cs │ │ │ ├── LinesAccessor.cs │ │ │ ├── MacrosManager.cs │ │ │ ├── MonoUtility.cs │ │ │ ├── NativeMethods.cs │ │ │ ├── NativeMethodsWrapper.cs │ │ │ ├── Place.cs │ │ │ ├── PlatformType.cs │ │ │ ├── Range.cs │ │ │ ├── ReplaceForm.cs │ │ │ ├── ReplaceForm.designer.cs │ │ │ ├── ReplaceForm.resx │ │ │ ├── Ruler.cs │ │ │ ├── Ruler.designer.cs │ │ │ ├── Style.cs │ │ │ ├── SyntaxDescriptor.cs │ │ │ ├── SyntaxHighlighter.cs │ │ │ ├── TextSource.cs │ │ │ ├── TypeDescriptor.cs │ │ │ ├── UnfocusablePanel.cs │ │ │ └── VisualMarker.cs │ │ ├── frmScript.Designer.cs │ │ ├── frmScript.cs │ │ └── frmScript.resx │ ├── Tooltips │ │ ├── ctrlTooltip.Designer.cs │ │ ├── ctrlTooltip.cs │ │ └── ctrlTooltip.resx │ ├── WatchManager.cs │ ├── Workspace │ │ ├── DebugWorkspace.cs │ │ └── DebugWorkspaceManager.cs │ ├── frmAssembler.Designer.cs │ ├── frmAssembler.cs │ ├── frmAssembler.resx │ ├── frmBreakIn.Designer.cs │ ├── frmBreakIn.cs │ ├── frmBreakIn.resx │ ├── frmBreakOn.Designer.cs │ ├── frmBreakOn.cs │ ├── frmBreakOn.resx │ ├── frmDbgPreferences.Designer.cs │ ├── frmDbgPreferences.cs │ ├── frmDbgPreferences.resx │ ├── frmDbgShortcutGetKey.Designer.cs │ ├── frmDbgShortcutGetKey.cs │ ├── frmDbgShortcutGetKey.resx │ ├── frmDebugLog.Designer.cs │ ├── frmDebugLog.cs │ ├── frmDebugLog.resx │ ├── frmDebugger.Designer.cs │ ├── frmDebugger.cs │ ├── frmDebugger.resx │ ├── frmDebuggerColors.Designer.cs │ ├── frmDebuggerColors.cs │ ├── frmGoToAll.Designer.cs │ ├── frmGoToAll.cs │ ├── frmGoToLine.Designer.cs │ ├── frmGoToLine.cs │ ├── frmGoToLine.resx │ ├── frmTraceLogger.Designer.cs │ ├── frmTraceLogger.cs │ └── frmTraceLogger.resx ├── Dependencies │ ├── CheatDb.xml │ ├── Font.24.spritefont │ ├── Font.64.spritefont │ ├── LICENSE.txt │ ├── LuaScripts │ │ ├── DrawMode.lua │ │ ├── Example.lua │ │ ├── Grid.lua │ │ └── NtscSafeArea.lua │ ├── PixelFont.ttf │ ├── Satellaview │ │ ├── BSX0120-0.bin │ │ ├── BSX0121-0.bin │ │ ├── BSX0122-0.bin │ │ ├── BSX0123-0.bin │ │ └── BSX0124-0.bin │ └── resources.en.xml ├── Emulation │ ├── CursorManager.cs │ ├── DisplayManager.cs │ ├── EmuRunner.cs │ ├── SaveStateManager.cs │ └── ShortcutHandler.cs ├── Forms │ ├── BaseConfigForm.Designer.cs │ ├── BaseConfigForm.cs │ ├── BaseConfigForm.resx │ ├── BaseForm.cs │ ├── BaseForm.resx │ ├── BaseInputForm.cs │ ├── BaseInputForm.resx │ ├── Config │ │ ├── Controllers │ │ │ ├── BaseInputConfigControl.cs │ │ │ ├── BaseInputConfigForm.cs │ │ │ ├── BaseInputConfigForm.resx │ │ │ ├── ctrlKeyBindingHint.Designer.cs │ │ │ ├── ctrlKeyBindingHint.cs │ │ │ ├── ctrlKeyBindingHint.resx │ │ │ ├── ctrlStandardController.Designer.cs │ │ │ ├── ctrlStandardController.cs │ │ │ ├── ctrlStandardController.resx │ │ │ ├── frmControllerConfig.Designer.cs │ │ │ ├── frmControllerConfig.cs │ │ │ └── frmControllerConfig.resx │ │ ├── KeyPresets.cs │ │ ├── ctrlEmulatorShortcuts.Designer.cs │ │ ├── ctrlEmulatorShortcuts.cs │ │ ├── ctrlEmulatorShortcuts.resx │ │ ├── frmAudioConfig.Designer.cs │ │ ├── frmAudioConfig.cs │ │ ├── frmAudioConfig.resx │ │ ├── frmCopyFiles.Designer.cs │ │ ├── frmCopyFiles.cs │ │ ├── frmCopyFiles.resx │ │ ├── frmEmulationConfig.Designer.cs │ │ ├── frmEmulationConfig.cs │ │ ├── frmEmulationConfig.resx │ │ ├── frmGameboyConfig.Designer.cs │ │ ├── frmGameboyConfig.cs │ │ ├── frmGameboyConfig.resx │ │ ├── frmGetKey.Designer.cs │ │ ├── frmGetKey.cs │ │ ├── frmGetKey.resx │ │ ├── frmInputConfig.Designer.cs │ │ ├── frmInputConfig.cs │ │ ├── frmInputConfig.resx │ │ ├── frmPreferences.Designer.cs │ │ ├── frmPreferences.cs │ │ ├── frmPreferences.resx │ │ ├── frmRecordMovie.Designer.cs │ │ ├── frmRecordMovie.cs │ │ ├── frmRecordMovie.resx │ │ ├── frmVideoConfig.Designer.cs │ │ ├── frmVideoConfig.cs │ │ └── frmVideoConfig.resx │ ├── EntityBinder.cs │ ├── MesenMsgBox.cs │ ├── MonoThemeHelper.cs │ ├── MonoToolStripHelper.cs │ ├── NetPlay │ │ ├── frmClientConfig.Designer.cs │ │ ├── frmClientConfig.cs │ │ ├── frmClientConfig.resx │ │ ├── frmPlayerProfile.Designer.cs │ │ ├── frmPlayerProfile.cs │ │ ├── frmPlayerProfile.resx │ │ ├── frmServerConfig.Designer.cs │ │ ├── frmServerConfig.cs │ │ └── frmServerConfig.resx │ ├── OpenSaveFileDialogExtensions.cs │ ├── ResourceHelper.cs │ ├── ResourcePath.cs │ ├── Tools │ │ ├── CheatDatabase.cs │ │ ├── frmCheat.Designer.cs │ │ ├── frmCheat.cs │ │ ├── frmCheat.resx │ │ ├── frmCheatDbList.Designer.cs │ │ ├── frmCheatDbList.cs │ │ ├── frmCheatDbList.resx │ │ ├── frmCheatList.Designer.cs │ │ ├── frmCheatList.cs │ │ ├── frmCheatList.resx │ │ ├── frmLogWindow.Designer.cs │ │ ├── frmLogWindow.cs │ │ ├── frmLogWindow.resx │ │ ├── frmRecordAvi.Designer.cs │ │ ├── frmRecordAvi.cs │ │ └── frmRecordAvi.resx │ ├── frmAbout.Designer.cs │ ├── frmAbout.cs │ ├── frmAbout.resx │ ├── frmConfigWizard.Designer.cs │ ├── frmConfigWizard.cs │ ├── frmConfigWizard.resx │ ├── frmFullscreenRenderer.cs │ ├── frmMain.Designer.cs │ ├── frmMain.cs │ ├── frmMain.resx │ ├── frmSelectRom.Designer.cs │ ├── frmSelectRom.cs │ └── frmSelectRom.resx ├── Interop │ ├── ConfigApi.cs │ ├── DebugApi.cs │ ├── DebugState.cs │ ├── EmuApi.cs │ ├── InputApi.cs │ ├── NetplayApi.cs │ ├── NotificationListener.cs │ ├── RecordApi.cs │ ├── TestApi.cs │ └── Utf8Marshaler.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── ResourceExtractor.cs ├── Resources │ ├── Accept.png │ ├── Add.png │ ├── ArrowKeys.png │ ├── Audio.png │ ├── Barcode.png │ ├── Breakpoint.png │ ├── BreakpointDisabled.png │ ├── BreakpointEnableDisable.png │ ├── Camera.png │ ├── CheatCode.png │ ├── Chip.png │ ├── Close.png │ ├── CloseWhite.png │ ├── Coins.png │ ├── Collapse.png │ ├── CommandLine.png │ ├── Comment.png │ ├── Controller.png │ ├── Copy.png │ ├── Cut.png │ ├── Cx4Debugger.png │ ├── Debugger.png │ ├── Dice.png │ ├── DipSwitches.png │ ├── Donate.png │ ├── DownArrow.png │ ├── DownArrowDarkTheme.png │ ├── DownArrowWin10.png │ ├── Edit.png │ ├── EditLabel.png │ ├── Enum.png │ ├── Exclamation.png │ ├── Exit.png │ ├── Expand.png │ ├── Export.png │ ├── Find.png │ ├── Folder.png │ ├── Font.png │ ├── Fullscreen.png │ ├── Function.png │ ├── GameboyIcon.png │ ├── GbDebugger.png │ ├── GsuDebugger.png │ ├── HdPack.png │ ├── Help.png │ ├── HistoryViewer.png │ ├── Icon.ico │ ├── Import.png │ ├── JumpTarget.png │ ├── LogWindow.png │ ├── MediaEject.png │ ├── MediaPause.png │ ├── MediaPlay.png │ ├── MediaStop.png │ ├── MesenSIcon.png │ ├── MesenSIconSmall.png │ ├── Microphone.png │ ├── MoveDown.png │ ├── MoveUp.png │ ├── Movie.png │ ├── NavigateBack.png │ ├── NavigateForward.png │ ├── NecDspDebugger.png │ ├── NesEventViewer.png │ ├── Network.png │ ├── NextArrow.png │ ├── NextTrack.png │ ├── NudDownArrow.png │ ├── NudDownArrowDarkTheme.png │ ├── NudUpArrow.png │ ├── NudUpArrowDarkTheme.png │ ├── Paste.png │ ├── Pencil.png │ ├── PerfTracker.png │ ├── Pipette.png │ ├── PipetteSmall.png │ ├── PowerCycle.png │ ├── PrevTrack.png │ ├── PreviousArrow.png │ ├── PsIcon.png │ ├── Record.png │ ├── Refresh.png │ ├── RegisterIcon.png │ ├── RunPpuCycle.png │ ├── RunPpuFrame.png │ ├── RunPpuScanline.png │ ├── Sa1Debugger.png │ ├── SaveFloppy.png │ ├── Script.png │ ├── SelectAll.png │ ├── Settings.png │ ├── SpcDebugger.png │ ├── Speed.png │ ├── SplitView.png │ ├── StepBack.png │ ├── StepInto.png │ ├── StepOut.png │ ├── StepOver.png │ ├── SwitchView.png │ ├── Tape.png │ ├── Undo.png │ ├── UnidentifiedData.png │ ├── Update.png │ ├── VerifiedData.png │ ├── VerticalLayout.png │ ├── VideoFilter.png │ ├── VideoOptions.png │ ├── VideoRecorder.png │ ├── Warning.png │ ├── WasdKeys.png │ ├── WebBrowser.png │ ├── XbIcon.png │ └── Zoom2x.png ├── RuntimeChecker.cs ├── SingleInstance.cs ├── UI.csproj ├── Updates │ ├── UpdateHelper.cs │ ├── frmDownloadProgress.Designer.cs │ ├── frmDownloadProgress.cs │ ├── frmDownloadProgress.resx │ ├── frmUpdatePrompt.Designer.cs │ ├── frmUpdatePrompt.cs │ └── frmUpdatePrompt.resx ├── Utilities │ ├── ArchiveHelper.cs │ ├── CommandLineHelper.cs │ ├── FirmwareHelper.cs │ ├── FolderHelper.cs │ ├── HexConverter.cs │ ├── ImageExtensions.cs │ ├── InBackgroundHelper.cs │ ├── Md5Helper.cs │ ├── NetPlayHelper.cs │ ├── RandomGameHelper.cs │ ├── RomTestHelper.cs │ └── XmlColor.cs └── app.manifest ├── UpdateHelper ├── Icon.ico ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── UpdateHelper.csproj ├── Utilities ├── ArchiveReader.cpp ├── ArchiveReader.h ├── AutoResetEvent.cpp ├── AutoResetEvent.h ├── AviRecorder.cpp ├── AviRecorder.h ├── AviWriter.cpp ├── AviWriter.h ├── Base64.h ├── BaseCodec.h ├── BpsPatcher.cpp ├── BpsPatcher.h ├── CRC32.cpp ├── CRC32.h ├── CamstudioCodec.cpp ├── CamstudioCodec.h ├── Equalizer.cpp ├── Equalizer.h ├── FastString.h ├── FolderUtilities.cpp ├── FolderUtilities.h ├── GifRecorder.cpp ├── GifRecorder.h ├── HQX │ ├── common.h │ ├── hq2x.cpp │ ├── hq3x.cpp │ ├── hq4x.cpp │ ├── hqx.h │ └── init.cpp ├── HermiteResampler.cpp ├── HermiteResampler.h ├── HexUtilities.cpp ├── HexUtilities.h ├── ISerializable.h ├── IVideoRecorder.h ├── IpsPatcher.cpp ├── IpsPatcher.h ├── KreedSaiEagle │ ├── 2xSai.cpp │ ├── SaiEagle.h │ ├── Super2xSai.cpp │ └── SuperEagle.cpp ├── LowPassFilter.h ├── PNGHelper.cpp ├── PNGHelper.h ├── PlatformUtilities.cpp ├── PlatformUtilities.h ├── RawCodec.h ├── SZReader.cpp ├── SZReader.h ├── Scale2x │ ├── scale2x.cpp │ ├── scale2x.h │ ├── scale3x.cpp │ ├── scale3x.h │ ├── scalebit.cpp │ └── scalebit.h ├── Serializer.cpp ├── Serializer.h ├── SimpleLock.cpp ├── SimpleLock.h ├── Socket.cpp ├── Socket.h ├── StringUtilities.h ├── Timer.cpp ├── Timer.h ├── UPnPPortMapper.cpp ├── UPnPPortMapper.h ├── UTF8Util.cpp ├── UTF8Util.h ├── UpsPatcher.cpp ├── UpsPatcher.h ├── Utilities.vcxproj ├── Utilities.vcxproj.filters ├── VirtualFile.cpp ├── VirtualFile.h ├── ZipReader.cpp ├── ZipReader.h ├── ZipWriter.cpp ├── ZipWriter.h ├── ZmbvCodec.cpp ├── ZmbvCodec.h ├── blip_buf.cpp ├── blip_buf.h ├── gif.h ├── md5.cpp ├── md5.h ├── miniz.cpp ├── miniz.h ├── orfanidis_eq.h ├── sha1.cpp ├── sha1.h ├── snes_ntsc.cpp ├── snes_ntsc.h ├── snes_ntsc_config.h ├── snes_ntsc_impl.h ├── stb_vorbis.cpp ├── stb_vorbis.h ├── stdafx.cpp ├── stdafx.h └── xBRZ │ ├── config.h │ ├── xbrz.cpp │ └── xbrz.h ├── Windows ├── DirectInputManager.cpp ├── DirectInputManager.h ├── DirectXTK │ ├── Audio.h │ ├── CommonStates.h │ ├── DDSTextureLoader.h │ ├── DirectXHelpers.h │ ├── Effects.h │ ├── GamePad.h │ ├── GeometricPrimitive.h │ ├── GraphicsMemory.h │ ├── Keyboard.h │ ├── Model.h │ ├── Mouse.h │ ├── PrimitiveBatch.h │ ├── ScreenGrab.h │ ├── SimpleMath.h │ ├── SimpleMath.inl │ ├── SpriteBatch.h │ ├── SpriteFont.h │ ├── VertexTypes.h │ ├── WICTextureLoader.h │ └── XboxDDSTextureLoader.h ├── Renderer.cpp ├── Renderer.h ├── Resources │ ├── MesenIcon.bmp │ ├── Roboto.12.spritefont │ └── Toast.dds ├── SoundManager.cpp ├── SoundManager.h ├── Windows.vcxproj ├── Windows.vcxproj.filters ├── WindowsKeyManager.cpp ├── WindowsKeyManager.h ├── XInputManager.cpp ├── XInputManager.h ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── build.sh ├── buildPGO.sh └── makefile /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | indent_size = 3 -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: Mesen -------------------------------------------------------------------------------- /Core/AluMulDiv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "InternalRegisterTypes.h" 4 | #include "../Utilities/ISerializable.h" 5 | 6 | class Cpu; 7 | 8 | class AluMulDiv final : public ISerializable 9 | { 10 | private: 11 | Cpu *_cpu; 12 | 13 | uint64_t _prevCpuCycle = 0; 14 | 15 | AluState _state; 16 | 17 | uint32_t _shift = 0; 18 | uint8_t _multCounter = 0; 19 | uint8_t _divCounter = 0; 20 | 21 | public: 22 | void Initialize(Cpu* cpu); 23 | 24 | void Run(bool isRead); 25 | 26 | uint8_t Read(uint16_t addr); 27 | void Write(uint16_t addr, uint8_t value); 28 | 29 | AluState GetState(); 30 | 31 | void Serialize(Serializer &s) override; 32 | }; -------------------------------------------------------------------------------- /Core/BaseCoprocessor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "../Utilities/ISerializable.h" 4 | #include "IMemoryHandler.h" 5 | 6 | class BaseCoprocessor : public ISerializable, public IMemoryHandler 7 | { 8 | public: 9 | using IMemoryHandler::IMemoryHandler; 10 | 11 | virtual void Reset() = 0; 12 | 13 | virtual void Run() { } 14 | virtual void ProcessEndOfFrame() { } 15 | virtual void LoadBattery() { } 16 | virtual void SaveBattery() { } 17 | }; -------------------------------------------------------------------------------- /Core/BaseSoundManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Core/IAudioDevice.h" 3 | 4 | class BaseSoundManager : public IAudioDevice 5 | { 6 | public: 7 | void ProcessLatency(uint32_t readPosition, uint32_t writePosition); 8 | AudioStatistics GetStatistics(); 9 | 10 | protected: 11 | bool _isStereo; 12 | uint32_t _sampleRate = 0; 13 | 14 | double _averageLatency = 0; 15 | uint32_t _bufferSize = 0x10000; 16 | uint32_t _bufferUnderrunEventCount = 0; 17 | 18 | int32_t _cursorGaps[60]; 19 | int32_t _cursorGapIndex = 0; 20 | bool _cursorGapFilled = false; 21 | 22 | void ResetStats(); 23 | }; 24 | -------------------------------------------------------------------------------- /Core/BatteryManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class IBatteryProvider 5 | { 6 | public: 7 | virtual vector LoadBattery(string extension) = 0; 8 | }; 9 | 10 | class IBatteryRecorder 11 | { 12 | public: 13 | virtual void OnLoadBattery(string extension, vector batteryData) = 0; 14 | }; 15 | 16 | class BatteryManager 17 | { 18 | private: 19 | string _romName; 20 | std::weak_ptr _provider; 21 | std::weak_ptr _recorder; 22 | 23 | string GetBasePath(); 24 | 25 | public: 26 | void Initialize(string romName); 27 | 28 | void SetBatteryProvider(shared_ptr provider); 29 | void SetBatteryRecorder(shared_ptr recorder); 30 | 31 | void SaveBattery(string extension, uint8_t* data, uint32_t length); 32 | 33 | vector LoadBattery(string extension); 34 | void LoadBattery(string extension, uint8_t* data, uint32_t length); 35 | }; -------------------------------------------------------------------------------- /Core/Breakpoint.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | enum class CpuType : uint8_t; 5 | enum class SnesMemoryType; 6 | struct AddressInfo; 7 | enum class BreakpointType; 8 | enum class BreakpointTypeFlags; 9 | enum class BreakpointCategory; 10 | 11 | class Breakpoint 12 | { 13 | public: 14 | bool Matches(uint32_t memoryAddr, AddressInfo &info); 15 | bool HasBreakpointType(BreakpointType type); 16 | string GetCondition(); 17 | bool HasCondition(); 18 | 19 | uint32_t GetId(); 20 | CpuType GetCpuType(); 21 | bool IsEnabled(); 22 | bool IsMarked(); 23 | 24 | private: 25 | uint32_t _id; 26 | CpuType _cpuType; 27 | SnesMemoryType _memoryType; 28 | BreakpointTypeFlags _type; 29 | int32_t _startAddr; 30 | int32_t _endAddr; 31 | bool _enabled; 32 | bool _markEvent; 33 | char _condition[1000]; 34 | }; -------------------------------------------------------------------------------- /Core/BsxSatellaview.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "IMemoryHandler.h" 4 | #include "BsxStream.h" 5 | #include "../Utilities/ISerializable.h" 6 | 7 | class Console; 8 | class MemoryManager; 9 | 10 | class BsxSatellaview : public IMemoryHandler, public ISerializable 11 | { 12 | private: 13 | IMemoryHandler* _bBusHandler; 14 | Console* _console; 15 | MemoryManager* _memoryManager; 16 | 17 | BsxStream _stream[2]; 18 | uint8_t _streamReg; 19 | uint8_t _extOutput; 20 | int64_t _customDate; 21 | 22 | uint64_t _prevMasterClock; 23 | 24 | void ProcessClocks(); 25 | 26 | public: 27 | BsxSatellaview(Console* console, IMemoryHandler *bBusHandler); 28 | 29 | void Reset(); 30 | 31 | uint8_t Read(uint32_t addr) override; 32 | uint8_t Peek(uint32_t addr) override; 33 | void PeekBlock(uint32_t addr, uint8_t* output) override; 34 | void Write(uint32_t addr, uint8_t value) override; 35 | AddressInfo GetAbsoluteAddress(uint32_t address) override; 36 | 37 | void Serialize(Serializer& s) override; 38 | }; -------------------------------------------------------------------------------- /Core/CallstackManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "DebugTypes.h" 4 | 5 | class Debugger; 6 | class Profiler; 7 | 8 | class CallstackManager 9 | { 10 | private: 11 | Debugger* _debugger; 12 | deque _callstack; 13 | unique_ptr _profiler; 14 | 15 | public: 16 | CallstackManager(Debugger* debugger); 17 | ~CallstackManager(); 18 | 19 | void Push(AddressInfo& src, uint32_t srcAddr, AddressInfo& dest, uint32_t destAddr, AddressInfo& ret, uint32_t returnAddress, StackFrameFlags flags); 20 | void Pop(AddressInfo& dest, uint32_t destAddr); 21 | 22 | void GetCallstack(StackFrameInfo* callstackArray, uint32_t &callstackSize); 23 | int32_t GetReturnAddress(); 24 | Profiler* GetProfiler(); 25 | }; -------------------------------------------------------------------------------- /Core/ClientConnectionData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | class ClientConnectionData 6 | { 7 | public: 8 | string Host; 9 | uint16_t Port; 10 | string Password; 11 | string PlayerName; 12 | bool Spectator; 13 | 14 | ClientConnectionData() {} 15 | 16 | ClientConnectionData(string host, uint16_t port, string password, string playerName, bool spectator) : 17 | Host(host), Port(port), Password(password), PlayerName(playerName), Spectator(spectator) 18 | { 19 | } 20 | 21 | ~ClientConnectionData() 22 | { 23 | } 24 | }; -------------------------------------------------------------------------------- /Core/ConsoleLock.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "ConsoleLock.h" 3 | #include "Console.h" 4 | #include "Debugger.h" 5 | 6 | ConsoleLock::ConsoleLock(Console *console) 7 | { 8 | _console = console; 9 | _console->Lock(); 10 | } 11 | 12 | ConsoleLock::~ConsoleLock() 13 | { 14 | _console->Unlock(); 15 | } 16 | -------------------------------------------------------------------------------- /Core/ConsoleLock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class Console; 5 | class Debugger; 6 | 7 | class ConsoleLock 8 | { 9 | private: 10 | Console *_console = nullptr; 11 | 12 | public: 13 | ConsoleLock(Console *console); 14 | ~ConsoleLock(); 15 | }; -------------------------------------------------------------------------------- /Core/ControlDeviceState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include 4 | #include "SettingTypes.h" 5 | 6 | struct ControlDeviceState 7 | { 8 | vector State; 9 | 10 | bool operator!=(ControlDeviceState &other) 11 | { 12 | return State.size() != other.State.size() || memcmp(State.data(), other.State.data(), State.size()) != 0; 13 | } 14 | }; 15 | 16 | struct ControllerData 17 | { 18 | ControllerType Type; 19 | ControlDeviceState State; 20 | }; -------------------------------------------------------------------------------- /Core/Cx4DisUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class DisassemblyInfo; 5 | class LabelManager; 6 | class EmuSettings; 7 | 8 | class Cx4DisUtils 9 | { 10 | public: 11 | static void GetDisassembly(DisassemblyInfo &info, string &out, uint32_t memoryAddr, LabelManager* labelManager, EmuSettings* settings); 12 | }; 13 | -------------------------------------------------------------------------------- /Core/DebugBreakHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "Debugger.h" 4 | #include "Console.h" 5 | 6 | class DebugBreakHelper 7 | { 8 | private: 9 | Debugger * _debugger; 10 | bool _needResume = false; 11 | bool _isEmulationThread = false; 12 | 13 | public: 14 | DebugBreakHelper(Debugger* debugger) 15 | { 16 | _debugger = debugger; 17 | 18 | _isEmulationThread = debugger->GetConsole()->GetEmulationThreadId() == std::this_thread::get_id(); 19 | 20 | if(!_isEmulationThread) { 21 | //Only attempt to break if this is done in a thread other than the main emulation thread 22 | debugger->BreakRequest(false); 23 | if(!debugger->IsExecutionStopped()) { 24 | while(!debugger->IsExecutionStopped()) {} 25 | _needResume = true; 26 | } 27 | } 28 | } 29 | 30 | ~DebugBreakHelper() 31 | { 32 | if(!_isEmulationThread) { 33 | _debugger->BreakRequest(true); 34 | } 35 | } 36 | }; -------------------------------------------------------------------------------- /Core/DebugHud.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "../Utilities/SimpleLock.h" 4 | #include "SettingTypes.h" 5 | 6 | class DrawCommand; 7 | 8 | class DebugHud 9 | { 10 | private: 11 | static constexpr size_t MaxCommandCount = 500000; 12 | vector> _commands; 13 | SimpleLock _commandLock; 14 | 15 | public: 16 | DebugHud(); 17 | ~DebugHud(); 18 | 19 | void Draw(uint32_t* argbBuffer, OverscanDimensions overscan, uint32_t width, uint32_t frameNumber); 20 | void ClearScreen(); 21 | 22 | void DrawPixel(int x, int y, int color, int frameCount, int startFrame); 23 | void DrawLine(int x, int y, int x2, int y2, int color, int frameCount, int startFrame); 24 | void DrawRectangle(int x, int y, int width, int height, int color, bool fill, int frameCount, int startFrame); 25 | void DrawScreenBuffer(uint32_t* screenBuffer, int startFrame); 26 | void DrawString(int x, int y, string text, int color, int backColor, int frameCount, int startFrame); 27 | }; 28 | -------------------------------------------------------------------------------- /Core/DebugStats.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class Console; 5 | 6 | class DebugStats 7 | { 8 | private: 9 | double _frameDurations[60] = {}; 10 | uint32_t _frameDurationIndex = 0; 11 | double _lastFrameMin = 9999; 12 | double _lastFrameMax = 0; 13 | 14 | public: 15 | void DisplayStats(Console *console, double lastFrameTime); 16 | }; -------------------------------------------------------------------------------- /Core/DmaControllerTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | struct DmaChannelConfig 5 | { 6 | bool DmaActive; 7 | 8 | bool InvertDirection; 9 | bool Decrement; 10 | bool FixedTransfer; 11 | bool HdmaIndirectAddressing; 12 | uint8_t TransferMode; 13 | 14 | uint16_t SrcAddress; 15 | uint8_t SrcBank; 16 | 17 | uint16_t TransferSize; 18 | uint8_t DestAddress; 19 | 20 | uint16_t HdmaTableAddress; 21 | uint8_t HdmaBank; 22 | uint8_t HdmaLineCounterAndRepeat; 23 | bool DoTransfer; 24 | bool HdmaFinished; 25 | 26 | bool UnusedFlag; 27 | }; -------------------------------------------------------------------------------- /Core/DrawPixelCommand.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "DrawCommand.h" 4 | 5 | class DrawPixelCommand : public DrawCommand 6 | { 7 | private: 8 | int _x, _y, _color; 9 | 10 | protected: 11 | void InternalDraw() 12 | { 13 | DrawPixel(_x, _y, _color); 14 | } 15 | 16 | public: 17 | DrawPixelCommand(int x, int y, int color, int frameCount, int startFrame) : 18 | DrawCommand(startFrame, frameCount), _x(x), _y(y), _color(color) 19 | { 20 | //Invert alpha byte - 0 = opaque, 255 = transparent (this way, no need to specifiy alpha channel all the time) 21 | _color = (~color & 0xFF000000) | (color & 0xFFFFFF); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /Core/DrawScreenBufferCommand.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "DrawCommand.h" 4 | 5 | class DrawScreenBufferCommand : public DrawCommand 6 | { 7 | private: 8 | uint32_t _screenBuffer[256*240]; 9 | 10 | protected: 11 | void InternalDraw() 12 | { 13 | for(int y = 0; y < 240; y++) { 14 | for(int x = 0; x < 256; x++) { 15 | DrawPixel(x, y, _screenBuffer[(y << 8) + x]); 16 | } 17 | } 18 | } 19 | 20 | public: 21 | DrawScreenBufferCommand(uint32_t* screenBuffer, int startFrame) : DrawCommand(startFrame, 1) 22 | { 23 | memcpy(_screenBuffer, screenBuffer, 256 * 240 * sizeof(uint32_t)); 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /Core/EventType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum class EventType 4 | { 5 | Nmi, 6 | Irq, 7 | StartFrame, 8 | EndFrame, 9 | Reset, 10 | ScriptEnded, 11 | InputPolled, 12 | StateLoaded, 13 | StateSaved, 14 | GbStartFrame, 15 | GbEndFrame, 16 | EventTypeSize 17 | }; -------------------------------------------------------------------------------- /Core/ForceDisconnectMessage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "MessageManager.h" 4 | #include "NetMessage.h" 5 | #include "Console.h" 6 | #include "../Utilities/FolderUtilities.h" 7 | 8 | class ForceDisconnectMessage : public NetMessage 9 | { 10 | private: 11 | string _disconnectMessage; 12 | 13 | protected: 14 | void Serialize(Serializer &s) override 15 | { 16 | s.Stream(_disconnectMessage); 17 | } 18 | 19 | public: 20 | ForceDisconnectMessage(void* buffer, uint32_t length) : NetMessage(buffer, length) { } 21 | 22 | ForceDisconnectMessage(string message) : NetMessage(MessageType::ForceDisconnect) 23 | { 24 | _disconnectMessage = message; 25 | } 26 | 27 | string GetMessage() 28 | { 29 | return _disconnectMessage; 30 | } 31 | }; -------------------------------------------------------------------------------- /Core/GameboyDisUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class DisassemblyInfo; 5 | class Console; 6 | class LabelManager; 7 | class EmuSettings; 8 | struct GbCpuState; 9 | 10 | class GameboyDisUtils 11 | { 12 | public: 13 | static void GetDisassembly(DisassemblyInfo& info, string& out, uint32_t memoryAddr, LabelManager* labelManager, EmuSettings* settings); 14 | static int32_t GetEffectiveAddress(DisassemblyInfo& info, Console* console, GbCpuState& state); 15 | static uint8_t GetOpSize(uint8_t opCode); 16 | static bool IsJumpToSub(uint8_t opCode); 17 | static bool IsReturnInstruction(uint8_t opCode); 18 | static string GetOpTemplate(uint8_t op, bool prefixed); 19 | }; 20 | -------------------------------------------------------------------------------- /Core/GbCartFactory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "GbCart.h" 4 | #include "GbMbc1.h" 5 | #include "GbMbc2.h" 6 | #include "GbMbc3.h" 7 | #include "GbMbc5.h" 8 | 9 | class GbCartFactory 10 | { 11 | public: 12 | static GbCart* CreateCart(uint8_t cartType) 13 | { 14 | switch(cartType) { 15 | case 0: 16 | return new GbCart(); 17 | 18 | case 1: case 2: case 3: 19 | return new GbMbc1(); 20 | 21 | case 5: case 6: 22 | return new GbMbc2(); 23 | 24 | case 15: case 16: 25 | return new GbMbc3(true); 26 | 27 | case 17: case 18: case 19: 28 | return new GbMbc3(false); 29 | 30 | case 25: case 26: case 27: case 28: case 29: case 30: 31 | return new GbMbc5(); 32 | }; 33 | 34 | return nullptr; 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /Core/GbDmaController.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "GbTypes.h" 4 | #include "../Utilities/ISerializable.h" 5 | 6 | class GbMemoryManager; 7 | class GbPpu; 8 | class GbCpu; 9 | 10 | class GbDmaController final : public ISerializable 11 | { 12 | private: 13 | GbDmaControllerState _state; 14 | GbMemoryManager* _memoryManager; 15 | GbPpu* _ppu; 16 | GbCpu* _cpu; 17 | 18 | void ProcessDmaBlock(); 19 | 20 | public: 21 | void Init(GbMemoryManager* memoryManager, GbPpu* ppu, GbCpu* cpu); 22 | 23 | GbDmaControllerState GetState(); 24 | 25 | void Exec(); 26 | 27 | bool IsOamDmaRunning(); 28 | 29 | uint8_t Read(); 30 | void Write(uint8_t value); 31 | 32 | uint8_t ReadCgb(uint16_t addr); 33 | void WriteCgb(uint16_t addr, uint8_t value); 34 | 35 | void ProcessHdma(); 36 | 37 | void Serialize(Serializer& s) override; 38 | }; -------------------------------------------------------------------------------- /Core/GbNoiseChannel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "GbTypes.h" 4 | #include "../Utilities/ISerializable.h" 5 | #include "../Utilities/Serializer.h" 6 | 7 | class GbApu; 8 | 9 | class GbNoiseChannel final : public ISerializable 10 | { 11 | private: 12 | GbNoiseState _state = {}; 13 | GbApu* _apu = nullptr; 14 | 15 | public: 16 | GbNoiseChannel(GbApu* apu); 17 | GbNoiseState GetState(); 18 | 19 | bool Enabled(); 20 | void Disable(); 21 | 22 | void ClockLengthCounter(); 23 | void ClockEnvelope(); 24 | 25 | uint8_t GetOutput(); 26 | uint32_t GetPeriod(); 27 | 28 | void Exec(uint32_t clocksToRun); 29 | 30 | uint8_t Read(uint16_t addr); 31 | void Write(uint16_t addr, uint8_t value); 32 | 33 | void Serialize(Serializer& s) override; 34 | }; -------------------------------------------------------------------------------- /Core/GbPpu.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Core/GbPpu.cpp -------------------------------------------------------------------------------- /Core/GbSquareChannel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "GbTypes.h" 4 | #include "../Utilities/ISerializable.h" 5 | #include "../Utilities/Serializer.h" 6 | 7 | class GbApu; 8 | 9 | class GbSquareChannel final : public ISerializable 10 | { 11 | private: 12 | const uint8_t _dutySequences[4][8] = { 13 | { 0, 1, 1, 1, 1, 1, 1, 1 }, 14 | { 0, 0, 1, 1, 1, 1, 1, 1 }, 15 | { 0, 0, 0, 0, 1, 1, 1, 1 }, 16 | { 0, 0, 0, 0, 0, 0, 1, 1 } 17 | }; 18 | 19 | GbSquareState _state = {}; 20 | GbApu* _apu = nullptr; 21 | 22 | public: 23 | GbSquareChannel(GbApu* apu); 24 | 25 | GbSquareState GetState(); 26 | 27 | bool Enabled(); 28 | void Disable(); 29 | 30 | void ClockSweepUnit(); 31 | uint16_t GetSweepTargetFrequency(); 32 | 33 | void ClockLengthCounter(); 34 | void ClockEnvelope(); 35 | 36 | uint8_t GetOutput(); 37 | 38 | void Exec(uint32_t clocksToRun); 39 | 40 | uint8_t Read(uint16_t addr); 41 | void Write(uint16_t addr, uint8_t value); 42 | 43 | void Serialize(Serializer& s) override; 44 | }; -------------------------------------------------------------------------------- /Core/GbTimer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "../Utilities/ISerializable.h" 4 | #include "../Utilities/Serializer.h" 5 | #include "GbTypes.h" 6 | 7 | class GbMemoryManager; 8 | class GbApu; 9 | 10 | class GbTimer : public ISerializable 11 | { 12 | private: 13 | GbMemoryManager* _memoryManager = nullptr; 14 | GbApu* _apu = nullptr; 15 | GbTimerState _state = {}; 16 | 17 | void SetDivider(uint16_t value); 18 | void ReloadCounter(); 19 | 20 | public: 21 | virtual ~GbTimer(); 22 | 23 | void Init(GbMemoryManager* memoryManager, GbApu* apu); 24 | 25 | GbTimerState GetState(); 26 | 27 | void Exec(); 28 | 29 | uint8_t Read(uint16_t addr); 30 | void Write(uint16_t addr, uint8_t value); 31 | 32 | void Serialize(Serializer& s) override; 33 | }; -------------------------------------------------------------------------------- /Core/GbWaveChannel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "GbTypes.h" 4 | #include "../Utilities/ISerializable.h" 5 | #include "../Utilities/Serializer.h" 6 | 7 | class GbApu; 8 | 9 | class GbWaveChannel final : public ISerializable 10 | { 11 | private: 12 | GbWaveState _state = {}; 13 | GbApu* _apu = nullptr; 14 | 15 | public: 16 | GbWaveChannel(GbApu* apu); 17 | 18 | GbWaveState GetState(); 19 | bool Enabled(); 20 | void Disable(); 21 | uint8_t GetOutput(); 22 | 23 | void ClockLengthCounter(); 24 | 25 | void Exec(uint32_t clocksToRun); 26 | 27 | uint8_t Read(uint16_t addr); 28 | void Write(uint16_t addr, uint8_t value); 29 | 30 | void WriteRam(uint16_t addr, uint8_t value); 31 | uint8_t ReadRam(uint16_t addr); 32 | 33 | void Serialize(Serializer& s) override; 34 | }; -------------------------------------------------------------------------------- /Core/GsuDisUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class DisassemblyInfo; 5 | class LabelManager; 6 | class EmuSettings; 7 | class Console; 8 | struct GsuState; 9 | 10 | class GsuDisUtils 11 | { 12 | public: 13 | static void GetDisassembly(DisassemblyInfo &info, string &out, uint32_t memoryAddr, LabelManager* labelManager, EmuSettings* settings); 14 | static int32_t GetEffectiveAddress(DisassemblyInfo& info, Console* console, GsuState& state); 15 | }; 16 | -------------------------------------------------------------------------------- /Core/IAssembler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class IAssembler 5 | { 6 | public: 7 | virtual uint32_t AssembleCode(string code, uint32_t startAddress, int16_t* assembledCode) = 0; 8 | }; 9 | 10 | enum AssemblerSpecialCodes 11 | { 12 | OK = 0, 13 | EndOfLine = -1, 14 | ParsingError = -2, 15 | OutOfRangeJump = -3, 16 | LabelRedefinition = -4, 17 | MissingOperand = -5, 18 | OperandOutOfRange = -6, 19 | InvalidHex = -7, 20 | InvalidSpaces = -8, 21 | TrailingText = -9, 22 | UnknownLabel = -10, 23 | InvalidInstruction = -11, 24 | InvalidBinaryValue = -12, 25 | InvalidOperands = -13, 26 | InvalidLabel = -14, 27 | }; 28 | -------------------------------------------------------------------------------- /Core/IAudioDevice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | struct AudioStatistics 6 | { 7 | double AverageLatency = 0; 8 | uint32_t BufferUnderrunEventCount = 0; 9 | uint32_t BufferSize = 0; 10 | }; 11 | 12 | class IAudioDevice 13 | { 14 | public: 15 | virtual ~IAudioDevice() {} 16 | virtual void PlayBuffer(int16_t *soundBuffer, uint32_t bufferSize, uint32_t sampleRate, bool isStereo) = 0; 17 | virtual void Stop() = 0; 18 | virtual void Pause() = 0; 19 | virtual void ProcessEndOfFrame() = 0; 20 | 21 | virtual string GetAvailableDevices() = 0; 22 | virtual void SetAudioDevice(string deviceName) = 0; 23 | 24 | virtual AudioStatistics GetStatistics() = 0; 25 | }; -------------------------------------------------------------------------------- /Core/IDebugger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | enum class StepType; 5 | 6 | class IDebugger 7 | { 8 | public: 9 | virtual void Step(int32_t stepCount, StepType type) = 0; 10 | }; -------------------------------------------------------------------------------- /Core/IInputProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class BaseControlDevice; 4 | 5 | class IInputProvider 6 | { 7 | public: 8 | virtual bool SetInput(BaseControlDevice* device) = 0; 9 | }; -------------------------------------------------------------------------------- /Core/IInputRecorder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class BaseControlDevice; 5 | 6 | class IInputRecorder 7 | { 8 | public: 9 | virtual void RecordInput(vector> devices) = 0; 10 | }; -------------------------------------------------------------------------------- /Core/IKeyManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | enum class MouseButton 5 | { 6 | LeftButton = 0, 7 | RightButton = 1, 8 | MiddleButton = 2, 9 | }; 10 | 11 | struct MousePosition 12 | { 13 | int16_t X; 14 | int16_t Y; 15 | }; 16 | 17 | struct MouseMovement 18 | { 19 | int16_t dx; 20 | int16_t dy; 21 | }; 22 | 23 | class IKeyManager 24 | { 25 | public: 26 | virtual ~IKeyManager() {} 27 | 28 | virtual void RefreshState() = 0; 29 | virtual void UpdateDevices() = 0; 30 | virtual bool IsMouseButtonPressed(MouseButton button) = 0; 31 | virtual bool IsKeyPressed(uint32_t keyCode) = 0; 32 | virtual vector GetPressedKeys() = 0; 33 | virtual string GetKeyName(uint32_t keyCode) = 0; 34 | virtual uint32_t GetKeyCode(string keyName) = 0; 35 | 36 | virtual void SetKeyState(uint16_t scanCode, bool state) = 0; 37 | virtual void ResetKeyState() = 0; 38 | virtual void SetDisabled(bool disabled) = 0; 39 | }; -------------------------------------------------------------------------------- /Core/IMemoryHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "DebugTypes.h" 4 | 5 | class IMemoryHandler 6 | { 7 | protected: 8 | SnesMemoryType _memoryType; 9 | 10 | public: 11 | IMemoryHandler(SnesMemoryType memType) 12 | { 13 | _memoryType = memType; 14 | } 15 | 16 | virtual ~IMemoryHandler() {} 17 | 18 | virtual uint8_t Read(uint32_t addr) = 0; 19 | virtual uint8_t Peek(uint32_t addr) = 0; 20 | virtual void PeekBlock(uint32_t addr, uint8_t *output) = 0; 21 | virtual void Write(uint32_t addr, uint8_t value) = 0; 22 | 23 | __forceinline SnesMemoryType GetMemoryType() 24 | { 25 | return _memoryType; 26 | } 27 | 28 | virtual AddressInfo GetAbsoluteAddress(uint32_t address) = 0; 29 | }; -------------------------------------------------------------------------------- /Core/INotificationListener.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | enum class ConsoleNotificationType 5 | { 6 | GameLoaded = 0, 7 | StateLoaded = 1, 8 | GameReset = 2, 9 | GamePaused = 3, 10 | GameResumed = 4, 11 | CodeBreak = 6, 12 | PpuFrameDone = 7, 13 | ResolutionChanged = 8, 14 | ConfigChanged = 9, 15 | ExecuteShortcut = 10, 16 | EmulationStopped = 11, 17 | BeforeEmulationStop = 12, 18 | ViewerRefresh = 13, 19 | EventViewerRefresh = 14, 20 | MissingFirmware = 15, 21 | BeforeGameUnload = 16, 22 | CheatsChanged = 17 23 | }; 24 | 25 | class INotificationListener 26 | { 27 | public: 28 | virtual void ProcessNotification(ConsoleNotificationType type, void* parameter) = 0; 29 | }; -------------------------------------------------------------------------------- /Core/IRenderingDevice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | class IRenderingDevice 6 | { 7 | public: 8 | virtual ~IRenderingDevice() {} 9 | virtual void UpdateFrame(void *frameBuffer, uint32_t width, uint32_t height) = 0; 10 | virtual void Render() = 0; 11 | virtual void Reset() = 0; 12 | virtual void SetFullscreenMode(bool fullscreen, void* windowHandle, uint32_t monitorWidth, uint32_t monitorHeight) = 0; 13 | }; -------------------------------------------------------------------------------- /Core/InputDataMessage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "NetMessage.h" 4 | #include "ControlDeviceState.h" 5 | 6 | class InputDataMessage : public NetMessage 7 | { 8 | private: 9 | ControlDeviceState _inputState; 10 | 11 | protected: 12 | void Serialize(Serializer &s) override 13 | { 14 | s.StreamVector(_inputState.State); 15 | } 16 | 17 | public: 18 | InputDataMessage(void* buffer, uint32_t length) : NetMessage(buffer, length) { } 19 | 20 | InputDataMessage(ControlDeviceState inputState) : NetMessage(MessageType::InputData) 21 | { 22 | _inputState = inputState; 23 | } 24 | 25 | ControlDeviceState GetInputState() 26 | { 27 | return _inputState; 28 | } 29 | }; -------------------------------------------------------------------------------- /Core/InputHud.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "SettingTypes.h" 4 | #include "ControlDeviceState.h" 5 | 6 | class Console; 7 | 8 | class InputHud 9 | { 10 | private: 11 | Console* _console; 12 | 13 | void DrawController(int port, ControlDeviceState state, int x, int y, int frameNumber); 14 | 15 | public: 16 | InputHud(Console *console); 17 | 18 | void DrawControllers(OverscanDimensions overscan, int frameNumber); 19 | }; -------------------------------------------------------------------------------- /Core/InternalRegisterTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | struct AluState 5 | { 6 | uint8_t MultOperand1; 7 | uint8_t MultOperand2; 8 | uint16_t MultOrRemainderResult; 9 | 10 | uint16_t Dividend; 11 | uint8_t Divisor; 12 | uint16_t DivResult; 13 | }; 14 | 15 | struct InternalRegisterState 16 | { 17 | bool EnableAutoJoypadRead; 18 | bool EnableFastRom; 19 | 20 | bool EnableNmi; 21 | bool EnableHorizontalIrq; 22 | bool EnableVerticalIrq; 23 | uint16_t HorizontalTimer; 24 | uint16_t VerticalTimer; 25 | 26 | uint8_t IoPortOutput; 27 | 28 | uint16_t ControllerData[4]; 29 | }; 30 | -------------------------------------------------------------------------------- /Core/LuaCallHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "../Lua/lua.hpp" 4 | 5 | template 6 | struct Nullable 7 | { 8 | bool HasValue = false; 9 | T Value = {}; 10 | }; 11 | 12 | class LuaCallHelper 13 | { 14 | private: 15 | int _stackSize = 0; 16 | int _paramCount = 0; 17 | int _returnCount = 0; 18 | lua_State* _lua; 19 | 20 | public: 21 | LuaCallHelper(lua_State* lua); 22 | 23 | void ForceParamCount(int paramCount); 24 | bool CheckParamCount(int minParamCount = -1); 25 | 26 | double ReadDouble(); 27 | bool ReadBool(bool defaultValue = false); 28 | uint32_t ReadInteger(uint32_t defaultValue = 0); 29 | string ReadString(); 30 | int GetReference(); 31 | 32 | Nullable ReadOptionalBool(); 33 | Nullable ReadOptionalInteger(); 34 | 35 | void Return(bool value); 36 | void Return(int value); 37 | void Return(uint32_t value); 38 | void Return(string value); 39 | 40 | int ReturnCount(); 41 | }; -------------------------------------------------------------------------------- /Core/MemoryMappings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "DebugTypes.h" 4 | 5 | class IMemoryHandler; 6 | 7 | class MemoryMappings 8 | { 9 | private: 10 | IMemoryHandler* _handlers[0x100 * 0x10] = {}; 11 | 12 | public: 13 | void RegisterHandler(uint8_t startBank, uint8_t endBank, uint16_t startPage, uint16_t endPage, vector>& handlers, uint16_t pageIncrement = 0, uint16_t startPageNumber = 0); 14 | void RegisterHandler(uint8_t startBank, uint8_t endBank, uint16_t startAddr, uint16_t endAddr, IMemoryHandler* handler); 15 | 16 | IMemoryHandler* GetHandler(uint32_t addr); 17 | AddressInfo GetAbsoluteAddress(uint32_t addr); 18 | int GetRelativeAddress(AddressInfo& absAddress, uint8_t startBank = 0); 19 | 20 | uint8_t Peek(uint32_t addr); 21 | uint16_t PeekWord(uint32_t addr); 22 | void PeekBlock(uint32_t addr, uint8_t * dest); 23 | 24 | void DebugWrite(uint32_t addr, uint8_t value); 25 | }; 26 | -------------------------------------------------------------------------------- /Core/MessageManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | #include "IMessageManager.h" 6 | #include 7 | #include "../Utilities/SimpleLock.h" 8 | 9 | #ifdef _DEBUG 10 | #define LogDebug(msg) MessageManager::Log(msg); 11 | #else 12 | #define LogDebug(msg) 13 | #endif 14 | 15 | class MessageManager 16 | { 17 | private: 18 | static IMessageManager* _messageManager; 19 | static std::unordered_map _enResources; 20 | 21 | static bool _osdEnabled; 22 | static SimpleLock _logLock; 23 | static SimpleLock _messageLock; 24 | static std::list _log; 25 | 26 | public: 27 | static void SetOsdState(bool enabled); 28 | 29 | static string Localize(string key); 30 | 31 | static void RegisterMessageManager(IMessageManager* messageManager); 32 | static void UnregisterMessageManager(IMessageManager* messageManager); 33 | static void DisplayMessage(string title, string message, string param1 = "", string param2 = ""); 34 | 35 | static void Log(string message = ""); 36 | static void ClearLog(); 37 | static string GetLog(); 38 | }; 39 | -------------------------------------------------------------------------------- /Core/MessageType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | enum class MessageType : uint8_t 5 | { 6 | HandShake = 0, 7 | SaveState = 1, 8 | InputData = 2, 9 | MovieData = 3, 10 | GameInformation = 4, 11 | PlayerList = 5, 12 | SelectController = 6, 13 | ForceDisconnect = 7, 14 | ServerInformation = 8 15 | }; -------------------------------------------------------------------------------- /Core/MovieDataMessage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "NetMessage.h" 4 | #include "ControlDeviceState.h" 5 | 6 | class MovieDataMessage : public NetMessage 7 | { 8 | private: 9 | uint8_t _portNumber; 10 | ControlDeviceState _inputState; 11 | 12 | protected: 13 | void Serialize(Serializer &s) override 14 | { 15 | s.Stream(_portNumber); 16 | s.StreamVector(_inputState.State); 17 | } 18 | 19 | public: 20 | MovieDataMessage(void* buffer, uint32_t length) : NetMessage(buffer, length) { } 21 | 22 | MovieDataMessage(ControlDeviceState state, uint8_t port) : NetMessage(MessageType::MovieData) 23 | { 24 | _portNumber = port; 25 | _inputState = state; 26 | } 27 | 28 | uint8_t GetPortNumber() 29 | { 30 | return _portNumber; 31 | } 32 | 33 | ControlDeviceState GetInputState() 34 | { 35 | return _inputState; 36 | } 37 | }; -------------------------------------------------------------------------------- /Core/MovieManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "MessageManager.h" 4 | #include "IInputProvider.h" 5 | #include "MovieTypes.h" 6 | 7 | class MovieRecorder; 8 | class VirtualFile; 9 | class Console; 10 | 11 | class IMovie : public IInputProvider 12 | { 13 | public: 14 | virtual bool Play(VirtualFile &file) = 0; 15 | virtual bool IsPlaying() = 0; 16 | }; 17 | 18 | class MovieManager 19 | { 20 | private: 21 | shared_ptr _console; 22 | shared_ptr _player; 23 | shared_ptr _recorder; 24 | 25 | public: 26 | MovieManager(shared_ptr console); 27 | 28 | void Record(RecordMovieOptions options); 29 | void Play(VirtualFile file, bool silent = false); 30 | void Stop(); 31 | bool Playing(); 32 | bool Recording(); 33 | }; -------------------------------------------------------------------------------- /Core/NecDspDisUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class DisassemblyInfo; 5 | class LabelManager; 6 | class EmuSettings; 7 | 8 | class NecDspDisUtils 9 | { 10 | public: 11 | static void GetDisassembly(DisassemblyInfo &info, string &out, uint32_t memoryAddr, LabelManager* labelManager, EmuSettings* settings); 12 | }; 13 | -------------------------------------------------------------------------------- /Core/NotificationManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "INotificationListener.h" 4 | #include "../Utilities/SimpleLock.h" 5 | 6 | class NotificationManager 7 | { 8 | private: 9 | SimpleLock _lock; 10 | vector> _listenersToAdd; 11 | vector> _listeners; 12 | 13 | void CleanupNotificationListeners(); 14 | 15 | public: 16 | void RegisterNotificationListener(shared_ptr notificationListener); 17 | void SendNotification(ConsoleNotificationType type, void* parameter = nullptr); 18 | }; 19 | -------------------------------------------------------------------------------- /Core/NtscFilter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "BaseVideoFilter.h" 4 | #include "../Utilities/snes_ntsc.h" 5 | 6 | class Console; 7 | 8 | class NtscFilter : public BaseVideoFilter 9 | { 10 | private: 11 | snes_ntsc_setup_t _ntscSetup; 12 | snes_ntsc_t _ntscData; 13 | uint32_t* _ntscBuffer; 14 | 15 | protected: 16 | void OnBeforeApplyFilter(); 17 | 18 | public: 19 | NtscFilter(shared_ptr console); 20 | virtual ~NtscFilter(); 21 | 22 | virtual void ApplyFilter(uint16_t *ppuOutputBuffer); 23 | virtual FrameInfo GetFrameInfo(); 24 | }; -------------------------------------------------------------------------------- /Core/Obc1.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "BaseCoprocessor.h" 4 | 5 | class Console; 6 | 7 | class Obc1 : public BaseCoprocessor 8 | { 9 | private: 10 | uint8_t *_ram; 11 | uint32_t _mask; 12 | 13 | uint16_t GetBaseAddress(); 14 | uint16_t GetLowAddress(); 15 | uint16_t GetHighAddress(); 16 | 17 | uint8_t ReadRam(uint16_t addr); 18 | void WriteRam(uint16_t addr, uint8_t value); 19 | 20 | public: 21 | Obc1(Console* console, uint8_t* saveRam, uint32_t saveRamSize); 22 | 23 | void Reset() override; 24 | 25 | uint8_t Read(uint32_t addr) override; 26 | void Write(uint32_t addr, uint8_t value) override; 27 | 28 | void Serialize(Serializer & s) override; 29 | 30 | uint8_t Peek(uint32_t addr) override; 31 | void PeekBlock(uint32_t addr, uint8_t * output) override; 32 | AddressInfo GetAbsoluteAddress(uint32_t address) override; 33 | }; -------------------------------------------------------------------------------- /Core/Ppu.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Core/Ppu.cpp -------------------------------------------------------------------------------- /Core/Profiler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "DebugTypes.h" 4 | 5 | class Debugger; 6 | class Console; 7 | 8 | struct ProfiledFunction 9 | { 10 | uint64_t ExclusiveCycles = 0; 11 | uint64_t InclusiveCycles = 0; 12 | uint64_t CallCount = 0; 13 | uint64_t MinCycles = UINT64_MAX; 14 | uint64_t MaxCycles = 0; 15 | AddressInfo Address; 16 | }; 17 | 18 | class Profiler 19 | { 20 | private: 21 | Debugger* _debugger; 22 | Console* _console; 23 | 24 | unordered_map _functions; 25 | 26 | deque _functionStack; 27 | deque _stackFlags; 28 | deque _cycleCountStack; 29 | 30 | uint64_t _currentCycleCount; 31 | uint64_t _prevMasterClock; 32 | int32_t _currentFunction; 33 | 34 | void InternalReset(); 35 | void UpdateCycles(); 36 | 37 | public: 38 | Profiler(Debugger* debugger); 39 | ~Profiler(); 40 | 41 | void StackFunction(AddressInfo& addr, StackFrameFlags stackFlag); 42 | void UnstackFunction(); 43 | 44 | void Reset(); 45 | void GetProfilerData(ProfiledFunction* profilerData, uint32_t& functionCount); 46 | }; -------------------------------------------------------------------------------- /Core/RegisterHandlerB.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "IMemoryHandler.h" 4 | #include "../Utilities/ISerializable.h" 5 | 6 | class Console; 7 | class Ppu; 8 | class Spc; 9 | class Sa1; 10 | class Msu1; 11 | class CheatManager; 12 | 13 | class RegisterHandlerB : public IMemoryHandler, public ISerializable 14 | { 15 | private: 16 | Console *_console; 17 | CheatManager *_cheatManager; 18 | Ppu *_ppu; 19 | Spc *_spc; 20 | Sa1 *_sa1; 21 | Msu1 *_msu1; 22 | 23 | uint8_t *_workRam; 24 | uint32_t _wramPosition; 25 | 26 | public: 27 | RegisterHandlerB(Console *console, Ppu *ppu, Spc *spc, uint8_t *workRam); 28 | 29 | uint8_t Read(uint32_t addr) override; 30 | uint8_t Peek(uint32_t addr) override; 31 | void PeekBlock(uint32_t addr, uint8_t *output) override; 32 | void Write(uint32_t addr, uint8_t value) override; 33 | 34 | AddressInfo GetAbsoluteAddress(uint32_t address) override; 35 | 36 | void Serialize(Serializer &s) override; 37 | }; -------------------------------------------------------------------------------- /Core/RewindData.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "RewindData.h" 3 | #include "Console.h" 4 | #include "SaveStateManager.h" 5 | #include "../Utilities/miniz.h" 6 | 7 | void RewindData::GetStateData(stringstream &stateData) 8 | { 9 | stateData.write((char*)SaveStateData.data(), SaveStateData.size()); 10 | } 11 | 12 | void RewindData::LoadState(shared_ptr &console) 13 | { 14 | if(SaveStateData.size() > 0) { 15 | stringstream stream; 16 | stream.write((char*)SaveStateData.data(), SaveStateData.size()); 17 | stream.seekg(0, ios::beg); 18 | 19 | console->Deserialize(stream, SaveStateManager::FileFormatVersion); 20 | } 21 | } 22 | 23 | void RewindData::SaveState(shared_ptr &console) 24 | { 25 | std::stringstream state; 26 | console->Serialize(state); 27 | 28 | string data = state.str(); 29 | SaveStateData = vector(data.c_str(), data.c_str()+data.size()); 30 | FrameCount = 0; 31 | } 32 | -------------------------------------------------------------------------------- /Core/RewindData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include 4 | #include "BaseControlDevice.h" 5 | 6 | class Console; 7 | 8 | class RewindData 9 | { 10 | private: 11 | vector SaveStateData; 12 | 13 | public: 14 | std::deque InputLogs[BaseControlDevice::PortCount]; 15 | int32_t FrameCount = 0; 16 | bool EndOfSegment = false; 17 | 18 | void GetStateData(stringstream &stateData); 19 | 20 | void LoadState(shared_ptr &console); 21 | void SaveState(shared_ptr &console); 22 | }; 23 | -------------------------------------------------------------------------------- /Core/RomHandler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "RamHandler.h" 4 | 5 | class RomHandler : public RamHandler 6 | { 7 | public: 8 | using RamHandler::RamHandler; 9 | 10 | void Write(uint32_t addr, uint8_t value) override 11 | { 12 | } 13 | }; -------------------------------------------------------------------------------- /Core/ScaleFilter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include "DefaultVideoFilter.h" 5 | 6 | class ScaleFilter 7 | { 8 | private: 9 | static bool _hqxInitDone; 10 | uint32_t _filterScale; 11 | ScaleFilterType _scaleFilterType; 12 | uint32_t *_outputBuffer = nullptr; 13 | uint32_t _width = 0; 14 | uint32_t _height = 0; 15 | 16 | void ApplyPrescaleFilter(uint32_t *inputArgbBuffer); 17 | void UpdateOutputBuffer(uint32_t width, uint32_t height); 18 | 19 | public: 20 | ScaleFilter(ScaleFilterType scaleFilterType, uint32_t scale); 21 | ~ScaleFilter(); 22 | 23 | uint32_t GetScale(); 24 | uint32_t* ApplyFilter(uint32_t *inputArgbBuffer, uint32_t width, uint32_t height, double scanlineIntensity); 25 | FrameInfo GetFrameInfo(FrameInfo baseFrameInfo); 26 | 27 | static shared_ptr GetScaleFilter(VideoFilterType filter); 28 | }; -------------------------------------------------------------------------------- /Core/ScriptHost.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "DebugTypes.h" 4 | #include "EventType.h" 5 | 6 | class ScriptingContext; 7 | class Debugger; 8 | 9 | class ScriptHost 10 | { 11 | private: 12 | shared_ptr _context; 13 | int _scriptId; 14 | 15 | public: 16 | ScriptHost(int scriptId); 17 | 18 | int GetScriptId(); 19 | const char* GetLog(); 20 | 21 | bool LoadScript(string scriptName, string scriptContent, Debugger* debugger); 22 | 23 | void ProcessMemoryOperation(uint32_t addr, uint8_t &value, MemoryOperationType type, CpuType cpuType); 24 | void ProcessEvent(EventType eventType); 25 | bool ProcessSavestate(); 26 | 27 | bool CheckStateLoadedFlag(); 28 | }; -------------------------------------------------------------------------------- /Core/ScriptManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "../Utilities/SimpleLock.h" 4 | #include "EventType.h" 5 | #include "DebugTypes.h" 6 | 7 | class Debugger; 8 | class ScriptHost; 9 | enum class MemoryOperationType; 10 | 11 | class ScriptManager 12 | { 13 | private: 14 | Debugger *_debugger; 15 | bool _hasScript; 16 | SimpleLock _scriptLock; 17 | int _nextScriptId; 18 | vector> _scripts; 19 | 20 | public: 21 | ScriptManager(Debugger *debugger); 22 | 23 | __forceinline bool HasScript() { return _hasScript; } 24 | int32_t LoadScript(string name, string content, int32_t scriptId); 25 | void RemoveScript(int32_t scriptId); 26 | const char* GetScriptLog(int32_t scriptId); 27 | void ProcessEvent(EventType type); 28 | void ProcessMemoryOperation(uint32_t address, uint8_t &value, MemoryOperationType type, CpuType cpuType); 29 | }; -------------------------------------------------------------------------------- /Core/Sdd1.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "BaseCoprocessor.h" 4 | #include "Sdd1Types.h" 5 | 6 | class Console; 7 | class Sdd1Mmc; 8 | 9 | class Sdd1 : public BaseCoprocessor 10 | { 11 | private: 12 | Sdd1State _state; 13 | unique_ptr _sdd1Mmc; 14 | IMemoryHandler* _cpuRegisterHandler; 15 | 16 | public: 17 | Sdd1(Console *console); 18 | 19 | void Serialize(Serializer &s) override; 20 | uint8_t Read(uint32_t addr) override; 21 | uint8_t Peek(uint32_t addr) override; 22 | void PeekBlock(uint32_t addr, uint8_t* output) override; 23 | void Write(uint32_t addr, uint8_t value) override; 24 | AddressInfo GetAbsoluteAddress(uint32_t address) override; 25 | void Reset() override; 26 | }; -------------------------------------------------------------------------------- /Core/Sdd1Mmc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "IMemoryHandler.h" 4 | #include "Sdd1Types.h" 5 | #include "Sdd1Decomp.h" 6 | #include "../Utilities/ISerializable.h" 7 | 8 | class BaseCartridge; 9 | 10 | class Sdd1Mmc : public IMemoryHandler, public ISerializable 11 | { 12 | private: 13 | Sdd1State* _state; 14 | vector> *_romHandlers; 15 | uint32_t _handlerMask; 16 | Sdd1Decomp _decompressor; 17 | 18 | IMemoryHandler* GetHandler(uint32_t addr); 19 | 20 | public: 21 | Sdd1Mmc(Sdd1State &state, BaseCartridge *cart); 22 | 23 | uint8_t ReadRom(uint32_t addr); 24 | 25 | // Inherited via IMemoryHandler 26 | virtual uint8_t Read(uint32_t addr) override; 27 | virtual uint8_t Peek(uint32_t addr) override; 28 | virtual void PeekBlock(uint32_t addr, uint8_t * output) override; 29 | virtual void Write(uint32_t addr, uint8_t value) override; 30 | virtual AddressInfo GetAbsoluteAddress(uint32_t address) override; 31 | 32 | void Serialize(Serializer &s) override; 33 | }; -------------------------------------------------------------------------------- /Core/Sdd1Types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | struct Sdd1State 5 | { 6 | uint8_t AllowDmaProcessing; 7 | uint8_t ProcessNextDma; 8 | uint8_t SelectedBanks[4]; 9 | 10 | uint32_t DmaAddress[8]; 11 | uint16_t DmaLength[8]; 12 | bool NeedInit; 13 | }; -------------------------------------------------------------------------------- /Core/SelectControllerMessage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "NetMessage.h" 4 | 5 | class SelectControllerMessage : public NetMessage 6 | { 7 | private: 8 | uint8_t _portNumber; 9 | 10 | protected: 11 | void Serialize(Serializer &s) override 12 | { 13 | s.Stream(_portNumber); 14 | } 15 | 16 | public: 17 | SelectControllerMessage(void* buffer, uint32_t length) : NetMessage(buffer, length) { } 18 | 19 | SelectControllerMessage(uint8_t port) : NetMessage(MessageType::SelectController) 20 | { 21 | _portNumber = port; 22 | } 23 | 24 | uint8_t GetPortNumber() 25 | { 26 | return _portNumber; 27 | } 28 | }; -------------------------------------------------------------------------------- /Core/ServerInformationMessage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "NetMessage.h" 4 | 5 | class ServerInformationMessage : public NetMessage 6 | { 7 | private: 8 | string _hashSalt; 9 | 10 | protected: 11 | void Serialize(Serializer &s) override 12 | { 13 | s.Stream(_hashSalt); 14 | } 15 | 16 | public: 17 | ServerInformationMessage(void* buffer, uint32_t length) : NetMessage(buffer, length) {} 18 | ServerInformationMessage(string hashSalt) : NetMessage(MessageType::ServerInformation) 19 | { 20 | _hashSalt = hashSalt; 21 | } 22 | 23 | string GetHashSalt() 24 | { 25 | return _hashSalt; 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /Core/SnesController.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "BaseControlDevice.h" 4 | #include "../Utilities/Serializer.h" 5 | 6 | class SnesController : public BaseControlDevice 7 | { 8 | private: 9 | uint32_t _stateBuffer = 0; 10 | uint8_t _turboSpeed = 0; 11 | 12 | protected: 13 | string GetKeyNames() override; 14 | void InternalSetStateFromInput() override; 15 | uint16_t ToByte(); 16 | void Serialize(Serializer &s) override; 17 | void RefreshStateBuffer() override; 18 | 19 | public: 20 | enum Buttons { A = 0, B, X, Y, L, R, Select, Start, Up, Down, Left, Right }; 21 | 22 | SnesController(Console* console, uint8_t port, KeyMappingSet keyMappings); 23 | 24 | ControllerType GetControllerType() override; 25 | uint8_t ReadRam(uint16_t addr) override; 26 | void WriteRam(uint16_t addr, uint8_t value) override; 27 | }; -------------------------------------------------------------------------------- /Core/SnesMemoryType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum class SnesMemoryType 4 | { 5 | CpuMemory, 6 | SpcMemory, 7 | Sa1Memory, 8 | NecDspMemory, 9 | GsuMemory, 10 | Cx4Memory, 11 | GameboyMemory, 12 | PrgRom, 13 | WorkRam, 14 | SaveRam, 15 | VideoRam, 16 | SpriteRam, 17 | CGRam, 18 | SpcRam, 19 | SpcRom, 20 | DspProgramRom, 21 | DspDataRom, 22 | DspDataRam, 23 | Sa1InternalRam, 24 | GsuWorkRam, 25 | Cx4DataRam, 26 | BsxPsRam, 27 | BsxMemoryPack, 28 | GbPrgRom, 29 | GbWorkRam, 30 | GbCartRam, 31 | GbHighRam, 32 | GbBootRom, 33 | GbVideoRam, 34 | GbSpriteRam, 35 | Register 36 | }; -------------------------------------------------------------------------------- /Core/SoundMixer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "IAudioDevice.h" 4 | 5 | class Console; 6 | class Equalizer; 7 | class SoundResampler; 8 | class WaveRecorder; 9 | 10 | class SoundMixer 11 | { 12 | private: 13 | IAudioDevice *_audioDevice; 14 | Console *_console; 15 | unique_ptr _equalizer; 16 | unique_ptr _resampler; 17 | shared_ptr _waveRecorder; 18 | int16_t *_sampleBuffer = nullptr; 19 | 20 | int16_t _leftSample = 0; 21 | int16_t _rightSample = 0; 22 | 23 | void ProcessEqualizer(int16_t *samples, uint32_t sampleCount); 24 | 25 | public: 26 | SoundMixer(Console *console); 27 | ~SoundMixer(); 28 | 29 | void PlayAudioBuffer(int16_t *samples, uint32_t sampleCount, uint32_t sourceRate); 30 | void StopAudio(bool clearBuffer = false); 31 | 32 | void RegisterAudioDevice(IAudioDevice *audioDevice); 33 | AudioStatistics GetStatistics(); 34 | double GetRateAdjustment(); 35 | 36 | void StartRecording(string filepath); 37 | void StopRecording(); 38 | bool IsRecording(); 39 | void GetLastSamples(int16_t &left, int16_t &right); 40 | }; 41 | -------------------------------------------------------------------------------- /Core/SoundResampler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "../Utilities/HermiteResampler.h" 4 | 5 | class Console; 6 | 7 | class SoundResampler 8 | { 9 | private: 10 | Console *_console; 11 | 12 | double _rateAdjustment = 1.0; 13 | double _previousTargetRate = 0; 14 | double _prevSpcSampleRate = 0; 15 | int32_t _underTarget = 0; 16 | 17 | HermiteResampler _resampler; 18 | 19 | double GetTargetRateAdjustment(); 20 | void UpdateTargetSampleRate(uint32_t sourceRate, uint32_t sampleRate); 21 | 22 | public: 23 | SoundResampler(Console *console); 24 | ~SoundResampler(); 25 | 26 | double GetRateAdjustment(); 27 | 28 | uint32_t Resample(int16_t *inSamples, uint32_t sampleCount, uint32_t sourceRate, uint32_t sampleRate, int16_t *outSamples); 29 | }; -------------------------------------------------------------------------------- /Core/SpcDisUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class DisassemblyInfo; 5 | class Console; 6 | class LabelManager; 7 | class EmuSettings; 8 | struct SpcState; 9 | 10 | class SpcDisUtils 11 | { 12 | public: 13 | static void GetDisassembly(DisassemblyInfo &info, string &out, uint32_t memoryAddr, LabelManager* labelManager, EmuSettings* settings); 14 | static int32_t GetEffectiveAddress(DisassemblyInfo &info, Console *console, SpcState &state); 15 | static uint8_t GetOpSize(uint8_t opCode); 16 | }; 17 | -------------------------------------------------------------------------------- /Core/SpcHud.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class Console; 5 | class SoundMixer; 6 | class DebugHud; 7 | class SpcFileData; 8 | 9 | class SpcHud 10 | { 11 | private: 12 | DebugHud* _hud; 13 | SoundMixer* _mixer; 14 | 15 | int8_t _volumesL[128] = {}; 16 | int8_t _volumesR[128] = {}; 17 | uint8_t _volPosition = 0; 18 | 19 | SpcFileData* _spcData; 20 | 21 | public: 22 | SpcHud(Console* console, SpcFileData* spcData); 23 | 24 | void Draw(uint32_t frame); 25 | }; -------------------------------------------------------------------------------- /Core/WaveRecorder.h: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | class WaveRecorder 4 | { 5 | private: 6 | std::ofstream _stream; 7 | uint32_t _streamSize; 8 | uint32_t _sampleRate; 9 | bool _isStereo; 10 | string _outputFile; 11 | 12 | void WriteHeader(); 13 | void UpdateSizeValues(); 14 | void CloseFile(); 15 | 16 | public: 17 | WaveRecorder(string outputFile, uint32_t sampleRate, bool isStereo); 18 | ~WaveRecorder(); 19 | 20 | bool WriteSamples(int16_t* samples, uint32_t sampleCount, uint32_t sampleRate, bool isStereo); 21 | }; -------------------------------------------------------------------------------- /Core/blargg_config.h: -------------------------------------------------------------------------------- 1 | // snes_spc 0.9.0 user configuration file. Don't replace when updating library. 2 | 3 | // snes_spc 0.9.0 4 | #ifndef BLARGG_CONFIG_H 5 | #define BLARGG_CONFIG_H 6 | 7 | // Uncomment to disable debugging checks 8 | //#define NDEBUG 1 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 if you get errors in the bool section of blargg_common.h 17 | //#define BLARGG_COMPILER_HAS_BOOL 1 18 | 19 | // Use standard config.h if present 20 | #ifdef HAVE_CONFIG_H 21 | #include "config.h" 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Core/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /Dependencies/DirectXTK.Debug.Static.x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Dependencies/DirectXTK.Debug.Static.x64.lib -------------------------------------------------------------------------------- /Dependencies/DirectXTK.Debug.Static.x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Dependencies/DirectXTK.Debug.Static.x86.lib -------------------------------------------------------------------------------- /Dependencies/DirectXTK.Release.Static.x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Dependencies/DirectXTK.Release.Static.x64.lib -------------------------------------------------------------------------------- /Dependencies/DirectXTK.Release.Static.x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Dependencies/DirectXTK.Release.Static.x86.lib -------------------------------------------------------------------------------- /DependencyPacker/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using System.IO.Compression; 8 | 9 | namespace DependencyPacker 10 | { 11 | class Program 12 | { 13 | static void Main(string[] args) 14 | { 15 | if(File.Exists("Dependencies.zip")) { 16 | File.Delete("Dependencies.zip"); 17 | } 18 | ZipFile.CreateFromDirectory("Dependencies", "Dependencies.zip"); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Docs/README.md: -------------------------------------------------------------------------------- 1 | This is the source code/resources used to build the documentation website located at [https://www.mesen.ca/snes/docs/](https://www.mesen.ca/snes/docs/) 2 | 3 | It requires hugo to build. You can download hugo here: [https://gohugo.io/](https://gohugo.io/). 4 | 5 | Use the "build.cmd" batch file to build a copy of the documentation - it will be saved to the "docs" subfolder. -------------------------------------------------------------------------------- /Docs/build.cmd: -------------------------------------------------------------------------------- 1 | hugo 2 | del docs\js\searchjson.js 3 | echo var searchjson = >>docs\js\searchjson.js 4 | type docs\index.json>>docs\js\searchjson.js 5 | -------------------------------------------------------------------------------- /Docs/config.toml: -------------------------------------------------------------------------------- 1 | baseURL = "" 2 | relativeURLS = true 3 | uglyURLs = true 4 | languageCode = "en-us" 5 | title = "Mesen-S Documentation" 6 | theme = "learn" 7 | publishDir = "docs" 8 | 9 | [outputs] 10 | home = [ "HTML", "RSS", "JSON"] 11 | 12 | [params] 13 | themeVariant = "green" 14 | mesenVersion = "0.4.0" 15 | 16 | [[menu.shortcuts]] 17 | name = " Website" 18 | identifier = "website" 19 | url = "https://www.mesen.ca" 20 | weight = 9 21 | 22 | [[menu.shortcuts]] 23 | name = " GitHub" 24 | identifier = "github" 25 | url = "https://github.com/SourMesen/Mesen-S" 26 | weight = 10 27 | -------------------------------------------------------------------------------- /Docs/content/apireference/Changelog.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Changelog 3 | weight: 1 4 | pre: "" 5 | chapter: false 6 | --- 7 | 8 | ## Changes between 0.1.0 and 0.5.0 ## 9 | 10 | * First version of the documentation - no documented changes. 11 | -------------------------------------------------------------------------------- /Docs/content/apireference/Logging.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Logging 3 | weight: 25 4 | pre: "" 5 | chapter: false 6 | --- 7 | 8 | ## displayMessage ## 9 | 10 | **Syntax** 11 | 12 | emu.displayMessage(category, text) 13 | 14 | **Parameters** 15 | category - *String* The category is the portion shown between brackets [] 16 | text - *String* Text to show on the screen 17 | 18 | **Return value** 19 | *None* 20 | 21 | **Description** 22 | Displays a message on the main window in the format "[category] text" 23 | 24 | ## log ## 25 | 26 | **Syntax** 27 | 28 | emu.log(text) 29 | 30 | **Parameters** 31 | text - *String* Text to log 32 | 33 | **Return value** 34 | *None* 35 | 36 | **Description** 37 | Logs the given string in the script's log window - useful for debugging scripts. 38 | -------------------------------------------------------------------------------- /Docs/content/debugging/DebugLog.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Debug Log 3 | weight: 12 4 | chapter: false 5 | --- 6 | 7 |
8 | 9 | Debug Log 10 |
11 | 12 | The debug log displays various emulation-related events. Currently, these include: 13 | 14 | * Uninitialized memory reads 15 | * SGB command packets -------------------------------------------------------------------------------- /Docs/content/debugging/RegisterViewer.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Register Viewer 3 | weight: 21 4 | chapter: false 5 | --- 6 | 7 |
8 | 9 | Register Viewer 10 |
11 | 12 | The register viewer displays the state of most chips in the SNES (PPU, SPC, DSP, etc.) in a list format. The data for each chip is shown in a separate tab. For Game Boy games (including Game Boy Color and Super Game Boy), a `Game Boy` tab will be shown. -------------------------------------------------------------------------------- /Docs/static/images/Assembler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/Assembler.png -------------------------------------------------------------------------------- /Docs/static/images/AudioOptions_Advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/AudioOptions_Advanced.png -------------------------------------------------------------------------------- /Docs/static/images/AudioOptions_General.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/AudioOptions_General.png -------------------------------------------------------------------------------- /Docs/static/images/BreakpointList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/BreakpointList.png -------------------------------------------------------------------------------- /Docs/static/images/CallStack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/CallStack.png -------------------------------------------------------------------------------- /Docs/static/images/CheatDbImport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/CheatDbImport.png -------------------------------------------------------------------------------- /Docs/static/images/CheatList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/CheatList.png -------------------------------------------------------------------------------- /Docs/static/images/CodeWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/CodeWindow.png -------------------------------------------------------------------------------- /Docs/static/images/ConfigWizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/ConfigWizard.png -------------------------------------------------------------------------------- /Docs/static/images/DebugLog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/DebugLog.png -------------------------------------------------------------------------------- /Docs/static/images/DebuggerWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/DebuggerWindow.png -------------------------------------------------------------------------------- /Docs/static/images/EditBreakpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/EditBreakpoint.png -------------------------------------------------------------------------------- /Docs/static/images/EditCheat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/EditCheat.png -------------------------------------------------------------------------------- /Docs/static/images/EditLabel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/EditLabel.png -------------------------------------------------------------------------------- /Docs/static/images/EmulationSettings_Advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/EmulationSettings_Advanced.png -------------------------------------------------------------------------------- /Docs/static/images/EmulationSettings_Bsx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/EmulationSettings_Bsx.png -------------------------------------------------------------------------------- /Docs/static/images/EmulationSettings_General.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/EmulationSettings_General.png -------------------------------------------------------------------------------- /Docs/static/images/EmulationSettings_Overclocking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/EmulationSettings_Overclocking.png -------------------------------------------------------------------------------- /Docs/static/images/EmulationStatus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/EmulationStatus.png -------------------------------------------------------------------------------- /Docs/static/images/EventViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/EventViewer.png -------------------------------------------------------------------------------- /Docs/static/images/EventViewer_ListView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/EventViewer_ListView.png -------------------------------------------------------------------------------- /Docs/static/images/GameMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/GameMenu.png -------------------------------------------------------------------------------- /Docs/static/images/GameSelectionScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/GameSelectionScreen.png -------------------------------------------------------------------------------- /Docs/static/images/Gameboy_Audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/Gameboy_Audio.png -------------------------------------------------------------------------------- /Docs/static/images/Gameboy_General.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/Gameboy_General.png -------------------------------------------------------------------------------- /Docs/static/images/Gameboy_Video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/Gameboy_Video.png -------------------------------------------------------------------------------- /Docs/static/images/GoToAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/GoToAll.png -------------------------------------------------------------------------------- /Docs/static/images/ImportExportMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/ImportExportMenu.png -------------------------------------------------------------------------------- /Docs/static/images/InputOptions_Advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/InputOptions_Advanced.png -------------------------------------------------------------------------------- /Docs/static/images/InputOptions_Controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/InputOptions_Controller.png -------------------------------------------------------------------------------- /Docs/static/images/InputOptions_General.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/InputOptions_General.png -------------------------------------------------------------------------------- /Docs/static/images/IntegrationSettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/IntegrationSettings.png -------------------------------------------------------------------------------- /Docs/static/images/LabelList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/LabelList.png -------------------------------------------------------------------------------- /Docs/static/images/LogWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/LogWindow.png -------------------------------------------------------------------------------- /Docs/static/images/MemoryAccessCounters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/MemoryAccessCounters.png -------------------------------------------------------------------------------- /Docs/static/images/MemoryMappings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/MemoryMappings.png -------------------------------------------------------------------------------- /Docs/static/images/MemoryViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/MemoryViewer.png -------------------------------------------------------------------------------- /Docs/static/images/MemoryViewerTbl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/MemoryViewerTbl.png -------------------------------------------------------------------------------- /Docs/static/images/MesenIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/MesenIcon.png -------------------------------------------------------------------------------- /Docs/static/images/MovieRecordingOptions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/MovieRecordingOptions.png -------------------------------------------------------------------------------- /Docs/static/images/NetplayConnect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/NetplayConnect.png -------------------------------------------------------------------------------- /Docs/static/images/NetplayHost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/NetplayHost.png -------------------------------------------------------------------------------- /Docs/static/images/OptionsMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/OptionsMenu.png -------------------------------------------------------------------------------- /Docs/static/images/PaletteViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/PaletteViewer.png -------------------------------------------------------------------------------- /Docs/static/images/Preferences_Advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/Preferences_Advanced.png -------------------------------------------------------------------------------- /Docs/static/images/Preferences_FoldersFiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/Preferences_FoldersFiles.png -------------------------------------------------------------------------------- /Docs/static/images/Preferences_General.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/Preferences_General.png -------------------------------------------------------------------------------- /Docs/static/images/Preferences_ShortcutKeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/Preferences_ShortcutKeys.png -------------------------------------------------------------------------------- /Docs/static/images/Profiler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/Profiler.png -------------------------------------------------------------------------------- /Docs/static/images/RegisterViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/RegisterViewer.png -------------------------------------------------------------------------------- /Docs/static/images/ScriptWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/ScriptWindow.png -------------------------------------------------------------------------------- /Docs/static/images/SourceView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/SourceView.png -------------------------------------------------------------------------------- /Docs/static/images/SpcPlayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/SpcPlayer.png -------------------------------------------------------------------------------- /Docs/static/images/SpriteViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/SpriteViewer.png -------------------------------------------------------------------------------- /Docs/static/images/TileViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/TileViewer.png -------------------------------------------------------------------------------- /Docs/static/images/TilemapViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/TilemapViewer.png -------------------------------------------------------------------------------- /Docs/static/images/ToolsMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/ToolsMenu.png -------------------------------------------------------------------------------- /Docs/static/images/TraceLogger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/TraceLogger.png -------------------------------------------------------------------------------- /Docs/static/images/VideoOptions_Advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/VideoOptions_Advanced.png -------------------------------------------------------------------------------- /Docs/static/images/VideoOptions_General.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/VideoOptions_General.png -------------------------------------------------------------------------------- /Docs/static/images/VideoOptions_Overscan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/VideoOptions_Overscan.png -------------------------------------------------------------------------------- /Docs/static/images/VideoOptions_Picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/VideoOptions_Picture.png -------------------------------------------------------------------------------- /Docs/static/images/VideoRecording.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/VideoRecording.png -------------------------------------------------------------------------------- /Docs/static/images/WatchList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/WatchList.png -------------------------------------------------------------------------------- /Docs/static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/favicon.png -------------------------------------------------------------------------------- /Docs/static/images/patreon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/static/images/patreon.png -------------------------------------------------------------------------------- /Docs/themes/learn/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | public/ 3 | exampleSite/public 4 | -------------------------------------------------------------------------------- /Docs/themes/learn/archetypes/chapter.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "{{ replace .TranslationBaseName "-" " " | title }}" 3 | date = {{ .Date }} 4 | weight = 5 5 | chapter = true 6 | pre = "X. " 7 | +++ 8 | 9 | ### Chapter X 10 | 11 | # Some Chapter title 12 | 13 | Lorem Ipsum. -------------------------------------------------------------------------------- /Docs/themes/learn/archetypes/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "{{ replace .TranslationBaseName "-" " " | title }}" 3 | date = {{ .Date }} 4 | weight = 5 5 | +++ 6 | 7 | Lorem Ipsum. -------------------------------------------------------------------------------- /Docs/themes/learn/i18n/en.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "Search..." 3 | 4 | [Clear-History] 5 | other = "Clear History" 6 | 7 | [Attachments-label] 8 | other = "Attachments" 9 | 10 | [title-404] 11 | other = "Error" 12 | 13 | [message-404] 14 | other = "Woops. Looks like this page doesn't exist ¯\\_(ツ)_/¯." 15 | 16 | [Go-to-homepage] 17 | other = "Go to homepage" 18 | 19 | [Edit-this-page] 20 | other = "Edit this page" 21 | 22 | [Shortcuts-Title] 23 | other = "More" 24 | 25 | [Expand-title] 26 | other = "Expand me..." -------------------------------------------------------------------------------- /Docs/themes/learn/i18n/fr.toml: -------------------------------------------------------------------------------- 1 | [Search-placeholder] 2 | other = "Rechercher..." 3 | 4 | [Clear-History] 5 | other = "Supprimer l'historique" 6 | 7 | [Attachments-label] 8 | other = "Pièces jointes" 9 | 10 | [title-404] 11 | other = "Erreur" 12 | 13 | [message-404] 14 | other = "Oups. On dirait que cette page n'existe pas ¯\\_(ツ)_/¯" 15 | 16 | [Go-to-homepage] 17 | other = "Vers la page d'accueil" 18 | 19 | [Edit-this-page] 20 | other = "Modifier la page" 21 | 22 | [Shortcuts-Title] 23 | other = "Aller plus loin" 24 | 25 | [Expand-title] 26 | other = "Déroulez-moi..." -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ partial "header.html" . }} 2 | 3 | {{ if ne .Params.toc false }} 4 |
5 |
{{.TableOfContents}}
6 |
7 | {{ end }} 8 | 9 | {{ .Content }} 10 | 11 |
12 | {{with .Params.LastModifierDisplayName}} 13 | {{ . }} {{with $.Date}} {{ .Format "02/01/2006" }}{{end}} 14 | 15 | {{end}} 16 |
17 | 18 | {{ partial "footer.html" . }} -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ partial "header.html" . }} 2 | 3 | {{ if ne .Params.toc false }} 4 | {{ if .TableOfContents }} 5 |
6 |
{{.TableOfContents}}
7 |
8 | {{ end }} 9 | {{ end }} 10 | 11 | {{ .Content }} 12 | 13 |
14 | {{with .Params.LastModifierDisplayName}} 15 | {{ . }} {{with $.Date}} {{ .Format "02/01/2006" }}{{end}} 16 | 17 | {{end}} 18 |
19 | 20 | 21 | {{ partial "footer.html" . }} 22 | -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/index.json: -------------------------------------------------------------------------------- 1 | [{{ range $index, $page := .Site.Pages }} 2 | {{- if ne $page.Type "json" -}} 3 | {{- if and $index (gt $index 0) -}},{{- end }} 4 | { 5 | "uri": "{{ $page.Permalink }}", 6 | "title": "{{ htmlEscape $page.Title}}", 7 | "tags": [{{ range $tindex, $tag := $page.Params.tags }}{{ if $tindex }}, {{ end }}"{{ $tag| htmlEscape }}"{{ end }}], 8 | "description": "{{ htmlEscape .Description}}", 9 | "content": {{$page.Plain | jsonify}} 10 | } 11 | {{- end -}} 12 | {{- end -}}] -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/partials/custom-footer.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/partials/custom-header.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/partials/favicon.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/partials/logo.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/partials/menu-footer.html: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/partials/meta.html: -------------------------------------------------------------------------------- 1 | 2 | {{ with .Site.Params.author }}{{ end }} 3 | -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/partials/toc.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ .TableOfContents }} 4 |
5 |
6 | -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/shortcodes/button.html: -------------------------------------------------------------------------------- 1 | 2 | {{ $icon := .Get "icon" }} 3 | {{ $iconposition := .Get "icon-position" }} 4 | {{ if ($icon) }} 5 | {{ if or (not ($iconposition)) (eq $iconposition "left") }} 6 | 7 | {{ end }} 8 | {{ end }} 9 | {{ .Inner }} 10 | {{ if and ($icon) (eq $iconposition "right")}} 11 | 12 | {{ end }} 13 | 14 | -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/shortcodes/expand.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 | {{$expandMessage := T "Expand-title"}} 6 | {{ if .IsNamedParams }} 7 | {{.Get "default" | default $expandMessage}} 8 | {{else}} 9 | {{.Get 0 | default $expandMessage}} 10 | {{end}} 11 | 12 |
13 | 16 |
-------------------------------------------------------------------------------- /Docs/themes/learn/layouts/shortcodes/mermaid.html: -------------------------------------------------------------------------------- 1 |
{{ safeHTML .Inner }}
2 | -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/shortcodes/notice.html: -------------------------------------------------------------------------------- 1 |
{{ .Inner }}
2 | -------------------------------------------------------------------------------- /Docs/themes/learn/layouts/shortcodes/relref.html: -------------------------------------------------------------------------------- 1 | {{- if in (.Get 0) "/_index.md" -}} 2 | {{- $path := (trim (.Get 0) "_index.md") -}} 3 | {{- with .Site.GetPage "section" (trim $path "/") -}} 4 | {{- .URL -}} 5 | {{- end -}} 6 | {{- else -}} 7 | {{- with .Site.GetPage "section" (.Get 0) }} 8 | {{- .URL -}} 9 | {{- else -}} 10 | {{- .Get 0 | relref .Page -}} 11 | {{- end -}} 12 | {{- end -}} -------------------------------------------------------------------------------- /Docs/themes/learn/static/css/horsey.css: -------------------------------------------------------------------------------- 1 | .sey-list { 2 | display: none; 3 | position: absolute; 4 | padding: 0; 5 | margin: 0; 6 | list-style-type: none; 7 | box-shadow: 1px 2px 6px; 8 | background-color: #fff; 9 | color: #333; 10 | transition: left 0.1s ease-in-out; 11 | max-height: 70vh; 12 | overflow: auto; 13 | width: 265px; 14 | } 15 | .sey-show { 16 | display: block; 17 | } 18 | .sey-hide { 19 | display: none; 20 | } 21 | .sey-item { 22 | cursor: pointer; 23 | overflow: hidden; 24 | white-space: nowrap; 25 | text-overflow: ellipsis; 26 | padding: 7px; 27 | } 28 | .sey-item:hover { 29 | background-color: #444; 30 | color: #fff; 31 | } 32 | .sey-selected { 33 | background-color: #333; 34 | color: #fff; 35 | } 36 | -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Inconsolata.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Inconsolata.eot -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Inconsolata.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Inconsolata.ttf -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Inconsolata.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Inconsolata.woff -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Novecentosanswide-Normal-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Novecentosanswide-Normal-webfont.eot -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Novecentosanswide-Normal-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Novecentosanswide-Normal-webfont.ttf -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Novecentosanswide-Normal-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Novecentosanswide-Normal-webfont.woff -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Novecentosanswide-Normal-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Novecentosanswide-Normal-webfont.woff2 -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Novecentosanswide-UltraLight-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Novecentosanswide-UltraLight-webfont.eot -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Novecentosanswide-UltraLight-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Novecentosanswide-UltraLight-webfont.ttf -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Novecentosanswide-UltraLight-webfont.woff2 -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_200.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_200.eot -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_200.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_200.ttf -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_200.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_200.woff -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_200.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_200.woff2 -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_300.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_300.eot -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_300.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_300.ttf -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_300.woff -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_300.woff2 -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_500.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_500.eot -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_500.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_500.ttf -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_500.woff -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/Work_Sans_500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/Work_Sans_500.woff2 -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /Docs/themes/learn/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /Docs/themes/learn/static/images/clippy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Docs/themes/learn/static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/images/favicon.png -------------------------------------------------------------------------------- /Docs/themes/learn/static/images/gopher-404.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Docs/themes/learn/static/images/gopher-404.jpg -------------------------------------------------------------------------------- /Docs/themes/learn/theme.toml: -------------------------------------------------------------------------------- 1 | # theme.toml template for a Hugo theme 2 | # See https://github.com/spf13/hugoThemes#themetoml for an example 3 | 4 | name = "Learn" 5 | license = "MIT" 6 | licenselink = "https://github.com/matcornic/hugo-theme-learn/blob/master/LICENSE.md" 7 | description = "Documentation theme for Hugo, based on Grav Learn theme" 8 | homepage = "https://github.com/matcornic/hugo-theme-learn/" 9 | repo = "https://github.com/matcornic/hugo-theme-learn" 10 | tags = ["documentation", "grav", "learn", "doc", "search"] 11 | features = ["documentation", "menu", "nested sections", "search", "mermaid"] 12 | min_version = 0.25 13 | 14 | [author] 15 | name = "Mathieu Cornic" 16 | homepage = "http://matcornic.github.io/" 17 | 18 | [original] 19 | name = "Grav Learn" 20 | homepage = "http://learn.getgrav.org/" 21 | repo = "https://github.com/getgrav/grav-learn" 22 | -------------------------------------------------------------------------------- /Docs/themes/learn/wercker.yml: -------------------------------------------------------------------------------- 1 | box: golang 2 | build: 3 | steps: 4 | # Sets the go workspace and places you package 5 | # at the right place in the workspace tree 6 | - setup-go-workspace 7 | 8 | # Gets the dependencies 9 | - script: 10 | name: get hugo 11 | code: | 12 | go get github.com/gohugoio/hugo 13 | 14 | # Build the project 15 | - script: 16 | name: build site 17 | code: | 18 | cd exampleSite && hugo -------------------------------------------------------------------------------- /InteropDLL/InteropNotificationListener.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "../Core/INotificationListener.h" 4 | #include "../Core/NotificationManager.h" 5 | 6 | typedef void(__stdcall *NotificationListenerCallback)(int, void*); 7 | 8 | class InteropNotificationListener : public INotificationListener 9 | { 10 | NotificationListenerCallback _callback; 11 | 12 | public: 13 | InteropNotificationListener(NotificationListenerCallback callback) 14 | { 15 | _callback = callback; 16 | } 17 | 18 | virtual ~InteropNotificationListener() 19 | { 20 | } 21 | 22 | void ProcessNotification(ConsoleNotificationType type, void* parameter) 23 | { 24 | _callback((int)type, parameter); 25 | } 26 | }; -------------------------------------------------------------------------------- /InteropDLL/TestApiWrapper.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "../Core/RecordedRomTest.h" 3 | #include "../Core/Console.h" 4 | 5 | extern shared_ptr _console; 6 | shared_ptr _recordedRomTest; 7 | 8 | extern "C" 9 | { 10 | DllExport int32_t __stdcall RunRecordedTest(char* filename, bool inBackground) 11 | { 12 | shared_ptr romTest(new RecordedRomTest(inBackground ? nullptr : _console)); 13 | return romTest->Run(filename); 14 | } 15 | 16 | DllExport void __stdcall RomTestRecord(char* filename, bool reset) 17 | { 18 | _recordedRomTest.reset(new RecordedRomTest(_console)); 19 | _recordedRomTest->Record(filename, reset); 20 | } 21 | 22 | DllExport void __stdcall RomTestStop() 23 | { 24 | if(_recordedRomTest) { 25 | _recordedRomTest->Stop(); 26 | _recordedRomTest.reset(); 27 | } 28 | } 29 | 30 | DllExport bool __stdcall RomTestRecording() { return _recordedRomTest != nullptr; } 31 | } -------------------------------------------------------------------------------- /InteropDLL/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // InteropDLL.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /Libretro/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.so 3 | *.dylib 4 | *.bc 5 | *.dll 6 | -------------------------------------------------------------------------------- /Libretro/Libretro.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Libretro/LibretroMessageManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "libretro.h" 3 | #include "../Core/IMessageManager.h" 4 | #include "../Core/MessageManager.h" 5 | 6 | class LibretroMessageManager : public IMessageManager 7 | { 8 | private: 9 | retro_log_printf_t _log = nullptr; 10 | retro_environment_t _retroEnv = nullptr; 11 | 12 | public: 13 | LibretroMessageManager(retro_log_printf_t logCallback, retro_environment_t retroEnv) 14 | { 15 | _log = logCallback; 16 | _retroEnv = retroEnv; 17 | MessageManager::RegisterMessageManager(this); 18 | } 19 | 20 | virtual ~LibretroMessageManager() 21 | { 22 | MessageManager::RegisterMessageManager(nullptr); 23 | } 24 | 25 | // Inherited via IMessageManager 26 | virtual void DisplayMessage(string title, string message) override 27 | { 28 | if(title.empty()) { 29 | if(_log) { 30 | _log(RETRO_LOG_INFO, message.c_str()); 31 | } 32 | } else { 33 | string osdMessage = "[" + title + "] " + message; 34 | retro_message msg = { osdMessage.c_str(), 180 }; 35 | _retroEnv(RETRO_ENVIRONMENT_SET_MESSAGE, &msg); 36 | } 37 | } 38 | }; -------------------------------------------------------------------------------- /Libretro/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ROOT_DIR := $(LOCAL_PATH)/../.. 4 | CORE_DIR := $(ROOT_DIR)/Core 5 | LIBRETRO_DIR := $(ROOT_DIR)/Libretro 6 | SEVENZIP_DIR := $(ROOT_DIR)/SevenZip 7 | UTIL_DIR := $(ROOT_DIR)/Utilities 8 | 9 | HAVE_NETWORK := 1 10 | 11 | include $(LIBRETRO_DIR)/Makefile.common 12 | 13 | COREFLAGS := -DLIBRETRO 14 | 15 | GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" 16 | ifneq ($(GIT_VERSION)," unknown") 17 | COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" 18 | endif 19 | 20 | include $(CLEAR_VARS) 21 | LOCAL_MODULE := retro 22 | LOCAL_SRC_FILES := $(SOURCES_CXX) $(SOURCES_C) 23 | LOCAL_CFLAGS := $(COREFLAGS) 24 | LOCAL_CXXFLAGS := $(COREFLAGS) -std=c++11 25 | LOCAL_LDFLAGS := -Wl,-version-script=$(LIBRETRO_DIR)/link.T 26 | LOCAL_CPP_FEATURES := exceptions rtti 27 | include $(BUILD_SHARED_LIBRARY) 28 | -------------------------------------------------------------------------------- /Libretro/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL:=c++_static 2 | APP_ABI := all 3 | 4 | # Don't strip debug builds 5 | ifeq ($(NDK_DEBUG),1) 6 | cmd-strip := 7 | endif 8 | -------------------------------------------------------------------------------- /Libretro/link.T: -------------------------------------------------------------------------------- 1 | { 2 | global: retro_*; 3 | local: *; 4 | }; 5 | 6 | -------------------------------------------------------------------------------- /Linux/LinuxGameController.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | struct libevdev; 6 | class Console; 7 | 8 | class LinuxGameController 9 | { 10 | private: 11 | int _fd = -1; 12 | int _deviceID = -1; 13 | libevdev *_device = nullptr; 14 | bool _disconnected = false; 15 | std::thread _eventThread; 16 | std::atomic _stopFlag; 17 | shared_ptr _console; 18 | int _axisDefaultValue[0x100]; 19 | 20 | LinuxGameController(shared_ptr console, int deviceID, int fileDescriptor, libevdev *device); 21 | bool CheckAxis(unsigned int code, bool forPositive); 22 | void Calibrate(); 23 | 24 | public: 25 | ~LinuxGameController(); 26 | 27 | static std::shared_ptr GetController(shared_ptr console, int deviceID, bool logInformation); 28 | 29 | bool IsDisconnected(); 30 | int GetDeviceID(); 31 | bool IsButtonPressed(int buttonNumber); 32 | }; -------------------------------------------------------------------------------- /Lua/compat.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPAT_H 2 | #define COMPAT_H 3 | 4 | #include "lua.h" 5 | #include "lauxlib.h" 6 | 7 | #ifndef _WIN32 8 | #define gai_strerrorA gai_strerror 9 | #endif 10 | 11 | #if LUA_VERSION_NUM==501 12 | void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup); 13 | void *luaL_testudata ( lua_State *L, int arg, const char *tname); 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Lua/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h,v 2.9 2015/03/06 19:49:50 roberto Exp $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include "llimits.h" 12 | #include "lstate.h" 13 | 14 | #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ 15 | "stack overflow");} 16 | 17 | #define adjustresults(L,nres) \ 18 | { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } 19 | 20 | #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ 21 | "not enough elements in the stack") 22 | 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Lua/lprefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lprefix.h,v 1.2 2014/12/29 16:54:13 roberto Exp $ 3 | ** Definitions for Lua code that must come before any other header file 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lprefix_h 8 | #define lprefix_h 9 | 10 | 11 | /* 12 | ** Allows POSIX/XSI stuff 13 | */ 14 | #if !defined(LUA_USE_C89) /* { */ 15 | 16 | #if !defined(_XOPEN_SOURCE) 17 | #define _XOPEN_SOURCE 600 18 | #elif _XOPEN_SOURCE == 0 19 | #undef _XOPEN_SOURCE /* use -D_XOPEN_SOURCE=0 to undefine it */ 20 | #endif 21 | 22 | /* 23 | ** Allows manipulation of large files in gcc and some other compilers 24 | */ 25 | #if !defined(LUA_32BITS) && !defined(_FILE_OFFSET_BITS) 26 | #define _LARGEFILE_SOURCE 1 27 | #define _FILE_OFFSET_BITS 64 28 | #endif 29 | 30 | #endif /* } */ 31 | 32 | 33 | /* 34 | ** Windows stuff 35 | */ 36 | #if defined(_WIN32) /* { */ 37 | 38 | #if !defined(_CRT_SECURE_NO_WARNINGS) 39 | #define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */ 40 | #endif 41 | 42 | #endif /* } */ 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /Lua/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "lua.h" 7 | #include "lualib.h" 8 | #include "lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /Lua/luasocket.hpp: -------------------------------------------------------------------------------- 1 | extern "C" { 2 | #include "luasocket.h" 3 | #include "mime.h" 4 | } 5 | -------------------------------------------------------------------------------- /Lua/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h,v 1.45 2015/09/08 15:41:05 roberto Exp $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include "llimits.h" 11 | #include "lobject.h" 12 | #include "lzio.h" 13 | 14 | 15 | /* data to catch conversion errors */ 16 | #define LUAC_DATA "\x19\x93\r\n\x1a\n" 17 | 18 | #define LUAC_INT 0x5678 19 | #define LUAC_NUM cast_num(370.5) 20 | 21 | #define MYINT(s) (s[0]-'0') 22 | #define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) 23 | #define LUAC_FORMAT 0 /* this is the official format */ 24 | 25 | /* load one chunk; from lundump.c */ 26 | LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); 27 | 28 | /* dump one chunk; from ldump.c */ 29 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, 30 | void* data, int strip); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Lua/select.h: -------------------------------------------------------------------------------- 1 | #ifndef SELECT_H 2 | #define SELECT_H 3 | /*=========================================================================*\ 4 | * Select implementation 5 | * LuaSocket toolkit 6 | * 7 | * Each object that can be passed to the select function has to export 8 | * method getfd() which returns the descriptor to be passed to the 9 | * underlying select function. Another method, dirty(), should return 10 | * true if there is data ready for reading (required for buffered input). 11 | \*=========================================================================*/ 12 | 13 | int select_open(lua_State *L); 14 | 15 | #endif /* SELECT_H */ 16 | -------------------------------------------------------------------------------- /Lua/udp.h: -------------------------------------------------------------------------------- 1 | #ifndef UDP_H 2 | #define UDP_H 3 | /*=========================================================================*\ 4 | * UDP object 5 | * LuaSocket toolkit 6 | * 7 | * The udp.h module provides LuaSocket with support for UDP protocol 8 | * (AF_INET, SOCK_DGRAM). 9 | * 10 | * Two classes are defined: connected and unconnected. UDP objects are 11 | * originally unconnected. They can be "connected" to a given address 12 | * with a call to the setpeername function. The same function can be used to 13 | * break the connection. 14 | \*=========================================================================*/ 15 | #include "lua.h" 16 | 17 | #include "timeout.h" 18 | #include "socket.h" 19 | 20 | #define UDP_DATAGRAMSIZE 8192 21 | 22 | typedef struct t_udp_ { 23 | t_socket sock; 24 | t_timeout tm; 25 | int family; 26 | } t_udp; 27 | typedef t_udp *p_udp; 28 | 29 | int udp_open(lua_State *L); 30 | 31 | #endif /* UDP_H */ 32 | -------------------------------------------------------------------------------- /Lua/wsocket.h: -------------------------------------------------------------------------------- 1 | #ifndef WSOCKET_H 2 | #define WSOCKET_H 3 | /*=========================================================================*\ 4 | * Socket compatibilization module for Win32 5 | * LuaSocket toolkit 6 | \*=========================================================================*/ 7 | 8 | /*=========================================================================*\ 9 | * WinSock include files 10 | \*=========================================================================*/ 11 | #include 12 | #include 13 | 14 | typedef int socklen_t; 15 | typedef SOCKADDR_STORAGE t_sockaddr_storage; 16 | typedef SOCKET t_socket; 17 | typedef t_socket *p_socket; 18 | 19 | #ifndef IPV6_V6ONLY 20 | #define IPV6_V6ONLY 27 21 | #endif 22 | 23 | #define SOCKET_INVALID (INVALID_SOCKET) 24 | 25 | #ifndef SO_REUSEPORT 26 | #define SO_REUSEPORT SO_REUSEADDR 27 | #endif 28 | 29 | #ifndef AI_NUMERICSERV 30 | #define AI_NUMERICSERV (0) 31 | #endif 32 | 33 | #endif /* WSOCKET_H */ 34 | -------------------------------------------------------------------------------- /PGOHelper/PGOGames/readme.md: -------------------------------------------------------------------------------- 1 | This folder is used when compiling Mesen-S with PGO. 2 | All .nes files put in this folder will be folder will be run in console mode for a few seconds as a way of building of a profile for use with PGO. 3 | 4 | Once you have added a few roms to this folder, run "make pgo" to produce a PGO-optimized binary (it will take several minutes to build) 5 | 6 | Another folder, called "PGOMesenHome" will be created alongside this one when the instrumented executable runs when executing the PGO script. 7 | This folder will be used as a temporary home folder location for Mesen-S to store the files it creates in the process. -------------------------------------------------------------------------------- /PGOHelper/PGOHelper.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | 10 | 11 | Source Files 12 | 13 | 14 | -------------------------------------------------------------------------------- /SevenZip/7zAlloc.h: -------------------------------------------------------------------------------- 1 | /* 7zAlloc.h -- Allocation functions 2 | 2013-03-25 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_ALLOC_H 5 | #define __7Z_ALLOC_H 6 | 7 | #include 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | void *SzAlloc(void *p, size_t size); 14 | void SzFree(void *p, void *address); 15 | 16 | void *SzAllocTemp(void *p, size_t size); 17 | void SzFreeTemp(void *p, void *address); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /SevenZip/7zBuf.c: -------------------------------------------------------------------------------- 1 | /* 7zBuf.c -- Byte Buffer 2 | 2013-01-21 : Igor Pavlov : Public domain */ 3 | 4 | #include "Precomp.h" 5 | 6 | #include "7zBuf.h" 7 | 8 | void Buf_Init(CBuf *p) 9 | { 10 | p->data = 0; 11 | p->size = 0; 12 | } 13 | 14 | int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc) 15 | { 16 | p->size = 0; 17 | if (size == 0) 18 | { 19 | p->data = 0; 20 | return 1; 21 | } 22 | p->data = (Byte *)alloc->Alloc(alloc, size); 23 | if (p->data != 0) 24 | { 25 | p->size = size; 26 | return 1; 27 | } 28 | return 0; 29 | } 30 | 31 | void Buf_Free(CBuf *p, ISzAlloc *alloc) 32 | { 33 | alloc->Free(alloc, p->data); 34 | p->data = 0; 35 | p->size = 0; 36 | } 37 | -------------------------------------------------------------------------------- /SevenZip/7zBuf.h: -------------------------------------------------------------------------------- 1 | /* 7zBuf.h -- Byte Buffer 2 | 2013-01-18 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_BUF_H 5 | #define __7Z_BUF_H 6 | 7 | #include "7zTypes.h" 8 | 9 | EXTERN_C_BEGIN 10 | 11 | typedef struct 12 | { 13 | Byte *data; 14 | size_t size; 15 | } CBuf; 16 | 17 | void Buf_Init(CBuf *p); 18 | int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc); 19 | void Buf_Free(CBuf *p, ISzAlloc *alloc); 20 | 21 | typedef struct 22 | { 23 | Byte *data; 24 | size_t size; 25 | size_t pos; 26 | } CDynBuf; 27 | 28 | void DynBuf_Construct(CDynBuf *p); 29 | void DynBuf_SeekToBeg(CDynBuf *p); 30 | int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc); 31 | void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc); 32 | 33 | EXTERN_C_END 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /SevenZip/7zCrc.h: -------------------------------------------------------------------------------- 1 | /* 7zCrc.h -- CRC32 calculation 2 | 2013-01-18 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_CRC_H 5 | #define __7Z_CRC_H 6 | 7 | #include "7zTypes.h" 8 | 9 | EXTERN_C_BEGIN 10 | 11 | extern UInt32 g_CrcTable[]; 12 | 13 | /* Call CrcGenerateTable one time before other CRC functions */ 14 | void MY_FAST_CALL CrcGenerateTable(void); 15 | 16 | #define CRC_INIT_VAL 0xFFFFFFFF 17 | #define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL) 18 | #define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) 19 | 20 | UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size); 21 | UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size); 22 | 23 | EXTERN_C_END 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /SevenZip/7zMemBuffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "7zTypes.h" 4 | 5 | EXTERN_C_BEGIN 6 | 7 | /* ---------- File ---------- */ 8 | 9 | typedef struct 10 | { 11 | void* buffer; 12 | Int64 size; 13 | Int64 pos; 14 | } CSzMemBuffer; 15 | 16 | /* reads max(*size, remain file's size) bytes */ 17 | WRes MemBuffer_Read(CSzMemBuffer *p, void *data, size_t *size); 18 | WRes MemBuffer_Seek(CSzMemBuffer *p, Int64 *pos, ESzSeek origin); 19 | 20 | /* ---------- FileInStream ---------- */ 21 | typedef struct 22 | { 23 | ISeekInStream s; 24 | CSzMemBuffer buffer; 25 | } CMemBufferInStream; 26 | 27 | void MemBufferInit(CMemBufferInStream *memBuferStream, CLookToRead *lookStream, void* buffer, size_t size); 28 | 29 | EXTERN_C_END 30 | -------------------------------------------------------------------------------- /SevenZip/Delta.h: -------------------------------------------------------------------------------- 1 | /* Delta.h -- Delta converter 2 | 2013-01-18 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __DELTA_H 5 | #define __DELTA_H 6 | 7 | #include "7zTypes.h" 8 | 9 | EXTERN_C_BEGIN 10 | 11 | #define DELTA_STATE_SIZE 256 12 | 13 | void Delta_Init(Byte *state); 14 | void Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size); 15 | void Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size); 16 | 17 | EXTERN_C_END 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /SevenZip/Precomp.c: -------------------------------------------------------------------------------- 1 | /* Precomp.c -- StdAfx 2 | 2013-01-21 : Igor Pavlov : Public domain */ 3 | 4 | #include "Precomp.h" 5 | -------------------------------------------------------------------------------- /SevenZip/Precomp.h: -------------------------------------------------------------------------------- 1 | /* Precomp.h -- StdAfx 2 | 2013-11-12 : Igor Pavlov : Public domain */ 3 | 4 | #ifndef __7Z_PRECOMP_H 5 | #define __7Z_PRECOMP_H 6 | 7 | #include "Compiler.h" 8 | /* #include "7zTypes.h" */ 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /UI/Config/AviRecordConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Mesen.GUI.Config 8 | { 9 | public class AviRecordConfig 10 | { 11 | public VideoCodec Codec = VideoCodec.CSCD; 12 | public UInt32 CompressionLevel = 6; 13 | } 14 | 15 | public enum VideoCodec 16 | { 17 | None = 0, 18 | ZMBV = 1, 19 | CSCD = 2, 20 | GIF = 3 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /UI/Config/BaseConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Mesen.GUI.Config 9 | { 10 | [StructLayout(LayoutKind.Sequential)] 11 | public class BaseConfig 12 | { 13 | public T Clone() 14 | { 15 | return (T)this.MemberwiseClone(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /UI/Config/CheatWindowConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Mesen.GUI.Config 9 | { 10 | public class CheatWindowConfig 11 | { 12 | public Size WindowSize = new Size(0, 0); 13 | public Point WindowLocation; 14 | public bool DisableAllCheats = false; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /UI/Config/ConfigAttributes.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Mesen.GUI.Config 8 | { 9 | public class MinMaxAttribute : Attribute 10 | { 11 | public object Min { get; set; } 12 | public object Max { get; set; } 13 | 14 | public MinMaxAttribute(object min, object max) 15 | { 16 | this.Min = min; 17 | this.Max = max; 18 | } 19 | } 20 | 21 | public class ValidValuesAttribute : Attribute 22 | { 23 | public uint[] ValidValues { get; set; } 24 | 25 | public ValidValuesAttribute(params uint[] validValues) 26 | { 27 | this.ValidValues = validValues; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /UI/Config/DbgIntegrationConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Mesen.GUI.Config 8 | { 9 | public class DbgIntegrationConfig 10 | { 11 | public bool AutoImport = true; 12 | public bool ResetLabelsOnImport = true; 13 | 14 | public bool ImportCpuPrgRomLabels = true; 15 | public bool ImportCpuWorkRamLabels = true; 16 | public bool ImportCpuSaveRamLabels = true; 17 | public bool ImportCpuComments = true; 18 | 19 | public bool ImportSpcRamLabels = true; 20 | public bool ImportSpcComments = true; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /UI/Config/MovieRecordConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Mesen.GUI.Config 8 | { 9 | public class MovieRecordConfig 10 | { 11 | public RecordMovieFrom RecordFrom = RecordMovieFrom.CurrentState; 12 | public string Author = ""; 13 | public string Description = ""; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /UI/Config/NetplayConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Mesen.GUI.Config 9 | { 10 | public class NetplayConfig : BaseConfig 11 | { 12 | public string Host = "localhost"; 13 | public UInt16 Port = 8888; 14 | public string Password = ""; 15 | 16 | public string PlayerName = "PlayerName"; 17 | 18 | public string ServerName = "Default"; 19 | public UInt16 ServerPort = 8888; 20 | public string ServerPassword = ""; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /UI/Config/Shortcuts/ShortcutKeyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Mesen.GUI.Config.Shortcuts 9 | { 10 | public struct ShortcutKeyInfo 11 | { 12 | public EmulatorShortcut Shortcut; 13 | public KeyCombination KeyCombination; 14 | 15 | public ShortcutKeyInfo(EmulatorShortcut key, KeyCombination keyCombination) 16 | { 17 | Shortcut = key; 18 | KeyCombination = keyCombination; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /UI/Controls/ctrlLinkLabel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Drawing; 4 | using System.Windows.Forms; 5 | 6 | namespace Mesen.GUI.Controls 7 | { 8 | public class ctrlLinkLabel: Label 9 | { 10 | private string _link = null; 11 | 12 | public ctrlLinkLabel() 13 | { 14 | MonoThemeHelper.ExcludeFromTheme(this); 15 | } 16 | 17 | public string Link 18 | { 19 | get { return _link; } 20 | set 21 | { 22 | _link = value; 23 | if(!string.IsNullOrWhiteSpace(_link)) { 24 | this.ForeColor = Color.Blue; 25 | this.Font = new Font(this.Font, FontStyle.Underline); 26 | this.Cursor = Cursors.Hand; 27 | } 28 | } 29 | } 30 | 31 | protected override void OnClick(EventArgs e) 32 | { 33 | base.OnClick(e); 34 | 35 | if(!string.IsNullOrWhiteSpace(_link)) { 36 | Process.Start(this.Link); 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /UI/Controls/ctrlLoadingRom.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace Mesen.GUI.Controls 12 | { 13 | public partial class ctrlLoadingRom : BaseControl 14 | { 15 | public ctrlLoadingRom() 16 | { 17 | InitializeComponent(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /UI/Controls/ctrlMesenContextMenuStrip.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Windows.Forms; 8 | 9 | namespace Mesen.GUI.Controls 10 | { 11 | public class ctrlMesenContextMenuStrip : ContextMenuStrip 12 | { 13 | public ctrlMesenContextMenuStrip() : base() 14 | { 15 | } 16 | 17 | public ctrlMesenContextMenuStrip(IContainer container) : base(container) 18 | { 19 | } 20 | 21 | internal bool ProcessCommandKey(ref Message msg, Keys keyData) 22 | { 23 | return this.ProcessCmdKey(ref msg, keyData); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /UI/Controls/ctrlMesenMenuStrip.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Forms; 7 | 8 | namespace Mesen.GUI.Controls 9 | { 10 | public class ctrlMesenMenuStrip : MenuStrip 11 | { 12 | private const int WM_MOUSEACTIVATE = 0x21; 13 | protected override void WndProc(ref Message m) 14 | { 15 | if(m.Msg == WM_MOUSEACTIVATE && this.CanFocus && !this.Focused) { 16 | this.FindForm()?.Focus(); 17 | } 18 | base.WndProc(ref m); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /UI/Controls/ctrlMesenPictureBox.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing.Drawing2D; 2 | using System.Windows.Forms; 3 | 4 | namespace Mesen.GUI.Controls 5 | { 6 | public class ctrlMesenPictureBox : PictureBox 7 | { 8 | public InterpolationMode InterpolationMode { get; set; } 9 | 10 | protected override void OnPaint(PaintEventArgs paintEventArgs) 11 | { 12 | paintEventArgs.Graphics.InterpolationMode = InterpolationMode; 13 | base.OnPaint(paintEventArgs); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /UI/Debugger/Breakpoints/InteropBreakpoint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Mesen.GUI.Debugger 5 | { 6 | public struct InteropBreakpoint 7 | { 8 | public Int32 Id; 9 | public CpuType CpuType; 10 | public SnesMemoryType MemoryType; 11 | public BreakpointTypeFlags Type; 12 | public Int32 StartAddress; 13 | public Int32 EndAddress; 14 | 15 | [MarshalAs(UnmanagedType.I1)] 16 | public bool Enabled; 17 | 18 | [MarshalAs(UnmanagedType.I1)] 19 | public bool MarkEvent; 20 | 21 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1000)] 22 | public byte[] Condition; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /UI/Debugger/Code/Cx4DisassemblyManager.cs: -------------------------------------------------------------------------------- 1 | using Mesen.GUI.Debugger.Controls; 2 | using Mesen.GUI.Debugger.Integration; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Mesen.GUI.Debugger.Code 10 | { 11 | public class Cx4DisassemblyManager : CpuDisassemblyManager 12 | { 13 | public override CpuType CpuType { get { return CpuType.Cx4; } } 14 | public override SnesMemoryType RelativeMemoryType { get { return SnesMemoryType.Cx4Memory; } } 15 | public override int AddressSize { get { return 6; } } 16 | public override int ByteCodeSize { get { return 4; } } 17 | public override bool AllowSourceView { get { return false; } } 18 | 19 | public override void RefreshCode(ISymbolProvider symbolProvider, SourceFileInfo file) 20 | { 21 | this._provider = new CodeDataProvider(CpuType.Cx4); 22 | } 23 | 24 | protected override int GetFullAddress(int address, int length) 25 | { 26 | return address; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /UI/Debugger/Code/GsuDisassemblyManager.cs: -------------------------------------------------------------------------------- 1 | using Mesen.GUI.Debugger.Controls; 2 | using Mesen.GUI.Debugger.Integration; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Mesen.GUI.Debugger.Code 10 | { 11 | public class GsuDisassemblyManager : CpuDisassemblyManager 12 | { 13 | public override CpuType CpuType { get { return CpuType.Gsu; } } 14 | public override SnesMemoryType RelativeMemoryType { get { return SnesMemoryType.GsuMemory; } } 15 | public override int AddressSize { get { return 6; } } 16 | public override int ByteCodeSize { get { return 3; } } 17 | public override bool AllowSourceView { get { return false; } } 18 | 19 | public override void RefreshCode(ISymbolProvider symbolProvider, SourceFileInfo file) 20 | { 21 | this._provider = new CodeDataProvider(CpuType.Gsu); 22 | } 23 | 24 | protected override int GetFullAddress(int address, int length) 25 | { 26 | return address; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /UI/Debugger/Code/IDisassemblyManager.cs: -------------------------------------------------------------------------------- 1 | using Mesen.GUI.Debugger.Controls; 2 | using Mesen.GUI.Debugger.Integration; 3 | using Mesen.GUI.Debugger.Labels; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Mesen.GUI.Debugger.Code 11 | { 12 | public interface IDisassemblyManager 13 | { 14 | ICodeDataProvider Provider { get; } 15 | 16 | CpuType CpuType { get; } 17 | SnesMemoryType RelativeMemoryType { get; } 18 | SnesMemoryType PrgMemoryType { get; } 19 | int AddressSize { get; } 20 | int ByteCodeSize { get; } 21 | bool AllowSourceView { get; } 22 | 23 | void RefreshCode(ISymbolProvider symbolProvider, SourceFileInfo file); 24 | 25 | Dictionary GetTooltipData(string word, int lineIndex); 26 | LocationInfo GetLocationInfo(string lastWord, int lineIndex); 27 | } 28 | 29 | public class LocationInfo 30 | { 31 | public int Address; 32 | public CodeLabel Label; 33 | public SourceSymbol Symbol; 34 | 35 | public int? ArrayIndex = null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /UI/Debugger/Code/NecDspDisassemblyManager.cs: -------------------------------------------------------------------------------- 1 | using Mesen.GUI.Debugger.Controls; 2 | using Mesen.GUI.Debugger.Integration; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Mesen.GUI.Debugger.Code 10 | { 11 | public class NecDspDisassemblyManager : CpuDisassemblyManager 12 | { 13 | public override CpuType CpuType { get { return CpuType.NecDsp; } } 14 | public override SnesMemoryType RelativeMemoryType { get { return SnesMemoryType.NecDspMemory; } } 15 | public override int AddressSize { get { return 4; } } 16 | public override int ByteCodeSize { get { return 3; } } 17 | public override bool AllowSourceView { get { return false; } } 18 | 19 | public override void RefreshCode(ISymbolProvider symbolProvider, SourceFileInfo file) 20 | { 21 | this._provider = new CodeDataProvider(CpuType.NecDsp); 22 | } 23 | 24 | protected override int GetFullAddress(int address, int length) 25 | { 26 | return address; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /UI/Debugger/Config/AssemblerConfig.cs: -------------------------------------------------------------------------------- 1 | using Mesen.GUI.Controls; 2 | using Mesen.GUI.Utilities; 3 | using System.Drawing; 4 | 5 | namespace Mesen.GUI.Config 6 | { 7 | public class AssemblerConfig 8 | { 9 | public Size WindowSize = new Size(0, 0); 10 | public Point WindowLocation; 11 | 12 | public string FontFamily = BaseControl.MonospaceFontFamily; 13 | public FontStyle FontStyle = FontStyle.Regular; 14 | public float FontSize = BaseControl.DefaultFontSize; 15 | public int Zoom = 100; 16 | } 17 | } -------------------------------------------------------------------------------- /UI/Debugger/Config/DebugLogConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace Mesen.GUI.Config 4 | { 5 | public class DebugLogConfig 6 | { 7 | public Size WindowSize = new Size(0, 0); 8 | public Point WindowLocation; 9 | } 10 | } -------------------------------------------------------------------------------- /UI/Debugger/Config/ProfilerConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | 3 | namespace Mesen.GUI.Config 4 | { 5 | public class ProfilerConfig 6 | { 7 | public Size WindowSize = new Size(0, 0); 8 | public Point WindowLocation; 9 | } 10 | } -------------------------------------------------------------------------------- /UI/Debugger/Config/RegisterViewerConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Imaging; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Xml; 10 | using System.Xml.Serialization; 11 | using Mesen.GUI.Debugger; 12 | using Mesen.GUI.Controls; 13 | using Mesen.GUI.Utilities; 14 | 15 | namespace Mesen.GUI.Config 16 | { 17 | public class RegisterViewerConfig 18 | { 19 | public Size WindowSize = new Size(0, 0); 20 | public Point WindowLocation; 21 | 22 | public bool AutoRefresh = true; 23 | public int RefreshScanline = 240; 24 | public int RefreshCycle = 0; 25 | 26 | public RegisterViewerConfig() 27 | { 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /UI/Debugger/Config/SpriteViewerConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Imaging; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Xml; 10 | using System.Xml.Serialization; 11 | using Mesen.GUI.Debugger; 12 | using Mesen.GUI.Controls; 13 | using Mesen.GUI.Utilities; 14 | 15 | namespace Mesen.GUI.Config 16 | { 17 | public class SpriteViewerConfig 18 | { 19 | public Size WindowSize = new Size(0, 0); 20 | public Point WindowLocation; 21 | 22 | public int ImageScale = 2; 23 | public int SplitterDistance = 514; 24 | public bool AutoRefresh = true; 25 | public bool HideOffscreenSprites = false; 26 | public int RefreshScanline = 240; 27 | public int RefreshCycle = 0; 28 | 29 | public RefreshSpeed AutoRefreshSpeed = RefreshSpeed.Low; 30 | 31 | public SpriteViewerConfig() 32 | { 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /UI/Debugger/Config/TilemapViewerConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Imaging; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Xml; 10 | using System.Xml.Serialization; 11 | using Mesen.GUI.Debugger; 12 | using Mesen.GUI.Controls; 13 | using Mesen.GUI.Utilities; 14 | 15 | namespace Mesen.GUI.Config 16 | { 17 | public class TilemapViewerConfig 18 | { 19 | public Size WindowSize = new Size(0, 0); 20 | public Point WindowLocation; 21 | 22 | public int ImageScale = 1; 23 | public bool ShowScrollOverlay = false; 24 | public bool ShowTileGrid = false; 25 | 26 | public RefreshSpeed AutoRefreshSpeed = RefreshSpeed.Low; 27 | 28 | public bool AutoRefresh = true; 29 | public int RefreshScanline = 240; 30 | public int RefreshCycle = 0; 31 | 32 | public TilemapViewerConfig() 33 | { 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /UI/Debugger/Controls/ctrlColorPicker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Forms; 7 | 8 | namespace Mesen.GUI.Debugger 9 | { 10 | public class ctrlColorPicker : PictureBox 11 | { 12 | public ctrlColorPicker() : base() 13 | { 14 | this.BorderStyle = BorderStyle.FixedSingle; 15 | this.Cursor = Cursors.Hand; 16 | } 17 | 18 | protected override void OnClick(EventArgs e) 19 | { 20 | base.OnClick(e); 21 | 22 | using(ColorDialog cd = new ColorDialog()) { 23 | cd.SolidColorOnly = true; 24 | cd.AllowFullOpen = true; 25 | cd.FullOpen = true; 26 | cd.Color = this.BackColor; 27 | if(cd.ShowDialog() == DialogResult.OK) { 28 | this.BackColor = cd.Color; 29 | } 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /UI/Debugger/Controls/ctrlTextbox.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Mesen.GUI.Debugger.Controls 2 | { 3 | partial class ctrlTextbox 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if(disposing && (components != null)) { 17 | components.Dispose(); 18 | } 19 | base.Dispose(disposing); 20 | } 21 | 22 | #region Component Designer generated code 23 | 24 | /// 25 | /// Required method for Designer support - do not modify 26 | /// the contents of this method with the code editor. 27 | /// 28 | private void InitializeComponent() 29 | { 30 | components = new System.ComponentModel.Container(); 31 | } 32 | 33 | #endregion 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /UI/Debugger/GraphicsExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace Mesen.GUI.Debugger 6 | { 7 | public static class GraphicsExtensions 8 | { 9 | public static void DrawOutlinedString(this Graphics g, string text, Font font, Brush foreColor, Brush backColor, int x, int y) 10 | { 11 | for(int i = -1; i <= 1; i++) { 12 | for(int j = -1; j <= 1; j++) { 13 | g.DrawString(text, font, backColor, x+j, y+i); 14 | } 15 | } 16 | g.DrawString(text, font, foreColor, x, y); 17 | } 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /UI/Debugger/HexBox/BytePositionInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Be.Windows.Forms 6 | { 7 | /// 8 | /// Represents a position in the HexBox control 9 | /// 10 | internal struct BytePositionInfo 11 | { 12 | public BytePositionInfo(long index, int characterPosition) 13 | { 14 | _index = index; 15 | _characterPosition = characterPosition; 16 | } 17 | 18 | public int CharacterPosition 19 | { 20 | get { return _characterPosition; } 21 | } int _characterPosition; 22 | 23 | public long Index 24 | { 25 | get { return _index; } 26 | } long _index; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /UI/Debugger/HexBox/DataBlock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Be.Windows.Forms 4 | { 5 | internal abstract class DataBlock 6 | { 7 | internal DataMap _map; 8 | internal DataBlock _nextBlock; 9 | internal DataBlock _previousBlock; 10 | 11 | public abstract long Length 12 | { 13 | get; 14 | } 15 | 16 | public DataMap Map 17 | { 18 | get 19 | { 20 | return _map; 21 | } 22 | } 23 | 24 | public DataBlock NextBlock 25 | { 26 | get 27 | { 28 | return _nextBlock; 29 | } 30 | } 31 | 32 | public DataBlock PreviousBlock 33 | { 34 | get 35 | { 36 | return _previousBlock; 37 | } 38 | } 39 | 40 | public abstract void RemoveBytes(long position, long count); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /UI/Debugger/HexBox/HexBox.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Debugger/HexBox/HexBox.cs -------------------------------------------------------------------------------- /UI/Debugger/HexBox/HexCasing.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Be.Windows.Forms 6 | { 7 | /// 8 | /// Specifies the case of hex characters in the HexBox control 9 | /// 10 | public enum HexCasing 11 | { 12 | /// 13 | /// Converts all characters to uppercase. 14 | /// 15 | Upper = 0, 16 | /// 17 | /// Converts all characters to lowercase. 18 | /// 19 | Lower = 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /UI/Debugger/HexBox/IByteColorProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace Be.Windows.Forms 5 | { 6 | public interface IByteColorProvider 7 | { 8 | void Prepare(long firstByteIndex, long lastByteIndex); 9 | ByteColors GetByteColor(long firstByteIndex, long byteIndex); 10 | } 11 | 12 | public class ByteColors 13 | { 14 | public Color ForeColor { get; set; } 15 | public Color BackColor { get; set; } 16 | public Color BorderColor { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /UI/Debugger/HexBox/IByteProvider.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Debugger/HexBox/IByteProvider.cs -------------------------------------------------------------------------------- /UI/Debugger/HexBox/NativeMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace Be.Windows.Forms 6 | { 7 | internal static class NativeMethods 8 | { 9 | // Key definitions 10 | public const int WM_KEYDOWN = 0x100; 11 | public const int WM_KEYUP = 0x101; 12 | public const int WM_CHAR = 0x102; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /UI/Debugger/MemoryTools/frmFadeSpeed.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using Mesen.GUI.Forms; 11 | 12 | namespace Mesen.GUI.Debugger 13 | { 14 | public partial class frmFadeSpeed : BaseConfigForm 15 | { 16 | public frmFadeSpeed(int initialValue) 17 | { 18 | InitializeComponent(); 19 | nudFrameCount.Value = initialValue; 20 | } 21 | 22 | public int FadeSpeed 23 | { 24 | get { return (int)nudFrameCount.Value; } 25 | } 26 | 27 | protected override void OnShown(EventArgs e) 28 | { 29 | base.OnShown(e); 30 | nudFrameCount.Focus(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /UI/Debugger/Scripts/FastColoredTextBox/Char.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FastColoredTextBoxNS 4 | { 5 | /// 6 | /// Char and style 7 | /// 8 | public struct Char 9 | { 10 | /// 11 | /// Unicode character 12 | /// 13 | public char c; 14 | /// 15 | /// Style bit mask 16 | /// 17 | /// Bit 1 in position n means that this char will rendering by FastColoredTextBox.Styles[n] 18 | public StyleIndex style; 19 | 20 | public Char(char c) 21 | { 22 | this.c = c; 23 | style = StyleIndex.None; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /UI/Debugger/Scripts/FastColoredTextBox/MonoUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace FastColoredTextBoxNS 6 | { 7 | internal class MonoUtility 8 | { 9 | // .Net 1.0 and 1.1 didn't have the PlatformID value for Unix, so Mono used the value 128. 10 | private const PlatformID MonoUnix = (PlatformID)128; 11 | 12 | public static bool IsLinux 13 | { 14 | get 15 | { 16 | PlatformID p = Environment.OSVersion.Platform; 17 | return (p == PlatformID.Unix) || (p == PlatformID.MacOSX) || (p == MonoUnix); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /UI/Debugger/frmGoToLine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using Mesen.GUI.Forms; 11 | 12 | namespace Mesen.GUI.Debugger 13 | { 14 | public partial class frmGoToLine : BaseConfigForm 15 | { 16 | public frmGoToLine(GoToAddress address, int charLimit) 17 | { 18 | InitializeComponent(); 19 | 20 | Entity = address; 21 | AddBinding("Address", txtAddress); 22 | 23 | txtAddress.MaxLength = charLimit; 24 | } 25 | 26 | protected override void OnShown(EventArgs e) 27 | { 28 | base.OnShown(e); 29 | txtAddress.Focus(); 30 | } 31 | } 32 | 33 | public class GoToAddress 34 | { 35 | public UInt32 Address; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /UI/Dependencies/Font.24.spritefont: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Dependencies/Font.24.spritefont -------------------------------------------------------------------------------- /UI/Dependencies/Font.64.spritefont: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Dependencies/Font.64.spritefont -------------------------------------------------------------------------------- /UI/Dependencies/LuaScripts/DrawMode.lua: -------------------------------------------------------------------------------- 1 | ----------------------- 2 | -- Name: Draw Mode 3 | -- Author: upsilandre 4 | ----------------------- 5 | -- Allows you to draw an overlay over the game's screen by left-clicking with the mouse. 6 | -- Right-click to clear the overlay. 7 | ----------------------- 8 | 9 | function Main() 10 | mouse = emu.getMouseState() 11 | if mouse.left then 12 | if not hold then 13 | hold = true 14 | else 15 | emu.drawLine( oldX, oldY, mouse.x, mouse.y, 0xFF0000, 10000000) 16 | end 17 | oldX = mouse.x 18 | oldY = mouse.y 19 | else 20 | hold = false 21 | end 22 | if mouse.right then 23 | emu.clearScreen() 24 | end 25 | end 26 | 27 | 28 | hold = false 29 | emu.addEventCallback(Main, emu.eventType.endFrame); 30 | emu.displayMessage("Script", "Draw Mode") 31 | -------------------------------------------------------------------------------- /UI/Dependencies/LuaScripts/NtscSafeArea.lua: -------------------------------------------------------------------------------- 1 | ----------------------- 2 | -- Name: NTSC Safe Area 3 | -- Author: Sour 4 | ----------------------- 5 | -- Displays an overlay based on tepples' "Safe Area on 5.37Mhz NTSC VDPs" diagram 6 | -- Source: https://wiki.nesdev.com/w/index.php/File:Safe_areas.png 7 | -- 8 | -- Red: "Danger Zone" (Top and bottom 8 pixels) 9 | -- Most TVs hide all of this. 10 | -- 11 | -- Gray: Outside the "Title Safe Area". 12 | -- Some TVs may hide portions of this. 13 | -- Text, etc. should not appear here. 14 | ----------------------- 15 | 16 | function drawSafeArea() 17 | local red = 0x40FF0000; 18 | local gray = 0x60505050; 19 | 20 | emu.drawRectangle(0, 0, 256, 8, red, true) 21 | emu.drawRectangle(0, 232, 256, 8, red, true) 22 | 23 | emu.drawRectangle(0, 8, 16, 224, gray, true) 24 | emu.drawRectangle(240, 8, 16, 224, gray, true) 25 | emu.drawRectangle(16, 8, 224, 16, gray, true) 26 | emu.drawRectangle(16, 216, 224, 16, gray, true) 27 | end 28 | 29 | emu.addEventCallback(drawSafeArea, emu.eventType.endFrame); 30 | -------------------------------------------------------------------------------- /UI/Dependencies/PixelFont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Dependencies/PixelFont.ttf -------------------------------------------------------------------------------- /UI/Dependencies/Satellaview/BSX0120-0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Dependencies/Satellaview/BSX0120-0.bin -------------------------------------------------------------------------------- /UI/Dependencies/Satellaview/BSX0121-0.bin: -------------------------------------------------------------------------------- 1 | Welcome to Satellaview. -------------------------------------------------------------------------------- /UI/Dependencies/Satellaview/BSX0122-0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Dependencies/Satellaview/BSX0122-0.bin -------------------------------------------------------------------------------- /UI/Dependencies/Satellaview/BSX0123-0.bin: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /UI/Dependencies/Satellaview/BSX0124-0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Dependencies/Satellaview/BSX0124-0.bin -------------------------------------------------------------------------------- /UI/Forms/Config/Controllers/ctrlKeyBindingHint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace Mesen.GUI.Forms.Config 12 | { 13 | public partial class ctrlKeyBindingHint : UserControl 14 | { 15 | public ctrlKeyBindingHint() 16 | { 17 | InitializeComponent(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /UI/Forms/NetPlay/frmPlayerProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using Mesen.GUI.Config; 11 | 12 | namespace Mesen.GUI.Forms.NetPlay 13 | { 14 | public partial class frmPlayerProfile : BaseConfigForm 15 | { 16 | public frmPlayerProfile() 17 | { 18 | InitializeComponent(); 19 | 20 | Entity = ConfigManager.Config.Netplay; 21 | AddBinding(nameof(NetplayConfig.PlayerName), txtPlayerName); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /UI/Forms/NetPlay/frmServerConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using Mesen.GUI.Config; 11 | 12 | namespace Mesen.GUI.Forms.NetPlay 13 | { 14 | public partial class frmServerConfig : BaseConfigForm 15 | { 16 | public frmServerConfig() 17 | { 18 | InitializeComponent(); 19 | 20 | Entity = ConfigManager.Config.Netplay; 21 | 22 | AddBinding(nameof(NetplayConfig.ServerName), txtServerName); 23 | AddBinding(nameof(NetplayConfig.ServerPassword), txtPassword); 24 | AddBinding(nameof(NetplayConfig.ServerPort), txtPort, eNumberFormat.Decimal); 25 | } 26 | 27 | private void Field_ValueChanged(object sender, EventArgs e) 28 | { 29 | UInt16 port; 30 | if(!UInt16.TryParse(txtPort.Text, out port)) { 31 | btnOK.Enabled = false; 32 | } else { 33 | btnOK.Enabled = !string.IsNullOrWhiteSpace(txtServerName.Text); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /UI/Forms/Tools/CheatDatabase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Xml.Serialization; 7 | 8 | namespace Mesen.GUI.Forms 9 | { 10 | [XmlRoot("cheats")] 11 | public class CheatDatabase 12 | { 13 | [XmlElement("game")] 14 | public List Games; 15 | } 16 | 17 | [XmlType("game")] 18 | public class CheatDbGameEntry 19 | { 20 | [XmlAttribute("name")] 21 | public string Name; 22 | 23 | [XmlAttribute("sha1")] 24 | public string Sha1; 25 | 26 | [XmlElement("cheat")] 27 | public List Cheats; 28 | 29 | public override string ToString() 30 | { 31 | return this.Name; 32 | } 33 | } 34 | 35 | public class CheatDbCheatEntry 36 | { 37 | [XmlAttribute("description")] 38 | public string Description; 39 | 40 | [XmlElement("code")] 41 | public List Codes; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /UI/Interop/TestApi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Mesen.GUI.Interop 9 | { 10 | class TestApi 11 | { 12 | private const string DllPath = "MesenSCore.dll"; 13 | 14 | [DllImport(DllPath)] public static extern Int32 RunRecordedTest([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))]string filename, [MarshalAs(UnmanagedType.I1)]bool inBackground); 15 | [DllImport(DllPath)] public static extern void RomTestRecord([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8Marshaler))]string filename, [MarshalAs(UnmanagedType.I1)]bool reset); 16 | [DllImport(DllPath)] public static extern void RomTestStop(); 17 | [DllImport(DllPath)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool RomTestRecording(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /UI/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UI/Resources/Accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Accept.png -------------------------------------------------------------------------------- /UI/Resources/Add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Add.png -------------------------------------------------------------------------------- /UI/Resources/ArrowKeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/ArrowKeys.png -------------------------------------------------------------------------------- /UI/Resources/Audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Audio.png -------------------------------------------------------------------------------- /UI/Resources/Barcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Barcode.png -------------------------------------------------------------------------------- /UI/Resources/Breakpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Breakpoint.png -------------------------------------------------------------------------------- /UI/Resources/BreakpointDisabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/BreakpointDisabled.png -------------------------------------------------------------------------------- /UI/Resources/BreakpointEnableDisable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/BreakpointEnableDisable.png -------------------------------------------------------------------------------- /UI/Resources/Camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Camera.png -------------------------------------------------------------------------------- /UI/Resources/CheatCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/CheatCode.png -------------------------------------------------------------------------------- /UI/Resources/Chip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Chip.png -------------------------------------------------------------------------------- /UI/Resources/Close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Close.png -------------------------------------------------------------------------------- /UI/Resources/CloseWhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/CloseWhite.png -------------------------------------------------------------------------------- /UI/Resources/Coins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Coins.png -------------------------------------------------------------------------------- /UI/Resources/Collapse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Collapse.png -------------------------------------------------------------------------------- /UI/Resources/CommandLine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/CommandLine.png -------------------------------------------------------------------------------- /UI/Resources/Comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Comment.png -------------------------------------------------------------------------------- /UI/Resources/Controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Controller.png -------------------------------------------------------------------------------- /UI/Resources/Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Copy.png -------------------------------------------------------------------------------- /UI/Resources/Cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Cut.png -------------------------------------------------------------------------------- /UI/Resources/Cx4Debugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Cx4Debugger.png -------------------------------------------------------------------------------- /UI/Resources/Debugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Debugger.png -------------------------------------------------------------------------------- /UI/Resources/Dice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Dice.png -------------------------------------------------------------------------------- /UI/Resources/DipSwitches.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/DipSwitches.png -------------------------------------------------------------------------------- /UI/Resources/Donate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Donate.png -------------------------------------------------------------------------------- /UI/Resources/DownArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/DownArrow.png -------------------------------------------------------------------------------- /UI/Resources/DownArrowDarkTheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/DownArrowDarkTheme.png -------------------------------------------------------------------------------- /UI/Resources/DownArrowWin10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/DownArrowWin10.png -------------------------------------------------------------------------------- /UI/Resources/Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Edit.png -------------------------------------------------------------------------------- /UI/Resources/EditLabel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/EditLabel.png -------------------------------------------------------------------------------- /UI/Resources/Enum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Enum.png -------------------------------------------------------------------------------- /UI/Resources/Exclamation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Exclamation.png -------------------------------------------------------------------------------- /UI/Resources/Exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Exit.png -------------------------------------------------------------------------------- /UI/Resources/Expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Expand.png -------------------------------------------------------------------------------- /UI/Resources/Export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Export.png -------------------------------------------------------------------------------- /UI/Resources/Find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Find.png -------------------------------------------------------------------------------- /UI/Resources/Folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Folder.png -------------------------------------------------------------------------------- /UI/Resources/Font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Font.png -------------------------------------------------------------------------------- /UI/Resources/Fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Fullscreen.png -------------------------------------------------------------------------------- /UI/Resources/Function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Function.png -------------------------------------------------------------------------------- /UI/Resources/GameboyIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/GameboyIcon.png -------------------------------------------------------------------------------- /UI/Resources/GbDebugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/GbDebugger.png -------------------------------------------------------------------------------- /UI/Resources/GsuDebugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/GsuDebugger.png -------------------------------------------------------------------------------- /UI/Resources/HdPack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/HdPack.png -------------------------------------------------------------------------------- /UI/Resources/Help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Help.png -------------------------------------------------------------------------------- /UI/Resources/HistoryViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/HistoryViewer.png -------------------------------------------------------------------------------- /UI/Resources/Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Icon.ico -------------------------------------------------------------------------------- /UI/Resources/Import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Import.png -------------------------------------------------------------------------------- /UI/Resources/JumpTarget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/JumpTarget.png -------------------------------------------------------------------------------- /UI/Resources/LogWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/LogWindow.png -------------------------------------------------------------------------------- /UI/Resources/MediaEject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/MediaEject.png -------------------------------------------------------------------------------- /UI/Resources/MediaPause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/MediaPause.png -------------------------------------------------------------------------------- /UI/Resources/MediaPlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/MediaPlay.png -------------------------------------------------------------------------------- /UI/Resources/MediaStop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/MediaStop.png -------------------------------------------------------------------------------- /UI/Resources/MesenSIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/MesenSIcon.png -------------------------------------------------------------------------------- /UI/Resources/MesenSIconSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/MesenSIconSmall.png -------------------------------------------------------------------------------- /UI/Resources/Microphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Microphone.png -------------------------------------------------------------------------------- /UI/Resources/MoveDown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/MoveDown.png -------------------------------------------------------------------------------- /UI/Resources/MoveUp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/MoveUp.png -------------------------------------------------------------------------------- /UI/Resources/Movie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Movie.png -------------------------------------------------------------------------------- /UI/Resources/NavigateBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/NavigateBack.png -------------------------------------------------------------------------------- /UI/Resources/NavigateForward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/NavigateForward.png -------------------------------------------------------------------------------- /UI/Resources/NecDspDebugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/NecDspDebugger.png -------------------------------------------------------------------------------- /UI/Resources/NesEventViewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/NesEventViewer.png -------------------------------------------------------------------------------- /UI/Resources/Network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Network.png -------------------------------------------------------------------------------- /UI/Resources/NextArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/NextArrow.png -------------------------------------------------------------------------------- /UI/Resources/NextTrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/NextTrack.png -------------------------------------------------------------------------------- /UI/Resources/NudDownArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/NudDownArrow.png -------------------------------------------------------------------------------- /UI/Resources/NudDownArrowDarkTheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/NudDownArrowDarkTheme.png -------------------------------------------------------------------------------- /UI/Resources/NudUpArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/NudUpArrow.png -------------------------------------------------------------------------------- /UI/Resources/NudUpArrowDarkTheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/NudUpArrowDarkTheme.png -------------------------------------------------------------------------------- /UI/Resources/Paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Paste.png -------------------------------------------------------------------------------- /UI/Resources/Pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Pencil.png -------------------------------------------------------------------------------- /UI/Resources/PerfTracker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/PerfTracker.png -------------------------------------------------------------------------------- /UI/Resources/Pipette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Pipette.png -------------------------------------------------------------------------------- /UI/Resources/PipetteSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/PipetteSmall.png -------------------------------------------------------------------------------- /UI/Resources/PowerCycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/PowerCycle.png -------------------------------------------------------------------------------- /UI/Resources/PrevTrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/PrevTrack.png -------------------------------------------------------------------------------- /UI/Resources/PreviousArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/PreviousArrow.png -------------------------------------------------------------------------------- /UI/Resources/PsIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/PsIcon.png -------------------------------------------------------------------------------- /UI/Resources/Record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Record.png -------------------------------------------------------------------------------- /UI/Resources/Refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Refresh.png -------------------------------------------------------------------------------- /UI/Resources/RegisterIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/RegisterIcon.png -------------------------------------------------------------------------------- /UI/Resources/RunPpuCycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/RunPpuCycle.png -------------------------------------------------------------------------------- /UI/Resources/RunPpuFrame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/RunPpuFrame.png -------------------------------------------------------------------------------- /UI/Resources/RunPpuScanline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/RunPpuScanline.png -------------------------------------------------------------------------------- /UI/Resources/Sa1Debugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Sa1Debugger.png -------------------------------------------------------------------------------- /UI/Resources/SaveFloppy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/SaveFloppy.png -------------------------------------------------------------------------------- /UI/Resources/Script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Script.png -------------------------------------------------------------------------------- /UI/Resources/SelectAll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/SelectAll.png -------------------------------------------------------------------------------- /UI/Resources/Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Settings.png -------------------------------------------------------------------------------- /UI/Resources/SpcDebugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/SpcDebugger.png -------------------------------------------------------------------------------- /UI/Resources/Speed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Speed.png -------------------------------------------------------------------------------- /UI/Resources/SplitView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/SplitView.png -------------------------------------------------------------------------------- /UI/Resources/StepBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/StepBack.png -------------------------------------------------------------------------------- /UI/Resources/StepInto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/StepInto.png -------------------------------------------------------------------------------- /UI/Resources/StepOut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/StepOut.png -------------------------------------------------------------------------------- /UI/Resources/StepOver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/StepOver.png -------------------------------------------------------------------------------- /UI/Resources/SwitchView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/SwitchView.png -------------------------------------------------------------------------------- /UI/Resources/Tape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Tape.png -------------------------------------------------------------------------------- /UI/Resources/Undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Undo.png -------------------------------------------------------------------------------- /UI/Resources/UnidentifiedData.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/UnidentifiedData.png -------------------------------------------------------------------------------- /UI/Resources/Update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Update.png -------------------------------------------------------------------------------- /UI/Resources/VerifiedData.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/VerifiedData.png -------------------------------------------------------------------------------- /UI/Resources/VerticalLayout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/VerticalLayout.png -------------------------------------------------------------------------------- /UI/Resources/VideoFilter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/VideoFilter.png -------------------------------------------------------------------------------- /UI/Resources/VideoOptions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/VideoOptions.png -------------------------------------------------------------------------------- /UI/Resources/VideoRecorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/VideoRecorder.png -------------------------------------------------------------------------------- /UI/Resources/Warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Warning.png -------------------------------------------------------------------------------- /UI/Resources/WasdKeys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/WasdKeys.png -------------------------------------------------------------------------------- /UI/Resources/WebBrowser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/WebBrowser.png -------------------------------------------------------------------------------- /UI/Resources/XbIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/XbIcon.png -------------------------------------------------------------------------------- /UI/Resources/Zoom2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UI/Resources/Zoom2x.png -------------------------------------------------------------------------------- /UI/RuntimeChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using Mesen.GUI.Config; 11 | using Mesen.GUI.Forms; 12 | 13 | namespace Mesen.GUI 14 | { 15 | class RuntimeChecker 16 | { 17 | public static bool TestDll() 18 | { 19 | try { 20 | return EmuApi.TestDll(); 21 | } catch { 22 | } 23 | 24 | bool dllExists; 25 | if(Program.IsMono) { 26 | dllExists = File.Exists(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "libMesenSCore.dll")); 27 | } else { 28 | dllExists = File.Exists("MesenSCore.dll"); 29 | } 30 | 31 | if(!dllExists) { 32 | MesenMsgBox.Show("UnableToStartMissingFiles", MessageBoxButtons.OK, MessageBoxIcon.Error); 33 | } else { 34 | MesenMsgBox.Show("UnableToStartMissingDependencies", MessageBoxButtons.OK, MessageBoxIcon.Error); 35 | } 36 | return false; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /UI/Utilities/ImageExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Drawing2D; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Mesen.GUI.Utilities 10 | { 11 | static class ImageExtensions 12 | { 13 | public static Image GetScaledImage(this Image img, double scale) 14 | { 15 | int newWidth = (int)(img.Width * scale); 16 | int newHeight = (int)(img.Height * scale); 17 | 18 | Bitmap scaledImg = new Bitmap(newWidth, newHeight); 19 | using(Graphics g = Graphics.FromImage(scaledImg)) { 20 | g.InterpolationMode = scale >= 2 ? InterpolationMode.NearestNeighbor : InterpolationMode.HighQualityBicubic; 21 | g.DrawImage(img, 0, 0, newWidth, newHeight); 22 | } 23 | 24 | return scaledImg; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /UI/Utilities/Md5Helper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Mesen.GUI.Utilities 9 | { 10 | public class Md5Helper 11 | { 12 | public static string GetMD5Hash(string filename) 13 | { 14 | if(File.Exists(filename)) { 15 | var md5 = System.Security.Cryptography.MD5.Create(); 16 | return BitConverter.ToString(md5.ComputeHash(File.ReadAllBytes(filename))).Replace("-", ""); 17 | } 18 | return null; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /UI/Utilities/XmlColor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Xml.Serialization; 8 | 9 | namespace Mesen.GUI.Utilities 10 | { 11 | public class XmlColor 12 | { 13 | private Color _color = Color.Black; 14 | 15 | public XmlColor() { } 16 | public XmlColor(Color c) { _color = c; } 17 | 18 | [XmlIgnore] 19 | public Color Color 20 | { 21 | get { return _color; } 22 | set { _color = value; } 23 | } 24 | 25 | public static implicit operator Color(XmlColor x) 26 | { 27 | return x.Color; 28 | } 29 | 30 | public static implicit operator XmlColor(Color c) 31 | { 32 | return new XmlColor(c); 33 | } 34 | 35 | [XmlAttribute] 36 | public string ColorString 37 | { 38 | get { return ColorTranslator.ToHtml(_color); } 39 | set 40 | { 41 | try { 42 | _color = ColorTranslator.FromHtml(value); 43 | } catch(Exception) { 44 | _color = Color.Black; 45 | } 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /UpdateHelper/Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/UpdateHelper/Icon.ico -------------------------------------------------------------------------------- /Utilities/ArchiveReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class ArchiveReader 5 | { 6 | protected: 7 | bool _initialized = false; 8 | uint8_t* _buffer = nullptr; 9 | virtual bool InternalLoadArchive(void* buffer, size_t size) = 0; 10 | virtual vector InternalGetFileList() = 0; 11 | public: 12 | ~ArchiveReader(); 13 | 14 | bool LoadArchive(void* buffer, size_t size); 15 | bool LoadArchive(vector& data); 16 | bool LoadArchive(string filename); 17 | bool LoadArchive(std::istream &in); 18 | 19 | bool GetStream(string filename, std::stringstream &stream); 20 | 21 | vector GetFileList(std::initializer_list extensions = {}); 22 | bool CheckFile(string filename); 23 | 24 | virtual bool ExtractFile(string filename, vector &output) = 0; 25 | 26 | static shared_ptr GetReader(std::istream &in); 27 | static shared_ptr GetReader(string filepath); 28 | }; -------------------------------------------------------------------------------- /Utilities/AutoResetEvent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | #include 5 | #include 6 | 7 | class AutoResetEvent 8 | { 9 | private: 10 | std::condition_variable _signal; 11 | std::mutex _mutex; 12 | bool _signaled; 13 | 14 | public: 15 | AutoResetEvent(); 16 | ~AutoResetEvent(); 17 | 18 | void Reset(); 19 | void Wait(int timeoutDelay = 0); 20 | void Signal(); 21 | }; 22 | -------------------------------------------------------------------------------- /Utilities/BaseCodec.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class BaseCodec 5 | { 6 | public: 7 | virtual bool SetupCompress(int width, int height, uint32_t compressionLevel) = 0; 8 | virtual int CompressFrame(bool isKeyFrame, uint8_t *frameData, uint8_t** compressedData) = 0; 9 | virtual const char* GetFourCC() = 0; 10 | 11 | virtual ~BaseCodec() { } 12 | }; -------------------------------------------------------------------------------- /Utilities/BpsPatcher.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | class BpsPatcher 6 | { 7 | private: 8 | static int64_t ReadBase128Number(std::istream &file); 9 | 10 | public: 11 | static bool PatchBuffer(std::istream &bpsFile, vector &input, vector &output); 12 | static bool PatchBuffer(string bpsFilepath, vector &input, vector &output); 13 | }; -------------------------------------------------------------------------------- /Utilities/CRC32.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class CRC32 5 | { 6 | private: 7 | static uint32_t crc32_16bytes(const void* data, size_t length, uint32_t previousCrc32); 8 | 9 | public: 10 | static uint32_t GetCRC(uint8_t* buffer, std::streamoff length); 11 | static uint32_t GetCRC(string filename); 12 | }; -------------------------------------------------------------------------------- /Utilities/CamstudioCodec.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "BaseCodec.h" 4 | #include "miniz.h" 5 | 6 | class CamstudioCodec : public BaseCodec 7 | { 8 | private: 9 | uint8_t* _prevFrame = nullptr; 10 | uint8_t* _currentFrame = nullptr; 11 | uint8_t* _buffer = nullptr; 12 | 13 | uint32_t _compressBufferLength = 0; 14 | uint8_t* _compressBuffer = nullptr; 15 | z_stream _compressor = {}; 16 | int _compressionLevel = 0; 17 | 18 | int _orgWidth = 0; 19 | int _rowStride = 0; 20 | int _height = 0; 21 | 22 | void LoadRow(uint8_t* inPointer, uint8_t* outPointer); 23 | 24 | public: 25 | virtual ~CamstudioCodec(); 26 | 27 | virtual bool SetupCompress(int width, int height, uint32_t compressionLevel) override; 28 | virtual int CompressFrame(bool isKeyFrame, uint8_t *frameData, uint8_t** compressedData) override; 29 | virtual const char* GetFourCC() override; 30 | }; -------------------------------------------------------------------------------- /Utilities/Equalizer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "orfanidis_eq.h" 4 | 5 | class Equalizer 6 | { 7 | private: 8 | unique_ptr _eqFrequencyGrid; 9 | unique_ptr _equalizerLeft; 10 | unique_ptr _equalizerRight; 11 | 12 | uint32_t _prevSampleRate = 0; 13 | vector _prevEqualizerGains; 14 | 15 | public: 16 | void ApplyEqualizer(uint32_t sampleCount, int16_t *samples); 17 | void UpdateEqualizers(vector bandGains, uint32_t sampleRate); 18 | }; -------------------------------------------------------------------------------- /Utilities/GifRecorder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "../Utilities/IVideoRecorder.h" 4 | 5 | struct GifWriter; 6 | 7 | class GifRecorder : public IVideoRecorder 8 | { 9 | private: 10 | std::unique_ptr _gif; 11 | bool _recording = false; 12 | uint32_t _frameCounter = 0; 13 | string _outputFile; 14 | 15 | public: 16 | GifRecorder(); 17 | virtual ~GifRecorder(); 18 | 19 | bool StartRecording(string filename, uint32_t width, uint32_t height, uint32_t bpp, uint32_t audioSampleRate, double fps) override; 20 | void StopRecording() override; 21 | void AddFrame(void* frameBuffer, uint32_t width, uint32_t height, double fps) override; 22 | void AddSound(int16_t* soundBuffer, uint32_t sampleCount, uint32_t sampleRate) override; 23 | bool IsRecording() override; 24 | string GetOutputFile() override; 25 | }; -------------------------------------------------------------------------------- /Utilities/HermiteResampler.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class HermiteResampler 5 | { 6 | private: 7 | double _prevLeft[4] = {}; 8 | double _prevRight[4] = {}; 9 | double _rateRatio = 1.0; 10 | double _fraction = 0.0; 11 | 12 | __forceinline int16_t HermiteInterpolate(double values[4], double mu); 13 | __forceinline void PushSample(double prevValues[4], int16_t sample); 14 | 15 | public: 16 | void Reset(); 17 | 18 | void SetSampleRates(double srcRate, double dstRate); 19 | uint32_t Resample(int16_t* in, uint32_t inSampleCount, int16_t* out); 20 | }; -------------------------------------------------------------------------------- /Utilities/HexUtilities.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class HexUtilities 5 | { 6 | private: 7 | const static vector _hexCache; 8 | 9 | public: 10 | static string ToHex(uint8_t value); 11 | static const char* ToHexChar(uint8_t value); 12 | static string ToHex(uint16_t value); 13 | static string ToHex(uint32_t value, bool fullSize = false); 14 | static string ToHex(int32_t value, bool fullSize = false); 15 | static string ToHex24(int32_t value); 16 | static string ToHex(vector &data); 17 | 18 | static int FromHex(string hex); 19 | }; -------------------------------------------------------------------------------- /Utilities/ISerializable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Serializer; 4 | 5 | class ISerializable 6 | { 7 | public: 8 | virtual void Serialize(Serializer &s) = 0; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /Utilities/IVideoRecorder.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class IVideoRecorder 5 | { 6 | public: 7 | virtual bool StartRecording(string filename, uint32_t width, uint32_t height, uint32_t bpp, uint32_t audioSampleRate, double fps) = 0; 8 | virtual void StopRecording() = 0; 9 | 10 | virtual void AddFrame(void* frameBuffer, uint32_t width, uint32_t height, double fps) = 0; 11 | virtual void AddSound(int16_t* soundBuffer, uint32_t sampleCount, uint32_t sampleRate) = 0; 12 | 13 | virtual bool IsRecording() = 0; 14 | virtual string GetOutputFile() = 0; 15 | }; -------------------------------------------------------------------------------- /Utilities/IpsPatcher.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | class IpsPatcher 6 | { 7 | public: 8 | static bool PatchBuffer(string ipsFilepath, vector &input, vector &output); 9 | static bool PatchBuffer(vector& ipsData, vector& input, vector& output); 10 | static bool PatchBuffer(std::istream &ipsFile, vector &input, vector &output); 11 | static vector CreatePatch(vector originalData, vector newData); 12 | }; -------------------------------------------------------------------------------- /Utilities/KreedSaiEagle/SaiEagle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../stdafx.h" 3 | 4 | extern void supertwoxsai_generic_xrgb8888(unsigned width, unsigned height, uint32_t *src, unsigned src_stride, uint32_t *dst, unsigned dst_stride); 5 | extern void twoxsai_generic_xrgb8888(unsigned width, unsigned height, uint32_t *src, unsigned src_stride, uint32_t *dst, unsigned dst_stride); 6 | extern void supereagle_generic_xrgb8888(unsigned width, unsigned height, uint32_t *src, unsigned src_stride, uint32_t *dst, unsigned dst_stride); 7 | 8 | -------------------------------------------------------------------------------- /Utilities/PNGHelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class PNGHelper 5 | { 6 | private: 7 | static int DecodePNG(vector& out_image, unsigned long& image_width, unsigned long& image_height, const unsigned char* in_png, size_t in_size, bool convert_to_rgba32 = true); 8 | 9 | public: 10 | static bool WritePNG(std::stringstream &stream, uint32_t* buffer, uint32_t xSize, uint32_t ySize, uint32_t bitsPerPixel = 32); 11 | static bool WritePNG(string filename, uint32_t* buffer, uint32_t xSize, uint32_t ySize, uint32_t bitsPerPixel = 32); 12 | static bool ReadPNG(string filename, vector &pngData, uint32_t &pngWidth, uint32_t &pngHeight); 13 | static bool ReadPNG(vector input, vector &output, uint32_t &pngWidth, uint32_t &pngHeight); 14 | }; -------------------------------------------------------------------------------- /Utilities/PlatformUtilities.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class PlatformUtilities 5 | { 6 | private: 7 | static bool _highResTimerEnabled; 8 | 9 | public: 10 | static void DisableScreensaver(); 11 | static void EnableScreensaver(); 12 | 13 | static void EnableHighResolutionTimer(); 14 | static void RestoreTimerResolution(); 15 | }; -------------------------------------------------------------------------------- /Utilities/SZReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "ArchiveReader.h" 4 | #include "../SevenZip/7z.h" 5 | #include "../SevenZip/7zAlloc.h" 6 | #include "../SevenZip/7zCrc.h" 7 | #include "../SevenZip/7zTypes.h" 8 | #include "../SevenZip/7zMemBuffer.h" 9 | 10 | class SZReader : public ArchiveReader 11 | { 12 | private: 13 | CMemBufferInStream _memBufferStream; 14 | CLookToRead _lookStream; 15 | CSzArEx _archive; 16 | ISzAlloc _allocImp{ SzAlloc, SzFree }; 17 | ISzAlloc _allocTempImp{ SzAllocTemp, SzFreeTemp }; 18 | 19 | protected: 20 | bool InternalLoadArchive(void* buffer, size_t size); 21 | vector InternalGetFileList(); 22 | 23 | public: 24 | SZReader(); 25 | virtual ~SZReader(); 26 | 27 | bool ExtractFile(string filename, vector &output); 28 | }; -------------------------------------------------------------------------------- /Utilities/SimpleLock.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include 4 | 5 | class SimpleLock; 6 | 7 | class LockHandler 8 | { 9 | private: 10 | SimpleLock *_lock; 11 | public: 12 | LockHandler(SimpleLock *lock); 13 | ~LockHandler(); 14 | }; 15 | 16 | class SimpleLock 17 | { 18 | private: 19 | thread_local static std::thread::id _threadID; 20 | 21 | std::thread::id _holderThreadID; 22 | uint32_t _lockCount; 23 | atomic_flag _lock; 24 | 25 | public: 26 | SimpleLock(); 27 | ~SimpleLock(); 28 | 29 | LockHandler AcquireSafe(); 30 | 31 | void Acquire(); 32 | bool IsFree(); 33 | void WaitForRelease(); 34 | void Release(); 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /Utilities/Socket.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | class Socket 6 | { 7 | private: 8 | #ifndef LIBRETRO 9 | #ifdef _WIN32 10 | bool _cleanupWSA = false; 11 | #endif 12 | 13 | uintptr_t _socket = ~0; 14 | bool _connectionError = false; 15 | int32_t _UPnPPort = -1; 16 | #endif 17 | 18 | public: 19 | Socket(); 20 | Socket(uintptr_t socket); 21 | ~Socket(); 22 | 23 | void SetSocketOptions(); 24 | void SetConnectionErrorFlag(); 25 | 26 | void Close(); 27 | bool ConnectionError(); 28 | 29 | void Bind(uint16_t port); 30 | bool Connect(const char* hostname, uint16_t port); 31 | void Listen(int backlog); 32 | shared_ptr Accept(); 33 | 34 | int Send(char *buf, int len, int flags); 35 | void BufferedSend(char *buf, int len); 36 | void SendBuffer(); 37 | int Recv(char *buf, int len, int flags); 38 | }; 39 | -------------------------------------------------------------------------------- /Utilities/StringUtilities.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | 4 | class StringUtilities 5 | { 6 | public: 7 | static vector Split(string input, char delimiter) 8 | { 9 | vector result; 10 | size_t index = 0; 11 | size_t lastIndex = 0; 12 | while((index = input.find(delimiter, index)) != string::npos) { 13 | result.push_back(input.substr(lastIndex, index - lastIndex)); 14 | index++; 15 | lastIndex = index; 16 | } 17 | result.push_back(input.substr(lastIndex)); 18 | return result; 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /Utilities/Timer.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Timer.h" 3 | 4 | #include 5 | #include 6 | 7 | using namespace std::chrono; 8 | 9 | Timer::Timer() 10 | { 11 | Reset(); 12 | } 13 | 14 | void Timer::Reset() 15 | { 16 | _start = high_resolution_clock::now(); 17 | } 18 | 19 | double Timer::GetElapsedMS() 20 | { 21 | high_resolution_clock::time_point end = high_resolution_clock::now(); 22 | duration span = duration_cast>(end - _start); 23 | return span.count() * 1000.0; 24 | } 25 | 26 | void Timer::WaitUntil(double targetMillisecond) 27 | { 28 | if(targetMillisecond > 0) { 29 | double elapsedTime = GetElapsedMS(); 30 | if(targetMillisecond - elapsedTime > 1) { 31 | std::this_thread::sleep_for(std::chrono::duration((int)(targetMillisecond - elapsedTime))); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Utilities/Timer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include 4 | using namespace std::chrono; 5 | 6 | class Timer 7 | { 8 | private: 9 | high_resolution_clock::time_point _start; 10 | 11 | public: 12 | Timer(); 13 | void Reset(); 14 | double GetElapsedMS(); 15 | void WaitUntil(double targetMillisecond); 16 | }; -------------------------------------------------------------------------------- /Utilities/UPnPPortMapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | using std::wstring; 6 | 7 | enum class IPProtocol 8 | { 9 | TCP = 0, 10 | UDP = 1 11 | }; 12 | 13 | class UPnPPortMapper 14 | { 15 | private: 16 | static vector GetLocalIPs(); 17 | 18 | public: 19 | static bool AddNATPortMapping(uint16_t internalPort, uint16_t externalPort, IPProtocol protocol); 20 | static bool RemoveNATPortMapping(uint16_t externalPort, IPProtocol protocol); 21 | }; -------------------------------------------------------------------------------- /Utilities/UTF8Util.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "UTF8Util.h" 3 | #include 4 | #include 5 | 6 | namespace utf8 7 | { 8 | std::wstring utf8::decode(const std::string &str) 9 | { 10 | std::wstring_convert> conv; 11 | return conv.from_bytes(str); 12 | } 13 | 14 | std::string utf8::encode(const std::wstring &wstr) 15 | { 16 | std::wstring_convert> conv; 17 | return conv.to_bytes(wstr); 18 | } 19 | 20 | std::string utf8::encode(const std::u16string &wstr) 21 | { 22 | #ifdef _MSC_VER 23 | std::wstring_convert, int16_t> conv; 24 | auto p = reinterpret_cast(wstr.data()); 25 | return conv.to_bytes(p, p + wstr.size()); 26 | #else 27 | std::wstring_convert, char16_t> conv; 28 | return conv.to_bytes(wstr); 29 | #endif 30 | } 31 | } -------------------------------------------------------------------------------- /Utilities/UpsPatcher.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | class UpsPatcher 6 | { 7 | private: 8 | static int64_t ReadBase128Number(std::istream &file); 9 | 10 | public: 11 | static bool PatchBuffer(std::istream &upsFile, vector &input, vector &output); 12 | static bool PatchBuffer(string upsFilepath, vector &input, vector &output); 13 | }; -------------------------------------------------------------------------------- /Utilities/ZipReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "miniz.h" 4 | #include "ArchiveReader.h" 5 | 6 | class ZipReader : public ArchiveReader 7 | { 8 | private: 9 | mz_zip_archive _zipArchive; 10 | 11 | protected: 12 | bool InternalLoadArchive(void* buffer, size_t size); 13 | vector InternalGetFileList(); 14 | 15 | public: 16 | ZipReader(); 17 | virtual ~ZipReader(); 18 | 19 | bool ExtractFile(string filename, vector &output); 20 | }; -------------------------------------------------------------------------------- /Utilities/ZipWriter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "stdafx.h" 3 | #include "miniz.h" 4 | 5 | class ZipWriter 6 | { 7 | private: 8 | mz_zip_archive _zipArchive; 9 | string _zipFilename; 10 | 11 | public: 12 | ZipWriter(); 13 | ~ZipWriter(); 14 | 15 | bool Initialize(string filename); 16 | bool Save(); 17 | 18 | void AddFile(string filepath, string zipFilename); 19 | void AddFile(vector &fileData, string zipFilename); 20 | void AddFile(std::stringstream &filestream, string zipFilename); 21 | }; -------------------------------------------------------------------------------- /Utilities/snes_ntsc_config.h: -------------------------------------------------------------------------------- 1 | /* Configure library by modifying this file */ 2 | 3 | #ifndef SNES_NTSC_CONFIG_H 4 | #define SNES_NTSC_CONFIG_H 5 | 6 | /* Format of source pixels */ 7 | /* #define SNES_NTSC_IN_FORMAT SNES_NTSC_RGB16 */ 8 | #define SNES_NTSC_IN_FORMAT SNES_NTSC_BGR15 9 | 10 | /* The following affect the built-in blitter only; a custom blitter can 11 | handle things however it wants. */ 12 | 13 | /* Bits per pixel of output. Can be 15, 16, 32, or 24 (same as 32). */ 14 | #define SNES_NTSC_OUT_DEPTH 32 15 | 16 | /* Type of input pixel values */ 17 | #define SNES_NTSC_IN_T unsigned short 18 | 19 | /* Each raw pixel input value is passed through this. You might want to mask 20 | the pixel index if you use the high bits as flags, etc. */ 21 | #define SNES_NTSC_ADJ_IN( in ) in 22 | 23 | /* For each pixel, this is the basic operation: 24 | output_color = SNES_NTSC_ADJ_IN( SNES_NTSC_IN_T ) */ 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Utilities/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Utilities.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /Utilities/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "UTF8Util.h" 14 | 15 | using std::shared_ptr; 16 | using std::unique_ptr; 17 | using utf8::ifstream; 18 | using utf8::ofstream; 19 | using std::ostream; 20 | using std::istream; 21 | using std::string; 22 | using std::vector; 23 | using std::atomic; 24 | using std::atomic_flag; 25 | 26 | #ifndef __MINGW32__ 27 | #ifdef __clang__ 28 | #define __forceinline __attribute__((always_inline)) inline 29 | #else 30 | #ifdef __GNUC__ 31 | #define __forceinline __attribute__((always_inline)) inline 32 | #endif 33 | #endif 34 | #endif -------------------------------------------------------------------------------- /Windows/Resources/MesenIcon.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Windows/Resources/MesenIcon.bmp -------------------------------------------------------------------------------- /Windows/Resources/Roboto.12.spritefont: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Windows/Resources/Roboto.12.spritefont -------------------------------------------------------------------------------- /Windows/Resources/Toast.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SourMesen/Mesen-S/1768b4fc83faa308d5e430e3cf785218f12c424d/Windows/Resources/Toast.dds -------------------------------------------------------------------------------- /Windows/XInputManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | #include 5 | 6 | class Console; 7 | 8 | class XInputManager 9 | { 10 | private: 11 | shared_ptr _console; 12 | vector> _gamePadStates; 13 | vector _gamePadConnected; 14 | 15 | public: 16 | XInputManager(shared_ptr console); 17 | 18 | bool NeedToUpdate(); 19 | void UpdateDeviceList(); 20 | void RefreshState(); 21 | bool IsPressed(uint8_t gamepadPort, uint8_t button); 22 | }; 23 | -------------------------------------------------------------------------------- /Windows/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Windows.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /Windows/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #This is a build script used for official releases which does not build the UI 4 | #Read the makefile and use "make" to build Mesen normally 5 | 6 | if [ "$1" = libretro ]; then 7 | MESENPLATFORM=x64 make clean 8 | LTO=true MESENPLATFORM=x64 make libretro -j 16 9 | else 10 | MESENPLATFORM=x64 BUILDTARGET=core ./buildPGO.sh 11 | cp ./InteropDLL/obj.x64/libMesenSCore.x64.dll ./bin/Any\ CPU/PGO\ Profile/Dependencies 12 | fi 13 | --------------------------------------------------------------------------------