From d7998b23ef52431ed2c18634f991a1635565482d Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Wed, 27 Jan 2016 22:31:39 +1100 Subject: [PATCH] Update to v097r03 release. byuu says: So, this WIP starts work on something new for higan. Obviously, I can't keep it a secret until it's ready, because I want to continue daily WIP releases, and of course, solicit feedback as I go along. --- higan/GNUmakefile | 1 + higan/data/higan.desktop | 2 +- higan/emulator/emulator.hpp | 2 +- higan/processor/GNUmakefile | 2 + higan/processor/v30mz/v30mz.cpp | 25 +++ higan/processor/v30mz/v30mz.hpp | 31 ++++ .../profile/WonderSwan Color.sys/manifest.bml | 1 + higan/profile/WonderSwan.sys/manifest.bml | 1 + higan/target-tomoko/GNUmakefile | 11 +- higan/target-tomoko/program/program.cpp | 2 + higan/target-tomoko/tomoko.cpp | 2 +- higan/target-tomoko/tomoko.hpp | 2 +- higan/ws/GNUmakefile | 13 ++ higan/ws/apu/apu.cpp | 31 ++++ higan/ws/apu/apu.hpp | 9 ++ higan/ws/cartridge/cartridge.cpp | 60 +++++++ higan/ws/cartridge/cartridge.hpp | 37 +++++ higan/ws/cartridge/memory.cpp | 26 +++ higan/ws/cpu/cpu.cpp | 44 +++++ higan/ws/cpu/cpu.hpp | 14 ++ higan/ws/cpu/memory.cpp | 9 ++ higan/ws/interface/interface.cpp | 151 ++++++++++++++++++ higan/ws/interface/interface.hpp | 60 +++++++ higan/ws/memory/memory.cpp | 26 +++ higan/ws/memory/memory.hpp | 15 ++ higan/ws/ppu/ppu.cpp | 44 +++++ higan/ws/ppu/ppu.hpp | 18 +++ higan/ws/ppu/video.cpp | 49 ++++++ higan/ws/ppu/video.hpp | 13 ++ higan/ws/scheduler/scheduler.cpp | 23 +++ higan/ws/scheduler/scheduler.hpp | 15 ++ higan/ws/system/system.cpp | 50 ++++++ higan/ws/system/system.hpp | 22 +++ higan/ws/ws.hpp | 54 +++++++ 34 files changed, 856 insertions(+), 9 deletions(-) create mode 100644 higan/processor/v30mz/v30mz.cpp create mode 100644 higan/processor/v30mz/v30mz.hpp create mode 100644 higan/profile/WonderSwan Color.sys/manifest.bml create mode 100644 higan/profile/WonderSwan.sys/manifest.bml create mode 100644 higan/ws/GNUmakefile create mode 100644 higan/ws/apu/apu.cpp create mode 100644 higan/ws/apu/apu.hpp create mode 100644 higan/ws/cartridge/cartridge.cpp create mode 100644 higan/ws/cartridge/cartridge.hpp create mode 100644 higan/ws/cartridge/memory.cpp create mode 100644 higan/ws/cpu/cpu.cpp create mode 100644 higan/ws/cpu/cpu.hpp create mode 100644 higan/ws/cpu/memory.cpp create mode 100644 higan/ws/interface/interface.cpp create mode 100644 higan/ws/interface/interface.hpp create mode 100644 higan/ws/memory/memory.cpp create mode 100644 higan/ws/memory/memory.hpp create mode 100644 higan/ws/ppu/ppu.cpp create mode 100644 higan/ws/ppu/ppu.hpp create mode 100644 higan/ws/ppu/video.cpp create mode 100644 higan/ws/ppu/video.hpp create mode 100644 higan/ws/scheduler/scheduler.cpp create mode 100644 higan/ws/scheduler/scheduler.hpp create mode 100644 higan/ws/system/system.cpp create mode 100644 higan/ws/system/system.hpp create mode 100644 higan/ws/ws.hpp diff --git a/higan/GNUmakefile b/higan/GNUmakefile index 9e194d41..1daac6cf 100644 --- a/higan/GNUmakefile +++ b/higan/GNUmakefile @@ -4,6 +4,7 @@ fc := fc sfc := sfc gb := gb gba := gba +ws := ws profile := accuracy target := tomoko diff --git a/higan/data/higan.desktop b/higan/data/higan.desktop index 4731230b..26b2e830 100644 --- a/higan/data/higan.desktop +++ b/higan/data/higan.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=higan -Comment=Nintendo emulator +Comment=Emulator Exec=higan Icon=higan Terminal=false diff --git a/higan/emulator/emulator.hpp b/higan/emulator/emulator.hpp index 84f24c7b..a16a9c63 100644 --- a/higan/emulator/emulator.hpp +++ b/higan/emulator/emulator.hpp @@ -6,7 +6,7 @@ using namespace nall; namespace Emulator { static const string Name = "higan"; - static const string Version = "097.02"; + static const string Version = "097.03"; static const string Author = "byuu"; static const string License = "GPLv3"; static const string Website = "http://byuu.org/"; diff --git a/higan/processor/GNUmakefile b/higan/processor/GNUmakefile index 28140ada..9d9a9ab7 100644 --- a/higan/processor/GNUmakefile +++ b/higan/processor/GNUmakefile @@ -7,6 +7,7 @@ processor_objects += $(if $(findstring r6502,$(processors)),processor-r6502) processor_objects += $(if $(findstring r65816,$(processors)),processor-r65816) processor_objects += $(if $(findstring spc700,$(processors)),processor-spc700) processor_objects += $(if $(findstring upd96050,$(processors)),processor-upd96050) +processor_objects += $(if $(findstring v30mz,$(processors)),processor-v30mz) objects += $(processor_objects) processor := processor @@ -18,3 +19,4 @@ obj/processor-r6502.o: $(processor)/r6502/r6502.cpp $(call rwildcard,$(proces obj/processor-r65816.o: $(processor)/r65816/r65816.cpp $(call rwildcard,$(processor)/r65816) obj/processor-spc700.o: $(processor)/spc700/spc700.cpp $(call rwildcard,$(processor)/spc700) obj/processor-upd96050.o: $(processor)/upd96050/upd96050.cpp $(call rwildcard,$(processor)/upd96050) +obj/processor-v30mz.o: $(processor)/v30mz/v30mz.cpp $(call rwildcard,$(processor)/v30mz) diff --git a/higan/processor/v30mz/v30mz.cpp b/higan/processor/v30mz/v30mz.cpp new file mode 100644 index 00000000..cc048a06 --- /dev/null +++ b/higan/processor/v30mz/v30mz.cpp @@ -0,0 +1,25 @@ +#include +#include "v30mz.hpp" + +namespace Processor { + +auto V30MZ::exec() -> void { + step(1); +} + +auto V30MZ::power() -> void { + r.ax = 0x0000; + r.cx = 0x0000; + r.dx = 0x0000; + r.bx = 0x0000; + r.sp = 0x0000; + r.bp = 0x0000; + r.si = 0x0000; + r.di = 0x0000; + r.es = 0x0000; + r.cs = 0xffff; + r.ss = 0x0000; + r.ds = 0x0000; +} + +} diff --git a/higan/processor/v30mz/v30mz.hpp b/higan/processor/v30mz/v30mz.hpp new file mode 100644 index 00000000..8f6794ee --- /dev/null +++ b/higan/processor/v30mz/v30mz.hpp @@ -0,0 +1,31 @@ +//NEC V30MZ + +#pragma once + +namespace Processor { + +struct V30MZ { + virtual auto step(uint clocks) -> void = 0; + virtual auto read(uint32 addr) -> uint8 = 0; + virtual auto write(uint32 addr, uint8 data) -> void = 0; + + auto exec() -> void; + auto power() -> void; + + struct Registers { + struct { uint16 ax; uint8 order_lsb2(al, ah); }; + struct { uint16 cx; uint8 order_lsb2(cl, ch); }; + struct { uint16 dx; uint8 order_lsb2(dl, dh); }; + struct { uint16 bx; uint8 order_lsb2(bl, bh); }; + uint16 sp; + uint16 bp; + uint16 si; + uint16 di; + uint16 es; + uint16 cs; + uint16 ss; + uint16 ds; + } r; +}; + +} diff --git a/higan/profile/WonderSwan Color.sys/manifest.bml b/higan/profile/WonderSwan Color.sys/manifest.bml new file mode 100644 index 00000000..4f4af405 --- /dev/null +++ b/higan/profile/WonderSwan Color.sys/manifest.bml @@ -0,0 +1 @@ +system name:WonderSwan Color diff --git a/higan/profile/WonderSwan.sys/manifest.bml b/higan/profile/WonderSwan.sys/manifest.bml new file mode 100644 index 00000000..b2be29cf --- /dev/null +++ b/higan/profile/WonderSwan.sys/manifest.bml @@ -0,0 +1 @@ +system name:WonderSwan diff --git a/higan/target-tomoko/GNUmakefile b/higan/target-tomoko/GNUmakefile index bf41ef50..02359d74 100644 --- a/higan/target-tomoko/GNUmakefile +++ b/higan/target-tomoko/GNUmakefile @@ -1,6 +1,6 @@ name := higan -processors := arm gsu hg51b lr35902 r6502 r65816 spc700 upd96050 +processors := arm gsu hg51b lr35902 r6502 r65816 spc700 upd96050 v30mz include processor/GNUmakefile include emulator/GNUmakefile @@ -8,6 +8,7 @@ include fc/GNUmakefile include sfc/GNUmakefile include gb/GNUmakefile include gba/GNUmakefile +include ws/GNUmakefile ui_objects := ui-tomoko ui-program ui-configuration ui-input ui_objects += ui-settings ui-tools ui-presentation @@ -90,12 +91,12 @@ else ifeq ($(platform),macosx) else ifneq ($(filter $(platform),linux bsd),) mkdir -p $(prefix)/bin/ mkdir -p $(prefix)/share/icons/ - mkdir -p $(prefix)/$(name)/ - mkdir -p ~/Emulation/System/ + mkdir -p $(prefix)/share/$(name)/ cp out/$(name) $(prefix)/bin/$(name) + cp data/$(name).desktop $(prefix)/share/applications/$(name).desktop cp data/$(name).png $(prefix)/share/icons/$(name).png - cp data/cheats.bml $(prefix)/$(name)/cheats.bml - cp -R profile/* $(prefix)/$(name)/ + cp data/cheats.bml $(prefix)/share/$(name)/cheats.bml + cp -R profile/* $(prefix)/share/$(name)/ endif uninstall: diff --git a/higan/target-tomoko/program/program.cpp b/higan/target-tomoko/program/program.cpp index 41c7104d..a44435dd 100644 --- a/higan/target-tomoko/program/program.cpp +++ b/higan/target-tomoko/program/program.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "interface.cpp" #include "media.cpp" #include "state.cpp" @@ -17,6 +18,7 @@ Program::Program(lstring args) { emulators.append(new SuperFamicom::Interface); emulators.append(new GameBoy::Interface); emulators.append(new GameBoyAdvance::Interface); + emulators.append(new WonderSwan::Interface); for(auto& emulator : emulators) emulator->bind = this; new InputManager; diff --git a/higan/target-tomoko/tomoko.cpp b/higan/target-tomoko/tomoko.cpp index 295c1283..9a8a08b6 100644 --- a/higan/target-tomoko/tomoko.cpp +++ b/higan/target-tomoko/tomoko.cpp @@ -2,7 +2,7 @@ unique_pointer