Commit Graph

100 Commits

Author SHA1 Message Date
a046eb5038 separate GPU2D registers and renderer 2021-02-27 22:25:42 +01:00
6256a42e00 improve and fix NonStupidBitfield also get rid of some UB
fixes optimised lto clang build
2021-02-09 19:24:57 +01:00
8530c099bc GPU: make sure to always pass BG0HOFS to the 3D engine, even if the 2D engine is disabled. 2020-12-10 19:34:31 +01:00
66cec85a9a GPU: forward BG0HOFS to internal rendering engine register for 3D layer scroll (only when the rendering engine is enabled).
fixes #840

thank you RSDuck and Hydr8gon for your insight into this.
2020-12-10 19:12:08 +01:00
e34ce013df only start display capture on first line
fixes Spearpillar in Pokemon D/P/Pt
also fixes #782 and #474
2020-12-09 22:45:16 +01:00
b80d5a04f3 lay base for multiple GPU2D backends 2020-12-06 17:40:16 +01:00
40899940b5 fix #838 2020-12-05 12:25:49 +01:00
906521e7e9 fix 4-bit affine sprites 2020-12-03 14:52:36 +01:00
6e8bac3909 Merge vram dirty tracking
Squashed commit of the following:

commit b463a05d4b909372f0cd1ad91caa0c77a25e5901
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Mon Nov 30 01:55:35 2020 +0100

    minor fix

commit ce73cebbdf5da243d7ebade82d8799ded9cd6b28
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Mon Nov 30 00:43:08 2020 +0100

    fix dirty flags of BG/OBJ mappings not being reset

commit fc5d73a6178e3adc444398bdd23de8314b5ca8f8
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Mon Nov 30 00:11:13 2020 +0100

    use flat vram for gpu2d everywhere

commit 34ee9fe2bf04fcfa2a5a1c8d78d70007e606f1a2
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Sat Nov 28 19:10:34 2020 +0100

    mark VRAM dirty for display capture

commit e8778fa2f429c6df0eece19d6a5ee83ae23a0cf4
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Sat Nov 28 18:59:31 2020 +0100

    use flat VRAM for textures and texpals
    also skip rendering if nothing changed and a bunch of fixes

commit 53f2041e2e1a28b35702a2ed51de885c36689f71
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Fri Nov 27 18:29:56 2020 +0100

    use vram dirty tracking for extpals
    also preparations to take this further

commit 4cdfa329e95aed26d3b21319c8fd86a04abf20f7
Author: RSDuck <rsduck@users.noreply.github.com>
Date:   Mon Nov 16 23:32:22 2020 +0100

    VRAM dirty tracking
2020-11-30 19:49:18 +01:00
690eed9e26 GPU2D: don't an indirect call in tight loops 2020-11-16 18:33:58 +01:00
6977302403 make OpenGL renderer a build option
mostly meant for the Switch port
2020-10-01 00:01:05 +02:00
a88df19708 avoid out-of-bounds read in GPU2D. fixes #763 2020-09-18 00:29:08 +02:00
9772201345 remove some UB
- savestates used to read a four bytes from a single byte value
- a few unassigned variables
- some other things
- also make the ROR macro an inline function
2020-09-04 20:37:14 +02:00
6f4e7c60b2 GPU2D: allow writes to DISPCNT, master brightness, capture, dispFIFO regardless of POWCNT.
fixes #665
2020-08-19 00:46:16 +02:00
0804ab3c78 * rework GPU's settings interface, make it config-agnostic
* make video settings dialog functional, sorta
* fix dialogs that were resizable
2020-05-28 15:53:32 +02:00
36f4cdbbbf get the OpenGL renderer going.
sorta.

(also make the blackmagic_II branch obsolete in the process)
2020-05-25 18:25:50 +02:00
83f8e11bc1 update copyright years 2020-02-14 20:18:08 +01:00
b641ccaf35 fix remaining sprite y-coord bugs. fixes #531 2019-11-03 04:53:11 +01:00
3561e93bf6 fix sprite y-flip
also, meaningless shenanigans
2019-11-03 04:32:47 +01:00
58c2790ea3 uuuh we should only do it once per scanline 2019-09-15 02:08:47 +02:00
e418b353e8 well, here, OBJ X mosaic is done too 2019-09-15 02:01:22 +02:00
cb90475b60 begin work on mosaic
OBJ Y mosaic emulated correctly, there's atleast that.
2019-09-15 01:31:09 +02:00
1aaf0c33ce guess who the idiot is who broke sprite extpal 2019-09-05 11:49:22 +02:00
0010e296bd GPU2D: delay palette lookup for sprites 2019-09-05 11:42:08 +02:00
5b51034436 zerp 2019-09-01 18:38:01 +02:00
f01016a30b GPU2D: shape3 sprites are always 8x8 2019-09-01 18:35:33 +02:00
78ff4165ed GPU2D:
* implement reserved mode for bitmap sprites (not too interesting)
* mask out DISPCNT bits that don't apply to the sub GPU
2019-07-24 04:29:19 +02:00
a8886d5949 GPU2D: add 'prohibited' large BG sizes 2019-07-24 03:30:09 +02:00
3c006fd361 GPU2D: fill gaps in BG modes
* mode6 actually works on the sub GPU, albeit limited to 1/4 the full bitmap size due to having only 128K of VRAM
* mode7 draws BG0, BG1 and sprites. no BG2/BG3.
2019-07-24 02:46:30 +02:00
c1fa5d8283 GPU2D: forced-blank only disables BG/OBJ compositing (VRAM/FIFO display, capture, master brightness still run)
fixes #491
2019-07-24 00:27:08 +02:00
22f3cae067 fix potential out-of-bounds write 2019-07-13 02:54:14 +02:00
49b2f8d969 raise kMaxIterationCycles to 64 2019-06-25 02:05:48 +02:00
d28035674a GPU2D: hardware renders sprites one scanline in advance.
fixes #375 (midframe OAM update)
2019-06-10 03:05:26 +02:00
bc53ff35a9 this is the same thing, but, for the sake of consistency 2019-06-08 12:39:52 +02:00
6de19645f8 fix potential crash when running the software renderer (oops) 2019-06-02 14:57:59 +02:00
78208a9728 OpenGL: fix cases of layers/sprites blending over the 3D layer 2019-06-01 03:39:35 +02:00
70a3243714 simpler GPU-compositing. will make it easier to grab neighbor 2D/3D pixels individually for filtering. 2019-05-25 19:36:47 +02:00
db396e992b welp.
progress
2019-05-21 22:28:46 +02:00
b493c24128 remove reference to GL version 4.3 from filenames and namespaces 2019-05-20 00:05:37 +02:00
cd8236303e begin botching the code
BAHAHAHAAAA
2019-05-19 19:37:13 +02:00
f5a7cb71fd also, do master brightness 2019-05-18 01:42:50 +02:00
a752b1d7c2 woops 2019-05-18 01:32:31 +02:00
f1a970ec30 actually finish display capture in hardware-accel mode 2019-05-18 01:21:46 +02:00
de287825ee start work on display capture
also fix a bug in the compositing shader
2019-05-17 22:50:41 +02:00
c1746f0c60 BAHAHAHHHH
HARK HARK HARK
2019-05-16 20:58:07 +02:00
c81bcccadc BAHAHAHAHAHAHAHAA 2019-05-16 16:27:45 +02:00
02b4919005 resolution switch somewhat functional 2019-05-12 17:43:39 +02:00
a32c5c99bb finish de-hardcoding it. also, code 4x variant (not that I guarantee it to be fast, but hey, it's here) 2019-05-12 15:58:12 +02:00
2a0bc4e700 make GPU2D somewhat more flexible. change LineScale to be log2. 2019-05-12 15:45:58 +02:00
858c0eecb9 scale screen gap
also moar optimization...
2019-05-11 01:46:38 +02:00