Commit Graph

65 Commits

Author SHA1 Message Date
StapleButter 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
StapleButter dd30b417b8 implement proper support for POWCNT1.
fixes #260
2018-12-18 17:04:42 +01:00
StapleButter 4a36193cab be sure to always reset NormalPipeline 2018-12-17 02:50:36 +01:00
StapleButter 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
StapleButter 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
StapleButter 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
StapleButter 5b20f40fad oopsies 2018-11-28 02:45:20 +01:00
StapleButter b1973014d3 add some missing shit to savestates 2018-11-25 22:40:08 +01:00
StapleButter 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
StapleButter 391c8d43b0 drain GX pipelines when there's nothing else running. fixes some weird bugs, apparently. 2018-11-24 04:27:27 +01:00
StapleButter 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
StapleButter 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
StapleButter 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
StapleButter 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
StapleButter f60ac42466 pass savefile name to NDS::LoadROM() instead of having the core generate it. 2018-10-23 21:52:41 +02:00
StapleButter a4a9bca5f0 fix more shit 2018-10-23 20:40:57 +02:00
StapleButter 98076f2334 hopefully fix all 3D-related crashes when loading savestates 2018-10-23 20:20:38 +02:00
StapleButter 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
StapleButter a2cc7087f7 GPU done 2018-10-18 02:31:01 +02:00
StapleButter fea7955675 fixor copyright years. 2018-09-15 02:32:13 +02:00
StapleButter 5bea3cc530 3D: add support for 8bit accesses to GXSTAT (Golden Sun - Dark Dawn) 2017-11-04 15:13:01 +01:00
StapleButter 5b71ffceee minor fix 2017-10-04 02:47:49 +02:00
StapleButter 2e23ae54b2 3D:
* more accurate polygon edges (still not perfect. heh)
* antialiasing (doesn't always work)
2017-08-28 18:37:07 +02:00
StapleButter d656e6e7ff 3D: faster and more accurate interpolation 2017-08-17 23:34:37 +02:00
StapleButter 4a899ebe3f 3D: fix culling. fixes #86. watch out for any missing polygons elsewhere. 2017-07-24 01:06:08 +02:00
StapleButter 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
StapleButter 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
StapleButter 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
StapleButter 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
StapleButter 8f031f698b normalize W values in both directions (0123-0157 -> 1230-1570) 2017-07-06 18:54:51 +02:00
StapleButter 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
StapleButter 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
StapleButter d5376b4184 3D: Y-sorting 2017-07-05 18:38:10 +02:00
StapleButter 01404ac6c3 3D: move opaque/translucent sorting to GPU3D.cpp 2017-07-05 18:11:00 +02:00
StapleButter 1acf355d99 3D: change viewport handling to match hardware. finally fixes #18 2017-07-04 19:11:43 +02:00
StapleButter ad58a68fc9 3D: fix boxtest coord overflow. fixes #57 2017-06-29 09:48:41 +02:00
StapleButter da10f9b3f6 fix rendering for crapoed 'butterfly' polygons 2017-06-28 21:19:44 +02:00
StapleButter f113f2f26e 3D: fix missing term in MatrixTranslate(). fixes Monster Trucks billboards. 2017-06-27 20:52:38 +02:00
StapleButter 155609b6d9 initialize clearZ to 0x7FFF. fixes #38 2017-06-26 01:18:54 +02:00
StapleButter 64a447bb7c clean up some shit. make framebuffer access less weird. 2017-06-03 22:10:32 +02:00
StapleButter ae78faf2a7 rework slope/edge code. lay groundwork for antialiasing. 2017-05-28 18:36:42 +02:00
StapleButter 6f4d835c7f fog 2017-05-26 15:14:22 +02:00
StapleButter a63ab24447 fix crapoed shadows 2017-05-26 04:00:15 +02:00
StapleButter 4b3caedbe7 first attempt at threading the 3D renderer 2017-05-23 23:38:28 +02:00
StapleButter 9fe24cb1e7 latch 3D registers upon VBlank
(fixes the last bugs in Gericom's train game)
2017-05-09 22:22:52 +02:00
StapleButter 50d2ffb207 misc. things 2017-05-09 03:54:37 +02:00
StapleButter 7c1443b973 fix lighting behavior with normals that overflow 2017-05-03 23:54:31 +02:00
StapleButter 9e622dcc66 3D: attempt at fixing culling. players in Madden are no longer full of holes, and that also fixes occasional missing polygons in RaymanDS, and probably others. 2017-05-03 01:21:39 +02:00
StapleButter da31af9202 fix Z-buffering. not really clean, and not perfectly accurate. 2017-04-29 00:20:04 +02:00
StapleButter 2273bd2ea4 fix texcoord-from-vertex mode. it works like for normals (1.0 = 1/16 texel) 2017-04-28 17:35:57 +02:00