Commit graph

1883 commits

Author SHA1 Message Date
Bobby Smiles
a5330b75de Isolate AI subsystem from audio plugin.
The AI controller has been reworked to be made independent of the audio
plugin. All it expects is 2 callbacks (one for setting sample format,
and the other to push samples).

A retro-compatibility module implements these 2 new callbacks using the
existing audio plugin in a best effort manner as pure zilmar spec
is not fully compatible with the new callbacks. However, by exploiting
implementation details of both core and audio plugin, we can get
a "good enough" implementation of these callbacks.

Audio DMA fifo has been also reworked and its associated data has
changed. A compromise has been made in order to not change the
savestate format.
2015-02-09 02:33:47 +01:00
Bobby Smiles
9ecd295e48 Extract fifo_push and fifo_pop functions. 2015-02-08 22:30:16 +01:00
Bobby Smiles
84075792b1 Extract get_dma_duration. 2015-02-08 15:11:34 +01:00
Bobby Smiles
41203bd93e Extract get_remaining_dma_length function. 2015-02-08 15:11:34 +01:00
Bobby Smiles
3acd299642 Move RDRAM size detection hack in a separate module. 2015-02-08 15:04:56 +01:00
Bobby Smiles
f8c0466512 Avoid usage of ConfigGetParamInt in pi_controller. 2015-02-08 15:04:56 +01:00
Nebuleon Fumika
fe6283f849 recomp.c: Delete prefetch_opcode, formerly used by the Pure Interpreter 2015-02-08 07:44:41 +00:00
Nebuleon Fumika
cd682e9e36 reset.c: Delete a comment suggesting a risky micro-optimisation
reset_hard is not called that often, so it is not that important to
save cycles with an optimisation that could, as the comment seemed to
imply, cause a memory leak.
2015-02-08 06:57:32 +00:00
Nebuleon Fumika
a22c424723 recomp.c: Remove Pure Interpreter checks
This commit cleans up checks like the following in recomp.c:

  if (r4300emu != CORE_PURE_INTERPRETER && ...)

which became unreachable after the Pure Interpreter got its own opcode
dispatcher instead of forwarding everything to the Cached Interpreter.
2015-02-08 06:40:45 +00:00
Nebuleon Fumika
851c130832 Decouple the Pure Interpreter from the Cached Interpreter
This commit gives the Pure Interpreter its own opcode dispatcher. It
uses a switch statement to parse major and minor opcodes, then uses an
opcode's fields to kill writes to integer register 0, and gives whole
opcodes to interpreter functions for them to figure out what to do.

MFC0, MTC0, J, JAL, JALR, and the integer memory access instructions,
L* and S*, still used members of the Cached Interpreter's pre-parsed
instruction structure via 'PC->...'. They have been replaced with the
macros in macros.h (irt, rrd...), which the Pure Interpreter now uses
to parse opcode fields.

The new dispatcher decodes one opcode ahead only if the active opcode
is a jump with a delay slot. It also correctly handles killing jumps
that target themselves with a NOP (binary all-zeroes) in their delay
slots.
2015-02-08 03:44:23 +00:00
Bobby Smiles
dc620df2b4 Some minor additional cleaning.
- Just moving stuff
- Removing unused headers
2015-02-07 22:28:50 +01:00
Bobby Smiles
0a52fa7607 Extract rdp_interrupt_event and move it into rdp_core module. 2015-02-07 22:28:50 +01:00
Bobby Smiles
d6de9f5886 Extract rsp_interrupt_event and move it into rsp_core module. 2015-02-07 22:28:50 +01:00
Bobby Smiles
f9308adc19 Extract vi_vertical_interrupt_event and move it into vi_controller module.
- move related variables into vi_controller structure
- move gameshark vi_counter to main module.
2015-02-07 22:28:50 +01:00
Bobby Smiles
fef83c2399 Extract ai_end_of_dma_event and move it into ai_controller module. 2015-02-07 22:28:50 +01:00
Bobby Smiles
ac32b9a50c Extract pi_end_of_dma_event and move it into pi module. 2015-02-07 22:28:50 +01:00
Bobby Smiles
935900a73a Extract si_end_of_dma and move it in si_controller module. 2015-02-07 22:28:50 +01:00
Bobby Smiles
c1ad0d14a9 Avoid usage of get_event for ai_int_handler. 2015-02-07 22:28:50 +01:00
Bobby Smiles
812206fb07 Move special case outside of remove_interupt function. 2015-02-07 22:28:50 +01:00
Bobby Smiles
df6a0b3967 Extract main_check_inputs. 2015-02-07 22:28:50 +01:00
Bobby Smiles
dfa8d099d0 Extract raise_*_interrupt functions. 2015-02-07 22:28:50 +01:00
Bobby Smiles
fce823dd0e Extract *_int_handlers. 2015-02-07 22:28:50 +01:00
Bobby Smiles
0dbbabd382 Extract wrapped_exception_general. 2015-02-07 22:28:50 +01:00
Bobby Smiles
6be21caebc Introduce {signal,clear}_rcp_interrupt functions. 2015-02-07 22:28:50 +01:00
Richard Goedeken
7117fe1081 Merge pull request #67 from gizmo98/testing2
Raspberry Pi fix and ARM NEON/VFP_HARD cleanup
2015-02-07 10:27:12 -08:00
Richard Goedeken
87087083b5 Merge pull request #65 from bsmiles32/si_refactorings
Si refactorings
2015-02-07 09:54:12 -08:00
Richard Goedeken
0e0a397268 fix build errors for OSX build with NEW_DYNAREC=1 2015-02-07 08:43:28 -08:00
Bobby Smiles
561f8e2e0e Rename confusing method name (touch -> save). 2015-02-07 09:21:55 +01:00
Bobby Smiles
c3eda20427 Flush save chip content immediately instead of at file closing.
Due to concerns about possible data loss, saved data should be flushed
as soon as reasonably possible.
2015-02-07 09:21:55 +01:00
Bobby Smiles
07379d8bac Refactor eeprom module to avoid dependency on ROM_SETTINGS. 2015-02-07 09:21:55 +01:00
Bobby Smiles
e5760d85bc Refactor mempak and rumble pak read write functions. 2015-02-07 09:21:55 +01:00
Bobby Smiles
769465443f Move FLA file handling out of PI subsystem.
File accesses are now made only at the beginning/end of emulation.
2015-02-07 09:21:55 +01:00
Bobby Smiles
9f08b7b02b Move SRA file handling out of PI subsystem.
File accesses are now made only at the beginning/end of emulation.
2015-02-07 09:21:55 +01:00
Bobby Smiles
6ac24239a2 Move EEP file handling out of SI subsystem.
File accesses are now made only at the beginning/end of emulation.
2015-02-07 09:21:55 +01:00
Bobby Smiles
55166ef274 Isolate game_controller and rumblepak emulation from input plugin.
This should allow for some flexibility in the choice of the controller
input and rumble output.
For now, we keep the old behavior and use the input plugin, but other
input source and rumble sink could be considered.
We hardcode te connection in the core, but ultimately,
the choice of an external controller/rumble should be the responsibilty
of the frontend.
2015-02-07 09:21:55 +01:00
Bobby Smiles
7a0f0081cc Move MPK file handling out of SI subsystem.
File accesses are now made only at the beginning/end of emulation.
2015-02-07 09:21:55 +01:00
Bobby Smiles
8f7ee083ac Move AF_RTC time source out of SI subsystem.
This should allow for some flexibility in the choice of a time source.
For now, we keep the old behavior and use the C localtime, but other
time source could be considered.
Furthermore, we hardcode the connection in the core, but ultimately,
the choice of an external time source should be the responsibility of
the frontend.
2015-02-07 09:21:55 +01:00
Richard Goedeken
44f1424898 Merge pull request #62 from bsmiles32/cenification_part1
Cenification part1
2015-02-06 22:45:31 -08:00
gizmo98
d38fc7344a linkage_arm.S: Use gcc macros instead of MAKEFILE defines 2015-02-05 21:00:46 +01:00
gizmo98
2c6b05c0f8 linkage_arm.S: Add VFP_HARD compatibility
Otherwise there will be a compiler error if VFP_HARD=1 is set.
2015-02-03 17:36:27 +01:00
littleguy77
465b0c2abf Touchup framelimiter code for readability (no functional changes).
- Consistency in the calculation/recalculation of CurrentFPSTime
  and ThisFrameDelta
- Clearer VITotalDelta increment
- Declare/assign persistent variables in consistent order
2015-01-24 19:13:25 -05:00
Paul Lamb
2434af925e Fix bug in framelimiter implementation.
CurrentFPSTime and ThisFrameDelta must be updated together.

The bug created an audio latency of 1/4 - 1/2 second in mupen64plus-ae.
The core was not slowing down enough to let the audio catch up.
2015-01-24 19:13:14 -05:00
Bobby Smiles
4da27756e9 Introduce PIF_CMD_ constants. 2015-01-24 15:52:45 +01:00
Bobby Smiles
e900d5b765 Extract game_controller and mempak into separate modules. 2015-01-24 15:52:45 +01:00
Bobby Smiles
f2854903c2 Extract eeprom and af_rtc into separate modules. 2015-01-24 15:52:45 +01:00
Bobby Smiles
52fdc3c8d3 Clean memory module - no functional change.
-> Proper header guard
-> Moved read/write functions in order to remoe their prototype
-> Removed various unneeded headers (and reorder others)
2015-01-24 15:52:45 +01:00
Bobby Smiles
09b8fd4810 Move CIC into the PIF module. 2015-01-24 15:52:39 +01:00
Bobby Smiles
400e2ff85d Move PIF RAM into the PIF module. 2015-01-24 15:52:33 +01:00
Bobby Smiles
f76049aa3f Move pif and n64_cic_nus_6105 modules into the SI subsystem. 2015-01-24 15:52:17 +01:00
Bobby Smiles
16f6e4dc71 Move dma_si_{read,write} into the SI module. 2015-01-24 15:52:12 +01:00