migration tidying (build master from trunk)
This commit is contained in:
parent
4d2e8eee53
commit
0307e3b827
|
@ -1,72 +0,0 @@
|
|||
Authors
|
||||
=======
|
||||
|
||||
A list of people who have contributed code to FCE Ultra, or have had their code
|
||||
placed in FCE Ultra by others.
|
||||
|
||||
Pre-2.0 FCE / FCE Ultra Contributors
|
||||
------------------------------------
|
||||
_These authors contributed exclusively to pre-2.0 versions,
|
||||
but much of their code remains in 2.0 builds_
|
||||
|
||||
* BERO - bero at geocities.co.jp - Base FCE code.
|
||||
|
||||
* Xodnizel - Most of the base FCE Ultra code
|
||||
|
||||
* Aaron Oneal - http://www.morphgear.com - Many changes to compile with MSVC and first frame skipping code
|
||||
|
||||
* Joe Nahmias - Man pages
|
||||
|
||||
* Paul Kuliniewicz - kuliniew at purdue.edu - Various code for the original SDL port.
|
||||
|
||||
* Quietust - quietust at ircN dot org - VRC7 "translation" code.
|
||||
|
||||
* Ben Parnell - Windows debugging tools
|
||||
|
||||
* Parasyte & bbitmaster - Enhanced Windows debugging tools
|
||||
|
||||
* blip & nitsuja - Rerecording support
|
||||
|
||||
FCEUX >= 2.0 Contributors
|
||||
-------------------------
|
||||
* SP - document thyself (sf:rheiny) - Enhanced Windows debugging tools
|
||||
|
||||
* zeromus - mgambrell at gmail dot com (sf:zeromus) - Core architecture refactoring and merging - Windows driver maintenance
|
||||
|
||||
* adelikat - document thyself (sf:adelikat) - UI cleanup, project management, Win32 features & maintenance, TAS tools, documentation
|
||||
|
||||
* CaH4e3 - CaH4e3 at mail dot ru (sf: cah4e3) - Mappers
|
||||
|
||||
* Luke Gustafson - (sf:???) - Windows TAS and movie recording enhancements
|
||||
|
||||
* qfox - (sf:qfox) - lua scripting fucntions, luabot, basicbot (no longer implemented), various lua scripts
|
||||
|
||||
* _mz - document thyself (mauzus) - Windows driver maintenance and cleanup
|
||||
|
||||
* UncombedCoconut - UncombedCoconut at gmail dot com (sf:jeblanchard) - Build system and cross-compilation support - Driver maintenance and refactoring
|
||||
|
||||
* DWEdit - Debugger additions
|
||||
|
||||
* AnS - ansstuff at yandex dot ru (sf:ansstuff) - Win32 features & maintenance, TAS Editor, debugging tools, documentation
|
||||
|
||||
FCEUX (>=2.0) Linux/SDL Developers
|
||||
----------------------------------
|
||||
_These guys concentrated on keeping fceux the premiere linux/portable nes emu._
|
||||
|
||||
* Lukas Sabota - ltsmooth42 at gmail dot com (sf:punkrockguy318) - Head FceuX-SDL developer - GTK GUI, complete overhaul of SDL port, build scripts; maintainence; docs
|
||||
|
||||
* Shinydoofy - sf:shinydoofy - SDL maintenence
|
||||
|
||||
* Soules - gimmedonutnow at gmail dot com (sf:gimmedonutnow) - Linux SDL driver maintenance
|
||||
|
||||
* radsaq - radsaq at gmail dot com (sf:radsaq) - Build system, testing, and random cleanups
|
||||
|
||||
* Bryan Cain - sf:plombo - Patch to embed SDL in the GTK+ GUI, miscellaneous other SDL and GTK+ contributions
|
||||
|
||||
Included components:
|
||||
--------------------
|
||||
* Mitsutaka Okazaki - YM2413 emulator.
|
||||
|
||||
* Andrea Mazzoleni - Scale2x/Scale3x scalers
|
||||
|
||||
* Gilles Vollant - unzip.c PKZIP fileio
|
|
@ -1,116 +0,0 @@
|
|||
FCEUX SDL 2.2.1 SDL README
|
||||
==========================
|
||||
By Lukas Sabota (sf: punkrockguy318)
|
||||
|
||||
http://www.fceux.com
|
||||
|
||||
Last Modified: March 10, 2013
|
||||
|
||||
Table of Contents
|
||||
-----------------
|
||||
|
||||
1. Requirements
|
||||
2. Installation
|
||||
3. Compile-time options
|
||||
4. GUI
|
||||
5. LUA Scripting
|
||||
5. FAQ
|
||||
6. Contact
|
||||
|
||||
1 - Requirements
|
||||
----------------
|
||||
* libsdl1.2 - It is strongly recommended that you upgrade to the latest
|
||||
version of sdl (1.2.15 at the time of writing).
|
||||
* scons - Required to build fceux.
|
||||
* libgtk2.0 (optional) - version >= 2.24 recommended
|
||||
* libgtk3.0 (optional) - this compiles as of fceux 2.2.0
|
||||
* liblua5.1 (optional)
|
||||
* minizip (optional) - you may chose to use the version of minizip on your system by enabling SYSTEM_MINIZIP in the SConstruct
|
||||
* c++ compiler -- you may use g++ from gcc or clang++ from llvm.
|
||||
|
||||
2 - Installation
|
||||
----------------
|
||||
Fceux can be compiled and built using the scons build system. To compile, run:
|
||||
|
||||
scons
|
||||
|
||||
After a sucessful compilation, the fceux binary will be generated to
|
||||
./src/fceux . You can install fceux to your system with the following command:
|
||||
|
||||
scons install
|
||||
|
||||
You can optionally define a prefix:
|
||||
|
||||
scons --prefix=/usr/local install
|
||||
|
||||
You can choose to install the lua scripts (located in output/luaScripts) to a directory of your choosing:
|
||||
|
||||
cp -R output/luaScripts /usr/local/some/directory/that/i/will/find/later
|
||||
|
||||
If you would like to clean the temporary scons files to perform a 'make clean' like function, you can do the following:
|
||||
|
||||
scons -c && rm -rf .scon*
|
||||
|
||||
3 - Compile-time options
|
||||
------------------------
|
||||
You can enable and disable certain features of fceux at build time.
|
||||
To edit these options, edit the "BoolOptions" following the "opts.AddVariables" method
|
||||
at the head of the "SConstruct" file in this source directory. The
|
||||
default options will be fine for most users, but power users may want to
|
||||
tweak some of these options.
|
||||
|
||||
4 - GUI
|
||||
-------
|
||||
You can enable the GTK GUI by setting GTK to 1 in the SConstruct build file.
|
||||
GfceuX is deprecatiated in favor of the new GTK GUI. You can disable the GTK GUI at
|
||||
run-time by passing the --nogui option, or disable it at build-time by setting
|
||||
GTK to 0 in the SConstruct file. If you prefer GTK3 to GTK2, you can set the
|
||||
GTK3 BoolVariable to 1 in the SConstruct.
|
||||
|
||||
5 - LUA Scripting
|
||||
-----------------
|
||||
FCEUX provides a LUA 5.1 engine that allows for in-game scripting capabilities. LUA can be enabled or disabled at build time by adjusting the "LUA" BoolVariable in the SConstruct file.
|
||||
|
||||
A collection of LUA scripts are provided with the source distribuition in the output directory:
|
||||
|
||||
$source_directory/output/luaScripts
|
||||
|
||||
You should be able to run most of the scripts in this directory out of the box. However, some of the the lua scripts require functionality from the "auxlib.lua" library. This file can be copied from "./bin/auxlib.lua" or "./src/auxlib.lua". You will need to place this file in the LUA library search path if a script bombs out looking for auxlib.lua. If the script bombs out, the console output will let you know what the search path are (/usr/local/lib/lua/5.1/ on my particular system). You can simply copy the auxlib to a preferred location to utilize the functions in the auxiliary lua library.
|
||||
|
||||
In addition, some of the lua scripts require functionality from the "iup" GUI library. You can obtain binaries and source for "iup" upstream (http://www.tecgraf.puc-rio.br/iup/), but I would recommend obtaining packages from your Linux distribution if you are able, as it can be difficult to compile or get the binaries working correctly on a given system.
|
||||
|
||||
You will need to add the location that the libiup*.so files to the LUA_CPATH. This can be done with the following command (please note that the location where iup is installed with vary based on how you installed iup):
|
||||
|
||||
export LUA_CPATH="/path/to/iup/lib/lib?51.so;"
|
||||
|
||||
For example, if libiuplua51.so is located in '/usr/lib', you can run the following command before executing fceux to place the library in the search path:
|
||||
|
||||
export LUA_CPATH="/usr/lib/lib?51.so;"
|
||||
|
||||
Finally, if any scripts complaints about "attempt to index global 'iup' (a nil value)", this means that "iup" needs to be explicitly loaded into the script. You can add the following line to the head of script to manually load "iup":
|
||||
|
||||
require("iuplua")
|
||||
|
||||
The latest version of iup (3.5 at the time of writing) is recomended.
|
||||
|
||||
6 - FAQ
|
||||
-------
|
||||
|
||||
* Q. Im having issues with my sound!
|
||||
* A. First of all, for the best sound quality be sure you are using SDL 1.2.14 or later. Versions 1.2.13 and earlier are known to have problems with fceux! Next, try different SDL audio drivers to see if this makes any difference. You can do this by using this command before running fceux:
|
||||
|
||||
export SDL_AUDIODRIVER=driver
|
||||
|
||||
where driver is either: 'pulse' for pulseaudio;' alsa' for ALSA; 'dsp' for OSS; 'esd' for ESD; see SDL documentation for details (http://www.libsdl.org/docs/html/sdlenvvars.html)
|
||||
|
||||
There are sound options that you can tweak at runtime through command line switches:
|
||||
|
||||
* -soundq x internal sound quality hack value (0 off)
|
||||
* -soundrate x sound rate (sane values: 28000 48000
|
||||
* -soundbuffersize x (in ms) sane values (30, 50, 100, 120)
|
||||
|
||||
Running fceux through esddsp is known to fix some audio issues with pulseaudio on some older Ubuntu versions.
|
||||
|
||||
7 - Contact
|
||||
-----------
|
||||
If you have an issue with fceux, report it in the sourceforge bug tracker (see fceux.com). If you would like to contact the author of this readme personally, e-mail LTsmooth42 <at> gmail <dot> com. You can also check us out at #fceu on irc.freenode.net.
|
|
@ -1,241 +0,0 @@
|
|||
#
|
||||
# SConstruct - build script for the SDL port of fceux
|
||||
#
|
||||
# You can adjust the BoolVariables below to include/exclude features
|
||||
# at compile-time. You may also use arguments to specify the parameters.
|
||||
# ie: scons RELEASE=1 GTK3=1
|
||||
#
|
||||
# Use "scons" to compile and "scons install" to install.
|
||||
#
|
||||
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
|
||||
opts = Variables(None, ARGUMENTS)
|
||||
opts.AddVariables(
|
||||
BoolVariable('DEBUG', 'Build with debugging symbols', 1),
|
||||
BoolVariable('RELEASE', 'Set to 1 to build for release', 0),
|
||||
BoolVariable('FRAMESKIP', 'Enable frameskipping', 1),
|
||||
BoolVariable('OPENGL', 'Enable OpenGL support', 1),
|
||||
BoolVariable('LUA', 'Enable Lua support', 1),
|
||||
BoolVariable('GTK', 'Enable GTK2 GUI (SDL only)', 1),
|
||||
BoolVariable('GTK3', 'Enable GTK3 GUI (SDL only)', 0),
|
||||
BoolVariable('NEWPPU', 'Enable new PPU core', 1),
|
||||
BoolVariable('CREATE_AVI', 'Enable avi creation support (SDL only)', 1),
|
||||
BoolVariable('LOGO', 'Enable a logoscreen when creating avis (SDL only)', 1),
|
||||
BoolVariable('SYSTEM_LUA','Use system lua instead of static lua provided with fceux', 1),
|
||||
BoolVariable('SYSTEM_MINIZIP', 'Use system minizip instead of static minizip provided with fceux', 0),
|
||||
BoolVariable('LSB_FIRST', 'Least signficant byte first (non-PPC)', 1),
|
||||
BoolVariable('CLANG', 'Compile with llvm-clang instead of gcc', 0),
|
||||
BoolVariable('SDL2', 'Compile using SDL2 instead of SDL 1.2 (experimental/non-functional)', 0)
|
||||
)
|
||||
AddOption('--prefix', dest='prefix', type='string', nargs=1, action='store', metavar='DIR', help='installation prefix')
|
||||
|
||||
prefix = GetOption('prefix')
|
||||
env = Environment(options = opts)
|
||||
|
||||
if env['RELEASE']:
|
||||
env.Append(CPPDEFINES=["PUBLIC_RELEASE"])
|
||||
env['DEBUG'] = 0
|
||||
|
||||
# LSB_FIRST must be off for PPC to compile
|
||||
if platform.system == "ppc":
|
||||
env['LSB_FIRST'] = 0
|
||||
|
||||
# Default compiler flags:
|
||||
env.Append(CCFLAGS = ['-Wall', '-Wno-write-strings', '-Wno-sign-compare'])
|
||||
|
||||
if os.environ.has_key('PLATFORM'):
|
||||
env.Replace(PLATFORM = os.environ['PLATFORM'])
|
||||
if os.environ.has_key('CC'):
|
||||
env.Replace(CC = os.environ['CC'])
|
||||
if os.environ.has_key('CXX'):
|
||||
env.Replace(CXX = os.environ['CXX'])
|
||||
if os.environ.has_key('WINDRES'):
|
||||
env.Replace(WINDRES = os.environ['WINDRES'])
|
||||
if os.environ.has_key('CFLAGS'):
|
||||
env.Append(CCFLAGS = os.environ['CFLAGS'].split())
|
||||
if os.environ.has_key('CXXFLAGS'):
|
||||
env.Append(CXXFLAGS = os.environ['CXXFLAGS'].split())
|
||||
if os.environ.has_key('CPPFLAGS'):
|
||||
env.Append(CPPFLAGS = os.environ['CPPFLAGS'].split())
|
||||
if os.environ.has_key('LDFLAGS'):
|
||||
env.Append(LINKFLAGS = os.environ['LDFLAGS'].split())
|
||||
|
||||
print "platform: ", env['PLATFORM']
|
||||
|
||||
# compile with clang
|
||||
if env['CLANG']:
|
||||
env.Replace(CC='clang')
|
||||
env.Replace(CXX='clang++')
|
||||
|
||||
# special flags for cygwin
|
||||
# we have to do this here so that the function and lib checks will go through mingw
|
||||
if env['PLATFORM'] == 'cygwin':
|
||||
env.Append(CCFLAGS = " -mno-cygwin")
|
||||
env.Append(LINKFLAGS = " -mno-cygwin")
|
||||
env['LIBS'] = ['wsock32'];
|
||||
|
||||
if env['PLATFORM'] == 'win32':
|
||||
env.Append(CPPPATH = [".", "drivers/win/", "drivers/common/", "drivers/", "drivers/win/zlib", "drivers/win/directx", "drivers/win/lua/include"])
|
||||
env.Append(CPPDEFINES = ["PSS_STYLE=2", "WIN32", "_USE_SHARED_MEMORY_", "NETWORK", "FCEUDEF_DEBUGGER", "NOMINMAX", "NEED_MINGW_HACKS", "_WIN32_IE=0x0600"])
|
||||
env.Append(LIBS = ["rpcrt4", "comctl32", "vfw32", "winmm", "ws2_32", "comdlg32", "ole32", "gdi32", "htmlhelp"])
|
||||
else:
|
||||
conf = Configure(env)
|
||||
# If libdw is available, compile in backward-cpp support
|
||||
if conf.CheckLib('dw'):
|
||||
conf.env.Append(CCFLAGS = "-DBACKWARD_HAS_DW=1")
|
||||
conf.env.Append(LINKFLAGS = "-ldw")
|
||||
if conf.CheckFunc('asprintf'):
|
||||
conf.env.Append(CCFLAGS = "-DHAVE_ASPRINTF")
|
||||
if env['SYSTEM_MINIZIP']:
|
||||
assert conf.CheckLibWithHeader('minizip', 'minizip/unzip.h', 'C', 'unzOpen;', 1), "please install: libminizip"
|
||||
assert conf.CheckLibWithHeader('z', 'zlib.h', 'c', 'inflate;', 1), "please install: zlib"
|
||||
env.Append(CPPDEFINES=["_SYSTEM_MINIZIP"])
|
||||
else:
|
||||
assert conf.CheckLibWithHeader('z', 'zlib.h', 'c', 'inflate;', 1), "please install: zlib"
|
||||
if env['SDL2']:
|
||||
if not conf.CheckLib('SDL2'):
|
||||
print 'Did not find libSDL2 or SDL2.lib, exiting!'
|
||||
Exit(1)
|
||||
env.Append(CPPDEFINES=["_SDL2"])
|
||||
env.ParseConfig('pkg-config sdl2 --cflags --libs')
|
||||
else:
|
||||
if not conf.CheckLib('SDL'):
|
||||
print 'Did not find libSDL or SDL.lib, exiting!'
|
||||
Exit(1)
|
||||
env.ParseConfig('sdl-config --cflags --libs')
|
||||
if env['GTK']:
|
||||
if not conf.CheckLib('gtk-x11-2.0'):
|
||||
print 'Could not find libgtk-2.0, exiting!'
|
||||
Exit(1)
|
||||
# Add compiler and linker flags from pkg-config
|
||||
config_string = 'pkg-config --cflags --libs gtk+-2.0'
|
||||
if env['PLATFORM'] == 'darwin':
|
||||
config_string = 'PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ ' + config_string
|
||||
env.ParseConfig(config_string)
|
||||
env.Append(CPPDEFINES=["_GTK2"])
|
||||
env.Append(CCFLAGS = ["-D_GTK"])
|
||||
if env['GTK3']:
|
||||
# Add compiler and linker flags from pkg-config
|
||||
config_string = 'pkg-config --cflags --libs gtk+-3.0'
|
||||
if env['PLATFORM'] == 'darwin':
|
||||
config_string = 'PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ ' + config_string
|
||||
env.ParseConfig(config_string)
|
||||
env.Append(CPPDEFINES=["_GTK3"])
|
||||
env.Append(CCFLAGS = ["-D_GTK"])
|
||||
|
||||
### Lua platform defines
|
||||
### Applies to all files even though only lua needs it, but should be ok
|
||||
if env['LUA']:
|
||||
env.Append(CPPDEFINES=["_S9XLUA_H"])
|
||||
if env['PLATFORM'] == 'darwin':
|
||||
# Define LUA_USE_MACOSX otherwise we can't bind external libs from lua
|
||||
env.Append(CCFLAGS = ["-DLUA_USE_MACOSX"])
|
||||
if env['PLATFORM'] == 'posix':
|
||||
# If we're POSIX, we use LUA_USE_LINUX since that combines usual lua posix defines with dlfcn calls for dynamic library loading.
|
||||
# Should work on any *nix
|
||||
env.Append(CCFLAGS = ["-DLUA_USE_LINUX"])
|
||||
lua_available = False
|
||||
if conf.CheckLib('lua5.1'):
|
||||
env.Append(LINKFLAGS = ["-ldl", "-llua5.1"])
|
||||
env.Append(CCFLAGS = ["-I/usr/include/lua5.1"])
|
||||
lua_available = True
|
||||
elif conf.CheckLib('lua'):
|
||||
env.Append(LINKFLAGS = ["-ldl", "-llua"])
|
||||
env.Append(CCFLAGS = ["-I/usr/include/lua"])
|
||||
lua_available = True
|
||||
if lua_available == False:
|
||||
print 'Could not find liblua, exiting!'
|
||||
Exit(1)
|
||||
# "--as-needed" no longer available on OSX (probably BSD as well? TODO: test)
|
||||
if env['PLATFORM'] != 'darwin':
|
||||
env.Append(LINKFLAGS=['-Wl,--as-needed'])
|
||||
|
||||
### Search for gd if we're not in Windows
|
||||
if env['PLATFORM'] != 'win32' and env['PLATFORM'] != 'cygwin' and env['CREATE_AVI'] and env['LOGO']:
|
||||
gd = conf.CheckLib('gd', autoadd=1)
|
||||
if gd == 0:
|
||||
env['LOGO'] = 0
|
||||
print 'Did not find libgd, you won\'t be able to create a logo screen for your avis.'
|
||||
|
||||
if env['OPENGL'] and conf.CheckLibWithHeader('GL', 'GL/gl.h', 'c', autoadd=1):
|
||||
conf.env.Append(CCFLAGS = "-DOPENGL")
|
||||
conf.env.Append(CPPDEFINES = ['PSS_STYLE=1'])
|
||||
|
||||
env = conf.Finish()
|
||||
|
||||
if sys.byteorder == 'little' or env['PLATFORM'] == 'win32':
|
||||
env.Append(CPPDEFINES = ['LSB_FIRST'])
|
||||
|
||||
if env['FRAMESKIP']:
|
||||
env.Append(CPPDEFINES = ['FRAMESKIP'])
|
||||
|
||||
print "base CPPDEFINES:",env['CPPDEFINES']
|
||||
print "base CCFLAGS:",env['CCFLAGS']
|
||||
|
||||
if env['DEBUG']:
|
||||
env.Append(CPPDEFINES=["_DEBUG"], CCFLAGS = ['-g', '-O0'])
|
||||
else:
|
||||
env.Append(CCFLAGS = ['-O2'])
|
||||
|
||||
if env['PLATFORM'] != 'win32' and env['PLATFORM'] != 'cygwin' and env['CREATE_AVI']:
|
||||
env.Append(CPPDEFINES=["CREATE_AVI"])
|
||||
else:
|
||||
env['CREATE_AVI']=0;
|
||||
|
||||
Export('env')
|
||||
fceux = SConscript('src/SConscript')
|
||||
env.Program(target="fceux-net-server", source=["fceux-server/server.cpp", "fceux-server/md5.cpp", "fceux-server/throttle.cpp"])
|
||||
|
||||
# Installation rules
|
||||
if prefix == None:
|
||||
prefix = "/usr/local"
|
||||
|
||||
exe_suffix = ''
|
||||
if env['PLATFORM'] == 'win32':
|
||||
exe_suffix = '.exe'
|
||||
|
||||
fceux_src = 'src/fceux' + exe_suffix
|
||||
fceux_dst = 'bin/fceux' + exe_suffix
|
||||
|
||||
fceux_net_server_src = 'fceux-net-server' + exe_suffix
|
||||
fceux_net_server_dst = 'bin/fceux-net-server' + exe_suffix
|
||||
|
||||
auxlib_src = 'src/auxlib.lua'
|
||||
auxlib_dst = 'bin/auxlib.lua'
|
||||
auxlib_inst_dst = prefix + '/share/fceux/auxlib.lua'
|
||||
|
||||
fceux_h_src = 'output/fceux.chm'
|
||||
fceux_h_dst = 'bin/fceux.chm'
|
||||
|
||||
env.Command(fceux_h_dst, fceux_h_src, [Copy(fceux_h_dst, fceux_h_src)])
|
||||
env.Command(fceux_dst, fceux_src, [Copy(fceux_dst, fceux_src)])
|
||||
env.Command(fceux_net_server_dst, fceux_net_server_src, [Copy(fceux_net_server_dst, fceux_net_server_src)])
|
||||
env.Command(auxlib_dst, auxlib_src, [Copy(auxlib_dst, auxlib_src)])
|
||||
|
||||
man_src = 'documentation/fceux.6'
|
||||
man_net_src = 'documentation/fceux-net-server.6'
|
||||
man_dst = prefix + '/share/man/man6/fceux.6'
|
||||
man_net_dst = prefix + '/share/man/man6/fceux-net-server.6'
|
||||
|
||||
share_src = 'output/'
|
||||
share_dst = prefix + '/share/fceux/'
|
||||
|
||||
image_src = 'fceux.png'
|
||||
image_dst = prefix + '/share/pixmaps'
|
||||
|
||||
desktop_src = 'fceux.desktop'
|
||||
desktop_dst = prefix + '/share/applications/'
|
||||
|
||||
env.Install(prefix + "/bin/", fceux)
|
||||
env.Install(prefix + "/bin/", "fceux-net-server")
|
||||
# TODO: Where to put auxlib on "scons install?"
|
||||
env.Alias('install', env.Command(auxlib_inst_dst, auxlib_src, [Copy(auxlib_inst_dst, auxlib_src)]))
|
||||
env.Alias('install', env.Command(share_dst, share_src, [Copy(share_dst, share_src)]))
|
||||
env.Alias('install', env.Command(man_dst, man_src, [Copy(man_dst, man_src)]))
|
||||
env.Alias('install', env.Command(man_net_dst, man_net_src, [Copy(man_net_dst, man_net_src)]))
|
||||
env.Alias('install', env.Command(image_dst, image_src, [Copy(image_dst, image_src)]))
|
||||
env.Alias('install', env.Command(desktop_dst, desktop_src, [Copy(desktop_dst, desktop_src)]))
|
||||
env.Alias('install', (prefix + "/bin/"))
|
|
@ -1,476 +0,0 @@
|
|||
#TODO: install generated exe's, appropriately named, in bin/
|
||||
include(CheckFunctionExists)
|
||||
include(TestBigEndian)
|
||||
|
||||
option(FCEUX_FORCE_LE "Build for a little-endian target" OFF)
|
||||
option(FCEUX_FORCE_BE "Build for a big-endian target" OFF)
|
||||
option(FCEUX_FRAMESKIP "Build legacy frameskip code" OFF)
|
||||
|
||||
if(WIN32)
|
||||
OPTION (NOWIN32 "Replace Win32 support with SDL" OFF)
|
||||
if (NOWIN32)
|
||||
set(WIN32 OFF)
|
||||
endif(NOWIN32)
|
||||
endif(WIN32)
|
||||
|
||||
if (NOT WIN32)
|
||||
option(FCEUX_SDL_OPENGL "Build with OpenGL support" ON)
|
||||
find_package(SDL REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
if(FCEUX_SDL_OPENGL)
|
||||
find_package(OpenGL REQUIRED)
|
||||
endif(FCEUX_SDL_OPENGL)
|
||||
endif(NOT WIN32)
|
||||
|
||||
set(SRC_CORE
|
||||
${CMAKE_SOURCE_DIR}/src/asm.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/cart.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/cheat.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/conddebug.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/config.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/debug.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drawing.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/fceu.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/fds.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/file.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/emufile.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/filter.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/ines.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/movie.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/netplay.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/nsf.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/oldmovie.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/palette.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/ppu.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/sound.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/state.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/unif.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/video.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/vsuni.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/wave.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/x6502.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/01-222.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/103.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/106.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/108.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/112.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/117.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/120.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/121.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/15.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/164.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/175.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/176.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/177.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/178.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/179.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/183.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/185.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/186.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/187.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/189.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/199.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/208.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/222.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/23.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/235.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/253.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/3d-block.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/411120-c.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/43.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/57.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/603-5052.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/68.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/8157.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/8237.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/830118C.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/88.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/90.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/95.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/__dummy_mapper.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/a9711.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/a9746.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/addrlatch.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/ax5705.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/bandai.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/bmc13in1jy110.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/bmc42in1r.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/bmc64in1nr.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/bmc70in1.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/bonza.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/bs-5.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/onebus.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/datalatch.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/deirom.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/dream.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/edu2000.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/fk23c.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/ghostbusters63in1.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/gs-2004.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/gs-2013.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/h2288.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/karaoke.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/kof97.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/vrc5.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/ks7032.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/malee.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/mmc1.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/mmc3.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/mmc5.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/n-c22m.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/n106.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/n625092.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/novel.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/sachen.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/sc-127.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/sheroes.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/sl1632.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/smb2j.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/subor.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/super24.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/supervision.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/t-227-1.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/t-262.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/tengen.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/boards/tf-1201.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/arkanoid.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/bworld.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/cursor.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/fkb.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/ftrainer.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/hypershot.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/mahjong.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/mouse.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/oekakids.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/powerpad.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/quiz.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/shadow.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/suborkb.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/toprider.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/input/zapper.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/151.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/16.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/17.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/18.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/193.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/201.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/202.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/203.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/204.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/21.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/212.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/213.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/214.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/215.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/217.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/22.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/225.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/227.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/228.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/229.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/230.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/231.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/232.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/234.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/241.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/242.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/244.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/246.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/24and26.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/25.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/255.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/27.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/32.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/33.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/40.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/41.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/42.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/46.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/50.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/51.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/59.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/6.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/60.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/61.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/62.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/65.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/67.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/69.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/71.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/72.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/73.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/75.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/76.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/77.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/79.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/8.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/80.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/82.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/83.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/85.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/86.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/89.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/91.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/92.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/97.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/99.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/emu2413.c
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/mmc2and4.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/mappers/simple.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/utils/ConvertUTF.c
|
||||
${CMAKE_SOURCE_DIR}/src/utils/crc32.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/utils/endian.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/utils/general.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/utils/guid.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/utils/md5.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/utils/memory.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/utils/unzip.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/utils/xstring.cpp
|
||||
)
|
||||
|
||||
set(SRC_DRIVERS_COMMON
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/common/args.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/common/cheat.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/common/config.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/common/configSys.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/common/hq2x.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/common/hq3x.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/common/scale2x.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/common/scale3x.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/common/scalebit.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/common/vidblit.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/common/nes_ntsc.c
|
||||
)
|
||||
|
||||
set(SRC_DRIVERS_SDL
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/sdl/config.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/sdl/input.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl-joystick.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl-sound.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl-throttle.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl-video.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/sdl/unix-netplay.cpp
|
||||
)
|
||||
|
||||
if(FCEUX_SDL_OPENGL)
|
||||
set(SRC_DRIVERS_SDL ${SRC_DRIVERS_SDL} ${CMAKE_SOURCE_DIR}/src/drivers/sdl/sdl-opengl.cpp)
|
||||
endif(FCEUX_SDL_OPENGL)
|
||||
|
||||
set(SRC_DRIVERS_WIN
|
||||
${CMAKE_SOURCE_DIR}/src/lua-engine.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lapi.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lauxlib.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lbaselib.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lcode.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/ldblib.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/ldebug.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/ldo.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/ldump.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lfunc.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lgc.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/linit.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/liolib.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/llex.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lmathlib.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lmem.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/loadlib.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lobject.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lopcodes.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/loslib.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lparser.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lstate.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lstring.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lstrlib.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/ltable.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/ltablib.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/ltm.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lundump.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lvm.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/lzio.c
|
||||
${CMAKE_SOURCE_DIR}/src/lua/src/print.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/archive.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/args.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/aviout.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/cdlogger.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/cheat.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/common.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/config.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/debugger.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/debuggersp.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/directories.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/gui.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/guiconfig.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/help.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/input.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/joystick.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/keyboard.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/log.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/luaconsole.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/main.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/mapinput.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/memview.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/memviewsp.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/memwatch.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/movieoptions.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/monitor.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/netplay.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/ntview.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/OutputDS.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/palette.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/ppuview.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/pref.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/ram_search.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/ramwatch.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/replay.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/res.rc
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/sound.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/state.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/tasedit.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/taseditlib/taseditproj.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/taseditlib/greenzone.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/taseditlib/bookmark.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/taseditlib/bookmarks.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/taseditlib/inputhistory.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/taseditlib/inputsnapshot.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/taseditlib/playback.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/taseditlib/markers.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/texthook.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/throttle.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/timing.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/tracer.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/video.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/wave.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/window.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/Win32InputBox.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/adler32.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/compress.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/crc32.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/deflate.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/gzio.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/infblock.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/infcodes.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/inffast.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/inflate.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/inftrees.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/infutil.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/trees.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/uncompr.c
|
||||
${CMAKE_SOURCE_DIR}/src/drivers/win/zlib/zutil.c
|
||||
# ${CMAKE_SOURCE_DIR}/src/drivers/res.rc
|
||||
)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
include_directories( ${CMAKE_SOURCE_DIR}/src )
|
||||
add_definitions( -DNETWORK )
|
||||
|
||||
if(WIN32)
|
||||
set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_WIN})
|
||||
include_directories( ${CMAKE_SOURCE_DIR}/src/drivers/win/directx ${CMAKE_SOURCE_DIR}/src/drivers/win/zlib )
|
||||
add_definitions(
|
||||
-DWIN32
|
||||
-DFCEUDEF_DEBUGGER
|
||||
-D_USE_SHARED_MEMORY_
|
||||
-DPSS_STYLE=2
|
||||
-DNOMINMAX
|
||||
-D_S9XLUA_H
|
||||
)
|
||||
link_directories( ${CMAKE_SOURCE_DIR}/src/drivers/win/directx )
|
||||
else(WIN32)
|
||||
set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_SDL})
|
||||
include_directories( ${SDL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
|
||||
add_definitions( ${SDL_DEFINITIONS} ${ZLIB_DEFINITIONS} )
|
||||
if(FCEUX_SDL_OPENGL)
|
||||
add_definitions( -DOPENGL )
|
||||
include_directories( ${OPENGL_INCLUDE_DIR} )
|
||||
endif(FCEUX_SDL_OPENGL)
|
||||
endif(WIN32)
|
||||
|
||||
if(APPLE)
|
||||
add_definitions( -DPSS_STYLE=4 )
|
||||
else(APPLE)
|
||||
if(UNIX)
|
||||
add_definitions( -DPSS_STYLE=1 )
|
||||
endif(UNIX)
|
||||
endif(APPLE)
|
||||
|
||||
if(MINGW)
|
||||
add_definitions( -DNEED_MINGW_HACKS -D_WIN32_IE=0x0600 )
|
||||
endif(MINGW)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "debug")
|
||||
add_definitions( -D_DEBUG )
|
||||
endif(CMAKE_BUILD_TYPE STREQUAL "debug")
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -Wno-write-strings -Wno-sign-compare")
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
if(FCEUX_FRAMESKIP)
|
||||
add_definitions( -DFRAMESKIP )
|
||||
endif(FCEUX_FRAMESKIP)
|
||||
|
||||
if(NOT FCEUX_FORCE_BE)
|
||||
if(FCEUX_FORCE_LE)
|
||||
add_definitions( -DLSB_FIRST )
|
||||
else(FCEUX_FORCE_LE)
|
||||
test_big_endian(SYS_IS_BE)
|
||||
if(NOT SYS_IS_BE)
|
||||
add_definitions( -DLSB_FIRST )
|
||||
endif(NOT SYS_IS_BE)
|
||||
endif(FCEUX_FORCE_LE)
|
||||
endif(NOT FCEUX_FORCE_BE)
|
||||
|
||||
check_function_exists(asprintf HAVE_ASPRINTF)
|
||||
# HACK: cmake seems to cache HAVE_ASPRINTF and I don't know how to ask it
|
||||
# to forget--even if your compiler changes. So tell it mingw=>no.
|
||||
if(HAVE_ASPRINTF AND NOT MINGW)
|
||||
add_definitions( -DHAVE_ASPRINTF )
|
||||
endif(HAVE_ASPRINTF AND NOT MINGW)
|
||||
|
||||
add_executable( ${FCEUX_EXE_NAME} ${SOURCES} )
|
||||
|
||||
if(WIN32)
|
||||
add_dependencies( ${FCEUX_EXE_NAME} InstallHelpFile )
|
||||
#add_dependencies( ${FCEUX_EXE_NAME} res.o)
|
||||
#add_custom_command(
|
||||
# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/res.o
|
||||
# COMMAND windres
|
||||
# ARGS ${CMAKE_SOURCE_DIR}/src/drivers/win/res.rc ${CMAKE_CURRENT_BINARY_DIR}/res.o --use-temp-file -D_WIN_IE=0x300
|
||||
# MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/src/drivers/win/res.rc
|
||||
#)
|
||||
set(OUTPUT_RES_RC_O CMakeFiles/${FCEUX_EXE_NAME}.dir/__/__/__/src/drivers/win/res.rc.o)
|
||||
add_custom_command(
|
||||
OUTPUT ${OUTPUT_RES_RC_O}
|
||||
COMMAND windres -o ${OUTPUT_RES_RC_O} ${CMAKE_SOURCE_DIR}/src/drivers/win/res.rc
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/src/drivers/win/res.rc
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_target(
|
||||
BuildResourceFileFor${FCEUX_EXE_NAME}
|
||||
DEPENDS ${OUTPUT_RES_RC_O}
|
||||
)
|
||||
set(DEFINED_BUILD_RESOURCE_FILE TRUE CACHE GLOBAL "This is a hack to get CMake to build the .rc file")
|
||||
|
||||
add_dependencies( ${FCEUX_EXE_NAME} BuildResourceFileFor${FCEUX_EXE_NAME} )
|
||||
set_property(
|
||||
TARGET ${FCEUX_EXE_NAME}
|
||||
PROPERTY LINK_FLAGS "${OUTPUT_RES_RC_O} -mwindows"
|
||||
)
|
||||
|
||||
target_link_libraries( ${FCEUX_EXE_NAME} rpcrt4 comctl32 vfw32 winmm ws2_32
|
||||
comdlg32 ole32 gdi32
|
||||
dsound dxguid ddraw dinput
|
||||
)
|
||||
if(MINGW)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/src/drivers/win/lua/include/)
|
||||
else(MINGW)
|
||||
target_link_libraries( ${FCEUX_EXE_NAME} htmlhelp)
|
||||
endif(MINGW)
|
||||
else(WIN32)
|
||||
target_link_libraries( ${FCEUX_EXE_NAME} ${SDL_LIBRARY} ${ZLIB_LIBRARIES} )
|
||||
if(FCEUX_SDL_OPENGL)
|
||||
target_link_libraries( ${FCEUX_EXE_NAME} ${OPENGL_gl_LIBRARY} )
|
||||
endif(FCEUX_SDL_OPENGL)
|
||||
endif(WIN32)
|
||||
|
||||
|
|
@ -1,817 +0,0 @@
|
|||
|
||||
23-Sep-2013 - AnS - Tracer: do not clear window log when stopping the logging
|
||||
22-Sep-2013 - AnS - Tracer: the dialog window can be resized
|
||||
21-Sep-2013 - AnS - Debugger: newly created Bookmarks inherit existing symbolic name by default
|
||||
20-Sep-2013 - AnS - Debugger, Tracer: clicking on Symbolic names works as well as clicking on addresses
|
||||
17-Sep-2013 - zeromus - fixed "Single Instance Mode"
|
||||
16-Sep-2013 - AnS - PPU Viewer: added "Mask unused graphics" and "Invert the mask" checkboxes; fixed window layout when using big fonts
|
||||
15-Sep-2013 - feos - Lua: added tobitstring(), memory.readword(int address1 [, int address2]), memory.readwordsigned(int address1 [, int address2]) functions
|
||||
15-Sep-2013 - CaH4e3 - mapper 002 - workaround for "Top Gun" issue #621, needs testing if this broke something else; mapper 012 - added hardware dip for language select; UNIF PEC-586 - fixed render finally, added 512K cartridges suppport, TODO: PEC keyboard
|
||||
13-Sep-2013 - AnS - debuggerFontSize and hexeditorFontSize can be specified in fceux.cfg
|
||||
13-Sep-2013 - AnS - Debugger: "Symbolic Debug" state is now saved in global fceux.cfg instead of different .deb files
|
||||
12-Sep-2013 - AnS - Tracer: added mouse wheel support
|
||||
12-Sep-2013 - AnS - Tracer: clicking any address select the address; double-clicking any address brings Debugger at the address
|
||||
12-Sep-2013 - AnS - Tracer: added Symbolic Debug naming by right-clicking any address
|
||||
10-Sep-2013 - feos - Hexeditor: Symbolic Debug naming by right-clicking address
|
||||
10-Sep-2013 - AnS - Debugger: added Symbolic Debug naming by right-clicking any address
|
||||
05-Sep-2013 - AnS - Debugger: fixed Cycles counter reset when loading an earlier savestate
|
||||
15-Aug-2013 - CaH4e3 - fixed bandai mapper emulation
|
||||
04-Aug-2013 - AnS - Hexeditor: added "Highlighting" submenu and "Highlight Activity" feature
|
||||
04-Aug-2013 - AnS - Taseditor: an experiment with somewhat different colors for HotChanges
|
||||
04-Aug-2013 - AnS - Auto-disable "Game Genie ROM" feature when no "gg.rom" file is found
|
||||
16-Jul-2013 - AnS - Debugger: highlight PC pointer line when a breakpoint is hit
|
||||
05-Jul-2013 - AnS - RAM Search: added "Hex Editor" button and right-click
|
||||
04-Jul-2013 - AnS - Debugger: added CDL data column in place of left panel. It helps to distinguish executed branches of code from not logged code
|
||||
04-Jul-2013 - AnS - Debugger: clever autoscrolling when stepping/seeking to PC. It maintains relative position of the ">" pointer inside the Disassembly window
|
||||
03-Jul-2013 - AnS - RAM Watch: fixed epic bug when contents of old .wch file mixed with the newly saved data because of "r+b" mode (changed it to "w+b")
|
||||
03-Jul-2013 - AnS - Taseditor: Greenzone: always keep Greenzone.lagLog in touch with history.currentSnapshot.laglog (fixes workflow with "Auto-adjust" disabled)
|
||||
03-Jul-2013 - AnS - Tracer: only output "from $XXXX" when the subroutine was called by JSR (fixes possible errors in those cases when the subroutine was called using stack magic)
|
||||
03-Jul-2013 - AnS - Debugger: do not reload ram.nl every time automatically
|
||||
21-Jun-2013 - CaH4e3 - PPU Viewer: when CDLogger is on, display unused graphics in a dim palette
|
||||
15-Jun-2013 - AnS - Movie recording: fixed bug when emulator allowed recording commands outside the range of FM2 specs
|
||||
15-Jun-2013 - AnS - Movie recording: added ability to record "Insert coin" command (for VS games)
|
||||
15-Jun-2013 - AnS - Movie recording: remember last Author name when creating a new movie
|
||||
08-Jun-2013 - AnS - A couple of fixes which deal with "multiple ROMs in a single archive" case. The loading procedure now takes into account actual ROM name when loading ROM from an archive containing multiple files. This affects PAL/NTSC detection (in case there were ROMs of different regions inside a single zip). Also, "auto-resume play" now loads actual ROM on startup (instead of prompting a list of archived files to choose). Also, NL files (symbolic debug) are named correctly when debugging a ROM from such an archive, etc.
|
||||
08-Jun-2013 - AnS - Hexeditor: fixed bugs when saving files while working with ROMs in archives
|
||||
27-May-2013 - AnS - Hexeditor: specify Data bank condition when adding a Breakpoint by context menu
|
||||
26-May-2013 - AnS - Debugger: added 'T' condition (checks the bank of the data accessed)
|
||||
26-May-2013 - AnS - Win32: fixed storing and loading .deb files when working with archived ROMs
|
||||
26-May-2013 - AnS - new Lua functions: debugger.hitbreakpoint(), debugger.getcyclescount(), debugger.getinstructionscount(), debugger.resetcyclescount(), debugger.resetinstructionscount()
|
||||
26-May-2013 - AnS - Win32: when no script is currently running, Shift+L loads the most recent Lua script
|
||||
26-May-2013 - CaH4e3 - fixed mapper 183
|
||||
14-May-2013 - CaH4e3 - fixed mapper 253
|
||||
13-May-2013 - CaH4e3 - mapper 43
|
||||
09-May-2013 - AnS - Video config: changed "Disable hardware acceleration" option to a drop-down list with 3 options: a) No hardware acceleration; b) Create surface in RAM; c) Hardware acceleration. Because it appears that some video cards still blur textures even when stored in RAM.
|
||||
29-Apr-2013 - AnS - added checking if archive file has any files in it, because new 7z.dll confuses FDS files with archives (it recognizes the first "F" as a signature of an archive)
|
||||
19-Apr-2013 - AnS - Video config: added "Square pixels" option
|
||||
19-Apr-2013 - AnS - Video config: added aspect ratio fields for customizing "TV Aspect" ratio, by default it's 4:3
|
||||
17-Apr-2013 - AnS - "Auto-resume old play session" now also works with NSFs
|
||||
17-Apr-2013 - zeromus - properly savestate NSF
|
||||
17-Apr-2013 - zeromus - add missing mmc5 savestate variables
|
||||
16-Apr-2013 - AnS - Tracer: added "Log Cycles count" and "Log Instructions count" options
|
||||
13-Apr-2013 - AnS - Debugger: scrolling up/down by whole instructions
|
||||
12-Apr-2013 - gocha - Lua: fix wrong frequency calculation in sound.get()
|
||||
07-Apr-2013 - AnS - Taseditor: comply with Lua movie.rerecordcounting() setting
|
||||
01-Apr-2013 - CaH4e3 - mapper 154 - fixed
|
||||
26-Mar-2013 - CaH4e3 - mapper 53 - supported ines format of SUPERVISION UNIF board; UNIF 8157 - fix according to hw; UNIF T-262 - fix according to hw
|
||||
24-Mar-2013 - CaH4e3 - UNIF DANCE2000 - now emulated properly
|
||||
20-Mar-2013 - gocha - link to lua51.dll instead of static linking
|
||||
19-Mar-2013 - zeromus - bring some improvements to newppu from bizhawk, and fix vtoggle5/6 back to vtoggle
|
||||
19-Mar-2013 - zeromus - fix mapper 28
|
||||
17-Mar-2013 - AnS - Replay: removed redundant window update when using "Browse" (fixes #585)
|
||||
17-Mar-2013 - CaH4e3 - UNIF DSOUNDV1 - removed due to duplicate of 178 mapper; mapper 178 - added more features of 8/16M carts with 32K SRAM; UNIF 09-034A - added support for a new SMB2j Lite version
|
||||
14-Mar-2013 - AnS - Debugger: ported "smart scrolling" from an obscure version of FCEUXD 1.1
|
||||
14-Mar-2013 - CaH4e3 - palette ram reading fix for old ppu
|
||||
|
||||
---r2869 - FCEUX 2.2.1 Released---
|
||||
---March 10 2013---
|
||||
|
||||
10-Mar-2013 - prg - SDL: added option to use system minizip
|
||||
10-Mar-2013 - prg - updated to use minizip v1.2.7
|
||||
10-Mar-2013 - CaH4e3 - CDLogger: improved CHR logging, now it also logs the data when using Old PPU
|
||||
02-Mar-2013 - AnS - Hexeditor: fixed ROM coloring when using CDLogger data
|
||||
28-Feb-2013 - AnS - PPU/PAL/Input type changing is now disabled when a movie is playing
|
||||
28-Feb-2013 - AnS - Cheats: update the window when ROM is changed
|
||||
28-Feb-2013 - AnS - show the number of active cheats when a ROM is loaded
|
||||
27-Feb-2013 - CaH4e3 - CDLogger: added "Auto-load .CDL when opening the window" option
|
||||
27-Feb-2013 - CaH4e3 - MMC5 refixed
|
||||
24-Feb-2013 - AnS - CDLogger: added "Auto-save .CDL when closing ROMs" and "Auto-resume logging when loading ROMs" options
|
||||
23-Feb-2013 - AnS - Hexeditor: show symbolic names in the window caption
|
||||
18-Feb-2013 - CaH4e3 - various mapper improvements; UNIF MALISB - Mali Splash Bomb dump; mapper 19 - Dream Master mirror fix
|
||||
18-Feb-2013 - CaH4e3 - fixed mapper 69 low quality sound issue
|
||||
11-Feb-2013 - AnS - fixed possible crash when saving the ROM in Hex Editor
|
||||
11-Feb-2013 - AnS - Moved "Config->Game Genie" to "Config->Enable->Game Genie ROM"
|
||||
03-Feb-2013 - AnS - win32: speed up screen blitting
|
||||
02-Feb-2013 - AnS - Added "TV Aspect (4:3)" to Video Config
|
||||
21-Jan-2013 - AnS - Taseditor: fixed Bookmarks List height on Windows 7
|
||||
21-Jan-2013 - AnS - Taseditor: fixed bug with adding new item to History Log
|
||||
20-Jan-2013 - AnS - Taseditor: changed the logic by which the Piano Roll follows Playback cursor, now it doesn't follow it while seeking
|
||||
15-Jan-2013 - AnS - Lua: removed "shadow pixels" from gui.text(), made gui.parsecolor() function available for users
|
||||
10-Jan-2013 - AnS - Taseditor: Config->Project file saving options
|
||||
01-Jan-2013 - zeromus - NameTableViewer: do something reasonable if a 4-screen, table2, table3 mirror mode is chosen when the corresponding nametable ram is not available on the cart (instead of crashing)
|
||||
31-Dec-2012 - CaH4e3 - fixed mappers 24, 26, 115
|
||||
29-Dec-2012 - AnS - Taseditor: Changed "Compact save" dialog, added 4 options of Greenzone saving
|
||||
29-Dec-2012 - AnS - Cheats: added "Add from CHT file..." button
|
||||
29-Dec-2012 - AnS - win32: force the entire client area to be invalidated at the beginning of WM_PAINT; this fixes the rare bug with DIRECTDRAWCLIPPER sometimes calculating wrong region (was noticed on some video cards)
|
||||
27-Dec-2012 - AnS - Play movie dialog shows New PPU in red if the required setting does not match
|
||||
27-Dec-2012 - thezlomus - RAM Search: added "Search ROM" checkbox
|
||||
19-Dec-2012 - AnS - win32: remodel "Video config" dialog
|
||||
19-Dec-2012 - AnS - win32: fixed restoring maximized window after switching from fullscreen
|
||||
18-Dec-2012 - CaH4e3 - fixed mapper 018 and 198
|
||||
15-Dec-2012 - AnS - win32: added Config->Enable->Auto-resume old play session
|
||||
13-Dec-2012 - AnS - win32: added Emulation Speed->Set custom speed for FrameAdvance
|
||||
13-Dec-2012 - AnS - win32: added NES->Emulation Speed->Set FrameAdvance Delay
|
||||
13-Dec-2012 - AnS - win32: added NES->Emulation Speed->Set Custom Speed
|
||||
12-Dec-2012 - CaH4e3 - finish with mapper to boards conversion
|
||||
07-Dec-2012 - CaH4e3 - Tracer: fixed RAM-located code logging when CDLogger options are enabled
|
||||
05-Dec-2012 - AnS - fixed zapper and mouse positioning in fullscreen
|
||||
04-Dec-2012 - AnS - speed up HUD text drawing
|
||||
04-Dec-2012 - AnS - Taseditor: speed up consecutive Recordings (when combining)
|
||||
03-Dec-2012 - AnS - Taseditor: fixed accelerators when editing Notes
|
||||
03-Dec-2012 - AnS - fixed "X" button in the "Enter New Input" dialog (Hotkey Mapping); changed "Cancel" button to "OK"
|
||||
03-Dec-2012 - CaH4e3 - fixed mapper 99
|
||||
29-Nov-2012 - zeromus - fix "you ling xing dong" by assigning to mapper 192
|
||||
|
||||
---r2768 - FCEUX 2.2.0 Released---
|
||||
---November 27 2012---
|
||||
|
||||
24-Nov-2012 - AnS - when the New PPU is on, it displays "(NewPPU)" in the window caption
|
||||
20-Nov-2012 - AnS - Taseditor: added "Ungreenzone" item to context menu; added "Config->Enable Greenzoning"
|
||||
13-Nov-2012 - AnS - Taseditor: changed fm3 format to version 3
|
||||
10-Nov-2012 - AnS - win32 hotkeys mapping: added the condition that both commands must have the same EMUCMDFLAG_TASEDITOR, or else they are not considered conflicting
|
||||
10-Nov-2012 - AnS - win32 hotkeys: disallow unwanted hits of e.g. F1 after pressing Shift+F1 and quickly releasing Shift
|
||||
05-Nov-2012 - zeromus - support mapper 028
|
||||
05-Nov-2012 - AnS - Taseditor: fixed lag adjustments when dealing with previously unknown lag state
|
||||
30-Oct-2012 - zeromus - default stack pointer to $FD instead of $FF
|
||||
29-Oct-2012 - CaH4e3 - mapper 252 added
|
||||
29-Oct-2012 - AnS - Taseditor: update RAM Search and RAM Watch when jumping causes game state to change
|
||||
21-Oct-2012 - CaH4e3 - sync mappers with fceu-mm
|
||||
30-Sep-2012 - AnS - added "(Europe)" and "(PAL)" strings to region detection
|
||||
28-Sep-2012 - AnS - Hexeditor: Ctrl+F opens Find dialog
|
||||
28-Sep-2012 - AnS - Hexeditor: display 0x5000-0x5FFF contents
|
||||
28-Sep-2012 - AnS - Tracer: fixed crash when logging undefined opcodes
|
||||
26-Sep-2012 - AnS - Debugger: "Name" button in Bookmarks, total revamp of Bookmarks
|
||||
26-Sep-2012 - AnS - Debugger: single click on any address copies this address to the "Seek To" field and "Bookmark Add" field
|
||||
26-Sep-2012 - AnS - Fixed replay engine bug that doubles the last input of the movie
|
||||
26-Sep-2012 - AnS - Tracer: "RTS" instructions now output the subroutine address/name
|
||||
23-Sep-2012 - AnS - Lua: clear previous frame drawings at the beginning of every frame
|
||||
23-Sep-2012 - AnS - Debugger: fixed mouseover when using Symbolic debug; mouseover works for the disassembly window too
|
||||
23-Sep-2012 - CaH4e3 - CDLogger: Now can log VROM access (CHR banks of the ROM) when NewPPU is enabled
|
||||
22-Sep-2012 - AnS - Tracer: added "Symbolic trace", "Log current Frame number", "Log emulator messages", "Log breakpoint hits" options
|
||||
11-Sep-2012 - AnS - new Lua function: emu.setlagflag()
|
||||
11-Sep-2012 - AnS - Debugger: deleting a breakpoint leaves selection in the Breakpoints list
|
||||
06-Sep-2012 - AnS - added "Use Custom Palette" checkbox to Palette config
|
||||
06-Sep-2012 - AnS - Debugger: special strings (NMI/IRQ/etc) can be also used in "Seek To" field and Bookmarks
|
||||
01-Sep-2012 - AnS - fixed movie savestates logic, loading post-movie savestates is not allowed in read-only
|
||||
31-Aug-2012 - zeromus - update mapper 156 from fceu-mm sources
|
||||
30-Aug-2012 - AnS - fixed savestates filenaming bug when working with a movie
|
||||
29-Aug-2012 - AnS - added "Force Grayscale" checkbox to Palette config
|
||||
26-Aug-2012 - AnS - Taseditor: History Log highlights items related to current item
|
||||
25-Aug-2012 - AnS - Taseditor: fixed AdjustLag feature and changed fm3 version to v2
|
||||
22-Aug-2012 - AnS - added "Clear" button to Message Log
|
||||
20-Aug-2012 - AnS - "Switch fullscreen by double-click" option in GUI config
|
||||
20-Aug-2012 - AnS - "Hide mouse cursor" and "Use console BG color for empty areas" options
|
||||
20-Aug-2012 - AnS - total revamp of Video config stuff, Best Fit also works for fullscreen mode
|
||||
19-Aug-2012 - AnS - win32: "Maintain aspect ratio (best fit)" option in Video config
|
||||
12-Aug-2012 - AnS - Debugger: "Display ROM offsets" option
|
||||
12-Aug-2012 - AnS - Debugger: double-click breakpoint also adds current bank number to breakpoint condition
|
||||
12-Aug-2012 - AnS - Added FPS display to Win32 port (Config->Display->FPS)
|
||||
10-Aug-2012 - prg - gtk: reset video on video dialog close
|
||||
10-Aug-2012 - prg - gtk: add gui option for showfps
|
||||
10-Aug-2012 - prg - sdl: add runtime option for controling drawing fps (SDL.ShowFPS)
|
||||
10-Aug-2012 - prg - core: move showfps from build option to runtime option
|
||||
10-Aug-2012 - prg - sdl: fix and enable SHOWFPS build option (TODO: make runtime option)
|
||||
10-Aug-2012 - AnS - Debugger: "Address Bookmark Add" field follows disassembly window scrolling position
|
||||
08-Aug-2012 - AnS - Taseditor: frame counter display is auto-on when Taseditor launches
|
||||
08-Aug-2012 - AnS - Debugger: improved stack display
|
||||
08-Aug-2012 - AnS - Debugger: doubleclick on the disassembly prompts "Add Execute breakpoint" dialog
|
||||
08-Aug-2012 - AnS - Debugger: fixed RAM peek by a rightclick on left pane
|
||||
08-Aug-2012 - AnS - Debugger: ">" points at current line in disassembly
|
||||
08-Aug-2012 - AnS - Debugger: show the number of breakpoints (enabled and total) above the breakpoints list
|
||||
06-Aug-2012 - CaH4e3 - fixed bug when loading UNF games (#525 )
|
||||
06-Aug-2012 - AnS - Tracer also updates its window when user pauses the game, not just when Debugger snaps
|
||||
06-Aug-2012 - AnS - Tracer: added "Use Stack Pointer for code tabbing" option and added "To the left from disassembly text" option
|
||||
05-Aug-2012 - AnS - Debugger: .DEB file now also stores the state of "Break on Bad Opcode" and "Break when exceed" checkboxes/editfields
|
||||
05-Aug-2012 - AnS - Debugger: added "CPU cycles" and "Instructions" counters (request #527) and added "Break when exceed" breakpoints
|
||||
05-Aug-2012 - AnS - Debugger: window layout cleanup
|
||||
06-Aug-2012 - prg - gtk: added hotkey gui config
|
||||
04-Aug-2012 - prg - all: updated FSF address
|
||||
04-Aug-2012 - prg - sdl: added SDL.Input.EnableOppositeDirectional option. allows/disallows simultaneous right+left / up+down.
|
||||
03-Aug-2012 - AnS - Debugger: highlighting breakpoint item in BPs list when it's triggered
|
||||
03-Aug-2012 - AnS - Debugger: allow Frame Advancing when Debugger is in breakpoint state
|
||||
03-Aug-2012 - AnS - Debugger: don't update Debugger window at the beginning of Step command (it will update at at the end of Step) - fixes #528
|
||||
25-Jul-2012 - AnS - Taseditor: auto-starting Note editing when creating Marker by double-click
|
||||
19-Jul-2012 - AnS - Taseditor: Lua registermanual allows changing the "Run function" button caption; Markers are always restored when deploying Bookmarks
|
||||
01-Jul-2012 - AnS - new hotkey "Run Manual Lua function"
|
||||
24-Jun-2012 - AnS - Taseditor: drawing selected_slot border in Branches Tree
|
||||
24-Jun-2012 - zeromus - add ability for CNROM games to choose whether they have bus conflicts (fixes Colorful Dragon (Unl) (Sachen), since it flakes out if bus conflicts are emulated)
|
||||
23-Jun-2012 - zeromus - add m116 from fceu-mm; fix mapper 178 big PRG support
|
||||
20-Jun-2012 - zeromus - fix savestate engine to throw errors when a buggy SFORMAT is passed to AddExState, and fix those errors in m015 and m253
|
||||
19-Jun-2012 - AnS - added TASEDITOR type of hotkeys
|
||||
19-Jun-2012 - AnS - Taseditor: 2 new hotkeys: "Switch Auto-restoring" (Ctrl+Spacebar), "Switch current Multitracking mode" (W)
|
||||
16-Jun-2012 - AnS - Taseditor: drawing patterns with Alt held; no more row_last_clicked
|
||||
15-Jun-2012 - AnS - Taseditor: added "rewatch from Selection to Playback" feature for Ctrl+middle click action
|
||||
14-Jun-2012 - AnS - Taseditor: combining consecutive AdjustLag operations
|
||||
13-Jun-2012 - AnS - Taseditor: truncated Greenzone is drawn by pale colors, not just white
|
||||
12-Jun-2012 - AnS - Taseditor: "Auto-adjust Input due to lag" checkbox
|
||||
11-Jun-2012 - AnS - Taseditor: green arrow doesn't disappear when Playback cursor goes through it
|
||||
11-Jun-2012 - AnS - Taseditor: changed icons column in Piano Roll, now can show both Bookmark and arrow
|
||||
09-Jun-2012 - zeromus - win32-support funny languages for opening roms, through drag&drop, at least
|
||||
06-Jun-2012 - AnS - Taseditor: small fix for Branches Tree - among bookmarks with equal jump_frame the cursor must be pointing at current branch
|
||||
06-Jun-2012 - zeromus - support mapper 176. mapper 176 no longer maps to BMCFK23C. BMCFK23C is still accessible through crc or unif? test case would be welcome. it is unclear to me why mapper 176 control was removed from 176.cpp and given to BMCFK23C
|
||||
06-Jun-2012 - AnS - Taseditor: autosave works only when project has a filename
|
||||
26-May-2012 - AnS - Taseditor: Ctrl+Space accelerator = toggle "Auto-restore last position" checkbox; remapped "Restore Playback" hotkey to Spacebar; "Restore Playback" also pauses seeking; mid-click = "Restore Playback" when possible
|
||||
08-May-2012 - AnS - Taseditor: changed "lost_position" logic
|
||||
01-May-2012 - AnS - Lua functions emu.pause() and emu.unpause() don't yield and don't reset emulator speed anymore
|
||||
30-Apr-2012 - AnS - Taseditor: Ctrl + mid click = run to Selection cursor; Shift + mid click = run to nearest Marker
|
||||
26-Apr-2012 - AnS - Taseditor: fixed filename logic when user creates project from an fm2 or a corrupted fm3
|
||||
23-Apr-2012 - AnS - Taseditor: menus overhaul
|
||||
19-Apr-2012 - AnS - RAM Watch: fixed loading Data Size and Data Type from a .wch, now corrupted .wch won't crash
|
||||
17-Apr-2012 - zeromus - fix bug in mapper 164 savestates which caused wram to be lost, also make mapper 164 sram work
|
||||
17-Apr-2012 - AnS - Taseditor: gradual History Log autocompression when idle
|
||||
14-Apr-2012 - zeromus - add hash database entry for Rasaaru Ishii no Childs Quest (J), whose extant roms specify both the wrong mapper and the wrong mirroring
|
||||
14-Apr-2012 - zeromus - change mapper 12 (mmc3 variant) to specify MMC3A chip version
|
||||
14-Apr-2012 - AnS - Taseditor: rightclicks in Branches Tree
|
||||
14-Apr-2012 - AnS - "Play Movie" dialog doesn't search in fceux root folder anymore
|
||||
10-Apr-2012 - AnS - bold items in some context menus
|
||||
10-Apr-2012 - zeromus - fix mapper 115 (actually to fix mapper 248 for Bao Qing Tian)
|
||||
09-Apr-2012 - zeromus - remove vram protection from mapper 227
|
||||
09-Apr-2012 - AnS - Taseditor: all GUI buttons fire off at mousedown; disabled Spacebar and enabled Middle mouse button on GUI buttons
|
||||
09-Apr-2012 - AnS - Taseditor: clicks in Branches Tree
|
||||
07-Apr-2012 - AnS - Taseditor: version data in fm3
|
||||
07-Apr-2012 - AnS - Taseditor: much better way of calculating Branches Tree; hinting full timelines; miniarrow showing current Playback cursor position in Branches Tree; "Bookmark#" modtype, undo/redo works for Bookmarks
|
||||
07-Apr-2012 - AnS - Taseditor: applying PAL and PPU flags when loading projects
|
||||
05-Apr-2012 - zeromus - fix mapper 242 (dragon quest 8 UNL)
|
||||
26-Mar-2012 - AnS - Taseditor: Alt+Wheel = jump across gaps in Input/Markers
|
||||
25-Mar-2012 - AnS - returned default mapping of Frame Advance hotkey to Backslash
|
||||
25-Mar-2012 - AnS - Taseditor: BookmarksList clicks apply on buttonup only
|
||||
22-Mar-2012 - AnS - Config->Combine consecutive Recordings/Draws
|
||||
18-Mar-2012 - AnS - new hotkey "Cancel Seeking (TAS Editor)" (Esc)
|
||||
18-Mar-2012 - AnS - Taseditor: Config->Autopause at the end of Movie
|
||||
17-Mar-2012 - CaH4e3 - varous bugfixes, xstring trimming functions logic bugs, etc
|
||||
17-Mar-2012 - AnS - Taseditor: showing row_last_clicked when Shift or Alt is held
|
||||
17-Mar-2012 - AnS - Taseditor: no more "allow keys in Piano Roll"; new accelerators: Ctrl + arrows, Shift + arrows, Home/End/Page Up/Page Down, Ctrl + Home/End, Shift + Home/End
|
||||
17-Mar-2012 - AnS - Taseditor: selection by dragging from Frame#
|
||||
17-Mar-2012 - AnS - Taseditor: set/pick Markers by doubleclick, throw Markers away
|
||||
14-Mar-2012 - AnS - Taseditor: drawing input; holding Shift when drawing
|
||||
14-Mar-2012 - AnS - Taseditor: fixed known WinXP bug with scrollbar arrows
|
||||
14-Mar-2012 - AnS - Taseditor: moving Markers by drag'n'drop, "Marker Drag" and "Marker Swap" operations
|
||||
14-Mar-2012 - AnS - Taseditor: dragging blue arrow (moving Playback cursor)
|
||||
14-Mar-2012 - AnS - Taseditor: observing Piano Roll by dragging cursor outside
|
||||
11-Mar-2012 - AnS - Taseditor: double-tapping Shift/Ctrl scrolls Piano Roll to respective cursor
|
||||
09-Mar-2012 - AnS - Taseditor: Config->Deselect on doubleclick
|
||||
09-Mar-2012 - AnS - Taseditor: checking ROM checksum when saving/loading projects
|
||||
09-Mar-2012 - AnS - Taseditor: TAS Editor can have mouse wheel input even when keyboard focus is on FCEUX window
|
||||
09-Mar-2012 - AnS - disabled FCEUX context menu when TAS Editor is engaged
|
||||
06-mar-2012 - prg - fceux no longer segfaults when opening gamepadconfig with GTK < 2.24 - a message is printed to the console
|
||||
06-mar-2012 - prg - supports loading of configuration files in $FCEUXDIR/cfg.d/*
|
||||
01-Mar-2012 - AnS - Taseditor: changing history size doesn't reset history
|
||||
28-feb-2012 - AnS - Taseditor: "Deselect" option in menus
|
||||
26-feb-2012 - AnS - Small save/load state speedup, noticeable only in TAS Editor or lua bots
|
||||
21-feb-2012 - AnS - Taseditor: header lights on mouseover
|
||||
21-feb-2012 - AnS - Taseditor: registering click at buttondown; Alt+click on input = set pattern
|
||||
20-feb-2012 - AnS - Taseditor: Right button + wheel = Playback rewind/forward; Shift/Ctrl + wheel = jump via Markers with Playback/Selection cursor
|
||||
20-feb-2012 - AnS - Taseditor: middle button pauses/unpauses emulation
|
||||
18-feb-2012 - AnS - PATTERNS menu, loading data from "tools\taseditor_patterns.txt"
|
||||
18-feb-2012 - AnS - "Use pattern" checkbox in Recorder; Config->ColumnSet Pattern skips Lag
|
||||
18-feb-2012 - AnS - Taseditor: "Frame#" lights when Alt key is being held, not entering menu by Alt
|
||||
18-feb-2012 - AnS - Changed some checkboxes to radiobuttons in FCEUX menu
|
||||
13-feb-2012 - AnS - Taseditor: when clicking text fields, Piano Roll scrolls to corresponding Marker, not to cursor
|
||||
13-feb-2012 - AnS - Replay dialog speedup, now movie is not loaded into memory when checking md5
|
||||
06-feb-2012 - AnS - new Lua scripts: SoundDisplay.lua, TrackNoise.lua
|
||||
06-feb-2012 - AnS - refined Recording, now can safely record commands (Power, Reset, Insert, Switch)
|
||||
02-feb-2012 - AnS - uploaded HelpNDoc3 project file
|
||||
02-feb-2012 - AnS - added Lua scripts demonstrating some TAS Editor library functions
|
||||
02-feb-2012 - AnS - new Lua function in TAS Editor library: getsuperimpose()
|
||||
02-feb-2012 - AnS - new Lua function in Joypad library: getimmediate()
|
||||
30-jan-2012 - AnS - Taseditor: 9 new Lua functions in TAS Editor library
|
||||
30-jan-2012 - AnS - Taseditor: Added "Restore Playback (TAS Editor)" hotkey (Enter by default)
|
||||
30-jan-2012 - AnS - Taseditor: Help->Show Tooltips
|
||||
30-jan-2012 - AnS - Taseditor: quicksave/quickload hotkeys save/load current branch
|
||||
23-jan-2012 - prg - sdl: pause will now show/ungrab cursor in fullscreen. this can be disabled with the SDL.NoFullscreenCursor option
|
||||
12-jan-2012 - AnS - Tasedit: File->New Project, INPUT_TYPE_1P
|
||||
12-jan-2012 - AnS - Tasedit: resizing TAS Editor window
|
||||
08-jan-2012 - prg - sdl: switched advance one frame key from "\" to "`"
|
||||
08-jan-2012 - AnS - changed default mapping of Frame Advance to Tilde
|
||||
08-jan-2012 - AnS - fixed recording bug where "length" tag appeared in fm2s
|
||||
08-jan-2012 - AnS - Tasedit: Lua panel; 5 new Lua functions
|
||||
08-jan-2012 - AnS - Tasedit: refactoring; Config->Silent autosave
|
||||
04-jan-2012 - AnS - Tasedit: colored marker captions; pale yellow and bright yellow when "Bind Markers" is off/on
|
||||
27-dec-2011 - AnS - Tasedit: "About" window
|
||||
27-dec-2011 - AnS - Tasedit: searching Markers with similar Notes ("Similar" and "More" buttons)
|
||||
26-dec-2011 - AnS - Tasedit: Find Note dialog (Ctrl-F)
|
||||
26-dec-2011 - AnS - new Lua functions (TAS Editor library)
|
||||
19-dec-2011 - AnS - Tasedit: listview header lights
|
||||
19-dec-2011 - AnS - Tasedit: Recording checkbox instead of radiobutton; Config->Use Input keys for ColumnSet
|
||||
19-dec-2011 - AnS - Tasedit: Export dialog: "Convert Marker Notes to Movie Subtitles"
|
||||
16-dec-2011 - AnS - Tasedit: new accelerators: Ctrl-PgUp/Ctrl-PgDn/Shift-PgUp/Shift-PgDn; Config->Allow keyboard controls in Listview
|
||||
16-dec-2011 - AnS - Tasedit: View->Display Branch Tooltips
|
||||
16-dec-2011 - AnS - Tasedit: Markers notes; View->Follow Marker Note context
|
||||
16-dec-2011 - AnS - changed ".tas" extension to ".fm3"
|
||||
10-dec-2011 - AnS - loading TAS Editor projects by drag-n-drop
|
||||
10-dec-2011 - AnS - Tasedit: File->Save Compact dialog
|
||||
09-dec-2011 - AnS - Replaying TAS Editor project files in FCEUX (win32 and SDL)
|
||||
07-dec-2011 - AnS - disabled changing PPU/PAL/input_type when Taseditor is engaged
|
||||
07-dec-2011 - AnS - Tasedit: File->Recent projects
|
||||
07-dec-2011 - AnS - enhanced Reload hotkey (Ctrl-F1), now it loads last ROM or last TAS Editor project
|
||||
05-dec-2011 - AnS - Tasedit: Import input, Export to FM2
|
||||
04-dec-2011 - AnS - Tasedit: branches autofind best parent, "Set Marker"/"Remove marker" in context menu, checking clipboard at selection.init() and retrieving info
|
||||
29-nov-2011 - AnS - Tasedit: MsgBox about not working with movies starting from savestate
|
||||
26-nov-2011 - aquanull - win32: fixed graphic-tearing WITH vertical sync enabled in windowed mode. It used to wait for V-Blank too early so that the V-Blank would end too soon before the blitting could be finished.
|
||||
26-nov-2011 - AnS - Fixed crash when using machine with no sound card
|
||||
26-nov-2011 - zeromus - Fixed wrong default palette entry
|
||||
25-nov-2011 - zeromus - add nestopia palette files
|
||||
25-nov-2011 - AnS - Tasedit: selection << and >>, Turbo Seek checkbox, PasteInsert, Config->Superimpose affects copy/paste, Editing info texts
|
||||
23-nov-2011 - zeromus - fix [3441099] printf bug in SwapSaveState()
|
||||
21-nov-2011 - AnS - Tasedit: multitrack recording, "Superimpose" checkbox, Config->Use 1P keys for all single recordings, Config->Combine consecutive Recordings
|
||||
19-nov-2011 - AnS - Tasedit: selection strobe, soft reset and power switch messages, messages when saving/loading Branches
|
||||
17-nov-2011 - AnS - Tasedit: selection history, undo/redo, Reselect Clipboard, saving/loading selection history to .tas
|
||||
17-nov-2011 - AnS - Tasedit: input hotchanges
|
||||
14-nov-2011 - zeromus - straighten out bandai m159/m016 handling and add valid null-EEPROM emulation to get those games booting.
|
||||
12-nov-2011 - adelikat - win32 - cheat search - slight GUI tweak
|
||||
12-nov-2011 - AnS - Tasedit: project autosaving
|
||||
10-nov-2011 - AnS - Tasedit: Branches show saved screenshot on mouseover (alpha-fade popup window)
|
||||
7-nov-2011 - AnS - Tasedit: Drawing Branches Tree (using GDI), animations, transitions, mouseover
|
||||
04-nov-2011 - prg318 - gtk: added option for frameskipping and made label case consistent in gui
|
||||
1-nov-2011 - zeromus - debugger - fix mysterious out of bounds condition while editing breakpoints
|
||||
31-oct-2011 - zeromus - add winapi lua library
|
||||
31-oct-2011 - zeromus - fix newppu bug; chr ram was not getting initialized to anything
|
||||
28-oct-2011 - AnS - Switching Tasedit Bg input on/off when Tasedit gets/loses focus
|
||||
27-oct-2011 - AnS - "Toggle Rerecord Display" hotkey (M), "Play Movie From Beginning" hotkey also works in Tasedit
|
||||
27-oct-2011 - AnS - Tasedit: Bookmarks/Branches
|
||||
23-oct-2011 - prg318 - sdl: fix a bug where alt key would get "stuck" when alt tabbing to window
|
||||
21-oct-2011 - AnS - Tasedit: gradual greenzone cleaning
|
||||
19-oct-2011 - prg318 - scons: "scons install" now installs auxlib and manpage
|
||||
19-oct-2011 - prg318 - scons: added --prefix option to build system and improved "install" target
|
||||
18-oct-2011 - prg318 - sdl: new hotkeys added - statestatenext savestateprev - useful for scrolling through savestates on a gamepad. mapped to pgup and pgdown by default
|
||||
18-oct-2011 - prg318 - gtk: new video option for double buffering and ClipSides
|
||||
18-oct-2011 - prg318 - sdl: GTK3 support is now functional. Set GTK3 to 1 in the SConstruct to try it out.
|
||||
18-oct-2011 - prg318 - no longer use depreciated gtk2 functions
|
||||
18-oct-2011 - prg318 - getSDLKey tool added to assist in remapping hotkeys
|
||||
17-oct-2011 - prg318 - some segfaults fixed, also fixed some build errors
|
||||
17-oct-2011 - prg318 - sdl netplay fixed
|
||||
15-oct-2011 - zeromus - don't lose cheat compare value when toggle cheat enables through UI
|
||||
14-oct-2011 - AnS - added rewind hotkey (~), works only in Taseditor
|
||||
14-oct-2011 - AnS - Tasedit: execute lua functions when jumping inside greenzone
|
||||
13-oct-2011 - AnS - Tasedit: major refactoring
|
||||
9-oct-2011 - AnS - Tasedit: input history, undo, redo; greenzone reduces only from the point where actual differences were found
|
||||
07-oct-2011 - prg318 - sdl: fixed some issues with --nogui . "--nogui" no longer requires an argument and can be used like this "$ fceux --nogui rom.nes"
|
||||
07-oct-2011 - prg318 - gtk: support mouseclicks (ie zapper)
|
||||
03-oct-2011 - AnS - Tasedit: Clone Frame(s)
|
||||
02-oct-2011 - AnS - Tasedit: Markers
|
||||
30-sept-2011 - AnS - logging all display messages to Message Log
|
||||
30-sept-2011 - AnS - Tasedit: special method of inserting frames; progressbar updating when loading/saving large projects; moved "Follow cursor" checkbox from View menu to main TASEdit window
|
||||
30-sept-2011 - AnS - Tasedit: View->Show dot in empty cells; ClearFrames (Del), Cut operation clears frames instead of deleting; checking unsaved project on Exit and Open project
|
||||
28-sept-2011 - CaH4e3 - resetexstate crash fix
|
||||
27-sept-2011 - AnS - Fixed old bug with "Play Movie From Beginning"
|
||||
26-sept-2011 - AnS - added support for "Enable HUD recording" option to SDL version
|
||||
25-sept-2011 - AnS - Tasedit: progressbar; holding "<" and ">" buttons
|
||||
25-sept-2011 - zeromus - newppu-fix bug in scroll reg logic causing mis-scrolls in p'radikus conflict
|
||||
24-sept-2011 - CaH4e3 - latest mapper changes; code/data logger now can log data access from the RAM code; the new button to save unused data to the code/data logger
|
||||
24-sept-2011 - AnS - Tasedit: changed control scheme to single click instead of double click
|
||||
23-sept-2011 - AnS - File->AVI/Wav->Enable HUD recording
|
||||
23-sept-2011 - AnS - moved "Display movie status icon" from Config->Movie options to Config->Display
|
||||
23-sept-2011 - AnS - Config->Display->Rerecord counter; no more TweakCount
|
||||
23-sept-2011 - AnS - Config->Movie options->Always suggest Read-Only replay (for Replay dialog)
|
||||
22-sept-2011 - AnS - deleted "Lag Counter Reset" hotkey; added "Open TAS Edit" hotkey
|
||||
22-sept-2011 - AnS - fixed long "savestate" messages containing path
|
||||
22-sept-2011 - AnS - Tasedit: auto clear "Disable speed throttling" and "Run in background", auto set "Set high-priority thread" when entering TASEdit; FCEUX runs in bg when TASEdit has focus; Config->"Mute Turbo" check
|
||||
19-sept-2011 - AnS - Tasedit: accelerator table; Config->"Set greenzone capacity"; pauseframe is shown by flashing color
|
||||
18-sept-2011 - zeromus - datalatch mapper-fix bug where wramless games would be able to do something mysterious to unmapped host emulator memory
|
||||
17-sept-2011 - AnS - Tasedit: forced read-only behaviour when seeking or holding turbo
|
||||
17-sept-2011 - AnS - Tasedit: "Auto-restore last position" checkbox in playback controls
|
||||
17-sept-2011 - AnS - Tasedit: fixed item drawing method, no more flicker and slowdowns
|
||||
12-sept-2011 - prg318 - sdl: rename InputType to CurInputType due to variable of same name in src/movie.h
|
||||
12-sept-2011 - AnS - Tasedit: rewrote project save/load functions, various bugfixes
|
||||
6-sept-2011 - AnS - Tasedit: red lines for lag frames
|
||||
6-sept-2011 - AnS - fixed bug when trying to open Replay dialog without having ROM loaded
|
||||
3-sept-2011 - AnS - Tasedit: tweaks and bugfixes
|
||||
3-sept-2011 - CaH4e3 - fixed bus conflict emulation, no kage no densetsu bug anymore
|
||||
31-Aug-2011 - AnS - Tasedit: Added 4 pads support; also now current frame is shown by blue line; minor cleanups
|
||||
30-Aug-2011 - mart0258 - Ram Search updates list when emulator is paused (on Power, or when resetting search)
|
||||
25-Aug-2011 - zeromus - win32: fix context menus to use rightclicks in context menus correctly
|
||||
19-Aug-2011 - CaH4e3 - PAL/NTSC noise fixed
|
||||
18-Jul-2011 - zeromus - slightly improve hud text rendering wrapping
|
||||
16-Jul-2011 - adelikat - Add Button Count lua script written by Brandon Evans
|
||||
15-Jul-2011 - prg318 - sdl: patch to resolve 'XKeysymToString' complication errors on debian sid and osx (thanks antonio ospite!)
|
||||
6-Jul-2011 - plombo - sdl: fixed --nogui option and removed SDL.NoGUI from fceux.cfg
|
||||
5-Jul-2011 - FatRatKnight - Lua console now gets the proper file path when selecting a file from the recent menu.
|
||||
|
||||
---r2206 - FCEUX 2.1.5 Released---
|
||||
---June 21 2011---
|
||||
|
||||
16-Jun-2011 - zeromus - win32: poll hotkeys while no rom is loaded
|
||||
1-jun-2011 - prg318 - sdl - print usage when --help is passed even if SDL fails
|
||||
plombo - added stock icons to menu items
|
||||
plombo - added new gamepad configuration dialog
|
||||
19-mar-2011 - prg318 - gtk - added hard reset option (renamed reset->soft reset)
|
||||
18-mar-2011 - prg318 - sdl - removed GTK_LITE; --nogui made it obsolete
|
||||
12-feb-2010 - mart0258 - Fix input selection for Famicom Expansion port
|
||||
25-jan-2010 - prg318 - gtk - filechooser now remembers last file opened
|
||||
25-jan-2010 - prg318 - gtk - fixed xscale/yscale spinbuttons not changing config
|
||||
24-jan-2010 - prg318 - gtk - game window integrated into sdl window (thanks bryan!)
|
||||
11-nov-2010 - mart0258 - TasEdit - Invalidate greenzone when re-recording earlier portions of a movie.
|
||||
09-oct-2010 - zeromus - fix bug in new ppu that made some intensify bits not get applied to output (fixes flashing siren screen in werefolf
|
||||
09-oct-2010 - gocha - win32 - Ram Watch - fix the multiple selection of watches
|
||||
09-oct-2010 - gocha - Win32 - Ram Search - multiple selection of addresses, fix restoration of the selection range
|
||||
09-oct-2010 - gocha - Win32 - Ram Search - fix restoration of the selection range
|
||||
01-oct-2010 - qeed - Fix many segfaults related to file handling
|
||||
22-sept-2010 - adelikat - win32 - Hex Editor - ask before removing all bookmarks
|
||||
04-sept-2010 - adelikat - Win32 - Ramwatch - fix displaying of 2 byte values
|
||||
26-aug-2010 - mart0258 - Win32 - fix crash when re-opening debugging window
|
||||
20-aug-2010 - adelikat - Win32 - Display movie name at the top of the main window
|
||||
09-july-2010 - mart0258 - TasEdit - cleanup; prevent crash when truncating while turbo
|
||||
13-june-2010 - adelikat - Win32 - avi capture commandline argument and related parameters
|
||||
12-june-2010 - adelikat - Save Turbo frame skip amount to config so that it can be customized by user
|
||||
12-june-2010 - adelikat - Lua - fix speed.mode() so that normal turns off turbo
|
||||
12-june-2010 - CaH4e3 - Fix Young Indiana Jones Chronicals
|
||||
10-june-2010 - Deign - Fix Ram Search to only display valid RAM addresses (0000-07FF and 6000-7FFF)
|
||||
10-june-2010 - zeromus - add luasocket to built in lua library
|
||||
09-june-2010 - adelikat - Movies - Fixed read-only loadstate error logic & messages
|
||||
07-june-2010 - mart0258 - Movie loading now faster - TAS savestates moved from class MovieRecord to class MovieData
|
||||
07-june-2010 - adelikat - Lua - new function: gui.screenshotas()
|
||||
07-june-2010 - Deign/adelikat - Win32 - Added a SavestateAs Menu item
|
||||
06-june-2010 - FatRatKnight - Added a return value to gui.text: The X position where the function would paint the next character.
|
||||
02-june-2010 - adelikat - Win32 - Movie Options Dialog - Fix so Full Savestate Load checkbox is updated on load
|
||||
|
||||
---r1984 - FCEUX 2.1.4a Released---
|
||||
---June 1 2010---
|
||||
|
||||
01-june-2010 - zeromus - fix crash bug in fcm convert
|
||||
01-june-2010 - adelikat - fix logic error in read-only loadstate of movies, should not improperly report savestate after movie errors
|
||||
|
||||
---r1977 - FCEUX 2.1.4 Released---
|
||||
---May 31 2010---
|
||||
|
||||
29-may-2010 - Cah4e3 - Added zapper autodetection for Gotcha!
|
||||
28-may-2010 - adelikat - Added lua function movie.getfilename() which returns the current movie filename without the path included
|
||||
27-may-2010 - ugetab - Win32 - Debugger - Made debugger able to break on and distinguish Stack reads/writes
|
||||
24-may-2010 - adelikat - Win32 - Memwatch - ignore spaces at the beginnign of an address in the address boxes
|
||||
24-may-2010 - mart0258 - Disable auto-savestates during turbo
|
||||
24-may-2010 - mart0258 - Prevent .zip files containing no recognized files from causing crash
|
||||
23-may-2010 - adelikat - Win32 - Replay dialog - fix bug that was causing it to always report savestate movies as soft-reset
|
||||
23-may-2010 - adelikat - Fix PlayMovieFromBeginning when using a movie that starts from savestate
|
||||
23-may-2010 - cah4e3 - mapper 19 savestate fix mirroring for "Dream Master (J)" corrected to "four-screen" by CRC check
|
||||
23-may-2010 - ugetab - Win32 - Fixed bug involving pausing emulation outside of the debugger, then trying to use the debugger commands, and having teh CPU registers become corrupted.
|
||||
22-may-2010 - ugetab - Win32 - Made cheat menu's Pause When Active effect immediate.
|
||||
22-may-2010 - ugetab - Win32 - Enabled multi-select for Cheat menu to allow multiple toggles and deletes.
|
||||
20-may-2010 - ugetab - Added NTSC 2x scalar option with some CFG config options of it's own
|
||||
20-may-2010 - Cah4e3 - Win32 - CDLogger - fixed bug preventing correct interrupt vectors from logging
|
||||
19-may-2010 - ugetab/adelikat - Win32 - Added single-instance mode, which makes starting a second copy of FCEUX load the file into the first, then exit.Mode off by default, togglable under Config -> GUI
|
||||
18-may-2010 - adelikat - Movie + loadstate errors are handled more gracefully now, more informative error messages and the movie doesn't have to stop
|
||||
18-may-2010 - adelikat - Implemented a "full savestate-movie load" mode similar to the implementation in VBA-rr & SNES9x-rr. In this mode loading a savestate in read+write doesn't truncate the movie to its frame count immediately. Instead it waits until input is recording into the movie (next frame). For win32 this feature is togglable in movie options and the context menu. For SDL this is off by default and a toggle will need to be added.
|
||||
17-may-2010 - adelikat - Made gamepad 2 off by default.
|
||||
17-may-2010 - adelikat - Movies - fully implemented "bulletproof" read-only
|
||||
17-may-2010 - zeromus - Movie loading (& movie-savestate saving/loading) should now be faster due to the use of a emufile class instead of std::ostream for dumping
|
||||
16-may-2010 - ugetab - Added player 3 and 4 to autohold notification window. Made FCEU_DispMessage able to display to different screen locations to do it. Made sure to update SDL with the change. Hope SDL still compiles ok.
|
||||
15-may-2010 - ugetab - Win32 - Added option for palette selection as color for LUA colors. Included an LUA script to display all choices with the value used to pick displayed color.
|
||||
14-may-2010 - adelikat - Win32 - Replay dialog, when selecting a movie in a relative path (.\movies for example), the recent movies list stores an absolute path instead.
|
||||
14-may-2010 - adelikat - Win32 - When recording a movie, add it to recent movies
|
||||
14-may-2010 - adelikat - Win32 - Replay dialog shows PAL flag & New PPU flag
|
||||
14-may-2010 - adelikat - New PPU flag in movie headers (doesn't change an emulators PPU state when loading a movie)
|
||||
13-may-2010 - adelikat - input display overhaul - a more desmume style system which shows both keys held the previous frame and immiately held keys that will be put in on the next frame
|
||||
12-may-2010 - ugetab - Win32 - Added rudamentry Between-Frames input display code for adelikat to customize.
|
||||
12-may-2010 - adelikat - Input Display - displays a silver color when input is from a movie rather than the user
|
||||
12-may-2010 - ugetab - Win32 - With special scaler in window mode, it's possible to resize to anything above the minimum.
|
||||
12-may-2010 - adelikat - Movies now have a "finished" option. If a playback stops the movie isn't cleared from memory, and can be replayed or a state loaded. Similar functionality as DeSmuME and GENS rerecording
|
||||
11-may-2010 - adelikat - Loadstate updates input display
|
||||
11-may-2010 - ugetab - Win32 - Added Ram Search hotkeys for the first 6 search types in the list.
|
||||
10-may-2010 - ugetab - Added gui.getpixel() which gets any gui.pixel() set pixel colors, and possibly other functions. Added emu.getscreenpixel() which gets the RGB and Palette of any pixel on the screen.
|
||||
08-may-2010 - ugetab - Added savestate.object() which is savestate.create() with intuitive numbering under windows
|
||||
08-may-2010 - ugetab - Added emu.addgamegenie() and emu.delgamegenie() LUA functions.
|
||||
07-may-2010 - ugetab - Win32 - Added context menu to Cheat Dialog Cheat Listbox, populated list with Toggle Cheat, Poke Cheat Value, and Goto In Hex Editor
|
||||
07-may-2010 - ugetab - Win32 - Made enabling/disabling cheats no longer deselect the selected cheat.
|
||||
06-may-2010 - ugetab - win32 - Add Cheat buttons for Ram Search and Ram Watch
|
||||
06-may-2010 - ugetab - win32 - Hex editor - Made the Hex Editor display the Frozen, Bookmarked, etc. status of the selected address, and made the Frozen color override the Bookmarked color.
|
||||
04-may-2010 - ugetab - Win32 - Added "Goto" command for hex editor.
|
||||
28-april-2010 - ugetab - Added microphone support option. When enabled, Port 2 Start activates the Microphone. Movies also support this.
|
||||
25-april-2010 - FatRatKnight - Fixed a potential desync that plays out an extra frame without an update to the frame count involving heavy lua use, joypad.get, and a loadstate.
|
||||
23-april-2010 - ugetab - Win32 - Added Tools>GUI option to partially disable visual themes, so the emulator can be made to look like it did in 2.1.1 and earlier releases.
|
||||
20-april-2010 - adelikat - New lua functions movie.ispoweron() and movie.isfromsavestate()
|
||||
20-april-2010 - adelikat - Win32 - Drag & Drop - if dropping a .fcm with no ROM loaded, prompt for one (same functionality that was added to .fm2 files)
|
||||
08-april-2010 - ugetab - Win32 - Added conditional debugging option 'K', for bank PC is on
|
||||
07-april-2010 - adelikat - fix bug that caused zapper.read() to crash when movie playback ends
|
||||
|
||||
---r1767 - FCEUX 2.1.3 Released---
|
||||
---April 7 2010---
|
||||
|
||||
07-april-2010 - sgrunt - Lua - gui.text now has out of bounds checking
|
||||
07-april-2010 - adelikat - Win32 - Lua console - filename updates when lua scripts are dragged to emulator or recent filenames invoked
|
||||
07-april-2010 - adelikat - Lua no longer unpauses the emulator when a script is loaded
|
||||
30-march-2010 - ugetab - Win32 - Closing minimized windows no longer moves them the next time they get opened
|
||||
28-march-2010 - adelikat - lua - fixed zapper.read() to read movie data if a movie is playing. Also changed the struct values to x,y,fire. This breaks lua scripts that used it previous, sorry.
|
||||
04-march-2010 - prockguy - added menu buttons for loading nsf files
|
||||
03-march-2010 - adelikat - Win32 - If .fm2 drag & dropped with no ROM load, the open ROM dialog will appear
|
||||
03-march-2010 - prockguy - fceux - now prints the name of the mapper on rom load
|
||||
03-march-2010 - prockguy - SDL - VS unisystem keys now configable
|
||||
03-march-2010 - prcokguy - SDL - changed default hotkeys and keys to match w32
|
||||
03-march-2010 - prockguy - SDL - fixed dpad/joyhat support
|
||||
01-march-2010 - adelikat - Movie file format header now has a FDS flag
|
||||
01-march-2010 - adelikat - win32 - cheats dialog - toggling a cheat in the cheats list now updates the active cheats count
|
||||
01-march-2010 - adelikat - win32 - a disable movie messages menu item
|
||||
25-feb-2010 - prockguy - unix netplay is now functional; gtk network gui created
|
||||
24-feb-2010 - prockguy - GTK - added basic movie controls
|
||||
24-feb-2010 - prockguy - GTK - added file filters; added Load FDS function
|
||||
24-feb-2010 - prockguy - GTK - added palette config dialog
|
||||
23-feb-2010 - prockguy - GTK - added UI elemnts for x/y scale; added lowpass UI option
|
||||
23-feb-2010 - prockguy - GTK - added GUI for color/tint/hue
|
||||
23-feb-2010 - prockguy - GTK - implemented sound mixer dialog (for square1, 2, triangle, etc)
|
||||
22-feb-2010 - prockguy - SDL - ported to SDL 1.3; compatibility maintained with 1.2
|
||||
18-feb-2010 - prockguy - GTK - a lot of options added to GTK gui; relatively stable; added GUI for gamepad config and sound config.
|
||||
02-feb-2010 - ugetab - Win32 - Added window positions bounds checks. Accounts for -32000 positions & less out-of-range too
|
||||
08-jan-2010 - rheiny - Win32 - Trace Logger - Trace logger now logs the values of the stack pointer register
|
||||
31-dec-2009 - prg318 - added gtk gui
|
||||
08-dec-2009 - Zeromus - Fix Name Table Viewer - Fix for use with New PPU
|
||||
08-dec-2009 - - mart0258 - FDS - show name of missing bios file in error message
|
||||
07-dec-2009 - qeed - NewPPU - fixed sprite hit before 255 and for non transparent hits only, thanks to dwedit for providing the fix
|
||||
06-dec-2009 - Zeromus - SDL - disallow --inputcfg gamepad0 and gamepad5
|
||||
??-???-2009 - CaH4e3 - fixed mappers 82, 25, 21, and 18. Games such as SD Kiji Blader, Ganbare Goemon Gaiden, and Ganbare Goemon Gaiden 2, Jajamaru Gekimadden are now playable
|
||||
17-nov-2009 - adelikat - Win32 - Cheats - Pause while active checkbox installed
|
||||
17-nov-2009 - adelikat - Win32 - Fix debug window so it doesn't crash if unminimized with no game loaded.
|
||||
13-nov-2009 - mart0258 - Win32 - TASEdit - Added interface functionality (save/load, running TASEdit mid-movie, etc.)
|
||||
13-nov-2009 - adelikat - made savestate compression togglable
|
||||
13-nov-2009 - adelikat - made savestate backups togglable
|
||||
08-nov-2009 - gocha - Win32 - Lua console - added a menu
|
||||
08-nov-2009 - gocha - change gui.line, gui.box, joypad.get to function like GENS rerecording
|
||||
08-nov-2009 - gocha - New lua functions: gui.parsecolor, joypad.getup, joypad.getdown, emu.emulating.
|
||||
08-nov-2009 - CaH4e3 - Fixes for mappers 253 & 226 - fixes games such as Fire Emblem (J) and Fire Emblem Gaiden (J)
|
||||
08-nov-2009 - CaH4e3 - Fix crashing on game loading for any battery backed roms with mappers from MapInitTab (fixes Esper Dream 2 - Aratanaru Tatakai (J)
|
||||
04-nov-2009 - adelikat - win32 - debugger - added an auto-load feature
|
||||
|
||||
---r1527 - FCEUX 2.1.2 Released---
|
||||
---November 3, 2009---
|
||||
|
||||
02-nov-2009 - qeed - fixed mapper 226, 76-in-1 seems to work now, also super 42 also seems to work with this fix, but people with save states with this game should make a new one. Since the the save state format for this game was changed a little.
|
||||
31-oct-2009 - adelikat - win32 - Memwatch - Save Changes prompt - Selecting yes will do quicksave first, save as 2nd (instead of always defaulting to save as)
|
||||
19-oct-2009 - qeed - Mapper 253 mostly implemented, known game [ES-1064] Qi Long Zhu (C) is mostly playable (some minor graphic glitches). Thanks to VirtualNESEX for reverse engineering this, gil for giving me the mapper src for implementation reference, and Dead_Body for figuring out this game had to use chr-ram
|
||||
10-oct-2009 - qeed - fixed dragon's lair the mapper 4 europe version in new PPU
|
||||
10-oct-2009 - zeromus - fixed Tecmo Super Bowl in new PPU
|
||||
08-oct-2009 - ugetab - win32 - fixed a debugger crash error, Unif/FDS filename issue, and enabled debugger bank display
|
||||
01-oct-2009 - gocha - win32 - movie play dialog displays movie time based on ~60.1 (~50.1 PAL) instead of 60 & 50
|
||||
26-sept-2009 - qeed - fixed action 52 game that was broken in fceux >2.0.3
|
||||
16-sept-2009 - ugetab - win32 - Restored DPCM Logging when Code/Data Logger is active
|
||||
sept-2009 - FatRatKnight - Finally got in that "invert" value for joypad.set. This value simply inverts the player input. Actually, any string will invert it, since we have not used strings for anything else in joypad.set.
|
||||
15-sept-2009 - FatRatKnight - Reworked how input is taken from lua, and generally everything related to joypad.set and what it affects. Now setting stuff to false will: Prevent user control for exactly one frame, and allow more than one false button as a time. Yeah, bug fixes. Hopefully runs a little faster now.
|
||||
22-aug-2009 - adelikat - Win32 - Map Hotkeys Dialog - Fixed but where "X" and Alt+F4 would not close dialog
|
||||
22-aug-2009 - adelikat - Win32 - Added a Save Config File menu item
|
||||
12-aug-2009 - adelikat - Win32 - Added a menu item to toggle to New PPU
|
||||
10-aug-2009 - adelikat - fixed bug that caused new movies be created in /movie instead of /movies
|
||||
08-aug-2009 - qeed - mappers - fixed mapper irq count, dragon ball z 3
|
||||
should be playable again.
|
||||
07-aug-2009 - ugetab - win32 - imported NSF features from FCEU-XDSP-NSF
|
||||
05-aug-2009 - adelikat - win32 - fixed an erroneous assumption made in 2.1.1 that caused the recent roms menu to be grayed out even when there were recent roms (however, it uncovered an underlying bug in the recent menu saving that needs to be fixed at some point).
|
||||
|
||||
---r1375 - FCEUX 2.1.1---
|
||||
---July 29, 2009---
|
||||
|
||||
01-july-2009 - adelikat - win32 - texthooker - drag & drop for table files
|
||||
01-july-2009 - adelikat - win32 - drag & drop for cheat (.cht) files
|
||||
25-jun-2009 - qeed - sound/ppu - fixed the noise value, it seems that the noise logic was shifting the values to the left by 1 when reloading, but this doesnt work for PAL since one of the PAL reload value is odd, so fix the logic and used the old tables. Revert a stupid CPU ignore logic in PPU. Sorry about that.
|
||||
25-jun-2009 - adelikat - Win32 - CD Logger - Drag and Drop for .cdl files
|
||||
24-jun-2009 - qeed - sound/ppu - reverted to old noise table value since this seems to get correct sound for double
|
||||
dragon 2. Also added experimental $2004 reading support to play micro machines with (little) shakes, and fixed some
|
||||
timing in the new PPU.
|
||||
24-jun-2009 - adelikat - win32 - memory watch - option to bind to main window, if checked it gives GENS dialog style control, where there is no extra task bar item, and it minimizes when FCEUX is minimized
|
||||
24-jun-2009 - adelikat - win32 - palette commandline options
|
||||
24-jun-2009 - adelikat - win32 - Sound Dialog - cleanup, when sound is off, all controls are grayed out
|
||||
24-jun-2009 - adelikat - win32 - Hex Editor - Drag & Drop for .tbl files
|
||||
24-jun-2009 - adelikat - win32 - Drag & Drop for .fcm, it converts and then loads the converted movie automatically
|
||||
24-jun-2009 - adelikat - win32 - Drag & Drop support for palette files
|
||||
23-jun-2009 - adelikat - win32 - Drag & Drop support for savestates
|
||||
22-jun-2009 - qeed - Revert IRQ inhibit fix, since this seems to break Dragon
|
||||
Warrior 4, added palette reading cases for the new PPU.
|
||||
21-jun-2009 - adelikat - win32 - memwatch - save menu item is grayed if file hasn't changed
|
||||
20-jun-2009 - adelikat - win32 - memwatch - fixed a regression I made in 2.0.1 that broke the Save As menu item
|
||||
17-jun-2009 - qeed - Sound core fix, updated with the correct values for the noise and DMC table,
|
||||
and also fixed the IRQ inhibit behavior for register $4017. Also fixed the CPU
|
||||
unofficial opcode ATX, ORing with correct constant $FF instead of $EE, as tested
|
||||
by blargg's. These fixes passes the IRQ flags test from blargg, and also one more
|
||||
opcode test from blargg's cpu.nes test.
|
||||
16-jun-2009 - adelikat - sound core fix - square 1 & square 2 volume controls no longer backwards
|
||||
11-jun-2009 - zeromus - sound core fix, length counters for APU now correct variables
|
||||
11-jun-2009 - adelikat - Win32 - Hex Editor - changed ROM values again dsiplay as red, saved in the config as RomFreezeColor
|
||||
06-jun-2009 - rheiny - Fixed reported issue 2746924 (md5_asciistr() doesn't produce correct string)
|
||||
23-may-2009 - adelikat - win32 - hex editor - freeze/unfreeze ram addresses now causes the colors to update immediately, but only with groups of addresses highlighted at once (single ones still don't yet update)
|
||||
23-may-2009 - adelikat - win32 - context menu - Save Movie As... menu item (for when a movie is loaded in read+write mode)
|
||||
23-may-2009 - adelikat - win32 - added opton to remove a recent item to the roms, lua, and movie recent menus
|
||||
23-may-2009 - adelikat - win32 - Added a remove recent item function and hooked it up to memwatch recent menu, now if a bad recent item is clicked, the user has a choice to remove it from the list
|
||||
23-may-2009 - adelikat - win32 - Load Last Movie context menu item added
|
||||
23-may-2009 - adelikat - win32 - Recent Movie Menu added
|
||||
22-may-2009 - adelikat - win32 - "Disable screen saver" gui option now also diables the monitor powersave
|
||||
22-may-2009 - adelikat - win32 - Debugger - Step type functions now update other dialogs such as ppu, nametable, code/data, trace logger, etc.
|
||||
22-may-2009 - adelikat - win32 - Hex Editor - Save Rom As... menu option enabled and implemented
|
||||
22-may-2009 - adelikat - win32 - Window caption shows the name of the ROM loaded
|
||||
22-may-2009 - adelikat - win32 - Hex Editor - allowed the user to customize the color scheme by use of RGB values stored in the .cfg file
|
||||
21-may-2009 - adelikat - win32 - reverted fixedFontHeight to 13 instead of 14. Gave the option of adjusting the height by modifying RowHeightBorder in the .cfg file
|
||||
21-may-2009 - adelikat - win32 - made fullscreen toggle (Alt+Enter) remappable
|
||||
15-may-2009 - shinydoofy - sdl - added --subtitles
|
||||
10-may-2009 - shinydoofy - sdl - fixed Four Score movie playback
|
||||
02-may-2009 - adelikat - win32 - stop movie at frame x feature - fixed off by 1 error
|
||||
23-apr-2009 - shinydoofy - sdl - added --ripsubs for converting fm2 movie subtitles to an srt file
|
||||
15-apr-2009 - shinydoofy - sdl - Lua is optional again, fixed the real issue
|
||||
14-apr-2009 - punkrockguy - sdl - LUA is NO longer optional, so the SConscripts have been updated to reflect that change. This fixes the mysterious non-working input issue.
|
||||
12-apr-2009 - shinydoofy - sdl - implemented saving/loading a savestate from a specific file on Alt+S/L
|
||||
11-apr-2009 - shinydoofy - sdl - implemented starting an FM2 movie on Alt+R
|
||||
11-apr-2009 - adelikat - made default save slot 0 instead of 1, Win32 - remember last slot used
|
||||
11-apr-2009 - shinydoofy - sdl - added --pauseframe to pause movie playback on frame x
|
||||
11-apr-2009 - shinydoofy - sdl - dropped UTFConverter.c from SDL build and added hotkey Q for toggling read-only/read+write movie playback
|
||||
|
||||
--version 2.1.0a released----
|
||||
04-apr-2009 - shinydoofy - fixed fcm->fm2 code once again (this time for good, hopefully). Thanks to Bisqwit!
|
||||
04-apr-2009 - shinydoofy - Reverted UTF8<->UTF32 code changes to fix up the win32 build for now
|
||||
|
||||
---version 2.1.0 released---
|
||||
29-mar-2009 - adelikat - Win32 - reverted acmlm's /dll folder change
|
||||
28-mar-2009 - shinydoofy - sdl - added hotkey Del to toggle mute avi capturing
|
||||
28-mar-2009 - shinydoofy - sdl - fix fm2 playback and fcm->fm2 conversion crash at the cost of ugly 0x00 bytes behind the author's comment line
|
||||
28-mar-2009 - adelikat - Lua - added FCEU.poweron() and FCEU.softreset()
|
||||
27-mar-2009 - shinydoofy - sdl - added --no-config
|
||||
23-mar-2009 - adelikat - Win32 - blocked "hotkey explosion" by rshift on some laptops
|
||||
22-mar-2009 - shinydoofy - sdl - added hotkey I and --inputdisplay {0|1|2|4} for toggling input display.
|
||||
22-mar-2009 - shinydoofy - sdl - added commandline options for sound channels' volumes
|
||||
22-mar-2009 - shinydoofy - sdl - updated window title
|
||||
19-mar-2009 - adelikat - Win32 - make Video - windowed mode - disable hardware accel the default setting. Made high quality sound the default setting.
|
||||
16-mar-2009 - adelikat - Win32 - GUI Dialog - added an option to disable the context menu
|
||||
15-mar-2009 - adelikat - Lua - added movie.rerecordcount(), movie.length(), movie.getname(), movie.playbeginning(), FCEU.getreadonly(), FCEU.setreadonly()
|
||||
14-mar-2009 - adelikat - Lua - added movie.active() - returns a bool value based on whether a movie is currently loaded
|
||||
14-mar-2009 - adelikat - Fixed Joypad.set, it uses 3 values instead of 2 now. True will take control of a button and make it on, False will take control and make it off, and Nil will not take control (allowing the user to press the button)
|
||||
14-mar-2009 - adelikat - Fix major crash issue where NROM game savestates were writing erroneous information if a non NROM game was loaded prior
|
||||
13-mar-2009 - adelikat - Closing game / Opening new game resets the frame counter
|
||||
13-mar-2009 - adelikat - Win32 - Debugger - Scanlines and PPU Pixels are displayed even in vblank (lines 240-261)
|
||||
12-mar-2009 - shinydoofy - sdl - fixed compilation error and reactivated the mouse pointer in the SDL window
|
||||
12-mar-2009 - adelikat - Win32 - Trace Logger - fixed bug where user can't scroll the log window while it is auto-updating
|
||||
11-mar-2009 - adelikat - Win32 - Trace Logger - changed message about F2 pause (left over from FCEUXDSP) to display the current hotkey mapping
|
||||
11-mar-2009 - adelikat - Added frame counter to savestates
|
||||
08-mar-2009 - adelikat - Lua - added input.get() function
|
||||
08-mar-2009 - adelikat - Lua - memory.readbyte will recognize frozen addresses
|
||||
08-mar-2009 - adelikat - Lua - added FCEU.lagged() function
|
||||
08-mar-2009 - adelikat - Lua - added zapper.read() function
|
||||
07-mar-2009 - adelikat - Lua - added FCEU.lagcount() function
|
||||
04-mar-2009 - adelikat - win32 - Fix bug so that Escape can now be assigned as a hotkey
|
||||
03-mar-2009 - adelikat - win32 - Fix Directory Overrides so to allow users to have no override. Also fixes directory override reset bug
|
||||
02-mar-2009 - adelikat - win32 - Drag & Drop for Memwatch dialog (.txt files)
|
||||
01-mar-2009 - adelikat - win32 - Drag & Drop Lua files
|
||||
25-feb-2009 - adelikat - win32 - Memwatch - added cancel to save changes? message box
|
||||
22-feb-2009 - adelikat - win32 - Lua - made speedmode("turbo") turn on turbo (which employs frameskipping) rather than max speed
|
||||
22-feb-2009 - adelikat - Increased lua gui.text height (and DrawTextTransWH() height)
|
||||
21-feb-2009 - adelikat - win32 - Lua - Added -lua commandline argment, loads a lua script on startup
|
||||
21-feb-2009 - adelikat - win32 - Debugger - Added pixel display after scanline display - Thanks to DWEdit for this patch
|
||||
21-feb-2009 - adelikat - win32 - Debugger - Added Run Line, Run 128 Lines buttons - Thanks to DWEdit for this patch
|
||||
21-feb-2009 - adelikat - win32 - Message Log - remembers X,Y position
|
||||
19-feb-2009 - adelikat - win32 - Memory Watch - fixed recent file menu - no longer crashes when attempting to load a non existent recent file
|
||||
07-feb-2009 - adelikat - win32 - Fix bug in screenshot numbering that caused numbering to not reset when changing ROMs
|
||||
06-feb-2009 - adelikat - win32 - Hex editor - remembers window size
|
||||
06-feb-2009 - adelikat - Win32 - sound config dialog - added sliders for individual sound channel volume control
|
||||
06-feb-2009 - zeromus - Force processor affinity, fixes throttling problem on AMD dualcore machines
|
||||
06-feb-2009 - adelikat - Sound channels now have individual volume control
|
||||
01-jan-2009 - adelikat - Win32 - Timing - "disable throttling when sound is off" now only affects FCEUX when sound is off
|
||||
26-dec-2008 - adelikat - Metadata - remember window position
|
||||
24-dec-2008 - adelikat - auto-save fixes, prevent loading an auto-save from previous session. Win32 - added flags for enabling auto-save menu item.
|
||||
24-dec-2008 - adelikat - added undo/redo savestate hotkey. Win32 - made undo/redo default key mapping Ctrl+Z
|
||||
24-dec-2008 - adelikat - win32 - added Last ROM used context menu item when no game loaded
|
||||
24-dec-2008 - shinydoofy - sdl - added option to mute FCEUX for avi capturing, check the docs for more detail
|
||||
23-dec-2008 - adelikat - Win32 - Undo/redo loadstate and Undo/redo savestate context menu items added
|
||||
23-dec-2008 - adelikat - undo/redo loadstate and undo/redo savestate implemented
|
||||
22-dec-2008 - adelikat - backupSavestate system added.
|
||||
22-dec-2008 - shinydoofy - sdl - added Shift+M for toggling automatic movie backups for SDL
|
||||
22-dec-2008 - adelikat - Movie auto-backup feature implemented
|
||||
22-dec-2008 - adelikat - win32 - moved movie related menu items to a movie options dialog box
|
||||
22-dec-2008 - adelikat - Win32 - context menu item "create backup" for backing up movie files
|
||||
21-dec-2008 - adelikat - Win32 - Name Table Viewer - Refresh value default to 15, Refresh value stored in config file
|
||||
21-dec-2008 - adelikat - Win32 - PPU Viewer - Refresh value default to 15, Refresh value stored in config file
|
||||
19-dec-2008 - adelikat - Loadbackup function added, Win32 - Undo Loadstate context menu item
|
||||
19-dec-2008 - adelikat - Backup savestate is made before loading a state
|
||||
18-dec-2008 - adelikat - win32 - turbo bypasses sound better if muteturbo is checked
|
||||
18-dec-2008 - shinydoofy - sdl - fixed compiling errors for SDL due to r1037
|
||||
18-dec-2008 - adelikat - win32 - fullscreen mode fixed (both enters and returns to fullscreen just fine)
|
||||
16-dec-2008 - adelikat - win32 - debugger - added "Restore original window size" button
|
||||
16-dec-2008 - adelikat - win32 - debugger - fixed SF2073113 - Debugger now has a minimum valid size
|
||||
15-dec-2008 - adelikat - win32 - cheats - number of active cheats listed, freezing ram addresses in hex editor automatically updates cheats dialog
|
||||
15-dec-2008 - adelikat - win32 - hexeditor - added minimize & maximize buttons
|
||||
14-dec-2008 - adelikat - win32 - memwatch - frozen addresses will display as blue
|
||||
14-dec-2008 - adelikat - win32 - hexeditor - prevent the user from freezing more than 256 addresses at once
|
||||
14-dec-2008 - adelikat - win32 - memwatch - collapsable to 1 column
|
||||
08-dec-2008 - adelikat - win32 - stop lua menu item gray if no lua script is running
|
||||
08-dec-2008 - adelikat - win32 - fix bug where no sound + mute turbo caused chirps when toggling
|
||||
08-dec-2008 - adelikat - win32 - sound dialog - disabling sound disabled sound options
|
||||
08-dec-2008 - adelikat - win32 - opening a rom runs closerom first, fixes bug where new sav file was not getting loaded
|
||||
07-dec-2008 - adelikat - win32 - turbo now employs frame skip
|
||||
30-nov-2008 - punkrockguy - commit 1000
|
||||
30-nov-2008 - punkrockguy - fixed gcc compile error
|
||||
30-nov-2008 - punkrockguy - moved around some hotkeys to be consistent with docs
|
||||
30-nov-2008 - punkrockguy - major update to sdl documentation
|
||||
24-nov-2008 - qfox - win32 - fixed two position checks for memwatch and debugger that could cause these windows to "disappear" (moved far out of reach).
|
||||
24-nov-2008 - adelikat - win32 - right click context menus installed
|
||||
24-nov-2008 - adelikat - win32 - added lots of mappable hotkey items as Menu items
|
||||
23-nov-2008 - adelikat - Win32 - fixed some errors in my AVI directory override code
|
||||
23-nov-2008 - shinydoofy - movie subs now have a toggle button in the SDL build (F10 by default)
|
||||
23-nov-2008 - adelikat - movie subtitle system installed
|
||||
22-nov-2008 - adelikat - Win32 - added help menu item to TASEdit and Hex Editor, Minor TASEdit clean up
|
||||
22-nov-2008 - adelikat - Win32 - fixed so that turbo works with VBlank sync settings
|
||||
21-nov-2008 - qfox - Lua - added joypad.write and joypad.get for naming consistency. Added plane display toggle for lua: FCEU.fceu_setrenderplanes(sprites, background) which accepts two boolean args and toggles the drawing of those planes from Lua. Changed movie.framecount() to always return a number, even when no movie is playing. Should return the same number as in view; the number of frames since last reset, if no movie is playing.
|
||||
17-nov-2008 - adelikat - added Open Cheats hotkey (currently a windows only function)
|
||||
16-nov-2008 - adelikat - Win32 - menu items that are hotkey mappable show the current hotkey mapping
|
||||
15-nov-2008 - adelikat - Win32 - memwatch - implemented RamChange() - monitors the behavior of ram addresses
|
||||
15-nov-2008 - adelikat - Win32 - re-enabled sound buffer time
|
||||
15-nov-2008 - adelikat - Clip Left and Right sides taken into account when drawing on screen (record/play/pause, lag & frame counters, messages, etc)
|
||||
15-nov-2008 - adelikat - win32 - Implemented Drap & Drop for movie files
|
||||
14-nov-2008 - adelikat - win32 Hex Editor - Dump Rom & Dump PPU to file Dialog - uses ROM to build default filename
|
||||
14-nov-2008 - adelikat - Win32 Memwatch - Save as dialog - uses ROM name to build default memwatch filename if there is no last used memwatch filename
|
||||
14-nov-2008 - adelikat - Win32 Text Hooker fixes - Init error checking reinstated, save .tht file no longer crashes, Dialog updates as ROM plays, Remembers window position, fix bug where canceling save as produces an error message, Save As produces default filename based on loaded ROM
|
||||
14-nov-2008 - adelikat - fixed but when aspect correction and special scaling 3x are set, video was getting resized incorrectly
|
||||
14-nov-2008 - adelikat - fixed a bug introduced in previous commit, frame display toggle now works when no movie is present
|
||||
12-nov-2008 - adelikat - allowed frame counter to display even with no movie present
|
||||
11-nov-2008 - punkrockguy - sdl - savestate slots now mappable [2175167]
|
||||
10-nov-2008 - adelikat - win32 - removed accel keys from main window
|
||||
10-nov-2008 - adelikat - Win32 - added Open & Close ROM mappable hotkeys, removed accel functions
|
||||
10-nov-2008 - punkrockguy - improved the sdl sound code; drasticaly improves quality of sound.
|
||||
09-nov-2008 - adelikat - minor memory watch menu clean up, removed Ctrl+W hotkey for close (and placed Alt+F4 on the menu name)
|
||||
08-nov-2008 - zeromus - big endian wasnt compiling. fix issues.
|
||||
02-nov-2008 - shinydoofy - added --fcmconvert for SDL
|
||||
02-nov-2008 - zeromus - emulua - add rom.readbyte and rom.readbytesigned
|
||||
|
||||
|
||||
---version 2.0.3 released---
|
||||
|
||||
02-nov-2008 - zeromus - fix fcm conversion, recording, and playback of reset and power commands
|
||||
25-oct-2008 - shinydoofy - added support for AVI creation for SDL, see documentation/Videolog.txt for more
|
||||
19-oct-2008 - shinydoofy - toggle lag frame counter for SDL, default hotkey F8
|
||||
19-oct-2008 - shinydoofy - toggle skipping of lag frames for SDL, default hotkey F6
|
||||
19-oct-2008 - shinydoofy - [ 2179829 ] user ability to toggle "bind savestates to movie" added for SDL, default hotkey F2
|
||||
19-oct-2008 - adelikat - win32 - added a toggle for binding savestates to movies
|
||||
18-oct-2008 - adelikat - win32 - added -cfg (config file) command line argument
|
||||
08-oct-2008 - zeromus - SF [ 2073113 ] Child windows inside debugging window get invalid sizes
|
||||
08-oct-2008 - zeromus - SF [ 2153843 ] Lua ignores second joypad.set()
|
||||
24-sep-2008 - punkrockguy318 - made the input config window more usable
|
||||
24-sep-2008 - punkrockguy318 - --inputcfg can now be used without a filename
|
||||
24-sep-2008 - punkrockguy318 - [ 2085437 ] should fix issues with missing author field crashing fceux
|
||||
24-sep-2008 - punkrockguy318 - [ 2047057 ] added uninstall script for gfceux
|
||||
24-sep-2008 - punkrockguy318 - [ 2062823 ] fixed ppc build errors and added LSB_FIRST option to build scripts
|
||||
24-sep-2008 - punkrockguy318 - [ 2057006 ] --newppu option added to sdl, disabled by default
|
||||
24-sep-2008 - punkrockguy318 - [ 2057008 ] lua is now optional, thanks shinydoofy for a patch. also fixed some build issues.
|
||||
22-sep-2008 - punkrockguy318 - [ 2008437 ] fixed an issue where flawed movie would crash fceux on every startup
|
||||
21-aug-2008 - punkrockguy318 - sdl - fixed issue where windowed mode would always be set to 32 bpp
|
||||
18-aug-2008 - zeromus - windows - SF [ 2058942 ] Load state as... does not use the savestate override dir (fixed; now, it does)
|
||||
18-aug-2008 - zeromus - windows - permit user optionally to proceed through the movie savestate mismatch error condition, in case he knows what he is doing.
|
||||
18-aug-2008 - zeromus - fix a bug in the savestate recovery code which prevent aborted savestate loads from recovering emulator state correctly.
|
||||
18-aug-2008 - zeromus - windows - bind a menu option for display framecounter
|
||||
17-aug-2008 - zeromus - windows - fix problem where replay dialog couldnt work when the process current directory had changed to something other than emulator base directory
|
||||
17-aug-2008 - zeromus - windows - autoload the only useful rom or movie from an archive, in cases where there is only one
|
||||
17-aug-2008 - zeromus - gracefully handle non-convertible broken utf-8 text without crashing
|
||||
17-aug-2008 - zeromus - windows - don't read every archive file when scanning for replay dialog. scan them, and only look for *.fm2
|
||||
17-aug-2008 - zeromus - debugger - fix issue where keyboard keys get stuck when switching between debugger window and main window
|
||||
15-aug-2008 - adelikat - fixed an oversight on my part. Sound config dialog will now look to see if Mute Turbo should be checked
|
||||
|
||||
---version 2.0.2 released---
|
||||
|
||||
14-aug-2008 - punkrockguy318 - SDL: prevent frame advance from crashing emulator
|
||||
14-aug-2008 - punkrockguy318 - SDL build scripts now look for lua5.1 and lua (distributions package lua differently)
|
||||
14-aug-2008 - zeromus - restore savestate error recovery functionality. This should have the side effect of guaranteeing that ( SF [ 2040761 ] Wrong savestate bug - crashes FCEUX) is resolved.
|
||||
14-aug-2008 - zeromus - SF [ 2047001 ] Low speeds crash FCEUX
|
||||
14-aug-2008 - zeromus - SF [ 2050371 ] FCM>FM2 converter should release file handle
|
||||
13-aug-2008 - zeromus - restore ungzipping (and unzipping in sdl) capability which was lost when archive support was added
|
||||
13-aug-2008 - zeromus - add FORBID breakpoints - regions which block breakpoints from happening if they contain the PC
|
||||
13-aug-2008 - punkrockguy318 - SDL: fixed --input(1-4) options. input1 and 2 are regular inputs, input3 and 4 are famicom expansion inputs
|
||||
12-aug-2008 - zeromus - fix SDL configfile woes. configfile now goes to ~/.fceux/fceux.cfg
|
||||
12-aug-2008 - zeromus - SF [ 2047986 ] palflag 1 in .fm2 files crashes fceux
|
||||
12-aug-2008 - adelikat - movie replay dialog displays fractions of a second
|
||||
12-aug-2008 - punkrockguy318 - SDL: fixed segfault when opening .fcm files
|
||||
12-aug-2008 - punkrockguy318 - SDL: Saner sound defaults for less choppy sound
|
||||
12-aug-2008 - punkrockguy318 - SF [ 2047050 ] SDL: "--special" option fixed for special video scaling filters
|
||||
12-aug-2008 - zeromus - SF [ 2046984 ] Player 3 inputs when not used
|
||||
12-aug-2008 - zeromus - print a special message when trying to open an FCM reminding user to convert. (finishes SF [ 2011832 ] Opening non movie file crashes FCEUX)
|
||||
12-aug-2008 - zeromus - SF [ 2046985 ] SRAM not wiped on power cycle (during movies)
|
||||
11-aug-2008 - zeromus - restore IPS patching capability which was lost when archive support was added
|
||||
11-aug-2008 - zeromus - SF [ 2011550 ] Buffer overflow (change vsprintf to vsnprintf)
|
||||
11-aug-2008 - zeromus - SF [ 2047004 ] Moviefilenames without extension don't automatically get fm2
|
||||
10-aug-2008 - zeromus - upgrade to cah4e3's latest mapper 163&164 code to fix a crash in a game
|
||||
10-aug-2008 - zeromus - remove cnrom chr rom size limit for homebrew roms
|
||||
10-aug-2008 - punkrockguy318 - SDL: cleaned up the SConsruct
|
||||
10-aug-2008 - punkrockguy318 - SDL: fixed issue where fceu would lock up when file dialogs were opened during fullscreen
|
||||
10-aug-2008 - punkrockguy318 - SDL: fixed bug where fceux would close when file dialogs were closed
|
||||
10-aug-2008 - punkrockguy318 - SDL: File open dialog is now used to movie playback
|
||||
10-aug-2008 - punkrockguy318 - SDL: File open wrapper now takes a titlebar argument
|
||||
10-aug-2008 - punkrockguy318 - SDL: Cleanup of usage
|
||||
10-aug-2008 - punkrockguy318 - SDL: rename options --no8lim -> --nospritelim and --color -> --ntsccolor
|
||||
10-aug-2008 - punkrockguy318 - SDL: Screenshots now always prepend the game name.
|
||||
10-aug-2008 - punkrockguy318 - SDL: Changed default A/B from numpad 2 and 3 to j and k.
|
||||
10-aug-2008 - punkrockguy318 - SDL: Enable frameskip by default
|
||||
10-aug-2008 - punkrockguy318 - SDL: Fixed a bug that would crash fceux if the emulation speed was overincreased
|
||||
10-aug-2008 - punkrockguy318 - SDL: New default hotkeys to more closely match win32 defaults
|
||||
10-aug-2008 - punkrockguy318 - SDL: Added lua script loading hotkey (f3). Non win32 SDL requires zenity for this to function.
|
||||
10-aug-2008 - punkrockguy318 - SDL: Build script cleanup; also added option for DEBUG builds.
|
||||
10-aug-2008 - zeromus - SF [ 2030405 ] Avi recording: no sound b0rks format
|
||||
10-aug-2008 - zeromus - SF [ 2037878 ] Convert .fcm doesn't do special characters
|
||||
09-aug-2008 - zeromus - SF [ 2040463 ] Add an "author" text field in the record movie dialog
|
||||
09-aug-2008 - zeromus - re-enable support for old-format savestates.
|
||||
09-aug-2008 - zeromus - SF [ 2041944 ] Savestates remember Lua painting
|
||||
09-aug-2008 - zeromus - support loading movies from archives
|
||||
08-aug-2008 - adelikat - added input display to the FCEUX main menu
|
||||
08-aug-2008 - adelikat - fixed the (null) in the default lua directory listing
|
||||
08-aug-2008 - adelikat - added shift+L as default hotkey for reload lua script
|
||||
08-aug-2008 - adelikat - removed accel ctrl+x (prevented cut from working in accel dialogs)
|
||||
08-aug-2008 - zeromus - fiddle with nametable viewer to display correct NT,CHR,ATTR data in more cases (specifically, including some exotic mmc5 cases).
|
||||
08-aug-2008 - zeromus - fix a new bug in windows build which caused fourscore emulation to fail in some cases
|
||||
07-aug-2008 - zeromus - add an option to pick a constant color to draw in place of BG when BG rendering is disabled (look for gNoBGFillColor in config; 255 means to use palette[0])
|
||||
07-aug-2008 - adelikat - added a mute turbo option in sound config
|
||||
07-aug-2008 - adelikat - new toggle - frame adv. - lag skip (menu item + hotkey mapping + saved in config)
|
||||
07-aug-2008 - adelikat - put in -32000 protection on all dialogs that remember x,y
|
||||
06-aug-2008 - adelikat - change config filename from fceu98.cfg to fceux.cfg
|
||||
06-aug-2008 - zeromus - add lagcounter and lagflag to savestate
|
||||
06-aug-2008 - zeromus - SF [ 2040448 ] View Slots bug - does not include new savestate naming
|
||||
06-aug-2008 - zeromus - restore the debugger snap functionality
|
||||
06-aug-2008 - zeromus - add memory.readbyterange to emulua
|
||||
06-aug-2008 - zeromus - auto-fill .fcs extension in save state as dialog
|
||||
06-aug-2008 - zeromus - mmc5 - 64KB WRAM games now work correctly
|
||||
06-aug-2008 - zeromus - mmc5 - use of chr A regs for BG in sprite 8x8 mode is fixed
|
||||
06-aug-2008 - zeromus - debugger - debugger window is now resizeable
|
||||
|
||||
---version 2.0.1 released---
|
||||
|
||||
04-aug-2008 - reorganize display toggle options in the menu
|
||||
04-aug-2008 - adelikat - autofire fix
|
||||
04-aug-2008 - zeromus - homebrew mmc5 games now have 64KB of exwram instead of only 8KB
|
||||
04-aug-2008 - zeromus - fix crash related to player2 in lua scripts
|
||||
03-aug-2008 - qfox - fixed player2 in lua scripts
|
||||
|
||||
---version 2.0.0 released---
|
|
@ -1,74 +0,0 @@
|
|||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" (C) Copyright 2012 Joe Nahmias <jello@debian.org>
|
||||
.\"
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH FCEUX-NET-SERVER 6 "October 12, 2012"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.SH NAME
|
||||
fceux-net-server \- FCE Ultra game server
|
||||
.SH SYNOPSIS
|
||||
.B fceux-net-server
|
||||
.RI [ options ]
|
||||
.SH DESCRIPTION
|
||||
This manual page documents briefly the
|
||||
.B fceux-net-server
|
||||
command.
|
||||
.PP
|
||||
\fBfceux-net-server\fP is the game server for multiplayer use of the FCE Ultra
|
||||
family of NES emulators. This server will first look in
|
||||
\fI/etc/fceux-server.conf\fP for options. If that file does not exist, it will
|
||||
use the defaults given here. Any argument given directly will override any
|
||||
default values.
|
||||
.SH OPTIONS
|
||||
These programs follow the usual GNU command line syntax, with long
|
||||
options starting with two dashes (`-').
|
||||
A summary of options is included below.
|
||||
.TP
|
||||
.B \-h, \-\-help
|
||||
Displays a help message.
|
||||
.TP
|
||||
.B \-v, \-\-version
|
||||
Displays the version number and quits.
|
||||
.TP
|
||||
.B \-p, \-\-port
|
||||
Starts server on given port (default = \fI4046\fP).
|
||||
.TP
|
||||
.B \-w, \-\-password
|
||||
Specifies a password for entry.
|
||||
.TP
|
||||
.B \-m, \-\-maxclients
|
||||
Specifies the maximum number of clients allowed to access the
|
||||
server (default = \fI100\fP).
|
||||
.TP
|
||||
.B \-t, \-\-timeout
|
||||
Specifies the number of seconds before the server times out (default = \fI5\fP).
|
||||
.TP
|
||||
.B \-f, \-\-framedivisor
|
||||
Specifies frame divisor, which controls the number of updates sent to client;
|
||||
calculated as: 60 / framedivisor = updates per second (default = \fI1\fP).
|
||||
.TP
|
||||
.B \-c, \-\-configfile
|
||||
Loads the given configuration file (default = \fI/etc/fceux\-server.conf\fP).
|
||||
.SH SEE ALSO
|
||||
.BR fceux (6),
|
||||
The
|
||||
.B FCEUX
|
||||
project homepage
|
||||
.RI < http://fceux.com/ >.
|
||||
.SH AUTHOR
|
||||
This manual page was written by Joe Nahmias <jello@debian.org>
|
||||
for the Debian GNU/Linux system (but may be used by others).
|
||||
|
|
@ -1,353 +0,0 @@
|
|||
.\" t Hey, EMACS: -*- nroff -*-
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH FCEUX 6 "June 24, 2012"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.SH NAME
|
||||
fceux \- An emulator for the original (8-bit) Nintendo / Famicom game console.
|
||||
.SH SYNOPSIS
|
||||
.B fceux
|
||||
.RI [ options ]
|
||||
"filename"
|
||||
.SH DESCRIPTION
|
||||
.B FCEUX
|
||||
is an emulator for the original (8-bit) Nintendo Entertainment System (NES).
|
||||
It has a robust color palette rendering engine that is fully customizable,
|
||||
along with excellent sound and joystick support, and even supports movie
|
||||
recording and playback.
|
||||
.SH OPTIONS
|
||||
.SS Misc. Options
|
||||
.TP
|
||||
.B \--no-config {0|1}
|
||||
Use default config file and do not save to it, when enabled.
|
||||
.TP
|
||||
.B \-g {0|1}, \--gamegenie {0|1}
|
||||
Enable or disable emulated Game Genie.
|
||||
.TP
|
||||
.B \--nogui {0|1}
|
||||
Enable or disable the GTK GUI.
|
||||
.TP
|
||||
.B \--loadlua FILE
|
||||
Loads lua script from filename FILE.
|
||||
.SS Emulation Options
|
||||
.TP
|
||||
.B \--pal {0|1}
|
||||
Enable or disable PAL mode.
|
||||
.SS Input Options
|
||||
.TP
|
||||
.B \-i DEV, \--inputcfg DEV
|
||||
Configures input device DEV on startup.
|
||||
Devices: gamepad powerpad hypershot quizking
|
||||
.TP
|
||||
.B \--input{1|2} DEV
|
||||
Set which input device to emulate for input 1 or 2.
|
||||
Devices: gamepad zapper powerpad.0 powerpad.1 arkanoid
|
||||
.TP
|
||||
.B \--input{3|4} DEV
|
||||
Set the famicom expansion device to emulate for input 3 or 4.
|
||||
Devices: quizking hypershot mahjong toprider ftrainer familykeyboard
|
||||
oekakids arkanoid shadow bworld 4player
|
||||
.TP
|
||||
.B \--inputdisplay {0|1}
|
||||
Enable or disable input display.
|
||||
.TP
|
||||
.B \--fourscore {0|1}
|
||||
Enable or disable fourscore emulation.
|
||||
.SS Graphics Options
|
||||
.TP
|
||||
.B \--newppu {0|1}
|
||||
Enable or disable the new PPU core. (WARNING: May break savestates)
|
||||
.TP
|
||||
.B \--frameskip NUM
|
||||
Set NUM of frames to skip per emulated frame.
|
||||
.TP
|
||||
.B \--clipsides {0|1}
|
||||
Enable or disable clipping of the leftmost and rightmost 8 columns of
|
||||
the video output.
|
||||
.TP
|
||||
.B \--slstart SCANLINE
|
||||
Set the first scanline to be rendered.
|
||||
.TP
|
||||
.B \--slend SCANLINE
|
||||
Set the last scanline to be rendered.
|
||||
.TP
|
||||
.B \--nospritelim {0|1}
|
||||
When set to 0, this disables the normal 8 sprites per scanline limitation.
|
||||
When set to 1, this enables the normal 8 sprites per scanline limitation.
|
||||
NOTE: Yes, this option is 'backwards'.
|
||||
.TP
|
||||
.B \-x XRES, \--xres XRES
|
||||
Set horizontal resolution for full screen mode.
|
||||
.TP
|
||||
.B \-y YRES, \--yres YRES
|
||||
Set vertical resolution for full screen mode.
|
||||
.TP
|
||||
.B \--doublebuf {0|1}
|
||||
Enable or disable double buffering.
|
||||
.TP
|
||||
.B \--autoscale {0|1}
|
||||
Enable or disable autoscaling in fullscreen.
|
||||
.TP
|
||||
.B \--keepratio {0|1}
|
||||
Keep native NES aspect ratio when autoscaling.
|
||||
.TP
|
||||
.B \--{x|y}scale VAL
|
||||
Multiply width/height by VAL.
|
||||
(Real numbers > 0 with OpenGL, otherwise integers > 0).
|
||||
.TP
|
||||
.B \--{x|y}stretch {0|1}
|
||||
Stretch to fill surface on x/y axis (OpenGL only).
|
||||
.TP
|
||||
.B \-b {8|16|24|32}, \--bpp {8|16|24|32}
|
||||
Set bits per pixel.
|
||||
.TP
|
||||
.B \--opengl {0|1}
|
||||
Enable or disable OpenGL support.
|
||||
.TP
|
||||
.B \--openglip {0|1}
|
||||
Enable or disable OpenGL linear interpolation.
|
||||
.TP
|
||||
.B \-f {0|1}, \--fullscreen {0|1}
|
||||
Enable or disable full-screen mode.
|
||||
.TP
|
||||
.B \--noframe {0|1}
|
||||
Hide title bar and window decorations.
|
||||
.TP
|
||||
.B \--special {1-4}
|
||||
Use special video scaling filters.
|
||||
(1 = hq2x 2 = Scale2x 3 = NTSC 2x 4 = hq3x 5 = Scale3x)
|
||||
.TP
|
||||
.B \-p FILE, \--palette FILE
|
||||
Use the custom palette in FILE.
|
||||
.TP
|
||||
.B \--ntsccolor {0|1}
|
||||
Enable or disable NTSC NES colors.
|
||||
.TP
|
||||
.B \--tint VAL
|
||||
Set the NTSC tint.
|
||||
.TP
|
||||
.B \--hue VAL
|
||||
Set the NTSC hue.
|
||||
.SS Sound Options
|
||||
.TP
|
||||
.B \-s {0|1}, \--sound {0|1}
|
||||
Enable or disable sound.
|
||||
.TP
|
||||
.B \--soundrate RATE
|
||||
Set the sound playback sample rate (0 == off?).
|
||||
.TP
|
||||
.B \--soundq {0|1|2}
|
||||
Set sound quality. (0 = Low 1 = High 2 = Very High)
|
||||
.TP
|
||||
.B \--soundbufsize MS
|
||||
Set sound buffer size to MS milliseconds.
|
||||
.TP
|
||||
.B \--volume {0-256}
|
||||
Sets the sound volume to the given value, where 256 is max volume.
|
||||
.TP
|
||||
.B \--trianglevol {0-256}
|
||||
Sets the sound volume of the triangle wave to the given value, where 256 is max volume.
|
||||
.TP
|
||||
.B \--square1vol {0-256}
|
||||
Sets the sound volume of square wave 1 to the given value, where 256 is max volume.
|
||||
.TP
|
||||
.B \--square2vol {0-256}
|
||||
Sets the sound volume of square wave 2 to the given value, where 256 is max volume.
|
||||
.TP
|
||||
.B \--noisevol {0-256}
|
||||
Sets the sound volume of the noise generator to the given value, where 256 is max volume.
|
||||
.TP
|
||||
.B \--lowpass {0|1}
|
||||
Enables or disables lowpass filtering of the sound.
|
||||
.TP
|
||||
.B \--soundrecord FILE
|
||||
Record sound to file FILE.
|
||||
.SS Movie Options
|
||||
.TP
|
||||
.B \--playmov FILE
|
||||
Play back a recorded FCM/FM2 movie from filename FILE.
|
||||
.TP
|
||||
.B \--pauseframe FRAME
|
||||
Pause movie playback at frame FRAME.
|
||||
.TP
|
||||
.B \--moviemsg {0|1}
|
||||
Enable or disable movie messages.
|
||||
.TP
|
||||
.B \--fcmconvert FILE
|
||||
Convert fcm movie file FILE to fm2.
|
||||
.TP
|
||||
.B \--ripsubs FILE
|
||||
Convert movie's subtitles to srt.
|
||||
.TP
|
||||
.B \--subtitles {0|1}
|
||||
Enable or disable subtitle display.
|
||||
.SS Networking Options
|
||||
.TP
|
||||
.B \-n SRV, \--net SRV
|
||||
Connect to server SRV for TCP/IP network play.
|
||||
.TP
|
||||
.B \--port PORT
|
||||
Use TCP/IP port PORT for network play.
|
||||
.TP
|
||||
.B \-u NICK, \--user NICK
|
||||
Set the nickname to use in network play.
|
||||
.TP
|
||||
.B \-w PASS, \--pass PASS
|
||||
Set password to use for connecting to the server.
|
||||
.TP
|
||||
.B \-k NETKEY, \--netkey NETKEY
|
||||
Use string NETKEY to create a unique session for the game loaded.
|
||||
.TP
|
||||
.B \--players NUM
|
||||
Set the number of local players.
|
||||
.TP
|
||||
.B \--rp2mic {0|1}
|
||||
If enabled, replace Port 2 Start with microphone (Famicom).
|
||||
.TP
|
||||
.B \--videolog c
|
||||
Calls mencoder to grab the video and audio streams to encode them. Check the documentation for more on this.?
|
||||
.TP
|
||||
.B \--mute {0|1}
|
||||
Mutes FCEUX while still passing the audio stream to mencoder.
|
||||
.TP
|
||||
.SH KEYBOARD COMMANDS
|
||||
.B FCEUX
|
||||
has a number of commands available within the emulator.
|
||||
It also includes default keyboard bindings when emulating game pads or power pads.
|
||||
.SS Gamepad Keyboard Bindings
|
||||
.TS
|
||||
center box;
|
||||
cb | cb, c | ci.
|
||||
NES Gamepad Keyboard
|
||||
=
|
||||
Up Keypad Up
|
||||
Down Keypad Down
|
||||
Left Keypad Left
|
||||
Right Keypad Right
|
||||
A F
|
||||
B D
|
||||
Select S
|
||||
Start Enter
|
||||
.TE
|
||||
.SS Other Commands
|
||||
.PP
|
||||
.TP 15
|
||||
.BI <Alt+Enter>
|
||||
Toggle full-screen mode.
|
||||
.TP 15
|
||||
.BI <F1>
|
||||
Cheat menu (command-line only).
|
||||
.TP 15
|
||||
.BI <F2>
|
||||
Toggle savestate binding to movies.
|
||||
.TP 15
|
||||
.BI <F3>
|
||||
Load LUA script.
|
||||
.TP 15
|
||||
.BI <F4>
|
||||
Toggles background rendering.
|
||||
.TP 15
|
||||
.BI <F5>
|
||||
Save game state into current slot (set using number keys).
|
||||
.TP 15
|
||||
.BI <F7>
|
||||
Restore game state from current slot (set using number keys).
|
||||
.TP 15
|
||||
.BI <F10>
|
||||
Toggle movie subtitles.
|
||||
.TP 15
|
||||
.BI <F11>
|
||||
Reset NES.
|
||||
.TP 15
|
||||
.BI <F12>
|
||||
Save screen snapshot.
|
||||
.TP 15
|
||||
.BI Shift + <F5>
|
||||
Beging recording video.
|
||||
.TP 15
|
||||
.BI Shift + <F7>
|
||||
Load recorded video.
|
||||
.TP 15
|
||||
.BI 0-9
|
||||
Select save state slot.
|
||||
.TP 15
|
||||
.BI Page Up/Page Down
|
||||
Select next/previous state.
|
||||
.TP 15
|
||||
.BI \-
|
||||
Decrease emulation speed.
|
||||
.TP 15
|
||||
.BI =
|
||||
Increase emulation speed.
|
||||
.TP 15
|
||||
.BI Tab
|
||||
Hold for turbo emulation speed.
|
||||
.TP 15
|
||||
.BI Pause
|
||||
Pause emulation.
|
||||
.TP 15
|
||||
.BI \e
|
||||
Advance a single frame.
|
||||
.TP 15
|
||||
.BI .
|
||||
Toggle movie frame counter.
|
||||
.TP 15
|
||||
.BI ,
|
||||
Toggle input display.
|
||||
.TP 15
|
||||
.BI q
|
||||
Toggle movie read-only.
|
||||
.TP 15
|
||||
.BI '
|
||||
Advance a single frame.
|
||||
.TP 15
|
||||
.BI /
|
||||
Lag counter display.
|
||||
.TP 15
|
||||
.BI Delete
|
||||
Frame advance lag skip display.
|
||||
.TP 15
|
||||
.BR <ESC>
|
||||
Quit
|
||||
.B FCEUX.
|
||||
.SS VS Unisystem Commands
|
||||
.PP
|
||||
.TP 15
|
||||
.BI <F8>
|
||||
Insert coin.
|
||||
.TP 15
|
||||
.BI <F6>
|
||||
Show/Hide dip switches.
|
||||
.TP 15
|
||||
.BI 1-8
|
||||
Toggle dip switches (when dip switches are shown).
|
||||
.SS Famicom Disk System Commands
|
||||
.PP
|
||||
.TP 15
|
||||
.BI <F6>
|
||||
Select disk and disk side.
|
||||
.TP 15
|
||||
.BI <F8>
|
||||
Eject or insert disk.
|
||||
.TP
|
||||
.I http://fceux.com/
|
||||
The
|
||||
.B FCEUX
|
||||
project homepage.
|
||||
.SH AUTHOR
|
||||
This manual page was written by Joe Nahmias <joe _at_ nahmias.net>,
|
||||
Lukas Sabota <ltsmooth42 _at_ gmail.com> and Alexander Toresson
|
||||
<alexander.toresson _at_ gmail.com> for the Debian GNU/Linux system
|
||||
(but may be used by others).
|
Binary file not shown.
|
@ -1,522 +0,0 @@
|
|||
/// \file
|
||||
/// \brief 6502 assembler and disassembler
|
||||
|
||||
#include "types.h"
|
||||
#include "utils/xstring.h"
|
||||
#include "debug.h"
|
||||
#include "asm.h"
|
||||
#include "x6502.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
///assembles the string to an instruction located at addr, storing opcodes in output buffer
|
||||
int Assemble(unsigned char *output, int addr, char *str) {
|
||||
//unsigned char opcode[3] = { 0,0,0 };
|
||||
output[0] = output[1] = output[2] = 0;
|
||||
char astr[128],ins[4];
|
||||
int len = strlen(str);
|
||||
if ((!len) || (len > 0x127)) return 1;
|
||||
|
||||
strcpy(astr,str);
|
||||
str_ucase(astr);
|
||||
sscanf(astr,"%3s",ins); //get instruction
|
||||
if (strlen(ins) != 3) return 1;
|
||||
strcpy(astr,strstr(astr,ins)+3); //heheh, this is probably a bad idea, but let's do it anyway!
|
||||
if ((astr[0] != ' ') && (astr[0] != 0)) return 1;
|
||||
|
||||
//remove all whitespace
|
||||
str_strip(astr,STRIP_SP|STRIP_TAB|STRIP_CR|STRIP_LF);
|
||||
|
||||
//repair syntax
|
||||
chr_replace(astr,'[','('); //brackets
|
||||
chr_replace(astr,']',')');
|
||||
chr_replace(astr,'{','(');
|
||||
chr_replace(astr,'}',')');
|
||||
chr_replace(astr,';',0); //comments
|
||||
str_replace(astr,"0X","$"); //miscellaneous
|
||||
|
||||
//This does the following:
|
||||
// 1) Sets opcode[0] on success, else returns 1.
|
||||
// 2) Parses text in *astr to build the rest of the assembled
|
||||
// data in 'opcode', else returns 1 on error.
|
||||
|
||||
if (!strlen(astr)) {
|
||||
//Implied instructions
|
||||
if (!strcmp(ins,"BRK")) output[0] = 0x00;
|
||||
else if (!strcmp(ins,"PHP")) output[0] = 0x08;
|
||||
else if (!strcmp(ins,"ASL")) output[0] = 0x0A;
|
||||
else if (!strcmp(ins,"CLC")) output[0] = 0x18;
|
||||
else if (!strcmp(ins,"PLP")) output[0] = 0x28;
|
||||
else if (!strcmp(ins,"ROL")) output[0] = 0x2A;
|
||||
else if (!strcmp(ins,"SEC")) output[0] = 0x38;
|
||||
else if (!strcmp(ins,"RTI")) output[0] = 0x40;
|
||||
else if (!strcmp(ins,"PHA")) output[0] = 0x48;
|
||||
else if (!strcmp(ins,"LSR")) output[0] = 0x4A;
|
||||
else if (!strcmp(ins,"CLI")) output[0] = 0x58;
|
||||
else if (!strcmp(ins,"RTS")) output[0] = 0x60;
|
||||
else if (!strcmp(ins,"PLA")) output[0] = 0x68;
|
||||
else if (!strcmp(ins,"ROR")) output[0] = 0x6A;
|
||||
else if (!strcmp(ins,"SEI")) output[0] = 0x78;
|
||||
else if (!strcmp(ins,"DEY")) output[0] = 0x88;
|
||||
else if (!strcmp(ins,"TXA")) output[0] = 0x8A;
|
||||
else if (!strcmp(ins,"TYA")) output[0] = 0x98;
|
||||
else if (!strcmp(ins,"TXS")) output[0] = 0x9A;
|
||||
else if (!strcmp(ins,"TAY")) output[0] = 0xA8;
|
||||
else if (!strcmp(ins,"TAX")) output[0] = 0xAA;
|
||||
else if (!strcmp(ins,"CLV")) output[0] = 0xB8;
|
||||
else if (!strcmp(ins,"TSX")) output[0] = 0xBA;
|
||||
else if (!strcmp(ins,"INY")) output[0] = 0xC8;
|
||||
else if (!strcmp(ins,"DEX")) output[0] = 0xCA;
|
||||
else if (!strcmp(ins,"CLD")) output[0] = 0xD8;
|
||||
else if (!strcmp(ins,"INX")) output[0] = 0xE8;
|
||||
else if (!strcmp(ins,"NOP")) output[0] = 0xEA;
|
||||
else if (!strcmp(ins,"SED")) output[0] = 0xF8;
|
||||
else return 1;
|
||||
}
|
||||
else {
|
||||
//Instructions with Operands
|
||||
if (!strcmp(ins,"ORA")) output[0] = 0x01;
|
||||
else if (!strcmp(ins,"ASL")) output[0] = 0x06;
|
||||
else if (!strcmp(ins,"BPL")) output[0] = 0x10;
|
||||
else if (!strcmp(ins,"JSR")) output[0] = 0x20;
|
||||
else if (!strcmp(ins,"AND")) output[0] = 0x21;
|
||||
else if (!strcmp(ins,"BIT")) output[0] = 0x24;
|
||||
else if (!strcmp(ins,"ROL")) output[0] = 0x26;
|
||||
else if (!strcmp(ins,"BMI")) output[0] = 0x30;
|
||||
else if (!strcmp(ins,"EOR")) output[0] = 0x41;
|
||||
else if (!strcmp(ins,"LSR")) output[0] = 0x46;
|
||||
else if (!strcmp(ins,"JMP")) output[0] = 0x4C;
|
||||
else if (!strcmp(ins,"BVC")) output[0] = 0x50;
|
||||
else if (!strcmp(ins,"ADC")) output[0] = 0x61;
|
||||
else if (!strcmp(ins,"ROR")) output[0] = 0x66;
|
||||
else if (!strcmp(ins,"BVS")) output[0] = 0x70;
|
||||
else if (!strcmp(ins,"STA")) output[0] = 0x81;
|
||||
else if (!strcmp(ins,"STY")) output[0] = 0x84;
|
||||
else if (!strcmp(ins,"STX")) output[0] = 0x86;
|
||||
else if (!strcmp(ins,"BCC")) output[0] = 0x90;
|
||||
else if (!strcmp(ins,"LDY")) output[0] = 0xA0;
|
||||
else if (!strcmp(ins,"LDA")) output[0] = 0xA1;
|
||||
else if (!strcmp(ins,"LDX")) output[0] = 0xA2;
|
||||
else if (!strcmp(ins,"BCS")) output[0] = 0xB0;
|
||||
else if (!strcmp(ins,"CPY")) output[0] = 0xC0;
|
||||
else if (!strcmp(ins,"CMP")) output[0] = 0xC1;
|
||||
else if (!strcmp(ins,"DEC")) output[0] = 0xC6;
|
||||
else if (!strcmp(ins,"BNE")) output[0] = 0xD0;
|
||||
else if (!strcmp(ins,"CPX")) output[0] = 0xE0;
|
||||
else if (!strcmp(ins,"SBC")) output[0] = 0xE1;
|
||||
else if (!strcmp(ins,"INC")) output[0] = 0xE6;
|
||||
else if (!strcmp(ins,"BEQ")) output[0] = 0xF0;
|
||||
else return 1;
|
||||
|
||||
{
|
||||
//Parse Operands
|
||||
// It's not the sexiest thing ever, but it works well enough!
|
||||
|
||||
//TODO:
|
||||
// Add branches.
|
||||
// Fix certain instructions. (Setting bits is not 100% perfect.)
|
||||
// Fix instruction/operand matching. (Instructions like "jmp ($94),Y" are no good!)
|
||||
// Optimizations?
|
||||
int tmpint;
|
||||
char tmpchr,tmpstr[20];
|
||||
|
||||
if (sscanf(astr,"#$%2X%c",&tmpint,&tmpchr) == 1) { //#Immediate
|
||||
switch (output[0]) {
|
||||
case 0x20: case 0x4C: //Jumps
|
||||
case 0x10: case 0x30: case 0x50: case 0x70: //Branches
|
||||
case 0x90: case 0xB0: case 0xD0: case 0xF0:
|
||||
case 0x06: case 0x24: case 0x26: case 0x46: //Other instructions incapable of #Immediate
|
||||
case 0x66: case 0x81: case 0x84: case 0x86:
|
||||
case 0xC6: case 0xE6:
|
||||
return 1;
|
||||
default:
|
||||
//cheap hack for certain instructions
|
||||
switch (output[0]) {
|
||||
case 0xA0: case 0xA2: case 0xC0: case 0xE0:
|
||||
break;
|
||||
default:
|
||||
output[0] |= 0x08;
|
||||
break;
|
||||
}
|
||||
output[1] = tmpint;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (sscanf(astr,"$%4X%c",&tmpint,&tmpchr) == 1) { //Absolute, Zero Page, Branch, or Jump
|
||||
switch (output[0]) {
|
||||
case 0x20: case 0x4C: //Jumps
|
||||
output[1] = (tmpint & 0xFF);
|
||||
output[2] = (tmpint >> 8);
|
||||
break;
|
||||
case 0x10: case 0x30: case 0x50: case 0x70: //Branches
|
||||
case 0x90: case 0xB0: case 0xD0: case 0xF0:
|
||||
tmpint -= (addr+2);
|
||||
if ((tmpint < -128) || (tmpint > 127)) return 1;
|
||||
output[1] = (tmpint & 0xFF);
|
||||
break;
|
||||
//return 1; //FIX ME
|
||||
default:
|
||||
if (tmpint > 0xFF) { //Absolute
|
||||
output[0] |= 0x0C;
|
||||
output[1] = (tmpint & 0xFF);
|
||||
output[2] = (tmpint >> 8);
|
||||
}
|
||||
else { //Zero Page
|
||||
output[0] |= 0x04;
|
||||
output[1] = (tmpint & 0xFF);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (sscanf(astr,"$%4X%s",&tmpint,tmpstr) == 2) { //Absolute,X, Zero Page,X, Absolute,Y or Zero Page,Y
|
||||
if (!strcmp(tmpstr,",X")) { //Absolute,X or Zero Page,X
|
||||
switch (output[0]) {
|
||||
case 0x20: case 0x4C: //Jumps
|
||||
case 0x10: case 0x30: case 0x50: case 0x70: //Branches
|
||||
case 0x90: case 0xB0: case 0xD0: case 0xF0:
|
||||
case 0x24: case 0x86: case 0xA2: case 0xC0: //Other instructions incapable of Absolute,X or Zero Page,X
|
||||
case 0xE0:
|
||||
return 1;
|
||||
default:
|
||||
if (tmpint > 0xFF) { //Absolute
|
||||
if (output[0] == 0x84) return 1; //No STY Absolute,X!
|
||||
output[0] |= 0x1C;
|
||||
output[1] = (tmpint & 0xFF);
|
||||
output[2] = (tmpint >> 8);
|
||||
}
|
||||
else { //Zero Page
|
||||
output[0] |= 0x14;
|
||||
output[1] = (tmpint & 0xFF);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (!strcmp(tmpstr,",Y")) { //Absolute,Y or Zero Page,Y
|
||||
switch (output[0]) {
|
||||
case 0x20: case 0x4C: //Jumps
|
||||
case 0x10: case 0x30: case 0x50: case 0x70: //Branches
|
||||
case 0x90: case 0xB0: case 0xD0: case 0xF0:
|
||||
case 0x06: case 0x24: case 0x26: case 0x46: //Other instructions incapable of Absolute,Y or Zero Page,Y
|
||||
case 0x66: case 0x84: case 0x86: case 0xA0:
|
||||
case 0xC0: case 0xC6: case 0xE0: case 0xE6:
|
||||
return 1;
|
||||
case 0xA2: //cheap hack for LDX
|
||||
output[0] |= 0x04;
|
||||
default:
|
||||
if (tmpint > 0xFF) { //Absolute
|
||||
if (output[0] == 0x86) return 1; //No STX Absolute,Y!
|
||||
output[0] |= 0x18;
|
||||
output[1] = (tmpint & 0xFF);
|
||||
output[2] = (tmpint >> 8);
|
||||
}
|
||||
else { //Zero Page
|
||||
if ((output[0] != 0x86) && (output[0] != 0xA2)) return 1; //only STX and LDX Absolute,Y!
|
||||
output[0] |= 0x10;
|
||||
output[1] = (tmpint & 0xFF);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else return 1;
|
||||
}
|
||||
else if (sscanf(astr,"($%4X%s",&tmpint,tmpstr) == 2) { //Jump (Indirect), (Indirect,X) or (Indirect),Y
|
||||
switch (output[0]) {
|
||||
case 0x20: //Jumps
|
||||
case 0x10: case 0x30: case 0x50: case 0x70: //Branches
|
||||
case 0x90: case 0xB0: case 0xD0: case 0xF0:
|
||||
case 0x06: case 0x24: case 0x26: case 0x46: //Other instructions incapable of Jump (Indirect), (Indirect,X) or (Indirect),Y
|
||||
case 0x66: case 0x84: case 0x86: case 0xA0:
|
||||
case 0xA2: case 0xC0: case 0xC6: case 0xE0:
|
||||
case 0xE6:
|
||||
return 1;
|
||||
default:
|
||||
if ((!strcmp(tmpstr,")")) && (output[0] == 0x4C)) { //Jump (Indirect)
|
||||
output[0] = 0x6C;
|
||||
output[1] = (tmpint & 0xFF);
|
||||
output[2] = (tmpint >> 8);
|
||||
}
|
||||
else if ((!strcmp(tmpstr,",X)")) && (tmpint <= 0xFF) && (output[0] != 0x4C)) { //(Indirect,X)
|
||||
output[1] = (tmpint & 0xFF);
|
||||
}
|
||||
else if ((!strcmp(tmpstr,"),Y")) && (tmpint <= 0xFF) && (output[0] != 0x4C)) { //(Indirect),Y
|
||||
output[0] |= 0x10;
|
||||
output[1] = (tmpint & 0xFF);
|
||||
}
|
||||
else return 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
///disassembles the opcodes in the buffer assuming the provided address. Uses GetMem() and 6502 current registers to query referenced values. returns a static string buffer.
|
||||
char *Disassemble(int addr, uint8 *opcode) {
|
||||
static char str[64]={0},chr[5]={0};
|
||||
uint16 tmp,tmp2;
|
||||
|
||||
//these may be replaced later with passed-in values to make a lighter-weight disassembly mode that may not query the referenced values
|
||||
#define RX (X.X)
|
||||
#define RY (X.Y)
|
||||
|
||||
switch (opcode[0]) {
|
||||
#define relative(a) { \
|
||||
if (((a)=opcode[1])&0x80) (a) = addr-(((a)-1)^0xFF); \
|
||||
else (a)+=addr; \
|
||||
}
|
||||
#define absolute(a) { \
|
||||
(a) = opcode[1] | opcode[2]<<8; \
|
||||
}
|
||||
#define zpIndex(a,i) { \
|
||||
(a) = opcode[1]+(i); \
|
||||
}
|
||||
#define indirectX(a) { \
|
||||
(a) = (opcode[1]+RX)&0xFF; \
|
||||
(a) = GetMem((a)) | (GetMem((a)+1))<<8; \
|
||||
}
|
||||
#define indirectY(a) { \
|
||||
(a) = GetMem(opcode[1]) | (GetMem(opcode[1]+1))<<8; \
|
||||
(a) += RY; \
|
||||
}
|
||||
|
||||
|
||||
//odd, 1-byte opcodes
|
||||
case 0x00: strcpy(str,"BRK"); break;
|
||||
case 0x08: strcpy(str,"PHP"); break;
|
||||
case 0x0A: strcpy(str,"ASL"); break;
|
||||
case 0x18: strcpy(str,"CLC"); break;
|
||||
case 0x28: strcpy(str,"PLP"); break;
|
||||
case 0x2A: strcpy(str,"ROL"); break;
|
||||
case 0x38: strcpy(str,"SEC"); break;
|
||||
case 0x40: strcpy(str,"RTI"); break;
|
||||
case 0x48: strcpy(str,"PHA"); break;
|
||||
case 0x4A: strcpy(str,"LSR"); break;
|
||||
case 0x58: strcpy(str,"CLI"); break;
|
||||
case 0x60: strcpy(str,"RTS"); break;
|
||||
case 0x68: strcpy(str,"PLA"); break;
|
||||
case 0x6A: strcpy(str,"ROR"); break;
|
||||
case 0x78: strcpy(str,"SEI"); break;
|
||||
case 0x88: strcpy(str,"DEY"); break;
|
||||
case 0x8A: strcpy(str,"TXA"); break;
|
||||
case 0x98: strcpy(str,"TYA"); break;
|
||||
case 0x9A: strcpy(str,"TXS"); break;
|
||||
case 0xA8: strcpy(str,"TAY"); break;
|
||||
case 0xAA: strcpy(str,"TAX"); break;
|
||||
case 0xB8: strcpy(str,"CLV"); break;
|
||||
case 0xBA: strcpy(str,"TSX"); break;
|
||||
case 0xC8: strcpy(str,"INY"); break;
|
||||
case 0xCA: strcpy(str,"DEX"); break;
|
||||
case 0xD8: strcpy(str,"CLD"); break;
|
||||
case 0xE8: strcpy(str,"INX"); break;
|
||||
case 0xEA: strcpy(str,"NOP"); break;
|
||||
case 0xF8: strcpy(str,"SED"); break;
|
||||
|
||||
//(Indirect,X)
|
||||
case 0x01: strcpy(chr,"ORA"); goto _indirectx;
|
||||
case 0x21: strcpy(chr,"AND"); goto _indirectx;
|
||||
case 0x41: strcpy(chr,"EOR"); goto _indirectx;
|
||||
case 0x61: strcpy(chr,"ADC"); goto _indirectx;
|
||||
case 0x81: strcpy(chr,"STA"); goto _indirectx;
|
||||
case 0xA1: strcpy(chr,"LDA"); goto _indirectx;
|
||||
case 0xC1: strcpy(chr,"CMP"); goto _indirectx;
|
||||
case 0xE1: strcpy(chr,"SBC"); goto _indirectx;
|
||||
_indirectx:
|
||||
indirectX(tmp);
|
||||
sprintf(str,"%s ($%02X,X) @ $%04X = #$%02X", chr,opcode[1],tmp,GetMem(tmp));
|
||||
break;
|
||||
|
||||
//Zero Page
|
||||
case 0x05: strcpy(chr,"ORA"); goto _zeropage;
|
||||
case 0x06: strcpy(chr,"ASL"); goto _zeropage;
|
||||
case 0x24: strcpy(chr,"BIT"); goto _zeropage;
|
||||
case 0x25: strcpy(chr,"AND"); goto _zeropage;
|
||||
case 0x26: strcpy(chr,"ROL"); goto _zeropage;
|
||||
case 0x45: strcpy(chr,"EOR"); goto _zeropage;
|
||||
case 0x46: strcpy(chr,"LSR"); goto _zeropage;
|
||||
case 0x65: strcpy(chr,"ADC"); goto _zeropage;
|
||||
case 0x66: strcpy(chr,"ROR"); goto _zeropage;
|
||||
case 0x84: strcpy(chr,"STY"); goto _zeropage;
|
||||
case 0x85: strcpy(chr,"STA"); goto _zeropage;
|
||||
case 0x86: strcpy(chr,"STX"); goto _zeropage;
|
||||
case 0xA4: strcpy(chr,"LDY"); goto _zeropage;
|
||||
case 0xA5: strcpy(chr,"LDA"); goto _zeropage;
|
||||
case 0xA6: strcpy(chr,"LDX"); goto _zeropage;
|
||||
case 0xC4: strcpy(chr,"CPY"); goto _zeropage;
|
||||
case 0xC5: strcpy(chr,"CMP"); goto _zeropage;
|
||||
case 0xC6: strcpy(chr,"DEC"); goto _zeropage;
|
||||
case 0xE4: strcpy(chr,"CPX"); goto _zeropage;
|
||||
case 0xE5: strcpy(chr,"SBC"); goto _zeropage;
|
||||
case 0xE6: strcpy(chr,"INC"); goto _zeropage;
|
||||
_zeropage:
|
||||
// ################################## Start of SP CODE ###########################
|
||||
// Change width to %04X
|
||||
sprintf(str,"%s $%04X = #$%02X", chr,opcode[1],GetMem(opcode[1]));
|
||||
// ################################## End of SP CODE ###########################
|
||||
break;
|
||||
|
||||
//#Immediate
|
||||
case 0x09: strcpy(chr,"ORA"); goto _immediate;
|
||||
case 0x29: strcpy(chr,"AND"); goto _immediate;
|
||||
case 0x49: strcpy(chr,"EOR"); goto _immediate;
|
||||
case 0x69: strcpy(chr,"ADC"); goto _immediate;
|
||||
//case 0x89: strcpy(chr,"STA"); goto _immediate; //baka, no STA #imm!!
|
||||
case 0xA0: strcpy(chr,"LDY"); goto _immediate;
|
||||
case 0xA2: strcpy(chr,"LDX"); goto _immediate;
|
||||
case 0xA9: strcpy(chr,"LDA"); goto _immediate;
|
||||
case 0xC0: strcpy(chr,"CPY"); goto _immediate;
|
||||
case 0xC9: strcpy(chr,"CMP"); goto _immediate;
|
||||
case 0xE0: strcpy(chr,"CPX"); goto _immediate;
|
||||
case 0xE9: strcpy(chr,"SBC"); goto _immediate;
|
||||
_immediate:
|
||||
sprintf(str,"%s #$%02X", chr,opcode[1]);
|
||||
break;
|
||||
|
||||
//Absolute
|
||||
case 0x0D: strcpy(chr,"ORA"); goto _absolute;
|
||||
case 0x0E: strcpy(chr,"ASL"); goto _absolute;
|
||||
case 0x2C: strcpy(chr,"BIT"); goto _absolute;
|
||||
case 0x2D: strcpy(chr,"AND"); goto _absolute;
|
||||
case 0x2E: strcpy(chr,"ROL"); goto _absolute;
|
||||
case 0x4D: strcpy(chr,"EOR"); goto _absolute;
|
||||
case 0x4E: strcpy(chr,"LSR"); goto _absolute;
|
||||
case 0x6D: strcpy(chr,"ADC"); goto _absolute;
|
||||
case 0x6E: strcpy(chr,"ROR"); goto _absolute;
|
||||
case 0x8C: strcpy(chr,"STY"); goto _absolute;
|
||||
case 0x8D: strcpy(chr,"STA"); goto _absolute;
|
||||
case 0x8E: strcpy(chr,"STX"); goto _absolute;
|
||||
case 0xAC: strcpy(chr,"LDY"); goto _absolute;
|
||||
case 0xAD: strcpy(chr,"LDA"); goto _absolute;
|
||||
case 0xAE: strcpy(chr,"LDX"); goto _absolute;
|
||||
case 0xCC: strcpy(chr,"CPY"); goto _absolute;
|
||||
case 0xCD: strcpy(chr,"CMP"); goto _absolute;
|
||||
case 0xCE: strcpy(chr,"DEC"); goto _absolute;
|
||||
case 0xEC: strcpy(chr,"CPX"); goto _absolute;
|
||||
case 0xED: strcpy(chr,"SBC"); goto _absolute;
|
||||
case 0xEE: strcpy(chr,"INC"); goto _absolute;
|
||||
_absolute:
|
||||
absolute(tmp);
|
||||
sprintf(str,"%s $%04X = #$%02X", chr,tmp,GetMem(tmp));
|
||||
break;
|
||||
|
||||
//branches
|
||||
case 0x10: strcpy(chr,"BPL"); goto _branch;
|
||||
case 0x30: strcpy(chr,"BMI"); goto _branch;
|
||||
case 0x50: strcpy(chr,"BVC"); goto _branch;
|
||||
case 0x70: strcpy(chr,"BVS"); goto _branch;
|
||||
case 0x90: strcpy(chr,"BCC"); goto _branch;
|
||||
case 0xB0: strcpy(chr,"BCS"); goto _branch;
|
||||
case 0xD0: strcpy(chr,"BNE"); goto _branch;
|
||||
case 0xF0: strcpy(chr,"BEQ"); goto _branch;
|
||||
_branch:
|
||||
relative(tmp);
|
||||
sprintf(str,"%s $%04X", chr,tmp);
|
||||
break;
|
||||
|
||||
//(Indirect),Y
|
||||
case 0x11: strcpy(chr,"ORA"); goto _indirecty;
|
||||
case 0x31: strcpy(chr,"AND"); goto _indirecty;
|
||||
case 0x51: strcpy(chr,"EOR"); goto _indirecty;
|
||||
case 0x71: strcpy(chr,"ADC"); goto _indirecty;
|
||||
case 0x91: strcpy(chr,"STA"); goto _indirecty;
|
||||
case 0xB1: strcpy(chr,"LDA"); goto _indirecty;
|
||||
case 0xD1: strcpy(chr,"CMP"); goto _indirecty;
|
||||
case 0xF1: strcpy(chr,"SBC"); goto _indirecty;
|
||||
_indirecty:
|
||||
indirectY(tmp);
|
||||
sprintf(str,"%s ($%02X),Y @ $%04X = #$%02X", chr,opcode[1],tmp,GetMem(tmp));
|
||||
break;
|
||||
|
||||
//Zero Page,X
|
||||
case 0x15: strcpy(chr,"ORA"); goto _zeropagex;
|
||||
case 0x16: strcpy(chr,"ASL"); goto _zeropagex;
|
||||
case 0x35: strcpy(chr,"AND"); goto _zeropagex;
|
||||
case 0x36: strcpy(chr,"ROL"); goto _zeropagex;
|
||||
case 0x55: strcpy(chr,"EOR"); goto _zeropagex;
|
||||
case 0x56: strcpy(chr,"LSR"); goto _zeropagex;
|
||||
case 0x75: strcpy(chr,"ADC"); goto _zeropagex;
|
||||
case 0x76: strcpy(chr,"ROR"); goto _zeropagex;
|
||||
case 0x94: strcpy(chr,"STY"); goto _zeropagex;
|
||||
case 0x95: strcpy(chr,"STA"); goto _zeropagex;
|
||||
case 0xB4: strcpy(chr,"LDY"); goto _zeropagex;
|
||||
case 0xB5: strcpy(chr,"LDA"); goto _zeropagex;
|
||||
case 0xD5: strcpy(chr,"CMP"); goto _zeropagex;
|
||||
case 0xD6: strcpy(chr,"DEC"); goto _zeropagex;
|
||||
case 0xF5: strcpy(chr,"SBC"); goto _zeropagex;
|
||||
case 0xF6: strcpy(chr,"INC"); goto _zeropagex;
|
||||
_zeropagex:
|
||||
zpIndex(tmp,RX);
|
||||
// ################################## Start of SP CODE ###########################
|
||||
// Change width to %04X
|
||||
sprintf(str,"%s $%02X,X @ $%04X = #$%02X", chr,opcode[1],tmp,GetMem(tmp));
|
||||
// ################################## End of SP CODE ###########################
|
||||
break;
|
||||
|
||||
//Absolute,Y
|
||||
case 0x19: strcpy(chr,"ORA"); goto _absolutey;
|
||||
case 0x39: strcpy(chr,"AND"); goto _absolutey;
|
||||
case 0x59: strcpy(chr,"EOR"); goto _absolutey;
|
||||
case 0x79: strcpy(chr,"ADC"); goto _absolutey;
|
||||
case 0x99: strcpy(chr,"STA"); goto _absolutey;
|
||||
case 0xB9: strcpy(chr,"LDA"); goto _absolutey;
|
||||
case 0xBE: strcpy(chr,"LDX"); goto _absolutey;
|
||||
case 0xD9: strcpy(chr,"CMP"); goto _absolutey;
|
||||
case 0xF9: strcpy(chr,"SBC"); goto _absolutey;
|
||||
_absolutey:
|
||||
absolute(tmp);
|
||||
tmp2=(tmp+RY);
|
||||
sprintf(str,"%s $%04X,Y @ $%04X = #$%02X", chr,tmp,tmp2,GetMem(tmp2));
|
||||
break;
|
||||
|
||||
//Absolute,X
|
||||
case 0x1D: strcpy(chr,"ORA"); goto _absolutex;
|
||||
case 0x1E: strcpy(chr,"ASL"); goto _absolutex;
|
||||
case 0x3D: strcpy(chr,"AND"); goto _absolutex;
|
||||
case 0x3E: strcpy(chr,"ROL"); goto _absolutex;
|
||||
case 0x5D: strcpy(chr,"EOR"); goto _absolutex;
|
||||
case 0x5E: strcpy(chr,"LSR"); goto _absolutex;
|
||||
case 0x7D: strcpy(chr,"ADC"); goto _absolutex;
|
||||
case 0x7E: strcpy(chr,"ROR"); goto _absolutex;
|
||||
case 0x9D: strcpy(chr,"STA"); goto _absolutex;
|
||||
case 0xBC: strcpy(chr,"LDY"); goto _absolutex;
|
||||
case 0xBD: strcpy(chr,"LDA"); goto _absolutex;
|
||||
case 0xDD: strcpy(chr,"CMP"); goto _absolutex;
|
||||
case 0xDE: strcpy(chr,"DEC"); goto _absolutex;
|
||||
case 0xFD: strcpy(chr,"SBC"); goto _absolutex;
|
||||
case 0xFE: strcpy(chr,"INC"); goto _absolutex;
|
||||
_absolutex:
|
||||
absolute(tmp);
|
||||
tmp2=(tmp+RX);
|
||||
sprintf(str,"%s $%04X,X @ $%04X = #$%02X", chr,tmp,tmp2,GetMem(tmp2));
|
||||
break;
|
||||
|
||||
//jumps
|
||||
case 0x20: strcpy(chr,"JSR"); goto _jump;
|
||||
case 0x4C: strcpy(chr,"JMP"); goto _jump;
|
||||
case 0x6C: absolute(tmp); sprintf(str,"JMP ($%04X) = $%04X", tmp,GetMem(tmp)|GetMem(tmp+1)<<8); break;
|
||||
_jump:
|
||||
absolute(tmp);
|
||||
sprintf(str,"%s $%04X", chr,tmp);
|
||||
break;
|
||||
|
||||
//Zero Page,Y
|
||||
case 0x96: strcpy(chr,"STX"); goto _zeropagey;
|
||||
case 0xB6: strcpy(chr,"LDX"); goto _zeropagey;
|
||||
_zeropagey:
|
||||
zpIndex(tmp,RY);
|
||||
// ################################## Start of SP CODE ###########################
|
||||
// Change width to %04X
|
||||
sprintf(str,"%s $%04X,Y @ $%04X = #$%02X", chr,opcode[1],tmp,GetMem(tmp));
|
||||
// ################################## End of SP CODE ###########################
|
||||
break;
|
||||
|
||||
//UNDEFINED
|
||||
default: strcpy(str,"ERROR"); break;
|
||||
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2006 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* TXC mappers, originally much complex banksitching
|
||||
*
|
||||
* 01-22111-000 (05-00002-010) (132, 22211) - MGC-001 Qi Wang
|
||||
* 01-22110-000 (52S ) - MGC-002 2-in-1 Gun
|
||||
* 01-22111-100 (02-00002-010) (173 ) - MGC-008 Mahjong Block
|
||||
* (079 ) - MGC-012 Poke Block
|
||||
* 01-22110-200 (05-00002-010) (036 ) - MGC-014 Strike Wolf
|
||||
* 01-22000-400 (05-00002-010) (036 ) - MGC-015 Policeman
|
||||
* 01-22017-000 (05-PT017-080) (189 ) - MGC-017 Thunder Warrior
|
||||
* 01-11160-000 (04-02310-000) ( , 11160) - MGC-023 6-in-1
|
||||
* 01-22270-000 (05-00002-010) (132, 22211) - MGC-xxx Creatom
|
||||
* 01-22200-400 (------------) (079 ) - ET.03 F-15 City War
|
||||
* (172 ) - 1991 Du Ma Racing
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg[4], cmd, is172, is173;
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ reg, 4, "REGS" },
|
||||
{ &cmd, 1, "CMD" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg32(0x8000, (reg[2] >> 2) & 1);
|
||||
if (is172)
|
||||
setchr8((((cmd ^ reg[2]) >> 3) & 2) | (((cmd ^ reg[2]) >> 5) & 1)); // 1991 DU MA Racing probably CHR bank sequence is WRONG, so it is possible to
|
||||
// rearrange CHR banks for normal UNIF board and mapper 172 is unneccessary
|
||||
else
|
||||
setchr8(reg[2] & 3);
|
||||
}
|
||||
|
||||
static DECLFW(UNL22211WriteLo) {
|
||||
// FCEU_printf("bs %04x %02x\n",A,V);
|
||||
reg[A & 3] = V;
|
||||
}
|
||||
|
||||
static DECLFW(UNL22211WriteHi) {
|
||||
// FCEU_printf("bs %04x %02x\n",A,V);
|
||||
cmd = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFR(UNL22211ReadLo) {
|
||||
return (reg[1] ^ reg[2]) | (is173 ? 0x01 : 0x40);
|
||||
// if(reg[3])
|
||||
// return reg[2];
|
||||
// else
|
||||
// return X.DB;
|
||||
}
|
||||
|
||||
static void UNL22211Power(void) {
|
||||
Sync();
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetReadHandler(0x4100, 0x4100, UNL22211ReadLo);
|
||||
SetWriteHandler(0x4100, 0x4103, UNL22211WriteLo);
|
||||
SetWriteHandler(0x8000, 0xFFFF, UNL22211WriteHi);
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void UNL22211_Init(CartInfo *info) {
|
||||
is172 = 0;
|
||||
is173 = 0;
|
||||
info->Power = UNL22211Power;
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void Mapper172_Init(CartInfo *info) {
|
||||
is172 = 1;
|
||||
is173 = 0;
|
||||
info->Power = UNL22211Power;
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void Mapper173_Init(CartInfo *info) {
|
||||
is172 = 0;
|
||||
is173 = 1;
|
||||
info->Power = UNL22211Power;
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2005 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* NTDEC, ASDER games
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg[8];
|
||||
static uint8 mirror, cmd, bank;
|
||||
static uint8 *WRAM = NULL;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &cmd, 1, "CMD" },
|
||||
{ &mirror, 1, "MIRR" },
|
||||
{ &bank, 1, "BANK" },
|
||||
{ reg, 8, "REGS" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setmirror(mirror ^ 1);
|
||||
setprg8(0x8000, reg[0]);
|
||||
setprg8(0xA000, reg[1]);
|
||||
setchr2(0x0000, (reg[2] >> 1));
|
||||
setchr2(0x0800, (reg[3] >> 1));
|
||||
setchr1(0x1000, ((bank & 0x10) << 4) | reg[4]);
|
||||
setchr1(0x1400, ((bank & 0x20) << 3) | reg[5]);
|
||||
setchr1(0x1800, ((bank & 0x40) << 2) | reg[6]);
|
||||
setchr1(0x1C00, ((bank & 0x80) << 1) | reg[7]);
|
||||
}
|
||||
|
||||
static DECLFW(M112Write) {
|
||||
switch (A) {
|
||||
case 0xe000: mirror = V & 1; Sync();; break;
|
||||
case 0x8000: cmd = V & 7; break;
|
||||
case 0xa000: reg[cmd] = V; Sync(); break;
|
||||
case 0xc000: bank = V; Sync(); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void M112Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void M112Power(void) {
|
||||
bank = 0;
|
||||
setprg16(0xC000, ~0);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M112Write);
|
||||
SetWriteHandler(0x4020, 0x5FFF, M112Write);
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper112_Init(CartInfo *info) {
|
||||
info->Power = M112Power;
|
||||
info->Close = M112Close;
|
||||
GameStateRestore = StateRestore;
|
||||
WRAM = (uint8*)FCEU_gmalloc(8192);
|
||||
SetupCartPRGMapping(0x10, WRAM, 8192, 1);
|
||||
AddExState(WRAM, 8192, 0, "WRAM");
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2009 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* 7-in-1 Darkwing Duck, Snake, MagicBlock (PCB marked as "12 in 1")
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg[4];
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ reg, 4, "REGS" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
uint8 bank = (reg[3] & 3) << 3;
|
||||
setchr4(0x0000, (reg[1] >> 3) | (bank << 2));
|
||||
setchr4(0x1000, (reg[2] >> 3) | (bank << 2));
|
||||
if (reg[3] & 8) {
|
||||
setprg32(0x8000, ((reg[2] & 7) >> 1) | bank);
|
||||
} else {
|
||||
setprg16(0x8000, (reg[1] & 7) | bank);
|
||||
setprg16(0xc000, 7 | bank);
|
||||
}
|
||||
setmirror(((reg[3] & 4) >> 2) ^ 1);
|
||||
}
|
||||
|
||||
static DECLFW(BMC12IN1Write) {
|
||||
switch (A) {
|
||||
case 0xafff: reg[0] = V; break;
|
||||
case 0xbfff: reg[1] = V; break;
|
||||
case 0xdfff: reg[2] = V; break;
|
||||
case 0xefff: reg[3] = V; break;
|
||||
}
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void BMC12IN1Power(void) {
|
||||
reg[0] = reg[1] = reg[2] = reg[3] = 0;
|
||||
Sync();
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, BMC12IN1Write);
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void BMC12IN1_Init(CartInfo *info) {
|
||||
info->Power = BMC12IN1Power;
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2006 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint16 latchea;
|
||||
static uint8 latched;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &latchea, 2, "AREG" },
|
||||
{ &latched, 1, "DREG" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
int i;
|
||||
setmirror(((latched >> 6) & 1) ^ 1);
|
||||
switch (latchea) {
|
||||
case 0x8000:
|
||||
for (i = 0; i < 4; i++)
|
||||
setprg8(0x8000 + (i << 13), (((latched & 0x7F) << 1) + i) ^ (latched >> 7));
|
||||
break;
|
||||
case 0x8002:
|
||||
for (i = 0; i < 4; i++)
|
||||
setprg8(0x8000 + (i << 13), ((latched & 0x7F) << 1) + (latched >> 7));
|
||||
break;
|
||||
case 0x8001:
|
||||
case 0x8003:
|
||||
for (i = 0; i < 4; i++) {
|
||||
unsigned int b;
|
||||
b = latched & 0x7F;
|
||||
if (i >= 2 && !(latchea & 0x2))
|
||||
b = 0x7F;
|
||||
setprg8(0x8000 + (i << 13), (i & 1) + ((b << 1) ^ (latched >> 7)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(M15Write) {
|
||||
latchea = A;
|
||||
latched = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M15Power(void) {
|
||||
latchea = 0x8000;
|
||||
latched = 0;
|
||||
setchr8(0);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M15Write);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M15Reset(void) {
|
||||
latchea = 0x8000;
|
||||
latched = 0;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M15Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
void Mapper15_Init(CartInfo *info) {
|
||||
info->Power = M15Power;
|
||||
info->Reset = M15Reset;
|
||||
info->Close = M15Close;
|
||||
GameStateRestore = StateRestore;
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2009 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 chrlo[8], chrhi[8], prg, mirr, mirrisused = 0;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &prg, 1, "PREG" },
|
||||
{ chrlo, 8, "CRGL" },
|
||||
{ chrhi, 8, "CRGH" },
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
uint32 i;
|
||||
for (i = 0; i < 8; i++)
|
||||
setchr1(i << 10, chrlo[i] | (chrhi[i] << 8));
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg16(0x8000, prg);
|
||||
setprg16(0xC000, ~0);
|
||||
if (mirrisused)
|
||||
setmirror(mirr ^ 1);
|
||||
else
|
||||
setmirror(MI_0);
|
||||
}
|
||||
|
||||
static DECLFW(M156Write) {
|
||||
switch (A) {
|
||||
case 0xC000:
|
||||
case 0xC001:
|
||||
case 0xC002:
|
||||
case 0xC003: chrlo[A & 3] = V; Sync(); break;
|
||||
case 0xC004:
|
||||
case 0xC005:
|
||||
case 0xC006:
|
||||
case 0xC007: chrhi[A & 3] = V; Sync(); break;
|
||||
case 0xC008:
|
||||
case 0xC009:
|
||||
case 0xC00A:
|
||||
case 0xC00B: chrlo[4 + (A & 3)] = V; Sync(); break;
|
||||
case 0xC00C:
|
||||
case 0xC00D:
|
||||
case 0xC00E:
|
||||
case 0xC00F: chrhi[4 + (A & 3)] = V; Sync(); break;
|
||||
case 0xC010: prg = V; Sync(); break;
|
||||
case 0xC014: mirr = V; mirrisused = 1; Sync(); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void M156Reset(void) {
|
||||
uint32 i;
|
||||
for (i = 0; i < 8; i++) {
|
||||
chrlo[i] = 0;
|
||||
chrhi[i] = 0;
|
||||
}
|
||||
prg = 0;
|
||||
mirr = 0;
|
||||
mirrisused = 0;
|
||||
}
|
||||
|
||||
static void M156Power(void) {
|
||||
M156Reset();
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetWriteHandler(0xC000, 0xCFFF, M156Write);
|
||||
}
|
||||
|
||||
static void M156Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper156_Init(CartInfo *info) {
|
||||
info->Reset = M156Reset;
|
||||
info->Power = M156Power;
|
||||
info->Close = M156Close;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,229 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2002 Xodnizel 2006 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* It seems that 162/163/164 mappers are the same mapper with just different
|
||||
* mapper modes enabled or disabled in software or hardware, need more nanjing
|
||||
* carts
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 laststrobe, trigger;
|
||||
static uint8 reg[8];
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static writefunc pcmwrite;
|
||||
|
||||
static void (*WSync)(void);
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &laststrobe, 1, "STB" },
|
||||
{ &trigger, 1, "TRG" },
|
||||
{ reg, 8, "REGS" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg32(0x8000, (reg[0] << 4) | (reg[1] & 0xF));
|
||||
setchr8(0);
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
WSync();
|
||||
}
|
||||
|
||||
static DECLFR(ReadLow) {
|
||||
switch (A & 0x7700) {
|
||||
case 0x5100: return reg[2] | reg[0] | reg[1] | reg[3] ^ 0xff; break;
|
||||
case 0x5500:
|
||||
if (trigger)
|
||||
return reg[2] | reg[1]; // Lei Dian Huang Bi Ka Qiu Chuan Shuo (NJ046) may broke other games
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
|
||||
static void M163HB(void) {
|
||||
if (reg[1] & 0x80) {
|
||||
if (scanline == 239) {
|
||||
setchr4(0x0000, 0);
|
||||
setchr4(0x1000, 0);
|
||||
} else if (scanline == 127) {
|
||||
setchr4(0x0000, 1);
|
||||
setchr4(0x1000, 1);
|
||||
}
|
||||
/*
|
||||
if(scanline>=127) // Hu Lu Jin Gang (NJ039) (Ch) [!] don't like it
|
||||
{
|
||||
setchr4(0x0000,1);
|
||||
setchr4(0x1000,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
setchr4(0x0000,0);
|
||||
setchr4(0x1000,0);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(Write) {
|
||||
switch (A & 0x7300) {
|
||||
case 0x5100: reg[0] = V; WSync(); break;
|
||||
case 0x5000: reg[1] = V; WSync(); break;
|
||||
case 0x5300: reg[2] = V; break;
|
||||
case 0x5200: reg[3] = V; WSync(); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void Power(void) {
|
||||
memset(reg, 0, 8);
|
||||
reg[1] = 0xFF;
|
||||
SetWriteHandler(0x5000, 0x5FFF, Write);
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
WSync();
|
||||
}
|
||||
|
||||
static void Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
void Mapper164_Init(CartInfo *info) {
|
||||
info->Power = Power;
|
||||
info->Close = Close;
|
||||
WSync = Sync;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
static DECLFW(Write2) {
|
||||
if (A == 0x5101) {
|
||||
if (laststrobe && !V) {
|
||||
trigger ^= 1;
|
||||
}
|
||||
laststrobe = V;
|
||||
} else if (A == 0x5100 && V == 6) //damn thoose protected games
|
||||
setprg32(0x8000, 3);
|
||||
else
|
||||
switch (A & 0x7300) {
|
||||
case 0x5200: reg[0] = V; WSync(); break;
|
||||
case 0x5000: reg[1] = V; WSync(); if (!(reg[1] & 0x80) && (scanline < 128)) setchr8(0); /* setchr8(0); */ break;
|
||||
case 0x5300: reg[2] = V; break;
|
||||
case 0x5100: reg[3] = V; WSync(); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void Power2(void) {
|
||||
memset(reg, 0, 8);
|
||||
laststrobe = 1;
|
||||
pcmwrite = GetWriteHandler(0x4011);
|
||||
SetReadHandler(0x5000, 0x5FFF, ReadLow);
|
||||
SetWriteHandler(0x5000, 0x5FFF, Write2);
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
WSync();
|
||||
}
|
||||
|
||||
void Mapper163_Init(CartInfo *info) {
|
||||
info->Power = Power2;
|
||||
info->Close = Close;
|
||||
WSync = Sync;
|
||||
GameHBIRQHook = M163HB;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
static void Sync3(void) {
|
||||
setchr8(0);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
switch (reg[3] & 7) {
|
||||
case 0:
|
||||
case 2: setprg32(0x8000, (reg[0] & 0xc) | (reg[1] & 2) | ((reg[2] & 0xf) << 4)); break;
|
||||
case 1:
|
||||
case 3: setprg32(0x8000, (reg[0] & 0xc) | (reg[2] & 0xf) << 4); break;
|
||||
case 4:
|
||||
case 6: setprg32(0x8000, (reg[0] & 0xe) | ((reg[1] >> 1) & 1) | ((reg[2] & 0xf) << 4)); break;
|
||||
case 5:
|
||||
case 7: setprg32(0x8000, (reg[0] & 0xf) | ((reg[2] & 0xf) << 4)); break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(Write3) {
|
||||
// FCEU_printf("bs %04x %02x\n",A,V);
|
||||
reg[(A >> 8) & 3] = V;
|
||||
WSync();
|
||||
}
|
||||
|
||||
static void Power3(void) {
|
||||
reg[0] = 3;
|
||||
reg[1] = 0;
|
||||
reg[2] = 0;
|
||||
reg[3] = 7;
|
||||
SetWriteHandler(0x5000, 0x5FFF, Write3);
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
WSync();
|
||||
}
|
||||
|
||||
void UNLFS304_Init(CartInfo *info) {
|
||||
info->Power = Power3;
|
||||
info->Close = Close;
|
||||
WSync = Sync3;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2009 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg;
|
||||
static uint8 *CHRRAM = NULL;
|
||||
static uint32 CHRRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ ®, 1, "REGS" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setchr4r(0x10, 0x0000, 0);
|
||||
setchr4r(0x10, 0x1000, reg & 0x0f);
|
||||
setprg16(0x8000, reg >> 6);
|
||||
setprg16(0xc000, ~0);
|
||||
}
|
||||
|
||||
static DECLFW(M168Write) {
|
||||
reg = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M168Dummy) {
|
||||
}
|
||||
|
||||
static void M168Power(void) {
|
||||
reg = 0;
|
||||
Sync();
|
||||
SetWriteHandler(0x4020, 0x7fff, M168Dummy);
|
||||
SetWriteHandler(0xB000, 0xB000, M168Write);
|
||||
SetWriteHandler(0xF000, 0xF000, M168Dummy);
|
||||
SetWriteHandler(0xF080, 0xF080, M168Dummy);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
}
|
||||
|
||||
static void MNNNClose(void) {
|
||||
if (CHRRAM)
|
||||
FCEU_gfree(CHRRAM);
|
||||
CHRRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper168_Init(CartInfo *info) {
|
||||
info->Power = M168Power;
|
||||
info->Close = MNNNClose;
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
|
||||
CHRRAMSIZE = 8192 * 8;
|
||||
CHRRAM = (uint8*)FCEU_gmalloc(CHRRAMSIZE);
|
||||
SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSIZE, 1);
|
||||
AddExState(CHRRAM, CHRRAMSIZE, 0, "CRAM");
|
||||
}
|
|
@ -1,158 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2007 CaH4e3
|
||||
* Copyright (C) 2012 FCEUX 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
extern uint32 ROM_size;
|
||||
|
||||
static uint8 prg[4], chr, sbw, we_sram;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[]=
|
||||
{
|
||||
{prg, 4, "PRG"},
|
||||
{&chr, 1, "CHR"},
|
||||
{&sbw, 1, "SBW"},
|
||||
{0}
|
||||
};
|
||||
|
||||
static void Sync(void)
|
||||
{
|
||||
setprg8r(0x10,0x6000,0);
|
||||
setprg8(0x8000,prg[0]);
|
||||
setprg8(0xA000,prg[1]);
|
||||
setprg8(0xC000,prg[2]);
|
||||
setprg8(0xE000,prg[3]);
|
||||
|
||||
setchr8(chr);
|
||||
}
|
||||
|
||||
static DECLFW(M176Write_5001)
|
||||
{
|
||||
printf("%04X = $%02X\n",A,V);
|
||||
if(sbw)
|
||||
{
|
||||
prg[0] = V*4;
|
||||
prg[1] = V*4+1;
|
||||
prg[2] = V*4+2;
|
||||
prg[3] = V*4+3;
|
||||
}
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M176Write_5010)
|
||||
{
|
||||
printf("%04X = $%02X\n",A,V);
|
||||
if(V == 0x24) sbw = 1;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M176Write_5011)
|
||||
{
|
||||
printf("%04X = $%02X\n",A,V);
|
||||
V >>= 1;
|
||||
if(sbw)
|
||||
{
|
||||
prg[0] = V*4;
|
||||
prg[1] = V*4+1;
|
||||
prg[2] = V*4+2;
|
||||
prg[3] = V*4+3;
|
||||
}
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M176Write_5FF1)
|
||||
{
|
||||
printf("%04X = $%02X\n",A,V);
|
||||
V >>= 1;
|
||||
prg[0] = V*4;
|
||||
prg[1] = V*4+1;
|
||||
prg[2] = V*4+2;
|
||||
prg[3] = V*4+3;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M176Write_5FF2)
|
||||
{
|
||||
printf("%04X = $%02X\n",A,V);
|
||||
chr = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M176Write_A001)
|
||||
{
|
||||
we_sram = V & 0x03;
|
||||
}
|
||||
|
||||
static DECLFW(M176Write_WriteSRAM)
|
||||
{
|
||||
// if(we_sram)
|
||||
CartBW(A,V);
|
||||
}
|
||||
|
||||
static void M176Power(void)
|
||||
{
|
||||
SetReadHandler(0x6000,0x7fff,CartBR);
|
||||
SetWriteHandler(0x6000,0x7fff,M176Write_WriteSRAM);
|
||||
SetReadHandler(0x8000,0xFFFF,CartBR);
|
||||
SetWriteHandler(0xA001,0xA001,M176Write_A001);
|
||||
SetWriteHandler(0x5001,0x5001,M176Write_5001);
|
||||
SetWriteHandler(0x5010,0x5010,M176Write_5010);
|
||||
SetWriteHandler(0x5011,0x5011,M176Write_5011);
|
||||
SetWriteHandler(0x5ff1,0x5ff1,M176Write_5FF1);
|
||||
SetWriteHandler(0x5ff2,0x5ff2,M176Write_5FF2);
|
||||
|
||||
we_sram = 0;
|
||||
sbw = 0;
|
||||
prg[0] = 0;
|
||||
prg[1] = 1;
|
||||
prg[2] = (ROM_size-2)&63;
|
||||
prg[3] = (ROM_size-1)&63;
|
||||
Sync();
|
||||
}
|
||||
|
||||
|
||||
static void M176Close(void)
|
||||
{
|
||||
if(WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version)
|
||||
{
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper176_Init(CartInfo *info)
|
||||
{
|
||||
info->Power=M176Power;
|
||||
info->Close=M176Close;
|
||||
|
||||
GameStateRestore=StateRestore;
|
||||
|
||||
WRAMSIZE=8192;
|
||||
WRAM=(uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10,WRAM,WRAMSIZE,1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,80 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2007 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg;
|
||||
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ ®, 1, "REG" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setchr8(0);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg32(0x8000, reg & 0x1f);
|
||||
setmirror(((reg & 0x20) >> 5) ^ 1);
|
||||
}
|
||||
|
||||
static DECLFW(M177Write) {
|
||||
reg = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M177Power(void) {
|
||||
reg = 0;
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0x7fff, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7fff, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M177Write);
|
||||
}
|
||||
|
||||
static void M177Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper177_Init(CartInfo *info) {
|
||||
info->Power = M177Power;
|
||||
info->Close = M177Close;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,176 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2013 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* DSOUNDV1/FL-TR8MA boards (32K WRAM, 8/16M), 178 mapper boards (8K WRAM, 4/8M)
|
||||
* Various Education Cartridges
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg[4];
|
||||
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
// SND Registers
|
||||
static uint8 pcm_enable = 0;
|
||||
static int16 pcm_latch = 0x3F6, pcm_clock = 0x3F6;
|
||||
static writefunc pcmwrite;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ reg, 4, "REGS" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static int16 step_size[49] = {
|
||||
16, 17, 19, 21, 23, 25, 28, 31, 34, 37,
|
||||
41, 45, 50, 55, 60, 66, 73, 80, 88, 97,
|
||||
107, 118, 130, 143, 157, 173, 190, 209, 230, 253,
|
||||
279, 307, 337, 371, 408, 449, 494, 544, 598, 658,
|
||||
724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552
|
||||
}; //49 items
|
||||
static int32 step_adj[16] = { -1, -1, -1, -1, 2, 5, 7, 9, -1, -1, -1, -1, 2, 5, 7, 9 };
|
||||
|
||||
//decode stuff
|
||||
static int32 jedi_table[16 * 49];
|
||||
static int32 acc = 0; //ADPCM accumulator, initial condition must be 0
|
||||
static int32 decstep = 0; //ADPCM decoding step, initial condition must be 0
|
||||
|
||||
static void jedi_table_init() {
|
||||
int step, nib;
|
||||
|
||||
for (step = 0; step < 49; step++) {
|
||||
for (nib = 0; nib < 16; nib++) {
|
||||
int value = (2 * (nib & 0x07) + 1) * step_size[step] / 8;
|
||||
jedi_table[step * 16 + nib] = ((nib & 0x08) != 0) ? -value : value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static uint8 decode(uint8 code) {
|
||||
acc += jedi_table[decstep + code];
|
||||
if ((acc & ~0x7ff) != 0) // acc is > 2047
|
||||
acc |= ~0xfff;
|
||||
else acc &= 0xfff;
|
||||
decstep += step_adj[code & 7] * 16;
|
||||
if (decstep < 0) decstep = 0;
|
||||
if (decstep > 48 * 16) decstep = 48 * 16;
|
||||
return (acc >> 8) & 0xff;
|
||||
}
|
||||
|
||||
static void Sync(void) {
|
||||
uint32 sbank = reg[1] & 0x7;
|
||||
uint32 bbank = reg[2];
|
||||
setchr8(0);
|
||||
setprg8r(0x10, 0x6000, reg[3] & 3);
|
||||
if (reg[0] & 2) { // UNROM mode
|
||||
setprg16(0x8000, (bbank << 3) | sbank);
|
||||
if (reg[0] & 4)
|
||||
setprg16(0xC000, (bbank << 3) | 6 | (reg[1] & 1));
|
||||
else
|
||||
setprg16(0xC000, (bbank << 3) | 7);
|
||||
} else { // NROM mode
|
||||
uint32 bank = (bbank << 3) | sbank;
|
||||
if (reg[0] & 4) {
|
||||
setprg16(0x8000, bank);
|
||||
setprg16(0xC000, bank);
|
||||
} else
|
||||
setprg32(0x8000, bank >> 1);
|
||||
}
|
||||
setmirror((reg[0] & 1) ^ 1);
|
||||
}
|
||||
|
||||
static DECLFW(M178Write) {
|
||||
reg[A & 3] = V;
|
||||
// FCEU_printf("cmd %04x:%02x\n", A, V);
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M178WriteSnd) {
|
||||
if (A == 0x5800) {
|
||||
if (V & 0xF0) {
|
||||
pcm_enable = 1;
|
||||
// pcmwrite(0x4011, (V & 0xF) << 3);
|
||||
pcmwrite(0x4011, decode(V & 0xf));
|
||||
} else
|
||||
pcm_enable = 0;
|
||||
} else
|
||||
FCEU_printf("misc %04x:%02x\n", A, V);
|
||||
}
|
||||
|
||||
static DECLFR(M178ReadSnd) {
|
||||
if (A == 0x5800)
|
||||
return (X.DB & 0xBF) | ((pcm_enable ^ 1) << 6);
|
||||
else
|
||||
return X.DB;
|
||||
}
|
||||
|
||||
static void M178Power(void) {
|
||||
reg[0] = reg[1] = reg[2] = reg[3] = 0;
|
||||
Sync();
|
||||
pcmwrite = GetWriteHandler(0x4011);
|
||||
SetWriteHandler(0x4800, 0x4fff, M178Write);
|
||||
SetWriteHandler(0x5800, 0x5fff, M178WriteSnd);
|
||||
SetReadHandler(0x5800, 0x5fff, M178ReadSnd);
|
||||
SetReadHandler(0x6000, 0x7fff, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7fff, CartBW);
|
||||
SetReadHandler(0x8000, 0xffff, CartBR);
|
||||
}
|
||||
|
||||
static void M178SndClk(int a) {
|
||||
if (pcm_enable) {
|
||||
pcm_latch -= a;
|
||||
if (pcm_latch <= 0) {
|
||||
pcm_latch += pcm_clock;
|
||||
pcm_enable = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void M178Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper178_Init(CartInfo *info) {
|
||||
info->Power = M178Power;
|
||||
info->Close = M178Close;
|
||||
GameStateRestore = StateRestore;
|
||||
MapIRQHook = M178SndClk;
|
||||
|
||||
jedi_table_init();
|
||||
|
||||
WRAMSIZE = 32768;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,133 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2012 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 preg[4], creg[8];
|
||||
static uint8 IRQa, mirr;
|
||||
static int32 IRQCount, IRQLatch;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ preg, 4, "PREG" },
|
||||
{ creg, 8, "CREG" },
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ &IRQa, 1, "IRQA" },
|
||||
{ &IRQCount, 4, "IRQC" },
|
||||
{ &IRQLatch, 4, "IRQL" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
int i;
|
||||
for (i = 0; i < 8; i++) setchr1(i << 10, creg[i]);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg8(0x8000, preg[0]);
|
||||
setprg8(0xA000, preg[1]);
|
||||
setprg8(0xC000, preg[2]);
|
||||
setprg8(0xE000, ~0);
|
||||
if (mirr & 2)
|
||||
setmirror(MI_0);
|
||||
else
|
||||
setmirror(mirr & 1);
|
||||
}
|
||||
|
||||
static DECLFW(M18WriteIRQ) {
|
||||
switch (A & 0xF003) {
|
||||
case 0xE000: IRQLatch &= 0xFFF0; IRQLatch |= (V & 0x0f) << 0x0; break;
|
||||
case 0xE001: IRQLatch &= 0xFF0F; IRQLatch |= (V & 0x0f) << 0x4; break;
|
||||
case 0xE002: IRQLatch &= 0xF0FF; IRQLatch |= (V & 0x0f) << 0x8; break;
|
||||
case 0xE003: IRQLatch &= 0x0FFF; IRQLatch |= (V & 0x0f) << 0xC; break;
|
||||
case 0xF000: IRQCount = IRQLatch; break;
|
||||
case 0xF001: IRQa = V & 1; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
case 0xF002: mirr = V & 3; Sync(); break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(M18WritePrg) {
|
||||
uint32 i = ((A >> 1) & 1) | ((A - 0x8000) >> 11);
|
||||
preg[i] &= (0xF0) >> ((A & 1) << 2);
|
||||
preg[i] |= (V & 0xF) << ((A & 1) << 2);
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M18WriteChr) {
|
||||
uint32 i = ((A >> 1) & 1) | ((A - 0xA000) >> 11);
|
||||
creg[i] &= (0xF0) >> ((A & 1) << 2);
|
||||
creg[i] |= (V & 0xF) << ((A & 1) << 2);
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M18Power(void) {
|
||||
IRQa = 0;
|
||||
preg[0] = 0;
|
||||
preg[1] = 1;
|
||||
preg[2] = ~1;
|
||||
preg[3] = ~0;
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetWriteHandler(0x8000, 0x9FFF, M18WritePrg);
|
||||
SetWriteHandler(0xA000, 0xDFFF, M18WriteChr);
|
||||
SetWriteHandler(0xE000, 0xFFFF, M18WriteIRQ);
|
||||
}
|
||||
|
||||
static void M18IRQHook(int a) {
|
||||
if (IRQa && IRQCount) {
|
||||
IRQCount -= a;
|
||||
if (IRQCount <= 0) {
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
IRQCount = 0;
|
||||
IRQa = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void M18Close(void)
|
||||
{
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper18_Init(CartInfo *info) {
|
||||
info->Power = M18Power;
|
||||
info->Close = M18Close;
|
||||
MapIRQHook = M18IRQHook;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2005 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Family Study Box by Fukutake Shoten
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 SWRAM[3072];
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint8 regs[4];
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ regs, 4, "DREG" },
|
||||
{ SWRAM, 3072, "SWRM" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg8r(0x10, 0x6000, regs[0] >> 6);
|
||||
setprg16(0x8000, regs[1]);
|
||||
setprg16(0xc000, 0);
|
||||
}
|
||||
|
||||
static DECLFW(M186Write) {
|
||||
if (A & 0x4203) regs[A & 3] = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFR(M186Read) {
|
||||
switch (A) {
|
||||
case 0x4200: return 0x00; break;
|
||||
case 0x4201: return 0x00; break;
|
||||
case 0x4202: return 0x40; break;
|
||||
case 0x4203: return 0x00; break;
|
||||
}
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
static DECLFR(ASWRAM) {
|
||||
return(SWRAM[A - 0x4400]);
|
||||
}
|
||||
static DECLFW(BSWRAM) {
|
||||
SWRAM[A - 0x4400] = V;
|
||||
}
|
||||
|
||||
static void M186Power(void) {
|
||||
setchr8(0);
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0xFFFF, CartBW);
|
||||
SetReadHandler(0x4200, 0x43FF, M186Read);
|
||||
SetWriteHandler(0x4200, 0x43FF, M186Write);
|
||||
SetReadHandler(0x4400, 0x4FFF, ASWRAM);
|
||||
SetWriteHandler(0x4400, 0x4FFF, BSWRAM);
|
||||
regs[0] = regs[1] = regs[2] = regs[3];
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M186Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void M186Restore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper186_Init(CartInfo *info) {
|
||||
info->Power = M186Power;
|
||||
info->Close = M186Close;
|
||||
GameStateRestore = M186Restore;
|
||||
WRAM = (uint8*)FCEU_gmalloc(32768);
|
||||
SetupCartPRGMapping(0x10, WRAM, 32768, 1);
|
||||
AddExState(WRAM, 32768, 0, "WRAM");
|
||||
AddExState(StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2011 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 prot[4], prg, mode, chr, mirr;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ prot, 4, "PROT" },
|
||||
{ &prg, 1, "PRG" },
|
||||
{ &chr, 1, "CHR" },
|
||||
{ &mode, 1, "MODE" },
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
if (mode) {
|
||||
setprg16(0x8000, prg);
|
||||
setprg16(0xC000, prg);
|
||||
} else
|
||||
setprg32(0x8000, prg >> 1);
|
||||
setchr8(chr);
|
||||
setmirror(mirr);
|
||||
}
|
||||
|
||||
static DECLFW(M225Write) {
|
||||
uint32 bank = (A >> 14) & 1;
|
||||
mirr = (A >> 13) & 1;
|
||||
mode = (A >> 12) & 1;
|
||||
chr = (A & 0x3f) | (bank << 6);
|
||||
prg = ((A >> 6) & 0x3f) | (bank << 6);
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M225LoWrite) {
|
||||
}
|
||||
|
||||
static DECLFR(M225LoRead) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void M225Power(void) {
|
||||
prg = 0;
|
||||
mode = 0;
|
||||
Sync();
|
||||
SetReadHandler(0x5000, 0x5FFF, M225LoRead);
|
||||
SetWriteHandler(0x5000, 0x5FFF, M225LoWrite);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M225Write);
|
||||
}
|
||||
|
||||
static void M225Reset(void) {
|
||||
prg = 0;
|
||||
mode = 0;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper225_Init(CartInfo *info) {
|
||||
info->Reset = M225Reset;
|
||||
info->Power = M225Power;
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2012 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 regs[8];
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ regs, 8, "REGS" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg2r(0x10, 0x6800, 0);
|
||||
setprg8(0x8000, regs[0]);
|
||||
setprg8(0xA000, regs[1]);
|
||||
setprg8(0xC000, regs[2]);
|
||||
setprg8(0xE000, regs[3]);
|
||||
setchr2(0x0000, regs[4]);
|
||||
setchr2(0x0800, regs[5]);
|
||||
setchr2(0x1000, regs[6]);
|
||||
setchr2(0x1800, regs[7]);
|
||||
}
|
||||
|
||||
static DECLFW(M246Write) {
|
||||
regs[A & 7] = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M246Power(void) {
|
||||
regs[0] = regs[1] = regs[2] = regs[3] = ~0;
|
||||
Sync();
|
||||
SetWriteHandler(0x6000, 0x67FF, M246Write);
|
||||
SetReadHandler(0x6800, 0x6FFF, CartBR);
|
||||
SetWriteHandler(0x6800, 0x6FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
}
|
||||
|
||||
static void M246Close(void)
|
||||
{
|
||||
if(WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper246_Init(CartInfo *info) {
|
||||
info->Power = M246Power;
|
||||
info->Close = M246Close;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 2048;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2009 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 creg[8], preg[2];
|
||||
static int32 IRQa, IRQCount, IRQClock, IRQLatch;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
static uint8 *CHRRAM = NULL;
|
||||
static uint32 CHRRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ creg, 8, "CREG" },
|
||||
{ preg, 2, "PREG" },
|
||||
{ &IRQa, 4, "IRQA" },
|
||||
{ &IRQCount, 4, "IRQC" },
|
||||
{ &IRQLatch, 4, "IRQL" },
|
||||
{ &IRQClock, 4, "IRQK" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
uint8 i;
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg8(0x8000, preg[0]);
|
||||
setprg8(0xa000, preg[1]);
|
||||
setprg8(0xc000, ~1);
|
||||
setprg8(0xe000, ~0);
|
||||
for (i = 0; i < 8; i++)
|
||||
if ((creg[i] == 6) || (creg[i] == 7))
|
||||
setchr1r(0x10, i << 10, creg[i] & 1);
|
||||
else
|
||||
setchr1(i << 10, creg[i]);
|
||||
}
|
||||
|
||||
static DECLFW(M252Write) {
|
||||
if ((A >= 0xB000) && (A <= 0xEFFF)) {
|
||||
uint8 ind = ((((A & 8) | (A >> 8)) >> 3) + 2) & 7;
|
||||
uint8 sar = A & 4;
|
||||
creg[ind] = (creg[ind] & (0xF0 >> sar)) | ((V & 0x0F) << sar);
|
||||
Sync();
|
||||
} else
|
||||
switch (A & 0xF00C) {
|
||||
case 0x8000:
|
||||
case 0x8004:
|
||||
case 0x8008:
|
||||
case 0x800C: preg[0] = V; Sync(); break;
|
||||
case 0xA000:
|
||||
case 0xA004:
|
||||
case 0xA008:
|
||||
case 0xA00C: preg[1] = V; Sync(); break;
|
||||
case 0xF000: X6502_IRQEnd(FCEU_IQEXT); IRQLatch &= 0xF0; IRQLatch |= V & 0xF; break;
|
||||
case 0xF004: X6502_IRQEnd(FCEU_IQEXT); IRQLatch &= 0x0F; IRQLatch |= V << 4; break;
|
||||
case 0xF008: X6502_IRQEnd(FCEU_IQEXT); IRQClock = 0; IRQCount = IRQLatch; IRQa = V & 2; break;
|
||||
}
|
||||
}
|
||||
|
||||
static void M252Power(void) {
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M252Write);
|
||||
}
|
||||
|
||||
static void M252IRQ(int a) {
|
||||
#define LCYCS 341
|
||||
if (IRQa) {
|
||||
IRQClock += a * 3;
|
||||
if (IRQClock >= LCYCS) {
|
||||
while (IRQClock >= LCYCS) {
|
||||
IRQClock -= LCYCS;
|
||||
IRQCount++;
|
||||
if (IRQCount & 0x100) {
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
IRQCount = IRQLatch;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void M252Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
if (CHRRAM)
|
||||
FCEU_gfree(CHRRAM);
|
||||
WRAM = CHRRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper252_Init(CartInfo *info) {
|
||||
info->Power = M252Power;
|
||||
info->Close = M252Close;
|
||||
MapIRQHook = M252IRQ;
|
||||
|
||||
CHRRAMSIZE = 2048;
|
||||
CHRRAM = (uint8*)FCEU_gmalloc(CHRRAMSIZE);
|
||||
SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSIZE, 1);
|
||||
AddExState(CHRRAM, CHRRAMSIZE, 0, "CRAM");
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,151 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2009 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 chrlo[8], chrhi[8], prg[2], mirr, vlock;
|
||||
static int32 IRQa, IRQCount, IRQLatch, IRQClock;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
static uint8 *CHRRAM = NULL;
|
||||
static uint32 CHRRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ chrlo, 8, "CHRL" },
|
||||
{ chrhi, 8, "CHRH" },
|
||||
{ prg, 2, "PRGR" },
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ &vlock, 1, "VLCK" },
|
||||
{ &IRQa, 4, "IRQA" },
|
||||
{ &IRQCount, 4, "IRQC" },
|
||||
{ &IRQLatch, 4, "IRQL" },
|
||||
{ &IRQClock, 4, "IRQK" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
uint8 i;
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg8(0x8000, prg[0]);
|
||||
setprg8(0xa000, prg[1]);
|
||||
setprg8(0xc000, ~1);
|
||||
setprg8(0xe000, ~0);
|
||||
for (i = 0; i < 8; i++) {
|
||||
uint32 chr = chrlo[i] | (chrhi[i] << 8);
|
||||
if (((chrlo[i] == 4) || (chrlo[i] == 5)) && !vlock)
|
||||
setchr1r(0x10, i << 10, chr & 1);
|
||||
else
|
||||
setchr1(i << 10, chr);
|
||||
}
|
||||
switch (mirr) {
|
||||
case 0: setmirror(MI_V); break;
|
||||
case 1: setmirror(MI_H); break;
|
||||
case 2: setmirror(MI_0); break;
|
||||
case 3: setmirror(MI_1); break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(M253Write) {
|
||||
if ((A >= 0xB000) && (A <= 0xE00C)) {
|
||||
uint8 ind = ((((A & 8) | (A >> 8)) >> 3) + 2) & 7;
|
||||
uint8 sar = A & 4;
|
||||
uint8 clo = (chrlo[ind] & (0xF0 >> sar)) | ((V & 0x0F) << sar);
|
||||
chrlo[ind] = clo;
|
||||
if (ind == 0) {
|
||||
if (clo == 0xc8)
|
||||
vlock = 0;
|
||||
else if (clo == 0x88)
|
||||
vlock = 1;
|
||||
}
|
||||
if (sar)
|
||||
chrhi[ind] = V >> 4;
|
||||
Sync();
|
||||
} else
|
||||
switch (A) {
|
||||
case 0x8010: prg[0] = V; Sync(); break;
|
||||
case 0xA010: prg[1] = V; Sync(); break;
|
||||
case 0x9400: mirr = V & 3; Sync(); break;
|
||||
case 0xF000: X6502_IRQEnd(FCEU_IQEXT); IRQLatch &= 0xF0; IRQLatch |= V & 0xF; break;
|
||||
case 0xF004: X6502_IRQEnd(FCEU_IQEXT); IRQLatch &= 0x0F; IRQLatch |= V << 4; break;
|
||||
case 0xF008: X6502_IRQEnd(FCEU_IQEXT); IRQClock = 0; IRQCount = IRQLatch; IRQa = V & 2; break;
|
||||
}
|
||||
}
|
||||
|
||||
static void M253Power(void) {
|
||||
vlock = 0;
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M253Write);
|
||||
}
|
||||
|
||||
static void M253Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
if (CHRRAM)
|
||||
FCEU_gfree(CHRRAM);
|
||||
WRAM = CHRRAM = NULL;
|
||||
}
|
||||
|
||||
static void M253IRQ(int a) {
|
||||
#define LCYCS 341
|
||||
if (IRQa) {
|
||||
IRQClock += a * 3;
|
||||
if (IRQClock >= LCYCS) {
|
||||
while (IRQClock >= LCYCS) {
|
||||
IRQClock -= LCYCS;
|
||||
IRQCount++;
|
||||
if (IRQCount & 0x100) {
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
IRQCount = IRQLatch;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper253_Init(CartInfo *info) {
|
||||
info->Power = M253Power;
|
||||
info->Close = M253Close;
|
||||
MapIRQHook = M253IRQ;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
CHRRAMSIZE = 2048;
|
||||
CHRRAM = (uint8*)FCEU_gmalloc(CHRRAMSIZE);
|
||||
SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSIZE, 1);
|
||||
AddExState(CHRRAM, CHRRAMSIZE, 0, "CRAM");
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,216 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2012 FCEUX team
|
||||
|
||||
This file 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 file 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 the this software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
// http://wiki.nesdev.com/w/index.php/INES_Mapper_028
|
||||
|
||||
//config
|
||||
static int prg_mask_16k;
|
||||
|
||||
// state
|
||||
uint8 reg;
|
||||
uint8 chr;
|
||||
uint8 prg;
|
||||
uint8 mode;
|
||||
uint8 outer;
|
||||
|
||||
void SyncMirror()
|
||||
{
|
||||
switch (mode & 3)
|
||||
{
|
||||
case 0: setmirror(MI_0); break;
|
||||
case 1: setmirror(MI_1); break;
|
||||
case 2: setmirror(MI_V); break;
|
||||
case 3: setmirror(MI_H); break;
|
||||
}
|
||||
}
|
||||
|
||||
void Mirror(uint8 value)
|
||||
{
|
||||
if ((mode & 2) == 0)
|
||||
{
|
||||
mode &= 0xfe;
|
||||
mode |= value >> 4 & 1;
|
||||
}
|
||||
SyncMirror();
|
||||
}
|
||||
|
||||
|
||||
static void Sync()
|
||||
{
|
||||
int prglo;
|
||||
int prghi;
|
||||
|
||||
int outb = outer << 1;
|
||||
//this can probably be rolled up, but i have no motivation to do so
|
||||
//until it's been tested
|
||||
switch (mode & 0x3c)
|
||||
{
|
||||
//32K modes
|
||||
case 0x00:
|
||||
case 0x04:
|
||||
prglo = outb;
|
||||
prghi = outb | 1;
|
||||
break;
|
||||
case 0x10:
|
||||
case 0x14:
|
||||
prglo = outb & ~2 | prg << 1 & 2;
|
||||
prghi = outb & ~2 | prg << 1 & 2 | 1;
|
||||
break;
|
||||
case 0x20:
|
||||
case 0x24:
|
||||
prglo = outb & ~6 | prg << 1 & 6;
|
||||
prghi = outb & ~6 | prg << 1 & 6 | 1;
|
||||
break;
|
||||
case 0x30:
|
||||
case 0x34:
|
||||
prglo = outb & ~14 | prg << 1 & 14;
|
||||
prghi = outb & ~14 | prg << 1 & 14 | 1;
|
||||
break;
|
||||
//bottom fixed modes
|
||||
case 0x08:
|
||||
prglo = outb;
|
||||
prghi = outb | prg & 1;
|
||||
break;
|
||||
case 0x18:
|
||||
prglo = outb;
|
||||
prghi = outb & ~2 | prg & 3;
|
||||
break;
|
||||
case 0x28:
|
||||
prglo = outb;
|
||||
prghi = outb & ~6 | prg & 7;
|
||||
break;
|
||||
case 0x38:
|
||||
prglo = outb;
|
||||
prghi = outb & ~14 | prg & 15;
|
||||
break;
|
||||
//top fixed modes
|
||||
case 0x0c:
|
||||
prglo = outb | prg & 1;
|
||||
prghi = outb | 1;
|
||||
break;
|
||||
case 0x1c:
|
||||
prglo = outb & ~2 | prg & 3;
|
||||
prghi = outb | 1;
|
||||
break;
|
||||
case 0x2c:
|
||||
prglo = outb & ~6 | prg & 7;
|
||||
prghi = outb | 1;
|
||||
break;
|
||||
case 0x3c:
|
||||
prglo = outb & ~14 | prg & 15;
|
||||
prghi = outb | 1;
|
||||
break;
|
||||
}
|
||||
prglo &= prg_mask_16k;
|
||||
prghi &= prg_mask_16k;
|
||||
|
||||
setprg16(0x8000, prglo);
|
||||
setprg16(0xC000, prghi);
|
||||
setchr8(chr);
|
||||
}
|
||||
|
||||
static DECLFW(WriteEXP)
|
||||
{
|
||||
uint32 addr = A;
|
||||
uint8 value = V;
|
||||
reg = value & 0x81;
|
||||
}
|
||||
|
||||
static DECLFW(WritePRG)
|
||||
{
|
||||
uint32 addr = A;
|
||||
uint8 value = V;
|
||||
switch (reg)
|
||||
{
|
||||
case 0x00:
|
||||
chr = value & 3;
|
||||
Mirror(value);
|
||||
break;
|
||||
case 0x01:
|
||||
prg = value & 15;
|
||||
Mirror(value);
|
||||
Sync();
|
||||
break;
|
||||
case 0x80:
|
||||
mode = value & 63;
|
||||
SyncMirror();
|
||||
Sync();
|
||||
break;
|
||||
case 0x81:
|
||||
outer = value & 63;
|
||||
Sync();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void M28Reset(void)
|
||||
{
|
||||
outer = 63;
|
||||
prg = 15;
|
||||
Sync();
|
||||
}
|
||||
|
||||
|
||||
static void M28Power(void)
|
||||
{
|
||||
prg_mask_16k = PRGsize[0] - 1;
|
||||
|
||||
//EXP
|
||||
SetWriteHandler(0x5000,0x5FFF,WriteEXP);
|
||||
|
||||
//PRG
|
||||
SetWriteHandler(0x8000,0xFFFF,WritePRG);
|
||||
SetReadHandler(0x8000,0xFFFF,CartBR);
|
||||
|
||||
//WRAM
|
||||
SetReadHandler(0x6000,0x7FFF,CartBR);
|
||||
SetWriteHandler(0x6000,0x7FFF,CartBW);
|
||||
|
||||
M28Reset();
|
||||
}
|
||||
|
||||
static void M28Close(void)
|
||||
{
|
||||
}
|
||||
|
||||
static SFORMAT StateRegs[]=
|
||||
{
|
||||
{®, 1, "REG"},
|
||||
{&chr, 1, "CHR"},
|
||||
{&prg, 1, "PRG"},
|
||||
{&mode, 1, "MODE"},
|
||||
{&outer, 1, "OUTR"},
|
||||
{0}
|
||||
};
|
||||
|
||||
static void StateRestore(int version)
|
||||
{
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper28_Init(CartInfo* info)
|
||||
{
|
||||
info->Power=M28Power;
|
||||
info->Reset=M28Reset;
|
||||
info->Close=M28Close;
|
||||
GameStateRestore=StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,102 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2012 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 preg[2], creg[8], mirr;
|
||||
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ preg, 4, "PREG" },
|
||||
{ creg, 8, "CREG" },
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
uint16 swap = ((mirr & 2) << 13);
|
||||
setmirror((mirr & 1) ^ 1);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg8(0x8000 ^ swap, preg[0]);
|
||||
setprg8(0xA000, preg[1]);
|
||||
setprg8(0xC000 ^ swap, ~1);
|
||||
setprg8(0xE000, ~0);
|
||||
uint8 i;
|
||||
for (i = 0; i < 8; i++)
|
||||
setchr1(i << 10, creg[i]);
|
||||
}
|
||||
|
||||
static DECLFW(M32Write0) {
|
||||
preg[0] = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M32Write1) {
|
||||
mirr = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M32Write2) {
|
||||
preg[1] = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M32Write3) {
|
||||
creg[A & 7] = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M32Power(void) {
|
||||
Sync();
|
||||
SetReadHandler(0x6000,0x7fff,CartBR);
|
||||
SetWriteHandler(0x6000,0x7fff,CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0x8FFF, M32Write0);
|
||||
SetWriteHandler(0x9000, 0x9FFF, M32Write1);
|
||||
SetWriteHandler(0xA000, 0xAFFF, M32Write2);
|
||||
SetWriteHandler(0xB000, 0xBFFF, M32Write3);
|
||||
}
|
||||
|
||||
static void M32Close(void)
|
||||
{
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper32_Init(CartInfo *info) {
|
||||
info->Power = M32Power;
|
||||
info->Close = M32Close;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2012 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Many-in-one hacked mapper crap.
|
||||
*
|
||||
* Original BNROM is actually AxROM variations without mirroring control,
|
||||
* and haven't SRAM on-board, so it must be removed from here
|
||||
*
|
||||
* Difficult banking is what NINA board doing, most hacks for 34 mapper are
|
||||
* NINA hacks, so this is actually 34 mapper
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 regs[3];
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ regs, 3, "REGS" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg32(0x8000, regs[0]);
|
||||
setchr4(0x0000, regs[1]);
|
||||
setchr4(0x1000, regs[2]);
|
||||
}
|
||||
|
||||
static DECLFW(M34Write) {
|
||||
if (A >= 0x8000)
|
||||
regs[0] = V;
|
||||
else
|
||||
switch (A) {
|
||||
case 0x7ffd: regs[0] = V; break;
|
||||
case 0x7ffe: regs[1] = V; break;
|
||||
case 0x7fff: regs[2] = V; break;
|
||||
}
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M34Power(void) {
|
||||
regs[0] = regs[1] = 0;
|
||||
regs[2] = 1;
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0x7ffc, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7ffc, CartBW);
|
||||
SetReadHandler(0x8000, 0xffff, CartBR);
|
||||
SetWriteHandler(0x7ffd, 0xffff, M34Write);
|
||||
}
|
||||
|
||||
static void M34Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper34_Init(CartInfo *info) {
|
||||
info->Power = M34Power;
|
||||
info->Close = M34Close;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2012 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* TXC/Micro Genius simplified mapper
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 latche;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &latche, 1, "LATC" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg32(0x8000, latche >> 4);
|
||||
setchr8(latche & 0xf);
|
||||
}
|
||||
|
||||
static DECLFW(M36Write) {
|
||||
latche = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFR(M36Read) {
|
||||
return latche; // Need by Strike Wolf, being simplified mapper, this cart still uses some TCX mapper features andrely on it
|
||||
}
|
||||
|
||||
static void M36Power(void) {
|
||||
latche = 0;
|
||||
Sync();
|
||||
SetReadHandler(0x4100, 0x4100, M36Read);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFE, M36Write); // Actually, BUS conflict there preventing from triggering the wrong banks
|
||||
}
|
||||
|
||||
static void M36Restore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper36_Init(CartInfo *info) {
|
||||
info->Power = M36Power;
|
||||
GameStateRestore = M36Restore;
|
||||
AddExState(StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,163 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2006 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 chr_reg[4];
|
||||
static uint8 kogame, prg_reg, nt1, nt2, mirr;
|
||||
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE, count;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &nt1, 1, "NT1" },
|
||||
{ &nt2, 1, "NT2" },
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ &prg_reg, 1, "PRG" },
|
||||
{ &kogame, 1, "KGME" },
|
||||
{ &count, 4, "CNT" },
|
||||
{ chr_reg, 4, "CHR" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void M68NTfix(void) {
|
||||
if ((!UNIFchrrama) && (mirr & 0x10)) {
|
||||
PPUNTARAM = 0;
|
||||
switch (mirr & 3) {
|
||||
case 0:
|
||||
vnapage[0] = vnapage[2] = CHRptr[0] + (((nt1 | 128) & CHRmask1[0]) << 10);
|
||||
vnapage[1] = vnapage[3] = CHRptr[0] + (((nt2 | 128) & CHRmask1[0]) << 10);
|
||||
break;
|
||||
case 1:
|
||||
vnapage[0] = vnapage[1] = CHRptr[0] + (((nt1 | 128) & CHRmask1[0]) << 10);
|
||||
vnapage[2] = vnapage[3] = CHRptr[0] + (((nt2 | 128) & CHRmask1[0]) << 10);
|
||||
break;
|
||||
case 2:
|
||||
vnapage[0] = vnapage[1] = vnapage[2] = vnapage[3] = CHRptr[0] + (((nt1 | 128) & CHRmask1[0]) << 10);
|
||||
break;
|
||||
case 3:
|
||||
vnapage[0] = vnapage[1] = vnapage[2] = vnapage[3] = CHRptr[0] + (((nt2 | 128) & CHRmask1[0]) << 10);
|
||||
break;
|
||||
}
|
||||
} else
|
||||
switch (mirr & 3) {
|
||||
case 0: setmirror(MI_V); break;
|
||||
case 1: setmirror(MI_H); break;
|
||||
case 2: setmirror(MI_0); break;
|
||||
case 3: setmirror(MI_1); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void Sync(void) {
|
||||
setchr2(0x0000, chr_reg[0]);
|
||||
setchr2(0x0800, chr_reg[1]);
|
||||
setchr2(0x1000, chr_reg[2]);
|
||||
setchr2(0x1800, chr_reg[3]);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg16r((PRGptr[1]) ? kogame : 0, 0x8000, prg_reg);
|
||||
setprg16(0xC000, ~0);
|
||||
}
|
||||
|
||||
static DECLFR(M68Read) {
|
||||
if (!(kogame & 8)) {
|
||||
count++;
|
||||
if (count == 1784)
|
||||
setprg16r(0, 0x8000, prg_reg);
|
||||
}
|
||||
return CartBR(A);
|
||||
}
|
||||
|
||||
static DECLFW(M68WriteLo) {
|
||||
if (!V) {
|
||||
count = 0;
|
||||
setprg16r((PRGptr[1]) ? kogame : 0, 0x8000, prg_reg);
|
||||
}
|
||||
CartBW(A, V);
|
||||
}
|
||||
|
||||
static DECLFW(M68WriteCHR) {
|
||||
chr_reg[(A >> 12) & 3] = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(M68WriteNT1) {
|
||||
nt1 = V;
|
||||
M68NTfix();
|
||||
}
|
||||
|
||||
static DECLFW(M68WriteNT2) {
|
||||
nt2 = V;
|
||||
M68NTfix();
|
||||
}
|
||||
|
||||
static DECLFW(M68WriteMIR) {
|
||||
mirr = V;
|
||||
M68NTfix();
|
||||
}
|
||||
|
||||
static DECLFW(M68WriteROM) {
|
||||
prg_reg = V & 7;
|
||||
kogame = ((V >> 3) & 1) ^ 1;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M68Power(void) {
|
||||
prg_reg = 0;
|
||||
kogame = 0;
|
||||
Sync();
|
||||
M68NTfix();
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetReadHandler(0x8000, 0xBFFF, M68Read);
|
||||
SetReadHandler(0xC000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xBFFF, M68WriteCHR);
|
||||
SetWriteHandler(0xC000, 0xCFFF, M68WriteNT1);
|
||||
SetWriteHandler(0xD000, 0xDFFF, M68WriteNT2);
|
||||
SetWriteHandler(0xE000, 0xEFFF, M68WriteMIR);
|
||||
SetWriteHandler(0xF000, 0xFFFF, M68WriteROM);
|
||||
SetWriteHandler(0x6000, 0x6000, M68WriteLo);
|
||||
SetWriteHandler(0x6001, 0x7FFF, CartBW);
|
||||
}
|
||||
|
||||
static void M68Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
M68NTfix();
|
||||
}
|
||||
|
||||
void Mapper68_Init(CartInfo *info) {
|
||||
info->Power = M68Power;
|
||||
info->Close = M68Close;
|
||||
GameStateRestore = StateRestore;
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,278 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2012 CaH4e3
|
||||
* Copyright (C) 2002 Xodnizel
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 cmdreg, preg[4], creg[8], mirr;
|
||||
static uint8 IRQa;
|
||||
static int32 IRQCount;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &cmdreg, 1, "CMDR" },
|
||||
{ preg, 4, "PREG" },
|
||||
{ creg, 8, "CREG" },
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ &IRQa, 1, "IRQA" },
|
||||
{ &IRQCount, 4, "IRQC" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
uint8 i;
|
||||
if ((preg[3] & 0xC0) == 0xC0)
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
else
|
||||
setprg8(0x6000, preg[3] & 0x3F);
|
||||
setprg8(0x8000, preg[0]);
|
||||
setprg8(0xA000, preg[1]);
|
||||
setprg8(0xC000, preg[2]);
|
||||
setprg8(0xE000, ~0);
|
||||
for (i = 0; i < 8; i++)
|
||||
setchr1(i << 10, creg[i]);
|
||||
switch (mirr & 3) {
|
||||
case 0: setmirror(MI_V); break;
|
||||
case 1: setmirror(MI_H); break;
|
||||
case 2: setmirror(MI_0); break;
|
||||
case 3: setmirror(MI_1); break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(M69WRAMWrite) {
|
||||
if ((preg[3] & 0xC0) == 0xC0)
|
||||
CartBW(A, V);
|
||||
}
|
||||
|
||||
static DECLFR(M69WRAMRead) {
|
||||
if ((preg[3] & 0xC0) == 0x40)
|
||||
return X.DB;
|
||||
else
|
||||
return CartBR(A);
|
||||
}
|
||||
|
||||
static DECLFW(M69Write0) {
|
||||
cmdreg = V & 0xF;
|
||||
}
|
||||
|
||||
static DECLFW(M69Write1) {
|
||||
switch (cmdreg) {
|
||||
case 0x0: creg[0] = V; Sync(); break;
|
||||
case 0x1: creg[1] = V; Sync(); break;
|
||||
case 0x2: creg[2] = V; Sync(); break;
|
||||
case 0x3: creg[3] = V; Sync(); break;
|
||||
case 0x4: creg[4] = V; Sync(); break;
|
||||
case 0x5: creg[5] = V; Sync(); break;
|
||||
case 0x6: creg[6] = V; Sync(); break;
|
||||
case 0x7: creg[7] = V; Sync(); break;
|
||||
case 0x8: preg[3] = V; Sync(); break;
|
||||
case 0x9: preg[0] = V; Sync(); break;
|
||||
case 0xA: preg[1] = V; Sync(); break;
|
||||
case 0xB: preg[2] = V; Sync(); break;
|
||||
case 0xC: mirr = V & 3; Sync();break;
|
||||
case 0xD: IRQa = V; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
case 0xE: IRQCount &= 0xFF00; IRQCount |= V; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
case 0xF: IRQCount &= 0x00FF; IRQCount |= V << 8; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
}
|
||||
}
|
||||
|
||||
// SUNSOFT-5/FME-7 Sound
|
||||
|
||||
static void AYSound(int Count);
|
||||
static void AYSoundHQ(void);
|
||||
static void DoAYSQ(int x);
|
||||
static void DoAYSQHQ(int x);
|
||||
|
||||
static uint8 sndcmd, sreg[14];
|
||||
static int32 vcount[3];
|
||||
static int32 dcount[3];
|
||||
static int CAYBC[3];
|
||||
|
||||
static SFORMAT SStateRegs[] =
|
||||
{
|
||||
{ &sndcmd, 1, "SCMD" },
|
||||
{ sreg, 14, "SREG" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static DECLFW(M69SWrite0) {
|
||||
sndcmd = V % 14;
|
||||
}
|
||||
|
||||
static DECLFW(M69SWrite1) {
|
||||
int x;
|
||||
GameExpSound.Fill = AYSound;
|
||||
GameExpSound.HiFill = AYSoundHQ;
|
||||
if (FSettings.SndRate)
|
||||
switch (sndcmd) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 8: if (FSettings.soundq >= 1) DoAYSQHQ(0); else DoAYSQ(0); break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 9: if (FSettings.soundq >= 1) DoAYSQHQ(1); else DoAYSQ(1); break;
|
||||
case 4:
|
||||
case 5:
|
||||
case 10: if (FSettings.soundq >= 1) DoAYSQHQ(2); else DoAYSQ(2); break;
|
||||
case 7:
|
||||
for (x = 0; x < 2; x++)
|
||||
if (FSettings.soundq >= 1) DoAYSQHQ(x); else DoAYSQ(x);
|
||||
break;
|
||||
}
|
||||
sreg[sndcmd] = V;
|
||||
}
|
||||
|
||||
static void DoAYSQ(int x) {
|
||||
int32 freq = ((sreg[x << 1] | ((sreg[(x << 1) + 1] & 15) << 8)) + 1) << (4 + 17);
|
||||
int32 amp = (sreg[0x8 + x] & 15) << 2;
|
||||
int32 start, end;
|
||||
int V;
|
||||
|
||||
amp += amp >> 1;
|
||||
|
||||
start = CAYBC[x];
|
||||
end = (SOUNDTS << 16) / soundtsinc;
|
||||
if (end <= start) return;
|
||||
CAYBC[x] = end;
|
||||
|
||||
if (amp && !(sreg[0x7] & (1 << x)))
|
||||
for (V = start; V < end; V++) {
|
||||
if (dcount[x])
|
||||
Wave[V >> 4] += amp;
|
||||
vcount[x] -= nesincsize;
|
||||
while (vcount[x] <= 0) {
|
||||
dcount[x] ^= 1;
|
||||
vcount[x] += freq;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void DoAYSQHQ(int x) {
|
||||
uint32 V;
|
||||
int32 freq = ((sreg[x << 1] | ((sreg[(x << 1) + 1] & 15) << 8)) + 1) << 4;
|
||||
int32 amp = (sreg[0x8 + x] & 15) << 6;
|
||||
|
||||
amp += amp >> 1;
|
||||
|
||||
if (!(sreg[0x7] & (1 << x))) {
|
||||
for (V = CAYBC[x]; V < SOUNDTS; V++) {
|
||||
if (dcount[x])
|
||||
WaveHi[V] += amp;
|
||||
vcount[x]--;
|
||||
if (vcount[x] <= 0) {
|
||||
dcount[x] ^= 1;
|
||||
vcount[x] = freq;
|
||||
}
|
||||
}
|
||||
}
|
||||
CAYBC[x] = SOUNDTS;
|
||||
}
|
||||
|
||||
static void AYSound(int Count) {
|
||||
int x;
|
||||
DoAYSQ(0);
|
||||
DoAYSQ(1);
|
||||
DoAYSQ(2);
|
||||
for (x = 0; x < 3; x++)
|
||||
CAYBC[x] = Count;
|
||||
}
|
||||
|
||||
static void AYSoundHQ(void) {
|
||||
DoAYSQHQ(0);
|
||||
DoAYSQHQ(1);
|
||||
DoAYSQHQ(2);
|
||||
}
|
||||
|
||||
static void AYHiSync(int32 ts) {
|
||||
int x;
|
||||
|
||||
for (x = 0; x < 3; x++)
|
||||
CAYBC[x] = ts;
|
||||
}
|
||||
|
||||
void Mapper69_ESI(void) {
|
||||
GameExpSound.RChange = Mapper69_ESI;
|
||||
GameExpSound.HiSync = AYHiSync;
|
||||
memset(dcount, 0, sizeof(dcount));
|
||||
memset(vcount, 0, sizeof(vcount));
|
||||
memset(CAYBC, 0, sizeof(CAYBC));
|
||||
AddExState(&SStateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
// SUNSOFT-5/FME-7 Sound
|
||||
|
||||
static void M69Power(void) {
|
||||
cmdreg = sndcmd = 0;
|
||||
IRQCount = 0xFFFF;
|
||||
IRQa = 0;
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0x7FFF, M69WRAMRead);
|
||||
SetWriteHandler(0x6000, 0x7FFF, M69WRAMWrite);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0x9FFF, M69Write0);
|
||||
SetWriteHandler(0xA000, 0xBFFF, M69Write1);
|
||||
SetWriteHandler(0xC000, 0xDFFF, M69SWrite0);
|
||||
SetWriteHandler(0xE000, 0xFFFF, M69SWrite1);
|
||||
}
|
||||
|
||||
static void M69Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void M69IRQHook(int a) {
|
||||
if (IRQa) {
|
||||
IRQCount -= a;
|
||||
if (IRQCount <= 0) {
|
||||
X6502_IRQBegin(FCEU_IQEXT); IRQa = 0; IRQCount = 0xFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper69_Init(CartInfo *info) {
|
||||
info->Power = M69Power;
|
||||
info->Close = M69Close;
|
||||
MapIRQHook = M69IRQHook;
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
GameStateRestore = StateRestore;
|
||||
Mapper69_ESI();
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void NSFAY_Init(void) {
|
||||
sndcmd = 0;
|
||||
SetWriteHandler(0xC000, 0xDFFF, M69SWrite0);
|
||||
SetWriteHandler(0xE000, 0xFFFF, M69SWrite1);
|
||||
Mapper69_ESI();
|
||||
}
|
|
@ -1,97 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2012 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Taito X1-017 board, battery backed
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 regs[9], ctrl;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ regs, 9, "REGS" },
|
||||
{ &ctrl, 1, "CTRL" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
uint32 swap = ((ctrl & 2) << 11);
|
||||
setchr2(0x0000 ^ swap, regs[0] >> 1);
|
||||
setchr2(0x0800 ^ swap, regs[1] >> 1);
|
||||
setchr1(0x1000 ^ swap, regs[2]);
|
||||
setchr1(0x1400 ^ swap, regs[3]);
|
||||
setchr1(0x1800 ^ swap, regs[4]);
|
||||
setchr1(0x1c00 ^ swap, regs[5]);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg8(0x8000, regs[6]);
|
||||
setprg8(0xA000, regs[7]);
|
||||
setprg8(0xC000, regs[8]);
|
||||
setprg8(0xE000, ~0);
|
||||
setmirror(ctrl & 1);
|
||||
}
|
||||
|
||||
static DECLFW(M82Write) {
|
||||
if (A <= 0x7ef5)
|
||||
regs[A & 7] = V;
|
||||
else
|
||||
switch (A) {
|
||||
case 0x7ef6: ctrl = V & 3; break;
|
||||
case 0x7efa: regs[6] = V >> 2; break;
|
||||
case 0x7efb: regs[7] = V >> 2; break;
|
||||
case 0x7efc: regs[8] = V >> 2; break;
|
||||
}
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M82Power(void) {
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0xffff, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7fff, CartBW);
|
||||
SetWriteHandler(0x7ef0, 0x7efc, M82Write); // external WRAM might end at $73FF
|
||||
}
|
||||
|
||||
static void M82Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper82_Init(CartInfo *info) {
|
||||
info->Power = M82Power;
|
||||
info->Close = M82Close;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2012 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 latch;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
static writefunc old4016;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &latch, 1, "LATC" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setchr8((latch >> 2) & 1);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg32(0x8000, 0);
|
||||
setprg8(0x8000, latch & 4); /* Special for VS Gumshoe */
|
||||
}
|
||||
|
||||
static DECLFW(M99Write) {
|
||||
latch = V;
|
||||
Sync();
|
||||
old4016(A, V);
|
||||
}
|
||||
|
||||
static void M99Power(void) {
|
||||
latch = 0;
|
||||
Sync();
|
||||
old4016 = GetWriteHandler(0x4016);
|
||||
SetWriteHandler(0x4016, 0x4016, M99Write);
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
}
|
||||
|
||||
static void M99Close(void)
|
||||
{
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper99_Init(CartInfo *info) {
|
||||
info->Power = M99Power;
|
||||
info->Close = M99Close;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,505 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2006 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint16 latche, latcheinit;
|
||||
static uint16 addrreg0, addrreg1;
|
||||
static uint8 dipswitch;
|
||||
static void (*WSync)(void);
|
||||
static readfunc defread;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static DECLFW(LatchWrite) {
|
||||
latche = A;
|
||||
WSync();
|
||||
}
|
||||
|
||||
static void LatchReset(void) {
|
||||
latche = latcheinit;
|
||||
WSync();
|
||||
}
|
||||
|
||||
static void LatchPower(void) {
|
||||
latche = latcheinit;
|
||||
WSync();
|
||||
if (WRAM) {
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
} else
|
||||
SetReadHandler(0x6000, 0xFFFF, defread);
|
||||
SetWriteHandler(addrreg0, addrreg1, LatchWrite);
|
||||
}
|
||||
|
||||
static void LatchClose(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
WSync();
|
||||
}
|
||||
|
||||
static void Latch_Init(CartInfo *info, void (*proc)(void), readfunc func, uint16 linit, uint16 adr0, uint16 adr1, uint8 wram) {
|
||||
latcheinit = linit;
|
||||
addrreg0 = adr0;
|
||||
addrreg1 = adr1;
|
||||
WSync = proc;
|
||||
if (func != NULL)
|
||||
defread = func;
|
||||
else
|
||||
defread = CartBROB;
|
||||
info->Power = LatchPower;
|
||||
info->Reset = LatchReset;
|
||||
info->Close = LatchClose;
|
||||
if (wram) {
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
}
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&latche, 2, 0, "LATC");
|
||||
}
|
||||
|
||||
//------------------ BMCD1038 ---------------------------
|
||||
|
||||
static void BMCD1038Sync(void) {
|
||||
if (latche & 0x80) {
|
||||
setprg16(0x8000, (latche & 0x70) >> 4);
|
||||
setprg16(0xC000, (latche & 0x70) >> 4);
|
||||
} else
|
||||
setprg32(0x8000, (latche & 0x60) >> 5);
|
||||
setchr8(latche & 7);
|
||||
setmirror(((latche & 8) >> 3) ^ 1);
|
||||
}
|
||||
|
||||
static DECLFR(BMCD1038Read) {
|
||||
if (latche & 0x100)
|
||||
return dipswitch;
|
||||
else
|
||||
return CartBR(A);
|
||||
}
|
||||
|
||||
static void BMCD1038Reset(void) {
|
||||
dipswitch++;
|
||||
dipswitch &= 3;
|
||||
}
|
||||
|
||||
void BMCD1038_Init(CartInfo *info) {
|
||||
Latch_Init(info, BMCD1038Sync, BMCD1038Read, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
info->Reset = BMCD1038Reset;
|
||||
AddExState(&dipswitch, 1, 0, "DIPSW");
|
||||
}
|
||||
|
||||
//------------------ UNL43272 ---------------------------
|
||||
// mapper much complex, including 16K bankswitching
|
||||
static void UNL43272Sync(void) {
|
||||
if ((latche & 0x81) == 0x81) {
|
||||
setprg32(0x8000, (latche & 0x38) >> 3);
|
||||
} else
|
||||
FCEU_printf("unrecognized command %04!\n", latche);
|
||||
setchr8(0);
|
||||
setmirror(0);
|
||||
}
|
||||
|
||||
static DECLFR(UNL43272Read) {
|
||||
if (latche & 0x400)
|
||||
return CartBR(A & 0xFE);
|
||||
else
|
||||
return CartBR(A);
|
||||
}
|
||||
|
||||
static void UNL43272Reset(void) {
|
||||
latche = 0;
|
||||
UNL43272Sync();
|
||||
}
|
||||
|
||||
void UNL43272_Init(CartInfo *info) {
|
||||
Latch_Init(info, UNL43272Sync, UNL43272Read, 0x0081, 0x8000, 0xFFFF, 0);
|
||||
info->Reset = UNL43272Reset;
|
||||
AddExState(&dipswitch, 1, 0, "DIPSW");
|
||||
}
|
||||
|
||||
//------------------ Map 058 ---------------------------
|
||||
|
||||
static void BMCGK192Sync(void) {
|
||||
if (latche & 0x40) {
|
||||
setprg16(0x8000, latche & 7);
|
||||
setprg16(0xC000, latche & 7);
|
||||
} else
|
||||
setprg32(0x8000, (latche >> 1) & 3);
|
||||
setchr8((latche >> 3) & 7);
|
||||
setmirror(((latche & 0x80) >> 7) ^ 1);
|
||||
}
|
||||
|
||||
void BMCGK192_Init(CartInfo *info) {
|
||||
Latch_Init(info, BMCGK192Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 059 ---------------------------
|
||||
// One more forgotten mapper
|
||||
static void M59Sync(void) {
|
||||
setprg32(0x8000, (latche >> 4) & 7);
|
||||
setchr8(latche & 0x7);
|
||||
setmirror((latche >> 3) & 1);
|
||||
}
|
||||
|
||||
static DECLFR(M59Read) {
|
||||
if (latche & 0x100)
|
||||
return 0;
|
||||
else
|
||||
return CartBR(A);
|
||||
}
|
||||
|
||||
void Mapper59_Init(CartInfo *info) {
|
||||
Latch_Init(info, M59Sync, M59Read, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 061 ---------------------------
|
||||
static void M61Sync(void) {
|
||||
if (((latche & 0x10) << 1) ^ (latche & 0x20)) {
|
||||
setprg16(0x8000, ((latche & 0xF) << 1) | (((latche & 0x20) >> 4)));
|
||||
setprg16(0xC000, ((latche & 0xF) << 1) | (((latche & 0x20) >> 4)));
|
||||
} else
|
||||
setprg32(0x8000, latche & 0xF);
|
||||
setchr8(0);
|
||||
setmirror(((latche >> 7) & 1) ^ 1);
|
||||
}
|
||||
|
||||
void Mapper61_Init(CartInfo *info) {
|
||||
Latch_Init(info, M61Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 092 ---------------------------
|
||||
// Another two-in-one mapper, two Jaleco carts uses similar
|
||||
// hardware, but with different wiring.
|
||||
// Original code provided by LULU
|
||||
// Additionally, PCB contains DSP extra sound chip, used for voice samples (unemulated)
|
||||
|
||||
static void M92Sync(void) {
|
||||
uint8 reg = latche & 0xF0;
|
||||
setprg16(0x8000, 0);
|
||||
if (latche >= 0x9000) {
|
||||
switch (reg) {
|
||||
case 0xD0: setprg16(0xc000, latche & 15); break;
|
||||
case 0xE0: setchr8(latche & 15); break;
|
||||
}
|
||||
} else {
|
||||
switch (reg) {
|
||||
case 0xB0: setprg16(0xc000, latche & 15); break;
|
||||
case 0x70: setchr8(latche & 15); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Mapper92_Init(CartInfo *info) {
|
||||
Latch_Init(info, M92Sync, NULL, 0x80B0, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 200 ---------------------------
|
||||
|
||||
static void M200Sync(void) {
|
||||
setprg16(0x8000, latche & 7);
|
||||
setprg16(0xC000, latche & 7);
|
||||
setchr8(latche & 7);
|
||||
setmirror((latche & 8) >> 3);
|
||||
}
|
||||
|
||||
void Mapper200_Init(CartInfo *info) {
|
||||
Latch_Init(info, M200Sync, NULL, 0xFFFF, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 201 ---------------------------
|
||||
|
||||
static void M201Sync(void) {
|
||||
if (latche & 8) {
|
||||
setprg32(0x8000, latche & 3);
|
||||
setchr8(latche & 3);
|
||||
} else {
|
||||
setprg32(0x8000, 0);
|
||||
setchr8(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Mapper201_Init(CartInfo *info) {
|
||||
Latch_Init(info, M201Sync, NULL, 0xFFFF, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 202 ---------------------------
|
||||
|
||||
static void M202Sync(void) {
|
||||
// According to more carefull hardware tests and PCB study
|
||||
int32 mirror = latche & 1;
|
||||
int32 bank = (latche >> 1) & 0x7;
|
||||
int32 select = (mirror & (bank >> 2));
|
||||
setprg16(0x8000, select ? (bank & 6) | 0 : bank);
|
||||
setprg16(0xc000, select ? (bank & 6) | 1 : bank);
|
||||
setmirror(mirror ^ 1);
|
||||
setchr8(bank);
|
||||
}
|
||||
|
||||
void Mapper202_Init(CartInfo *info) {
|
||||
Latch_Init(info, M202Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 204 ---------------------------
|
||||
|
||||
static void M204Sync(void) {
|
||||
int32 tmp2 = latche & 0x6;
|
||||
int32 tmp1 = tmp2 + ((tmp2 == 0x6) ? 0 : (latche & 1));
|
||||
setprg16(0x8000, tmp1);
|
||||
setprg16(0xc000, tmp2 + ((tmp2 == 0x6) ? 1 : (latche & 1)));
|
||||
setchr8(tmp1);
|
||||
setmirror(((latche >> 4) & 1) ^ 1);
|
||||
}
|
||||
|
||||
void Mapper204_Init(CartInfo *info) {
|
||||
Latch_Init(info, M204Sync, NULL, 0xFFFF, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 212 ---------------------------
|
||||
|
||||
static DECLFR(M212Read) {
|
||||
uint8 ret = CartBROB(A);
|
||||
if ((A & 0xE010) == 0x6000)
|
||||
ret |= 0x80;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void M212Sync(void) {
|
||||
if (latche & 0x4000) {
|
||||
setprg32(0x8000, (latche >> 1) & 3);
|
||||
} else {
|
||||
setprg16(0x8000, latche & 7);
|
||||
setprg16(0xC000, latche & 7);
|
||||
}
|
||||
setchr8(latche & 7);
|
||||
setmirror(((latche >> 3) & 1) ^ 1);
|
||||
}
|
||||
|
||||
void Mapper212_Init(CartInfo *info) {
|
||||
Latch_Init(info, M212Sync, M212Read, 0xFFFF, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 213 ---------------------------
|
||||
|
||||
static void M213Sync(void) {
|
||||
setprg32(0x8000, (latche >> 1) & 3);
|
||||
setchr8((latche >> 3) & 7);
|
||||
}
|
||||
|
||||
void Mapper213_Init(CartInfo *info) {
|
||||
Latch_Init(info, M213Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 214 ---------------------------
|
||||
|
||||
static void M214Sync(void) {
|
||||
setprg16(0x8000, (latche >> 2) & 3);
|
||||
setprg16(0xC000, (latche >> 2) & 3);
|
||||
setchr8(latche & 3);
|
||||
}
|
||||
|
||||
void Mapper214_Init(CartInfo *info) {
|
||||
Latch_Init(info, M214Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 217 ---------------------------
|
||||
|
||||
static void M217Sync(void) {
|
||||
setprg32(0x8000, (latche >> 2) & 3);
|
||||
setchr8(latche & 7);
|
||||
}
|
||||
|
||||
void Mapper217_Init(CartInfo *info) {
|
||||
Latch_Init(info, M217Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 227 ---------------------------
|
||||
|
||||
static void M227Sync(void) {
|
||||
uint32 S = latche & 1;
|
||||
uint32 p = ((latche >> 2) & 0x1F) + ((latche & 0x100) >> 3);
|
||||
uint32 L = (latche >> 9) & 1;
|
||||
|
||||
if ((latche >> 7) & 1) {
|
||||
if (S) {
|
||||
setprg32(0x8000, p >> 1);
|
||||
} else {
|
||||
setprg16(0x8000, p);
|
||||
setprg16(0xC000, p);
|
||||
}
|
||||
} else {
|
||||
if (S) {
|
||||
if (L) {
|
||||
setprg16(0x8000, p & 0x3E);
|
||||
setprg16(0xC000, p | 7);
|
||||
} else {
|
||||
setprg16(0x8000, p & 0x3E);
|
||||
setprg16(0xC000, p & 0x38);
|
||||
}
|
||||
} else {
|
||||
if (L) {
|
||||
setprg16(0x8000, p);
|
||||
setprg16(0xC000, p | 7);
|
||||
} else {
|
||||
setprg16(0x8000, p);
|
||||
setprg16(0xC000, p & 0x38);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setmirror(((latche >> 1) & 1) ^ 1);
|
||||
setchr8(0);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
}
|
||||
|
||||
void Mapper227_Init(CartInfo *info) {
|
||||
Latch_Init(info, M227Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1);
|
||||
}
|
||||
|
||||
//------------------ Map 229 ---------------------------
|
||||
|
||||
static void M229Sync(void) {
|
||||
setchr8(latche);
|
||||
if (!(latche & 0x1e))
|
||||
setprg32(0x8000, 0);
|
||||
else {
|
||||
setprg16(0x8000, latche & 0x1F);
|
||||
setprg16(0xC000, latche & 0x1F);
|
||||
}
|
||||
setmirror(((latche >> 5) & 1) ^ 1);
|
||||
}
|
||||
|
||||
void Mapper229_Init(CartInfo *info) {
|
||||
Latch_Init(info, M229Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 231 ---------------------------
|
||||
|
||||
static void M231Sync(void) {
|
||||
setchr8(0);
|
||||
if (latche & 0x20)
|
||||
setprg32(0x8000, (latche >> 1) & 0x0F);
|
||||
else {
|
||||
setprg16(0x8000, latche & 0x1E);
|
||||
setprg16(0xC000, latche & 0x1E);
|
||||
}
|
||||
setmirror(((latche >> 7) & 1) ^ 1);
|
||||
}
|
||||
|
||||
void Mapper231_Init(CartInfo *info) {
|
||||
Latch_Init(info, M231Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 242 ---------------------------
|
||||
|
||||
static void M242Sync(void) {
|
||||
setchr8(0);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg32(0x8000, (latche >> 3) & 0xf);
|
||||
setmirror(((latche >> 1) & 1) ^ 1);
|
||||
}
|
||||
|
||||
void Mapper242_Init(CartInfo *info) {
|
||||
Latch_Init(info, M242Sync, NULL, 0x0000, 0x8000, 0xFFFF, 1);
|
||||
}
|
||||
|
||||
//------------------ 190in1 ---------------------------
|
||||
|
||||
static void BMC190in1Sync(void) {
|
||||
setprg16(0x8000, (latche >> 2) & 7);
|
||||
setprg16(0xC000, (latche >> 2) & 7);
|
||||
setchr8((latche >> 2) & 7);
|
||||
setmirror((latche & 1) ^ 1);
|
||||
}
|
||||
|
||||
void BMC190in1_Init(CartInfo *info) {
|
||||
Latch_Init(info, BMC190in1Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//-------------- BMC810544-C-A1 ------------------------
|
||||
|
||||
static void BMC810544CA1Sync(void) {
|
||||
uint32 bank = latche >> 7;
|
||||
if (latche & 0x40)
|
||||
setprg32(0x8000, bank);
|
||||
else {
|
||||
setprg16(0x8000, (bank << 1) | ((latche >> 5) & 1));
|
||||
setprg16(0xC000, (bank << 1) | ((latche >> 5) & 1));
|
||||
}
|
||||
setchr8(latche & 0x0f);
|
||||
setmirror(((latche >> 4) & 1) ^ 1);
|
||||
}
|
||||
|
||||
void BMC810544CA1_Init(CartInfo *info) {
|
||||
Latch_Init(info, BMC810544CA1Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//-------------- BMCNTD-03 ------------------------
|
||||
|
||||
static void BMCNTD03Sync(void) {
|
||||
// 1PPP Pmcc spxx xccc
|
||||
// 1000 0000 0000 0000 v
|
||||
// 1001 1100 0000 0100 h
|
||||
// 1011 1010 1100 0100
|
||||
uint32 prg = ((latche >> 10) & 0x1e);
|
||||
uint32 chr = ((latche & 0x0300) >> 5) | (latche & 7);
|
||||
if (latche & 0x80) {
|
||||
setprg16(0x8000, prg | ((latche >> 6) & 1));
|
||||
setprg16(0xC000, prg | ((latche >> 6) & 1));
|
||||
} else
|
||||
setprg32(0x8000, prg >> 1);
|
||||
setchr8(chr);
|
||||
setmirror(((latche >> 10) & 1) ^ 1);
|
||||
}
|
||||
|
||||
void BMCNTD03_Init(CartInfo *info) {
|
||||
Latch_Init(info, BMCNTD03Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
||||
|
||||
//-------------- BMCG-146 ------------------------
|
||||
|
||||
static void BMCG146Sync(void) {
|
||||
setchr8(0);
|
||||
if (latche & 0x800) { // UNROM mode
|
||||
setprg16(0x8000, (latche & 0x1F) | (latche & ((latche & 0x40) >> 6)));
|
||||
setprg16(0xC000, (latche & 0x18) | 7);
|
||||
} else {
|
||||
if (latche & 0x40) { // 16K mode
|
||||
setprg16(0x8000, latche & 0x1F);
|
||||
setprg16(0xC000, latche & 0x1F);
|
||||
} else {
|
||||
setprg32(0x8000, (latche >> 1) & 0x0F);
|
||||
}
|
||||
}
|
||||
setmirror(((latche & 0x80) >> 7) ^ 1);
|
||||
}
|
||||
|
||||
void BMCG146_Init(CartInfo *info) {
|
||||
Latch_Init(info, BMCG146Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
|
||||
}
|
|
@ -1,464 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2007 CaH4e3
|
||||
* Copyright (C) 2011 FCEUX 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
|
||||
*
|
||||
* Bandai mappers
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg[16], is153, x24c02;
|
||||
static uint8 IRQa;
|
||||
static int16 IRQCount, IRQLatch;
|
||||
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ reg, 16, "REGS" },
|
||||
{ &IRQa, 1, "IRQA" },
|
||||
{ &IRQCount, 2, "IRQC" },
|
||||
{ &IRQLatch, 2, "IRQL" }, // need for Famicom Jump II - Saikyou no 7 Nin (J) [!]
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
// x24C0x interface
|
||||
|
||||
#define X24C0X_STANDBY 0
|
||||
#define X24C0X_ADDRESS 1
|
||||
#define X24C0X_WORD 2
|
||||
#define X24C0X_READ 3
|
||||
#define X24C0X_WRITE 4
|
||||
|
||||
static uint8 x24c0x_data[256], x24c0x_state;
|
||||
static uint8 x24c0x_addr, x24c0x_word, x24c0x_latch, x24c0x_bitcount;
|
||||
static uint8 x24c0x_sda, x24c0x_scl, x24c0x_out, x24c0x_oe;
|
||||
|
||||
static SFORMAT x24c0xStateRegs[] =
|
||||
{
|
||||
{ &x24c0x_addr, 1, "ADDR" },
|
||||
{ &x24c0x_word, 1, "WORD" },
|
||||
{ &x24c0x_latch, 1, "LATC" },
|
||||
{ &x24c0x_bitcount, 1, "BITC" },
|
||||
{ &x24c0x_sda, 1, "SDA" },
|
||||
{ &x24c0x_scl, 1, "SCL" },
|
||||
{ &x24c0x_out, 1, "OUT" },
|
||||
{ &x24c0x_oe, 1, "OE" },
|
||||
{ &x24c0x_state, 1, "STAT" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void x24c0x_init() {
|
||||
x24c0x_addr = x24c0x_word = x24c0x_latch = x24c0x_bitcount = x24c0x_sda = x24c0x_scl = x24c0x_oe = 0;
|
||||
x24c0x_state = X24C0X_STANDBY;
|
||||
}
|
||||
|
||||
static void x24c0x_write(uint8 data) {
|
||||
uint8 sda = (data >> 6) & 1;
|
||||
uint8 scl = (data >> 5) & 1;
|
||||
x24c0x_oe = (data >> 7);
|
||||
|
||||
if(x24c0x_scl && scl) {
|
||||
if(x24c0x_sda && !sda) { // START
|
||||
x24c0x_state = X24C0X_ADDRESS;
|
||||
x24c0x_bitcount = 0;
|
||||
x24c0x_addr = 0;
|
||||
} else if(!x24c0x_sda && sda) { //STOP
|
||||
x24c0x_state = X24C0X_STANDBY;
|
||||
}
|
||||
} else if(!x24c0x_scl && scl) { // RISING EDGE
|
||||
switch(x24c0x_state) {
|
||||
case X24C0X_ADDRESS:
|
||||
if(x24c0x_bitcount < 7) {
|
||||
x24c0x_addr <<= 1;
|
||||
x24c0x_addr |= sda;
|
||||
} else {
|
||||
if(!x24c02) // X24C01 mode
|
||||
x24c0x_word = x24c0x_addr;
|
||||
if(sda) { // READ COMMAND
|
||||
x24c0x_state = X24C0X_READ;
|
||||
} else { // WRITE COMMAND
|
||||
if(x24c02) // X24C02 mode
|
||||
x24c0x_state = X24C0X_WORD;
|
||||
else
|
||||
x24c0x_state = X24C0X_WRITE;
|
||||
}
|
||||
}
|
||||
x24c0x_bitcount++;
|
||||
break;
|
||||
case X24C0X_WORD:
|
||||
if(x24c0x_bitcount == 8) { // ACK
|
||||
x24c0x_word = 0;
|
||||
x24c0x_out = 0;
|
||||
} else { // WORD ADDRESS INPUT
|
||||
x24c0x_word <<= 1;
|
||||
x24c0x_word |= sda;
|
||||
if(x24c0x_bitcount == 16) { // END OF ADDRESS INPUT
|
||||
x24c0x_bitcount = 7;
|
||||
x24c0x_state = X24C0X_WRITE;
|
||||
}
|
||||
}
|
||||
x24c0x_bitcount++;
|
||||
break;
|
||||
case X24C0X_READ:
|
||||
if (x24c0x_bitcount == 8) { // ACK
|
||||
x24c0x_out = 0;
|
||||
x24c0x_latch = x24c0x_data[x24c0x_word];
|
||||
x24c0x_bitcount = 0;
|
||||
} else { // REAL OUTPUT
|
||||
x24c0x_out = x24c0x_latch >> 7;
|
||||
x24c0x_latch <<= 1;
|
||||
x24c0x_bitcount++;
|
||||
if(x24c0x_bitcount == 8) {
|
||||
x24c0x_word++;
|
||||
x24c0x_word &= 0xff;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case X24C0X_WRITE:
|
||||
if (x24c0x_bitcount == 8) { // ACK
|
||||
x24c0x_out = 0;
|
||||
x24c0x_latch = 0;
|
||||
x24c0x_bitcount = 0;
|
||||
} else { // REAL INPUT
|
||||
x24c0x_latch <<= 1;
|
||||
x24c0x_latch |= sda;
|
||||
x24c0x_bitcount++;
|
||||
if(x24c0x_bitcount == 8) {
|
||||
x24c0x_data[x24c0x_word] = x24c0x_latch;
|
||||
x24c0x_word++;
|
||||
x24c0x_word &= 0xff;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
x24c0x_sda = sda;
|
||||
x24c0x_scl = scl;
|
||||
}
|
||||
|
||||
static uint8 x24c0x_read() {
|
||||
return x24c0x_out << 4;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
static void Sync(void) {
|
||||
if (is153) {
|
||||
int base = (reg[0] & 1) << 4;
|
||||
setchr8(0);
|
||||
setprg16(0x8000, (reg[8] & 0x0F) | base);
|
||||
setprg16(0xC000, 0x0F | base);
|
||||
} else {
|
||||
int i;
|
||||
for (i = 0; i < 8; i++) setchr1(i << 10, reg[i]);
|
||||
setprg16(0x8000, reg[8]);
|
||||
setprg16(0xC000, ~0);
|
||||
}
|
||||
switch (reg[9] & 3) {
|
||||
case 0: setmirror(MI_V); break;
|
||||
case 1: setmirror(MI_H); break;
|
||||
case 2: setmirror(MI_0); break;
|
||||
case 3: setmirror(MI_1); break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(BandaiWrite) {
|
||||
A &= 0x0F;
|
||||
if (A < 0x0A) {
|
||||
reg[A & 0x0F] = V;
|
||||
Sync();
|
||||
} else
|
||||
switch (A) {
|
||||
case 0x0A: X6502_IRQEnd(FCEU_IQEXT); IRQa = V & 1; IRQCount = IRQLatch; break;
|
||||
case 0x0B: IRQLatch &= 0xFF00; IRQLatch |= V; break;
|
||||
case 0x0C: IRQLatch &= 0xFF; IRQLatch |= V << 8; break;
|
||||
case 0x0D: x24c0x_write(V); break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFR(BandaiRead) {
|
||||
return (X.DB & 0xEF) | x24c0x_read();
|
||||
}
|
||||
|
||||
static void BandaiIRQHook(int a) {
|
||||
if (IRQa) {
|
||||
IRQCount -= a;
|
||||
if (IRQCount < 0) {
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
IRQa = 0;
|
||||
IRQCount = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void BandaiPower(void) {
|
||||
IRQa = 0;
|
||||
x24c0x_init();
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0x7FFF, BandaiRead);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0xFFFF, BandaiWrite);
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper16_Init(CartInfo *info) {
|
||||
x24c02 = 1;
|
||||
is153 = 0;
|
||||
info->Power = BandaiPower;
|
||||
MapIRQHook = BandaiIRQHook;
|
||||
|
||||
info->battery = 1;
|
||||
info->SaveGame[0] = x24c0x_data;
|
||||
info->SaveGameLen[0] = 256;
|
||||
AddExState(x24c0x_data, 256, 0, "DATA");
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&x24c0xStateRegs, ~0, 0, 0);
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void Mapper159_Init(CartInfo *info) {
|
||||
x24c02 = 0;
|
||||
is153 = 0;
|
||||
info->Power = BandaiPower;
|
||||
MapIRQHook = BandaiIRQHook;
|
||||
|
||||
info->battery = 1;
|
||||
info->SaveGame[0] = x24c0x_data;
|
||||
info->SaveGameLen[0] = 128;
|
||||
AddExState(x24c0x_data, 128, 0, "DATA");
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&x24c0xStateRegs, ~0, 0, 0);
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
// Famicom jump 2:
|
||||
// 0-7: Lower bit of data selects which 256KB PRG block is in use.
|
||||
// This seems to be a hack on the developers' part, so I'll make emulation
|
||||
// of it a hack(I think the current PRG block would depend on whatever the
|
||||
// lowest bit of the CHR bank switching register that corresponds to the
|
||||
// last CHR address read).
|
||||
|
||||
static void M153Power(void) {
|
||||
Sync();
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, BandaiWrite);
|
||||
}
|
||||
|
||||
|
||||
static void M153Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
void Mapper153_Init(CartInfo *info) {
|
||||
is153 = 1;
|
||||
info->Power = M153Power;
|
||||
info->Close = M153Close;
|
||||
MapIRQHook = BandaiIRQHook;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
// Datach Barcode Battler
|
||||
|
||||
static uint8 BarcodeData[256];
|
||||
static int BarcodeReadPos;
|
||||
static int BarcodeCycleCount;
|
||||
static uint32 BarcodeOut;
|
||||
|
||||
int FCEUI_DatachSet(const uint8 *rcode) {
|
||||
int prefix_parity_type[10][6] = {
|
||||
{ 0, 0, 0, 0, 0, 0 }, { 0, 0, 1, 0, 1, 1 }, { 0, 0, 1, 1, 0, 1 }, { 0, 0, 1, 1, 1, 0 },
|
||||
{ 0, 1, 0, 0, 1, 1 }, { 0, 1, 1, 0, 0, 1 }, { 0, 1, 1, 1, 0, 0 }, { 0, 1, 0, 1, 0, 1 },
|
||||
{ 0, 1, 0, 1, 1, 0 }, { 0, 1, 1, 0, 1, 0 }
|
||||
};
|
||||
int data_left_odd[10][7] = {
|
||||
{ 0, 0, 0, 1, 1, 0, 1 }, { 0, 0, 1, 1, 0, 0, 1 }, { 0, 0, 1, 0, 0, 1, 1 }, { 0, 1, 1, 1, 1, 0, 1 },
|
||||
{ 0, 1, 0, 0, 0, 1, 1 }, { 0, 1, 1, 0, 0, 0, 1 }, { 0, 1, 0, 1, 1, 1, 1 }, { 0, 1, 1, 1, 0, 1, 1 },
|
||||
{ 0, 1, 1, 0, 1, 1, 1 }, { 0, 0, 0, 1, 0, 1, 1 }
|
||||
};
|
||||
int data_left_even[10][7] = {
|
||||
{ 0, 1, 0, 0, 1, 1, 1 }, { 0, 1, 1, 0, 0, 1, 1 }, { 0, 0, 1, 1, 0, 1, 1 }, { 0, 1, 0, 0, 0, 0, 1 },
|
||||
{ 0, 0, 1, 1, 1, 0, 1 }, { 0, 1, 1, 1, 0, 0, 1 }, { 0, 0, 0, 0, 1, 0, 1 }, { 0, 0, 1, 0, 0, 0, 1 },
|
||||
{ 0, 0, 0, 1, 0, 0, 1 }, { 0, 0, 1, 0, 1, 1, 1 }
|
||||
};
|
||||
int data_right[10][7] = {
|
||||
{ 1, 1, 1, 0, 0, 1, 0 }, { 1, 1, 0, 0, 1, 1, 0 }, { 1, 1, 0, 1, 1, 0, 0 }, { 1, 0, 0, 0, 0, 1, 0 },
|
||||
{ 1, 0, 1, 1, 1, 0, 0 }, { 1, 0, 0, 1, 1, 1, 0 }, { 1, 0, 1, 0, 0, 0, 0 }, { 1, 0, 0, 0, 1, 0, 0 },
|
||||
{ 1, 0, 0, 1, 0, 0, 0 }, { 1, 1, 1, 0, 1, 0, 0 }
|
||||
};
|
||||
uint8 code[13 + 1];
|
||||
uint32 tmp_p = 0;
|
||||
int i, j;
|
||||
int len;
|
||||
|
||||
for (i = len = 0; i < 13; i++) {
|
||||
if (!rcode[i]) break;
|
||||
if ((code[i] = rcode[i] - '0') > 9)
|
||||
return(0);
|
||||
len++;
|
||||
}
|
||||
if (len != 13 && len != 12 && len != 8 && len != 7) return(0);
|
||||
|
||||
#define BS(x) BarcodeData[tmp_p] = x; tmp_p++
|
||||
|
||||
for (j = 0; j < 32; j++) {
|
||||
BS(0x00);
|
||||
}
|
||||
|
||||
/* Left guard bars */
|
||||
BS(1); BS(0); BS(1);
|
||||
|
||||
if (len == 13 || len == 12) {
|
||||
uint32 csum;
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
if (prefix_parity_type[code[0]][i]) {
|
||||
for (j = 0; j < 7; j++) {
|
||||
BS(data_left_even[code[i + 1]][j]);
|
||||
}
|
||||
} else
|
||||
for (j = 0; j < 7; j++) {
|
||||
BS(data_left_odd[code[i + 1]][j]);
|
||||
}
|
||||
|
||||
/* Center guard bars */
|
||||
BS(0); BS(1); BS(0); BS(1); BS(0);
|
||||
|
||||
for (i = 7; i < 12; i++)
|
||||
for (j = 0; j < 7; j++) {
|
||||
BS(data_right[code[i]][j]);
|
||||
}
|
||||
csum = 0;
|
||||
for (i = 0; i < 12; i++) csum += code[i] * ((i & 1) ? 3 : 1);
|
||||
csum = (10 - (csum % 10)) % 10;
|
||||
for (j = 0; j < 7; j++) {
|
||||
BS(data_right[csum][j]);
|
||||
}
|
||||
} else if (len == 8 || len == 7) {
|
||||
uint32 csum = 0;
|
||||
|
||||
for (i = 0; i < 7; i++) csum += (i & 1) ? code[i] : (code[i] * 3);
|
||||
|
||||
csum = (10 - (csum % 10)) % 10;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (j = 0; j < 7; j++) {
|
||||
BS(data_left_odd[code[i]][j]);
|
||||
}
|
||||
|
||||
|
||||
/* Center guard bars */
|
||||
BS(0); BS(1); BS(0); BS(1); BS(0);
|
||||
|
||||
for (i = 4; i < 7; i++)
|
||||
for (j = 0; j < 7; j++) {
|
||||
BS(data_right[code[i]][j]);
|
||||
}
|
||||
|
||||
for (j = 0; j < 7; j++) {
|
||||
BS(data_right[csum][j]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Right guard bars */
|
||||
BS(1); BS(0); BS(1);
|
||||
|
||||
for (j = 0; j < 32; j++) {
|
||||
BS(0x00);
|
||||
}
|
||||
|
||||
BS(0xFF);
|
||||
|
||||
#undef BS
|
||||
|
||||
BarcodeReadPos = 0;
|
||||
BarcodeOut = 0x8;
|
||||
BarcodeCycleCount = 0;
|
||||
return(1);
|
||||
}
|
||||
|
||||
static void BarcodeIRQHook(int a) {
|
||||
BandaiIRQHook(a);
|
||||
|
||||
BarcodeCycleCount += a;
|
||||
|
||||
if (BarcodeCycleCount >= 1000) {
|
||||
BarcodeCycleCount -= 1000;
|
||||
if (BarcodeData[BarcodeReadPos] == 0xFF) {
|
||||
BarcodeOut = 0;
|
||||
} else {
|
||||
BarcodeOut = (BarcodeData[BarcodeReadPos] ^ 1) << 3;
|
||||
BarcodeReadPos++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFR(BarcodeRead) {
|
||||
return BarcodeOut;
|
||||
}
|
||||
|
||||
static void M157Power(void) {
|
||||
IRQa = 0;
|
||||
BarcodeData[0] = 0xFF;
|
||||
BarcodeReadPos = 0;
|
||||
BarcodeOut = 0;
|
||||
BarcodeCycleCount = 0;
|
||||
|
||||
Sync();
|
||||
|
||||
SetWriteHandler(0x6000, 0xFFFF, BandaiWrite);
|
||||
SetReadHandler(0x6000, 0x7FFF, BarcodeRead);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
}
|
||||
|
||||
void Mapper157_Init(CartInfo *info) {
|
||||
is153 = 1;
|
||||
info->Power = M157Power;
|
||||
MapIRQHook = BarcodeIRQHook;
|
||||
|
||||
GameInfo->cspecial = SIS_DATACH;
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2007 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 prg, mode;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
static uint32 lastnt = 0;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &prg, 1, "REGS" },
|
||||
{ &mode, 1, "MODE" },
|
||||
{ &lastnt, 4, "LSNT" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setmirror((mode ^ 1) & 1);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setchr4(0x0000, lastnt);
|
||||
setchr4(0x1000, 1);
|
||||
if (mode & 4)
|
||||
setprg32(0x8000, prg & 7);
|
||||
else {
|
||||
setprg16(0x8000, prg & 0x0f);
|
||||
setprg16(0xC000, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(UNLD2000Write) {
|
||||
switch (A) {
|
||||
case 0x5000: prg = V; Sync(); break;
|
||||
case 0x5200: mode = V; if (mode & 4) Sync(); break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFR(UNLD2000Read) {
|
||||
if (prg & 0x40)
|
||||
return X.DB;
|
||||
else
|
||||
return CartBR(A);
|
||||
}
|
||||
|
||||
static void UNLD2000Power(void) {
|
||||
prg = mode = 0;
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, UNLD2000Read);
|
||||
SetWriteHandler(0x5000, 0x5FFF, UNLD2000Write);
|
||||
}
|
||||
|
||||
static void UNL2000Hook(uint32 A) {
|
||||
if (mode & 2) {
|
||||
if ((A & 0x3000) == 0x2000) {
|
||||
uint32 curnt = A & 0x800;
|
||||
if (curnt != lastnt) {
|
||||
setchr4(0x0000, curnt >> 11);
|
||||
lastnt = curnt;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
lastnt = 0;
|
||||
setchr4(0x0000, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void UNLD2000Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void UNLD2000_Init(CartInfo *info) {
|
||||
info->Power = UNLD2000Power;
|
||||
info->Close = UNLD2000Close;
|
||||
PPU_hook = UNL2000Hook;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,484 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2002 Xodnizel
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
#include "../ines.h"
|
||||
|
||||
static uint8 latche, latcheinit, bus_conflict;
|
||||
static uint16 addrreg0, addrreg1;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
static void (*WSync)(void);
|
||||
|
||||
static DECLFW(LatchWrite) {
|
||||
// FCEU_printf("bs %04x %02x\n",A,V);
|
||||
if (bus_conflict)
|
||||
latche = (V == CartBR(A)) ? V : 0;
|
||||
else
|
||||
latche = V;
|
||||
WSync();
|
||||
}
|
||||
|
||||
static void LatchPower(void) {
|
||||
latche = latcheinit;
|
||||
WSync();
|
||||
if (WRAM) {
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
} else {
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
}
|
||||
SetWriteHandler(addrreg0, addrreg1, LatchWrite);
|
||||
}
|
||||
|
||||
static void LatchClose(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
WSync();
|
||||
}
|
||||
|
||||
static void Latch_Init(CartInfo *info, void (*proc)(void), uint8 init, uint16 adr0, uint16 adr1, uint8 wram, uint8 busc) {
|
||||
bus_conflict = busc;
|
||||
latcheinit = init;
|
||||
addrreg0 = adr0;
|
||||
addrreg1 = adr1;
|
||||
WSync = proc;
|
||||
info->Power = LatchPower;
|
||||
info->Close = LatchClose;
|
||||
GameStateRestore = StateRestore;
|
||||
if (wram) {
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
}
|
||||
AddExState(&latche, 1, 0, "LATC");
|
||||
AddExState(&bus_conflict, 1, 0, "BUSC");
|
||||
}
|
||||
|
||||
//------------------ Map 0 ---------------------------
|
||||
|
||||
#ifdef DEBUG_MAPPER
|
||||
static DECLFW(NROMWrite) {
|
||||
FCEU_printf("bs %04x %02x\n", A, V);
|
||||
CartBW(A, V);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void NROMPower(void) {
|
||||
setprg8r(0x10, 0x6000, 0); // Famili BASIC (v3.0) need it (uses only 4KB), FP-BASIC uses 8KB
|
||||
setprg16(0x8000, 0);
|
||||
setprg16(0xC000, ~0);
|
||||
setchr8(0);
|
||||
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
|
||||
#ifdef DEBUG_MAPPER
|
||||
SetWriteHandler(0x4020, 0xFFFF, NROMWrite);
|
||||
#endif
|
||||
}
|
||||
|
||||
void NROM_Init(CartInfo *info) {
|
||||
info->Power = NROMPower;
|
||||
info->Close = LatchClose;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
}
|
||||
|
||||
//------------------ Map 2 ---------------------------
|
||||
|
||||
static void UNROMSync(void) {
|
||||
static uint32 mirror_in_use = 0;
|
||||
if (PRGsize[0] <= 128 * 1024) {
|
||||
setprg16(0x8000, latche & 0x7);
|
||||
if (latche & 8) mirror_in_use = 1;
|
||||
if (mirror_in_use)
|
||||
setmirror(((latche >> 3) & 1) ^ 1); // Higway Star Hacked mapper
|
||||
} else
|
||||
setprg16(0x8000, latche & 0xf);
|
||||
setprg16(0xc000, ~0);
|
||||
setchr8(0);
|
||||
}
|
||||
|
||||
void UNROM_Init(CartInfo *info) {
|
||||
Latch_Init(info, UNROMSync, 0, 0x8000, 0xFFFF, 0, 1);
|
||||
}
|
||||
|
||||
//------------------ Map 3 ---------------------------
|
||||
|
||||
static void CNROMSync(void) {
|
||||
setchr8(latche);
|
||||
setprg32(0x8000, 0);
|
||||
setprg8r(0x10, 0x6000, 0); // Hayauchy IGO uses 2Kb or RAM
|
||||
}
|
||||
|
||||
void CNROM_Init(CartInfo *info) {
|
||||
Latch_Init(info, CNROMSync, 0, 0x8000, 0xFFFF, 1, 1);
|
||||
}
|
||||
|
||||
//------------------ Map 7 ---------------------------
|
||||
|
||||
static void ANROMSync() {
|
||||
setprg32(0x8000, latche & 0xF);
|
||||
setmirror(MI_0 + ((latche >> 4) & 1));
|
||||
setchr8(0);
|
||||
}
|
||||
|
||||
void ANROM_Init(CartInfo *info) {
|
||||
Latch_Init(info, ANROMSync, 0, 0x4020, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 8 ---------------------------
|
||||
|
||||
static void M8Sync() {
|
||||
setprg16(0x8000, latche >> 3);
|
||||
setprg16(0xc000, 1);
|
||||
setchr8(latche & 3);
|
||||
}
|
||||
|
||||
void Mapper8_Init(CartInfo *info) {
|
||||
Latch_Init(info, M8Sync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 11 ---------------------------
|
||||
|
||||
static void M11Sync(void) {
|
||||
setprg32(0x8000, latche & 0xF);
|
||||
setchr8(latche >> 4);
|
||||
}
|
||||
|
||||
void Mapper11_Init(CartInfo *info) {
|
||||
Latch_Init(info, M11Sync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
void Mapper144_Init(CartInfo *info) {
|
||||
Latch_Init(info, M11Sync, 0, 0x8001, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 13 ---------------------------
|
||||
|
||||
static void CPROMSync(void) {
|
||||
setchr4(0x0000, 0);
|
||||
setchr4(0x1000, latche & 3);
|
||||
setprg32(0x8000, 0);
|
||||
}
|
||||
|
||||
void CPROM_Init(CartInfo *info) {
|
||||
Latch_Init(info, CPROMSync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 38 ---------------------------
|
||||
|
||||
static void M38Sync(void) {
|
||||
setprg32(0x8000, latche & 3);
|
||||
setchr8(latche >> 2);
|
||||
}
|
||||
|
||||
void Mapper38_Init(CartInfo *info) {
|
||||
Latch_Init(info, M38Sync, 0, 0x7000, 0x7FFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 66 ---------------------------
|
||||
|
||||
static void MHROMSync(void) {
|
||||
setprg32(0x8000, latche >> 4);
|
||||
setchr8(latche & 0xF);
|
||||
}
|
||||
|
||||
void MHROM_Init(CartInfo *info) {
|
||||
Latch_Init(info, MHROMSync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 70 ---------------------------
|
||||
|
||||
static void M70Sync() {
|
||||
setprg16(0x8000, latche >> 4);
|
||||
setprg16(0xc000, ~0);
|
||||
setchr8(latche & 0xf);
|
||||
}
|
||||
|
||||
void Mapper70_Init(CartInfo *info) {
|
||||
Latch_Init(info, M70Sync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 78 ---------------------------
|
||||
/* Should be two separate emulation functions for this "mapper". Sigh. URGE TO KILL RISING. */
|
||||
static void M78Sync() {
|
||||
setprg16(0x8000, (latche & 7));
|
||||
setprg16(0xc000, ~0);
|
||||
setchr8(latche >> 4);
|
||||
setmirror(MI_0 + ((latche >> 3) & 1));
|
||||
}
|
||||
|
||||
void Mapper78_Init(CartInfo *info) {
|
||||
Latch_Init(info, M78Sync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 86 ---------------------------
|
||||
|
||||
static void M86Sync(void) {
|
||||
setprg32(0x8000, (latche >> 4) & 3);
|
||||
setchr8((latche & 3) | ((latche >> 4) & 4));
|
||||
}
|
||||
|
||||
void Mapper86_Init(CartInfo *info) {
|
||||
Latch_Init(info, M86Sync, ~0, 0x6000, 0x6FFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 87 ---------------------------
|
||||
|
||||
static void M87Sync(void) {
|
||||
setprg32(0x8000, 0);
|
||||
setchr8(((latche >> 1) & 1) | ((latche << 1) & 2));
|
||||
}
|
||||
|
||||
void Mapper87_Init(CartInfo *info) {
|
||||
Latch_Init(info, M87Sync, ~0, 0x6000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 89 ---------------------------
|
||||
|
||||
static void M89Sync(void) {
|
||||
setprg16(0x8000, (latche >> 4) & 7);
|
||||
setprg16(0xc000, ~0);
|
||||
setchr8((latche & 7) | ((latche >> 4) & 8));
|
||||
setmirror(MI_0 + ((latche >> 3) & 1));
|
||||
}
|
||||
|
||||
void Mapper89_Init(CartInfo *info) {
|
||||
Latch_Init(info, M89Sync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 93 ---------------------------
|
||||
|
||||
static void SSUNROMSync(void) {
|
||||
setprg16(0x8000, latche >> 4);
|
||||
setprg16(0xc000, ~0);
|
||||
setchr8(0);
|
||||
}
|
||||
|
||||
void SUNSOFT_UNROM_Init(CartInfo *info) {
|
||||
Latch_Init(info, SSUNROMSync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 94 ---------------------------
|
||||
|
||||
static void M94Sync(void) {
|
||||
setprg16(0x8000, latche >> 2);
|
||||
setprg16(0xc000, ~0);
|
||||
setchr8(0);
|
||||
}
|
||||
|
||||
void Mapper94_Init(CartInfo *info) {
|
||||
Latch_Init(info, M94Sync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 97 ---------------------------
|
||||
|
||||
static void M97Sync(void) {
|
||||
setchr8(0);
|
||||
setprg16(0x8000, ~0);
|
||||
setprg16(0xc000, latche & 15);
|
||||
switch (latche >> 6) {
|
||||
case 0: break;
|
||||
case 1: setmirror(MI_H); break;
|
||||
case 2: setmirror(MI_V); break;
|
||||
case 3: break;
|
||||
}
|
||||
setchr8(((latche >> 1) & 1) | ((latche << 1) & 2));
|
||||
}
|
||||
|
||||
void Mapper97_Init(CartInfo *info) {
|
||||
Latch_Init(info, M97Sync, ~0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 101 ---------------------------
|
||||
|
||||
static void M101Sync(void) {
|
||||
setprg32(0x8000, 0);
|
||||
setchr8(latche);
|
||||
}
|
||||
|
||||
void Mapper101_Init(CartInfo *info) {
|
||||
Latch_Init(info, M101Sync, ~0, 0x6000, 0x7FFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 107 ---------------------------
|
||||
|
||||
static void M107Sync(void) {
|
||||
setprg32(0x8000, (latche >> 1) & 3);
|
||||
setchr8(latche & 7);
|
||||
}
|
||||
|
||||
void Mapper107_Init(CartInfo *info) {
|
||||
Latch_Init(info, M107Sync, ~0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 113 ---------------------------
|
||||
|
||||
static void M113Sync(void) {
|
||||
setprg32(0x8000, (latche >> 3) & 7);
|
||||
setchr8(((latche >> 3) & 8) | (latche & 7));
|
||||
// setmirror(latche>>7); // only for HES 6in1
|
||||
}
|
||||
|
||||
void Mapper113_Init(CartInfo *info) {
|
||||
Latch_Init(info, M113Sync, 0, 0x4100, 0x7FFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 140 ---------------------------
|
||||
|
||||
void Mapper140_Init(CartInfo *info) {
|
||||
Latch_Init(info, MHROMSync, 0, 0x6000, 0x7FFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 152 ---------------------------
|
||||
|
||||
static void M152Sync() {
|
||||
setprg16(0x8000, (latche >> 4) & 7);
|
||||
setprg16(0xc000, ~0);
|
||||
setchr8(latche & 0xf);
|
||||
setmirror(MI_0 + ((latche >> 7) & 1)); /* Saint Seiya...hmm. */
|
||||
}
|
||||
|
||||
void Mapper152_Init(CartInfo *info) {
|
||||
Latch_Init(info, M152Sync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 180 ---------------------------
|
||||
|
||||
static void M180Sync(void) {
|
||||
setprg16(0x8000, 0);
|
||||
setprg16(0xc000, latche);
|
||||
setchr8(0);
|
||||
}
|
||||
|
||||
void Mapper180_Init(CartInfo *info) {
|
||||
Latch_Init(info, M180Sync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 184 ---------------------------
|
||||
|
||||
static void M184Sync(void) {
|
||||
setchr4(0x0000, latche);
|
||||
setchr4(0x1000, latche >> 4);
|
||||
setprg32(0x8000, 0);
|
||||
}
|
||||
|
||||
void Mapper184_Init(CartInfo *info) {
|
||||
Latch_Init(info, M184Sync, 0, 0x6000, 0x7FFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 203 ---------------------------
|
||||
|
||||
static void M203Sync(void) {
|
||||
setprg16(0x8000, (latche >> 2) & 3);
|
||||
setprg16(0xC000, (latche >> 2) & 3);
|
||||
setchr8(latche & 3);
|
||||
}
|
||||
|
||||
void Mapper203_Init(CartInfo *info) {
|
||||
Latch_Init(info, M203Sync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 240 ---------------------------
|
||||
|
||||
static void M240Sync(void) {
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg32(0x8000, latche >> 4);
|
||||
setchr8(latche & 0xF);
|
||||
}
|
||||
|
||||
void Mapper240_Init(CartInfo *info) {
|
||||
Latch_Init(info, M240Sync, 0, 0x4020, 0x5FFF, 1, 0);
|
||||
}
|
||||
|
||||
//------------------ Map 241 ---------------------------
|
||||
// Mapper 7 mostly, but with SRAM or maybe prot circuit
|
||||
// figure out, which games do need 5xxx area reading
|
||||
|
||||
static void M241Sync(void) {
|
||||
setchr8(0);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
if (latche & 0x80)
|
||||
setprg32(0x8000, latche | 8); // no 241 actually, but why not afterall?
|
||||
else
|
||||
setprg32(0x8000, latche);
|
||||
}
|
||||
|
||||
void Mapper241_Init(CartInfo *info) {
|
||||
Latch_Init(info, M241Sync, 0, 0x8000, 0xFFFF, 1, 0);
|
||||
}
|
||||
|
||||
//------------------ A65AS ---------------------------
|
||||
|
||||
// actually, there is two cart in one... First have extra mirroring
|
||||
// mode (one screen) and 32K bankswitching, second one have only
|
||||
// 16 bankswitching mode and normal mirroring... But there is no any
|
||||
// correlations between modes and they can be used in one mapper code.
|
||||
|
||||
static void BMCA65ASSync(void) {
|
||||
if (latche & 0x40)
|
||||
setprg32(0x8000, (latche >> 1) & 0x0F);
|
||||
else {
|
||||
setprg16(0x8000, ((latche & 0x30) >> 1) | (latche & 7));
|
||||
setprg16(0xC000, ((latche & 0x30) >> 1) | 7);
|
||||
}
|
||||
setchr8(0);
|
||||
if (latche & 0x80)
|
||||
setmirror(MI_0 + (((latche >> 5) & 1)));
|
||||
else
|
||||
setmirror(((latche >> 3) & 1) ^ 1);
|
||||
}
|
||||
|
||||
void BMCA65AS_Init(CartInfo *info) {
|
||||
Latch_Init(info, BMCA65ASSync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
||||
|
||||
//------------------ BMC-11160 ---------------------------
|
||||
// Simple BMC discrete mapper by TXC
|
||||
|
||||
static void BMC11160Sync(void) {
|
||||
uint32 bank = (latche >> 4) & 7;
|
||||
setprg32(0x8000, bank);
|
||||
setchr8((bank << 2) | (latche & 3));
|
||||
setmirror((latche >> 7) & 1);
|
||||
}
|
||||
|
||||
void BMC11160_Init(CartInfo *info) {
|
||||
Latch_Init(info, BMC11160Sync, 0, 0x8000, 0xFFFF, 0, 0);
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2006 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint8 reg;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ ®, 1, "REG" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setchr8(0);
|
||||
setprg8r(0x10, 0x6000, (reg & 0xC0) >> 6);
|
||||
setprg32(0x8000, reg & 0x1F);
|
||||
// setmirror(((reg&0x20)>>5));
|
||||
}
|
||||
|
||||
static DECLFW(UNLEDU2000HiWrite) {
|
||||
// FCEU_printf("%04x:%02x\n",A,V);
|
||||
reg = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void UNLEDU2000Power(void) {
|
||||
setmirror(MI_0);
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0xFFFF, CartBW);
|
||||
SetWriteHandler(0x8000, 0xFFFF, UNLEDU2000HiWrite);
|
||||
reg = 0;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void UNLEDU2000Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void UNLEDU2000Restore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void UNLEDU2000_Init(CartInfo *info) {
|
||||
info->Power = UNLEDU2000Power;
|
||||
info->Close = UNLEDU2000Close;
|
||||
GameStateRestore = UNLEDU2000Restore;
|
||||
WRAM = (uint8*)FCEU_gmalloc(32768);
|
||||
SetupCartPRGMapping(0x10, WRAM, 32768, 1);
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = 32768;
|
||||
}
|
||||
AddExState(WRAM, 32768, 0, "WRAM");
|
||||
AddExState(StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,115 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2009 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 regs[8];
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ regs, 8, "REGS" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg2r(0x10, 0x0800, 0);
|
||||
setprg2r(0x10, 0x1000, 1);
|
||||
setprg2r(0x10, 0x1800, 2);
|
||||
setprg8r(0x10, 0x6000, 1);
|
||||
setprg16(0x8000, 0);
|
||||
setprg16(0xC000, ~0);
|
||||
setchr8(0);
|
||||
}
|
||||
|
||||
//static DECLFW(SSSNROMWrite)
|
||||
//{
|
||||
// CartBW(A,V);
|
||||
//}
|
||||
|
||||
static DECLFW(SSSNROMWrite) {
|
||||
// FCEU_printf("write %04x %02x\n",A,V);
|
||||
// regs[A&7] = V;
|
||||
}
|
||||
|
||||
static DECLFR(SSSNROMRead) {
|
||||
// FCEU_printf("read %04x\n",A);
|
||||
switch (A & 7) {
|
||||
case 0: return regs[0] = 0xff; // clear all exceptions
|
||||
case 2: return 0xc0; // DIP selftest + freeplay
|
||||
case 3: return 0x00; // 0, 1 - attract
|
||||
// 2
|
||||
// 4 - menu
|
||||
// 8 - self check and game casette check
|
||||
// 10 - lock?
|
||||
// 20 - game title & count display
|
||||
case 7: return 0x22; // TV type, key not turned, relay B
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void SSSNROMPower(void) {
|
||||
regs[0] = regs[1] = regs[2] = regs[3] = regs[4] = regs[5] = regs[6] = 0;
|
||||
regs[7] = 0xff;
|
||||
Sync();
|
||||
memset(WRAM, 0x00, WRAMSIZE);
|
||||
// SetWriteHandler(0x0000,0x1FFF,SSSNROMRamWrite);
|
||||
SetReadHandler(0x0800, 0x1FFF, CartBR);
|
||||
SetWriteHandler(0x0800, 0x1FFF, CartBW);
|
||||
SetReadHandler(0x5000, 0x5FFF, SSSNROMRead);
|
||||
SetWriteHandler(0x5000, 0x5FFF, SSSNROMWrite);
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
}
|
||||
|
||||
static void SSSNROMReset(void) {
|
||||
regs[1] = regs[2] = regs[3] = regs[4] = regs[5] = regs[6] = 0;
|
||||
}
|
||||
|
||||
static void SSSNROMClose(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void SSSNROMIRQHook(void) {
|
||||
// X6502_IRQBegin(FCEU_IQEXT);
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void SSSNROM_Init(CartInfo *info) {
|
||||
info->Reset = SSSNROMReset;
|
||||
info->Power = SSSNROMPower;
|
||||
info->Close = SSSNROMClose;
|
||||
GameHBIRQHook = SSSNROMIRQHook;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 16384;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,153 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2012 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* FFE Copier Mappers
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 preg[4], creg[8], latch, ffemode;
|
||||
static uint8 IRQa, mirr;
|
||||
static int32 IRQCount, IRQLatch;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ preg, 4, "PREG" },
|
||||
{ creg, 8, "CREG" },
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ &IRQa, 1, "IRQA" },
|
||||
{ &IRQCount, 4, "IRQC" },
|
||||
{ &IRQLatch, 4, "IRQL" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
if (ffemode) {
|
||||
int i;
|
||||
for (i = 0; i < 8; i++) setchr1(i << 10, creg[i]);
|
||||
setprg8(0x8000, preg[0]);
|
||||
setprg8(0xA000, preg[1]);
|
||||
setprg8(0xC000, preg[2]);
|
||||
setprg8(0xE000, preg[3]);
|
||||
} else {
|
||||
setchr8(latch & 3);
|
||||
setprg16(0x8000, (latch >> 2) & 0x3F);
|
||||
setprg16(0xc000, 0x7);
|
||||
}
|
||||
switch (mirr) {
|
||||
case 0: setmirror(MI_0); break;
|
||||
case 1: setmirror(MI_1); break;
|
||||
case 2: setmirror(MI_V); break;
|
||||
case 3: setmirror(MI_H); break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(FFEWriteMirr) {
|
||||
mirr = ((A << 1) & 2) | ((V >> 4) & 1);
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(FFEWriteIRQ) {
|
||||
switch (A) {
|
||||
case 0x4501: IRQa = 0; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
case 0x4502: IRQCount &= 0xFF00; IRQCount |= V; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
case 0x4503: IRQCount &= 0x00FF; IRQCount |= V << 8; IRQa = 1; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(FFEWritePrg) {
|
||||
preg[A & 3] = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(FFEWriteChr) {
|
||||
creg[A & 7] = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(FFEWriteLatch) {
|
||||
latch = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void FFEPower(void) {
|
||||
preg[3] = ~0;
|
||||
Sync();
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x42FE, 0x42FF, FFEWriteMirr);
|
||||
SetWriteHandler(0x4500, 0x4503, FFEWriteIRQ);
|
||||
SetWriteHandler(0x4504, 0x4507, FFEWritePrg);
|
||||
SetWriteHandler(0x4510, 0x4517, FFEWriteChr);
|
||||
SetWriteHandler(0x4510, 0x4517, FFEWriteChr);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, FFEWriteLatch);
|
||||
}
|
||||
|
||||
static void FFEIRQHook(int a) {
|
||||
if (IRQa) {
|
||||
IRQCount += a;
|
||||
if (IRQCount >= 0x10000) {
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
IRQa = 0;
|
||||
IRQCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void FFEClose(void)
|
||||
{
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper6_Init(CartInfo *info) {
|
||||
ffemode = 0;
|
||||
mirr = ((info->mirror & 1) ^ 1) | 2;
|
||||
|
||||
info->Power = FFEPower;
|
||||
info->Close = FFEClose;
|
||||
MapIRQHook = FFEIRQHook;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void Mapper17_Init(CartInfo *info) {
|
||||
ffemode = 1;
|
||||
Mapper6_Init(info);
|
||||
}
|
|
@ -1,290 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2006 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
#include "mmc3.h"
|
||||
#include "../ines.h"
|
||||
|
||||
static bool is_BMCFK23CA;
|
||||
static uint8 unromchr;
|
||||
static uint32 dipswitch;
|
||||
static uint8 *CHRRAM=NULL;
|
||||
static uint32 CHRRAMSize;
|
||||
|
||||
static void BMCFK23CCW(uint32 A, uint8 V)
|
||||
{
|
||||
if(EXPREGS[0]&0x40)
|
||||
setchr8(EXPREGS[2]|unromchr);
|
||||
else if(EXPREGS[0]&0x20) {
|
||||
setchr1r(0x10, A, V);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint16 base=(EXPREGS[2]&0x7F)<<3;
|
||||
if(EXPREGS[3]&2)
|
||||
{
|
||||
int cbase=(MMC3_cmd&0x80)<<5;
|
||||
setchr1(A,V|base);
|
||||
setchr1(0x0000^cbase,DRegBuf[0]|base);
|
||||
setchr1(0x0400^cbase,EXPREGS[6]|base);
|
||||
setchr1(0x0800^cbase,DRegBuf[1]|base);
|
||||
setchr1(0x0c00^cbase,EXPREGS[7]|base);
|
||||
}
|
||||
else
|
||||
setchr1(A,V|base);
|
||||
}
|
||||
}
|
||||
|
||||
//some games are wired differently, and this will need to be changed.
|
||||
//all the WXN games require prg_bonus = 1, and cah4e3's multicarts require prg_bonus = 0
|
||||
//we'll populate this from a game database
|
||||
static int prg_bonus;
|
||||
static int prg_mask;
|
||||
|
||||
//prg_bonus = 0
|
||||
//4-in-1 (FK23C8021)[p1][!].nes
|
||||
//4-in-1 (FK23C8033)[p1][!].nes
|
||||
//4-in-1 (FK23C8043)[p1][!].nes
|
||||
//4-in-1 (FK23Cxxxx, S-0210A PCB)[p1][!].nes
|
||||
|
||||
//prg_bonus = 1
|
||||
//[m176]大富翁2-上海大亨.wxn.nes
|
||||
//[m176]宠物翡翠.fix.nes
|
||||
//[m176]格兰帝亚.wxn.nes
|
||||
//[m176]梦幻之星.wxn.nes
|
||||
//[m176]水浒神兽.fix.nes
|
||||
//[m176]西楚霸王.fix.nes
|
||||
//[m176]超级大富翁.wxn.nes
|
||||
//[m176]雄霸天下.wxn.nes
|
||||
|
||||
//works as-is under virtuanes m176
|
||||
//[m176]三侠五义.wxn.nes
|
||||
//[m176]口袋金.fix.nes
|
||||
//[m176]爆笑三国.fix.nes
|
||||
|
||||
//needs other tweaks
|
||||
//[m176]三国忠烈传.wxn.nes
|
||||
//[m176]破釜沉舟.fix.nes
|
||||
|
||||
//PRG wrapper
|
||||
static void BMCFK23CPW(uint32 A, uint8 V)
|
||||
{
|
||||
uint32 bank = (EXPREGS[1] & 0x1F);
|
||||
uint32 hiblock = ((EXPREGS[0] & 8) << 4)|((EXPREGS[0] & 0x80) << 1)|(UNIFchrrama?((EXPREGS[2] & 0x40)<<3):0);
|
||||
uint32 block = (EXPREGS[1] & 0x60) | hiblock;
|
||||
uint32 extra = (EXPREGS[3] & 2);
|
||||
|
||||
if((EXPREGS[0]&7)==4)
|
||||
setprg32(0x8000,EXPREGS[1]>>1);
|
||||
else if ((EXPREGS[0]&7)==3)
|
||||
{
|
||||
setprg16(0x8000,EXPREGS[1]);
|
||||
setprg16(0xC000,EXPREGS[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(EXPREGS[0]&3)
|
||||
{
|
||||
uint32 blocksize = (6)-(EXPREGS[0]&3);
|
||||
uint32 mask = (1<<blocksize)-1;
|
||||
V &= mask;
|
||||
//V &= 63; //? is this a good idea?
|
||||
V |= (EXPREGS[1]<<1);
|
||||
setprg8(A,V);
|
||||
}
|
||||
else
|
||||
setprg8(A,V & prg_mask);
|
||||
|
||||
if(EXPREGS[3]&2)
|
||||
{
|
||||
setprg8(0xC000,EXPREGS[4]);
|
||||
setprg8(0xE000,EXPREGS[5]);
|
||||
}
|
||||
}
|
||||
setprg8r(0x10,0x6000,A001B&3);
|
||||
}
|
||||
|
||||
//PRG handler ($8000-$FFFF)
|
||||
static DECLFW(BMCFK23CHiWrite)
|
||||
{
|
||||
if(EXPREGS[0]&0x40)
|
||||
{
|
||||
if(EXPREGS[0]&0x30)
|
||||
unromchr=0;
|
||||
else
|
||||
{
|
||||
unromchr=V&3;
|
||||
FixMMC3CHR(MMC3_cmd);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if((A==0x8001)&&(EXPREGS[3]&2&&MMC3_cmd&8))
|
||||
{
|
||||
EXPREGS[4|(MMC3_cmd&3)]=V;
|
||||
FixMMC3PRG(MMC3_cmd);
|
||||
FixMMC3CHR(MMC3_cmd);
|
||||
}
|
||||
else
|
||||
if(A<0xC000) {
|
||||
if(UNIFchrrama) { // hacky... strange behaviour, must be bit scramble due to pcb layot restrictions
|
||||
// check if it not interfer with other dumps
|
||||
if((A==0x8000)&&(V==0x46))
|
||||
V=0x47;
|
||||
else if((A==0x8000)&&(V==0x47))
|
||||
V=0x46;
|
||||
}
|
||||
MMC3_CMDWrite(A,V);
|
||||
FixMMC3PRG(MMC3_cmd);
|
||||
}
|
||||
else
|
||||
MMC3_IRQWrite(A,V);
|
||||
}
|
||||
}
|
||||
|
||||
//EXP handler ($5000-$5FFF)
|
||||
static DECLFW(BMCFK23CWrite)
|
||||
{
|
||||
if(A&(1<<(dipswitch+4)))
|
||||
{
|
||||
//printf("+ ");
|
||||
EXPREGS[A&3]=V;
|
||||
|
||||
bool remap = false;
|
||||
|
||||
//sometimes writing to reg0 causes remappings to occur. we think the 2 signifies this.
|
||||
//if not, 0x24 is a value that is known to work
|
||||
//however, the low 4 bits are known to control the mapping mode, so 0x20 is more likely to be the immediate remap flag
|
||||
remap |= ((EXPREGS[0]&0xF0)==0x20);
|
||||
|
||||
//this is an actual mapping reg. i think reg0 controls what happens when reg1 is written. anyway, we have to immediately remap these
|
||||
remap |= (A&3)==1;
|
||||
//this too.
|
||||
remap |= (A&3)==2;
|
||||
|
||||
if(remap)
|
||||
{
|
||||
FixMMC3PRG(MMC3_cmd);
|
||||
FixMMC3CHR(MMC3_cmd);
|
||||
}
|
||||
}
|
||||
|
||||
if(is_BMCFK23CA)
|
||||
{
|
||||
if(EXPREGS[3]&2)
|
||||
EXPREGS[0] &= ~7; // hacky hacky! if someone wants extra banking, then for sure doesn't want mode 4 for it! (allow to run A version boards on normal mapper)
|
||||
}
|
||||
|
||||
//printf("%04X = $%02X\n",A,V);
|
||||
//printf("%02X %02X %02X %02X\n",EXPREGS[0],EXPREGS[1],EXPREGS[2],EXPREGS[3]);
|
||||
}
|
||||
|
||||
static void BMCFK23CReset(void)
|
||||
{
|
||||
//NOT NECESSARY ANYMORE
|
||||
//this little hack makes sure that we try all the dip switch settings eventually, if we reset enough
|
||||
// dipswitch++;
|
||||
// dipswitch&=7;
|
||||
//printf("BMCFK23C dipswitch set to %d\n",dipswitch);
|
||||
|
||||
EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=EXPREGS[3]=0;
|
||||
EXPREGS[4]=EXPREGS[5]=EXPREGS[6]=EXPREGS[7]=0xFF;
|
||||
MMC3RegReset();
|
||||
FixMMC3PRG(MMC3_cmd);
|
||||
FixMMC3CHR(MMC3_cmd);
|
||||
}
|
||||
|
||||
static void BMCFK23CPower(void)
|
||||
{
|
||||
dipswitch = 0;
|
||||
GenMMC3Power();
|
||||
EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=EXPREGS[3]=0;
|
||||
EXPREGS[4]=EXPREGS[5]=EXPREGS[6]=EXPREGS[7]=0xFF;
|
||||
GenMMC3Power();
|
||||
SetWriteHandler(0x5000,0x5fff,BMCFK23CWrite);
|
||||
SetWriteHandler(0x8000,0xFFFF,BMCFK23CHiWrite);
|
||||
FixMMC3PRG(MMC3_cmd);
|
||||
FixMMC3CHR(MMC3_cmd);
|
||||
}
|
||||
|
||||
static void BMCFK23CAPower(void)
|
||||
{
|
||||
GenMMC3Power();
|
||||
dipswitch = 0;
|
||||
EXPREGS[0]=EXPREGS[1]=EXPREGS[2]=EXPREGS[3]=0;
|
||||
EXPREGS[4]=EXPREGS[5]=EXPREGS[6]=EXPREGS[7]=0xFF;
|
||||
SetWriteHandler(0x5000,0x5fff,BMCFK23CWrite);
|
||||
SetWriteHandler(0x8000,0xFFFF,BMCFK23CHiWrite);
|
||||
FixMMC3PRG(MMC3_cmd);
|
||||
FixMMC3CHR(MMC3_cmd);
|
||||
}
|
||||
|
||||
static void BMCFK23CAClose(void)
|
||||
{
|
||||
if(CHRRAM)
|
||||
FCEU_gfree(CHRRAM);
|
||||
CHRRAM=NULL;
|
||||
}
|
||||
|
||||
void BMCFK23C_Init(CartInfo *info)
|
||||
{
|
||||
is_BMCFK23CA = false;
|
||||
|
||||
GenMMC3_Init(info, 512, 256, 8, 0);
|
||||
cwrap=BMCFK23CCW;
|
||||
pwrap=BMCFK23CPW;
|
||||
info->Power=BMCFK23CPower;
|
||||
info->Reset=BMCFK23CReset;
|
||||
AddExState(EXPREGS, 8, 0, "EXPR");
|
||||
AddExState(&unromchr, 1, 0, "UCHR");
|
||||
AddExState(&dipswitch, 1, 0, "DPSW");
|
||||
|
||||
prg_bonus = 1;
|
||||
if(MasterRomInfoParams.find("bonus") != MasterRomInfoParams.end())
|
||||
prg_bonus = atoi(MasterRomInfoParams["bonus"].c_str());
|
||||
|
||||
prg_mask = 0x7F>>(prg_bonus);
|
||||
}
|
||||
|
||||
void BMCFK23CA_Init(CartInfo *info)
|
||||
{
|
||||
is_BMCFK23CA = true;
|
||||
|
||||
GenMMC3_Init(info, 512, 256, 8, 0);
|
||||
cwrap=BMCFK23CCW;
|
||||
pwrap=BMCFK23CPW;
|
||||
info->Power=BMCFK23CAPower;
|
||||
info->Reset=BMCFK23CReset;
|
||||
info->Close=BMCFK23CAClose;
|
||||
|
||||
CHRRAMSize=8192;
|
||||
CHRRAM=(uint8*)FCEU_gmalloc(CHRRAMSize);
|
||||
SetupCartCHRMapping(0x10, CHRRAM, CHRRAMSize, 1);
|
||||
AddExState(CHRRAM, CHRRAMSize, 0, "CRAM");
|
||||
|
||||
AddExState(EXPREGS, 8, 0, "EXPR");
|
||||
AddExState(&unromchr, 1, 0, "UCHR");
|
||||
AddExState(&dipswitch, 1, 0, "DPSW");
|
||||
|
||||
prg_bonus = 1;
|
||||
if(MasterRomInfoParams.find("bonus") != MasterRomInfoParams.end())
|
||||
prg_bonus = atoi(MasterRomInfoParams["bonus"].c_str());
|
||||
prg_mask = 0x7F>>(prg_bonus);
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2007 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ ®, 1, "REGS" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg32(0x8000, reg & 1);
|
||||
setchr8(0);
|
||||
}
|
||||
|
||||
static DECLFW(UNLKS7012Write) {
|
||||
// FCEU_printf("bs %04x %02x\n",A,V);
|
||||
switch (A) {
|
||||
case 0xE0A0: reg = 0; Sync(); break;
|
||||
case 0xEE36: reg = 1; Sync(); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void UNLKS7012Power(void) {
|
||||
reg = ~0;
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, UNLKS7012Write);
|
||||
}
|
||||
|
||||
static void UNLKS7012Reset(void) {
|
||||
reg = ~0;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void UNLKS7012Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
void UNLKS7012_Init(CartInfo *info) {
|
||||
info->Power = UNLKS7012Power;
|
||||
info->Reset = UNLKS7012Reset;
|
||||
info->Close = UNLKS7012Close;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,114 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2007 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* FDS Conversion
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg, mirr;
|
||||
static int32 IRQa, IRQCount, IRQLatch;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ ®, 1, "REGS" },
|
||||
{ &IRQa, 4, "IRQA" },
|
||||
{ &IRQCount, 4, "IRQC" },
|
||||
{ &IRQLatch, 4, "IRQL" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg16(0x8000, reg);
|
||||
setprg16(0xC000, 2);
|
||||
setmirror(mirr);
|
||||
}
|
||||
|
||||
static DECLFW(UNLKS7017Write) {
|
||||
// FCEU_printf("bs %04x %02x\n",A,V);
|
||||
if ((A & 0xFF00) == 0x4A00) {
|
||||
reg = ((A >> 2) & 3) | ((A >> 4) & 4);
|
||||
} else if ((A & 0xFF00) == 0x5100) {
|
||||
Sync();
|
||||
} else if (A == 0x4020) {
|
||||
X6502_IRQEnd(FCEU_IQEXT);
|
||||
IRQCount &= 0xFF00;
|
||||
IRQCount |= V;
|
||||
} else if (A == 0x4021) {
|
||||
X6502_IRQEnd(FCEU_IQEXT);
|
||||
IRQCount &= 0xFF;
|
||||
IRQCount |= V << 8;
|
||||
IRQa = 1;
|
||||
} else if (A == 0x4025) {
|
||||
mirr = ((V & 8) >> 3) ^ 1;
|
||||
}
|
||||
}
|
||||
static DECLFR(FDSRead4030) {
|
||||
X6502_IRQEnd(FCEU_IQEXT);
|
||||
return X.IRQlow & FCEU_IQEXT ? 1 : 0;
|
||||
}
|
||||
|
||||
static void UNL7017IRQ(int a) {
|
||||
if (IRQa) {
|
||||
IRQCount -= a;
|
||||
if (IRQCount <= 0) {
|
||||
IRQa = 0;
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void UNLKS7017Power(void) {
|
||||
Sync();
|
||||
setchr8(0);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetReadHandler(0x4030, 0x4030, FDSRead4030);
|
||||
SetWriteHandler(0x4020, 0x5FFF, UNLKS7017Write);
|
||||
}
|
||||
|
||||
static void UNLKS7017Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void UNLKS7017_Init(CartInfo *info) {
|
||||
info->Power = UNLKS7017Power;
|
||||
info->Close = UNLKS7017Close;
|
||||
MapIRQHook = UNL7017IRQ;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,125 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2011 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* FDS Conversion
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg[8], cmd;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static void (*WSync)(void);
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &cmd, 1, "CMD" },
|
||||
{ reg, 8, "REGS" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void SyncKS7037(void) {
|
||||
setprg4r(0x10, 0x6000, 0);
|
||||
setprg4(0x7000, 15);
|
||||
setprg8(0x8000, reg[6]);
|
||||
setprg4(0xA000, ~3);
|
||||
setprg4r(0x10, 0xB000, 1);
|
||||
setprg8(0xC000, reg[7]);
|
||||
setprg8(0xE000, ~0);
|
||||
setchr8(0);
|
||||
setmirrorw(reg[2] & 1, reg[4] & 1, reg[3] & 1, reg[5] & 1);
|
||||
}
|
||||
|
||||
static void SyncLH10(void) {
|
||||
setprg8(0x6000, ~1);
|
||||
setprg8(0x8000, reg[6]);
|
||||
setprg8(0xA000, reg[7]);
|
||||
setprg8r(0x10, 0xC000, 0);
|
||||
setprg8(0xE000, ~0);
|
||||
setchr8(0);
|
||||
setmirror(0);
|
||||
}
|
||||
|
||||
static DECLFW(UNLKS7037Write) {
|
||||
switch (A & 0xE001) {
|
||||
case 0x8000: cmd = V & 7; break;
|
||||
case 0x8001: reg[cmd] = V; WSync(); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void UNLKS7037Power(void) {
|
||||
reg[0] = reg[1] = reg[2] = reg[3] = reg[4] = reg[5] = reg[6] = reg[7] = 0;
|
||||
WSync();
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetWriteHandler(0x8000, 0x9FFF, UNLKS7037Write);
|
||||
SetWriteHandler(0xA000, 0xBFFF, CartBW);
|
||||
SetWriteHandler(0xC000, 0xFFFF, UNLKS7037Write);
|
||||
}
|
||||
|
||||
static void LH10Power(void) {
|
||||
reg[0] = reg[1] = reg[2] = reg[3] = reg[4] = reg[5] = reg[6] = reg[7] = 0;
|
||||
WSync();
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xBFFF, UNLKS7037Write);
|
||||
SetWriteHandler(0xC000, 0xDFFF, CartBW);
|
||||
SetWriteHandler(0xE000, 0xFFFF, UNLKS7037Write);
|
||||
}
|
||||
|
||||
static void Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
WSync();
|
||||
}
|
||||
|
||||
void UNLKS7037_Init(CartInfo *info) {
|
||||
info->Power = UNLKS7037Power;
|
||||
info->Close = Close;
|
||||
|
||||
WSync = SyncKS7037;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void LH10_Init(CartInfo *info) {
|
||||
info->Power = LH10Power;
|
||||
info->Close = Close;
|
||||
|
||||
WSync = SyncLH10;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2007 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* FDS Conversion
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ ®, 1, "REG" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg8(0x6000, reg);
|
||||
setprg8(0x8000, ~3);
|
||||
setprg8(0xa000, ~2);
|
||||
setprg8r(0x10, 0xc000, 0);
|
||||
setprg8(0xe000, ~0);
|
||||
setchr8(0);
|
||||
}
|
||||
|
||||
static DECLFW(LH32Write) {
|
||||
reg = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void LH32Power(void) {
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0xC000, 0xDFFF, CartBW);
|
||||
SetWriteHandler(0x6000, 0x6000, LH32Write);
|
||||
}
|
||||
|
||||
static void LH32Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void LH32_Init(CartInfo *info) {
|
||||
info->Power = LH32Power;
|
||||
info->Close = LH32Close;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,107 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2007 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* FDS Conversion
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg, IRQa;
|
||||
static int32 IRQCount;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ ®, 1, "REG" },
|
||||
{ &IRQa, 1, "IRQA" },
|
||||
{ &IRQCount, 4, "IRQC" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setchr8(0);
|
||||
setprg8(0x6000, reg);
|
||||
setprg8(0x8000, 0xc);
|
||||
setprg4(0xa000, (0xd << 1));
|
||||
setprg2(0xb000, (0xd << 2) + 2);
|
||||
setprg2r(0x10, 0xb800, 4);
|
||||
setprg2r(0x10, 0xc000, 5);
|
||||
setprg2r(0x10, 0xc800, 6);
|
||||
setprg2r(0x10, 0xd000, 7);
|
||||
setprg2(0xd800, (0xe << 2) + 3);
|
||||
setprg8(0xe000, 0xf);
|
||||
}
|
||||
|
||||
static DECLFW(LH53RamWrite) {
|
||||
WRAM[(A - 0xB800) & 0x1FFF] = V;
|
||||
}
|
||||
|
||||
static DECLFW(LH53Write) {
|
||||
reg = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(LH53IRQaWrite) {
|
||||
IRQa = V & 2;
|
||||
IRQCount = 0;
|
||||
if (!IRQa)
|
||||
X6502_IRQEnd(FCEU_IQEXT);
|
||||
}
|
||||
|
||||
static void LH53IRQ(int a) {
|
||||
if (IRQa) {
|
||||
IRQCount += a;
|
||||
if (IRQCount > 7560)
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
}
|
||||
}
|
||||
|
||||
static void LH53Power(void) {
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0xB800, 0xD7FF, LH53RamWrite);
|
||||
SetWriteHandler(0xE000, 0xEFFF, LH53IRQaWrite);
|
||||
SetWriteHandler(0xF000, 0xFFFF, LH53Write);
|
||||
}
|
||||
|
||||
static void LH53Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void LH53_Init(CartInfo *info) {
|
||||
info->Power = LH53Power;
|
||||
info->Close = LH53Close;
|
||||
MapIRQHook = LH53IRQ;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,392 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 1998 BERO
|
||||
* Copyright (C) 2002 Xodnizel
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static void GenMMC1Power(void);
|
||||
static void GenMMC1Init(CartInfo *info, int prg, int chr, int wram, int battery);
|
||||
|
||||
static uint8 DRegs[4];
|
||||
static uint8 Buffer, BufferShift;
|
||||
|
||||
static int mmc1opts;
|
||||
|
||||
static void (*MMC1CHRHook4)(uint32 A, uint8 V);
|
||||
static void (*MMC1PRGHook16)(uint32 A, uint8 V);
|
||||
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint8 *CHRRAM = NULL;
|
||||
static int is155, is171;
|
||||
|
||||
static DECLFW(MBWRAM) {
|
||||
if (!(DRegs[3] & 0x10) || is155)
|
||||
Page[A >> 11][A] = V; // WRAM is enabled.
|
||||
}
|
||||
|
||||
static DECLFR(MAWRAM) {
|
||||
if ((DRegs[3] & 0x10) && !is155)
|
||||
return X.DB; // WRAM is disabled
|
||||
return(Page[A >> 11][A]);
|
||||
}
|
||||
|
||||
static void MMC1CHR(void) {
|
||||
if (mmc1opts & 4) {
|
||||
if (DRegs[0] & 0x10)
|
||||
setprg8r(0x10, 0x6000, (DRegs[1] >> 4) & 1);
|
||||
else
|
||||
setprg8r(0x10, 0x6000, (DRegs[1] >> 3) & 1);
|
||||
}
|
||||
|
||||
if (MMC1CHRHook4) {
|
||||
if (DRegs[0] & 0x10) {
|
||||
MMC1CHRHook4(0x0000, DRegs[1]);
|
||||
MMC1CHRHook4(0x1000, DRegs[2]);
|
||||
} else {
|
||||
MMC1CHRHook4(0x0000, (DRegs[1] & 0xFE));
|
||||
MMC1CHRHook4(0x1000, DRegs[1] | 1);
|
||||
}
|
||||
} else {
|
||||
if (DRegs[0] & 0x10) {
|
||||
setchr4(0x0000, DRegs[1]);
|
||||
setchr4(0x1000, DRegs[2]);
|
||||
} else
|
||||
setchr8(DRegs[1] >> 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void MMC1PRG(void) {
|
||||
uint8 offs = DRegs[1] & 0x10;
|
||||
if (MMC1PRGHook16) {
|
||||
switch (DRegs[0] & 0xC) {
|
||||
case 0xC:
|
||||
MMC1PRGHook16(0x8000, (DRegs[3] + offs));
|
||||
MMC1PRGHook16(0xC000, 0xF + offs);
|
||||
break;
|
||||
case 0x8:
|
||||
MMC1PRGHook16(0xC000, (DRegs[3] + offs));
|
||||
MMC1PRGHook16(0x8000, offs);
|
||||
break;
|
||||
case 0x0:
|
||||
case 0x4:
|
||||
MMC1PRGHook16(0x8000, ((DRegs[3] & ~1) + offs));
|
||||
MMC1PRGHook16(0xc000, ((DRegs[3] & ~1) + offs + 1));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (DRegs[0] & 0xC) {
|
||||
case 0xC:
|
||||
setprg16(0x8000, (DRegs[3] + offs));
|
||||
setprg16(0xC000, 0xF + offs);
|
||||
break;
|
||||
case 0x8:
|
||||
setprg16(0xC000, (DRegs[3] + offs));
|
||||
setprg16(0x8000, offs);
|
||||
break;
|
||||
case 0x0:
|
||||
case 0x4:
|
||||
setprg16(0x8000, ((DRegs[3] & ~1) + offs));
|
||||
setprg16(0xc000, ((DRegs[3] & ~1) + offs + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void MMC1MIRROR(void) {
|
||||
if (!is171)
|
||||
switch (DRegs[0] & 3) {
|
||||
case 2: setmirror(MI_V); break;
|
||||
case 3: setmirror(MI_H); break;
|
||||
case 0: setmirror(MI_0); break;
|
||||
case 1: setmirror(MI_1); break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint64 lreset;
|
||||
static DECLFW(MMC1_write) {
|
||||
int n = (A >> 13) - 4;
|
||||
|
||||
/* The MMC1 is busy so ignore the write. */
|
||||
/* As of version FCE Ultra 0.81, the timestamp is only
|
||||
increased before each instruction is executed(in other words
|
||||
precision isn't that great), but this should still work to
|
||||
deal with 2 writes in a row from a single RMW instruction.
|
||||
*/
|
||||
if ((timestampbase + timestamp) < (lreset + 2))
|
||||
return;
|
||||
// FCEU_printf("Write %04x:%02x\n",A,V);
|
||||
if (V & 0x80) {
|
||||
DRegs[0] |= 0xC;
|
||||
BufferShift = Buffer = 0;
|
||||
MMC1PRG();
|
||||
lreset = timestampbase + timestamp;
|
||||
return;
|
||||
}
|
||||
|
||||
Buffer |= (V & 1) << (BufferShift++);
|
||||
|
||||
if (BufferShift == 5) {
|
||||
DRegs[n] = Buffer;
|
||||
BufferShift = Buffer = 0;
|
||||
switch (n) {
|
||||
case 0: MMC1MIRROR(); MMC1CHR(); MMC1PRG(); break;
|
||||
case 1: MMC1CHR(); MMC1PRG(); break;
|
||||
case 2: MMC1CHR(); break;
|
||||
case 3: MMC1PRG(); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void MMC1_Restore(int version) {
|
||||
MMC1MIRROR();
|
||||
MMC1CHR();
|
||||
MMC1PRG();
|
||||
lreset = 0; // timestamp(base) is not stored in save states.
|
||||
}
|
||||
|
||||
static void MMC1CMReset(void) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
DRegs[i] = 0;
|
||||
Buffer = BufferShift = 0;
|
||||
DRegs[0] = 0x1F;
|
||||
|
||||
DRegs[1] = 0;
|
||||
DRegs[2] = 0; // Should this be something other than 0?
|
||||
DRegs[3] = 0;
|
||||
|
||||
MMC1MIRROR();
|
||||
MMC1CHR();
|
||||
MMC1PRG();
|
||||
}
|
||||
|
||||
static int DetectMMC1WRAMSize(uint32 crc32) {
|
||||
switch (crc32) {
|
||||
case 0xc6182024: // Romance of the 3 Kingdoms
|
||||
case 0x2225c20f: // Genghis Khan
|
||||
case 0x4642dda6: // Nobunaga's Ambition
|
||||
case 0x29449ba9: // "" "" (J)
|
||||
case 0x2b11e0b0: // "" "" (J)
|
||||
case 0xb8747abf: // Best Play Pro Yakyuu Special (J)
|
||||
case 0xc9556b36: // Final Fantasy I & II (J) [!]
|
||||
FCEU_printf(" >8KB external WRAM present. Use UNIF if you hack the ROM image.\n");
|
||||
return(16);
|
||||
break;
|
||||
default: return(8);
|
||||
}
|
||||
}
|
||||
|
||||
static uint32 NWCIRQCount;
|
||||
static uint8 NWCRec;
|
||||
#define NWCDIP 0xE
|
||||
|
||||
static void NWCIRQHook(int a) {
|
||||
if (!(NWCRec & 0x10)) {
|
||||
NWCIRQCount += a;
|
||||
if ((NWCIRQCount | (NWCDIP << 25)) >= 0x3e000000) {
|
||||
NWCIRQCount = 0;
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void NWCCHRHook(uint32 A, uint8 V) {
|
||||
if ((V & 0x10)) { // && !(NWCRec&0x10))
|
||||
NWCIRQCount = 0;
|
||||
X6502_IRQEnd(FCEU_IQEXT);
|
||||
}
|
||||
|
||||
NWCRec = V;
|
||||
if (V & 0x08)
|
||||
MMC1PRG();
|
||||
else
|
||||
setprg32(0x8000, (V >> 1) & 3);
|
||||
}
|
||||
|
||||
static void NWCPRGHook(uint32 A, uint8 V) {
|
||||
if (NWCRec & 0x8)
|
||||
setprg16(A, 8 | (V & 0x7));
|
||||
else
|
||||
setprg32(0x8000, (NWCRec >> 1) & 3);
|
||||
}
|
||||
|
||||
static void NWCPower(void) {
|
||||
GenMMC1Power();
|
||||
setchr8r(0, 0);
|
||||
}
|
||||
|
||||
void Mapper105_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 256, 256, 8, 0);
|
||||
MMC1CHRHook4 = NWCCHRHook;
|
||||
MMC1PRGHook16 = NWCPRGHook;
|
||||
MapIRQHook = NWCIRQHook;
|
||||
info->Power = NWCPower;
|
||||
}
|
||||
|
||||
static void GenMMC1Power(void) {
|
||||
lreset = 0;
|
||||
if (mmc1opts & 1) {
|
||||
FCEU_CheatAddRAM(8, 0x6000, WRAM);
|
||||
if (mmc1opts & 4)
|
||||
FCEU_dwmemset(WRAM, 0, 8192)
|
||||
else if (!(mmc1opts & 2))
|
||||
FCEU_dwmemset(WRAM, 0, 8192);
|
||||
}
|
||||
SetWriteHandler(0x8000, 0xFFFF, MMC1_write);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
|
||||
if (mmc1opts & 1) {
|
||||
SetReadHandler(0x6000, 0x7FFF, MAWRAM);
|
||||
SetWriteHandler(0x6000, 0x7FFF, MBWRAM);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
}
|
||||
|
||||
MMC1CMReset();
|
||||
}
|
||||
|
||||
static void GenMMC1Close(void) {
|
||||
if (CHRRAM)
|
||||
FCEU_gfree(CHRRAM);
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
CHRRAM = WRAM = NULL;
|
||||
}
|
||||
|
||||
static void GenMMC1Init(CartInfo *info, int prg, int chr, int wram, int battery) {
|
||||
is155 = 0;
|
||||
|
||||
info->Close = GenMMC1Close;
|
||||
MMC1PRGHook16 = MMC1CHRHook4 = 0;
|
||||
mmc1opts = 0;
|
||||
PRGmask16[0] &= (prg >> 14) - 1;
|
||||
CHRmask4[0] &= (chr >> 12) - 1;
|
||||
CHRmask8[0] &= (chr >> 13) - 1;
|
||||
|
||||
if (wram) {
|
||||
WRAM = (uint8*)FCEU_gmalloc(wram * 1024);
|
||||
//mbg 17-jun-08 - this shouldve been cleared to re-initialize save ram
|
||||
//ch4 10-dec-08 - nope, this souldn't
|
||||
//mbg 29-mar-09 - no time to debate this, we need to keep from breaking some old stuff.
|
||||
//we really need to make up a policy for how compatibility and accuracy can be resolved.
|
||||
memset(WRAM, 0, wram * 1024);
|
||||
mmc1opts |= 1;
|
||||
if (wram > 8) mmc1opts |= 4;
|
||||
SetupCartPRGMapping(0x10, WRAM, wram * 1024, 1);
|
||||
AddExState(WRAM, wram * 1024, 0, "WRAM");
|
||||
if (battery) {
|
||||
mmc1opts |= 2;
|
||||
info->SaveGame[0] = WRAM + ((mmc1opts & 4) ? 8192 : 0);
|
||||
info->SaveGameLen[0] = 8192;
|
||||
}
|
||||
}
|
||||
if (!chr) {
|
||||
CHRRAM = (uint8*)FCEU_gmalloc(8192);
|
||||
SetupCartCHRMapping(0, CHRRAM, 8192, 1);
|
||||
AddExState(CHRRAM, 8192, 0, "CHRR");
|
||||
}
|
||||
AddExState(DRegs, 4, 0, "DREG");
|
||||
|
||||
info->Power = GenMMC1Power;
|
||||
GameStateRestore = MMC1_Restore;
|
||||
AddExState(&lreset, 8, 1, "LRST");
|
||||
AddExState(&Buffer, 1, 1, "BFFR");
|
||||
AddExState(&BufferShift, 1, 1, "BFRS");
|
||||
}
|
||||
|
||||
void Mapper1_Init(CartInfo *info) {
|
||||
int ws = DetectMMC1WRAMSize(info->CRC32);
|
||||
GenMMC1Init(info, 512, 256, ws, info->battery);
|
||||
}
|
||||
|
||||
/* Same as mapper 1, without respect for WRAM enable bit. */
|
||||
void Mapper155_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 512, 256, 8, info->battery);
|
||||
is155 = 1;
|
||||
}
|
||||
|
||||
/* Same as mapper 1, with different (or without) mirroring control. */
|
||||
/* Kaiser KS7058 board, KS203 custom chip */
|
||||
void Mapper171_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 32, 32, 0, 0);
|
||||
is171 = 1;
|
||||
}
|
||||
|
||||
void SAROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 128, 64, 8, info->battery);
|
||||
}
|
||||
|
||||
void SBROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 128, 64, 0, 0);
|
||||
}
|
||||
|
||||
void SCROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 128, 128, 0, 0);
|
||||
}
|
||||
|
||||
void SEROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 32, 64, 0, 0);
|
||||
}
|
||||
|
||||
void SGROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 256, 0, 0, 0);
|
||||
}
|
||||
|
||||
void SKROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 256, 64, 8, info->battery);
|
||||
}
|
||||
|
||||
void SLROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 256, 128, 0, 0);
|
||||
}
|
||||
|
||||
void SL1ROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 128, 128, 0, 0);
|
||||
}
|
||||
|
||||
/* Begin unknown - may be wrong - perhaps they use different MMC1s from the
|
||||
similarly functioning boards?
|
||||
*/
|
||||
|
||||
void SL2ROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 256, 256, 0, 0);
|
||||
}
|
||||
|
||||
void SFROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 256, 256, 0, 0);
|
||||
}
|
||||
|
||||
void SHROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 256, 256, 0, 0);
|
||||
}
|
||||
|
||||
/* End unknown */
|
||||
/* */
|
||||
/* */
|
||||
|
||||
void SNROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 256, 0, 8, info->battery);
|
||||
}
|
||||
|
||||
void SOROM_Init(CartInfo *info) {
|
||||
GenMMC1Init(info, 256, 0, 16, info->battery);
|
||||
}
|
||||
|
||||
|
|
@ -1,137 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2012 CaH4e3
|
||||
* Copyright (C) 2002 Xodnizel
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 is10;
|
||||
static uint8 creg[4], latch0, latch1, preg, mirr;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ creg, 4, "CREG" },
|
||||
{ &preg, 1, "PREG" },
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ &latch0, 1, "LAT0" },
|
||||
{ &latch1, 1, "LAT1" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
if (is10) {
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg16(0x8000, preg);
|
||||
setprg16(0xC000, ~0);
|
||||
} else {
|
||||
setprg8(0x8000, preg);
|
||||
setprg8(0xA000, ~2);
|
||||
setprg8(0xC000, ~1);
|
||||
setprg8(0xE000, ~0);
|
||||
}
|
||||
setchr4(0x0000, creg[latch0]);
|
||||
setchr4(0x1000, creg[latch1 + 2]);
|
||||
setmirror(mirr);
|
||||
}
|
||||
|
||||
DECLFW(MMC2and4Write) {
|
||||
switch (A & 0xF000) {
|
||||
case 0xA000: preg = V; Sync(); break;
|
||||
case 0xB000: creg[0] = V; Sync(); break;
|
||||
case 0xC000: creg[1] = V; Sync(); break;
|
||||
case 0xD000: creg[2] = V; Sync(); break;
|
||||
case 0xE000: creg[3] = V; Sync(); break;
|
||||
case 0xF000: mirr = (V & 1) ^ 1; Sync(); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void MMC2and4PPUHook(uint32 A) {
|
||||
uint8 l, h = A >> 8;
|
||||
if (h >= 0x20 || ((h & 0xF) != 0xF))
|
||||
return;
|
||||
l = A & 0xF0;
|
||||
if (h < 0x10) {
|
||||
if (l == 0xD0) {
|
||||
latch0 = 0;
|
||||
setchr4(0x0000, creg[0]);
|
||||
} else if (l == 0xE0) {
|
||||
latch0 = 1;
|
||||
setchr4(0x0000, creg[1]);
|
||||
}
|
||||
} else {
|
||||
if (l == 0xD0) {
|
||||
latch1 = 0;
|
||||
setchr4(0x1000, creg[2]);
|
||||
} else if (l == 0xE0) {
|
||||
latch1 = 1;
|
||||
setchr4(0x1000, creg[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void MMC2and4Power(void) {
|
||||
preg = 0;
|
||||
latch0 = latch1 = 1;
|
||||
Sync();
|
||||
if (is10) {
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
}
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0xA000, 0xFFFF, MMC2and4Write);
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void MMC2and4Close(void)
|
||||
{
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
void Mapper9_Init(CartInfo *info) {
|
||||
is10 = 0;
|
||||
info->Power = MMC2and4Power;
|
||||
PPU_hook = MMC2and4PPUHook;
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void Mapper10_Init(CartInfo *info) {
|
||||
is10 = 1;
|
||||
info->Power = MMC2and4Power;
|
||||
info->Close = MMC2and4Close;
|
||||
PPU_hook = MMC2and4PPUHook;
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,874 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2002 Xodnizel
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* None of this code should use any of the iNES bank switching wrappers. */
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static void (*sfun)(int P);
|
||||
static void (*psfun)(void);
|
||||
|
||||
void MMC5RunSound(int Count);
|
||||
void MMC5RunSoundHQ(void);
|
||||
|
||||
static INLINE void MMC5SPRVROM_BANK1(uint32 A, uint32 V) {
|
||||
if (CHRptr[0]) {
|
||||
V &= CHRmask1[0];
|
||||
MMC5SPRVPage[(A) >> 10] = &CHRptr[0][(V) << 10] - (A);
|
||||
}
|
||||
}
|
||||
|
||||
static INLINE void MMC5BGVROM_BANK1(uint32 A, uint32 V) {
|
||||
if (CHRptr[0]) {
|
||||
V &= CHRmask1[0]; MMC5BGVPage[(A) >> 10] = &CHRptr[0][(V) << 10] - (A);
|
||||
}
|
||||
}
|
||||
|
||||
static INLINE void MMC5SPRVROM_BANK2(uint32 A, uint32 V) {
|
||||
if (CHRptr[0]) {
|
||||
V &= CHRmask2[0]; MMC5SPRVPage[(A) >> 10] = MMC5SPRVPage[((A) >> 10) + 1] = &CHRptr[0][(V) << 11] - (A);
|
||||
}
|
||||
}
|
||||
static INLINE void MMC5BGVROM_BANK2(uint32 A, uint32 V) {
|
||||
if (CHRptr[0]) {
|
||||
V &= CHRmask2[0]; MMC5BGVPage[(A) >> 10] = MMC5BGVPage[((A) >> 10) + 1] = &CHRptr[0][(V) << 11] - (A);
|
||||
}
|
||||
}
|
||||
|
||||
static INLINE void MMC5SPRVROM_BANK4(uint32 A, uint32 V) {
|
||||
if (CHRptr[0]) {
|
||||
V &= CHRmask4[0]; MMC5SPRVPage[(A) >> 10] = MMC5SPRVPage[((A) >> 10) + 1] = MMC5SPRVPage[((A) >> 10) + 2] = MMC5SPRVPage[((A) >> 10) + 3] = &CHRptr[0][(V) << 12] - (A);
|
||||
}
|
||||
}
|
||||
static INLINE void MMC5BGVROM_BANK4(uint32 A, uint32 V) {
|
||||
if (CHRptr[0]) {
|
||||
V &= CHRmask4[0]; MMC5BGVPage[(A) >> 10] = MMC5BGVPage[((A) >> 10) + 1] = MMC5BGVPage[((A) >> 10) + 2] = MMC5BGVPage[((A) >> 10) + 3] = &CHRptr[0][(V) << 12] - (A);
|
||||
}
|
||||
}
|
||||
|
||||
static INLINE void MMC5SPRVROM_BANK8(uint32 V) {
|
||||
if (CHRptr[0]) {
|
||||
V &= CHRmask8[0]; MMC5SPRVPage[0] = MMC5SPRVPage[1] = MMC5SPRVPage[2] = MMC5SPRVPage[3] = MMC5SPRVPage[4] = MMC5SPRVPage[5] = MMC5SPRVPage[6] = MMC5SPRVPage[7] = &CHRptr[0][(V) << 13];
|
||||
}
|
||||
}
|
||||
static INLINE void MMC5BGVROM_BANK8(uint32 V) {
|
||||
if (CHRptr[0]) {
|
||||
V &= CHRmask8[0]; MMC5BGVPage[0] = MMC5BGVPage[1] = MMC5BGVPage[2] = MMC5BGVPage[3] = MMC5BGVPage[4] = MMC5BGVPage[5] = MMC5BGVPage[6] = MMC5BGVPage[7] = &CHRptr[0][(V) << 13];
|
||||
}
|
||||
}
|
||||
|
||||
static uint8 PRGBanks[4];
|
||||
static uint8 WRAMPage;
|
||||
static uint16 CHRBanksA[8], CHRBanksB[4];
|
||||
static uint8 WRAMMaskEnable[2];
|
||||
uint8 mmc5ABMode; /* A=0, B=1 */
|
||||
|
||||
static uint8 IRQScanline, IRQEnable;
|
||||
static uint8 CHRMode, NTAMirroring, NTFill, ATFill;
|
||||
|
||||
static uint8 MMC5IRQR;
|
||||
static uint8 MMC5LineCounter;
|
||||
static uint8 mmc5psize, mmc5vsize;
|
||||
static uint8 mul[2];
|
||||
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint8 *MMC5fill = NULL;
|
||||
static uint8 *ExRAM = NULL;
|
||||
|
||||
static uint8 MMC5WRAMsize; //configuration, not state
|
||||
static uint8 MMC5WRAMIndex[8]; //configuration, not state
|
||||
|
||||
static uint8 MMC5ROMWrProtect[4];
|
||||
static uint8 MMC5MemIn[5];
|
||||
|
||||
static void MMC5CHRA(void);
|
||||
static void MMC5CHRB(void);
|
||||
|
||||
typedef struct __cartdata {
|
||||
uint32 crc32;
|
||||
uint8 size;
|
||||
} cartdata;
|
||||
|
||||
#define Sprite16 (PPU[0]& 0x20) //Sprites 8x16/8x8
|
||||
//#define MMC5SPRVRAMADR(V) &MMC5SPRVPage[(V)>>10][(V)]
|
||||
static inline uint8 * MMC5BGVRAMADR(uint32 A) {
|
||||
if (!Sprite16) {
|
||||
if (mmc5ABMode == 0)
|
||||
return &MMC5SPRVPage[(A) >> 10][(A)];
|
||||
else
|
||||
return &MMC5BGVPage[(A) >> 10][(A)];
|
||||
} else return &MMC5BGVPage[(A) >> 10][(A)];
|
||||
}
|
||||
|
||||
static void mmc5_PPUWrite(uint32 A, uint8 V) {
|
||||
uint32 tmp = A;
|
||||
extern uint8 PALRAM[0x20];
|
||||
|
||||
if (tmp >= 0x3F00) {
|
||||
// hmmm....
|
||||
if (!(tmp & 0xf))
|
||||
PALRAM[0x00] = PALRAM[0x04] = PALRAM[0x08] = PALRAM[0x0C] = V & 0x3F;
|
||||
else if (tmp & 3) PALRAM[(tmp & 0x1f)] = V & 0x3f;
|
||||
} else if (tmp < 0x2000) {
|
||||
if (PPUCHRRAM & (1 << (tmp >> 10)))
|
||||
VPage[tmp >> 10][tmp] = V;
|
||||
} else {
|
||||
if (PPUNTARAM & (1 << ((tmp & 0xF00) >> 10)))
|
||||
vnapage[((tmp & 0xF00) >> 10)][tmp & 0x3FF] = V;
|
||||
}
|
||||
}
|
||||
|
||||
uint8 FASTCALL mmc5_PPURead(uint32 A) {
|
||||
if (A < 0x2000) {
|
||||
if (ppuphase == PPUPHASE_BG)
|
||||
return *MMC5BGVRAMADR(A);
|
||||
else return MMC5SPRVPage[(A) >> 10][(A)];
|
||||
} else {
|
||||
return vnapage[(A >> 10) & 0x3][A & 0x3FF];
|
||||
}
|
||||
}
|
||||
|
||||
cartdata MMC5CartList[] =
|
||||
{
|
||||
{ 0x6f4e4312, 4 }, /* Aoki Ookami to Shiroki Mejika - Genchou Hishi */
|
||||
{ 0x15fe6d0f, 2 }, /* Bandit Kings of Ancient China */
|
||||
{ 0x671f23a8, 0 }, /* Castlevania III - Dracula's Curse (E) */
|
||||
{ 0xcd4e7430, 0 }, /* Castlevania III - Dracula's Curse (KC) */
|
||||
{ 0xed2465be, 0 }, /* Castlevania III - Dracula's Curse (U) */
|
||||
{ 0xfe3488d1, 2 }, /* Daikoukai Jidai */
|
||||
{ 0x0ec6c023, 1 }, /* Gemfire */
|
||||
{ 0x0afb395e, 0 }, /* Gun Sight */
|
||||
{ 0x1ced086f, 2 }, /* Ishin no Arashi */
|
||||
{ 0x9cbadc25, 1 }, /* Just Breed */
|
||||
{ 0x6396b988, 2 }, /* L'Empereur (J) */
|
||||
{ 0x9c18762b, 2 }, /* L'Empereur (U) */
|
||||
{ 0xb0480ae9, 0 }, /* Laser Invasion */
|
||||
{ 0xb4735fac, 0 }, /* Metal Slader Glory */
|
||||
{ 0xf540677b, 4 }, /* Nobunaga no Yabou - Bushou Fuuun Roku */
|
||||
{ 0xeee9a682, 2 }, /* Nobunaga no Yabou - Sengoku Gunyuu Den (J) (PRG0) */
|
||||
{ 0xf9b4240f, 2 }, /* Nobunaga no Yabou - Sengoku Gunyuu Den (J) (PRG1) */
|
||||
{ 0x8ce478db, 2 }, /* Nobunaga's Ambition 2 */
|
||||
{ 0xf011e490, 4 }, /* Romance of The Three Kingdoms II */
|
||||
{ 0xbc80fb52, 1 }, /* Royal Blood */
|
||||
{ 0x184c2124, 4 }, /* Sangokushi II (J) (PRG0) */
|
||||
{ 0xee8e6553, 4 }, /* Sangokushi II (J) (PRG1) */
|
||||
{ 0xd532e98f, 1 }, /* Shin 4 Nin Uchi Mahjong - Yakuman Tengoku */
|
||||
{ 0x39f2ce4b, 2 }, /* Suikoden - Tenmei no Chikai */
|
||||
{ 0xbb7f829a, 0 }, /* Uchuu Keibitai SDF */
|
||||
{ 0xaca15643, 2 }, /* Uncharted Waters */
|
||||
};
|
||||
|
||||
#define MMC5_NOCARTS (sizeof(MMC5CartList) / sizeof(MMC5CartList[0]))
|
||||
int DetectMMC5WRAMSize(uint32 crc32) {
|
||||
int x;
|
||||
for (x = 0; x < MMC5_NOCARTS; x++) {
|
||||
if (crc32 == MMC5CartList[x].crc32) {
|
||||
if(MMC5CartList[x].size > 1)
|
||||
FCEU_printf(" >8KB external WRAM present. Use UNIF if you hack the ROM image.\n");
|
||||
return(MMC5CartList[x].size * 8);
|
||||
}
|
||||
}
|
||||
return 64;
|
||||
}
|
||||
|
||||
static void BuildWRAMSizeTable(void) {
|
||||
int x;
|
||||
for (x = 0; x < 8; x++) {
|
||||
switch (MMC5WRAMsize) {
|
||||
case 0: MMC5WRAMIndex[x] = 255; break; //X,X,X,X,X,X,X,X
|
||||
case 1: MMC5WRAMIndex[x] = (x > 3) ? 255 : 0; break; //0,0,0,0,X,X,X,X
|
||||
case 2: MMC5WRAMIndex[x] = (x & 4) >> 2; break; //0,0,0,0,1,1,1,1
|
||||
case 4: MMC5WRAMIndex[x] = (x > 3) ? 255 : (x & 3); break; //0,1,2,3,X,X,X,X
|
||||
case 8: MMC5WRAMIndex[x] = x; break; //0,1,2,3,4,5,6,7
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void MMC5CHRA(void) {
|
||||
int x;
|
||||
switch (mmc5vsize & 3) {
|
||||
case 0:
|
||||
setchr8(CHRBanksA[7]);
|
||||
MMC5SPRVROM_BANK8(CHRBanksA[7]);
|
||||
break;
|
||||
case 1:
|
||||
setchr4(0x0000, CHRBanksA[3]);
|
||||
setchr4(0x1000, CHRBanksA[7]);
|
||||
MMC5SPRVROM_BANK4(0x0000, CHRBanksA[3]);
|
||||
MMC5SPRVROM_BANK4(0x1000, CHRBanksA[7]);
|
||||
break;
|
||||
case 2:
|
||||
setchr2(0x0000, CHRBanksA[1]);
|
||||
setchr2(0x0800, CHRBanksA[3]);
|
||||
setchr2(0x1000, CHRBanksA[5]);
|
||||
setchr2(0x1800, CHRBanksA[7]);
|
||||
MMC5SPRVROM_BANK2(0x0000, CHRBanksA[1]);
|
||||
MMC5SPRVROM_BANK2(0x0800, CHRBanksA[3]);
|
||||
MMC5SPRVROM_BANK2(0x1000, CHRBanksA[5]);
|
||||
MMC5SPRVROM_BANK2(0x1800, CHRBanksA[7]);
|
||||
break;
|
||||
case 3:
|
||||
for (x = 0; x < 8; x++) {
|
||||
setchr1(x << 10, CHRBanksA[x]);
|
||||
MMC5SPRVROM_BANK1(x << 10, CHRBanksA[x]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void MMC5CHRB(void) {
|
||||
int x;
|
||||
switch (mmc5vsize & 3) {
|
||||
case 0:
|
||||
setchr8(CHRBanksB[3]);
|
||||
MMC5BGVROM_BANK8(CHRBanksB[3]);
|
||||
break;
|
||||
case 1:
|
||||
setchr4(0x0000, CHRBanksB[3]);
|
||||
setchr4(0x1000, CHRBanksB[3]);
|
||||
MMC5BGVROM_BANK4(0x0000, CHRBanksB[3]);
|
||||
MMC5BGVROM_BANK4(0x1000, CHRBanksB[3]);
|
||||
break;
|
||||
case 2:
|
||||
setchr2(0x0000, CHRBanksB[1]);
|
||||
setchr2(0x0800, CHRBanksB[3]);
|
||||
setchr2(0x1000, CHRBanksB[1]);
|
||||
setchr2(0x1800, CHRBanksB[3]);
|
||||
MMC5BGVROM_BANK2(0x0000, CHRBanksB[1]);
|
||||
MMC5BGVROM_BANK2(0x0800, CHRBanksB[3]);
|
||||
MMC5BGVROM_BANK2(0x1000, CHRBanksB[1]);
|
||||
MMC5BGVROM_BANK2(0x1800, CHRBanksB[3]);
|
||||
break;
|
||||
case 3:
|
||||
for (x = 0; x < 8; x++) {
|
||||
setchr1(x << 10, CHRBanksB[x & 3]);
|
||||
MMC5BGVROM_BANK1(x << 10, CHRBanksB[x & 3]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void MMC5WRAM(uint32 A, uint32 V) {
|
||||
V = MMC5WRAMIndex[V & 7];
|
||||
if (V != 255) {
|
||||
setprg8r(0x10, A, V);
|
||||
MMC5MemIn[(A - 0x6000) >> 13] = 1;
|
||||
} else
|
||||
MMC5MemIn[(A - 0x6000) >> 13] = 0;
|
||||
}
|
||||
|
||||
static void MMC5PRG(void) {
|
||||
int x;
|
||||
switch (mmc5psize & 3) {
|
||||
case 0:
|
||||
MMC5ROMWrProtect[0] = MMC5ROMWrProtect[1] = MMC5ROMWrProtect[2] = MMC5ROMWrProtect[3] = 1;
|
||||
setprg32(0x8000, ((PRGBanks[1] & 0x7F) >> 2));
|
||||
for (x = 0; x < 4; x++)
|
||||
MMC5MemIn[1 + x] = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (PRGBanks[1] & 0x80) {
|
||||
MMC5ROMWrProtect[0] = MMC5ROMWrProtect[1] = 1;
|
||||
setprg16(0x8000, (PRGBanks[1] >> 1));
|
||||
MMC5MemIn[1] = MMC5MemIn[2] = 1;
|
||||
} else {
|
||||
MMC5ROMWrProtect[0] = MMC5ROMWrProtect[1] = 0;
|
||||
MMC5WRAM(0x8000, PRGBanks[1] & 7 & 0xFE);
|
||||
MMC5WRAM(0xA000, (PRGBanks[1] & 7 & 0xFE) + 1);
|
||||
}
|
||||
MMC5MemIn[3] = MMC5MemIn[4] = 1;
|
||||
MMC5ROMWrProtect[2] = MMC5ROMWrProtect[3] = 1;
|
||||
setprg16(0xC000, (PRGBanks[3] & 0x7F) >> 1);
|
||||
break;
|
||||
case 2:
|
||||
if (PRGBanks[1] & 0x80) {
|
||||
MMC5MemIn[1] = MMC5MemIn[2] = 1;
|
||||
MMC5ROMWrProtect[0] = MMC5ROMWrProtect[1] = 1;
|
||||
setprg16(0x8000, (PRGBanks[1] & 0x7F) >> 1);
|
||||
} else {
|
||||
MMC5ROMWrProtect[0] = MMC5ROMWrProtect[1] = 0;
|
||||
MMC5WRAM(0x8000, PRGBanks[1] & 7 & 0xFE);
|
||||
MMC5WRAM(0xA000, (PRGBanks[1] & 7 & 0xFE) + 1);
|
||||
}
|
||||
if (PRGBanks[2] & 0x80) {
|
||||
MMC5ROMWrProtect[2] = 1;
|
||||
MMC5MemIn[3] = 1;
|
||||
setprg8(0xC000, PRGBanks[2] & 0x7F);
|
||||
} else {
|
||||
MMC5ROMWrProtect[2] = 0;
|
||||
MMC5WRAM(0xC000, PRGBanks[2] & 7);
|
||||
}
|
||||
MMC5MemIn[4] = 1;
|
||||
MMC5ROMWrProtect[3] = 1;
|
||||
setprg8(0xE000, PRGBanks[3] & 0x7F);
|
||||
break;
|
||||
case 3:
|
||||
for (x = 0; x < 3; x++)
|
||||
if (PRGBanks[x] & 0x80) {
|
||||
MMC5ROMWrProtect[x] = 1;
|
||||
setprg8(0x8000 + (x << 13), PRGBanks[x] & 0x7F);
|
||||
MMC5MemIn[1 + x] = 1;
|
||||
} else {
|
||||
MMC5ROMWrProtect[x] = 0;
|
||||
MMC5WRAM(0x8000 + (x << 13), PRGBanks[x] & 7);
|
||||
}
|
||||
MMC5MemIn[4] = 1;
|
||||
MMC5ROMWrProtect[3] = 1;
|
||||
setprg8(0xE000, PRGBanks[3] & 0x7F);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(Mapper5_write) {
|
||||
switch (A) {
|
||||
case 0x5100:
|
||||
mmc5psize = V;
|
||||
MMC5PRG();
|
||||
break;
|
||||
case 0x5101:
|
||||
mmc5vsize = V;
|
||||
if (!mmc5ABMode) {
|
||||
MMC5CHRB();
|
||||
MMC5CHRA();
|
||||
} else {
|
||||
MMC5CHRA();
|
||||
MMC5CHRB();
|
||||
}
|
||||
break;
|
||||
case 0x5102:
|
||||
WRAMMaskEnable[0] = V;
|
||||
break;
|
||||
case 0x5103:
|
||||
WRAMMaskEnable[1] = V;
|
||||
break;
|
||||
case 0x5104:
|
||||
CHRMode = V;
|
||||
MMC5HackCHRMode = V & 3;
|
||||
break;
|
||||
case 0x5105:
|
||||
{
|
||||
int x;
|
||||
for (x = 0; x < 4; x++) {
|
||||
switch ((V >> (x << 1)) & 3) {
|
||||
case 0: PPUNTARAM |= 1 << x; vnapage[x] = NTARAM; break;
|
||||
case 1: PPUNTARAM |= 1 << x; vnapage[x] = NTARAM + 0x400; break;
|
||||
case 2: PPUNTARAM |= 1 << x; vnapage[x] = ExRAM; break;
|
||||
case 3: PPUNTARAM &= ~(1 << x); vnapage[x] = MMC5fill; break;
|
||||
}
|
||||
}
|
||||
NTAMirroring = V;
|
||||
break;
|
||||
}
|
||||
case 0x5106:
|
||||
if (V != NTFill)
|
||||
FCEU_dwmemset(MMC5fill, (V | (V << 8) | (V << 16) | (V << 24)), 0x3c0);
|
||||
NTFill = V;
|
||||
break;
|
||||
case 0x5107:
|
||||
if (V != ATFill) {
|
||||
unsigned char moop = V | (V << 2) | (V << 4) | (V << 6);
|
||||
FCEU_dwmemset(MMC5fill + 0x3c0, moop | (moop << 8) | (moop << 16) | (moop << 24), 0x40);
|
||||
}
|
||||
ATFill = V;
|
||||
break;
|
||||
case 0x5113:
|
||||
WRAMPage = V;
|
||||
MMC5WRAM(0x6000, V & 7);
|
||||
break;
|
||||
case 0x5114:
|
||||
case 0x5115:
|
||||
case 0x5116:
|
||||
case 0x5117:
|
||||
PRGBanks[A & 3] = V;
|
||||
MMC5PRG();
|
||||
break;
|
||||
case 0x5120:
|
||||
case 0x5121:
|
||||
case 0x5122:
|
||||
case 0x5123:
|
||||
case 0x5124:
|
||||
case 0x5125:
|
||||
case 0x5126:
|
||||
case 0x5127:
|
||||
mmc5ABMode = 0;
|
||||
CHRBanksA[A & 7] = V | ((MMC50x5130 & 0x3) << 8);
|
||||
MMC5CHRA();
|
||||
break;
|
||||
case 0x5128:
|
||||
case 0x5129:
|
||||
case 0x512a:
|
||||
case 0x512b:
|
||||
mmc5ABMode = 1;
|
||||
CHRBanksB[A & 3] = V | ((MMC50x5130 & 0x3) << 8);
|
||||
MMC5CHRB();
|
||||
break;
|
||||
case 0x5130: MMC50x5130 = V; break;
|
||||
case 0x5200: MMC5HackSPMode = V; break;
|
||||
case 0x5201: MMC5HackSPScroll = (V >> 3) & 0x1F; break;
|
||||
case 0x5202: MMC5HackSPPage = V & 0x3F; break;
|
||||
case 0x5203: X6502_IRQEnd(FCEU_IQEXT); IRQScanline = V; break;
|
||||
case 0x5204: X6502_IRQEnd(FCEU_IQEXT); IRQEnable = V & 0x80; break;
|
||||
case 0x5205: mul[0] = V; break;
|
||||
case 0x5206: mul[1] = V; break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFR(MMC5_ReadROMRAM) {
|
||||
if (MMC5MemIn[(A - 0x6000) >> 13])
|
||||
return Page[A >> 11][A];
|
||||
else
|
||||
return X.DB;
|
||||
}
|
||||
|
||||
static DECLFW(MMC5_WriteROMRAM) {
|
||||
if ((A >= 0x8000) && (MMC5ROMWrProtect[(A - 0x8000) >> 13]))
|
||||
return;
|
||||
if (MMC5MemIn[(A - 0x6000) >> 13])
|
||||
if (((WRAMMaskEnable[0] & 3) | ((WRAMMaskEnable[1] & 3) << 2)) == 6)
|
||||
Page[A >> 11][A] = V;
|
||||
}
|
||||
|
||||
static DECLFW(MMC5_ExRAMWr) {
|
||||
if (MMC5HackCHRMode != 3)
|
||||
ExRAM[A & 0x3ff] = V;
|
||||
}
|
||||
|
||||
static DECLFR(MMC5_ExRAMRd) {
|
||||
return ExRAM[A & 0x3ff];
|
||||
}
|
||||
|
||||
static DECLFR(MMC5_read) {
|
||||
switch (A) {
|
||||
case 0x5204: {
|
||||
uint8 x;
|
||||
X6502_IRQEnd(FCEU_IQEXT);
|
||||
x = MMC5IRQR;
|
||||
#ifdef FCEUDEF_DEBUGGER
|
||||
if (!fceuindbg)
|
||||
#endif
|
||||
MMC5IRQR &= 0x40;
|
||||
return x;
|
||||
}
|
||||
case 0x5205:
|
||||
return(mul[0] * mul[1]);
|
||||
case 0x5206:
|
||||
return((mul[0] * mul[1]) >> 8);
|
||||
}
|
||||
return(X.DB);
|
||||
}
|
||||
|
||||
void MMC5Synco(void) {
|
||||
int x;
|
||||
|
||||
MMC5PRG();
|
||||
for (x = 0; x < 4; x++) {
|
||||
switch ((NTAMirroring >> (x << 1)) & 3) {
|
||||
case 0: PPUNTARAM |= 1 << x; vnapage[x] = NTARAM; break;
|
||||
case 1: PPUNTARAM |= 1 << x; vnapage[x] = NTARAM + 0x400; break;
|
||||
case 2: PPUNTARAM |= 1 << x; vnapage[x] = ExRAM; break;
|
||||
case 3: PPUNTARAM &= ~(1 << x); vnapage[x] = MMC5fill; break;
|
||||
}
|
||||
}
|
||||
MMC5WRAM(0x6000, WRAMPage & 7);
|
||||
if (!mmc5ABMode) {
|
||||
MMC5CHRB();
|
||||
MMC5CHRA();
|
||||
} else {
|
||||
MMC5CHRA();
|
||||
MMC5CHRB();
|
||||
}
|
||||
|
||||
//in case the fill register changed, we need to overwrite the fill buffer
|
||||
FCEU_dwmemset(MMC5fill, NTFill | (NTFill << 8) | (NTFill << 16) | (NTFill << 24), 0x3c0);
|
||||
{
|
||||
unsigned char moop = ATFill | (ATFill << 2) | (ATFill << 4) | (ATFill << 6);
|
||||
FCEU_dwmemset(MMC5fill + 0x3c0, moop | (moop << 8) | (moop << 16) | (moop << 24), 0x40);
|
||||
}
|
||||
|
||||
MMC5HackCHRMode = CHRMode & 3;
|
||||
|
||||
//zero 17-apr-2013 - why the heck should this happen here? anything in a `synco` should be depending on the state.
|
||||
//im going to leave it commented out to see what happens
|
||||
//X6502_IRQEnd(FCEU_IQEXT);
|
||||
}
|
||||
|
||||
void MMC5_hb(int scanline) {
|
||||
if (scanline == 240) {
|
||||
MMC5LineCounter = 0;
|
||||
MMC5IRQR = 0x40;
|
||||
return;
|
||||
}
|
||||
if (MMC5LineCounter < 240) {
|
||||
if (MMC5LineCounter == IRQScanline) {
|
||||
MMC5IRQR |= 0x80;
|
||||
if (IRQEnable & 0x80)
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
}
|
||||
MMC5LineCounter++;
|
||||
}
|
||||
if (MMC5LineCounter == 240)
|
||||
MMC5IRQR = 0;
|
||||
}
|
||||
|
||||
void MMC5_StateRestore(int version) {
|
||||
MMC5Synco();
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
uint16 wl[2];
|
||||
uint8 env[2];
|
||||
uint8 enable;
|
||||
uint8 running;
|
||||
uint8 raw;
|
||||
uint8 rawcontrol;
|
||||
int32 dcount[2];
|
||||
int32 BC[3];
|
||||
int32 vcount[2];
|
||||
} MMC5APU;
|
||||
|
||||
static MMC5APU MMC5Sound;
|
||||
|
||||
|
||||
static void Do5PCM() {
|
||||
int32 V;
|
||||
int32 start, end;
|
||||
|
||||
start = MMC5Sound.BC[2];
|
||||
end = (SOUNDTS << 16) / soundtsinc;
|
||||
if (end <= start) return;
|
||||
MMC5Sound.BC[2] = end;
|
||||
|
||||
if (!(MMC5Sound.rawcontrol & 0x40) && MMC5Sound.raw)
|
||||
for (V = start; V < end; V++)
|
||||
Wave[V >> 4] += MMC5Sound.raw << 1;
|
||||
}
|
||||
|
||||
static void Do5PCMHQ() {
|
||||
uint32 V;
|
||||
if (!(MMC5Sound.rawcontrol & 0x40) && MMC5Sound.raw)
|
||||
for (V = MMC5Sound.BC[2]; V < SOUNDTS; V++)
|
||||
WaveHi[V] += MMC5Sound.raw << 5;
|
||||
MMC5Sound.BC[2] = SOUNDTS;
|
||||
}
|
||||
|
||||
|
||||
static DECLFW(Mapper5_SW) {
|
||||
A &= 0x1F;
|
||||
|
||||
GameExpSound.Fill = MMC5RunSound;
|
||||
GameExpSound.HiFill = MMC5RunSoundHQ;
|
||||
|
||||
switch (A) {
|
||||
case 0x10: if (psfun) psfun(); MMC5Sound.rawcontrol = V; break;
|
||||
case 0x11: if (psfun) psfun(); MMC5Sound.raw = V; break;
|
||||
|
||||
case 0x0:
|
||||
case 0x4:
|
||||
if (sfun) sfun(A >> 2);
|
||||
MMC5Sound.env[A >> 2] = V;
|
||||
break;
|
||||
case 0x2:
|
||||
case 0x6:
|
||||
if (sfun) sfun(A >> 2);
|
||||
MMC5Sound.wl[A >> 2] &= ~0x00FF;
|
||||
MMC5Sound.wl[A >> 2] |= V & 0xFF;
|
||||
break;
|
||||
case 0x3:
|
||||
case 0x7:
|
||||
MMC5Sound.wl[A >> 2] &= ~0x0700;
|
||||
MMC5Sound.wl[A >> 2] |= (V & 0x07) << 8;
|
||||
MMC5Sound.running |= 1 << (A >> 2);
|
||||
break;
|
||||
case 0x15:
|
||||
if (sfun) {
|
||||
sfun(0);
|
||||
sfun(1);
|
||||
}
|
||||
MMC5Sound.running &= V;
|
||||
MMC5Sound.enable = V;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void Do5SQ(int P) {
|
||||
static int tal[4] = { 1, 2, 4, 6 };
|
||||
int32 V, amp, rthresh, wl;
|
||||
int32 start, end;
|
||||
|
||||
start = MMC5Sound.BC[P];
|
||||
end = (SOUNDTS << 16) / soundtsinc;
|
||||
if (end <= start) return;
|
||||
MMC5Sound.BC[P] = end;
|
||||
|
||||
wl = MMC5Sound.wl[P] + 1;
|
||||
amp = (MMC5Sound.env[P] & 0xF) << 4;
|
||||
rthresh = tal[(MMC5Sound.env[P] & 0xC0) >> 6];
|
||||
|
||||
if (wl >= 8 && (MMC5Sound.running & (P + 1))) {
|
||||
int dc, vc;
|
||||
|
||||
wl <<= 18;
|
||||
dc = MMC5Sound.dcount[P];
|
||||
vc = MMC5Sound.vcount[P];
|
||||
|
||||
for (V = start; V < end; V++) {
|
||||
if (dc < rthresh)
|
||||
Wave[V >> 4] += amp;
|
||||
vc -= nesincsize;
|
||||
while (vc <= 0) {
|
||||
vc += wl;
|
||||
dc = (dc + 1) & 7;
|
||||
}
|
||||
}
|
||||
MMC5Sound.dcount[P] = dc;
|
||||
MMC5Sound.vcount[P] = vc;
|
||||
}
|
||||
}
|
||||
|
||||
static void Do5SQHQ(int P) {
|
||||
static int tal[4] = { 1, 2, 4, 6 };
|
||||
uint32 V;
|
||||
int32 amp, rthresh, wl;
|
||||
|
||||
wl = MMC5Sound.wl[P] + 1;
|
||||
amp = ((MMC5Sound.env[P] & 0xF) << 8);
|
||||
rthresh = tal[(MMC5Sound.env[P] & 0xC0) >> 6];
|
||||
|
||||
if (wl >= 8 && (MMC5Sound.running & (P + 1))) {
|
||||
int dc, vc;
|
||||
|
||||
wl <<= 1;
|
||||
|
||||
dc = MMC5Sound.dcount[P];
|
||||
vc = MMC5Sound.vcount[P];
|
||||
for (V = MMC5Sound.BC[P]; V < SOUNDTS; V++) {
|
||||
if (dc < rthresh)
|
||||
WaveHi[V] += amp;
|
||||
vc--;
|
||||
if (vc <= 0) { /* Less than zero when first started. */
|
||||
vc = wl;
|
||||
dc = (dc + 1) & 7;
|
||||
}
|
||||
}
|
||||
MMC5Sound.dcount[P] = dc;
|
||||
MMC5Sound.vcount[P] = vc;
|
||||
}
|
||||
MMC5Sound.BC[P] = SOUNDTS;
|
||||
}
|
||||
|
||||
void MMC5RunSoundHQ(void) {
|
||||
Do5SQHQ(0);
|
||||
Do5SQHQ(1);
|
||||
Do5PCMHQ();
|
||||
}
|
||||
|
||||
void MMC5HiSync(int32 ts) {
|
||||
int x;
|
||||
for (x = 0; x < 3; x++)
|
||||
MMC5Sound.BC[x] = ts;
|
||||
}
|
||||
|
||||
void MMC5RunSound(int Count) {
|
||||
int x;
|
||||
Do5SQ(0);
|
||||
Do5SQ(1);
|
||||
Do5PCM();
|
||||
for (x = 0; x < 3; x++)
|
||||
MMC5Sound.BC[x] = Count;
|
||||
}
|
||||
|
||||
void Mapper5_ESI(void) {
|
||||
GameExpSound.RChange = Mapper5_ESI;
|
||||
if (FSettings.SndRate) {
|
||||
if (FSettings.soundq >= 1) {
|
||||
sfun = Do5SQHQ;
|
||||
psfun = Do5PCMHQ;
|
||||
} else {
|
||||
sfun = Do5SQ;
|
||||
psfun = Do5PCM;
|
||||
}
|
||||
} else {
|
||||
sfun = 0;
|
||||
psfun = 0;
|
||||
}
|
||||
memset(MMC5Sound.BC, 0, sizeof(MMC5Sound.BC));
|
||||
memset(MMC5Sound.vcount, 0, sizeof(MMC5Sound.vcount));
|
||||
GameExpSound.HiSync = MMC5HiSync;
|
||||
}
|
||||
|
||||
void NSFMMC5_Init(void) {
|
||||
memset(&MMC5Sound, 0, sizeof(MMC5Sound));
|
||||
mul[0] = mul[1] = 0;
|
||||
ExRAM = (uint8*)FCEU_gmalloc(1024);
|
||||
Mapper5_ESI();
|
||||
SetWriteHandler(0x5c00, 0x5fef, MMC5_ExRAMWr);
|
||||
SetReadHandler(0x5c00, 0x5fef, MMC5_ExRAMRd);
|
||||
MMC5HackCHRMode = 2;
|
||||
SetWriteHandler(0x5000, 0x5015, Mapper5_SW);
|
||||
SetWriteHandler(0x5205, 0x5206, Mapper5_write);
|
||||
SetReadHandler(0x5205, 0x5206, MMC5_read);
|
||||
}
|
||||
|
||||
void NSFMMC5_Close(void) {
|
||||
FCEU_gfree(ExRAM);
|
||||
ExRAM = 0;
|
||||
}
|
||||
|
||||
static void GenMMC5Reset(void) {
|
||||
int x;
|
||||
|
||||
for (x = 0; x < 4; x++) PRGBanks[x] = ~0;
|
||||
for (x = 0; x < 8; x++) CHRBanksA[x] = ~0;
|
||||
for (x = 0; x < 4; x++) CHRBanksB[x] = ~0;
|
||||
WRAMMaskEnable[0] = WRAMMaskEnable[1] = ~0;
|
||||
|
||||
mmc5psize = mmc5vsize = 3;
|
||||
CHRMode = 0;
|
||||
|
||||
NTAMirroring = NTFill = ATFill = 0xFF;
|
||||
|
||||
MMC5Synco();
|
||||
|
||||
SetWriteHandler(0x4020, 0x5bff, Mapper5_write);
|
||||
SetReadHandler(0x4020, 0x5bff, MMC5_read);
|
||||
|
||||
SetWriteHandler(0x5c00, 0x5fff, MMC5_ExRAMWr);
|
||||
SetReadHandler(0x5c00, 0x5fff, MMC5_ExRAMRd);
|
||||
|
||||
SetWriteHandler(0x6000, 0xFFFF, MMC5_WriteROMRAM);
|
||||
SetReadHandler(0x6000, 0xFFFF, MMC5_ReadROMRAM);
|
||||
|
||||
SetWriteHandler(0x5000, 0x5015, Mapper5_SW);
|
||||
SetWriteHandler(0x5205, 0x5206, Mapper5_write);
|
||||
SetReadHandler(0x5205, 0x5206, MMC5_read);
|
||||
|
||||
// GameHBIRQHook=MMC5_hb;
|
||||
FCEU_CheatAddRAM(8, 0x6000, WRAM);
|
||||
FCEU_CheatAddRAM(1, 0x5c00, ExRAM);
|
||||
}
|
||||
|
||||
static SFORMAT MMC5_StateRegs[] = {
|
||||
{ PRGBanks, 4, "PRGB" },
|
||||
{ CHRBanksA, 16, "CHRA" },
|
||||
{ CHRBanksB, 8, "CHRB" },
|
||||
{ &WRAMPage, 1, "WRMP" },
|
||||
{ WRAMMaskEnable, 2, "WRME" },
|
||||
{ &mmc5ABMode, 1, "ABMD" },
|
||||
{ &IRQScanline, 1, "IRQS" },
|
||||
{ &IRQEnable, 1, "IRQE" },
|
||||
{ &CHRMode, 1, "CHRM" },
|
||||
{ &NTAMirroring, 1, "NTAM" },
|
||||
{ &NTFill, 1, "NTFL" },
|
||||
{ &ATFill, 1, "ATFL" },
|
||||
|
||||
//zero 17-apr-2013 - added
|
||||
{ &MMC5IRQR, 1, "IRQR" },
|
||||
{ &MMC5LineCounter, 1, "LCTR" },
|
||||
{ &mmc5psize, 1, "PSIZ" },
|
||||
{ &mmc5vsize, 1, "VSIZ" },
|
||||
{ mul, 2, "MUL2" },
|
||||
{ MMC5ROMWrProtect, 4, "WRPR" },
|
||||
{ MMC5MemIn, 5, "MEMI" },
|
||||
|
||||
{ &MMC5Sound.wl[0], 2 | FCEUSTATE_RLSB, "SDW0" },
|
||||
{ &MMC5Sound.wl[1], 2 | FCEUSTATE_RLSB, "SDW1" },
|
||||
{ MMC5Sound.env, 2, "SDEV" },
|
||||
{ &MMC5Sound.enable, 1, "SDEN" },
|
||||
{ &MMC5Sound.running, 1, "SDRU" },
|
||||
{ &MMC5Sound.raw, 1, "SDRW" },
|
||||
{ &MMC5Sound.rawcontrol, 1, "SDRC" },
|
||||
|
||||
//zero 17-apr-2013 - added
|
||||
{ &MMC5Sound.dcount[0], 4 | FCEUSTATE_RLSB, "DCT0" },
|
||||
{ &MMC5Sound.dcount[1], 4 | FCEUSTATE_RLSB, "DCT1" },
|
||||
{ &MMC5Sound.BC[0], 4 | FCEUSTATE_RLSB, "BC00" },
|
||||
{ &MMC5Sound.BC[1], 4 | FCEUSTATE_RLSB, "BC01" },
|
||||
{ &MMC5Sound.BC[2], 4 | FCEUSTATE_RLSB, "BC02" },
|
||||
{ &MMC5Sound.vcount[0], 4 | FCEUSTATE_RLSB, "VCT0" },
|
||||
{ &MMC5Sound.vcount[1], 4 | FCEUSTATE_RLSB, "VCT1" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void GenMMC5_Init(CartInfo *info, int wsize, int battery) {
|
||||
if (wsize) {
|
||||
WRAM = (uint8*)FCEU_gmalloc(wsize * 1024);
|
||||
SetupCartPRGMapping(0x10, WRAM, wsize * 1024, 1);
|
||||
AddExState(WRAM, wsize * 1024, 0, "WRAM");
|
||||
}
|
||||
|
||||
MMC5fill = (uint8*)FCEU_gmalloc(1024);
|
||||
ExRAM = (uint8*)FCEU_gmalloc(1024);
|
||||
|
||||
AddExState(ExRAM, 1024, 0, "ERAM");
|
||||
AddExState(&MMC5HackSPMode, 1, 0, "SPLM");
|
||||
AddExState(&MMC5HackSPScroll, 1, 0, "SPLS");
|
||||
AddExState(&MMC5HackSPPage, 1, 0, "SPLP");
|
||||
AddExState(&MMC50x5130, 1, 0, "5130");
|
||||
AddExState(MMC5_StateRegs, ~0, 0, 0);
|
||||
|
||||
MMC5WRAMsize = wsize / 8;
|
||||
BuildWRAMSizeTable();
|
||||
GameStateRestore = MMC5_StateRestore;
|
||||
info->Power = GenMMC5Reset;
|
||||
|
||||
if (battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
if (wsize <= 16)
|
||||
info->SaveGameLen[0] = 8192;
|
||||
else
|
||||
info->SaveGameLen[0] = 32768;
|
||||
}
|
||||
|
||||
MMC5HackVROMMask = CHRmask4[0];
|
||||
MMC5HackExNTARAMPtr = ExRAM;
|
||||
MMC5Hack = 1;
|
||||
MMC5HackVROMPTR = CHRptr[0];
|
||||
MMC5HackCHRMode = 0;
|
||||
MMC5HackSPMode = MMC5HackSPScroll = MMC5HackSPPage = 0;
|
||||
Mapper5_ESI();
|
||||
|
||||
FFCEUX_PPURead = mmc5_PPURead;
|
||||
FFCEUX_PPUWrite = mmc5_PPUWrite;
|
||||
}
|
||||
|
||||
void Mapper5_Init(CartInfo *info) {
|
||||
GenMMC5_Init(info, DetectMMC5WRAMSize(info->CRC32), info->battery);
|
||||
}
|
||||
|
||||
// ELROM seems to have 0KB of WRAM
|
||||
// EKROM seems to have 8KB of WRAM, battery-backed
|
||||
// ETROM seems to have 16KB of WRAM, battery-backed
|
||||
// EWROM seems to have 32KB of WRAM, battery-backed
|
||||
|
||||
void ELROM_Init(CartInfo *info) {
|
||||
GenMMC5_Init(info, 0, 0);
|
||||
}
|
||||
|
||||
void EKROM_Init(CartInfo *info) {
|
||||
GenMMC5_Init(info, 8, info->battery);
|
||||
}
|
||||
|
||||
void ETROM_Init(CartInfo *info) {
|
||||
GenMMC5_Init(info, 16, info->battery);
|
||||
}
|
||||
|
||||
void EWROM_Init(CartInfo *info) {
|
||||
GenMMC5_Init(info, 32, info->battery);
|
||||
}
|
|
@ -1,292 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2007-2010 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* VR02/VT03 Console and OneBus System
|
||||
*
|
||||
* Street Dance (Dance pad) (Unl)
|
||||
* 101-in-1 Arcade Action II
|
||||
* DreamGEAR 75-in-1, etc.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
// General Purpose Registers
|
||||
static uint8 cpu410x[16], ppu201x[16], apu40xx[64];
|
||||
|
||||
// IRQ Registers
|
||||
static uint8 IRQCount, IRQa, IRQReload;
|
||||
#define IRQLatch cpu410x[0x1]
|
||||
|
||||
// MMC3 Registers
|
||||
static uint8 inv_hack = 0; // some OneBus Systems have swapped PRG reg commans in MMC3 inplementation,
|
||||
// trying to autodetect unusual behavior, due not to add a new mapper.
|
||||
#define mmc3cmd cpu410x[0x5]
|
||||
#define mirror cpu410x[0x6]
|
||||
|
||||
// APU Registers
|
||||
static uint8 pcm_enable = 0, pcm_irq = 0;
|
||||
static int16 pcm_addr, pcm_size, pcm_latch, pcm_clock = 0xF6;
|
||||
|
||||
static writefunc defapuwrite[64];
|
||||
static readfunc defapuread[64];
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ cpu410x, 16, "REGC" },
|
||||
{ ppu201x, 16, "REGS" },
|
||||
{ apu40xx, 64, "REGA" },
|
||||
{ &IRQReload, 1, "IRQR" },
|
||||
{ &IRQCount, 1, "IRQC" },
|
||||
{ &IRQa, 1, "IRQA" },
|
||||
{ &pcm_enable, 1, "PCME" },
|
||||
{ &pcm_irq, 1, "PCMI" },
|
||||
{ &pcm_addr, 2, "PCMA" },
|
||||
{ &pcm_size, 2, "PCMS" },
|
||||
{ &pcm_latch, 2, "PCML" },
|
||||
{ &pcm_clock, 2, "PCMC" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void PSync(void) {
|
||||
uint8 bankmode = cpu410x[0xb] & 7;
|
||||
uint8 mask = (bankmode == 0x7) ? (0xff) : (0x3f >> bankmode);
|
||||
uint32 block = ((cpu410x[0x0] & 0xf0) << 4) + (cpu410x[0xa] & (~mask));
|
||||
uint32 pswap = (mmc3cmd & 0x40) << 8;
|
||||
|
||||
// uint8 bank0 = (cpu410x[0xb] & 0x40)?(~1):(cpu410x[0x7]);
|
||||
// uint8 bank1 = cpu410x[0x8];
|
||||
// uint8 bank2 = (cpu410x[0xb] & 0x40)?(cpu410x[0x9]):(~1);
|
||||
// uint8 bank3 = ~0;
|
||||
uint8 bank0 = cpu410x[0x7 ^ inv_hack];
|
||||
uint8 bank1 = cpu410x[0x8 ^ inv_hack];
|
||||
uint8 bank2 = (cpu410x[0xb] & 0x40) ? (cpu410x[0x9]) : (~1);
|
||||
uint8 bank3 = ~0;
|
||||
|
||||
// FCEU_printf(" PRG: %04x [%02x]",0x8000^pswap,block | (bank0 & mask));
|
||||
setprg8(0x8000 ^ pswap, block | (bank0 & mask));
|
||||
// FCEU_printf(" %04x [%02x]",0xa000^pswap,block | (bank1 & mask));
|
||||
setprg8(0xa000, block | (bank1 & mask));
|
||||
// FCEU_printf(" %04x [%02x]",0xc000^pswap,block | (bank2 & mask));
|
||||
setprg8(0xc000 ^ pswap, block | (bank2 & mask));
|
||||
// FCEU_printf(" %04x [%02x]\n",0xe000^pswap,block | (bank3 & mask));
|
||||
setprg8(0xe000, block | (bank3 & mask));
|
||||
}
|
||||
|
||||
static void CSync(void) {
|
||||
static const uint8 midx[8] = { 0, 1, 2, 0, 3, 4, 5, 0 };
|
||||
uint8 mask = 0xff >> midx[ppu201x[0xa] & 7];
|
||||
uint32 block = ((cpu410x[0x0] & 0x0f) << 11) + ((ppu201x[0x8] & 0x70) << 4) + (ppu201x[0xa] & (~mask));
|
||||
uint32 cswap = (mmc3cmd & 0x80) << 5;
|
||||
|
||||
uint8 bank0 = ppu201x[0x6] & (~1);
|
||||
uint8 bank1 = ppu201x[0x6] | 1;
|
||||
uint8 bank2 = ppu201x[0x7] & (~1);
|
||||
uint8 bank3 = ppu201x[0x7] | 1;
|
||||
uint8 bank4 = ppu201x[0x2];
|
||||
uint8 bank5 = ppu201x[0x3];
|
||||
uint8 bank6 = ppu201x[0x4];
|
||||
uint8 bank7 = ppu201x[0x5];
|
||||
|
||||
setchr1(0x0000 ^ cswap, block | (bank0 & mask));
|
||||
setchr1(0x0400 ^ cswap, block | (bank1 & mask));
|
||||
setchr1(0x0800 ^ cswap, block | (bank2 & mask));
|
||||
setchr1(0x0c00 ^ cswap, block | (bank3 & mask));
|
||||
setchr1(0x1000 ^ cswap, block | (bank4 & mask));
|
||||
setchr1(0x1400 ^ cswap, block | (bank5 & mask));
|
||||
setchr1(0x1800 ^ cswap, block | (bank6 & mask));
|
||||
setchr1(0x1c00 ^ cswap, block | (bank7 & mask));
|
||||
|
||||
setmirror((mirror & 1) ^ 1);
|
||||
}
|
||||
|
||||
static void Sync(void) {
|
||||
PSync();
|
||||
CSync();
|
||||
}
|
||||
|
||||
static DECLFW(UNLOneBusWriteCPU410X) {
|
||||
// FCEU_printf("CPU %04x:%04x\n",A,V);
|
||||
switch (A & 0xf) {
|
||||
case 0x1: IRQLatch = V & 0xfe; break;
|
||||
case 0x2: IRQReload = 1; break;
|
||||
case 0x3: X6502_IRQEnd(FCEU_IQEXT); IRQa = 0; break;
|
||||
case 0x4: IRQa = 1; break;
|
||||
default:
|
||||
cpu410x[A & 0xf] = V;
|
||||
Sync();
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(UNLOneBusWritePPU201X) {
|
||||
// FCEU_printf("PPU %04x:%04x\n",A,V);
|
||||
ppu201x[A & 0x0f] = V;
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFW(UNLOneBusWriteMMC3) {
|
||||
// FCEU_printf("MMC %04x:%04x\n",A,V);
|
||||
switch (A & 0xe001) {
|
||||
case 0x8000: mmc3cmd = (mmc3cmd & 0x38) | (V & 0xc7); Sync(); break;
|
||||
case 0x8001:
|
||||
{
|
||||
switch (mmc3cmd & 7) {
|
||||
case 0: ppu201x[0x6] = V; CSync(); break;
|
||||
case 1: ppu201x[0x7] = V; CSync(); break;
|
||||
case 2: ppu201x[0x2] = V; CSync(); break;
|
||||
case 3: ppu201x[0x3] = V; CSync(); break;
|
||||
case 4: ppu201x[0x4] = V; CSync(); break;
|
||||
case 5: ppu201x[0x5] = V; CSync(); break;
|
||||
case 6: cpu410x[0x7] = V; PSync(); break;
|
||||
case 7: cpu410x[0x8] = V; PSync(); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0xa000: mirror = V; CSync(); break;
|
||||
case 0xc000: IRQLatch = V & 0xfe; break;
|
||||
case 0xc001: IRQReload = 1; break;
|
||||
case 0xe000: X6502_IRQEnd(FCEU_IQEXT); IRQa = 0; break;
|
||||
case 0xe001: IRQa = 1; break;
|
||||
}
|
||||
}
|
||||
|
||||
static void UNLOneBusIRQHook(void) {
|
||||
uint32 count = IRQCount;
|
||||
if (!count || IRQReload) {
|
||||
IRQCount = IRQLatch;
|
||||
IRQReload = 0;
|
||||
} else
|
||||
IRQCount--;
|
||||
if (count && !IRQCount) {
|
||||
if (IRQa)
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(UNLOneBusWriteAPU40XX) {
|
||||
// FCEU_printf("APU %04x:%04x\n",A,V);
|
||||
apu40xx[A & 0x3f] = V;
|
||||
switch (A & 0x3f) {
|
||||
case 0x12:
|
||||
if (apu40xx[0x30] & 0x10) {
|
||||
pcm_addr = V << 6;
|
||||
}
|
||||
case 0x13:
|
||||
if (apu40xx[0x30] & 0x10) {
|
||||
pcm_size = (V << 4) + 1;
|
||||
}
|
||||
case 0x15:
|
||||
if (apu40xx[0x30] & 0x10) {
|
||||
pcm_enable = V & 0x10;
|
||||
if (pcm_irq) {
|
||||
X6502_IRQEnd(FCEU_IQEXT);
|
||||
pcm_irq = 0;
|
||||
}
|
||||
if (pcm_enable)
|
||||
pcm_latch = pcm_clock;
|
||||
V &= 0xef;
|
||||
}
|
||||
}
|
||||
defapuwrite[A & 0x3f](A, V);
|
||||
}
|
||||
|
||||
static DECLFR(UNLOneBusReadAPU40XX) {
|
||||
uint8 result = defapuread[A & 0x3f](A);
|
||||
// FCEU_printf("read %04x, %02x\n",A,result);
|
||||
switch (A & 0x3f) {
|
||||
case 0x15:
|
||||
if (apu40xx[0x30] & 0x10) {
|
||||
result = (result & 0x7f) | pcm_irq;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static void UNLOneBusCpuHook(int a) {
|
||||
if (pcm_enable) {
|
||||
pcm_latch -= a;
|
||||
if (pcm_latch <= 0) {
|
||||
pcm_latch += pcm_clock;
|
||||
pcm_size--;
|
||||
if (pcm_size < 0) {
|
||||
pcm_irq = 0x80;
|
||||
pcm_enable = 0;
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
} else {
|
||||
uint8 raw_pcm = ARead[pcm_addr](pcm_addr) >> 1;
|
||||
defapuwrite[0x11](0x4011, raw_pcm);
|
||||
pcm_addr++;
|
||||
pcm_addr &= 0x7FFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void UNLOneBusPower(void) {
|
||||
uint32 i;
|
||||
IRQReload = IRQCount = IRQa = 0;
|
||||
|
||||
memset(cpu410x, 0x00, sizeof(cpu410x));
|
||||
memset(ppu201x, 0x00, sizeof(ppu201x));
|
||||
memset(apu40xx, 0x00, sizeof(apu40xx));
|
||||
|
||||
SetupCartCHRMapping(0, PRGptr[0], PRGsize[0], 0);
|
||||
|
||||
for (i = 0; i < 64; i++) {
|
||||
defapuread[i] = GetReadHandler(0x4000 | i);
|
||||
defapuwrite[i] = GetWriteHandler(0x4000 | i);
|
||||
}
|
||||
SetReadHandler(0x4000, 0x403f, UNLOneBusReadAPU40XX);
|
||||
SetWriteHandler(0x4000, 0x403f, UNLOneBusWriteAPU40XX);
|
||||
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x2010, 0x201f, UNLOneBusWritePPU201X);
|
||||
SetWriteHandler(0x4100, 0x410f, UNLOneBusWriteCPU410X);
|
||||
SetWriteHandler(0x8000, 0xffff, UNLOneBusWriteMMC3);
|
||||
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void UNLOneBusReset(void) {
|
||||
IRQReload = IRQCount = IRQa = 0;
|
||||
|
||||
memset(cpu410x, 0x00, sizeof(cpu410x));
|
||||
memset(ppu201x, 0x00, sizeof(ppu201x));
|
||||
memset(apu40xx, 0x00, sizeof(apu40xx));
|
||||
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void UNLOneBus_Init(CartInfo *info) {
|
||||
info->Power = UNLOneBusPower;
|
||||
info->Reset = UNLOneBusReset;
|
||||
|
||||
if (((*(uint32*)&(info->MD5)) == 0x305fcdc3) || // PowerJoy Supermax Carts
|
||||
((*(uint32*)&(info->MD5)) == 0x6abfce8e))
|
||||
inv_hack = 0xf;
|
||||
|
||||
GameHBIRQHook = UNLOneBusIRQHook;
|
||||
MapIRQHook = UNLOneBusCpuHook;
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,127 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2009 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg[8];
|
||||
static uint32 lastnt = 0;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ reg, 2, "REG" },
|
||||
{ &lastnt, 4, "LNT" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static uint8 bs_tbl[128] = {
|
||||
0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, // 00
|
||||
0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, // 10
|
||||
0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, // 20
|
||||
0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, // 30
|
||||
0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, // 40
|
||||
0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, // 50
|
||||
0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x00, 0x10, 0x20, 0x30, // 60
|
||||
0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, // 70
|
||||
};
|
||||
|
||||
static uint8 br_tbl[16] = {
|
||||
0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setchr8(0);
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
if(PRGsize[0] == 512 * 1024) {
|
||||
if(reg[0] & 0x010) {
|
||||
setprg32(0x8000, reg[0] & 7);
|
||||
} else {
|
||||
if(reg[0] & 0x40)
|
||||
setprg8(0x8000, (reg[0] & 0x0F) | 0x20 | ((reg[0] & 0x20) >> 1));
|
||||
}
|
||||
if((reg[0] & 0x18) == 0x18)
|
||||
setmirror(MI_H);
|
||||
else
|
||||
setmirror(MI_V);
|
||||
} else {
|
||||
setprg16(0x8000, bs_tbl[reg[0] & 0x7f] >> 4);
|
||||
setprg16(0xc000, bs_tbl[reg[0] & 0x7f] & 0xf);
|
||||
setmirror(MI_V);
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(UNLPEC586Write) {
|
||||
reg[(A & 0x700) >> 8] = V;
|
||||
PEC586Hack = (reg[0] & 0x80) >> 7;
|
||||
// FCEU_printf("bs %04x %02x\n", A, V);
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFR(UNLPEC586Read) {
|
||||
// FCEU_printf("read %04x\n", A);
|
||||
return (X.DB & 0xD8) | br_tbl[reg[4] >> 4];
|
||||
}
|
||||
|
||||
static DECLFR(UNLPEC586ReadHi) {
|
||||
if((reg[0] & 0x10) || ((reg[0] & 0x40) && (A < 0xA000)))
|
||||
return CartBR(A);
|
||||
else
|
||||
return PRGptr[0][((0x0107 | ((A >> 7) & 0x0F8)) << 10) | (A & 0x3FF)];
|
||||
}
|
||||
|
||||
static void UNLPEC586Power(void) {
|
||||
if(PRGsize[0] == 512 * 1024)
|
||||
reg[0] = 0x00;
|
||||
else
|
||||
reg[0] = 0x0E;
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
if(PRGsize[0] == 512 * 1024)
|
||||
SetReadHandler(0x8000, 0xFFFF, UNLPEC586ReadHi);
|
||||
else
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x5000, 0x5fff, UNLPEC586Write);
|
||||
SetReadHandler(0x5000, 0x5fff, UNLPEC586Read);
|
||||
}
|
||||
|
||||
static void UNLPEC586Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void UNLPEC586Init(CartInfo *info) {
|
||||
info->Power = UNLPEC586Power;
|
||||
info->Close = UNLPEC586Close;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,114 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2009 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Wario Land II (Kirby hack)
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 reg[8], chr[8];
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
static uint16 IRQCount, IRQa;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ reg, 8, "REGS" },
|
||||
{ chr, 8, "CHRS" },
|
||||
{ &IRQCount, 16, "IRQc" },
|
||||
{ &IRQa, 16, "IRQa" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
int i;
|
||||
setprg8(0x8000, reg[0]);
|
||||
setprg8(0xA000, reg[1]);
|
||||
setprg8(0xC000, reg[2]);
|
||||
for (i = 0; i < 8; i++)
|
||||
setchr1(i << 10, chr[i]);
|
||||
setmirror(reg[3] ^ 1);
|
||||
}
|
||||
|
||||
static DECLFW(UNLSC127Write) {
|
||||
switch (A) {
|
||||
case 0x8000: reg[0] = V; break;
|
||||
case 0x8001: reg[1] = V; break;
|
||||
case 0x8002: reg[2] = V; break;
|
||||
case 0x9000: chr[0] = V; break;
|
||||
case 0x9001: chr[1] = V; break;
|
||||
case 0x9002: chr[2] = V; break;
|
||||
case 0x9003: chr[3] = V; break;
|
||||
case 0x9004: chr[4] = V; break;
|
||||
case 0x9005: chr[5] = V; break;
|
||||
case 0x9006: chr[6] = V; break;
|
||||
case 0x9007: chr[7] = V; break;
|
||||
case 0xC002: IRQa = 0; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
case 0xC005: IRQCount = V; break;
|
||||
case 0xC003: IRQa = 1; break;
|
||||
case 0xD001: reg[3] = V; break;
|
||||
}
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void UNLSC127Power(void) {
|
||||
Sync();
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg8(0xE000, ~0);
|
||||
SetReadHandler(0x6000, 0x7fff, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7fff, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, UNLSC127Write);
|
||||
}
|
||||
|
||||
static void UNLSC127IRQ(void) {
|
||||
if (IRQa) {
|
||||
IRQCount--;
|
||||
if (IRQCount == 0) {
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
IRQa = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void UNLSC127Reset(void) {
|
||||
}
|
||||
|
||||
static void UNLSC127Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void UNLSC127_Init(CartInfo *info) {
|
||||
info->Reset = UNLSC127Reset;
|
||||
info->Power = UNLSC127Power;
|
||||
info->Close = UNLSC127Close;
|
||||
GameHBIRQHook = UNLSC127IRQ;
|
||||
GameStateRestore = StateRestore;
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2009 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
unsigned int *GetKeyboard(void); // FIXME: 10/28 - now implemented in SDL as well. should we rename this to a FCEUI_* function?
|
||||
|
||||
static unsigned int *TransformerKeys, oldkeys[256];
|
||||
static int TransformerCycleCount, TransformerChar = 0;
|
||||
|
||||
static void TransformerIRQHook(int a) {
|
||||
TransformerCycleCount += a;
|
||||
if (TransformerCycleCount >= 1000) {
|
||||
uint32 i;
|
||||
TransformerCycleCount -= 1000;
|
||||
TransformerKeys = GetKeyboard();
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
if (oldkeys[i] != TransformerKeys[i]) {
|
||||
if (oldkeys[i] == 0)
|
||||
TransformerChar = i;
|
||||
else
|
||||
TransformerChar = i | 0x80;
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
memcpy((void*)&oldkeys[0], (void*)TransformerKeys, sizeof(oldkeys));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFR(TransformerRead) {
|
||||
uint8 ret = 0;
|
||||
switch (A & 3) {
|
||||
case 0: ret = TransformerChar & 15; break;
|
||||
case 1: ret = (TransformerChar >> 4); break;
|
||||
case 2: break;
|
||||
case 4: break;
|
||||
}
|
||||
X6502_IRQEnd(FCEU_IQEXT);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void TransformerPower(void) {
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg16(0x8000, 0);
|
||||
setprg16(0xC000, ~0);
|
||||
setchr8(0);
|
||||
|
||||
SetReadHandler(0x5000, 0x5004, TransformerRead);
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
|
||||
MapIRQHook = TransformerIRQHook;
|
||||
}
|
||||
|
||||
static void TransformerClose(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
void Transformer_Init(CartInfo *info) {
|
||||
info->Power = TransformerPower;
|
||||
info->Close = TransformerClose;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
}
|
|
@ -1,267 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2007 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 isPirate, is22;
|
||||
static uint16 IRQCount;
|
||||
static uint8 IRQLatch, IRQa;
|
||||
static uint8 prgreg[2], chrreg[8];
|
||||
static uint16 chrhi[8];
|
||||
static uint8 regcmd, irqcmd, mirr, big_bank;
|
||||
static uint16 acount = 0;
|
||||
static uint16 weirdo = 0;
|
||||
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ prgreg, 2, "PREG" },
|
||||
{ chrreg, 8, "CREG" },
|
||||
{ chrhi, 16, "CRGH" },
|
||||
{ ®cmd, 1, "CMDR" },
|
||||
{ &irqcmd, 1, "CMDI" },
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ &big_bank, 1, "BIGB" },
|
||||
{ &IRQCount, 2, "IRQC" },
|
||||
{ &IRQLatch, 1, "IRQL" },
|
||||
{ &IRQa, 1, "IRQA" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
if (regcmd & 2) {
|
||||
setprg8(0xC000, prgreg[0] | big_bank);
|
||||
setprg8(0x8000, ((~1) & 0x1F) | big_bank);
|
||||
} else {
|
||||
setprg8(0x8000, prgreg[0] | big_bank);
|
||||
setprg8(0xC000, ((~1) & 0x1F) | big_bank);
|
||||
}
|
||||
setprg8(0xA000, prgreg[1] | big_bank);
|
||||
setprg8(0xE000, ((~0) & 0x1F) | big_bank);
|
||||
if (UNIFchrrama)
|
||||
setchr8(0);
|
||||
else{
|
||||
uint8 i;
|
||||
if(!weirdo)
|
||||
for (i = 0; i < 8; i++)
|
||||
setchr1(i << 10, (chrhi[i] | chrreg[i]) >> is22);
|
||||
else {
|
||||
setchr1(0x0000, 0xFC);
|
||||
setchr1(0x0400, 0xFD);
|
||||
setchr1(0x0800, 0xFF);
|
||||
weirdo--;
|
||||
}
|
||||
}
|
||||
switch (mirr & 0x3) {
|
||||
case 0: setmirror(MI_V); break;
|
||||
case 1: setmirror(MI_H); break;
|
||||
case 2: setmirror(MI_0); break;
|
||||
case 3: setmirror(MI_1); break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(VRC24Write) {
|
||||
A &= 0xF003;
|
||||
if ((A >= 0xB000) && (A <= 0xE003)) {
|
||||
if (UNIFchrrama)
|
||||
big_bank = (V & 8) << 2; // my personally many-in-one feature ;) just for support pirate cart 2-in-1
|
||||
else{
|
||||
uint16 i = ((A >> 1) & 1) | ((A - 0xB000) >> 11);
|
||||
uint16 nibble = ((A & 1) << 2);
|
||||
chrreg[i] = (chrreg[i] & (0xF0 >> nibble)) | ((V & 0xF) << nibble);
|
||||
if(nibble)
|
||||
chrhi[i] = (V & 0x10) << 4; // another one many in one feature from pirate carts
|
||||
}
|
||||
Sync();
|
||||
} else
|
||||
switch (A & 0xF003) {
|
||||
case 0x8000:
|
||||
case 0x8001:
|
||||
case 0x8002:
|
||||
case 0x8003:
|
||||
if (!isPirate) {
|
||||
prgreg[0] = V & 0x1F;
|
||||
Sync();
|
||||
}
|
||||
break;
|
||||
case 0xA000:
|
||||
case 0xA001:
|
||||
case 0xA002:
|
||||
case 0xA003:
|
||||
if (!isPirate)
|
||||
prgreg[1] = V & 0x1F;
|
||||
else{
|
||||
prgreg[0] = (V & 0x1F) << 1;
|
||||
prgreg[1] = ((V & 0x1F) << 1) | 1;
|
||||
}
|
||||
Sync();
|
||||
break;
|
||||
case 0x9000:
|
||||
case 0x9001: if (V != 0xFF) mirr = V; Sync(); break;
|
||||
case 0x9002:
|
||||
case 0x9003: regcmd = V; Sync(); break;
|
||||
case 0xF000: X6502_IRQEnd(FCEU_IQEXT); IRQLatch &= 0xF0; IRQLatch |= V & 0xF; break;
|
||||
case 0xF001: X6502_IRQEnd(FCEU_IQEXT); IRQLatch &= 0x0F; IRQLatch |= V << 4; break;
|
||||
case 0xF002: X6502_IRQEnd(FCEU_IQEXT); acount = 0; IRQCount = IRQLatch; IRQa = V & 2; irqcmd = V & 1; break;
|
||||
case 0xF003: X6502_IRQEnd(FCEU_IQEXT); IRQa = irqcmd; break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(M21Write) {
|
||||
A = (A & 0xF000) | ((A >> 1) & 0x3); // Ganbare Goemon Gaiden 2 - Tenka no Zaihou (J) [!] isn't mapper 21 actually,
|
||||
// it's mapper 23 by wirings
|
||||
VRC24Write(A, V);
|
||||
}
|
||||
|
||||
static DECLFW(M22Write) {
|
||||
if (A == 0xC007) { // Ganbare Goemon Gaiden does strange things!!! at the end credits
|
||||
weirdo = 8; // quick dirty hack, seems there is no other games with such PCB, so
|
||||
// we never know if it will not work for something else lol
|
||||
}
|
||||
A |= ((A >> 2) & 0x3); // It's just swapped lines from 21 mapper
|
||||
//
|
||||
VRC24Write((A & 0xF000) | ((A >> 1) & 1) | ((A << 1) & 2), V);
|
||||
}
|
||||
|
||||
static DECLFW(M23Write) {
|
||||
A |= ((A >> 2) & 0x3) | ((A >> 4) & 0x3) | ((A >> 6) & 0x3);// actually there is many-in-one mapper source, some pirate or
|
||||
// licensed games use various address bits for registers
|
||||
VRC24Write(A, V);
|
||||
}
|
||||
|
||||
static void M21Power(void) {
|
||||
Sync();
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M21Write);
|
||||
}
|
||||
|
||||
static void M22Power(void) {
|
||||
Sync();
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M22Write);
|
||||
}
|
||||
|
||||
static void M23Power(void) {
|
||||
big_bank = 0x20;
|
||||
Sync();
|
||||
setprg8r(0x10, 0x6000, 0); // Only two Goemon games are have battery backed RAM, three more shooters
|
||||
// (Parodius Da!, Gradius 2 and Crisis Force uses 2k or SRAM at 6000-67FF only
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M23Write);
|
||||
}
|
||||
|
||||
static void M25Power(void) {
|
||||
big_bank = 0x20;
|
||||
Sync();
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
SetReadHandler(0x6000, 0x7FFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetReadHandler(0x8000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M22Write);
|
||||
}
|
||||
|
||||
void VRC24IRQHook(int a) {
|
||||
#define LCYCS 341
|
||||
if (IRQa) {
|
||||
acount += a * 3;
|
||||
if (acount >= LCYCS) {
|
||||
while (acount >= LCYCS) {
|
||||
acount -= LCYCS;
|
||||
IRQCount++;
|
||||
if (IRQCount & 0x100) {
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
IRQCount = IRQLatch;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void VRC24Close(void) {
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
void Mapper21_Init(CartInfo *info) {
|
||||
isPirate = 0;
|
||||
is22 = 0;
|
||||
info->Power = M21Power;
|
||||
MapIRQHook = VRC24IRQHook;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void Mapper22_Init(CartInfo *info) {
|
||||
isPirate = 0;
|
||||
is22 = 1;
|
||||
info->Power = M22Power;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void VRC24_Init(CartInfo *info) {
|
||||
info->Close = VRC24Close;
|
||||
MapIRQHook = VRC24IRQHook;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
if(info->battery) {
|
||||
info->SaveGame[0]=WRAM;
|
||||
info->SaveGameLen[0]=WRAMSIZE;
|
||||
}
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void Mapper23_Init(CartInfo *info) {
|
||||
isPirate = 0;
|
||||
is22 = 0;
|
||||
info->Power = M23Power;
|
||||
VRC24_Init(info);
|
||||
}
|
||||
|
||||
void Mapper25_Init(CartInfo *info) {
|
||||
isPirate = 0;
|
||||
is22 = 0;
|
||||
info->Power = M25Power;
|
||||
VRC24_Init(info);
|
||||
}
|
||||
|
||||
void UNLT230_Init(CartInfo *info) {
|
||||
isPirate = 1;
|
||||
is22 = 0;
|
||||
info->Power = M23Power;
|
||||
VRC24_Init(info);
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2012 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* VRC-3
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 preg;
|
||||
static uint8 IRQx; //autoenable
|
||||
static uint8 IRQm; //mode
|
||||
static uint8 IRQa;
|
||||
static uint16 IRQReload, IRQCount;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &preg, 1, "PREG" },
|
||||
{ &IRQa, 1, "IRQA" },
|
||||
{ &IRQx, 1, "IRQX" },
|
||||
{ &IRQm, 1, "IRQM" },
|
||||
{ &IRQReload, 2, "IRQR" },
|
||||
{ &IRQCount, 2, "IRQC" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg16(0x8000, preg);
|
||||
setprg16(0xC000, ~0);
|
||||
setchr8(0);
|
||||
}
|
||||
|
||||
static DECLFW(M73Write) {
|
||||
switch (A & 0xF000) {
|
||||
case 0x8000: IRQReload &= 0xFFF0; IRQReload |= (V & 0xF) << 0; break;
|
||||
case 0x9000: IRQReload &= 0xFF0F; IRQReload |= (V & 0xF) << 4; break;
|
||||
case 0xA000: IRQReload &= 0xF0FF; IRQReload |= (V & 0xF) << 8; break;
|
||||
case 0xB000: IRQReload &= 0x0FFF; IRQReload |= (V & 0xF) << 12; break;
|
||||
case 0xC000:
|
||||
IRQm = V & 4;
|
||||
IRQx = V & 1;
|
||||
IRQa = V & 2;
|
||||
if (IRQa) {
|
||||
if (IRQm) {
|
||||
IRQCount &= 0xFFFF;
|
||||
IRQCount |= (IRQReload & 0xFF);
|
||||
} else
|
||||
IRQCount = IRQReload;
|
||||
}
|
||||
X6502_IRQEnd(FCEU_IQEXT);
|
||||
break;
|
||||
case 0xD000: X6502_IRQEnd(FCEU_IQEXT); IRQa = IRQx; break;
|
||||
case 0xF000: preg = V; Sync(); break;
|
||||
}
|
||||
}
|
||||
|
||||
static void M73IRQHook(int a) {
|
||||
int32 i;
|
||||
if (!IRQa) return;
|
||||
for (i = 0; i < a; i++) {
|
||||
if (IRQm) {
|
||||
uint16 temp = IRQCount;
|
||||
temp &= 0xFF;
|
||||
IRQCount &= 0xFF00;
|
||||
if (temp == 0xFF) {
|
||||
IRQCount = IRQReload;
|
||||
IRQCount |= (uint16)(IRQReload & 0xFF);
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
} else {
|
||||
temp++;
|
||||
IRQCount |= temp;
|
||||
}
|
||||
} else {
|
||||
//16 bit mode
|
||||
if (IRQCount == 0xFFFF) {
|
||||
IRQCount = IRQReload;
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
} else
|
||||
IRQCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void M73Power(void) {
|
||||
IRQReload = IRQm = IRQx = 0;
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M73Write);
|
||||
}
|
||||
|
||||
static void M73Close(void)
|
||||
{
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper73_Init(CartInfo *info) {
|
||||
info->Power = M73Power;
|
||||
info->Close = M73Close;
|
||||
MapIRQHook = M73IRQHook;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
GameStateRestore = StateRestore;
|
||||
}
|
|
@ -1,225 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2005 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* VRC-5 (CAI Shogakko no Sansu)
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 QTAINTRAM[2048];
|
||||
static writefunc old2007wrap;
|
||||
|
||||
static uint16 CHRSIZE = 8192;
|
||||
static uint16 WRAMSIZE = 8192 + 4096;
|
||||
static uint8 *CHRRAM = NULL;
|
||||
static uint8 *WRAM = NULL;
|
||||
|
||||
static uint8 IRQa, K4IRQ;
|
||||
static uint32 IRQLatch, IRQCount;
|
||||
|
||||
static uint8 regs[16];
|
||||
//static uint8 test[8];
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ &IRQCount, 1, "IRQC" },
|
||||
{ &IRQLatch, 1, "IRQL" },
|
||||
{ &IRQa, 1, "IRQA" },
|
||||
{ &K4IRQ, 1, "KIRQ" },
|
||||
{ regs, 16, "REGS" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void chrSync(void) {
|
||||
setchr4r(0x10, 0x0000, regs[5] & 1);
|
||||
setchr4r(0x10, 0x1000, 0);
|
||||
}
|
||||
|
||||
static void Sync(void) {
|
||||
chrSync();
|
||||
// if(regs[0xA]&0x10)
|
||||
// {
|
||||
/* setchr1r(0x10,0x0000,(((regs[5]&1))<<2)+0);
|
||||
setchr1r(0x10,0x0400,(((regs[5]&1))<<2)+1);
|
||||
setchr1r(0x10,0x0800,(((regs[5]&1))<<2)+2);
|
||||
setchr1r(0x10,0x0c00,(((regs[5]&1))<<2)+3);
|
||||
setchr1r(0x10,0x1000,0);
|
||||
setchr1r(0x10,0x1400,1);
|
||||
setchr1r(0x10,0x1800,2);
|
||||
setchr1r(0x10,0x1c00,3);*/
|
||||
/* setchr1r(0x10,0x0000,(((regs[5]&1))<<2)+0);
|
||||
setchr1r(0x10,0x0400,(((regs[5]&1))<<2)+1);
|
||||
setchr1r(0x10,0x0800,(((regs[5]&1))<<2)+2);
|
||||
setchr1r(0x10,0x0c00,(((regs[5]&1))<<2)+3);
|
||||
setchr1r(0x10,0x1000,(((regs[5]&1)^1)<<2)+4);
|
||||
setchr1r(0x10,0x1400,(((regs[5]&1)^1)<<2)+5);
|
||||
setchr1r(0x10,0x1800,(((regs[5]&1)^1)<<2)+6);
|
||||
setchr1r(0x10,0x1c00,(((regs[5]&1)^1)<<2)+7);
|
||||
*/
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
/*
|
||||
setchr1r(0x10,0x0000,(((regs[5]&1)^1)<<2)+0);
|
||||
setchr1r(0x10,0x0400,(((regs[5]&1)^1)<<2)+1);
|
||||
setchr1r(0x10,0x0800,(((regs[5]&1)^1)<<2)+2);
|
||||
setchr1r(0x10,0x0c00,(((regs[5]&1)^1)<<2)+3);
|
||||
setchr1r(0x10,0x1000,(((regs[5]&1))<<2)+4);
|
||||
setchr1r(0x10,0x1400,(((regs[5]&1))<<2)+5);
|
||||
setchr1r(0x10,0x1800,(((regs[5]&1))<<2)+6);
|
||||
setchr1r(0x10,0x1c00,(((regs[5]&1))<<2)+7);
|
||||
// }
|
||||
//*/
|
||||
/* setchr1r(1,0x0000,test[0]);
|
||||
setchr1r(1,0x0400,test[1]);
|
||||
setchr1r(1,0x0800,test[2]);
|
||||
setchr1r(1,0x0c00,test[3]);
|
||||
setchr1r(1,0x1000,test[4]);
|
||||
setchr1r(1,0x1400,test[5]);
|
||||
setchr1r(1,0x1800,test[6]);
|
||||
setchr1r(1,0x1c00,test[7]);
|
||||
*/
|
||||
setprg4r(0x10, 0x6000, regs[0] & 1);
|
||||
if (regs[2] >= 0x40)
|
||||
setprg8r(1, 0x8000, (regs[2] - 0x40));
|
||||
else
|
||||
setprg8r(0, 0x8000, (regs[2] & 0x3F));
|
||||
if (regs[3] >= 0x40)
|
||||
setprg8r(1, 0xA000, (regs[3] - 0x40));
|
||||
else
|
||||
setprg8r(0, 0xA000, (regs[3] & 0x3F));
|
||||
if (regs[4] >= 0x40)
|
||||
setprg8r(1, 0xC000, (regs[4] - 0x40));
|
||||
else
|
||||
setprg8r(0, 0xC000, (regs[4] & 0x3F));
|
||||
|
||||
setprg8r(1, 0xE000, ~0);
|
||||
setmirror(MI_V);
|
||||
}
|
||||
|
||||
/*static DECLFW(TestWrite)
|
||||
{
|
||||
test[A&7] = V;
|
||||
Sync();
|
||||
}*/
|
||||
|
||||
static DECLFW(M190Write) {
|
||||
// FCEU_printf("write %04x:%04x %d, %d\n",A,V,scanline,timestamp);
|
||||
regs[(A & 0x0F00) >> 8] = V;
|
||||
switch (A) {
|
||||
case 0xd600: IRQLatch &= 0xFF00; IRQLatch |= V; break;
|
||||
case 0xd700: IRQLatch &= 0x00FF; IRQLatch |= V << 8; break;
|
||||
case 0xd900: IRQCount = IRQLatch; IRQa = V & 2; K4IRQ = V & 1; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
case 0xd800: IRQa = K4IRQ; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
}
|
||||
Sync();
|
||||
}
|
||||
|
||||
static DECLFR(M190Read) {
|
||||
// FCEU_printf("read %04x:%04x %d, %d\n",A,regs[(A&0x0F00)>>8],scanline,timestamp);
|
||||
return regs[(A & 0x0F00) >> 8] + regs[0x0B];
|
||||
}
|
||||
static void VRC5IRQ(int a) {
|
||||
if (IRQa) {
|
||||
IRQCount += a;
|
||||
if (IRQCount & 0x10000) {
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
IRQCount = IRQLatch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//static void Mapper190_PPU(uint32 A)
|
||||
//{
|
||||
// if(A<0x2000)
|
||||
// setchr4r(0x10,0x1000,QTAINTRAM[A&0x1FFF]&1);
|
||||
// else
|
||||
// chrSync();
|
||||
//}
|
||||
|
||||
static DECLFW(M1902007Wrap) {
|
||||
if (A >= 0x2000) {
|
||||
if (regs[0xA] & 1)
|
||||
QTAINTRAM[A & 0x1FFF] = V;
|
||||
else
|
||||
old2007wrap(A, V);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void M190Power(void) {
|
||||
/* test[0]=0;
|
||||
test[1]=1;
|
||||
test[2]=2;
|
||||
test[3]=3;
|
||||
test[4]=4;
|
||||
test[5]=5;
|
||||
test[6]=6;
|
||||
test[7]=7;
|
||||
*/
|
||||
setprg4r(0x10, 0x7000, 2);
|
||||
|
||||
old2007wrap = GetWriteHandler(0x2007);
|
||||
SetWriteHandler(0x2007, 0x2007, M1902007Wrap);
|
||||
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
// SetWriteHandler(0x5000,0x5007,TestWrite);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetWriteHandler(0x8000, 0xFFFF, M190Write);
|
||||
SetReadHandler(0xDC00, 0xDC00, M190Read);
|
||||
SetReadHandler(0xDD00, 0xDD00, M190Read);
|
||||
Sync();
|
||||
}
|
||||
|
||||
static void M190Close(void) {
|
||||
if (CHRRAM)
|
||||
FCEU_gfree(CHRRAM);
|
||||
CHRRAM = NULL;
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
void Mapper190_Init(CartInfo *info) {
|
||||
info->Power = M190Power;
|
||||
info->Close = M190Close;
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
MapIRQHook = VRC5IRQ;
|
||||
// PPU_hook=Mapper190_PPU;
|
||||
|
||||
CHRRAM = (uint8*)FCEU_gmalloc(CHRSIZE);
|
||||
SetupCartCHRMapping(0x10, CHRRAM, CHRSIZE, 1);
|
||||
AddExState(CHRRAM, CHRSIZE, 0, "CRAM");
|
||||
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE - 4096;
|
||||
}
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
|
@ -1,377 +0,0 @@
|
|||
/* FCE Ultra - NES/Famicom Emulator
|
||||
*
|
||||
* Copyright notice for this file:
|
||||
* Copyright (C) 2009 CaH4e3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* VRC-6
|
||||
*
|
||||
*/
|
||||
|
||||
#include "mapinc.h"
|
||||
|
||||
static uint8 is26;
|
||||
static uint8 prg[2], chr[8], mirr;
|
||||
static uint8 IRQLatch, IRQa, IRQd;
|
||||
static int32 IRQCount, CycleCount;
|
||||
static uint8 *WRAM = NULL;
|
||||
static uint32 WRAMSIZE;
|
||||
|
||||
static SFORMAT StateRegs[] =
|
||||
{
|
||||
{ prg, 2, "PRG" },
|
||||
{ chr, 8, "CHR" },
|
||||
{ &mirr, 1, "MIRR" },
|
||||
{ &IRQa, 1, "IRQA" },
|
||||
{ &IRQd, 1, "IRQD" },
|
||||
{ &IRQLatch, 1, "IRQL" },
|
||||
{ &IRQCount, 4, "IRQC" },
|
||||
{ &CycleCount, 4, "CYCC" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void(*sfun[3]) (void);
|
||||
static uint8 vpsg1[8];
|
||||
static uint8 vpsg2[4];
|
||||
static int32 cvbc[3];
|
||||
static int32 vcount[3];
|
||||
static int32 dcount[2];
|
||||
|
||||
static SFORMAT SStateRegs[] =
|
||||
{
|
||||
{ vpsg1, 8, "PSG1" },
|
||||
{ vpsg2, 4, "PSG2" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static void Sync(void) {
|
||||
uint8 i;
|
||||
if (is26)
|
||||
setprg8r(0x10, 0x6000, 0);
|
||||
setprg16(0x8000, prg[0]);
|
||||
setprg8(0xc000, prg[1]);
|
||||
setprg8(0xe000, ~0);
|
||||
for (i = 0; i < 8; i++)
|
||||
setchr1(i << 10, chr[i]);
|
||||
switch (mirr & 3) {
|
||||
case 0: setmirror(MI_V); break;
|
||||
case 1: setmirror(MI_H); break;
|
||||
case 2: setmirror(MI_0); break;
|
||||
case 3: setmirror(MI_1); break;
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(VRC6SW) {
|
||||
A &= 0xF003;
|
||||
if (A >= 0x9000 && A <= 0x9002) {
|
||||
vpsg1[A & 3] = V;
|
||||
if (sfun[0]) sfun[0]();
|
||||
} else if (A >= 0xA000 && A <= 0xA002) {
|
||||
vpsg1[4 | (A & 3)] = V;
|
||||
if (sfun[1]) sfun[1]();
|
||||
} else if (A >= 0xB000 && A <= 0xB002) {
|
||||
vpsg2[A & 3] = V;
|
||||
if (sfun[2]) sfun[2]();
|
||||
}
|
||||
}
|
||||
|
||||
static DECLFW(VRC6Write) {
|
||||
if (is26)
|
||||
A = (A & 0xFFFC) | ((A >> 1) & 1) | ((A << 1) & 2);
|
||||
if (A >= 0x9000 && A <= 0xB002) {
|
||||
VRC6SW(A, V);
|
||||
return;
|
||||
}
|
||||
switch (A & 0xF003) {
|
||||
case 0x8000: prg[0] = V; Sync(); break;
|
||||
case 0xB003: mirr = (V >> 2) & 3; Sync(); break;
|
||||
case 0xC000: prg[1] = V; Sync(); break;
|
||||
case 0xD000: chr[0] = V; Sync(); break;
|
||||
case 0xD001: chr[1] = V; Sync(); break;
|
||||
case 0xD002: chr[2] = V; Sync(); break;
|
||||
case 0xD003: chr[3] = V; Sync(); break;
|
||||
case 0xE000: chr[4] = V; Sync(); break;
|
||||
case 0xE001: chr[5] = V; Sync(); break;
|
||||
case 0xE002: chr[6] = V; Sync(); break;
|
||||
case 0xE003: chr[7] = V; Sync(); break;
|
||||
case 0xF000: IRQLatch = V; X6502_IRQEnd(FCEU_IQEXT); break;
|
||||
case 0xF001:
|
||||
IRQa = V & 2;
|
||||
IRQd = V & 1;
|
||||
if (V & 2)
|
||||
IRQCount = IRQLatch;
|
||||
CycleCount = 0;
|
||||
X6502_IRQEnd(FCEU_IQEXT);
|
||||
break;
|
||||
case 0xF002:
|
||||
IRQa = IRQd;
|
||||
X6502_IRQEnd(FCEU_IQEXT);
|
||||
}
|
||||
}
|
||||
|
||||
static void VRC6Power(void) {
|
||||
Sync();
|
||||
SetReadHandler(0x6000, 0xFFFF, CartBR);
|
||||
SetWriteHandler(0x6000, 0x7FFF, CartBW);
|
||||
SetWriteHandler(0x8000, 0xFFFF, VRC6Write);
|
||||
}
|
||||
|
||||
static void VRC6IRQHook(int a) {
|
||||
if (IRQa) {
|
||||
CycleCount += a * 3;
|
||||
while(CycleCount >= 341) {
|
||||
CycleCount -= 341;
|
||||
IRQCount++;
|
||||
if (IRQCount == 0x100) {
|
||||
IRQCount = IRQLatch;
|
||||
X6502_IRQBegin(FCEU_IQEXT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void VRC6Close(void)
|
||||
{
|
||||
if (WRAM)
|
||||
FCEU_gfree(WRAM);
|
||||
WRAM = NULL;
|
||||
}
|
||||
|
||||
static void StateRestore(int version) {
|
||||
Sync();
|
||||
}
|
||||
|
||||
// VRC6 Sound
|
||||
|
||||
static void DoSQV1(void);
|
||||
static void DoSQV2(void);
|
||||
static void DoSawV(void);
|
||||
|
||||
static INLINE void DoSQV(int x) {
|
||||
int32 V;
|
||||
int32 amp = (((vpsg1[x << 2] & 15) << 8) * 6 / 8) >> 4;
|
||||
int32 start, end;
|
||||
|
||||
start = cvbc[x];
|
||||
end = (SOUNDTS << 16) / soundtsinc;
|
||||
if (end <= start) return;
|
||||
cvbc[x] = end;
|
||||
|
||||
if (vpsg1[(x << 2) | 0x2] & 0x80) {
|
||||
if (vpsg1[x << 2] & 0x80) {
|
||||
for (V = start; V < end; V++)
|
||||
Wave[V >> 4] += amp;
|
||||
} else {
|
||||
int32 thresh = (vpsg1[x << 2] >> 4) & 7;
|
||||
int32 freq = ((vpsg1[(x << 2) | 0x1] | ((vpsg1[(x << 2) | 0x2] & 15) << 8)) + 1) << 17;
|
||||
for (V = start; V < end; V++) {
|
||||
if (dcount[x] > thresh)
|
||||
Wave[V >> 4] += amp;
|
||||
vcount[x] -= nesincsize;
|
||||
while (vcount[x] <= 0) {
|
||||
vcount[x] += freq;
|
||||
dcount[x] = (dcount[x] + 1) & 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void DoSQV1(void) {
|
||||
DoSQV(0);
|
||||
}
|
||||
|
||||
static void DoSQV2(void) {
|
||||
DoSQV(1);
|
||||
}
|
||||
|
||||
static void DoSawV(void) {
|
||||
int V;
|
||||
int32 start, end;
|
||||
|
||||
start = cvbc[2];
|
||||
end = (SOUNDTS << 16) / soundtsinc;
|
||||
if (end <= start) return;
|
||||
cvbc[2] = end;
|
||||
|
||||
if (vpsg2[2] & 0x80) {
|
||||
static int32 saw1phaseacc = 0;
|
||||
uint32 freq3;
|
||||
static uint8 b3 = 0;
|
||||
static int32 phaseacc = 0;
|
||||
static uint32 duff = 0;
|
||||
|
||||
freq3 = (vpsg2[1] + ((vpsg2[2] & 15) << 8) + 1);
|
||||
|
||||
for (V = start; V < end; V++) {
|
||||
saw1phaseacc -= nesincsize;
|
||||
if (saw1phaseacc <= 0) {
|
||||
int32 t;
|
||||
rea:
|
||||
t = freq3;
|
||||
t <<= 18;
|
||||
saw1phaseacc += t;
|
||||
phaseacc += vpsg2[0] & 0x3f;
|
||||
b3++;
|
||||
if (b3 == 7) {
|
||||
b3 = 0;
|
||||
phaseacc = 0;
|
||||
}
|
||||
if (saw1phaseacc <= 0)
|
||||
goto rea;
|
||||
duff = (((phaseacc >> 3) & 0x1f) << 4) * 6 / 8;
|
||||
}
|
||||
Wave[V >> 4] += duff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static INLINE void DoSQVHQ(int x) {
|
||||
int32 V;
|
||||
int32 amp = ((vpsg1[x << 2] & 15) << 8) * 6 / 8;
|
||||
|
||||
if (vpsg1[(x << 2) | 0x2] & 0x80) {
|
||||
if (vpsg1[x << 2] & 0x80) {
|
||||
for (V = cvbc[x]; V < (int)SOUNDTS; V++)
|
||||
WaveHi[V] += amp;
|
||||
} else {
|
||||
int32 thresh = (vpsg1[x << 2] >> 4) & 7;
|
||||
for (V = cvbc[x]; V < (int)SOUNDTS; V++) {
|
||||
if (dcount[x] > thresh)
|
||||
WaveHi[V] += amp;
|
||||
vcount[x]--;
|
||||
if (vcount[x] <= 0) {
|
||||
vcount[x] = (vpsg1[(x << 2) | 0x1] | ((vpsg1[(x << 2) | 0x2] & 15) << 8)) + 1;
|
||||
dcount[x] = (dcount[x] + 1) & 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cvbc[x] = SOUNDTS;
|
||||
}
|
||||
|
||||
static void DoSQV1HQ(void) {
|
||||
DoSQVHQ(0);
|
||||
}
|
||||
|
||||
static void DoSQV2HQ(void) {
|
||||
DoSQVHQ(1);
|
||||
}
|
||||
|
||||
static void DoSawVHQ(void) {
|
||||
static uint8 b3 = 0;
|
||||
static int32 phaseacc = 0;
|
||||
int32 V;
|
||||
|
||||
if (vpsg2[2] & 0x80) {
|
||||
for (V = cvbc[2]; V < (int)SOUNDTS; V++) {
|
||||
WaveHi[V] += (((phaseacc >> 3) & 0x1f) << 8) * 6 / 8;
|
||||
vcount[2]--;
|
||||
if (vcount[2] <= 0) {
|
||||
vcount[2] = (vpsg2[1] + ((vpsg2[2] & 15) << 8) + 1) << 1;
|
||||
phaseacc += vpsg2[0] & 0x3f;
|
||||
b3++;
|
||||
if (b3 == 7) {
|
||||
b3 = 0;
|
||||
phaseacc = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cvbc[2] = SOUNDTS;
|
||||
}
|
||||
|
||||
|
||||
void VRC6Sound(int Count) {
|
||||
int x;
|
||||
|
||||
DoSQV1();
|
||||
DoSQV2();
|
||||
DoSawV();
|
||||
for (x = 0; x < 3; x++)
|
||||
cvbc[x] = Count;
|
||||
}
|
||||
|
||||
void VRC6SoundHQ(void) {
|
||||
DoSQV1HQ();
|
||||
DoSQV2HQ();
|
||||
DoSawVHQ();
|
||||
}
|
||||
|
||||
void VRC6SyncHQ(int32 ts) {
|
||||
int x;
|
||||
for (x = 0; x < 3; x++) cvbc[x] = ts;
|
||||
}
|
||||
|
||||
static void VRC6_ESI(void) {
|
||||
GameExpSound.RChange = VRC6_ESI;
|
||||
GameExpSound.Fill = VRC6Sound;
|
||||
GameExpSound.HiFill = VRC6SoundHQ;
|
||||
GameExpSound.HiSync = VRC6SyncHQ;
|
||||
|
||||
memset(cvbc, 0, sizeof(cvbc));
|
||||
memset(vcount, 0, sizeof(vcount));
|
||||
memset(dcount, 0, sizeof(dcount));
|
||||
if (FSettings.SndRate) {
|
||||
if (FSettings.soundq >= 1) {
|
||||
sfun[0] = DoSQV1HQ;
|
||||
sfun[1] = DoSQV2HQ;
|
||||
sfun[2] = DoSawVHQ;
|
||||
} else {
|
||||
sfun[0] = DoSQV1;
|
||||
sfun[1] = DoSQV2;
|
||||
sfun[2] = DoSawV;
|
||||
}
|
||||
} else
|
||||
memset(sfun, 0, sizeof(sfun));
|
||||
AddExState(&SStateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
// VRC6 Sound
|
||||
|
||||
void Mapper24_Init(CartInfo *info) {
|
||||
is26 = 0;
|
||||
info->Power = VRC6Power;
|
||||
MapIRQHook = VRC6IRQHook;
|
||||
VRC6_ESI();
|
||||
GameStateRestore = StateRestore;
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void Mapper26_Init(CartInfo *info) {
|
||||
is26 = 1;
|
||||
info->Power = VRC6Power;
|
||||
info->Close = VRC6Close;
|
||||
MapIRQHook = VRC6IRQHook;
|
||||
VRC6_ESI();
|
||||
GameStateRestore = StateRestore;
|
||||
|
||||
WRAMSIZE = 8192;
|
||||
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
|
||||
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);
|
||||
AddExState(WRAM, WRAMSIZE, 0, "WRAM");
|
||||
if (info->battery) {
|
||||
info->SaveGame[0] = WRAM;
|
||||
info->SaveGameLen[0] = WRAMSIZE;
|
||||
}
|
||||
|
||||
AddExState(&StateRegs, ~0, 0, 0);
|
||||
}
|
||||
|
||||
void NSFVRC6_Init(void) {
|
||||
VRC6_ESI();
|
||||
SetWriteHandler(0x8000, 0xbfff, VRC6SW);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue