Savestate hook requires re-entry from NMI/IRQ, but lack of detected button
presses can preempt that and jump back to the game instead, corrupting
the stack and disrupting savestate hook execution flow.
A force_entry flag is added that is set when the FPGA enables the branch
to the savestate handler, and does not disable it before hook mapping
is disabled by the unlock_disable register ($2BFD).
* - Fixed missing line 0 OAM STAT interrupt.
* - Added some notes.
* - Added support for (non save state) MCU write of SC to assert interrupt
request.
* - Removed trailing white space from several files and updated some
comments.
* Updated notes.
Co-authored-by: Your Name <youremail@yourdomain.com>
This allows for savestate handler execution directly from the menu ROM
bank without having to copy it to block RAM or similar.
(this seems to be causing unresolvable issues with HDMA interrupting
NMI/IRQ so it will be due for an overhaul)
Databus direction was reversed according to the ROMSEL signal, not
taking into account SRAM that is mapped outside of active ROMSEL areas.
Instead take into account anything where data is sourced from the
cartridge (ROM_HIT).
Only snoop registers 2100-2183 and ignore the ones we supply ourselves.
e.g. Trying to snoop BS-X registers would result in the SNES not being
able to read them at all, freezing the
BS-X BIOS at the startup screen.
On some occasions data output can be enabled before data is valid.
This results in needless data line toggling which in turn can cause
coupling into other signals, thereby potentially altering the ROM address
and putting wrong data on the bus, etc.
Use a narrowed output enable signal for SNES read cases to prevent this
effect.
CPU_CLK is substantially shorter than RD# during DMA transfers.
Access cycle end was previously based on falling edge of CPU_CLK.
This resulted in premature yielding of RAM access to the bus and in
consequence incorrect values leaking onto the bus.
Xilinx command line tools (xst, par, map ...) block on console output when
run via the Tcl shell's "Process Run" command which seems to flush the
console about once per second. Running he command line tools directly
from the shell results in much faster output and thus operation of the
tools. However in order to extract the command line parameters for the
tools from the ISE project file it becomes necessary to mimic some of
the internal scripting. Tcl scripts are added that are run via xtclsh to
output parameters that are then passed to the command line tools for
direct execution.