37 Commits

Author SHA1 Message Date
ikari
f7e1208b06 comments, wording, cleanup, cosmetics 2021-07-28 02:19:06 +02:00
ikari
26e9f2cc3b FPGA: update auto region patch state machine for all cores 2021-07-28 02:07:10 +02:00
ikari
031cb5201d integrate savestate handler call with in-game hook
Also move in-game hook out of the way of MCU_CMD area used by savestates
2021-07-28 00:30:48 +02:00
ikari
6b1a4254b1 FPGA: Mask data line toggling before data ready
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.
2021-07-20 23:14:36 +02:00
ikari
3ccffb1fda Detect end of cycle based on longest enable pulse
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.
2021-07-20 18:19:18 +02:00
ikari
df72413dcd FPGA: rearrange code to need less `ifdef blocks 2019-07-05 13:33:46 +02:00
ikari
a01fb3d6a1 Revise project structure
Makefile based build for FPGA configurations, firmware, SuperCIC,
release packaging. Probably needs more polishing.
2019-05-20 00:33:28 +02:00
ikari
9d4d669689 Avoid memory corruption on MCU writes
(address invalid before end of write strobe)
2019-03-26 10:29:39 +01:00
ikari
43451bf671 Consolidate some inconsistent / scattered verilog 2019-02-28 18:45:23 +01:00
ikari
ee279c448a Cleanup 2018-12-08 23:20:37 +01:00
ikari
a91be50355 Unify address sampling 2018-12-08 23:16:57 +01:00
ikari
5d5e918fb0 Fix timing for auto region patching 2018-12-08 23:15:45 +01:00
ikari
87403fb370 Adjust PAWR sampling point on 96MHz cores for brightness patch 2018-12-08 23:13:31 +01:00
ikari
bfc82ba830 Whitespace/general cleanup 2018-11-05 00:29:05 +01:00
ikari
ac546fb7fa Fix brightness patching for DMA and SA1 IRAM 2018-11-03 01:01:20 +01:00
Maximilian Rehkopf
872300caa4 Fix menu lockup after reconfiguration (databus glitch)
To support multiple custom chips the FPGA is reconfigured at ROM loading
time while the menu is running.

After reconfiguration the initial state of all synchronizing shift
registers was 0 which led the FPGA to believe the SNES is actively
accessing the bus, writing to peripheral address $00 (CPU address $2100
- brightness register). This invalid state persists for a couple of FPGA
cycles until the SNES control signals have been clocked into the shift
registers.

The recently introduced brightness patch partly reacts to this pattern,
momentarily forcing the sd2snes data bus drivers active. Depending on
the SNES CPU's current position in the cycle this could cause a crash,
disrupting the game loading handshake. Upon pushing reset the game would
still run but without long reset or autosave features, so one would
inevitably lose their SRAM contents.

This fix initializes the synchronizers for all active low control
registers with 1's (and the CPU_CLK synchronizer with 0's for good
measure) so the FPGA doesn't make up any accesses that do not exist.
2018-08-07 18:58:00 +02:00
ikari
7d5dd9d2b4 Feature: Brightness limit
This intercepts and overrides writes to $2100, limiting the brightness
written to a configurable value (8..15).
The FPGA feature bitfield is extended to 16 bits to accomodate the 4
additional bits for the brightness limit.
The menu itself does not apply the brightness limit on FPGA level but
"fakes" it by setting the brightness manually. The newly added menu
change hooks are used to reflect the brightness setting as soon as it is
changed during selection.
2018-07-15 00:50:11 +02:00
ikari
de174c1a15 Add missing change for eda3909 2017-04-30 23:38:21 +02:00
ikari
e07b6e2508 MSU1: avoid unaligned SD reads (FPGA side) 2017-04-30 23:29:23 +02:00
Maximilian Rehkopf
8a72bfe122 FPGA: Some bus timing tweaks
Do not yield too early on cycle end
2017-04-29 09:30:34 +02:00
Maximilian Rehkopf
21e6bd9f8a Properly name ROMSEL signal, filter like other control signals 2016-09-28 17:46:09 +02:00
Maximilian Rehkopf
b48b04a03a Inhibit "blind" hook area writes unless unlocked
Magic value writes are no longer necessary for unlocking
2016-09-28 16:15:20 +02:00
ikari
43d53557af Another in-game hook overhaul
- Offload any flow control to FPGA to shave off some more CPU cycles
- Blank screen on reset to menu to avoid graphical artifacts
2016-09-14 01:39:59 +02:00
ikari
76eea82763 FPGA: adjust leftover timing values for 96MHz 2016-09-14 01:33:54 +02:00
ikari
77520bf30b Revised in-game hook (FPGA side)
Significant improvements on the hook's CPU footprint and "stealthiness".

* implicit unlocking by FPGA (and by mapper ID for menu operation)
* automatic return vector filling by FPGA, no more duplicate hooks
* do not perform manual read when manual read in progress by game
* map button combination -> command using FPGA (no costly loop in hook)
* reset hook support
2016-08-16 03:57:15 +02:00
ikari
829953b034 DAC: improve audio quality (nearest neighbor -> CIC filter), fix playback rate 2016-04-01 02:00:29 +02:00
Michaël Larouche
6f601e371a Implement final specs of MSU-1 resume. Tested on a SD2SNES rev.F. 2016-01-31 15:20:42 -05:00
ikari_01
dedcb9ff5e DAC: volume boost setting for MSU1 2015-10-21 00:12:30 +02:00
ikari_01
688bd5d6e5 Sample SNES data input to reliably get valid data on writes 2015-08-29 14:52:41 +02:00
ikari_01
3175c55919 Lower clock speed from 88MHz to 86MHz
(to help achieve timing closure on the dreaded Cx4)
2015-08-29 14:50:39 +02:00
ikari_01
4bdcffdfa6 FPGA: reconstitute more aggressive SNES control signal filtering; unify edge detection and data buffering 2014-10-08 00:00:43 +02:00
ikari_01
278eedca6b Snoop $4200 register write (sense auto joypad read); double BRAM buffer size
Rearrange memory map of BRAM hook
2014-09-30 17:46:42 +02:00
ikari_01
c1f216f680 FPGA: properly synchronize asynchronous FSM control signals
hopefully REALLY eliminate FSM lockups this time
2014-09-25 00:39:26 +02:00
ikari_01
a55a161a2b FPGA: Auto-choose NMI/IRQ vector depending on usage by SNES;
also do not switch vector patching while vectors are being read
2014-09-25 00:36:44 +02:00
ikari_01
470b286572 FPGA: new memory sharing for all sub configurations; Cx4 speed switch 2014-09-18 17:32:56 +02:00
Maximilian Rehkopf
c530f5d7c9 FPGA: code formatting + cleanup 2014-05-10 17:17:25 +02:00
Maximilian Rehkopf
fd64adc7aa FPGA: OBC1 support 2014-03-09 23:58:16 +01:00