Commit graph

1886 commits

Author SHA1 Message Date
Paul Holden
22557412d8 Don't rendering anythign if the mode isn't set. 2023-07-04 23:04:48 +01:00
Paul Holden
c87b9f850e Move computeDimensions to vi.js. 2023-07-04 23:00:54 +01:00
Paul Holden
a4a1a76226 Remove vi prefix. 2023-07-04 22:56:27 +01:00
Paul Holden
6a3e14e0eb Use accessors for registers. 2023-07-04 22:50:33 +01:00
Paul Holden
7cb2b2b121 Tidy VI register names. 2023-07-04 22:43:10 +01:00
Paul Holden
86a71b34a5 Improve microcode detection. 2023-07-04 21:18:36 +01:00
Paul Holden
0c394f2c77 Disable noisy mempack logging. 2023-07-04 20:02:30 +01:00
Paul Holden
14b546f82d Improve boot constants.
This is based on https://github.com/PeterLemon/N64/tree/master/CPUTest/CP0/COP0Register.
2023-07-04 20:00:35 +01:00
Paul Holden
acc1772404 Don't render anything if the origin is not set. 2023-07-04 19:58:01 +01:00
Paul Holden
620b8da57f Fix y-res scaling hack.
I'm not 100% sure about this but it seems more likely to be based on whether the screen is interlaced than the screen width.
2023-07-04 19:57:13 +01:00
Paul Holden
01e6bd8734 Add a dump() helper. 2023-07-04 19:49:35 +01:00
Paul Holden
db19528564 Remove the y scaling hack. 2023-07-04 19:48:26 +01:00
Paul Holden
d6f27bbec1 Fix SM64 (E). 2023-07-04 00:10:02 +01:00
Paul Holden
f7014c4b02 Tidy vi width/height calculation and use for raw framebuffer code.
There are still a number of TODOs, like figuring out why the hacky 240/237 constant is needed.
2023-07-04 00:00:47 +01:00
Paul Holden
d34469db3d Tidy setViScales a little. 2023-07-03 22:41:06 +01:00
Paul Holden
0f2ae9be13 Calc viHeight using constant of 80/79 and truncate to int. 2023-07-03 22:40:00 +01:00
Paul Holden
05020bf891 Clear the CAUSE_IP3 bit when the MI interrupt mask is cleared.
This gets https://github.com/PeterLemon/N64/blob/master/CPUTest/Exceptions/VIIntr/ExceptionVIIntrDisabled.asm passing.
2023-07-03 22:14:56 +01:00
Paul Holden
0b49203bfc Call presentBackBuffer on every vertical blank.
Suppress the 2d rendering as soon as the first display list is rendered.
2023-07-02 22:47:47 +01:00
Paul Holden
10f072f796 Make presentBackBuffer work with 32bit framebuffers. 2023-07-02 22:29:37 +01:00
Paul Holden
356f0a9004 Overhaul VI interrupts.
* Increment CURRENT based on number of executed instructions
* Set interrupt based on cart country / tv type
* Handle interlaced modes

This fixes a bunch of roms (boot issues and timing issues).
2023-07-02 20:53:11 +01:00
Paul Holden
6922cf0bd6 Init rominfo earlier so devices can reference it. 2023-07-02 19:31:55 +01:00
Paul Holden
fbdc75dd88 Fix copyToRDRAM (assigning to const variable). 2023-07-02 19:31:17 +01:00
Paul Holden
bba874c354 Store tv type in rominfo. 2023-07-02 12:34:16 +01:00
Paul Holden
4e524cf21e vI changes break Wetrix. 2023-07-01 21:49:46 +01:00
Paul Holden
3371e95cac Convert load_s64_as_double to use BigInt. 2023-07-01 21:48:52 +01:00
Paul Holden
fc8ffb401c Fix store_float_as_long. 2023-07-01 21:46:03 +01:00
Paul Holden
f41f4fe0e1 Add a TODO for VI_CURRENT_REG. 2023-07-01 21:37:06 +01:00
Paul Holden
49a4a3559c Rewrite store_float_as_long using BigInt. 2023-06-30 20:53:51 +01:00
Paul Holden
b83616dabf k1Shift32 is unused. 2023-06-30 20:38:19 +01:00
Paul Holden
e9242acc5c Rewrite DADD/DSUB etc using BigInt. 2023-06-30 20:30:30 +01:00
Paul Holden
35b498241a Remove getGPR_u64 (now unused) 2023-06-30 18:36:30 +01:00
Paul Holden
c6da98abd0 Fix DIV and DIVU with negative numbers.
Math.floor does the wrong thing (should round to zero). `>> 0` has the correct behaviour.
2023-06-30 18:34:17 +01:00
Paul Holden
c4f105446d Rewrite DDIV and DDIVU to use BigInt.
This is probably slower than doing 64+32 bit paths, but it's not a common operator and on modern computers should be negligible. It's also much more likely to be correct.
2023-06-30 17:37:18 +01:00
Paul Holden
99c99bf84a Remove getHi32 as it's no longer used. 2023-06-30 16:24:26 +01:00
Paul Holden
0d65fd5b2e Use warn() rather than halt() for "Invalid Operation".
Doesn't seem to be needed: 07303fb263/Source/Core/R4300.cpp (L94).
2023-06-30 16:23:15 +01:00
Paul Holden
db0394b93f Tidy 2023-06-30 16:22:10 +01:00
Paul Holden
7bff96d4ab Fix precision errors in multiplication instructions.
For large 32 bit values this can overflow precision of a Number.

This fixes Mario getting stuck on the stairs in the castle.
2023-06-30 16:21:51 +01:00
Paul Holden
3fe82fd50c Use bool constants. 2023-06-29 09:03:08 +01:00
Paul Holden
c57de45765 Fix logging when before initialise.
Echo everything to console.log.
2023-06-29 09:02:54 +01:00
Paul Holden
c3f00a4852 Fix pageMaskName arg name. 2023-06-29 09:00:55 +01:00
Paul Holden
64ba9d7fdf Fix kDebugDynarec - assert to dynarec. 2023-06-29 08:55:45 +01:00
Paul Holden
94d8564492 Use template literals for codegen. 2023-06-29 00:05:46 +01:00
Paul Holden
80503ef347 Handle empty code blocks (e.g. NOP). 2023-06-28 23:12:05 +01:00
Paul Holden
3141962381 Dedent the code first, to allow template literals to be formatted better. 2023-06-28 23:02:35 +01:00
Paul Holden
30c008d2fa Add the disassembly as a comment before each instruction.
Wrap each block in parens so temporaries can be scoped.
2023-06-28 08:05:26 +01:00
Paul Holden
9082e9cf7e Template strings. 2023-06-27 23:16:33 +01:00
Paul Holden
4f68691d07 var -> {const,let} 2023-06-27 23:10:13 +01:00
Paul Holden
ca67b5f47a camelCase vars. 2023-06-27 22:42:17 +01:00
Paul Holden
b72cbd02cc Rename to FragmentMap. 2023-06-27 22:40:06 +01:00
Paul Holden
f9ac190286 Use for..of and Map for FragmentMapWho entries. 2023-06-27 22:38:14 +01:00