Commit graph

48 commits

Author SHA1 Message Date
Adam Gashlin d386930fa2 Avoid length overflow when fetch starts beyond ROM 2022-01-24 18:41:03 +01:00
Christopher Bonhage 9f264b3208 Emulate SRAM bank boundaries in PI read/write 2021-12-17 21:18:48 +01:00
Christopher Bonhage 6b7c2af8d4 Add support for 768Kbit SRAM save type
Fixes a Segfault when loading Dezaemon 3D.

  * Unfortunately, Dezaemon 3D does not actually work yet. It appears to
    fail the SRAM test, which still needs further investigation.

Adds an option alias for sram256k to disambiguate with new sram768k option.
2021-12-17 21:18:48 +01:00
Giovanni Bajo 8367698e20 Improve PI DMA implementation.
This is now basically perfect compared to real hardware. Verified
used the extensive testsuite here: https://github.com/rasky/n64_pi_dma_test

The only missing part is timing and making the transfer happen in
background, at least block by block.
2021-06-23 20:11:44 +02:00
Giovanni Bajo 6abe0f7e55 Fix several bugs in PI DMA alignments and register reads 2021-06-07 20:36:15 +02:00
Simon Eriksson 9316569eff pi: Fix PI DMA length alignment
Fixes Yoshi's Story, F-1 World Grand Prix and probably many other games
2021-03-09 22:20:12 +01:00
Simon Eriksson fe81d08ca2 Remove unused global bus pointer variables 2020-05-15 21:28:24 +02:00
Nabile Rahmani 30f17b2e20 PI: name constants and fixed DMA/reset controller behaviour (#134)
* PI: name constants and fixed DMA/reset controller behaviour.

When a reset controller request is performed, only busy and error bits are cleared.
When DMAs begin, the DMA busy bit is set, but the interrupt bit shouldn't be touched yet.

* Ignore PI register write and flag error when busy.
2019-11-03 17:46:44 +01:00
Jay Oster acae696f03 Fix PI DMA with unaligned cartridge address 2019-05-16 21:48:39 -07:00
peterlemon 5ce3772646 fix master 2018-09-10 23:15:30 +01:00
peterlemon 32641012eb fix const struct is_viewer 2018-09-10 22:15:07 +01:00
peterlemon 82cbba5a1b fix const struct is_viewer 2018-09-10 22:02:08 +01:00
Jason Benaim 72c778c3bf Fix segfault when DMAing past the end of cart ROM.
When a game triggers a DMA from the cart ROM area to RDRAM, part or all of the
DMA'd area is not covered by the currently-loaded ROM, cen64 treats it as a
series of reads from open-bus. A bug in the code that handles this case was
causing segfaults.
Hat-tip to cen64 user Grim who provided a test rom that triggered this bug. His
test ROM was less than (1 MB + 4 KB) in size, which was causing the initial 1MB
DMA to trigger this bug.
2018-05-23 23:23:45 -04:00
Mike Ryan 8d0e7bb627 pi: add support for IS Viewer 64
When -is-viewer is passed on the command line, create an IS Viewer
object that intercepts writes at 0x13FF0000. This is used by Ocarina of
Time Master Quest Debug to log debug messages.

The messages are encoded in EUC-JP, so we bring in iconv to convert that
to UTF-8 so the messages can be printed to modern consoles.

Props to jrra (@jkbenaim) and spinout for reverse engineering the
interface and documenting it: http://wiki.spinout182.com/w/IS64
2017-02-28 19:55:55 -08:00
Tyler J. Stachecki 3900be4776 bus: Perform open bus reads for unmapped addresses.
Fixes F-Zero X (cartridge version).
2016-07-17 20:47:07 -04:00
Tyler J. Stachecki 3288229a50 Start fixing MSVC builds.
Conflicts:
	rdp/n64video.c
2016-06-26 17:19:17 -04:00
Mike Ryan 73f4420a4c fix all build warnings, does not affect functionality 2016-06-16 20:40:51 -07:00
Tyler J. Stachecki bb41f7208e Implement mapped SRAM accesses. 2016-03-20 15:18:17 -04:00
Tyler J. Stachecki e0c3fdd47f Fix PI/DD bugs that broke some carts.
Readjust PI DMA delay timing slightly (until we get some
more accurate timing information or simulation to replace
it altogether).
2016-01-30 19:39:10 -05:00
Mike Ryan 4fc80b7e8b dd: functional N64 DD implementation
Does not handle disk writes. Expect disks in MAME format.
2016-01-30 16:28:00 -05:00
Mike Ryan 71f405ea40 pi: adjust DMA delay to work with 64dd 2016-01-30 16:27:45 -05:00
Mike Ryan a0840f1e04 pi: return 0 for mapped read of non-present cart 2016-01-30 16:27:41 -05:00
Tyler J. Stachecki e2e72821e2 Try to reduce component cycle overheads.
Oftentimes, many of our countrollers are just doing a
simple countdown and don't perform any real work for the
cycle. Pull those parts out into headers so that the
compiler can 'see' that and optimize accordingly.
2016-01-30 14:58:31 -05:00
Tyler J. Stachecki 63b2709dc0 Bad implementation of PI delay. 2016-01-30 14:58:31 -05:00
Mike Ryan 683fcc39a0 flashram: do not segfault on writes if FlashRAM is not present 2016-01-28 00:42:35 -05:00
Mike Ryan e48d982023 flashram: implement FlashRAM in PI, with mapped reads 2016-01-25 20:09:46 -08:00
Mike Ryan 782b8cb826 flashram: take command line option and pass into PI 2016-01-25 20:09:46 -08:00
Mike Ryan b07994687f sram: do not memcpy to NULL buffer 2016-01-24 14:20:27 -08:00
Mike Ryan 21d588c6ed sram: copy data between RDRAM and SRAM 2016-01-24 14:18:18 -08:00
Mike Ryan 3ba39b536d sram: load on command line and stuff into PI 2016-01-24 14:18:18 -08:00
Mike Ryan 4e8f3d3406 pi: correct memory ranges for SRAM and DD modem 2016-01-24 14:18:18 -08:00
Derek "Turtle" Roe 8b89df2fdc See long description
Replaced all references to simulation with emulation
Updated copyright year
Updated .gitignore to reduce chances of random files being uploaded to
the repo
Added .gitattributes to normalize all text files, and to ignore binary
files (which includes the logo and the NEC PDF)
2015-07-01 18:44:21 -05:00
Tyler Stachecki 28d4b7e122 Give DDIPL a lower priority than carts. 2015-01-17 11:51:29 -05:00
Tyler Stachecki e073637d33 Add some temporary hacks to the PI and UB fixes. 2015-01-13 18:01:49 -05:00
Tyler Stachecki 3e299ed764 Allow PI DMAs past 32MiB cart range. 2015-01-09 12:23:39 -05:00
Tyler Stachecki 67fca6c47f Add -ddrom to the command line. 2015-01-08 12:17:17 -05:00
Tyler Stachecki 10fc81d7a3 Start filling in lots of 64DD implementation.
Also, fix a few bugs in the past two commits.
2015-01-06 22:21:00 -05:00
Tyler Stachecki fd74a5eb55 Update README and prepare for GitHub push. 2015-01-01 15:01:46 -05:00
Tyler Stachecki e89f054674 Optimize extremely aggressively.
Tell GCC to optimize cold functions for size and stash them away in
a separate part of the binary. Put the simulate core, meanwhile, on
the hot path. Also, bump optimization to -O3 as we can now "afford"
to do so.
2014-11-05 08:39:47 -05:00
Tyler Stachecki e6bc8ebe64 Add more TLB support, verify things. 2014-08-23 20:06:45 -04:00
Tyler Stachecki 8d7afe3d4c Do a better job of emulating the PI. 2014-07-13 21:22:36 -04:00
Tyler Stachecki 454033499d Start integrating OpenGL (GLFW) and friends. 2014-04-19 17:14:45 -04:00
Tyler Stachecki b951f9ccf5 Start integrating interrupt support. 2014-04-18 22:59:48 -04:00
Tyler Stachecki 9127d539f8 Add support for PI DMAs, correctly initialize RDRAM. 2014-04-18 21:15:38 -04:00
Tyler Stachecki 3a126249c9 Allow PI to perform cartridge ROM reads. 2014-04-18 17:18:12 -04:00
Tyler Stachecki 25a6ae8431 Mask bus writes to requested type, etc. 2014-04-18 13:34:23 -04:00
Tyler Stachecki d114038a2b Add option for debugging MMIO register access. 2014-04-18 12:44:57 -04:00
Tyler Stachecki 4560adf7a7 Populate with interfaces and devices. 2014-04-18 11:24:43 -04:00