Commit graph

2672 commits

Author SHA1 Message Date
Richard Goedeken
78cf996ee8 Merge pull request #448 from Enker/patch-1
Fix some Save Type entries
2017-10-20 17:02:06 -07:00
Enker
506e993f30 Fix some Save Type entries 2017-10-20 16:58:43 -04:00
Logan McNaughton
e415e75560 Force word alignment in SI DMA 2017-10-19 23:10:59 -06:00
Logan
a145cde5c6 Merge pull request #1 from bsmiles32/pisi
Minor edits to PR 420 (pisi)
2017-10-19 21:54:32 -06:00
Bobby Smiles
092a7c270a Minor edits to loganmc10 SI refacotrings:
- remove si_schedule function. Move it inside write_si_reg body.
- add word-alignment restriction on dram address, and do word-copy
- rename si_type to dma_dir, also SI_DMA_NONE is now SI_NO_DMA
- pif_addr validity test is more relaxed (test only 25 bits).
- add more comments
2017-10-20 01:59:34 +02:00
Bobby Smiles
d5026c76a5 Remove unused pi_status from cart_rom.
Also, now that pi_status is not used outside of pi_controller.c move
pi_status enums inside pi_controller.c
2017-10-19 23:32:26 +02:00
Logan McNaughton
1dfecd4af3 Make pi DMA lengths consistent 2017-10-19 14:38:44 -06:00
Logan McNaughton
17bab84d42 Don't use IO_BUSY flags for DMA 2017-10-19 14:27:28 -06:00
bsmiles32
c745998310 Merge pull request #436 from bsmiles32/refac_pi
PI refactorings
2017-10-19 22:23:56 +02:00
Bobby Smiles
ac2b6bab33 Fix (again) duplicate saves in Paper Mario (U)
Was not mapping correctly PI_DOM3_ADDR2 space.
2017-10-19 18:51:32 +02:00
Bobby Smiles
273ae923d8 Move cart_rom, flashram and sram into cart module. 2017-10-19 14:26:50 +02:00
Bobby Smiles
f6700de7a2 Pass cart_rom instead of pi to {read,write}_cart_rom functions. 2017-10-19 13:41:11 +02:00
Bobby Smiles
8fe2aa033f Refactor pi dma logic.
PI controller now accepts 4 different dma handler, one for each DMA'able
region (DD ROM, CART SAVE, CART ROM, 1FD00000). Each handler is
responsible for effective data transfer and some extra operation as
needed (cached_code invalidation for instance).
2017-10-19 13:41:11 +02:00
Richard Goedeken
9e648931d5 Merge pull request #444 from loganmc10/vi2
Re-work the way VI interrupts are timed
2017-10-18 20:42:52 -07:00
Richard Goedeken
61ee619057 Merge pull request #443 from loganmc10/patch-2
Remove CountPerOp=1 for Ep I Racer
2017-10-18 18:19:04 -07:00
Logan McNaughton
89a1e41184 Re-work the way VI interrupts are timed 2017-10-18 18:16:38 -06:00
Logan
8a9b3d3c06 Remove CountPerOp=1 for Ep I Racer 2017-10-18 14:48:02 -06:00
Richard Goedeken
4e5ec46cc6 Merge pull request #440 from Enker/patch-1
Mempak/Rumble fixes
2017-10-16 18:38:31 -07:00
Enker
57211b92c1 Fix some Mempak/Rumble entries 2017-10-16 21:03:44 -04:00
Richard Goedeken
5126f994f0 Merge pull request #439 from bsmiles32/fix_savestate
Fix crash when loading savestate.
2017-10-15 10:01:09 -07:00
Bobby Smiles
e826cf0939 Fix crash when loading savestate.
savestate loading code was trying to poweron rumble pak on a
non-initialized rumble pak.
Now we check that the game is rumble pak compatible (therefore it has
been initialized) before calling the poweron function.

A similar issue was also present for transferpak.
2017-10-15 16:04:12 +02:00
Richard Goedeken
441f550360 Merge pull request #437 from Enker/patch-1
ROM database update
2017-10-14 20:07:37 -07:00
Richard Goedeken
1b482b69f7 Merge pull request #415 from loganmc10/rng
Randomize PI/SI interrupt timing
2017-10-14 20:06:40 -07:00
Enker
de38d84eaf Add Mempak/Rumble fixes and new ROMs to the database 2017-10-14 14:47:08 -04:00
Logan McNaughton
c35cae784d rand() does not work in MinGW, use rand_s 2017-10-13 20:33:50 -06:00
Logan McNaughton
51c4471d42 Randomize PI/SI interrupt timing 2017-10-13 20:33:50 -06:00
bsmiles32
8f918f4100 Merge pull request #411 from bsmiles32/more_si_refactorings_0
More si refactorings
2017-10-14 03:30:29 +02:00
Bobby Smiles
2c4ae15d64 Rename GB cart loader to media loader. 2017-10-14 03:23:43 +02:00
Bobby Smiles
ac700c87b3 Fix controllers state loading. 2017-10-14 03:23:43 +02:00
Bobby Smiles
51aa73d935 Remove testing code. 2017-10-14 03:23:43 +02:00
Bobby Smiles
004bdda0c8 Fix returned value for M64CMD_SET_GB_CART_LOADER command. 2017-10-14 03:23:43 +02:00
Bobby Smiles
ded3624cdc Fix msvc compilation.
objects of static storage duration are guaranted to be zero initialized
anyway.
2017-10-14 03:23:43 +02:00
Bobby Smiles
6a828f2971 Disable testing code. 2017-10-14 03:23:43 +02:00
Bobby Smiles
cf75ee1fc6 Fix NULL pointer dereference when no GB cart loader is defined. 2017-10-14 03:23:43 +02:00
Bobby Smiles
1e8a490ef3 Be more tolerant about RAM file size. 2017-10-14 03:23:43 +02:00
Bobby Smiles
2a20df9c56 Document GB loader functions. Bump version.
Also during this process, I felt necessary to slightly alter functions
prototypes (better name, easier usage/implementation).
I also specified the NULL terminated strings ownership, and thus
reworked some aspects of objects ownership.
NULL or empty strings usage also have been documented. For ROM, empty or
NULL strings allow to have an empty transferpak. For RAM, empty or NULL
strings will let the core generate a suitable save filename and
initialize it with empty content. This can be helpful when a GB save
file is not available and the game doesn't really care about the initial
saved content (for instance Perfect Dark).

The init_gb_cart function as also been slightly modified to better
handle loading failures (and not leak stuff in this case).

The GB pak switch function is now only activable when the game is
compatible with the Transferpak. Still you can change what is inside the
transferpak even when the transferpak is not plugged in.
2017-10-14 03:23:43 +02:00
Bobby Smiles
d440020a3b Avoid usage of initialized static variables inside functions
because they are not reinitialized when stopping/restaring emulation.
2017-10-14 03:23:43 +02:00
Bobby Smiles
623690ab1e Add some more Mempak/Rumble entries to the db
Also some fixes here and there.
2017-10-14 03:23:43 +02:00
Bobby Smiles
e56a9294ca Implement GB cart switching. 2017-10-14 03:23:43 +02:00
Bobby Smiles
c3031064b8 Add some more Mempak/Rumble entries to the rom db.
Also some other fixes here and there.
2017-10-14 03:23:43 +02:00
Bobby Smiles
c71a6d547b Add some constants to ease controller input backends writing. 2017-10-14 03:23:43 +02:00
Bobby Smiles
9e54900c07 One less warning in pi_controller. 2017-10-14 03:23:43 +02:00
Bobby Smiles
3b7dbabf46 Fix some warnings found by msvc. 2017-10-14 03:23:43 +02:00
Bobby Smiles
6dc0c760c3 Fix msvc project file. 2017-10-14 03:20:41 +02:00
Bobby Smiles
a35a724705 Add SET_GB_CART_LOADER core command. 2017-10-14 03:20:41 +02:00
Bobby Smiles
88303abb31 Use rom db to know paks compatibility.
Adds 2 new fields : Transferpak=*Yes*|No, Mempak=*Yes*|No (default value
between *).
2017-10-14 03:20:41 +02:00
Bobby Smiles
7f727759c0 Implement pak switching inside the core.
The mempak switch button is repurposed as a pak switching button.
By pressing this button, the next compatible pak is inserted into the
controller.
2017-10-14 03:20:41 +02:00
Bobby Smiles
8682a7ce8b Separate interfaces from mutable state in all backends.
Also
* Move backends implementations under backends directory.
* Rework file_storage to be a real implementation of storage_backend.
* Fixup PIF_PDT_EEPROM types
* Extract joybus stuff from pif module.
* Extract cart stuff from pif module.
* Extract controllers and paks from si module.
2017-10-14 03:20:41 +02:00
Bobby Smiles
0f02d0074c Move some controller initialization stuff around. 2017-10-14 03:12:46 +02:00
Bobby Smiles
891c7005de Remove some unneeded headers. 2017-10-14 03:12:46 +02:00