diff --git a/Info.plist b/Info.plist
index db639ca..f52f3bc 100644
--- a/Info.plist
+++ b/Info.plist
@@ -19,7 +19,7 @@
CFBundleSignature
????
CFBundleVersion
- 1.22.2
+ 1.23.0
NSPrincipalClass
OEGameCoreController
OEGameCoreClass
diff --git a/Mednafen.xcodeproj/project.pbxproj b/Mednafen.xcodeproj/project.pbxproj
index 20464c4..eec2e5b 100644
--- a/Mednafen.xcodeproj/project.pbxproj
+++ b/Mednafen.xcodeproj/project.pbxproj
@@ -4747,9 +4747,9 @@
OTHER_CFLAGS = (
"-fwrapv",
"-DHAVE_MKDIR",
- "-DMEDNAFEN_VERSION=\\\"1.22.2\\\"",
+ "-DMEDNAFEN_VERSION=\\\"1.23.0-UNSTABLE\\\"",
"-DPACKAGE=\\\"mednafen\\\"",
- "-DMEDNAFEN_VERSION_NUMERIC=0x00102202",
+ "-DMEDNAFEN_VERSION_NUMERIC=0x00102300",
"-DPSS_STYLE=1",
"-DMPC_FIXED_POINT",
"-DARCH_X86",
@@ -4813,9 +4813,9 @@
OTHER_CFLAGS = (
"-fwrapv",
"-DHAVE_MKDIR",
- "-DMEDNAFEN_VERSION=\\\"1.22.2\\\"",
+ "-DMEDNAFEN_VERSION=\\\"1.23.0-UNSTABLE\\\"",
"-DPACKAGE=\\\"mednafen\\\"",
- "-DMEDNAFEN_VERSION_NUMERIC=0x00102202",
+ "-DMEDNAFEN_VERSION_NUMERIC=0x00102300",
"-DPSS_STYLE=1",
"-DMPC_FIXED_POINT",
"-DARCH_X86",
diff --git a/mednafen/Makefile.in b/mednafen/Makefile.in
index f5926a3..d20d35f 100644
--- a/mednafen/Makefile.in
+++ b/mednafen/Makefile.in
@@ -256,7 +256,21 @@ DIST_COMMON = $(srcdir)/cdplay/Makefile.am.inc \
@WANT_SNES_EMU_TRUE@am__append_32 = libsnes.a
@WANT_SNES_EMU_TRUE@am__append_33 = libsnes.a
@WANT_SNES_EMU_TRUE@am__append_34 = libsnes.a
-@WANT_SNES_FAUST_EMU_TRUE@am__append_35 = snes_faust/cpu.cpp snes_faust/snes.cpp snes_faust/apu.cpp snes_faust/cart.cpp snes_faust/input.cpp snes_faust/ppu.cpp
+@WANT_SNES_FAUST_EMU_TRUE@am__append_35 = snes_faust/cpu.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/snes.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/apu.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/input.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/ppu.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/dsp1.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/dsp2.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/sdd1.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/cx4.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/superfx.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/sa1.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/sa1cpu.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/debug.cpp \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/dis65816.cpp
@WANT_SS_EMU_TRUE@am__append_36 = ss/libss.a
@WANT_SS_EMU_TRUE@am__append_37 = ss/libss.a
@WANT_SSFPLAY_EMU_TRUE@am__append_38 = ss/libssfplay.a
@@ -369,17 +383,12 @@ am__libngp_a_SOURCES_DIST = ngp/bios.cpp ngp/biosHLE.cpp ngp/dma.cpp \
ngp/gfx_scanline_mono.cpp ngp/gfx_scanline_colour.cpp \
ngp/interrupt.cpp ngp/mem.cpp ngp/neopop.cpp ngp/rom.cpp \
ngp/rtc.cpp ngp/sound.cpp ngp/Z80_interface.cpp \
- ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp \
- ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp \
ngp/TLCS-900h/TLCS900h_interpret_single.cpp \
- ngp/TLCS-900h/TLCS900h_disassemble_src.cpp \
ngp/TLCS-900h/TLCS900h_interpret.cpp \
ngp/TLCS-900h/TLCS900h_registers.cpp \
ngp/TLCS-900h/TLCS900h_interpret_reg.cpp \
- ngp/TLCS-900h/TLCS900h_disassemble.cpp \
ngp/TLCS-900h/TLCS900h_interpret_src.cpp \
- ngp/TLCS-900h/TLCS900h_interpret_dst.cpp \
- ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp
+ ngp/TLCS-900h/TLCS900h_interpret_dst.cpp
@WANT_NGP_EMU_TRUE@am_libngp_a_OBJECTS = ngp/libngp_a-bios.$(OBJEXT) \
@WANT_NGP_EMU_TRUE@ ngp/libngp_a-biosHLE.$(OBJEXT) \
@WANT_NGP_EMU_TRUE@ ngp/libngp_a-dma.$(OBJEXT) \
@@ -395,17 +404,12 @@ am__libngp_a_SOURCES_DIST = ngp/bios.cpp ngp/biosHLE.cpp ngp/dma.cpp \
@WANT_NGP_EMU_TRUE@ ngp/libngp_a-rtc.$(OBJEXT) \
@WANT_NGP_EMU_TRUE@ ngp/libngp_a-sound.$(OBJEXT) \
@WANT_NGP_EMU_TRUE@ ngp/libngp_a-Z80_interface.$(OBJEXT) \
-@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.$(OBJEXT) \
-@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.$(OBJEXT) \
@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_interpret_single.$(OBJEXT) \
-@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.$(OBJEXT) \
@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_interpret.$(OBJEXT) \
@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_registers.$(OBJEXT) \
@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_interpret_reg.$(OBJEXT) \
-@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.$(OBJEXT) \
@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_interpret_src.$(OBJEXT) \
-@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_interpret_dst.$(OBJEXT) \
-@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.$(OBJEXT)
+@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/libngp_a-TLCS900h_interpret_dst.$(OBJEXT)
libngp_a_OBJECTS = $(am_libngp_a_OBJECTS)
libsnes_a_AR = $(AR) $(ARFLAGS)
libsnes_a_LIBADD =
@@ -579,16 +583,21 @@ am__mednafen_SOURCES_DIST = debug.cpp error.cpp mempatcher.cpp \
sms/romdb.cpp sms/sms.cpp sms/sound.cpp sms/system.cpp \
sms/tms.cpp sms/vdp.cpp snes_faust/cpu.cpp snes_faust/snes.cpp \
snes_faust/apu.cpp snes_faust/cart.cpp snes_faust/input.cpp \
- snes_faust/ppu.cpp vb/vb.cpp vb/timer.cpp vb/input.cpp \
- vb/vip.cpp vb/vsu.cpp vb/debug.cpp wswan/gfx.cpp \
- wswan/main.cpp wswan/memory.cpp wswan/comm.cpp wswan/v30mz.cpp \
- wswan/sound.cpp wswan/tcache.cpp wswan/interrupt.cpp \
- wswan/eeprom.cpp wswan/rtc.cpp wswan/debug.cpp \
- wswan/dis/dis_decode.cpp wswan/dis/dis_groups.cpp \
- wswan/dis/resolve.cpp wswan/dis/syntax.cpp \
- hw_cpu/m68k/m68k.cpp hw_cpu/z80-fuse/z80.cpp \
- hw_cpu/z80-fuse/z80_ops.cpp hw_cpu/v810/v810_cpu.cpp \
- hw_cpu/v810/v810_cpuD.cpp hw_cpu/v810/v810_fp_ops.cpp \
+ snes_faust/ppu.cpp snes_faust/cart/dsp1.cpp \
+ snes_faust/cart/dsp2.cpp snes_faust/cart/sdd1.cpp \
+ snes_faust/cart/cx4.cpp snes_faust/cart/superfx.cpp \
+ snes_faust/cart/sa1.cpp snes_faust/cart/sa1cpu.cpp \
+ snes_faust/debug.cpp snes_faust/dis65816.cpp vb/vb.cpp \
+ vb/timer.cpp vb/input.cpp vb/vip.cpp vb/vsu.cpp vb/debug.cpp \
+ wswan/gfx.cpp wswan/main.cpp wswan/memory.cpp wswan/comm.cpp \
+ wswan/v30mz.cpp wswan/sound.cpp wswan/tcache.cpp \
+ wswan/interrupt.cpp wswan/eeprom.cpp wswan/rtc.cpp \
+ wswan/debug.cpp wswan/dis/dis_decode.cpp \
+ wswan/dis/dis_groups.cpp wswan/dis/resolve.cpp \
+ wswan/dis/syntax.cpp hw_cpu/m68k/m68k.cpp \
+ hw_cpu/z80-fuse/z80.cpp hw_cpu/z80-fuse/z80_ops.cpp \
+ hw_cpu/v810/v810_cpu.cpp hw_cpu/v810/v810_cpuD.cpp \
+ hw_cpu/v810/v810_fp_ops.cpp \
hw_misc/arcade_card/arcade_card.cpp \
hw_sound/ym2413/emu2413.cpp hw_sound/ym2612/Ym2612_Emu.cpp \
hw_sound/gb_apu/Gb_Apu.cpp hw_sound/gb_apu/Gb_Apu_State.cpp \
@@ -851,7 +860,16 @@ am__mednafen_SOURCES_DIST = debug.cpp error.cpp mempatcher.cpp \
@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/apu.$(OBJEXT) \
@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart.$(OBJEXT) \
@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/input.$(OBJEXT) \
-@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/ppu.$(OBJEXT)
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/ppu.$(OBJEXT) \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/dsp1.$(OBJEXT) \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/dsp2.$(OBJEXT) \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/sdd1.$(OBJEXT) \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/cx4.$(OBJEXT) \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/superfx.$(OBJEXT) \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/sa1.$(OBJEXT) \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/cart/sa1cpu.$(OBJEXT) \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/debug.$(OBJEXT) \
+@WANT_SNES_FAUST_EMU_TRUE@ snes_faust/dis65816.$(OBJEXT)
@WANT_VB_EMU_TRUE@am__objects_20 = vb/vb.$(OBJEXT) vb/timer.$(OBJEXT) \
@WANT_VB_EMU_TRUE@ vb/input.$(OBJEXT) vb/vip.$(OBJEXT) \
@WANT_VB_EMU_TRUE@ vb/vsu.$(OBJEXT)
@@ -1325,11 +1343,12 @@ mednafen_SOURCES = debug.cpp error.cpp mempatcher.cpp settings.cpp \
@WANT_NGP_EMU_TRUE@libngp_a_SOURCES = ngp/bios.cpp ngp/biosHLE.cpp ngp/dma.cpp ngp/flash.cpp ngp/gfx.cpp ngp/T6W28_Apu.cpp \
@WANT_NGP_EMU_TRUE@ ngp/gfx_scanline_mono.cpp ngp/gfx_scanline_colour.cpp ngp/interrupt.cpp ngp/mem.cpp ngp/neopop.cpp \
@WANT_NGP_EMU_TRUE@ ngp/rom.cpp ngp/rtc.cpp ngp/sound.cpp ngp/Z80_interface.cpp \
-@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp \
-@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/TLCS900h_interpret_single.cpp ngp/TLCS-900h/TLCS900h_disassemble_src.cpp \
-@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/TLCS900h_interpret.cpp ngp/TLCS-900h/TLCS900h_registers.cpp ngp/TLCS-900h/TLCS900h_interpret_reg.cpp \
-@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/TLCS900h_disassemble.cpp ngp/TLCS-900h/TLCS900h_interpret_src.cpp \
-@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/TLCS900h_interpret_dst.cpp ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp
+@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/TLCS900h_interpret_single.cpp \
+@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/TLCS900h_interpret.cpp \
+@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/TLCS900h_registers.cpp \
+@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/TLCS900h_interpret_reg.cpp \
+@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/TLCS900h_interpret_src.cpp \
+@WANT_NGP_EMU_TRUE@ ngp/TLCS-900h/TLCS900h_interpret_dst.cpp
@WANT_SNES_EMU_TRUE@libsnes_a_CFLAGS = @AM_CFLAGS@ @SNES_EXTRA_FLAGS@
@WANT_SNES_EMU_TRUE@libsnes_a_CXXFLAGS = @AM_CXXFLAGS@ @SNES_EXTRA_FLAGS@ @SNES_EXTRA_CXXFLAGS@
@@ -1555,18 +1574,9 @@ ngp/TLCS-900h/$(am__dirstamp):
ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) ngp/TLCS-900h/$(DEPDIR)
@: > ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp)
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.$(OBJEXT): \
- ngp/TLCS-900h/$(am__dirstamp) \
- ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp)
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.$(OBJEXT): \
- ngp/TLCS-900h/$(am__dirstamp) \
- ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp)
ngp/TLCS-900h/libngp_a-TLCS900h_interpret_single.$(OBJEXT): \
ngp/TLCS-900h/$(am__dirstamp) \
ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp)
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.$(OBJEXT): \
- ngp/TLCS-900h/$(am__dirstamp) \
- ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp)
ngp/TLCS-900h/libngp_a-TLCS900h_interpret.$(OBJEXT): \
ngp/TLCS-900h/$(am__dirstamp) \
ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp)
@@ -1576,18 +1586,12 @@ ngp/TLCS-900h/libngp_a-TLCS900h_registers.$(OBJEXT): \
ngp/TLCS-900h/libngp_a-TLCS900h_interpret_reg.$(OBJEXT): \
ngp/TLCS-900h/$(am__dirstamp) \
ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp)
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.$(OBJEXT): \
- ngp/TLCS-900h/$(am__dirstamp) \
- ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp)
ngp/TLCS-900h/libngp_a-TLCS900h_interpret_src.$(OBJEXT): \
ngp/TLCS-900h/$(am__dirstamp) \
ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp)
ngp/TLCS-900h/libngp_a-TLCS900h_interpret_dst.$(OBJEXT): \
ngp/TLCS-900h/$(am__dirstamp) \
ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp)
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.$(OBJEXT): \
- ngp/TLCS-900h/$(am__dirstamp) \
- ngp/TLCS-900h/$(DEPDIR)/$(am__dirstamp)
libngp.a: $(libngp_a_OBJECTS) $(libngp_a_DEPENDENCIES) $(EXTRA_libngp_a_DEPENDENCIES)
$(AM_V_at)-rm -f libngp.a
@@ -2549,6 +2553,30 @@ snes_faust/input.$(OBJEXT): snes_faust/$(am__dirstamp) \
snes_faust/$(DEPDIR)/$(am__dirstamp)
snes_faust/ppu.$(OBJEXT): snes_faust/$(am__dirstamp) \
snes_faust/$(DEPDIR)/$(am__dirstamp)
+snes_faust/cart/$(am__dirstamp):
+ @$(MKDIR_P) snes_faust/cart
+ @: > snes_faust/cart/$(am__dirstamp)
+snes_faust/cart/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) snes_faust/cart/$(DEPDIR)
+ @: > snes_faust/cart/$(DEPDIR)/$(am__dirstamp)
+snes_faust/cart/dsp1.$(OBJEXT): snes_faust/cart/$(am__dirstamp) \
+ snes_faust/cart/$(DEPDIR)/$(am__dirstamp)
+snes_faust/cart/dsp2.$(OBJEXT): snes_faust/cart/$(am__dirstamp) \
+ snes_faust/cart/$(DEPDIR)/$(am__dirstamp)
+snes_faust/cart/sdd1.$(OBJEXT): snes_faust/cart/$(am__dirstamp) \
+ snes_faust/cart/$(DEPDIR)/$(am__dirstamp)
+snes_faust/cart/cx4.$(OBJEXT): snes_faust/cart/$(am__dirstamp) \
+ snes_faust/cart/$(DEPDIR)/$(am__dirstamp)
+snes_faust/cart/superfx.$(OBJEXT): snes_faust/cart/$(am__dirstamp) \
+ snes_faust/cart/$(DEPDIR)/$(am__dirstamp)
+snes_faust/cart/sa1.$(OBJEXT): snes_faust/cart/$(am__dirstamp) \
+ snes_faust/cart/$(DEPDIR)/$(am__dirstamp)
+snes_faust/cart/sa1cpu.$(OBJEXT): snes_faust/cart/$(am__dirstamp) \
+ snes_faust/cart/$(DEPDIR)/$(am__dirstamp)
+snes_faust/debug.$(OBJEXT): snes_faust/$(am__dirstamp) \
+ snes_faust/$(DEPDIR)/$(am__dirstamp)
+snes_faust/dis65816.$(OBJEXT): snes_faust/$(am__dirstamp) \
+ snes_faust/$(DEPDIR)/$(am__dirstamp)
vb/$(am__dirstamp):
@$(MKDIR_P) vb
@: > vb/$(am__dirstamp)
@@ -2968,6 +2996,7 @@ mostlyclean-compile:
-rm -f snes/src/smp/*.$(OBJEXT)
-rm -f snes/src/system/*.$(OBJEXT)
-rm -f snes_faust/*.$(OBJEXT)
+ -rm -f snes_faust/cart/*.$(OBJEXT)
-rm -f sound/*.$(OBJEXT)
-rm -f string/*.$(OBJEXT)
-rm -f tremor/*.$(OBJEXT)
@@ -3278,11 +3307,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@ngp/$(DEPDIR)/libngp_a-rom.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ngp/$(DEPDIR)/libngp_a-rtc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ngp/$(DEPDIR)/libngp_a-sound.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_dst.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_extra.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_reg.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_src.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret_dst.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret_reg.Po@am__quote@
@@ -3392,9 +3416,18 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/$(DEPDIR)/apu.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/$(DEPDIR)/cart.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/$(DEPDIR)/cpu.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/$(DEPDIR)/debug.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/$(DEPDIR)/dis65816.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/$(DEPDIR)/input.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/$(DEPDIR)/ppu.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/$(DEPDIR)/snes.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/cart/$(DEPDIR)/cx4.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/cart/$(DEPDIR)/dsp1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/cart/$(DEPDIR)/dsp2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/cart/$(DEPDIR)/sa1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/cart/$(DEPDIR)/sa1cpu.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/cart/$(DEPDIR)/sdd1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@snes_faust/cart/$(DEPDIR)/superfx.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@sound/$(DEPDIR)/Blip_Buffer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@sound/$(DEPDIR)/DSPUtility.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@sound/$(DEPDIR)/Fir_Resampler.Po@am__quote@
@@ -4120,34 +4153,6 @@ ngp/libngp_a-Z80_interface.obj: ngp/Z80_interface.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/libngp_a-Z80_interface.obj `if test -f 'ngp/Z80_interface.cpp'; then $(CYGPATH_W) 'ngp/Z80_interface.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/Z80_interface.cpp'; fi`
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.o: ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.o -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_extra.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.o `test -f 'ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_extra.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_extra.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp' object='ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.o `test -f 'ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp
-
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.obj: ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.obj -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_extra.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.obj `if test -f 'ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_extra.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_extra.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp' object='ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_extra.obj `if test -f 'ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp'; fi`
-
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.o: ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.o -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_reg.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.o `test -f 'ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_reg.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_reg.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp' object='ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.o `test -f 'ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp
-
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.obj: ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.obj -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_reg.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.obj `if test -f 'ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_reg.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_reg.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp' object='ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_reg.obj `if test -f 'ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp'; fi`
-
ngp/TLCS-900h/libngp_a-TLCS900h_interpret_single.o: ngp/TLCS-900h/TLCS900h_interpret_single.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_interpret_single.o -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret_single.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_interpret_single.o `test -f 'ngp/TLCS-900h/TLCS900h_interpret_single.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_interpret_single.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret_single.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret_single.Po
@@ -4162,20 +4167,6 @@ ngp/TLCS-900h/libngp_a-TLCS900h_interpret_single.obj: ngp/TLCS-900h/TLCS900h_int
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_interpret_single.obj `if test -f 'ngp/TLCS-900h/TLCS900h_interpret_single.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_interpret_single.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_interpret_single.cpp'; fi`
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.o: ngp/TLCS-900h/TLCS900h_disassemble_src.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.o -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_src.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.o `test -f 'ngp/TLCS-900h/TLCS900h_disassemble_src.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_disassemble_src.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_src.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_src.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ngp/TLCS-900h/TLCS900h_disassemble_src.cpp' object='ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.o `test -f 'ngp/TLCS-900h/TLCS900h_disassemble_src.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_disassemble_src.cpp
-
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.obj: ngp/TLCS-900h/TLCS900h_disassemble_src.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.obj -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_src.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.obj `if test -f 'ngp/TLCS-900h/TLCS900h_disassemble_src.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_disassemble_src.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_disassemble_src.cpp'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_src.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_src.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ngp/TLCS-900h/TLCS900h_disassemble_src.cpp' object='ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_src.obj `if test -f 'ngp/TLCS-900h/TLCS900h_disassemble_src.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_disassemble_src.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_disassemble_src.cpp'; fi`
-
ngp/TLCS-900h/libngp_a-TLCS900h_interpret.o: ngp/TLCS-900h/TLCS900h_interpret.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_interpret.o -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_interpret.o `test -f 'ngp/TLCS-900h/TLCS900h_interpret.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_interpret.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret.Po
@@ -4218,20 +4209,6 @@ ngp/TLCS-900h/libngp_a-TLCS900h_interpret_reg.obj: ngp/TLCS-900h/TLCS900h_interp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_interpret_reg.obj `if test -f 'ngp/TLCS-900h/TLCS900h_interpret_reg.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_interpret_reg.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_interpret_reg.cpp'; fi`
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.o: ngp/TLCS-900h/TLCS900h_disassemble.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.o -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.o `test -f 'ngp/TLCS-900h/TLCS900h_disassemble.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_disassemble.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ngp/TLCS-900h/TLCS900h_disassemble.cpp' object='ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.o `test -f 'ngp/TLCS-900h/TLCS900h_disassemble.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_disassemble.cpp
-
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.obj: ngp/TLCS-900h/TLCS900h_disassemble.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.obj -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.obj `if test -f 'ngp/TLCS-900h/TLCS900h_disassemble.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_disassemble.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_disassemble.cpp'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ngp/TLCS-900h/TLCS900h_disassemble.cpp' object='ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble.obj `if test -f 'ngp/TLCS-900h/TLCS900h_disassemble.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_disassemble.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_disassemble.cpp'; fi`
-
ngp/TLCS-900h/libngp_a-TLCS900h_interpret_src.o: ngp/TLCS-900h/TLCS900h_interpret_src.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_interpret_src.o -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret_src.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_interpret_src.o `test -f 'ngp/TLCS-900h/TLCS900h_interpret_src.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_interpret_src.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret_src.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_interpret_src.Po
@@ -4260,20 +4237,6 @@ ngp/TLCS-900h/libngp_a-TLCS900h_interpret_dst.obj: ngp/TLCS-900h/TLCS900h_interp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_interpret_dst.obj `if test -f 'ngp/TLCS-900h/TLCS900h_interpret_dst.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_interpret_dst.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_interpret_dst.cpp'; fi`
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.o: ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.o -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_dst.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.o `test -f 'ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_dst.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_dst.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp' object='ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.o `test -f 'ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp' || echo '$(srcdir)/'`ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp
-
-ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.obj: ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -MT ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.obj -MD -MP -MF ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_dst.Tpo -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.obj `if test -f 'ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_dst.Tpo ngp/TLCS-900h/$(DEPDIR)/libngp_a-TLCS900h_disassemble_dst.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp' object='ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libngp_a_CXXFLAGS) $(CXXFLAGS) -c -o ngp/TLCS-900h/libngp_a-TLCS900h_disassemble_dst.obj `if test -f 'ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp'; then $(CYGPATH_W) 'ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp'; else $(CYGPATH_W) '$(srcdir)/ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp'; fi`
-
snes/libsnes_a-interface.o: snes/interface.cpp
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsnes_a_CPPFLAGS) $(CPPFLAGS) $(libsnes_a_CXXFLAGS) $(CXXFLAGS) -MT snes/libsnes_a-interface.o -MD -MP -MF snes/$(DEPDIR)/libsnes_a-interface.Tpo -c -o snes/libsnes_a-interface.o `test -f 'snes/interface.cpp' || echo '$(srcdir)/'`snes/interface.cpp
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) snes/$(DEPDIR)/libsnes_a-interface.Tpo snes/$(DEPDIR)/libsnes_a-interface.Po
@@ -4962,6 +4925,8 @@ distclean-generic:
-rm -f snes/src/system/$(am__dirstamp)
-rm -f snes_faust/$(DEPDIR)/$(am__dirstamp)
-rm -f snes_faust/$(am__dirstamp)
+ -rm -f snes_faust/cart/$(DEPDIR)/$(am__dirstamp)
+ -rm -f snes_faust/cart/$(am__dirstamp)
-rm -f sound/$(DEPDIR)/$(am__dirstamp)
-rm -f sound/$(am__dirstamp)
-rm -f string/$(DEPDIR)/$(am__dirstamp)
@@ -4988,7 +4953,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \
mostlyclean-am
distclean: distclean-recursive
- -rm -rf ./$(DEPDIR) apple2/$(DEPDIR) cdplay/$(DEPDIR) cdrom/$(DEPDIR) cheat_formats/$(DEPDIR) compress/$(DEPDIR) cputest/$(DEPDIR) demo/$(DEPDIR) desa68/$(DEPDIR) gb/$(DEPDIR) gba/$(DEPDIR) hash/$(DEPDIR) hw_cpu/m68k/$(DEPDIR) hw_cpu/v810/$(DEPDIR) hw_cpu/z80-fuse/$(DEPDIR) hw_misc/arcade_card/$(DEPDIR) hw_sound/gb_apu/$(DEPDIR) hw_sound/pce_psg/$(DEPDIR) hw_sound/sms_apu/$(DEPDIR) hw_sound/ym2413/$(DEPDIR) hw_sound/ym2612/$(DEPDIR) hw_video/huc6270/$(DEPDIR) lynx/$(DEPDIR) md/$(DEPDIR) md/cart/$(DEPDIR) md/cd/$(DEPDIR) md/input/$(DEPDIR) minilzo/$(DEPDIR) mpcdec/$(DEPDIR) mthreading/$(DEPDIR) nes/$(DEPDIR) nes/boards/$(DEPDIR) nes/input/$(DEPDIR) nes/ntsc/$(DEPDIR) nes/ppu/$(DEPDIR) net/$(DEPDIR) ngp/$(DEPDIR) ngp/TLCS-900h/$(DEPDIR) pce/$(DEPDIR) pce/input/$(DEPDIR) pce_fast/$(DEPDIR) pcfx/$(DEPDIR) pcfx/input/$(DEPDIR) psx/$(DEPDIR) psx/input/$(DEPDIR) quicklz/$(DEPDIR) resampler/$(DEPDIR) sms/$(DEPDIR) snes/$(DEPDIR) snes/src/cartridge/$(DEPDIR) snes/src/cheat/$(DEPDIR) snes/src/chip/bsx/$(DEPDIR) snes/src/chip/cx4/$(DEPDIR) snes/src/chip/dsp1/$(DEPDIR) snes/src/chip/dsp2/$(DEPDIR) snes/src/chip/dsp3/$(DEPDIR) snes/src/chip/dsp4/$(DEPDIR) snes/src/chip/obc1/$(DEPDIR) snes/src/chip/sa1/$(DEPDIR) snes/src/chip/sdd1/$(DEPDIR) snes/src/chip/spc7110/$(DEPDIR) snes/src/chip/srtc/$(DEPDIR) snes/src/chip/st010/$(DEPDIR) snes/src/chip/superfx/$(DEPDIR) snes/src/cpu/$(DEPDIR) snes/src/cpu/core/$(DEPDIR) snes/src/cpu/scpu/$(DEPDIR) snes/src/lib/libco/$(DEPDIR) snes/src/memory/$(DEPDIR) snes/src/memory/smemory/$(DEPDIR) snes/src/ppu/$(DEPDIR) snes/src/sdsp/$(DEPDIR) snes/src/smp/$(DEPDIR) snes/src/system/$(DEPDIR) snes_faust/$(DEPDIR) sound/$(DEPDIR) string/$(DEPDIR) tremor/$(DEPDIR) trio/$(DEPDIR) vb/$(DEPDIR) video/$(DEPDIR) wswan/$(DEPDIR) wswan/dis/$(DEPDIR)
+ -rm -rf ./$(DEPDIR) apple2/$(DEPDIR) cdplay/$(DEPDIR) cdrom/$(DEPDIR) cheat_formats/$(DEPDIR) compress/$(DEPDIR) cputest/$(DEPDIR) demo/$(DEPDIR) desa68/$(DEPDIR) gb/$(DEPDIR) gba/$(DEPDIR) hash/$(DEPDIR) hw_cpu/m68k/$(DEPDIR) hw_cpu/v810/$(DEPDIR) hw_cpu/z80-fuse/$(DEPDIR) hw_misc/arcade_card/$(DEPDIR) hw_sound/gb_apu/$(DEPDIR) hw_sound/pce_psg/$(DEPDIR) hw_sound/sms_apu/$(DEPDIR) hw_sound/ym2413/$(DEPDIR) hw_sound/ym2612/$(DEPDIR) hw_video/huc6270/$(DEPDIR) lynx/$(DEPDIR) md/$(DEPDIR) md/cart/$(DEPDIR) md/cd/$(DEPDIR) md/input/$(DEPDIR) minilzo/$(DEPDIR) mpcdec/$(DEPDIR) mthreading/$(DEPDIR) nes/$(DEPDIR) nes/boards/$(DEPDIR) nes/input/$(DEPDIR) nes/ntsc/$(DEPDIR) nes/ppu/$(DEPDIR) net/$(DEPDIR) ngp/$(DEPDIR) ngp/TLCS-900h/$(DEPDIR) pce/$(DEPDIR) pce/input/$(DEPDIR) pce_fast/$(DEPDIR) pcfx/$(DEPDIR) pcfx/input/$(DEPDIR) psx/$(DEPDIR) psx/input/$(DEPDIR) quicklz/$(DEPDIR) resampler/$(DEPDIR) sms/$(DEPDIR) snes/$(DEPDIR) snes/src/cartridge/$(DEPDIR) snes/src/cheat/$(DEPDIR) snes/src/chip/bsx/$(DEPDIR) snes/src/chip/cx4/$(DEPDIR) snes/src/chip/dsp1/$(DEPDIR) snes/src/chip/dsp2/$(DEPDIR) snes/src/chip/dsp3/$(DEPDIR) snes/src/chip/dsp4/$(DEPDIR) snes/src/chip/obc1/$(DEPDIR) snes/src/chip/sa1/$(DEPDIR) snes/src/chip/sdd1/$(DEPDIR) snes/src/chip/spc7110/$(DEPDIR) snes/src/chip/srtc/$(DEPDIR) snes/src/chip/st010/$(DEPDIR) snes/src/chip/superfx/$(DEPDIR) snes/src/cpu/$(DEPDIR) snes/src/cpu/core/$(DEPDIR) snes/src/cpu/scpu/$(DEPDIR) snes/src/lib/libco/$(DEPDIR) snes/src/memory/$(DEPDIR) snes/src/memory/smemory/$(DEPDIR) snes/src/ppu/$(DEPDIR) snes/src/sdsp/$(DEPDIR) snes/src/smp/$(DEPDIR) snes/src/system/$(DEPDIR) snes_faust/$(DEPDIR) snes_faust/cart/$(DEPDIR) sound/$(DEPDIR) string/$(DEPDIR) tremor/$(DEPDIR) trio/$(DEPDIR) vb/$(DEPDIR) video/$(DEPDIR) wswan/$(DEPDIR) wswan/dis/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -5034,7 +4999,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
- -rm -rf ./$(DEPDIR) apple2/$(DEPDIR) cdplay/$(DEPDIR) cdrom/$(DEPDIR) cheat_formats/$(DEPDIR) compress/$(DEPDIR) cputest/$(DEPDIR) demo/$(DEPDIR) desa68/$(DEPDIR) gb/$(DEPDIR) gba/$(DEPDIR) hash/$(DEPDIR) hw_cpu/m68k/$(DEPDIR) hw_cpu/v810/$(DEPDIR) hw_cpu/z80-fuse/$(DEPDIR) hw_misc/arcade_card/$(DEPDIR) hw_sound/gb_apu/$(DEPDIR) hw_sound/pce_psg/$(DEPDIR) hw_sound/sms_apu/$(DEPDIR) hw_sound/ym2413/$(DEPDIR) hw_sound/ym2612/$(DEPDIR) hw_video/huc6270/$(DEPDIR) lynx/$(DEPDIR) md/$(DEPDIR) md/cart/$(DEPDIR) md/cd/$(DEPDIR) md/input/$(DEPDIR) minilzo/$(DEPDIR) mpcdec/$(DEPDIR) mthreading/$(DEPDIR) nes/$(DEPDIR) nes/boards/$(DEPDIR) nes/input/$(DEPDIR) nes/ntsc/$(DEPDIR) nes/ppu/$(DEPDIR) net/$(DEPDIR) ngp/$(DEPDIR) ngp/TLCS-900h/$(DEPDIR) pce/$(DEPDIR) pce/input/$(DEPDIR) pce_fast/$(DEPDIR) pcfx/$(DEPDIR) pcfx/input/$(DEPDIR) psx/$(DEPDIR) psx/input/$(DEPDIR) quicklz/$(DEPDIR) resampler/$(DEPDIR) sms/$(DEPDIR) snes/$(DEPDIR) snes/src/cartridge/$(DEPDIR) snes/src/cheat/$(DEPDIR) snes/src/chip/bsx/$(DEPDIR) snes/src/chip/cx4/$(DEPDIR) snes/src/chip/dsp1/$(DEPDIR) snes/src/chip/dsp2/$(DEPDIR) snes/src/chip/dsp3/$(DEPDIR) snes/src/chip/dsp4/$(DEPDIR) snes/src/chip/obc1/$(DEPDIR) snes/src/chip/sa1/$(DEPDIR) snes/src/chip/sdd1/$(DEPDIR) snes/src/chip/spc7110/$(DEPDIR) snes/src/chip/srtc/$(DEPDIR) snes/src/chip/st010/$(DEPDIR) snes/src/chip/superfx/$(DEPDIR) snes/src/cpu/$(DEPDIR) snes/src/cpu/core/$(DEPDIR) snes/src/cpu/scpu/$(DEPDIR) snes/src/lib/libco/$(DEPDIR) snes/src/memory/$(DEPDIR) snes/src/memory/smemory/$(DEPDIR) snes/src/ppu/$(DEPDIR) snes/src/sdsp/$(DEPDIR) snes/src/smp/$(DEPDIR) snes/src/system/$(DEPDIR) snes_faust/$(DEPDIR) sound/$(DEPDIR) string/$(DEPDIR) tremor/$(DEPDIR) trio/$(DEPDIR) vb/$(DEPDIR) video/$(DEPDIR) wswan/$(DEPDIR) wswan/dis/$(DEPDIR)
+ -rm -rf ./$(DEPDIR) apple2/$(DEPDIR) cdplay/$(DEPDIR) cdrom/$(DEPDIR) cheat_formats/$(DEPDIR) compress/$(DEPDIR) cputest/$(DEPDIR) demo/$(DEPDIR) desa68/$(DEPDIR) gb/$(DEPDIR) gba/$(DEPDIR) hash/$(DEPDIR) hw_cpu/m68k/$(DEPDIR) hw_cpu/v810/$(DEPDIR) hw_cpu/z80-fuse/$(DEPDIR) hw_misc/arcade_card/$(DEPDIR) hw_sound/gb_apu/$(DEPDIR) hw_sound/pce_psg/$(DEPDIR) hw_sound/sms_apu/$(DEPDIR) hw_sound/ym2413/$(DEPDIR) hw_sound/ym2612/$(DEPDIR) hw_video/huc6270/$(DEPDIR) lynx/$(DEPDIR) md/$(DEPDIR) md/cart/$(DEPDIR) md/cd/$(DEPDIR) md/input/$(DEPDIR) minilzo/$(DEPDIR) mpcdec/$(DEPDIR) mthreading/$(DEPDIR) nes/$(DEPDIR) nes/boards/$(DEPDIR) nes/input/$(DEPDIR) nes/ntsc/$(DEPDIR) nes/ppu/$(DEPDIR) net/$(DEPDIR) ngp/$(DEPDIR) ngp/TLCS-900h/$(DEPDIR) pce/$(DEPDIR) pce/input/$(DEPDIR) pce_fast/$(DEPDIR) pcfx/$(DEPDIR) pcfx/input/$(DEPDIR) psx/$(DEPDIR) psx/input/$(DEPDIR) quicklz/$(DEPDIR) resampler/$(DEPDIR) sms/$(DEPDIR) snes/$(DEPDIR) snes/src/cartridge/$(DEPDIR) snes/src/cheat/$(DEPDIR) snes/src/chip/bsx/$(DEPDIR) snes/src/chip/cx4/$(DEPDIR) snes/src/chip/dsp1/$(DEPDIR) snes/src/chip/dsp2/$(DEPDIR) snes/src/chip/dsp3/$(DEPDIR) snes/src/chip/dsp4/$(DEPDIR) snes/src/chip/obc1/$(DEPDIR) snes/src/chip/sa1/$(DEPDIR) snes/src/chip/sdd1/$(DEPDIR) snes/src/chip/spc7110/$(DEPDIR) snes/src/chip/srtc/$(DEPDIR) snes/src/chip/st010/$(DEPDIR) snes/src/chip/superfx/$(DEPDIR) snes/src/cpu/$(DEPDIR) snes/src/cpu/core/$(DEPDIR) snes/src/cpu/scpu/$(DEPDIR) snes/src/lib/libco/$(DEPDIR) snes/src/memory/$(DEPDIR) snes/src/memory/smemory/$(DEPDIR) snes/src/ppu/$(DEPDIR) snes/src/sdsp/$(DEPDIR) snes/src/smp/$(DEPDIR) snes/src/system/$(DEPDIR) snes_faust/$(DEPDIR) snes_faust/cart/$(DEPDIR) sound/$(DEPDIR) string/$(DEPDIR) tremor/$(DEPDIR) trio/$(DEPDIR) vb/$(DEPDIR) video/$(DEPDIR) wswan/$(DEPDIR) wswan/dis/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/mednafen/apple2/apple2.cpp b/mednafen/apple2/apple2.cpp
index 4835251..8f6eb0f 100644
--- a/mednafen/apple2/apple2.cpp
+++ b/mednafen/apple2/apple2.cpp
@@ -2,7 +2,7 @@
/* Mednafen Apple II Emulation Module */
/******************************************************************************/
/* apple2.cpp:
-** Copyright (C) 2018 Mednafen Team
+** Copyright (C) 2018-2019 Mednafen Team
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
@@ -493,6 +493,8 @@ static void Emulate(EmulateSpecStruct* espec)
s.mono_lumafilter = MDFN_GetSettingI("apple2.video.mono_lumafilter");
s.color_lumafilter = MDFN_GetSettingI("apple2.video.color_lumafilter");
+ s.mode = MDFN_GetSettingUI("apple2.video.mode");
+
s.matrix = MDFN_GetSettingUI("apple2.video.matrix");
for(unsigned cc_i = 0; cc_i < 3; cc_i++)
@@ -512,7 +514,7 @@ static void Emulate(EmulateSpecStruct* espec)
//
//
//
- Video::SetFormat(surface->format, s);
+ Video::SetFormat(surface->format, s, espec->CustomPalette, espec->CustomPaletteNumEntries);
//
VideoSettingChanged = false;
}
@@ -521,11 +523,7 @@ static void Emulate(EmulateSpecStruct* espec)
Sound::SetParams(espec->SoundRate, 0.00004, 3);
//
Video::surface = espec->surface;
-
- espec->DisplayRect.x = 0;
- espec->DisplayRect.y = 0;
- espec->DisplayRect.w = 560 + 12*2;
- espec->DisplayRect.h = 192;
+ espec->DisplayRect = Video::surface_dr;
MDFNMP_ApplyPeriodicCheats();
@@ -1678,6 +1676,16 @@ static const MDFNSetting_EnumList Matrix_List[] =
{ nullptr, 0 },
};
+static const MDFNSetting_EnumList Mode_List[] =
+{
+ { "composite", Video::Settings::MODE_COMPOSITE, "Composite", gettext_noop("Internal video dimensions of 584x192.") },
+ { "rgb", Video::Settings::MODE_RGB, "RGB", gettext_noop("Internal video dimensions of 292x192; suitable for use with scalers like hq2x.") },
+ { "rgb_alt1", Video::Settings::MODE_RGB_ALT1, "RGB (alternate algorithm 1)", gettext_noop("Internal video dimensions of 584x192.") },
+ { "rgb_alt2", Video::Settings::MODE_RGB_ALT2, "RGB (alternate algorithm 2)", gettext_noop("Internal video dimensions of 584x192.") },
+
+ { nullptr, 0 }
+};
+
static const MDFNSetting Settings[] =
{
{ "apple2.video.hue", MDFNSF_CAT_VIDEO, gettext_noop("Color video hue/tint."), nullptr, MDFNST_FLOAT, "0.0", "-1.0", "1.0", nullptr, VideoChangeNotif },
@@ -1701,6 +1709,8 @@ static const MDFNSetting Settings[] =
{ "apple2.video.matrix.blue.i", MDFNSF_CAT_VIDEO, gettext_noop("Custom color decoder matrix; blue, I."), gettext_noop("Only used if \"apple2.video.matrix\" is set to \"custom\"."), MDFNST_FLOAT, "-1.11", "-4.00", "4.00", nullptr, VideoChangeNotif },
{ "apple2.video.matrix.blue.q", MDFNSF_CAT_VIDEO, gettext_noop("Custom color decoder matrix; blue, Q."), gettext_noop("Only used if \"apple2.video.matrix\" is set to \"custom\"."), MDFNST_FLOAT, "1.70", "-4.00", "4.00", nullptr, VideoChangeNotif },
+ { "apple2.video.mode", MDFNSF_CAT_VIDEO, gettext_noop("Video rendering mode."), gettext_noop("When an RGB mode is enabled, settings \"apple2.video.force_mono\", \"apple2.video.mixed_text_mono\", \"apple2.video.mono_lumafilter\", \"apple2.video.color_lumafilter\", and \"apple2.video.color_smooth\" are effectively ignored."), MDFNST_ENUM, "composite", nullptr, nullptr, nullptr, VideoChangeNotif, Mode_List },
+
{ NULL },
};
@@ -1731,6 +1741,13 @@ static const CheatInfoStruct CheatInfo =
false
};
+static const CustomPalette_Spec CPInfo[] =
+{
+ { gettext_noop("RGB mode 16-color palette. The presence of a custom palette will automatically enable RGB video mode."), NULL, { 16, 0 } },
+
+ { NULL, NULL }
+};
+
}
using namespace MDFN_IEN_APPLE2;
@@ -1747,6 +1764,7 @@ MDFNGI EmulatedApple2 =
NULL,
//#endif
A2PortInfo,
+ NULL,
Load,
TestMagic,
nullptr,
@@ -1759,8 +1777,8 @@ MDFNGI EmulatedApple2 =
nullptr,
nullptr,
- nullptr,
- 0,
+ CPInfo,
+ 1,
CheatInfo,
diff --git a/mednafen/apple2/video.inc b/mednafen/apple2/video.inc
index cf9afa4..e839e90 100644
--- a/mednafen/apple2/video.inc
+++ b/mednafen/apple2/video.inc
@@ -2,7 +2,7 @@
/* Mednafen Apple II Emulation Module */
/******************************************************************************/
/* video.inc:
-** Copyright (C) 2018 Mednafen Team
+** Copyright (C) 2018-2019 Mednafen Team
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
@@ -58,9 +58,15 @@ namespace Video
enum { ColorLUT_NumPixels = 13 };
static uint32 ColorLUT[2][4][1U << ColorLUT_NumPixels];
+static uint32 RGBLUT[16 * 2];
static MDFN_PixelFormat format;
static bool EnableMixedTextMonoHack;
+static void (*BlitLineBitBuffer)(uint32* target);
+template static void BlitLineBitBuffer_RGB_Alt(uint32* target);
+static void BlitLineBitBuffer_RGB(uint32* target);
+static void BlitLineBitBuffer_Composite(uint32* target);
+
struct Settings
{
float hue = 0.0;
@@ -74,6 +80,16 @@ struct Settings
int mono_lumafilter = 5;
int color_lumafilter = -3;
+ enum
+ {
+ MODE_COMPOSITE = 0,
+ MODE_RGB,
+ MODE_RGB_ALT1,
+ MODE_RGB_ALT2
+ };
+
+ unsigned mode = MODE_COMPOSITE;
+
enum
{
MATRIX_MEDNAFEN = 0,
@@ -97,286 +113,241 @@ struct Settings
float custom_matrix[3][2];
};
-static const float matrixes[Settings::MATRIX_CUSTOM][3][2] =
-{
- //
- // Mednafen
- //
- {
- { 1.348808, 0.504299 }, // (102.5° * 1.440) + (237.7° * 0.000) + (0.0° * 0.000),
- { -0.242363, -0.526935 }, // (102.5° * 0.000) + (237.7° * 0.580) + (0.0° * 0.000),
- { -1.089278, 1.677341 }, // (102.5° * 0.000) + (237.7° * 0.000) + (0.0° * 2.000),
- },
-
- //
- // LA7620
- //
- {
- { 1.701933, 0.586023 }, // (104.0° * 1.800) + (238.0° * 0.000) + (0.0° * 0.000),
- { -0.253571, -0.543785 }, // (104.0° * 0.000) + (238.0° * 0.600) + (0.0° * 0.000),
- { -1.089278, 1.677341 }, // (104.0° * 0.000) + (238.0° * 0.000) + (0.0° * 2.000),
- },
+/*
+ text/lores
+ page1: 0x0400-0x07FF
+ page2: 0x0800-0x0BFF
- //
- // CXA2025 Japan
- //
- {
- { 1.377398, 0.732376 }, // (95.0° * 1.560) + (240.0° * 0.000) + (0.0° * 0.000),
- { -0.272394, -0.534604 }, // (95.0° * 0.000) + (240.0° * 0.600) + (0.0° * 0.000),
- { -1.089278, 1.677341 }, // (95.0° * 0.000) + (240.0° * 0.000) + (0.0° * 2.000),
- },
+ hires
+ page1: 0x2000-0x3FFF
+ page2: 0x4000-0x5FFF
- //
- // CXA2025 USA
- //
- {
- { 1.629501, 0.316743 }, // (112.0° * 1.660) + (252.0° * 0.000) + (0.0° * 0.000),
- { -0.377592, -0.466288 }, // (112.0° * 0.000) + (252.0° * 0.600) + (0.0° * 0.000),
- { -1.089278, 1.677341 }, // (112.0° * 0.000) + (252.0° * 0.000) + (0.0° * 2.000),
- },
- //
- // CXA2060 Japan
- //
- {
- { 1.377398, 0.732376 }, // (95.0° * 1.560) + (236.0° * 0.000) + (0.0° * 0.000),
- { -0.257883, -0.607533 }, // (95.0° * 0.000) + (236.0° * 0.660) + (0.0° * 0.000),
- { -1.089278, 1.677341 }, // (95.0° * 0.000) + (236.0° * 0.000) + (0.0° * 2.000),
- },
+ lores: 1 byte for 7x8 7MHz pixels, lower nybble for upper 4 pixels, upper nybble for lower 4 pixels
- //
- // CXA2060 USA
- //
- {
- { 1.456385, 0.559054 }, // (102.0° * 1.560) + (236.0° * 0.000) + (0.0° * 0.000),
- { -0.234439, -0.552303 }, // (102.0° * 0.000) + (236.0° * 0.600) + (0.0° * 0.000),
- { -1.089278, 1.677341 }, // (102.0° * 0.000) + (236.0° * 0.000) + (0.0° * 2.000),
- },
+ hires: 1 byte for 7x1 7MHz pixels, upper bit for phase/delay thing, bit0 leftmost pixel, bit6 rightmost pixel
+*/
- //
- // CXA2095 Japan
- //
- {
- { 1.059537, 0.563366 }, // (95.0° * 1.200) + (236.0° * 0.000) + (0.0° * 0.000),
- { -0.257883, -0.607533 }, // (95.0° * 0.000) + (236.0° * 0.660) + (0.0° * 0.000),
- { -1.089278, 1.677341 }, // (95.0° * 0.000) + (236.0° * 0.000) + (0.0° * 2.000),
- },
+static uint8 linebuffer[(560 + 24) / 8 + 4] = { 0 };
+static MDFN_Surface* surface;
+static MDFN_Rect surface_dr;
+static bool colorburst_present;
+static bool rgb_hires_latch;
+static uint32 HCounter, VCounter;
+static bool flashything;
+static int32 flashycounter;
+static bool HiresDelayBit = false;
+static uint64 NoiseLCG;
- //
- // CXA2095 USA
- //
- {
- { 1.483648, 0.482066 }, // (105.0° * 1.560) + (236.0° * 0.000) + (0.0° * 0.000),
- { -0.257883, -0.607533 }, // (105.0° * 0.000) + (236.0° * 0.660) + (0.0° * 0.000),
- { -1.089278, 1.677341 }, // (105.0° * 0.000) + (236.0° * 0.000) + (0.0° * 2.000),
- },
-};
+static void Power(void)
+{
+ HCounter = 0;
+ VCounter = 0xFA;
+ flashything = false;
+ flashycounter = 0;
+ HiresDelayBit = false;
+ NoiseLCG = 0;
+}
-// tint, saturation, -1.0 to 1.0
-static INLINE void SetFormat(const MDFN_PixelFormat& f, const Settings& s)
+template
+static void BlitLineBitBuffer_RGB_Alt(uint32* target)
{
- format = f;
- EnableMixedTextMonoHack = s.mixed_text_mono;
- //
- //
- const float (&d)[3][2] = (s.matrix == Settings::MATRIX_CUSTOM) ? s.custom_matrix : matrixes[s.matrix];
- float demod_tab[2][4];
+ uint32 pdata = 0;
- for(unsigned cd_i = 0; cd_i < 2; cd_i++)
+ if(!colorburst_present)
{
- static const float angles[2] = { 123.0, 33.0 };
-
- for(int x = 0; x < 4; x++)
+ for(int x = 0; x < 584; x++)
{
- demod_tab[cd_i][x] = sin(((x / 4.0) - s.hue / 8.0 + angles[cd_i] / 360.0) * (M_PI * 2.0));
- //printf("%d, %d, %f\n", cd_i, x, demod_tab[cd_i][x]);
+ pdata |= ((linebuffer[x >> 3] >> (x & 0x7)) & 1) << 12;
+ //
+ const bool C = (pdata & 1);
+ target[x] = RGBLUT[C ? 15 : 0];
+ //
+ pdata >>= 1;
}
}
-
-
- for(unsigned cbp = 0; cbp < 2; cbp++)
+ else if(!rgb_hires_latch)
{
- static const float coeffs[11][ColorLUT_NumPixels] =
- {
- /* -3 */ { 0.00172554, -0.00760881, -0.03068241, -0.01602947, 0.09901781, 0.27344111, 0.36027244, 0.27344111, 0.09901781, -0.01602947, -0.03068241, -0.00760881, 0.00172554, }, /* 1.000000 */
- /* -2 */ { -0.00085195, -0.00688802, -0.00964609, 0.02346799, 0.11669260, 0.23333631, 0.28777829, 0.23333631, 0.11669260, 0.02346799, -0.00964609, -0.00688802, -0.00085195, }, /* 1.000000 */
- /* -1 */ { -0.00666994, -0.01931400, -0.01700092, 0.03131011, 0.13104562, 0.23818615, 0.28488591, 0.23818615, 0.13104562, 0.03131011, -0.01700092, -0.01931400, -0.00666994, }, /* 1.000000 */
- /* 0 */ { 0.00000000, 0.00535462, 0.02579365, 0.06746032, 0.12500000, 0.17718506, 0.19841270, 0.17718506, 0.12500000, 0.06746032, 0.02579365, 0.00535462, 0.00000000, }, /* 1.000000 */
- /* 1 */ { 0.00000000, 0.00000000, 0.00957449, 0.04780242, 0.12137789, 0.20219758, 0.23809524, 0.20219758, 0.12137789, 0.04780242, 0.00957449, 0.00000000, 0.00000000, }, /* 1.000000 */
- /* 2 */ { 0.00000000, 0.00000000, 0.00000000, 0.01977578, 0.10119048, 0.23022422, 0.29761904, 0.23022422, 0.10119048, 0.01977578, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
- /* 3 */ { 0.00000000, 0.00000000, 0.00000000, 0.01464626, 0.08312087, 0.23555925, 0.33334723, 0.23555925, 0.08312087, 0.01464626, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
- /* 4 */ { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.05158730, 0.25000000, 0.39682540, 0.25000000, 0.05158730, 0.00000000, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
- /* 5 */ { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.25000000, 0.50000000, 0.25000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
- /* 6 */ { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.16666667, 0.66666669, 0.16666667, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
- /* 7 */ { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
- };
- const bool mono_mode = !cbp || s.force_mono;
- static const float colordiff_coeffs[ColorLUT_NumPixels] = { 0.00329843, 0.01538324, 0.04024864, 0.07809234, 0.12141892, 0.15652442, 0.17006803, 0.15652442, 0.12141892, 0.07809234, 0.04024864, 0.01538324, 0.00329843 };
- const float (&luma_coeffs)[ColorLUT_NumPixels] = coeffs[3 + (mono_mode ? s.mono_lumafilter : s.color_lumafilter)];
+ unsigned pat = 0;
+ unsigned dc = 1;
-#if 0
- for(unsigned ci = 0; ci < 11; ci++)
+ for(int x = 0; x < 584; x++)
{
- float sum = 0;
-
- printf(" /* % d */ { ", (int)ci - 3);
+ unsigned phase = x & 3;
+ bool nb = ((linebuffer[x >> 3] >> (x & 0x7)) & 1);
- for(unsigned i = 0; i < ColorLUT_NumPixels; i++)
+ pdata |= nb << 12;
+ //
+ dc++;
+ if(dc == 14)
{
- assert(coeffs[ci][i] == coeffs[ci][ColorLUT_NumPixels - 1 - i]);
- sum += coeffs[ci][i];
- printf("% .8f, ", coeffs[ci][i]);
+ pat = (pdata >> 0) & 0xF;
+ pat = ((pat << phase) | (pat >> (4 - phase))) & 0xF;
+ dc = 0;
}
- printf("}, /* %f */\n", sum);
+ target[x] = RGBLUT[pat];
+ //
+ pdata >>= 1;
}
-#endif
+ }
+ else
+ {
+ unsigned pat = 0;
+ unsigned bw = 0;
+ unsigned cpd = 0;
+ unsigned dc = 0;
+ unsigned halve = 0;
- for(unsigned phase = 0; phase < 4; phase++)
+ for(int x = 0; x < 584; x++)
{
- for(unsigned color = 0; color < (1U << ColorLUT_NumPixels); color++)
- {
- float y = 0;
- float color_diff[2] = { 0, 0 };
-
- for(unsigned i = 0; i < ColorLUT_NumPixels; i++)
- y += luma_coeffs[i] * ((color >> i) & 1);
-
- y = y * ((s.contrast * 0.50) + 1.0) + (s.brightness * 0.50);
-
- for(unsigned cd_i = 0; cd_i < 2; cd_i++)
- {
- for(unsigned i = 0; i < ColorLUT_NumPixels; i++)
- {
- float chroma = ((color >> i) & 1);
-
- color_diff[cd_i] += colordiff_coeffs[i] * demod_tab[cd_i][(i + phase) & 3] * chroma;
- }
- color_diff[cd_i] *= 1.0 + s.saturation;
+ unsigned phase = x & 3;
+ bool nb = ((linebuffer[x >> 3] >> (x & 0x7)) & 1);
- if(mono_mode)
- color_diff[cd_i] = 0;
- }
+ pdata |= nb << 12;
+ //
+ if((pdata & 0x1FC) == 0x070)
+ bw |= 0x070;
- unsigned rgb_cc[3];
+ if((pdata & 0xF00) == 0xF00)
+ bw |= 0xF00;
- for(unsigned cc_i = 0; cc_i < 3; cc_i++)
- {
- float eff_y = y * (s.force_mono ? (((s.force_mono >> ((2 - cc_i) << 3)) & 0xFF) / 255.0) : 1.0);
- float t = std::max(0.0, eff_y + d[cc_i][0] * color_diff[0] + d[cc_i][1] * color_diff[1]);
+ if((pdata & 0xF00) == 0x000)
+ bw |= 0xF00;
- //t = pow(t, d.power);
+ if(which == 2)
+ {
+ if((pdata & 0xF3C) == 0xF3C)
+ halve |= 0xC0; //bw |= 0xFFC;
- //if(t > 1.10)
- // printf("phase=%d color=0x%08x cc_i=%u t=%f\n", phase, color, cc_i, t);
+ if((pdata & 0xF1E) == 0xF1E)
+ halve |= 0xE0; //bw |= 0xFFE;
+ }
- rgb_cc[cc_i] = std::min(1016, std::max(0, floor(0.5 + 1016 * t)));
- }
+ if((pdata & 0xF00) == 0x300) // && !(pdata & 0x400))
+ dc = 0;
+ else
+ dc = (dc + 1) & 1;
- //printf("color 0x%01x: y=%f pb=%.13f pr=%.13f --- %3u %3u %3u\n", color, ySL2 / 4.0, pbSL6 / 64.0, prSL6 / 64.0, r, g, b);
+ if(!dc)
+ {
+ cpd = (pdata >> 0) & 0xF;
+ cpd = ((cpd << phase) | (cpd >> (4 - phase))) & 0xF;
+ }
- ColorLUT[cbp][phase][color] = (rgb_cc[0] << 0) + (rgb_cc[1] << 10) + (rgb_cc[2] << 20);
+ if(bw & 0x01)
+ pat = (pdata & 0x01) ? 15 : 0;
+ else if(which == 2 && (halve & 0x01))
+ pat = 0x10 + cpd;
+ else if(1)
+ {
+ //pat = (pdata >> (ps & 1)) & 0xF;
+ //pat = ((pat << phase) | (pat >> (4 - phase))) & 0xF;
+ pat = cpd;
}
+
+ target[x] = RGBLUT[pat];
+ //
+ pdata >>= 1;
+ bw >>= 1;
+ if(which == 2)
+ halve >>= 1;
}
}
+}
- if(s.color_smooth && !s.force_mono)
- {
- uint32 SmoothLUT[4][16];
+static void BlitLineBitBuffer_RGB(uint32* target)
+{
+ for(int i = 0; i < 6; i++)
+ *(target++) = RGBLUT[0];
- for(unsigned phase = 0; phase < 4; phase++)
+ if(!colorburst_present)
+ {
+ for(int x = 0; x < 560; x += 2)
{
- for(unsigned color = 0; color < 16; color++)
- {
- float r = 0;
- float g = 0;
- float b = 0;
- int r_p, g_p, b_p;
+ const bool C = (linebuffer[x >> 3] >> (x & 0x7)) & 1;
+ target[x >> 1] = RGBLUT[C ? 15 : 0];
+ }
+ target += 560;
+ }
+ else if(!rgb_hires_latch)
+ {
+ for(int x = 0; x < 560; x += 14)
+ {
+ unsigned pat = (MDFN_de32lsb(&linebuffer[x >> 3]) >> (x & 0x7)) & 0xF;
+ unsigned phase = x & 3;
+ uint32 pix;
- for(unsigned i = 0; i < 4; i++)
- {
- unsigned pattern = (color | (color << 4) | (color << 8) | (color << 12) | (color << 16)) >> (4 + i - phase);
- uint32 cle = ColorLUT[1][(i) & 3][pattern & 0x1FFF];
+ pat = ((pat << phase) | (pat >> (4 - phase))) & 0xF;
+ pix = RGBLUT[pat];
- r_p = (cle >> 0) & 0x3FF;
- g_p = (cle >> 10) & 0x3FF;
- b_p = (cle >> 20) & 0x3FF;
+ for(int sx = 0; sx < 7; sx++)
+ target[(x >> 1) + sx] = pix;
+ }
+ target += 560;
+ }
+ else
+ {
+ uint32 pdata = 0;
+ uint32 pshift = 0;
+ uint32 bw = 0;
+ uint32 cpd = 0;
- r += pow(r_p / 1016.0, 2.2);
- g += pow(g_p / 1016.0, 2.2);
- b += pow(b_p / 1016.0, 2.2);
- }
+ for(int x = 0; x < 560 + 14; x += 14)
+ {
+ uint32 tmp = MDFN_de32lsb(&linebuffer[x >> 3]) >> (x & 0x7);
- r /= 4;
- g /= 4;
- b /= 4;
+ if((tmp ^ (tmp >> 1)) & 0x1555)
+ {
+ tmp = ((tmp >> 1) & 0x1FFF) | (tmp & 0x2000);
+ pshift |= 0x3FFF << 14;
+ }
+ pdata |= (tmp & 0x3FFF) << 14;
- r_p = std::min(1016, floor(0.5 + 1016 * pow(r, 1.0 / 2.2)));
- g_p = std::min(1016, floor(0.5 + 1016 * pow(g, 1.0 / 2.2)));
- b_p = std::min(1016, floor(0.5 + 1016 * pow(b, 1.0 / 2.2)));
+ for(int sx = 0; sx < 14; sx += 2)
+ {
+ uint32 pat;
- //printf("Phase: %d, Color: %d - 0x%02x 0x%02x 0x%02x\n", phase, color, r_p, g_p, b_p);
+ if((pdata & 0xF00) == 0xF00)
+ bw |= 0xF00;
- SmoothLUT[phase][color] = (r_p << 0) + (g_p << 10) + (b_p << 20);
- }
- }
+ if((pdata & 0xF00) == 0x000)
+ bw |= 0xF00;
- for(unsigned phase = 0; phase < 4; phase++)
- {
- for(unsigned color = 0; color < (1U << ColorLUT_NumPixels); color++)
- {
- const unsigned c0 = (color >> 0) & 0x1F;
- const unsigned c1 = (color >> 4) & 0x1F;
- const unsigned c2 = (color >> 8) & 0x1F;
+ if(!(sx & 0x3))
+ {
+ unsigned shift = ((x & 2) ^ 2) + (pshift & 1);
+ cpd = pdata & 0xF;
+ cpd = ((cpd << shift) | (cpd >> (4 - shift))) & 0xF;
+ }
- if(c1 == c0 || c1 == c2 || (((color >> 2) & 0x7) == ((color >> 6) & 0x7) && ((color >> 3) & 0x7) == ((color >> 7) & 0x7)))
- ColorLUT[1][phase][color] = SmoothLUT[phase][c1 & 0xF];
+ if(bw & 1)
+ pat = (pdata & 0x1) ? 0xF : 0x0;
+ else
+ pat = cpd;
+
+ *target = RGBLUT[pat];
+ //
+ if(x >= 14)
+ target++;
+ bw >>= 2;
+ pdata >>= 2;
+ pshift >>= 2;
}
}
}
+
+ for(int i = 0; i < 6; i++)
+ *(target++) = RGBLUT[0];
}
-/*
- text/lores
- page1: 0x0400-0x07FF
- page2: 0x0800-0x0BFF
-
- hires
- page1: 0x2000-0x3FFF
- page2: 0x4000-0x5FFF
-
-
- lores: 1 byte for 7x8 7MHz pixels, lower nybble for upper 4 pixels, upper nybble for lower 4 pixels
-
- hires: 1 byte for 7x1 7MHz pixels, upper bit for phase/delay thing, bit0 leftmost pixel, bit6 rightmost pixel
-*/
-
-static uint8 linebuffer[(560 + 24) / 8 + 4] = { 0 };
-static MDFN_Surface* surface;
-static bool colorburst_present;
-static uint32 HCounter, VCounter;
-static bool flashything;
-static int32 flashycounter;
-static bool HiresDelayBit = false;
-static uint64 NoiseLCG;
-
-static void Power(void)
-{
- HCounter = 0;
- VCounter = 0xFA;
- flashything = false;
- flashycounter = 0;
- HiresDelayBit = false;
- NoiseLCG = 0;
-}
-
-static NO_INLINE void BlitLineBitBuffer_Composite(uint32* target)
-{
- uint32 pdata = 0;
- const unsigned nb_pos = (ColorLUT_NumPixels - 1) + (12 - (ColorLUT_NumPixels / 2));
- const uint8 rs = format.Rshift;
- const uint8 gs = format.Gshift;
- const uint8 bs = format.Bshift;
+static void BlitLineBitBuffer_Composite(uint32* target)
+{
+ uint32 pdata = 0;
+ const unsigned nb_pos = (ColorLUT_NumPixels - 1) + (12 - (ColorLUT_NumPixels / 2));
+ const uint8 rs = format.Rshift;
+ const uint8 gs = format.Gshift;
+ const uint8 bs = format.Bshift;
for(size_t x = 0; x < 584; x++)
{
@@ -561,7 +532,7 @@ static NO_INLINE void Tick(void)
}
#endif
- BlitLineBitBuffer_Composite(surface->pixels + vis_vc * surface->pitchinpix);
+ BlitLineBitBuffer(surface->pixels + vis_vc * surface->pitchinpix);
}
//
VCounter = (VCounter + 1) & 0x1FF;
@@ -585,6 +556,8 @@ static NO_INLINE void Tick(void)
if(text && EnableMixedTextMonoHack)
colorburst_present = false;
+
+ rgb_hires_latch = hires && !text;
}
if(flashycounter <= 0)
@@ -672,4 +645,320 @@ static INLINE void Kill(void)
}
+static const float matrixes[Settings::MATRIX_CUSTOM][3][2] =
+{
+ //
+ // Mednafen
+ //
+ {
+ { 1.348808, 0.504299 }, // (102.5° * 1.440) + (237.7° * 0.000) + (0.0° * 0.000),
+ { -0.242363, -0.526935 }, // (102.5° * 0.000) + (237.7° * 0.580) + (0.0° * 0.000),
+ { -1.089278, 1.677341 }, // (102.5° * 0.000) + (237.7° * 0.000) + (0.0° * 2.000),
+ },
+
+ //
+ // LA7620
+ //
+ {
+ { 1.701933, 0.586023 }, // (104.0° * 1.800) + (238.0° * 0.000) + (0.0° * 0.000),
+ { -0.253571, -0.543785 }, // (104.0° * 0.000) + (238.0° * 0.600) + (0.0° * 0.000),
+ { -1.089278, 1.677341 }, // (104.0° * 0.000) + (238.0° * 0.000) + (0.0° * 2.000),
+ },
+
+ //
+ // CXA2025 Japan
+ //
+ {
+ { 1.377398, 0.732376 }, // (95.0° * 1.560) + (240.0° * 0.000) + (0.0° * 0.000),
+ { -0.272394, -0.534604 }, // (95.0° * 0.000) + (240.0° * 0.600) + (0.0° * 0.000),
+ { -1.089278, 1.677341 }, // (95.0° * 0.000) + (240.0° * 0.000) + (0.0° * 2.000),
+ },
+
+ //
+ // CXA2025 USA
+ //
+ {
+ { 1.629501, 0.316743 }, // (112.0° * 1.660) + (252.0° * 0.000) + (0.0° * 0.000),
+ { -0.377592, -0.466288 }, // (112.0° * 0.000) + (252.0° * 0.600) + (0.0° * 0.000),
+ { -1.089278, 1.677341 }, // (112.0° * 0.000) + (252.0° * 0.000) + (0.0° * 2.000),
+ },
+
+ //
+ // CXA2060 Japan
+ //
+ {
+ { 1.377398, 0.732376 }, // (95.0° * 1.560) + (236.0° * 0.000) + (0.0° * 0.000),
+ { -0.257883, -0.607533 }, // (95.0° * 0.000) + (236.0° * 0.660) + (0.0° * 0.000),
+ { -1.089278, 1.677341 }, // (95.0° * 0.000) + (236.0° * 0.000) + (0.0° * 2.000),
+ },
+
+ //
+ // CXA2060 USA
+ //
+ {
+ { 1.456385, 0.559054 }, // (102.0° * 1.560) + (236.0° * 0.000) + (0.0° * 0.000),
+ { -0.234439, -0.552303 }, // (102.0° * 0.000) + (236.0° * 0.600) + (0.0° * 0.000),
+ { -1.089278, 1.677341 }, // (102.0° * 0.000) + (236.0° * 0.000) + (0.0° * 2.000),
+ },
+
+ //
+ // CXA2095 Japan
+ //
+ {
+ { 1.059537, 0.563366 }, // (95.0° * 1.200) + (236.0° * 0.000) + (0.0° * 0.000),
+ { -0.257883, -0.607533 }, // (95.0° * 0.000) + (236.0° * 0.660) + (0.0° * 0.000),
+ { -1.089278, 1.677341 }, // (95.0° * 0.000) + (236.0° * 0.000) + (0.0° * 2.000),
+ },
+
+ //
+ // CXA2095 USA
+ //
+ {
+ { 1.483648, 0.482066 }, // (105.0° * 1.560) + (236.0° * 0.000) + (0.0° * 0.000),
+ { -0.257883, -0.607533 }, // (105.0° * 0.000) + (236.0° * 0.660) + (0.0° * 0.000),
+ { -1.089278, 1.677341 }, // (105.0° * 0.000) + (236.0° * 0.000) + (0.0° * 2.000),
+ },
+};
+
+// tint, saturation, -1.0 to 1.0
+static INLINE void SetFormat(const MDFN_PixelFormat& f, const Settings& s, uint8* CustomPalette, uint32 CustomPaletteNumEntries)
+{
+ int mode = s.mode;
+
+ if(CustomPalette && CustomPaletteNumEntries && mode == Settings::MODE_COMPOSITE)
+ mode = Settings::MODE_RGB;
+ //
+ //
+ format = f;
+ EnableMixedTextMonoHack = (mode != Settings::MODE_COMPOSITE) ? true : s.mixed_text_mono;
+ //
+ //
+ surface_dr.x = 0;
+ surface_dr.y = 0;
+ surface_dr.w = (560 + 12*2) >> (mode == Settings::MODE_RGB);
+ surface_dr.h = 192;
+ //
+ //
+ //
+ if(mode == Settings::MODE_COMPOSITE)
+ BlitLineBitBuffer = BlitLineBitBuffer_Composite;
+ else
+ {
+ if(mode == Settings::MODE_RGB_ALT1)
+ BlitLineBitBuffer = BlitLineBitBuffer_RGB_Alt<1>;
+ else if(mode == Settings::MODE_RGB_ALT2)
+ BlitLineBitBuffer = BlitLineBitBuffer_RGB_Alt<2>;
+ else
+ BlitLineBitBuffer = BlitLineBitBuffer_RGB;
+
+ if(CustomPalette && CustomPaletteNumEntries == 16)
+ {
+ for(unsigned i = 0; i < 16; i++)
+ {
+ RGBLUT[i] = format.MakeColor(CustomPalette[i * 3 + 0], CustomPalette[i * 3 + 1], CustomPalette[i * 3 + 2]);
+ RGBLUT[16 + i] = format.MakeColor(CustomPalette[i * 3 + 0] * 3 / 4, CustomPalette[i * 3 + 1] * 3 / 4, CustomPalette[i * 3 + 2] * 3 / 4);
+ }
+
+ return;
+ }
+ }
+ //
+ //
+ //
+ const uint32 force_mono = (mode != Settings::MODE_COMPOSITE) ? 0 : s.force_mono;
+ const float (&d)[3][2] = *((s.matrix == Settings::MATRIX_CUSTOM) ? &s.custom_matrix : &matrixes[s.matrix]);
+ float demod_tab[2][4];
+
+ for(unsigned cd_i = 0; cd_i < 2; cd_i++)
+ {
+ static const float angles[2] = { 123.0, 33.0 };
+
+ for(int x = 0; x < 4; x++)
+ {
+ demod_tab[cd_i][x] = sin(((x / 4.0) - s.hue / 8.0 + angles[cd_i] / 360.0) * (M_PI * 2.0));
+ //printf("%d, %d, %f\n", cd_i, x, demod_tab[cd_i][x]);
+ }
+ }
+
+
+ for(unsigned cbp = 0; cbp < 2; cbp++)
+ {
+ static const float coeffs[11][ColorLUT_NumPixels] =
+ {
+ /* -3 */ { 0.00172554, -0.00760881, -0.03068241, -0.01602947, 0.09901781, 0.27344111, 0.36027244, 0.27344111, 0.09901781, -0.01602947, -0.03068241, -0.00760881, 0.00172554, }, /* 1.000000 */
+ /* -2 */ { -0.00085195, -0.00688802, -0.00964609, 0.02346799, 0.11669260, 0.23333631, 0.28777829, 0.23333631, 0.11669260, 0.02346799, -0.00964609, -0.00688802, -0.00085195, }, /* 1.000000 */
+ /* -1 */ { -0.00666994, -0.01931400, -0.01700092, 0.03131011, 0.13104562, 0.23818615, 0.28488591, 0.23818615, 0.13104562, 0.03131011, -0.01700092, -0.01931400, -0.00666994, }, /* 1.000000 */
+ /* 0 */ { 0.00000000, 0.00535462, 0.02579365, 0.06746032, 0.12500000, 0.17718506, 0.19841270, 0.17718506, 0.12500000, 0.06746032, 0.02579365, 0.00535462, 0.00000000, }, /* 1.000000 */
+ /* 1 */ { 0.00000000, 0.00000000, 0.00957449, 0.04780242, 0.12137789, 0.20219758, 0.23809524, 0.20219758, 0.12137789, 0.04780242, 0.00957449, 0.00000000, 0.00000000, }, /* 1.000000 */
+ /* 2 */ { 0.00000000, 0.00000000, 0.00000000, 0.01977578, 0.10119048, 0.23022422, 0.29761904, 0.23022422, 0.10119048, 0.01977578, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
+ /* 3 */ { 0.00000000, 0.00000000, 0.00000000, 0.01464626, 0.08312087, 0.23555925, 0.33334723, 0.23555925, 0.08312087, 0.01464626, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
+ /* 4 */ { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.05158730, 0.25000000, 0.39682540, 0.25000000, 0.05158730, 0.00000000, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
+ /* 5 */ { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.25000000, 0.50000000, 0.25000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
+ /* 6 */ { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.16666667, 0.66666669, 0.16666667, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
+ /* 7 */ { 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, }, /* 1.000000 */
+ };
+ const bool mono_mode = !cbp || force_mono;
+ static const float colordiff_coeffs[ColorLUT_NumPixels] = { 0.00329843, 0.01538324, 0.04024864, 0.07809234, 0.12141892, 0.15652442, 0.17006803, 0.15652442, 0.12141892, 0.07809234, 0.04024864, 0.01538324, 0.00329843 };
+ const float (&luma_coeffs)[ColorLUT_NumPixels] = coeffs[3 + (mono_mode ? s.mono_lumafilter : s.color_lumafilter)];
+
+#if 0
+ for(unsigned ci = 0; ci < 11; ci++)
+ {
+ float sum = 0;
+
+ printf(" /* % d */ { ", (int)ci - 3);
+
+ for(unsigned i = 0; i < ColorLUT_NumPixels; i++)
+ {
+ assert(coeffs[ci][i] == coeffs[ci][ColorLUT_NumPixels - 1 - i]);
+ sum += coeffs[ci][i];
+ printf("% .8f, ", coeffs[ci][i]);
+ }
+
+ printf("}, /* %f */\n", sum);
+ }
+#endif
+
+ for(unsigned phase = 0; phase < 4; phase++)
+ {
+ for(unsigned color = 0; color < (1U << ColorLUT_NumPixels); color++)
+ {
+ float y = 0;
+ float color_diff[2] = { 0, 0 };
+
+ for(unsigned i = 0; i < ColorLUT_NumPixels; i++)
+ y += luma_coeffs[i] * ((color >> i) & 1);
+
+ y = y * ((s.contrast * 0.50) + 1.0) + (s.brightness * 0.50);
+
+ for(unsigned cd_i = 0; cd_i < 2; cd_i++)
+ {
+ for(unsigned i = 0; i < ColorLUT_NumPixels; i++)
+ {
+ float chroma = ((color >> i) & 1);
+
+ color_diff[cd_i] += colordiff_coeffs[i] * demod_tab[cd_i][(i + phase) & 3] * chroma;
+ }
+ color_diff[cd_i] *= 1.0 + s.saturation;
+
+ if(mono_mode)
+ color_diff[cd_i] = 0;
+ }
+
+ unsigned rgb_cc[3];
+
+ for(unsigned cc_i = 0; cc_i < 3; cc_i++)
+ {
+ float eff_y = y * (force_mono ? (((force_mono >> ((2 - cc_i) << 3)) & 0xFF) / 255.0) : 1.0);
+ float t = std::max(0.0, eff_y + d[cc_i][0] * color_diff[0] + d[cc_i][1] * color_diff[1]);
+
+ //t = pow(t, d.power);
+
+ //if(t > 1.10)
+ // printf("phase=%d color=0x%08x cc_i=%u t=%f\n", phase, color, cc_i, t);
+
+ rgb_cc[cc_i] = std::min(1016, std::max(0, floor(0.5 + 1016 * t)));
+ }
+
+ //printf("color 0x%01x: y=%f pb=%.13f pr=%.13f --- %3u %3u %3u\n", color, ySL2 / 4.0, pbSL6 / 64.0, prSL6 / 64.0, r, g, b);
+
+ ColorLUT[cbp][phase][color] = (rgb_cc[0] << 0) + (rgb_cc[1] << 10) + (rgb_cc[2] << 20);
+ }
+ }
+ }
+
+ if(s.color_smooth && !force_mono)
+ {
+ uint32 SmoothLUT[4][16];
+
+ for(unsigned phase = 0; phase < 4; phase++)
+ {
+ for(unsigned color = 0; color < 16; color++)
+ {
+ float r = 0;
+ float g = 0;
+ float b = 0;
+ int r_p, g_p, b_p;
+
+ for(unsigned i = 0; i < 4; i++)
+ {
+ unsigned pattern = (color | (color << 4) | (color << 8) | (color << 12) | (color << 16)) >> (4 + i - phase);
+ uint32 cle = ColorLUT[1][(i) & 3][pattern & 0x1FFF];
+
+ r_p = (cle >> 0) & 0x3FF;
+ g_p = (cle >> 10) & 0x3FF;
+ b_p = (cle >> 20) & 0x3FF;
+
+ r += pow(r_p / 1016.0, 2.2);
+ g += pow(g_p / 1016.0, 2.2);
+ b += pow(b_p / 1016.0, 2.2);
+ }
+
+ r /= 4;
+ g /= 4;
+ b /= 4;
+
+ r_p = std::min(1016, floor(0.5 + 1016 * pow(r, 1.0 / 2.2)));
+ g_p = std::min(1016, floor(0.5 + 1016 * pow(g, 1.0 / 2.2)));
+ b_p = std::min(1016, floor(0.5 + 1016 * pow(b, 1.0 / 2.2)));
+
+ //printf("Phase: %d, Color: %d - 0x%02x 0x%02x 0x%02x\n", phase, color, r_p, g_p, b_p);
+
+ SmoothLUT[phase][color] = (r_p << 0) + (g_p << 10) + (b_p << 20);
+ }
+ }
+
+ for(unsigned phase = 0; phase < 4; phase++)
+ {
+ for(unsigned color = 0; color < (1U << ColorLUT_NumPixels); color++)
+ {
+ const unsigned c0 = (color >> 0) & 0x1F;
+ const unsigned c1 = (color >> 4) & 0x1F;
+ const unsigned c2 = (color >> 8) & 0x1F;
+
+ if(c1 == c0 || c1 == c2 || (((color >> 2) & 0x7) == ((color >> 6) & 0x7) && ((color >> 3) & 0x7) == ((color >> 7) & 0x7)))
+ ColorLUT[1][phase][color] = SmoothLUT[phase][c1 & 0xF];
+ }
+ }
+ }
+
+ if(mode != Settings::MODE_COMPOSITE)
+ {
+ for(unsigned color = 0; color < 16; color++)
+ {
+ float r = 0;
+ float g = 0;
+ float b = 0;
+ int r_p, g_p, b_p;
+
+ for(unsigned i = 0; i < 4; i++)
+ {
+ unsigned pattern = (color | (color << 4) | (color << 8) | (color << 12) | (color << 16)) >> (4 + i);
+ uint32 cle = ColorLUT[1][i & 3][pattern & 0x1FFF];
+
+ r_p = (cle >> 0) & 0x3FF;
+ g_p = (cle >> 10) & 0x3FF;
+ b_p = (cle >> 20) & 0x3FF;
+
+ r += pow(r_p / 1016.0, 2.2);
+ g += pow(g_p / 1016.0, 2.2);
+ b += pow(b_p / 1016.0, 2.2);
+ }
+
+ r /= 4;
+ g /= 4;
+ b /= 4;
+
+ r_p = std::min(255, floor(0.5 + 255 * pow(r, 1.0 / 2.2)));
+ g_p = std::min(255, floor(0.5 + 255 * pow(g, 1.0 / 2.2)));
+ b_p = std::min(255, floor(0.5 + 255 * pow(b, 1.0 / 2.2)));
+
+ //printf("Phase: %d, Color: %d - 0x%02x 0x%02x 0x%02x\n", phase, color, r_p, g_p, b_p);
+
+ RGBLUT[color] = format.MakeColor(r_p, g_p, b_p);
+ RGBLUT[16 + color] = format.MakeColor(r_p * 3 / 4, g_p * 3 / 4, b_p * 3 / 4);
+ }
+ }
+}
+
}
diff --git a/mednafen/cdplay/cdplay.cpp b/mednafen/cdplay/cdplay.cpp
index f4bb013..2d1eda7 100644
--- a/mednafen/cdplay/cdplay.cpp
+++ b/mednafen/cdplay/cdplay.cpp
@@ -555,6 +555,7 @@ MDFNGI EmulatedCDPlay =
PortInfo, //
NULL,
NULL,
+ NULL,
LoadCD,
TestMagicCD,
CloseGame,
diff --git a/mednafen/cdrom/recover-raw.cpp b/mednafen/cdrom/recover-raw.cpp
index e7dee73..8300dea 100644
--- a/mednafen/cdrom/recover-raw.cpp
+++ b/mednafen/cdrom/recover-raw.cpp
@@ -178,7 +178,7 @@ static int simple_lec(unsigned char *frame)
int ValidateRawSector(unsigned char *frame, bool xaMode)
{
- int lec_did_sth = FALSE;
+ //int lec_did_sth = FALSE;
/* Do simple L-EC.
It seems that drives stop their internal L-EC as soon as the
@@ -196,17 +196,17 @@ int ValidateRawSector(unsigned char *frame, bool xaMode)
memset(frame + 12, 0, 4);
}
- lec_did_sth = simple_lec(frame);
+ /*lec_did_sth =*/ simple_lec(frame);
if(xaMode)
memcpy(frame + 12, header, 4);
- }
- /* Test internal sector checksum again */
- if(!CheckEDC(frame, xaMode))
- {
- /* EDC failure in RAW sector */
- return FALSE;
+ /* Test internal sector checksum again */
+ if(!CheckEDC(frame, xaMode))
+ {
+ /* EDC failure in RAW sector */
+ return FALSE;
+ }
}
return TRUE;
diff --git a/mednafen/demo/demo.cpp b/mednafen/demo/demo.cpp
index f924d6a..4cd5549 100644
--- a/mednafen/demo/demo.cpp
+++ b/mednafen/demo/demo.cpp
@@ -755,6 +755,7 @@ MDFNGI EmulatedDEMO =
MODPRIO_INTERNAL_LOW,
NULL,
PortInfo,
+ NULL,
Load,
TestMagic,
NULL,
diff --git a/mednafen/desa68/desa68.c b/mednafen/desa68/desa68.c
index 1cbe22f..6437aa3 100644
--- a/mednafen/desa68/desa68.c
+++ b/mednafen/desa68/desa68.c
@@ -124,7 +124,7 @@ static void desa_char(const unsigned char c)
#endif
/* Add a string to disassembly string */
-static void desa_str(char *str)
+static void desa_str(const char *str)
{
char c;
while(c=*str++, c)
@@ -1017,7 +1017,7 @@ static void desa_line4(void)
return;
case 6: /* FUNKY LINE 4 MODE 6 (4E */
{
- static char *str[8] = /* $4E70 - $4E77 */
+ static const char *str[8] = /* $4E70 - $4E77 */
{
/* 0 1 2 3 4 5 6 7 */
"RESET","NOP","STOP ","RTE", "?","RTS","TRAPV","RTR"
diff --git a/mednafen/drivers/main.cpp b/mednafen/drivers/main.cpp
index ff7d59a..3e73116 100644
--- a/mednafen/drivers/main.cpp
+++ b/mednafen/drivers/main.cpp
@@ -66,7 +66,9 @@ static bool SuppressErrorPopups; // Set from env variable "MEDNAFEN_NOPOPUPS"
static int StateSLSTest = false;
static int StateRCTest = false; // Rewind consistency
-
+#if 0
+static int StatePCTest = false; // Power(toggle) consistency
+#endif
static WMInputBehavior NeededWMInputBehavior = { false, false, false, false };
static bool NeededWMInputBehavior_Dirty = false;
@@ -152,11 +154,11 @@ static const MDFNSetting DriverSettings[] =
gettext_noop("Disable to reduce latency, at the cost of potentially increased video \"juddering\", with the maximum reduction in latency being about 1 video frame's time.\nWill work best with emulated systems that are not very computationally expensive to emulate, combined with running on a relatively fast CPU."),
MDFNST_BOOL, "1" },
- { "ffspeed", MDFNSF_NOFLAGS, gettext_noop("Fast-forwarding speed multiplier."), NULL, MDFNST_FLOAT, "4", "1", "15" },
+ { "ffspeed", MDFNSF_NOFLAGS, gettext_noop("Fast-forwarding speed multiplier."), NULL, MDFNST_FLOAT, "4", "0.25", "15" },
{ "fftoggle", MDFNSF_NOFLAGS, gettext_noop("Treat the fast-forward button as a toggle."), NULL, MDFNST_BOOL, "0" },
{ "ffnosound", MDFNSF_NOFLAGS, gettext_noop("Silence sound output when fast-forwarding."), NULL, MDFNST_BOOL, "0" },
- { "sfspeed", MDFNSF_NOFLAGS, gettext_noop("SLOW-forwarding speed multiplier."), NULL, MDFNST_FLOAT, "0.75", "0.25", "1" },
+ { "sfspeed", MDFNSF_NOFLAGS, gettext_noop("SLOW-forwarding speed multiplier."), NULL, MDFNST_FLOAT, "0.75", "0.25", "15" },
{ "sftoggle", MDFNSF_NOFLAGS, gettext_noop("Treat the SLOW-forward button as a toggle."), NULL, MDFNST_BOOL, "0" },
{ "nothrottle", MDFNSF_NOFLAGS, gettext_noop("Disable speed throttling when sound is disabled."), NULL, MDFNST_BOOL, "0"},
@@ -865,6 +867,11 @@ static bool DoArgs(int argc, char *argv[], char **filename)
// Save state rewind consistency test.
{ "staterctest", NULL, &StateRCTest, 0, 0 },
+#if 0
+ // Save state power consistency test.
+ { "statepctest", NULL, &StatePCTest, 0, 0 },
+#endif
+
// SwiftResampler test.
{ "swiftresamptest", NULL, &swiftresamptest, 0, 0 },
@@ -982,7 +989,45 @@ static int LoadGame(const char *force_module, const char *path)
if(!(tmp=MDFNI_LoadGame(force_module, &::Mednafen::NVFS, path)))
return 0;
}
+ //
+ //
+ //
+#if 0
+ if(StatePCTest)
+ {
+ MemoryStream state0(524288);
+ MemoryStream state1(524288);
+ MDFNI_Power();
+ MDFNSS_SaveSM(&state0);
+ state0.rewind();
+ MDFNSS_LoadSM(&state0, false, true);
+ MDFNI_CloseGame();
+ if(!(tmp=MDFNI_LoadGame(force_module, &::Mednafen::NVFS, path)))
+ abort();
+ MDFNI_Power();
+ MDFNSS_SaveSM(&state1);
+ state0.rewind();
+ MDFNSS_LoadSM(&state0);
+ MDFNI_CloseGame();
+ if(!(tmp=MDFNI_LoadGame(force_module, &::Mednafen::NVFS, path)))
+ abort();
+ if(!(state0.map_size() == state1.map_size() && !memcmp(state0.map() + 32, state1.map() + 32, state1.map_size() - 32)))
+ {
+ FileStream sd0("/tmp/sdump0", FileStream::MODE_WRITE);
+ FileStream sd1("/tmp/sdump1", FileStream::MODE_WRITE);
+
+ sd0.write(state0.map(), state0.map_size());
+ sd1.write(state1.map(), state1.map_size());
+ sd0.close();
+ sd1.close();
+ abort();
+ }
+ }
+#endif
+ //
+ //
+ //
CurGame = tmp;
Input_GameLoaded(tmp);
RMDUI_Init(tmp, which_medium);
diff --git a/mednafen/drivers/sound.cpp b/mednafen/drivers/sound.cpp
index d454a61..6b735bc 100644
--- a/mednafen/drivers/sound.cpp
+++ b/mednafen/drivers/sound.cpp
@@ -74,6 +74,7 @@ void Sound_WriteSilence(int ms)
Output->Write(Output, SBuffer, frames);
}
+#if 0
static std::string sampformat_to_string(const uint32 sampformat)
{
char buf[256];
@@ -95,7 +96,6 @@ static std::string sampformat_to_string(const uint32 sampformat)
return buf;
}
-#if 0
static bool RunSexyALTest(SexyAL_buffering* buffering, const char* device, int driver_type)
{
static const uint32 sampformats[] =
diff --git a/mednafen/gb/gb.cpp b/mednafen/gb/gb.cpp
index ec26903..6a52560 100644
--- a/mednafen/gb/gb.cpp
+++ b/mednafen/gb/gb.cpp
@@ -2864,6 +2864,7 @@ MDFNGI EmulatedGB =
MODPRIO_INTERNAL_HIGH,
NULL,
PortInfo,
+ NULL,
Load,
TestMagic,
NULL,
diff --git a/mednafen/gba/GBA.cpp b/mednafen/gba/GBA.cpp
index 95b0155..68d1afe 100644
--- a/mednafen/gba/GBA.cpp
+++ b/mednafen/gba/GBA.cpp
@@ -3339,6 +3339,7 @@ MDFNGI EmulatedGBA =
MODPRIO_INTERNAL_HIGH,
NULL,
PortInfo,
+ NULL,
Load,
TestMagic,
NULL,
diff --git a/mednafen/git.h b/mednafen/git.h
index f03b725..ff742ac 100644
--- a/mednafen/git.h
+++ b/mednafen/git.h
@@ -528,6 +528,24 @@ struct DesiredInputType
std::map switches;
};
+struct GameDB_Entry
+{
+ std::string GameID;
+ bool GameIDIsHash = false;
+ std::string Name;
+ std::string Setting;
+ std::string Purpose;
+};
+
+struct GameDB_Database
+{
+ std::string ShortName;
+ std::string FullName;
+ std::string Description;
+
+ std::vector Entries;
+};
+
typedef struct
{
/* Private functions to Mednafen. Do not call directly
@@ -554,6 +572,8 @@ typedef struct
#endif
const std::vector &PortInfo;
+ void (*GetInternalDB)(std::vector* databases);
+
//
// throws exception on fatal error.
//
diff --git a/mednafen/hw_cpu/m68k/m68k.cpp b/mednafen/hw_cpu/m68k/m68k.cpp
index 16159ce..a36b135 100644
--- a/mednafen/hw_cpu/m68k/m68k.cpp
+++ b/mednafen/hw_cpu/m68k/m68k.cpp
@@ -107,6 +107,9 @@ void M68K::StateAction(StateMem* sm, const unsigned load, const bool data_only,
};
MDFNSS_StateAction(sm, load, data_only, StateRegs, sname);
+
+ if(load)
+ XPending &= XPENDING_MASK__VALID;
}
void M68K::LoadOldState(const uint8* osm)
@@ -2274,6 +2277,8 @@ void M68K::Reset(bool powering_up)
{
if(powering_up)
{
+ PC = 0;
+
for(unsigned i = 0; i < 8; i++)
D[i] = 0;
@@ -2284,7 +2289,7 @@ void M68K::Reset(bool powering_up)
SetSR(0);
}
- XPending = (XPending & ~XPENDING_MASK_STOPPED) | XPENDING_MASK_RESET;
+ XPending = (XPending & ~(XPENDING_MASK_STOPPED | XPENDING_MASK_NMI)) | XPENDING_MASK_RESET;
}
diff --git a/mednafen/hw_cpu/m68k/m68k.h b/mednafen/hw_cpu/m68k/m68k.h
index 8d64630..9cfbfc5 100644
--- a/mednafen/hw_cpu/m68k/m68k.h
+++ b/mednafen/hw_cpu/m68k/m68k.h
@@ -80,7 +80,10 @@ class M68K
XPENDING_MASK_NMI = 0x0002,
XPENDING_MASK_RESET = 0x0010,
XPENDING_MASK_STOPPED = 0x0100, // via STOP instruction
- XPENDING_MASK_EXTHALTED= 0x1000
+ XPENDING_MASK_EXTHALTED= 0x1000,
+
+ // For save state sanitizing:
+ XPENDING_MASK__VALID = XPENDING_MASK_INT | XPENDING_MASK_NMI | XPENDING_MASK_RESET | XPENDING_MASK_STOPPED | XPENDING_MASK_EXTHALTED
};
const bool Revision_E;
diff --git a/mednafen/lynx/system.cpp b/mednafen/lynx/system.cpp
index 844d923..95d17c1 100644
--- a/mednafen/lynx/system.cpp
+++ b/mednafen/lynx/system.cpp
@@ -447,6 +447,7 @@ MDFNGI EmulatedLynx =
MODPRIO_INTERNAL_HIGH,
NULL,
PortInfo,
+ NULL,
Load,
TestMagic,
NULL,
diff --git a/mednafen/md/system.cpp b/mednafen/md/system.cpp
index 7aa3759..77675c6 100644
--- a/mednafen/md/system.cpp
+++ b/mednafen/md/system.cpp
@@ -795,6 +795,7 @@ MDFNGI EmulatedMD =
NULL,
#endif
MDPortInfo,
+ NULL,
Load,
MDCart_TestMagic,
LoadCD,
diff --git a/mednafen/mednafen.cpp b/mednafen/mednafen.cpp
index d3b18a3..d24c51e 100644
--- a/mednafen/mednafen.cpp
+++ b/mednafen/mednafen.cpp
@@ -530,6 +530,30 @@ void MDFNI_DumpModulesDef(const char *fn)
fp.print_format("\n");
}
}
+
+ std::vector gamedb;
+
+ if(MDFNSystems[i]->GetInternalDB)
+ MDFNSystems[i]->GetInternalDB(&gamedb);
+
+ fp.print_format("%zu\n", gamedb.size());
+
+ for(const GameDB_Database& db : gamedb)
+ {
+ fp.print_format("%s\n", MDFN_strescape(db.ShortName).c_str());
+ fp.print_format("%s\n", MDFN_strescape(db.FullName).c_str());
+ fp.print_format("%s\n", MDFN_strescape(db.Description).c_str());
+
+ fp.print_format("%zu\n", db.Entries.size());
+ for(const GameDB_Entry& gdbe : db.Entries)
+ {
+ fp.print_format("%s\n", MDFN_strescape(gdbe.Name).c_str());
+ fp.print_format("%s\n", MDFN_strescape(gdbe.GameID).c_str());
+ fp.print_format("%u\n", gdbe.GameIDIsHash);
+ fp.print_format("%s\n", MDFN_strescape(gdbe.Setting).c_str());
+ fp.print_format("%s\n", MDFN_strescape(gdbe.Purpose).c_str());
+ }
+ }
}
fp.close();
diff --git a/mednafen/nes/nes.cpp b/mednafen/nes/nes.cpp
index e5255aa..efd7cc4 100644
--- a/mednafen/nes/nes.cpp
+++ b/mednafen/nes/nes.cpp
@@ -775,6 +775,7 @@ MDFNGI EmulatedNES =
NULL,
#endif
NESPortInfo,
+ NULL,
Load,
TestMagic,
NULL,
diff --git a/mednafen/ngp/Makefile.am.inc b/mednafen/ngp/Makefile.am.inc
index ae26154..3ba7a2b 100644
--- a/mednafen/ngp/Makefile.am.inc
+++ b/mednafen/ngp/Makefile.am.inc
@@ -4,11 +4,12 @@ libngp_a_CXXFLAGS = @AM_CXXFLAGS@ @NO_STRICT_ALIASING_FLAGS@
libngp_a_SOURCES = ngp/bios.cpp ngp/biosHLE.cpp ngp/dma.cpp ngp/flash.cpp ngp/gfx.cpp ngp/T6W28_Apu.cpp \
ngp/gfx_scanline_mono.cpp ngp/gfx_scanline_colour.cpp ngp/interrupt.cpp ngp/mem.cpp ngp/neopop.cpp \
ngp/rom.cpp ngp/rtc.cpp ngp/sound.cpp ngp/Z80_interface.cpp \
- ngp/TLCS-900h/TLCS900h_disassemble_extra.cpp ngp/TLCS-900h/TLCS900h_disassemble_reg.cpp \
- ngp/TLCS-900h/TLCS900h_interpret_single.cpp ngp/TLCS-900h/TLCS900h_disassemble_src.cpp \
- ngp/TLCS-900h/TLCS900h_interpret.cpp ngp/TLCS-900h/TLCS900h_registers.cpp ngp/TLCS-900h/TLCS900h_interpret_reg.cpp \
- ngp/TLCS-900h/TLCS900h_disassemble.cpp ngp/TLCS-900h/TLCS900h_interpret_src.cpp \
- ngp/TLCS-900h/TLCS900h_interpret_dst.cpp ngp/TLCS-900h/TLCS900h_disassemble_dst.cpp
+ ngp/TLCS-900h/TLCS900h_interpret_single.cpp \
+ ngp/TLCS-900h/TLCS900h_interpret.cpp \
+ ngp/TLCS-900h/TLCS900h_registers.cpp \
+ ngp/TLCS-900h/TLCS900h_interpret_reg.cpp \
+ ngp/TLCS-900h/TLCS900h_interpret_src.cpp \
+ ngp/TLCS-900h/TLCS900h_interpret_dst.cpp
mednafen_LDADD += libngp.a
mednafen_DEPENDENCIES += libngp.a
diff --git a/mednafen/ngp/TLCS-900h/TLCS900h_interpret_reg.cpp b/mednafen/ngp/TLCS-900h/TLCS900h_interpret_reg.cpp
index fc91219..9f4ede4 100644
--- a/mednafen/ngp/TLCS-900h/TLCS900h_interpret_reg.cpp
+++ b/mednafen/ngp/TLCS-900h/TLCS900h_interpret_reg.cpp
@@ -732,12 +732,61 @@ void regTSET()
cycles = 6;
}
+#if 0
+// TODO, test on an actual TLCS-900H CPU:
+
+//===== MINC1 #,r
+void regMINC1()
+{
+ const uint16 mask = fetch16() | 0;
+ const uint16 origval = rCodeW(rCode);
+
+ if(size == 1)
+ rCodeW(rCode) = (origval & ~mask) + ((origval + 1) & mask);
+
+ printf("MINC1: 0x%04x, 0x%04x->0x%04x%s\n", mask, origval, rCodeW(rCode), (rCodeW(rCode) < origval) ? " (wrap)" : "");
+
+ cycles = 8;
+}
+
+//===== MINC2 #,r
+// Densetsu no Ogre Battle Gaiden
+void regMINC2()
+{
+ const uint16 mask = fetch16() | 1;
+ const uint16 origval = rCodeW(rCode);
+
+ if(size == 1)
+ rCodeW(rCode) = (origval & ~mask) + ((origval + 2) & mask);
+
+ printf("MINC2: 0x%04x, 0x%04x->0x%04x%s\n", mask, origval, rCodeW(rCode), (rCodeW(rCode) < origval) ? " (wrap)" : "");
+
+ cycles = 8;
+}
+
+//===== MINC4 #,r
+// Pocket Tennis Color
+void regMINC4()
+{
+ const uint16 mask = fetch16() | 3;
+ const uint16 origval = rCodeW(rCode);
+
+ if(size == 1)
+ rCodeW(rCode) = (origval & ~mask) + ((origval + 4) & mask);
+
+ printf("MINC4: 0x%04x, 0x%04x->0x%04x%s\n", mask, origval, rCodeW(rCode), (rCodeW(rCode) < origval) ? " (wrap)" : "");
+
+ cycles = 8;
+}
+
+#endif
+
//===== MINC1 #,r
void regMINC1()
{
uint16 num = fetch16() + 1;
- if (size == 1)
+ if (size == 1 && num)
{
if ((rCodeW(rCode) % num) == (num - 1))
rCodeW(rCode) -= (num - 1);
@@ -753,7 +802,7 @@ void regMINC2()
{
uint16 num = fetch16() + 2;
- if (size == 1)
+ if (size == 1 && num)
{
if ((rCodeW(rCode) % num) == (num - 2))
rCodeW(rCode) -= (num - 2);
@@ -769,7 +818,7 @@ void regMINC4()
{
uint16 num = fetch16() + 4;
- if (size == 1)
+ if (size == 1 && num)
{
if ((rCodeW(rCode) % num) == (num - 4))
rCodeW(rCode) -= (num - 4);
@@ -785,7 +834,7 @@ void regMDEC1()
{
uint16 num = fetch16() + 1;
- if (size == 1)
+ if (size == 1 && num)
{
if ((rCodeW(rCode) % num) == 0)
rCodeW(rCode) += (num - 1);
@@ -801,7 +850,7 @@ void regMDEC2()
{
uint16 num = fetch16() + 2;
- if (size == 1)
+ if (size == 1 && num)
{
if ((rCodeW(rCode) % num) == 0)
rCodeW(rCode) += (num - 2);
@@ -817,7 +866,7 @@ void regMDEC4()
{
uint16 num = fetch16() + 4;
- if (size == 1)
+ if (size == 1 && num)
{
if ((rCodeW(rCode) % num) == 0)
rCodeW(rCode) += (num - 4);
diff --git a/mednafen/ngp/TLCS-900h/TLCS900h_interpret_single.cpp b/mednafen/ngp/TLCS-900h/TLCS900h_interpret_single.cpp
index 1561b06..a5660b9 100644
--- a/mednafen/ngp/TLCS-900h/TLCS900h_interpret_single.cpp
+++ b/mednafen/ngp/TLCS-900h/TLCS900h_interpret_single.cpp
@@ -408,16 +408,16 @@ void sngSWI()
pc = loadL(0xFFFE00 + ((rCodeB(0x31) & 0x1F) << 2));
break;
- case 3: interrupt(0); //SWI 3
+ case 3: interrupt(0, -1); //SWI 3
break;
- case 4: interrupt(1); //SWI 4
+ case 4: interrupt(1, -1); //SWI 4
break;
- case 5: interrupt(2); //SWI 5
+ case 5: interrupt(2, -1); //SWI 5
break;
- case 6: interrupt(3); //SWI 6
+ case 6: interrupt(3, -1); //SWI 6
break;
default: instruction_error("SWI %d is not valid.", first & 7);
diff --git a/mednafen/ngp/TLCS-900h/TLCS900h_interpret_src.cpp b/mednafen/ngp/TLCS-900h/TLCS900h_interpret_src.cpp
index a51ba6f..e0bbc74 100644
--- a/mednafen/ngp/TLCS-900h/TLCS900h_interpret_src.cpp
+++ b/mednafen/ngp/TLCS-900h/TLCS900h_interpret_src.cpp
@@ -263,15 +263,15 @@ void srcLDDR()
//===== CPI
void srcCPI()
{
- uint8 R = first & 7;
+ uint8 R_local = first & 7;
switch(size)
{
- case 0: generic_SUB_B(REGA, loadB(regL(R)));
- regL(R) ++; break;
+ case 0: generic_SUB_B(REGA, loadB(regL(R_local)));
+ regL(R_local) ++; break;
- case 1: generic_SUB_W(REGWA, loadW(regL(R)));
- regL(R) += 2; break;
+ case 1: generic_SUB_W(REGWA, loadW(regL(R_local)));
+ regL(R_local) += 2; break;
}
REGBC --;
@@ -283,7 +283,7 @@ void srcCPI()
//===== CPIR
void srcCPIR()
{
- uint8 R = first & 7;
+ uint8 R_local = first & 7;
cycles = 10;
@@ -292,12 +292,12 @@ void srcCPIR()
switch(size)
{
case 0: if (debug_abort_memory == false)
- generic_SUB_B(REGA, loadB(regL(R)));
- regL(R) ++; break;
+ generic_SUB_B(REGA, loadB(regL(R_local)));
+ regL(R_local) ++; break;
case 1: if (debug_abort_memory == false)
- generic_SUB_W(REGWA, loadW(regL(R)));
- regL(R) += 2; break;
+ generic_SUB_W(REGWA, loadW(regL(R_local)));
+ regL(R_local) += 2; break;
}
REGBC --;
@@ -311,15 +311,15 @@ void srcCPIR()
//===== CPD
void srcCPD()
{
- uint8 R = first & 7;
+ uint8 R_local = first & 7;
switch(size)
{
- case 0: generic_SUB_B(REGA, loadB(regL(R)));
- regL(R) --; break;
+ case 0: generic_SUB_B(REGA, loadB(regL(R_local)));
+ regL(R_local) --; break;
- case 1: generic_SUB_W(REGWA, loadW(regL(R)));
- regL(R) -= 2; break;
+ case 1: generic_SUB_W(REGWA, loadW(regL(R_local)));
+ regL(R_local) -= 2; break;
}
REGBC --;
@@ -331,7 +331,7 @@ void srcCPD()
//===== CPDR
void srcCPDR()
{
- uint8 R = first & 7;
+ uint8 R_local = first & 7;
cycles = 10;
@@ -340,12 +340,12 @@ void srcCPDR()
switch(size)
{
case 0: if (debug_abort_memory == false)
- generic_SUB_B(REGA, loadB(regL(R)));
- regL(R) -= 1; break;
+ generic_SUB_B(REGA, loadB(regL(R_local)));
+ regL(R_local) -= 1; break;
case 1: if (debug_abort_memory == false)
- generic_SUB_W(REGWA, loadW(regL(R)));
- regL(R) -= 2; break;
+ generic_SUB_W(REGWA, loadW(regL(R_local)));
+ regL(R_local) -= 2; break;
}
REGBC --;
diff --git a/mednafen/ngp/biosHLE.cpp b/mednafen/ngp/biosHLE.cpp
index 6ae6c21..e549475 100644
--- a/mednafen/ngp/biosHLE.cpp
+++ b/mednafen/ngp/biosHLE.cpp
@@ -321,8 +321,36 @@ void iBIOSHLE(void)
if (filter_bios)
system_debug_message("VECT_FLASHERS: bank %d, block %d (?)", rCodeB(0x30), rCodeB(0x35));
#endif
- //TODO
- rCodeB(0x30) = 0; //RA3 = SYS_SUCCESS
+ //
+ //
+ //
+ {
+ const uint8 bank = rCodeB(0x30);
+ const uint8 flash_block = rCodeB(0x35);
+
+ //printf("flash erase: %d 0x%02x\n", bank, flash_block);
+
+ if((ngpc_rom.length & ~0x1FFF) == 0x200000 && bank == 0 && flash_block == 31)
+ {
+ const uint32 addr = 0x3F0000;
+ const uint32 size = 0x008000;
+
+ flash_optimise_blocks();
+ flash_write(addr, size);
+ flash_optimise_blocks();
+
+ memory_flash_error = false;
+ memory_unlock_flash_write = true;
+ for(uint32 i = 0; i < size; i += 4)
+ {
+ storeL(addr + i, 0xFFFFFFFF);
+ }
+ memory_unlock_flash_write = false;
+ }
+
+ rCodeB(0x30) = 0; //RA3 = SYS_SUCCESS
+ //rCodeB(0x30) = 0xFF; //RA3 = SYS_FAILURE
+ }
break;
//VECT_ALARMSET
diff --git a/mednafen/ngp/dma.cpp b/mednafen/ngp/dma.cpp
index 277c280..9945c28 100644
--- a/mednafen/ngp/dma.cpp
+++ b/mednafen/ngp/dma.cpp
@@ -188,7 +188,8 @@ void DMA_update(int channel)
dmaC[channel] --;
if (dmaC[channel] == 0)
{
- interrupt(14 + channel);
+ //printf("dma end: %d\n", channel);
+ interrupt(14 + channel, 7);
storeB(0x7C + channel, 0);
}
}
diff --git a/mednafen/ngp/flash.cpp b/mednafen/ngp/flash.cpp
index ceac6c1..3e892fc 100644
--- a/mednafen/ngp/flash.cpp
+++ b/mednafen/ngp/flash.cpp
@@ -69,7 +69,7 @@ static uint16 block_count;
//-----------------------------------------------------------------------------
// optimise_blocks()
//-----------------------------------------------------------------------------
-static void optimise_blocks(void)
+void flash_optimise_blocks(void)
{
int i, j;
@@ -105,9 +105,8 @@ static void optimise_blocks(void)
(blocks[i].start_address + blocks[i].data_length))
{
//Extend the first block
- blocks[i].data_length =
- (uint16)((blocks[i+1].start_address + blocks[i+1].data_length) -
- blocks[i].start_address);
+ blocks[i].data_length = (uint16)(std::max(blocks[i + 0].start_address + blocks[i + 0].data_length,
+ blocks[i + 1].start_address + blocks[i + 1].data_length) - blocks[i].start_address);
//Remove the next one.
for (j = i+2; j < block_count; j++)
@@ -122,6 +121,9 @@ static void optimise_blocks(void)
i++; // Try the next block
}
}
+
+ //for(i = 0; i < block_count; i++)
+ // printf("block: 0x%08x 0x%04x\n", blocks[i].start_address, blocks[i].data_length);
}
static void do_flash_read(const uint8 *flashdata)
@@ -162,7 +164,7 @@ static void do_flash_read(const uint8 *flashdata)
}
memory_unlock_flash_write = PREV_memory_unlock_flash_write;
- optimise_blocks(); //Optimise
+ flash_optimise_blocks(); //Optimise
#if 0
//Output block list...
@@ -211,6 +213,8 @@ void flash_write(uint32 start_address, uint16 length)
{
uint16 i;
+ //printf("flash_write 0x%08x 0x%04x\n", start_address, length);
+
//Now we need a new flash command before the next flash write will work!
memory_flash_command = false;
@@ -260,7 +264,7 @@ static void make_flash_commit(PODFastVector &flashdata)
return;
//Optimise before writing
- optimise_blocks();
+ flash_optimise_blocks();
//Build a header;
header.valid_flash_id = FLASH_VALID_ID;
diff --git a/mednafen/ngp/flash.h b/mednafen/ngp/flash.h
index 662be2a..692f3dd 100644
--- a/mednafen/ngp/flash.h
+++ b/mednafen/ngp/flash.h
@@ -21,6 +21,7 @@ namespace MDFN_IEN_NGP
//Marks flash blocks for saving.
void flash_write(uint32 start_address, uint16 length);
+void flash_optimise_blocks(void);
void FLASH_LoadNV(void);
void FLASH_SaveNV(void);
diff --git a/mednafen/ngp/interrupt.cpp b/mednafen/ngp/interrupt.cpp
index 0f69136..7fefba1 100644
--- a/mednafen/ngp/interrupt.cpp
+++ b/mednafen/ngp/interrupt.cpp
@@ -48,15 +48,15 @@ static bool h_int, timer0, timer2;
// a device sets the virual interrupt latch register, signaling it wants an interrupt.
// FIXME in the future if we ever add real bios support?
-void interrupt(uint8 index)
+void interrupt(const uint8 index, const int level)
{
//printf("INT: %d\n", index);
push32(pc);
push16(sr);
- //Up the IFF
- if (((sr & 0x7000) >> 12) < 7)
- setStatusIFF(((sr & 0x7000) >> 12) + 1);
+ //Up the IFF
+ if(level >= 0)
+ setStatusIFF((level < 7) ? (level + 1) : 7);
//Access the interrupt vector table to find the jump destination
pc = loadL(0x6FB8 + index * 4);
@@ -82,7 +82,7 @@ void int_check_pending(void)
if(ipending[5] && curIFF <= prio && prio && prio != 7)
{
ipending[5] = 0;
- interrupt(5);
+ interrupt(5, prio);
return;
}
@@ -90,7 +90,7 @@ void int_check_pending(void)
if(ipending[6] && curIFF <= prio && prio && prio != 7)
{
ipending[6] = 0;
- interrupt(6);
+ interrupt(6, prio);
return;
}
@@ -98,7 +98,7 @@ void int_check_pending(void)
if(ipending[7] && curIFF <= prio && prio && prio != 7)
{
ipending[7] = 0;
- interrupt(7);
+ interrupt(7, prio);
return;
}
@@ -106,7 +106,7 @@ void int_check_pending(void)
if(ipending[8] && curIFF <= prio && prio && prio != 7)
{
ipending[8] = 0;
- interrupt(8);
+ interrupt(8, prio);
return;
}
@@ -114,7 +114,7 @@ void int_check_pending(void)
if(ipending[9] && curIFF <= prio && prio && prio != 7)
{
ipending[9] = 0;
- interrupt(9);
+ interrupt(9, prio);
return;
}
@@ -122,7 +122,7 @@ void int_check_pending(void)
if(ipending[10] && curIFF <= prio && prio && prio != 7)
{
ipending[10] = 0;
- interrupt(10);
+ interrupt(10, prio);
return;
}
@@ -130,7 +130,7 @@ void int_check_pending(void)
if(ipending[11] && curIFF <= prio && prio && prio != 7)
{
ipending[11] = 0;
- interrupt(11);
+ interrupt(11, prio);
return;
}
@@ -138,7 +138,7 @@ void int_check_pending(void)
if(ipending[12] && curIFF <= prio && prio && prio != 7)
{
ipending[12] = 0;
- interrupt(12);
+ interrupt(12, prio);
return;
}
diff --git a/mednafen/ngp/interrupt.h b/mednafen/ngp/interrupt.h
index a0b622f..d5e7d5f 100644
--- a/mednafen/ngp/interrupt.h
+++ b/mednafen/ngp/interrupt.h
@@ -19,7 +19,7 @@
namespace MDFN_IEN_NGP
{
-void interrupt(uint8 index);
+void interrupt(const uint8 index, const int level);
#define TIMER_HINT_RATE 515 //CPU Ticks between horizontal interrupts
diff --git a/mednafen/ngp/neopop.cpp b/mednafen/ngp/neopop.cpp
index 0dfd5bc..968ee67 100644
--- a/mednafen/ngp/neopop.cpp
+++ b/mednafen/ngp/neopop.cpp
@@ -391,6 +391,7 @@ MDFNGI EmulatedNGP =
MODPRIO_INTERNAL_HIGH,
NULL,
PortInfo,
+ NULL,
Load,
TestMagic,
NULL,
diff --git a/mednafen/ngp/neopop.h b/mednafen/ngp/neopop.h
index 9d7ff9b..518fe12 100644
--- a/mednafen/ngp/neopop.h
+++ b/mednafen/ngp/neopop.h
@@ -19,7 +19,7 @@
#include
#include
-#include "TLCS-900h/TLCS900h_disassemble.h"
+//#include "TLCS-900h/TLCS900h_disassemble.h"
#include "TLCS-900h/TLCS900h_interpret_dst.h"
#include "TLCS-900h/TLCS900h_interpret.h"
#include "TLCS-900h/TLCS900h_interpret_reg.h"
diff --git a/mednafen/pce/pce.cpp b/mednafen/pce/pce.cpp
index 0a19c13..e599bf8 100644
--- a/mednafen/pce/pce.cpp
+++ b/mednafen/pce/pce.cpp
@@ -1222,6 +1222,7 @@ MDFNGI EmulatedPCE =
NULL,
#endif
PCEPortInfo,
+ NULL,
Load,
TestMagic,
LoadCD,
diff --git a/mednafen/pce/pcecd.cpp b/mednafen/pce/pcecd.cpp
index 4ac0113..5d21fbb 100644
--- a/mednafen/pce/pcecd.cpp
+++ b/mednafen/pce/pcecd.cpp
@@ -525,14 +525,12 @@ MDFN_FASTCALL uint8 PCECD_Read(uint32 timestamp, uint32 A, int32 &next_event, co
if((A & 0x18c0) == 0x18c0)
{
- switch (A & 0x18cf)
+ ret = 0xFF;
+ if(!(A & 0xC))
{
- case 0x18c1: ret = 0xaa; break;
- case 0x18c2: ret = 0x55; break;
- case 0x18c3: ret = 0x00; break;
- case 0x18c5: ret = 0xaa; break;
- case 0x18c6: ret = 0x55; break;
- case 0x18c7: ret = 0x03; break;
+ static const uint8 sig[4] = { 0x00, 0xAA, 0x55, 0x03 };
+
+ ret = sig[A & 0x3];
}
}
else
diff --git a/mednafen/pce_fast/pce.cpp b/mednafen/pce_fast/pce.cpp
index 96da4ec..cac383f 100644
--- a/mednafen/pce_fast/pce.cpp
+++ b/mednafen/pce_fast/pce.cpp
@@ -744,6 +744,7 @@ MDFNGI EmulatedPCE_Fast =
MODPRIO_INTERNAL_LOW,
NULL,
PCEPortInfo,
+ NULL,
Load,
TestMagic,
LoadCD,
diff --git a/mednafen/pcfx/pcfx.cpp b/mednafen/pcfx/pcfx.cpp
index 77a0fdb..d3758fc 100644
--- a/mednafen/pcfx/pcfx.cpp
+++ b/mednafen/pcfx/pcfx.cpp
@@ -1103,6 +1103,7 @@ MDFNGI EmulatedPCFX =
PCFXPortInfo,
NULL,
NULL,
+ NULL,
LoadCD,
TestMagicCD,
CloseGame,
diff --git a/mednafen/psx/cdc.cpp b/mednafen/psx/cdc.cpp
index b14124c..4ca750d 100644
--- a/mednafen/psx/cdc.cpp
+++ b/mednafen/psx/cdc.cpp
@@ -220,6 +220,8 @@ void PS_CDC::Power(void)
SoftReset();
+ HoldLogicalPos = false;
+
DiscStartupDelay = 0;
SPUCounter = SPU->UpdateFromCDC(0);
diff --git a/mednafen/psx/psx.cpp b/mednafen/psx/psx.cpp
index cedcf66..a455338 100644
--- a/mednafen/psx/psx.cpp
+++ b/mednafen/psx/psx.cpp
@@ -2297,6 +2297,7 @@ MDFNGI EmulatedPSX =
NULL,
#endif
FIO_PortInfo,
+ NULL,
Load,
TestMagic,
LoadCD,
diff --git a/mednafen/sms/system.cpp b/mednafen/sms/system.cpp
index 6299ea4..6a35c0c 100644
--- a/mednafen/sms/system.cpp
+++ b/mednafen/sms/system.cpp
@@ -435,6 +435,7 @@ MDFNGI EmulatedSMS =
MODPRIO_INTERNAL_HIGH,
NULL,
SMSPortInfo,
+ NULL,
LoadSMS,
TestMagicSMS,
NULL,
@@ -486,6 +487,7 @@ MDFNGI EmulatedGG =
MODPRIO_INTERNAL_HIGH,
NULL,
GGPortInfo,
+ NULL,
LoadGG,
TestMagicGG,
NULL,
diff --git a/mednafen/snes/interface.cpp b/mednafen/snes/interface.cpp
index 342efb5..b3f2428 100644
--- a/mednafen/snes/interface.cpp
+++ b/mednafen/snes/interface.cpp
@@ -1364,6 +1364,7 @@ MDFNGI EmulatedSNES =
MODPRIO_INTERNAL_HIGH,
NULL, // Debugger
PortInfo,
+ NULL,
Load,
TestMagic,
NULL,
diff --git a/mednafen/snes_faust/Core65816.h b/mednafen/snes_faust/Core65816.h
new file mode 100644
index 0000000..1dd6e15
--- /dev/null
+++ b/mednafen/snes_faust/Core65816.h
@@ -0,0 +1,283 @@
+/******************************************************************************/
+/* Mednafen - Multi-system Emulator */
+/******************************************************************************/
+/* Core65816.h - 65816 CPU Emulator Core
+** Copyright (C) 2015-2019 Mednafen Team
+**
+** This program is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public License
+** as published by the Free Software Foundation; either version 2
+** of the License, or (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software Foundation, Inc.,
+** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+class Core65816
+{
+ public:
+ Core65816() MDFN_COLD;
+ ~Core65816() MDFN_COLD;
+
+ void Power(void) MDFN_COLD;
+ void Reset(void) MDFN_COLD;
+
+ void StateAction(StateMem* sm, const unsigned load, const bool data_only, const char* sname);
+
+ //private:
+
+ enum
+ {
+ N_FLAG = 0x80,
+ V_FLAG = 0x40,
+
+ M_FLAG = 0x20, // Memory/Accumulator(0=16-bit)
+ X_FLAG = 0x10, // Index(0=16-bit)
+
+ D_FLAG = 0x08,
+ I_FLAG = 0x04,
+ Z_FLAG = 0x02,
+ C_FLAG = 0x01,
+ };
+
+ union
+ {
+ struct
+ {
+#ifdef MSB_FIRST
+ uint8 PCPBRDummy;
+ uint8 PBR;
+ uint16 PC;
+#else
+ uint16 PC;
+ uint8 PBR;
+ uint8 PCPBRDummy;
+#endif
+ };
+ uint32 PCPBR;
+ };
+ uint32 DBRSL16;
+
+ uint16 S;
+ uint16 D;
+
+ union
+ {
+ uint16 C;
+ struct
+ {
+#ifdef MSB_FIRST
+ uint8 B;
+ uint8 A;
+#else
+ uint8 A;
+ uint8 B;
+#endif
+ };
+ };
+
+ template
+ INLINE T& AC(void) // Clever and/or horrible.
+ {
+/*
+ if(sizeof(T) == 2)
+ return (T&)C;
+ else
+ return (T&)A;
+*/
+ return *(T*)((sizeof(T) == 2) ? (void*)&C : (void*)&A);
+ }
+
+ uint16 X, Y;
+ uint8 P;
+ bool E;
+
+ void SampleIRQ(void);
+/*
+ INLINE void SampleIRQ(void)
+ {
+ PIN_Delay = ((P ^ I_FLAG) | 0x01) & CPUM.CombinedNIState;
+ }
+*/
+
+ template
+ void RunInstruction(void);
+
+ template
+ void MemWrite(uint32 addr, T val);
+
+ template
+ T MemRead(uint32 addr);
+
+ void IO(void);
+
+ void BranchOccurred(unsigned iseq = ~0U);
+
+ enum
+ {
+ GSREG_PCPBR,
+ GSREG_DBR,
+ GSREG_S,
+ GSREG_D,
+ GSREG_A,
+ GSREG_X,
+ GSREG_Y,
+ GSREG_P,
+ GSREG_E,
+ GSREG__BOUND
+ };
+
+ void SetRegister(const unsigned id, const uint32 value) MDFN_COLD;
+ uint32 GetRegister(const unsigned id, char* const special, const uint32 special_len) MDFN_COLD;
+
+ //private:
+
+ uint8 OpRead(uint32 addr);
+
+ template void SetZN(const T arg);
+ template void Push(T arg);
+ template T Pull(void);
+
+ enum
+ {
+ ISEQ_COP,
+ ISEQ_BRK,
+ ISEQ_ABORT,
+ ISEQ_NMI,
+ ISEQ_IRQ
+ };
+
+ void ISequence(unsigned which);
+
+ template void Op_ADC(T arg);
+ template void Op_AND(T arg);
+ template void Op_BIT(T arg);
+ template void Op_Compare(T rv, T arg);
+ template void Op_CMP(T arg);
+ template void Op_CPX(T arg);
+ template void Op_CPY(T arg);
+ template void Op_EOR(T arg);
+ template void Op_LDA(T arg);
+ template void Op_LDX(T arg);
+ template void Op_LDY(T arg);
+ template void Op_ORA(T arg);
+ template void Op_SBC(T arg);
+
+ template void Op_ASL(T& arg);
+ template void Op_DEC(T& arg);
+ template void Op_INC(T& arg);
+ template void Op_LSR(T& arg);
+ template void Op_ROL(T& arg);
+ template void Op_ROR(T& arg);
+ template void Op_TRB(T& arg);
+ template void Op_TSB(T& arg);
+
+ template INLINE T Op_STA(void) { return C; }
+ template INLINE T Op_STX(void) { return X; }
+ template INLINE T Op_STY(void) { return Y; }
+ template INLINE T Op_STZ(void) { return 0; }
+
+ uint32 GetEA_AB(void);
+ template uint32 GetEA_ABI(uint16 index);
+ template uint32 GetEA_ABX(void);
+ template uint32 GetEA_ABY(void);
+ uint32 GetEA_ABL(void);
+ uint32 GetEA_ABLX(void);
+
+ uint16 GetEA_DP(void);
+ uint16 GetEA_DPI(uint16 index);
+ uint16 GetEA_DPX(void);
+ uint16 GetEA_DPY(void);
+ uint32 GetEA_IND(void);
+ uint32 GetEA_INDL(void);
+ uint32 GetEA_IX(void);
+ template uint32 GetEA_IY(void);
+ uint32 GetEA_ILY(void);
+
+ uint16 GetEA_SR(void);
+ uint32 GetEA_SRIY(void);
+
+ template void Instr_LD_IM(void (Core65816::*op)(T));
+ template void Instr_LD(EAT (Core65816::*eafn)(void), void (Core65816::*op)(T));
+
+ template void Instr_RMW_A (void (Core65816::*op)(T&));
+ template void Instr_RMW(EAT (Core65816::*eafn)(void), void (Core65816::*op)(T&));
+
+ template void Instr_ST(EAT (Core65816::*eafn)(void), T (Core65816::*op)(void));
+
+ void Instr_BRK(void);
+ void Instr_COP(void);
+ void Instr_NOP(void);
+ void Instr_STP(void);
+ void Instr_WAI(void);
+ void Instr_WDM(void);
+
+ void Instr_Bxx(bool cond);
+ void Instr_BRL(void);
+
+ void Instr_PEA(void);
+ void Instr_PEI(void);
+ void Instr_PER(void);
+ template void Instr_PHA(void);
+ void Instr_PHB(void);
+ void Instr_PHD(void);
+ void Instr_PHK(void);
+ void Instr_PHP(void);
+ template void Instr_PHX(void);
+ template void Instr_PHY(void);
+
+ template void Instr_PLA(void);
+ void Instr_PLB(void);
+ void Instr_PLD(void);
+ void Instr_PLP(void);
+ template void Instr_PLX(void);
+ template void Instr_PLY(void);
+
+ void Instr_REP(void);
+ void Instr_SEP(void);
+
+ void Instr_JMP(void);
+ void Instr_JMP_I(void);
+ void Instr_JMP_II(void);
+ void Instr_JML(void);
+ void Instr_JML_I(void);
+
+ void Instr_JSL(void);
+ void Instr_JSR(void);
+ void Instr_JSR_II(void);
+
+ void Instr_RTI(void);
+ void Instr_RTL(void);
+ void Instr_RTS(void);
+
+ template void Instr_INX(void);
+ template void Instr_INY(void);
+
+ template void Instr_DEX(void);
+ template void Instr_DEY(void);
+
+ template void Instr_TAX(void);
+ template void Instr_TAY(void);
+ void Instr_TCD(void);
+ void Instr_TCS(void);
+ void Instr_TDC(void);
+ void Instr_TSC(void);
+ template void Instr_TSX(void);
+ template void Instr_TXA(void);
+ void Instr_TXS(void);
+ template void Instr_TXY(void);
+ template void Instr_TYA(void);
+ template void Instr_TYX(void);
+ void Instr_XBA(void);
+ void Instr_XCE(void);
+ template void Instr_CLx(void);
+ template void Instr_SEx(void);
+ template void Instr_MVx(void);
+};
+
diff --git a/mednafen/snes_faust/Core65816.inc b/mednafen/snes_faust/Core65816.inc
new file mode 100644
index 0000000..55f398c
--- /dev/null
+++ b/mednafen/snes_faust/Core65816.inc
@@ -0,0 +1,1871 @@
+/******************************************************************************/
+/* Mednafen - Multi-system Emulator */
+/******************************************************************************/
+/* Core65816.inc - 65816 CPU Emulator Core
+** Copyright (C) 2015-2019 Mednafen Team
+**
+** This program is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public License
+** as published by the Free Software Foundation; either version 2
+** of the License, or (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software Foundation, Inc.,
+** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+Core65816::Core65816()
+{
+ PCPBRDummy = 0x00;
+}
+
+Core65816::~Core65816()
+{
+
+
+}
+
+//
+//
+//
+template
+INLINE void Core65816::SetZN(T arg)
+{
+ P &= ~(Z_FLAG | N_FLAG);
+
+ if(!arg)
+ P |= Z_FLAG;
+
+ P |= (arg >> ((sizeof(T) - 1) * 8)) & N_FLAG;
+}
+
+template
+INLINE void Core65816::Push(T arg)
+{
+ if(sizeof(T) == 2)
+ {
+ MemWrite(S, arg >> 8);
+ S--;
+ }
+
+ MemWrite(S, arg);
+ S--;
+}
+
+template
+INLINE T Core65816::Pull(void)
+{
+ T ret = 0;
+
+ S++;
+ ret |= MemRead(S);
+
+ if(sizeof(T) == 2)
+ {
+ S++;
+ ret |= MemRead(S) << 8;
+ }
+
+ return ret;
+}
+
+// ABORT not fully implemented/tested.
+INLINE void Core65816::ISequence(unsigned which)
+{
+ uint16 vecaddr;
+
+ switch(which)
+ {
+ case ISEQ_COP: vecaddr = 0xFFE4; break;
+ case ISEQ_BRK: vecaddr = 0xFFE6; break;
+ case ISEQ_ABORT: vecaddr = 0xFFE8; break;
+ case ISEQ_NMI: vecaddr = 0xFFEA; break;
+ case ISEQ_IRQ: vecaddr = 0xFFEE; break;
+ }
+
+ Push(PBR);
+ Push(PC);
+ Push(P);
+
+ P = (P & ~D_FLAG) | I_FLAG;
+ PBR = 0x00;
+ PC = MemRead(vecaddr);
+ BranchOccurred(which);
+
+ SNES_DBG("[CPU] ISeq %u: %04x\n", which, PC);
+}
+
+//
+//
+//
+
+INLINE void Core65816::Instr_BRK(void)
+{
+ OpRead(PCPBR);
+ PC++;
+ OpRead(PCPBR);
+
+ ISequence(ISEQ_BRK);
+ SampleIRQ();
+}
+
+INLINE void Core65816::Instr_COP(void)
+{
+ OpRead(PCPBR);
+ PC++;
+ OpRead(PCPBR);
+
+ ISequence(ISEQ_COP);
+ SampleIRQ();
+}
+
+INLINE void Core65816::Instr_NOP(void)
+{
+ IO();
+}
+
+INLINE void Core65816::Instr_WDM(void)
+{
+ OpRead(PCPBR);
+ PC++;
+}
+
+//
+//
+//
+template
+INLINE void Core65816::Op_ADC(T arg)
+{
+ T& AA = AC();
+ uint32 tmp;
+
+ if(P & D_FLAG)
+ {
+ uint32 a, b, c, d;
+
+ a = (AA & 0x000F) + (arg & 0x000F) + (P & 1);
+ b = (AA & 0x00F0) + (arg & 0x00F0);
+
+ P &= ~(C_FLAG | V_FLAG);
+
+ if(sizeof(T) == 2)
+ {
+ c = (AA & 0x0F00) + (arg & 0x0F00);
+ d = (AA & 0xF000) + (arg & 0xF000);
+
+ if(a > 0x0009) { b += 0x0010; a += 0x0006; }
+ if(b > 0x0090) { c += 0x0100; b += 0x0060; }
+ if(c > 0x0900) { d += 0x1000; c += 0x0600; }
+ P |= ((~(AA ^ arg) & (AA ^ d)) >> (sizeof(T) * 8 - 7)) & 0x40; // V flag
+ if(d > 0x9000) { P |= C_FLAG; d += 0x6000; }
+
+ tmp = (a & 0x000F) | (b & 0x00F0) | (c & 0x0F00) | (d & 0xF000);
+ }
+ else
+ {
+ if(a > 0x0009) { b += 0x0010; a += 0x0006; }
+ P |= ((~(AA ^ arg) & (AA ^ b)) >> (sizeof(T) * 8 - 7)) & 0x40; // V flag
+ if(b > 0x0090) { P |= C_FLAG; b += 0x0060; }
+
+ tmp = (a & 0x000F) | (b & 0x00F0);
+ }
+ }
+ else
+ {
+ tmp = AA + arg + (P & 1);
+
+ P &= ~(C_FLAG | V_FLAG);
+ P |= (tmp >> (sizeof(T) * 8)) & 1; // C flag
+ P |= ((~(AA ^ arg) & (AA ^ tmp)) >> (sizeof(T) * 8 - 7)) & 0x40; // V flag
+ }
+
+ AA = tmp;
+ SetZN(AA);
+}
+
+template
+INLINE void Core65816::Op_AND(T arg)
+{
+ T& AA = AC();
+
+ AA &= arg;
+
+ SetZN(AA);
+}
+
+template
+INLINE void Core65816::Op_BIT(T arg) // N and V flags are not modified in the immediate addressing form of BIT.
+{
+ T& AA = AC();
+
+ P &= ~Z_FLAG;
+
+ if(!(AA & arg))
+ P |= Z_FLAG;
+
+ if(!immediate)
+ {
+ P &= ~(N_FLAG | V_FLAG);
+ P |= (arg >> ((sizeof(T) - 1) * 8)) & (N_FLAG | V_FLAG);
+ }
+}
+
+template
+INLINE void Core65816::Op_Compare(T rv, T arg)
+{
+ uint32 tmp = rv - arg;
+
+ SetZN(tmp);
+
+ P &= ~C_FLAG;
+ P |= ((tmp >> (sizeof(T) * 8)) & 1) ^ 1;
+}
+
+template
+INLINE void Core65816::Op_CMP(T arg)
+{
+ Op_Compare(C, arg);
+}
+
+template
+INLINE void Core65816::Op_CPX(T arg)
+{
+ Op_Compare(X, arg);
+}
+
+template
+INLINE void Core65816::Op_CPY(T arg)
+{
+ Op_Compare(Y, arg);
+}
+
+template
+INLINE void Core65816::Op_EOR(T arg)
+{
+ T& AA = AC();
+
+ AA ^= arg;
+
+ SetZN(AA);
+}
+
+template
+INLINE void Core65816::Op_LDA(T arg)
+{
+ T& AA = AC();
+
+ AA = arg;
+
+ SetZN(AA);
+}
+
+template
+INLINE void Core65816::Op_LDX(T arg)
+{
+ X = arg;
+
+ SetZN(X);
+}
+
+template
+INLINE void Core65816::Op_LDY(T arg)
+{
+ Y = arg;
+
+ SetZN(Y);
+}
+
+template
+INLINE void Core65816::Op_ORA(T arg)
+{
+ T& AA = AC();
+
+ AA |= arg;
+
+ SetZN(AA);
+}
+
+template
+INLINE void Core65816::Op_SBC(T arg)
+{
+ T& AA = AC();
+ uint32 tmp;
+
+ arg = ~arg;
+
+ if(P & D_FLAG)
+ {
+ uint32 a, b, c, d;
+
+ a = (AA & 0x000F) + (arg & 0x000F) + (P & 1);
+ b = (AA & 0x00F0) + (arg & 0x00F0) + (a & 0x0010);
+
+ P &= ~(C_FLAG | V_FLAG);
+
+ if(sizeof(T) == 2)
+ {
+ c = (AA & 0x0F00) + (arg & 0x0F00) + (b & 0x0100);
+ d = (AA & 0xF000) + (arg & 0xF000) + (c & 0x1000);
+
+ P |= ((d >> (sizeof(T) * 8)) & 1); // C flag
+
+ if(a < 0x00010) { a -= 0x0006; }
+ if(b < 0x00100) { b -= 0x0060; }
+ if(c < 0x01000) { c -= 0x0600; }
+ P |= ((~(AA ^ arg) & (AA ^ d)) >> (sizeof(T) * 8 - 7)) & 0x40; // V flag
+ if(d < 0x10000) { d -= 0x6000; }
+
+ tmp = (a & 0x000F) | (b & 0x00F0) | (c & 0x0F00) | (d & 0xF000);
+ }
+ else
+ {
+ P |= ((b >> (sizeof(T) * 8)) & 1); // C flag
+
+ if(a < 0x0010) { a -= 0x0006; }
+ P |= ((~(AA ^ arg) & (AA ^ b)) >> (sizeof(T) * 8 - 7)) & 0x40; // V flag
+ if(b < 0x0100) { b -= 0x0060; }
+
+ tmp = (a & 0x000F) | (b & 0x00F0);
+ }
+ }
+ else
+ {
+ tmp = AA + arg + (P & 1);
+
+ P &= ~(C_FLAG | V_FLAG);
+ P |= ((tmp >> (sizeof(T) * 8)) & 1); // C flag
+ P |= ((~(AA ^ arg) & (AA ^ tmp)) >> (sizeof(T) * 8 - 7)) & 0x40; // V flag
+ }
+
+ AA = tmp;
+ SetZN(AA);
+}
+
+
+//
+//
+//
+template
+INLINE void Core65816::Op_ASL(T& arg)
+{
+ P &= ~C_FLAG;
+ P |= arg >> (8 * sizeof(T) - 1);
+
+ arg <<= 1;
+
+ SetZN(arg);
+}
+
+template
+INLINE void Core65816::Op_DEC(T& arg)
+{
+ arg--;
+
+ SetZN(arg);
+}
+
+template
+INLINE void Core65816::Op_INC(T& arg)
+{
+ arg++;
+
+ SetZN(arg);
+}
+
+template
+INLINE void Core65816::Op_LSR(T& arg)
+{
+ P &= ~C_FLAG;
+ P |= arg & 1;
+
+ arg >>= 1;
+
+ SetZN(arg);
+}
+
+template
+INLINE void Core65816::Op_ROL(T& arg)
+{
+ const bool new_CF = arg >> (sizeof(T) * 8 - 1);
+
+ arg <<= 1;
+
+ arg |= (P & 1);
+ P &= ~C_FLAG;
+ P |= new_CF;
+
+ SetZN(arg);
+}
+
+template
+INLINE void Core65816::Op_ROR(T& arg)
+{
+ const bool new_CF = arg & 1;
+
+ arg >>= 1;
+
+ arg |= (P & 1) << (sizeof(T) * 8 - 1);
+ P &= ~C_FLAG;
+ P |= new_CF;
+
+ SetZN(arg);
+}
+
+template
+INLINE void Core65816::Op_TRB(T& arg)
+{
+ T& AA = AC();
+
+ P &= ~Z_FLAG;
+ if(!(arg & AA))
+ P |= Z_FLAG;
+
+ arg &= ~AA;
+}
+
+template
+INLINE void Core65816::Op_TSB(T& arg)
+{
+ T& AA = AC();
+
+ P &= ~Z_FLAG;
+ if(!(arg & AA))
+ P |= Z_FLAG;
+
+ arg |= AA;
+}
+
+//
+//
+//
+// NOTE: Since we're hardcoding in DBR in GetEA_AB(), don't use it
+// to implement JSR/JMP/whatever(at least not without modification).
+INLINE uint32 Core65816::GetEA_AB(void)
+{
+ uint32 ea = DBRSL16;
+
+ ea |= OpRead(PCPBR);
+ PC++;
+
+ ea |= OpRead(PCPBR) << 8;
+ PC++;
+
+ return ea;
+}
+
+template
+INLINE uint32 Core65816::GetEA_ABI(uint16 index)
+{
+ uint32 ea;
+
+ ea = GetEA_AB();
+
+ if(UncondEC || (((ea + index) ^ ea) & 0x100))
+ IO();
+
+ ea = (ea + index) & 0xFFFFFF;
+
+ return ea;
+}
+
+template
+INLINE uint32 Core65816::GetEA_ABX(void)
+{
+ return GetEA_ABI(X);
+}
+
+template
+INLINE uint32 Core65816::GetEA_ABY(void)
+{
+ return GetEA_ABI(Y);
+}
+
+INLINE uint32 Core65816::GetEA_ABL(void)
+{
+ uint32 ea;
+
+ ea = OpRead(PCPBR);
+ PC++;
+
+ ea |= OpRead(PCPBR) << 8;
+ PC++;
+
+ ea |= OpRead(PCPBR) << 16;
+ PC++;
+
+ return ea;
+}
+
+INLINE uint32 Core65816::GetEA_ABLX(void)
+{
+ uint32 ea;
+
+ ea = GetEA_ABL();
+ ea = (ea + X) & 0xFFFFFF;
+
+ return ea;
+}
+
+INLINE uint16 Core65816::GetEA_DP(void) // d
+{
+ uint16 ea;
+
+ ea = OpRead(PCPBR);
+ PC++;
+
+ if(D & 0xFF)
+ IO();
+
+ ea = (ea + D);
+
+ return ea;
+}
+
+INLINE uint16 Core65816::GetEA_DPI(uint16 index)
+{
+ uint16 ea;
+
+ ea = GetEA_DP();
+
+ IO();
+ ea = (ea + index);
+
+ return ea;
+}
+
+INLINE uint16 Core65816::GetEA_DPX(void) // d, X
+{
+ return GetEA_DPI(X);
+}
+
+INLINE uint16 Core65816::GetEA_DPY(void) // d, Y
+{
+ return GetEA_DPI(Y);
+}
+
+INLINE uint32 Core65816::GetEA_IND(void) // (d)
+{
+ uint16 eadp;
+ uint32 ea = DBRSL16;
+
+ eadp = GetEA_DP();
+
+ ea |= MemRead(eadp);
+ eadp++;
+
+ ea |= MemRead(eadp) << 8;
+
+ return ea;
+}
+
+INLINE uint32 Core65816::GetEA_INDL(void) // [d]
+{
+ uint16 eadp;
+ uint32 ea;
+
+ eadp = GetEA_DP();
+
+ ea = MemRead(eadp);
+ eadp++;
+
+ ea |= MemRead(eadp) << 8;
+ eadp++;
+
+ ea |= MemRead(eadp) << 16;
+
+ return ea;
+}
+
+INLINE uint32 Core65816::GetEA_IX(void) // (d, X)
+{
+ uint16 eadp;
+ uint32 ea = DBRSL16;
+
+ eadp = GetEA_DPX();
+
+ ea |= MemRead(eadp);
+ eadp++;
+
+ ea |= MemRead(eadp) << 8;
+
+ return ea;
+}
+
+template
+INLINE uint32 Core65816::GetEA_IY(void) // (d), Y
+{
+ uint32 ea;
+
+ ea = GetEA_IND();
+
+ if(UncondEC || (((ea + Y) ^ ea) & 0x100))
+ IO();
+
+ ea = (ea + Y) & 0xFFFFFF;
+
+ return ea;
+}
+
+INLINE uint32 Core65816::GetEA_ILY(void) // [d], Y
+{
+ uint32 ea;
+
+ ea = GetEA_INDL();
+
+ ea = (ea + Y) & 0xFFFFFF;
+
+ return ea;
+}
+
+INLINE uint16 Core65816::GetEA_SR(void)
+{
+ uint16 ea;
+
+ ea = OpRead(PCPBR);
+ PC++;
+
+ IO();
+ ea = (ea + S);
+
+ return ea;
+}
+
+INLINE uint32 Core65816::GetEA_SRIY(void) // (whatever, S), Y
+{
+ uint16 easp;
+ uint32 ea = DBRSL16;
+
+ easp = GetEA_SR();
+
+ ea |= MemRead(easp);
+ easp++;
+
+ ea |= MemRead(easp) << 8;
+
+ IO();
+ ea = (ea + Y) & 0xFFFFFF;
+
+ return ea;
+}
+
+//
+//
+//
+template
+INLINE void Core65816::Instr_LD_IM(void (Core65816::*op)(T))
+{
+ T tmp;
+
+ tmp = OpRead(PCPBR);
+ PC++;
+
+ if(sizeof(T) == 2)
+ {
+ tmp |= OpRead(PCPBR) << 8;
+ PC++;
+ }
+
+ (this->*op)(tmp);
+}
+
+template
+INLINE void Core65816::Instr_LD(EAT (Core65816::*eafn)(void), void (Core65816::*op)(T))
+{
+ EAT ea = (this->*eafn)();
+ T tmp = MemRead(ea);
+
+ (this->*op)(tmp);
+}
+
+template
+INLINE void Core65816::Instr_RMW_A(void (Core65816::*op)(T&))
+{
+ IO();
+ (this->*op)(AC());
+}
+
+template
+INLINE void Core65816::Instr_RMW(EAT (Core65816::*eafn)(void), void (Core65816::*op)(T&))
+{
+ // For 16-bit: L, H, H, L
+ EAT ea = (this->*eafn)();
+ T tmp = MemRead(ea);
+
+ IO();
+ (this->*op)(tmp);
+
+ if(sizeof(T) == 2)
+ MemWrite(ea + 1, tmp >> 8);
+
+ MemWrite(ea, tmp);
+}
+
+template
+INLINE void Core65816::Instr_ST(EAT (Core65816::*eafn)(void), T (Core65816::*op)(void))
+{
+ EAT ea = (this->*eafn)();
+ T tmp = (this->*op)();
+
+ MemWrite(ea, tmp);
+}
+
+//
+//
+//
+
+//
+//
+//
+
+INLINE void Core65816::Instr_Bxx(bool cond)
+{
+ int8 disp;
+
+ disp = OpRead(PCPBR);
+ PC++;
+
+ if(cond)
+ {
+ IO();
+ PC += disp;
+ BranchOccurred();
+ }
+}
+
+INLINE void Core65816::Instr_BRL(void)
+{
+ uint16 disp;
+
+ disp = OpRead(PCPBR);
+ PC++;
+
+ disp |= OpRead(PCPBR) << 8;
+ PC++;
+
+ IO();
+ PC += disp;
+ BranchOccurred();
+}
+
+INLINE void Core65816::Instr_JML(void)
+{
+ uint16 npc;
+
+ npc = OpRead(PCPBR);
+ PC++;
+
+ npc |= OpRead(PCPBR) << 8;
+ PC++;
+
+ PBR = OpRead(PCPBR);
+
+ PC = npc;
+ BranchOccurred();
+}
+
+INLINE void Core65816::Instr_JML_I(void)
+{
+ uint32 ea = 0; // Bank 0, not DBR!
+
+ ea |= OpRead(PCPBR);
+ PC++;
+
+ ea |= OpRead(PCPBR) << 8;
+
+ PC = MemRead(ea);
+ PBR = MemRead((ea + 2) & 0xFFFFFF);
+ BranchOccurred();
+}
+
+INLINE void Core65816::Instr_JMP(void)
+{
+ uint16 npc;
+
+ npc = OpRead(PCPBR);
+ PC++;
+
+ npc |= OpRead(PCPBR) << 8;
+
+ PC = npc;
+ BranchOccurred();
+}
+
+INLINE void Core65816::Instr_JMP_I(void)
+{
+ uint32 ea = 0; // Bank 0, not DBR!
+
+ ea |= OpRead(PCPBR);
+ PC++;
+
+ ea |= OpRead(PCPBR) << 8;
+
+ PC = MemRead(ea);
+ BranchOccurred();
+}
+
+//
+// PBR not DBR, and wrap within bank for both + X and reading high byte of PC.
+//
+INLINE void Core65816::Instr_JMP_II(void)
+{
+ uint16 ea;
+
+ ea = OpRead(PCPBR);
+ PC++;
+
+ ea |= OpRead(PCPBR) << 8;
+ IO();
+ ea += X;
+
+ PC = MemRead((PBR << 16) | ea);
+ ea++;
+ PC |= MemRead((PBR << 16) | ea) << 8;
+ BranchOccurred();
+}
+
+INLINE void Core65816::Instr_JSL(void)
+{
+ uint16 npc;
+
+ npc = OpRead(PCPBR);
+ PC++;
+ npc |= OpRead(PCPBR) << 8;
+ PC++;
+
+ Push(PBR);
+
+ IO();
+
+ PBR = OpRead(PCPBR);
+
+ Push(PC);
+
+ PC = npc;
+ BranchOccurred();
+}
+
+INLINE void Core65816::Instr_JSR(void) // Different memory access order from 6502...
+{
+ uint16 npc;
+
+ npc = OpRead(PCPBR);
+ PC++;
+ npc |= OpRead(PCPBR) << 8;
+
+ IO();
+
+ Push(PC);
+ PC = npc;
+ BranchOccurred();
+}
+
+//
+// PBR not DBR, and wrap within bank for both + X and reading high byte of PC.
+//
+INLINE void Core65816::Instr_JSR_II(void)
+{
+ uint16 ea;
+
+ ea = OpRead(PCPBR);
+ PC++;
+
+ Push(PC);
+
+ ea |= OpRead(PCPBR) << 8;
+ IO();
+ ea += X;
+
+ PC = MemRead((PBR << 16) | ea);
+ ea++;
+ PC |= MemRead((PBR << 16) | ea) << 8;
+}
+
+
+INLINE void Core65816::Instr_RTI(void)
+{
+ IO();
+ IO();
+
+ P = Pull();
+ PC = Pull();
+ // TODO: SampleIRQ();
+ PBR = Pull();
+ BranchOccurred();
+
+ if(P & X_FLAG)
+ {
+ X = (uint8)X;
+ Y = (uint8)Y;
+ }
+
+ SampleIRQ();
+}
+
+INLINE void Core65816::Instr_RTL(void)
+{
+ IO();
+ IO();
+
+ PC = Pull() + 1;
+ PBR = Pull();
+ BranchOccurred();
+}
+
+INLINE void Core65816::Instr_RTS(void)
+{
+ IO();
+ IO();
+
+ PC = Pull() + 1;
+ BranchOccurred();
+
+ IO();
+}
+
+//
+//
+//
+
+template
+INLINE void Core65816::Instr_INX(void)
+{
+ IO();
+ X = (T)(X + 1);
+ SetZN(X);
+}
+
+template
+INLINE void Core65816::Instr_INY(void)
+{
+ IO();
+ Y = (T)(Y + 1);
+ SetZN(Y);
+}
+
+template
+INLINE void Core65816::Instr_DEX(void)
+{
+ IO();
+ X = (T)(X - 1);
+ SetZN(X);
+}
+
+template
+INLINE void Core65816::Instr_DEY(void)
+{
+ IO();
+ Y = (T)(Y - 1);
+ SetZN(Y);
+}
+
+//
+//
+//
+
+template
+INLINE void Core65816::Instr_TAX(void)
+{
+ IO();
+
+ X = (T)C;
+
+ SetZN(X);
+}
+
+template
+INLINE void Core65816::Instr_TAY(void)
+{
+ IO();
+
+ Y = (T)C;
+
+ SetZN(Y);
+}
+
+INLINE void Core65816::Instr_TCD(void)
+{
+ IO();
+
+ D = C;
+
+ SetZN(D);
+}
+
+INLINE void Core65816::Instr_TCS(void)
+{
+ IO();
+ if(MDFN_UNLIKELY(E))
+ S = 0x100 | (uint8)C;
+ else
+ S = C;
+}
+
+INLINE void Core65816::Instr_TDC(void)
+{
+ IO();
+ C = D;
+
+ SetZN(C);
+}
+
+INLINE void Core65816::Instr_TSC(void)
+{
+ IO();
+ C = S;
+
+ SetZN(C);
+}
+
+template
+INLINE void Core65816::Instr_TSX(void)
+{
+ IO();
+ X = (T)S;
+
+ SetZN(X);
+}
+
+template
+INLINE void Core65816::Instr_TXA(void)
+{
+ IO();
+ AC() = X;
+
+ SetZN(C);
+}
+
+INLINE void Core65816::Instr_TXS(void)
+{
+ IO();
+ if(MDFN_UNLIKELY(E)) // SNES "Metal Marines" definitely needs this.
+ S = 0x100 | (uint8)X;
+ else
+ S = X;
+}
+
+template
+INLINE void Core65816::Instr_TXY(void)
+{
+ IO();
+ Y = X;
+
+ SetZN(Y);
+}
+
+template
+INLINE void Core65816::Instr_TYA(void)
+{
+ IO();
+ AC() = Y;
+
+ SetZN(C);
+}
+
+template
+INLINE void Core65816::Instr_TYX(void)
+{
+ IO();
+ X = Y;
+
+ SetZN(X);
+}
+
+INLINE void Core65816::Instr_XBA(void)
+{
+ uint8 tmp = B;
+
+ IO();
+ IO();
+
+ B = A;
+ A = tmp;
+
+ SetZN(A);
+}
+
+INLINE void Core65816::Instr_XCE(void)
+{
+ bool new_E = P & C_FLAG;
+
+ P &= ~C_FLAG;
+ P |= E;
+
+ E = new_E;
+
+ IO();
+ SNES_DBG("[CPU] XCE: %u\n", E);
+}
+
+//
+//
+//
+
+template
+INLINE void Core65816::Instr_CLx(void)
+{
+ IO();
+ P &= ~TA_Mask;
+}
+
+template
+INLINE void Core65816::Instr_SEx(void)
+{
+ IO();
+ P |= TA_Mask;
+}
+
+//
+//
+//
+
+template
+INLINE void Core65816::Instr_MVx(void)
+{
+ // opcode, dstbank, srcbank
+ //
+ // dstbank is loaded into DBR.
+ //
+ // source addr: srcbank, X reg
+ // dest addr, dstbank, Y reg
+ //
+ // Respects X flag, seems to ignore M flag.
+ uint8 SB;
+ uint8 tmp;
+
+ DBRSL16 = OpRead(PCPBR) << 16;
+ PC++;
+
+ SB = OpRead(PCPBR);
+ PC++;
+
+ //
+ //
+ tmp = MemRead((SB << 16) | X);
+ MemWrite((DBRSL16) | Y, tmp);
+ //
+ //
+
+ X = (X_type)(X + increment);
+ Y = (X_type)(Y + increment);
+
+ IO();
+ IO();
+
+ C--;
+ if(C != 0xFFFF)
+ PC -= 3;
+}
+
+INLINE void Core65816::Instr_PEA(void) // Push Effective Absolute Address
+{
+ uint16 ea = GetEA_AB();
+
+ Push(ea);
+}
+
+INLINE void Core65816::Instr_PEI(void) // Push Effective Indirect Address
+{
+ uint16 ea = GetEA_IND();
+
+ Push(ea);
+}
+
+INLINE void Core65816::Instr_PER(void) // Push Effective PC Relative Address
+{
+ uint16 ea = GetEA_AB();
+
+ IO();
+ ea += PC;
+
+ Push(ea);
+}
+
+template
+INLINE void Core65816::Instr_PHA(void)
+{
+ IO();
+ Push(AC());
+}
+
+INLINE void Core65816::Instr_PHB(void)
+{
+ IO();
+ Push(DBRSL16 >> 16);
+}
+
+INLINE void Core65816::Instr_PHD(void)
+{
+ IO();
+ Push(D);
+}
+
+INLINE void Core65816::Instr_PHK(void)
+{
+ IO();
+ Push(PBR);
+}
+
+INLINE void Core65816::Instr_PHP(void)
+{
+ IO();
+ Push(P);
+}
+
+template
+INLINE void Core65816::Instr_PHX(void)
+{
+ IO();
+ Push(X);
+}
+
+template
+INLINE void Core65816::Instr_PHY(void)
+{
+ IO();
+ Push(Y);
+}
+
+template
+INLINE void Core65816::Instr_PLA(void)
+{
+ IO();
+ IO();
+
+ AC() = Pull();
+ SetZN(AC());
+}
+
+INLINE void Core65816::Instr_PLB(void)
+{
+ IO();
+ IO();
+
+ uint8 tmp = Pull();
+
+ SetZN(tmp);
+ DBRSL16 = tmp << 16;
+}
+
+INLINE void Core65816::Instr_PLD(void)
+{
+ IO();
+ IO();
+
+ D = Pull();
+ SetZN(D);
+}
+
+INLINE void Core65816::Instr_PLP(void)
+{
+ IO();
+ IO();
+
+ P = Pull();
+
+ if(P & X_FLAG)
+ {
+ X = (uint8)X;
+ Y = (uint8)Y;
+ }
+}
+
+template
+INLINE void Core65816::Instr_PLX(void)
+{
+ IO();
+ IO();
+
+ X = Pull();
+ SetZN(X);
+}
+
+template
+INLINE void Core65816::Instr_PLY(void)
+{
+ IO();
+ IO();
+
+ Y = Pull();
+ SetZN(Y);
+}
+
+INLINE void Core65816::Instr_REP(void)
+{
+ uint8 tmp;
+
+ tmp = OpRead(PCPBR);
+ PC++;
+
+ IO();
+ P &= ~tmp;
+}
+
+INLINE void Core65816::Instr_SEP(void)
+{
+ uint8 tmp;
+
+ tmp = OpRead(PCPBR);
+ PC++;
+
+ IO();
+ P |= tmp;
+
+ if(P & X_FLAG)
+ {
+ X = (uint8)X;
+ Y = (uint8)Y;
+ }
+}
+
+
+template
+INLINE void Core65816::RunInstruction(void)
+{
+ switch(opcode)
+ {
+ case 0x00: Instr_BRK(); break; // BRK
+ case 0x02: Instr_COP(); break; // COP
+ case 0xEA: Instr_NOP(); break; // NOP
+ case 0xDB: Instr_STP(); break; // STP
+ case 0xCB: Instr_WAI(); break; // WAI
+ case 0x42: Instr_WDM(); break; // WDM (effectively 2-byte NOP).
+
+ //
+ // Block transfer
+ //
+ case 0x44: Instr_MVx(); break; // MVP
+ case 0x54: Instr_MVx