Commit Graph

120 Commits

Author SHA1 Message Date
b0efde8bf7 also, update copyright name 2019-01-22 15:58:29 +01:00
669247e8c8 redesign main emu loop to use timestamps instead of being a trainwreck
* cleaner code
* faster in some cases
* more accurate (on-demand compensation for timers and GPU)
* less prone to desyncs
* overall betterer
2019-01-05 05:28:58 +01:00
1e35d18ce6 GX: polygon pipeline doesn't get as far if the polygon is rejected by culling/clipping. 2019-01-03 20:30:30 +01:00
4601636788 GX: always latch rendering engine registers even when not flushing (similar to hardware). 2019-01-03 15:29:25 +01:00
f86fe46035 move the W=0 check, to be sure to check all the vertices 2018-12-20 01:40:32 +01:00
f6e6fa05ea some work on extreme/degenerate shit in GPU
* clip against Z then Y then X. apparently, fixes #310. I had also observed hints that the hardware does it this way.
* truncate W to 24 bits before viewport transform.
* mark any polygons that have a W=0 at that point as degenerate. do not render.
2018-12-20 01:31:31 +01:00
dd30b417b8 implement proper support for POWCNT1.
fixes #260
2018-12-18 17:04:42 +01:00
4a36193cab be sure to always reset NormalPipeline 2018-12-17 02:50:36 +01:00
a34d456fcc GX: timing for command 0x50 is more like 325 cycles on average on hardware. (measured 319/325/331)
fixes #297
2018-12-15 13:33:44 +01:00
12c35093aa set GXSTAT busy flag immediately when writing a command to the GXFIFO.
there was a slim chance that a game could send a couple commands and read GXSTAT.busy as zero immediately after. the new timings made that happen in NSMB (not in the USA ROM, oddly), such that the game was reading the clip matrix while matrix commands were running, and getting the first few values wrong.

fixes #295 and probably others in the same vein.
2018-12-15 05:00:25 +01:00
172fb4876a begin work on general timing renovation. way shitty because it behaves as if caches were off, so everything will be slow as shit. 2018-12-04 17:54:10 +01:00
5b20f40fad oopsies 2018-11-28 02:45:20 +01:00
b1973014d3 add some missing shit to savestates 2018-11-25 22:40:08 +01:00
5f1f2a7b4a fix regression in Marvel Nemesis. keep GX cycle counter from drifting absurdly far in the negatives, and fix a few other issues. 2018-11-25 17:39:43 +01:00
391c8d43b0 drain GX pipelines when there's nothing else running. fixes some weird bugs, apparently. 2018-11-24 04:27:27 +01:00
7b48ce5b75 * fix possible issues with GXFIFO stalling
* rework GPU timings, now almost same as hardware. display lists generally execute faster. not finished. not bad for a start tho.
* Rayman RR2 is still getting sound streaming issues. I don't think GXFIFO stalls are supposed to halt the ARM7. that doesn't make sense and would mess badly with sound since it's also using the ARM7 bus.
2018-11-24 02:29:25 +01:00
a9e7f8bc5b add proper support for GXFIFO stalls.
bad games that blast the GXFIFO and overflow it:
* Super Mario 64 DS
* Rayman RR2

latter seems to get its music streaming crapoed.
2018-11-23 22:21:41 +01:00
fa4fa164cb * store all 32 matrix stack entries in savestates instead of 31.
* bump savestate version up. will break compatibility, but the alternative would be guessing the missing matrix entries somehow, so blarg.
* avoid relocating the savefile if loading a savestate fails.
2018-11-05 16:14:48 +01:00
9b32418367 3D: fix0r matrix stack handling when stack pointers overflow (it fucking wraps around).
fixes #231 and probably others of the same vein.
2018-11-05 16:05:16 +01:00
f60ac42466 pass savefile name to NDS::LoadROM() instead of having the core generate it. 2018-10-23 21:52:41 +02:00
a4a9bca5f0 fix more shit 2018-10-23 20:40:57 +02:00
98076f2334 hopefully fix all 3D-related crashes when loading savestates 2018-10-23 20:20:38 +02:00
d191af8690 rewrite how structures are stored to savestates (store individual fields, to avoid compatibility issues)
also fixes stability issues when 3D is involved. turns out we were storing raw pointers to vertices. figures

more crapo code to get around that, but atleast it works without asploding now.
2018-10-21 03:16:41 +02:00
a2cc7087f7 GPU done 2018-10-18 02:31:01 +02:00
fea7955675 fixor copyright years. 2018-09-15 02:32:13 +02:00
5bea3cc530 3D: add support for 8bit accesses to GXSTAT (Golden Sun - Dark Dawn) 2017-11-04 15:13:01 +01:00
5b71ffceee minor fix 2017-10-04 02:47:49 +02:00
2e23ae54b2 3D:
* more accurate polygon edges (still not perfect. heh)
* antialiasing (doesn't always work)
2017-08-28 18:37:07 +02:00
d656e6e7ff 3D: faster and more accurate interpolation 2017-08-17 23:34:37 +02:00
4a899ebe3f 3D: fix culling. fixes #86. watch out for any missing polygons elsewhere. 2017-07-24 01:06:08 +02:00
0df3a29374 * FPS counter displays target framerate
* fix potential hang and out-of-bounds drawing when VCount is modified during drawing
2017-07-21 10:19:56 +02:00
d978603852 3D: fix Z calculation in Z-buffering mode (should use original W, not normalized one). fixes horrendous Z-fighting in Pokémon games. 2017-07-14 18:35:34 +02:00
cd6ecfc21f apply the interpolation fix to Z interpolation.
more accurate conversion of Z values.

but this doesn't fix the horrendous Z-fighting in Pokémon B/W because of course it doesn't >_<
2017-07-14 04:49:29 +02:00
a1401e724c * actually fix linear interpolation when y0>y1
* change the backfacing attribute bit, so that it doesn't mess with edgemarking
2017-07-13 23:09:42 +02:00
8f031f698b normalize W values in both directions (0123-0157 -> 1230-1570) 2017-07-06 18:54:51 +02:00
3aa83ae641 3D:
* undo 'winding sorting' hypothesis
* special depth test rules: 'less than' function becomes 'less or equal' when rendering front-facing polygon pixels against back-facing opaque pixels
2017-07-06 18:38:13 +02:00
dc32613028 3D: opaque polygons are sorted by winding order
the Sands of Destruction character menu relies on this, it mixes and matches polygon windings to thwart Y-sorting
2017-07-06 02:02:30 +02:00
d5376b4184 3D: Y-sorting 2017-07-05 18:38:10 +02:00
01404ac6c3 3D: move opaque/translucent sorting to GPU3D.cpp 2017-07-05 18:11:00 +02:00
1acf355d99 3D: change viewport handling to match hardware. finally fixes #18 2017-07-04 19:11:43 +02:00
ad58a68fc9 3D: fix boxtest coord overflow. fixes #57 2017-06-29 09:48:41 +02:00
da10f9b3f6 fix rendering for crapoed 'butterfly' polygons 2017-06-28 21:19:44 +02:00
f113f2f26e 3D: fix missing term in MatrixTranslate(). fixes Monster Trucks billboards. 2017-06-27 20:52:38 +02:00
155609b6d9 initialize clearZ to 0x7FFF. fixes #38 2017-06-26 01:18:54 +02:00
64a447bb7c clean up some shit. make framebuffer access less weird. 2017-06-03 22:10:32 +02:00
ae78faf2a7 rework slope/edge code. lay groundwork for antialiasing. 2017-05-28 18:36:42 +02:00
6f4d835c7f fog 2017-05-26 15:14:22 +02:00
a63ab24447 fix crapoed shadows 2017-05-26 04:00:15 +02:00
4b3caedbe7 first attempt at threading the 3D renderer 2017-05-23 23:38:28 +02:00
9fe24cb1e7 latch 3D registers upon VBlank
(fixes the last bugs in Gericom's train game)
2017-05-09 22:22:52 +02:00