Commit graph

1733 commits

Author SHA1 Message Date
Paul Holden
a3df6cbe3d Simplify kEventRunForCycles handling in speedHack. 2023-09-23 22:17:56 +01:00
Paul Holden
d33f89d389 Tidy 2023-09-23 22:17:56 +01:00
Paul Holden
eb2c01ff0c Use for/of. 2023-09-23 22:17:56 +01:00
Paul Holden
d824732399 Add an option for whether to run audio task processing. 2023-09-23 22:17:56 +01:00
Paul Holden
77223a67dd Implement Audio.
This doesn't do much unless M_AUDTASK is set to be unhandled in hleProcessRSPTask.
2023-09-23 22:17:56 +01:00
Paul Holden
c25825844c Remove bounds checks for get/setVec. 2023-09-23 22:17:56 +01:00
Paul Holden
43dff97c94 Optimise RSP to remove some BigInt conversions. 2023-09-23 22:17:56 +01:00
Paul Holden
c58d2759d7 Don't run speedHack when the RSP is running. 2023-09-23 22:17:56 +01:00
Paul Holden
8fb5f05a00 Fix COUNT so that it increments once every 2 instructions. 2023-09-23 22:17:56 +01:00
Paul Holden
83a47be410 Fix reference to undefined var. 2023-09-23 22:17:56 +01:00
Paul Holden
8b7ceef4c4 Rename getCount to getOpsExecuted. 2023-09-23 22:17:56 +01:00
Paul Holden
6d26400a4a Add accessors for accumulator low/mid/high which avoid BigInt conversions. 2023-09-23 22:17:56 +01:00
Paul Holden
102654dc36 Reduce nesting in speedHack. 2023-09-23 22:17:56 +01:00
Paul Holden
00ef9922c6 Remove wrappers around executeX functions.
The extra level of indirection is showing up in the profiler.
2023-09-23 22:17:56 +01:00
Paul Holden
de630a24f3 Fix lint warnings. 2023-09-23 22:17:56 +01:00
Paul Holden
3e643de36d Add a getCyclesUntilEvent helper and fix getVblCount.
This wasn't working correclty as the countdown value is relative to the previous event.
2023-09-23 22:17:56 +01:00
Paul Holden
454ed067eb Refactor setGLBlendMode. 2023-09-23 22:17:56 +01:00
Paul Holden
e0abf51547 Debug color images. 2023-09-23 22:17:56 +01:00
Paul Holden
f001721d64 Fix lint errors. 2023-09-23 22:17:56 +01:00
Paul Holden
49b6122b92 Add eslint config. 2023-09-23 22:17:56 +01:00
Paul Holden
96bc2cc071 Fix lint errors. 2023-09-23 22:17:56 +01:00
Paul Holden
a6cd10c121 Improve accuracy of SP DMAs.
* Add double buffering
* Correctly set the full and busy registers/bits
* Register latching
2023-09-23 22:17:56 +01:00
Paul Holden
58db855730 Improve accuracy of PI DMA emulation.
* Set BUSY bit during transfer.
* Set ERROR bit if registers modified during transfer.
* Trigger interrupt after a delay based on transfer length.
* Cancel any interrupts if RESET bit written.
2023-09-23 22:17:56 +01:00
Paul Holden
2e658c4997 Make the SystemEvent type a string so it doesn't need to be maintained centrally, and move VI interrupt stuff to vi.js. 2023-09-23 22:17:56 +01:00
Paul Holden
c824e9a92b Add handler function to SystemEvent. 2023-09-23 22:17:56 +01:00
Paul Holden
25596179a0 Improve cpu status table. 2023-09-23 22:17:56 +01:00
Paul Holden
db6dd1bf54 Show single value for VCC/VCO. 2023-09-23 22:17:56 +01:00
Paul Holden
8dd30f5b1a Fix toHex when bits >= 32. 2023-09-23 22:17:56 +01:00
Paul Holden
7b13da432d Tidy 2023-09-23 22:17:56 +01:00
Paul Holden
b731221b25 Add some TODOs. 2023-09-23 22:17:56 +01:00
Paul Holden
4375413975 Add some todos. 2023-09-23 22:17:56 +01:00
Paul Holden
842e797b7f Add a tab for RSP task state. 2023-09-23 22:17:56 +01:00
Paul Holden
ad5093af7c Rename toString64_bigint to toString64. 2023-09-23 22:17:56 +01:00
Paul Holden
b0b7673400 Replace uses of toString64 with toString64_bigint. 2023-09-23 22:17:56 +01:00
Paul Holden
3dcd94a531 Apply masking in toHex. 2023-09-23 22:17:56 +01:00
Paul Holden
1e9b7a643e Fix toString64_bigint formatting (wasn't padding with zeros) and resolve toStringN TODO. 2023-09-23 22:17:56 +01:00
Paul Holden
5478fe11c4 Add VCO, VCC, VCE. 2023-09-23 22:17:56 +01:00
Paul Holden
2a7eba8333 Show RSP registers. 2023-09-23 22:17:56 +01:00
Paul Holden
d7956ab645 Hoist opsExecuted out as a local var. 2023-09-23 22:17:56 +01:00
Paul Holden
a69fccf182 Flesh out disassembly for the RSP debugger. 2023-09-23 22:17:56 +01:00
Paul Holden
25cac85239 Make imem wrap when disassembling.
This is parimarily for the debugger which disassembles a range around the PC.
2023-09-23 22:17:56 +01:00
Paul Holden
1c1bd078b3 Refactor makeRecentMemoryAccesses to use a helper function to resolve the memory access. 2023-09-23 22:17:56 +01:00
Paul Holden
69caeebc13 Wrap up lastPC in CPUDebugState. 2023-09-23 22:17:56 +01:00
Paul Holden
5dab0f74eb Fix rollup config for rollup v3. 2023-09-23 22:17:56 +01:00
Paul Holden
9347292a32 Add disassembleRange helper to CPUDebugState. 2023-09-23 22:17:56 +01:00
Paul Holden
048388a157 Start wrapping cpu debugger state in a class. 2023-09-23 22:17:56 +01:00
Paul Holden
587bb80c95 Stub out RSP tab. 2023-09-23 22:17:56 +01:00
Paul Holden
6e73ac92ec Keep n64js.cpu0 in a local. 2023-09-23 22:17:56 +01:00
Paul Holden
06558a6e82 Rename updateDebug to updateCPU. 2023-09-23 22:17:56 +01:00
Paul Holden
f86970fb9d Rename Debug tab to CPU. 2023-09-23 22:17:56 +01:00