Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
50763df
hey look Arisotura wants to code more fun shit
Arisotura Nov 7, 2025
b77e20b
start botching the code.
Arisotura Nov 9, 2025
6322e97
add POWCNT screen swap
Arisotura Nov 9, 2025
83b5c67
get started.
Arisotura Nov 11, 2025
7e33a29
move "screen swap" state to GPU2D (instead of being in the renderer)
Arisotura Nov 11, 2025
60efbac
move compositor shito to GPU2D_OpenGL. get rid of the GPU_OpenGL wart.
Arisotura Nov 11, 2025
38ba57f
start reworking the compositor
Arisotura Nov 12, 2025
565cf4f
add master brightness
Arisotura Nov 12, 2025
efd4052
remove junk
Arisotura Nov 12, 2025
faaec4e
fixes to blending. add in 3D layer.
Arisotura Nov 12, 2025
3fe8772
add v0.0000001 of apparatus to keep capture VRAM banks in sync
Arisotura Nov 14, 2025
a05f14e
commit current work. first attempt at filling in hi-res capture layers.
Arisotura Nov 16, 2025
9c85469
add support for VRAM and mainmem FIFO
Arisotura Nov 16, 2025
4ad7875
fix possible positioning issue with hires-capture-sprites
Arisotura Nov 16, 2025
5c55ed1
make VRAM capture block tracking more efficient
Arisotura Nov 21, 2025
643ce4f
the code was broken but a way where it accidentally worked. so let's …
Arisotura Nov 21, 2025
93689bf
add secret green bit (bit15), as well as notes about where it applies
Arisotura Nov 21, 2025
1ee5bb2
change granularity of VRAMCBF to 16K to match the rest of the VRAM tr…
Arisotura Nov 22, 2025
563cfea
temp. crap
Arisotura Nov 24, 2025
a21e698
add test code (to pre-render BG layers)
Arisotura Nov 27, 2025
eb1eabf
add remaining BG types
Arisotura Nov 27, 2025
04d8de2
add build system for embedding .glsl files into .h files, to make sha…
Arisotura Nov 28, 2025
e4f7ced
remove debug message
Arisotura Nov 28, 2025
599e2bb
pre-render sprites (test)
Arisotura Nov 30, 2025
a4f0683
blarg
Arisotura Nov 30, 2025
8637496
more pre-rendering/rendering work
Arisotura Dec 3, 2025
3811690
BG: add rotscale coords and wraparound
Arisotura Dec 3, 2025
dbd7eba
fix possible bug when BLDCNT is set to blending and backdrop is selec…
Arisotura Dec 4, 2025
80cff64
oh god oh god oh god
Arisotura Dec 5, 2025
f40771f
remove a whole pile of cruft
Arisotura Dec 5, 2025
4df4e85
add in 3D layer
Arisotura Dec 5, 2025
f636516
first attempt at rendering the sprite layer
Arisotura Dec 5, 2025
75e45bc
add color effects
Arisotura Dec 5, 2025
7c8565d
fix dumb shit
Arisotura Dec 5, 2025
145bff0
redo the final pass
Arisotura Dec 5, 2025
ffabbc4
fix MKDS player select sprites
Arisotura Dec 5, 2025
af97ef9
fix SM64DS backdrop
Arisotura Dec 5, 2025
005b68e
add windows
Arisotura Dec 6, 2025
fbac0dc
proof of concept: midframe OAM changes
Arisotura Dec 7, 2025
9506092
work on display capture
Arisotura Dec 7, 2025
6ba6984
proof of concept code for syncing captures back to emulated VRAM
Arisotura Dec 7, 2025
765679b
add support for hi-res layers/sprites (ie. dual-screen 3D)
Arisotura Dec 7, 2025
97034bf
fix VRAM tracking
Arisotura Dec 8, 2025
25025d0
add code path for syncing a 128x128 capture
Arisotura Dec 8, 2025
c9ec01c
forgot that
Arisotura Dec 8, 2025
1b52ca0
fix fog color in regular GL renderer
Arisotura Dec 8, 2025
52814fb
document what the fuck is going on with the stencil buffer in the reg…
Arisotura Dec 13, 2025
d3e5ab9
proof of concept: add hi-res capture support to compute renderer
Arisotura Dec 13, 2025
c611265
add VRAM display
Arisotura Dec 13, 2025
da93f4b
refine VRAM display a bit
Arisotura Dec 14, 2025
22c2165
fix bias for capture blending
Arisotura Dec 14, 2025
a0c086d
actually I'm not so sure
Arisotura Dec 14, 2025
2c22979
compute renderer: add support for clear bitmap
Arisotura Dec 14, 2025
86191a8
blarg
Arisotura Dec 14, 2025
76f76db
initializing the shit correctly might help
Arisotura Dec 14, 2025
825288c
fix clear bitmap repeat
Arisotura Dec 15, 2025
1a70437
rename it to just "Renderer" since it also does 2D now
Arisotura Dec 15, 2025
15f66d3
OpenGL: move 3D shaders to proper files (structure might still change…
Arisotura Dec 16, 2025
853ef23
backport texture cache to old GL renderer
Arisotura Dec 20, 2025
0e7ccd1
add support for hi-res capture textures
Arisotura Dec 20, 2025
a1e0553
add clear bitmap, too
Arisotura Dec 20, 2025
d4f3b80
fix polygons with no texture
Arisotura Dec 20, 2025
f9f26ee
remove old cruft (pixel buffers and shit)
Arisotura Dec 20, 2025
605ed1a
fix software renderer output under OpenGL display (also make the shit…
Arisotura Dec 20, 2025
e9f6b18
avoid using glTexStorage() in the non-compute renderer
Arisotura Dec 25, 2025
9aaecc3
begin reworking renderer to something actually proper
Arisotura Jan 1, 2026
428eaa2
* sample BG textures directly in compositor shader, w/ hardware repeat
Arisotura Jan 2, 2026
43e6b8b
add sprites back
Arisotura Jan 2, 2026
39de857
make display capture shit work again, and make it more sensible
Arisotura Jan 3, 2026
a9f548e
remove LayerShader
Arisotura Jan 3, 2026
182514b
blarg
Arisotura Jan 3, 2026
13a8918
* add partial VRAM upload
Arisotura Jan 3, 2026
a82e80e
fix bug with dirty tracking for direct color BGs
Arisotura Jan 3, 2026
2595da8
remove a bunch of old junk
Arisotura Jan 3, 2026
3b25dde
properly clean up resources (mostly)
Arisotura Jan 3, 2026
48327bc
fix bugs (mosaic counters, and rotscale reference points, get updated…
Arisotura Jan 4, 2026
f2619f2
VCount register is 9 bits wide
Arisotura Jan 4, 2026
035aa27
add comments
Arisotura Jan 4, 2026
df2836d
lay base for renderer shito refactor...
Arisotura Jan 6, 2026
2a33ab5
more shit (temp., broken, bad)
Arisotura Jan 9, 2026
4ec8a35
more shit
Arisotura Jan 10, 2026
d463585
some code unsucking
Arisotura Jan 10, 2026
d9c2dc0
more furious code botching.
Arisotura Jan 11, 2026
f8ec6ec
piss
Arisotura Jan 11, 2026
197b689
more unsucking...
Arisotura Jan 11, 2026
03689ab
oh god
Arisotura Jan 12, 2026
2aa6c98
remove GPU2D namespace, to keep things uniform
Arisotura Jan 12, 2026
cfc892d
fix up some shit
Arisotura Jan 12, 2026
a63c9f7
a lot more code unfucking
Arisotura Jan 12, 2026
1141bf9
tying more loose ends
Arisotura Jan 12, 2026
d434b63
blarg
Arisotura Jan 12, 2026
d2c4036
finish the GPU I/O handlers
Arisotura Jan 12, 2026
81447c5
close another 8-bit gap
Arisotura Jan 12, 2026
77a96f6
finish unfucking the 3D renderers, mostly
Arisotura Jan 12, 2026
b575df8
CAN YOU TASTE IT
Arisotura Jan 12, 2026
1e9fa4d
YOUR TASTE BUDS ARE ASPLODING NOW
Arisotura Jan 12, 2026
6c58965
IT BUILDS NOW
Arisotura Jan 12, 2026
d2508d1
fix crash
Arisotura Jan 12, 2026
8d291b4
guess what, Arisotura
Arisotura Jan 12, 2026
31799cd
fix a bunch of shit.
Arisotura Jan 12, 2026
bb8da9d
fix more shit. atleast now it stopped crashing in RenderDoc
Arisotura Jan 13, 2026
1dcca54
fix rotscale BG layers and shit
Arisotura Jan 13, 2026
cc8d96f
Merge remote-tracking branch 'origin/master' into blackmagic3
Arisotura Jan 13, 2026
43d8b27
resurrect melonCap
Arisotura Jan 14, 2026
05653f0
Revert "resurrect melonCap"
Arisotura Jan 14, 2026
3e53c6b
fix possible crash
Arisotura Jan 14, 2026
468b2df
fix sprite mosaic (finally)
Arisotura Jan 17, 2026
27b09c3
this can be simplified a bit
Arisotura Jan 17, 2026
f92a645
BG/OBJ layer enable and forced blank disable are delayed by two scanl…
Arisotura Jan 17, 2026
ead3588
add that crapo to savestates
Arisotura Jan 17, 2026
13c1c46
fix windows
Arisotura Jan 17, 2026
de63823
update GPU2D registers on every scanline, like hardware. fixes some s…
Arisotura Jan 17, 2026
45b4a71
yeah, confirmed
Arisotura Jan 17, 2026
6192209
o yeah forgot that one
Arisotura Jan 17, 2026
0706e4e
fix Pokémon battle transitions
Arisotura Jan 17, 2026
fbd1e2b
make this nicer
Arisotura Jan 17, 2026
71fea50
Merge remote-tracking branch 'origin/master' into blackmagic3
Arisotura Jan 18, 2026
c1f8863
GL: avoid having two samplers bound to the same texture unit. as I fe…
Arisotura Jan 18, 2026
70870bc
fix GL display w/ software renderer (GL_BGRA isn't valid as an intern…
Arisotura Jan 18, 2026
12e4011
fix possible crash when toggling GL display
Arisotura Jan 18, 2026
2e9434f
start with screens off
Arisotura Jan 18, 2026
1b5aeed
* properly reset the caches and stuff when switching renderers
Arisotura Jan 18, 2026
4ed08fe
try something
Arisotura Jan 18, 2026
5330c28
fix DSi menu
Arisotura Jan 18, 2026
078611f
properly set GL state before rendering
Arisotura Jan 18, 2026
acc6e2b
2D/GL: rework UBO mapping (Windows AMD driver did not like the previo…
Arisotura Jan 19, 2026
8685cb7
avoid updating VRAM during screen transition (fixes glitches)
Arisotura Jan 19, 2026
6c1800e
could also add this one
Arisotura Jan 19, 2026
82d50a6
don't update rotscale ref points if the layers are disabled
Arisotura Jan 20, 2026
e00e1f3
fix up inaccuracies in BG mosaic
Arisotura Jan 22, 2026
c1353f6
fark
Arisotura Jan 22, 2026
b676bda
2D/GL: first attempt at BG mosaic
Arisotura Jan 22, 2026
cdaa7d4
remove some old shit
Arisotura Jan 22, 2026
4e99a46
2D/GL: fix color conversion, matches software renderer now
Arisotura Jan 23, 2026
1f87dde
2D/GL: add sprite mosaic (there are still bugs)
Arisotura Jan 23, 2026
07252dd
add forcedblank, POWCNT1, LCD disable
Arisotura Jan 23, 2026
9b9d8dd
blarg
Arisotura Jan 24, 2026
3d7c710
minor stuff
Arisotura Jan 24, 2026
54dcde3
2D/GL: add support for splitting final pass and capture midframe
Arisotura Jan 25, 2026
5850a16
add support for per-scanline BG0HOFS in capture
Arisotura Jan 25, 2026
fa252f7
blarg
Arisotura Jan 25, 2026
b7d647d
avoid obliterating uScaleFactor in the OAM buffer when resetting
Arisotura Jan 25, 2026
22f6c4b
fix some sprite bugs
Arisotura Jan 25, 2026
18df804
prolly better this way
Arisotura Jan 25, 2026
73277bb
use different flags in GPU.PaletteDirty for backdrop colors
Arisotura Jan 26, 2026
a067c42
do some cleanup
Arisotura Jan 26, 2026
05463ee
more cleanup. make UBO names consistent. remove unused fields.
Arisotura Jan 26, 2026
07318a3
only render transparent sprite pixels if doing mosaic
Arisotura Jan 26, 2026
a9e83c4
I guess we don't need this extra whitespace
Arisotura Jan 26, 2026
8fa96bd
more cleanup. add some of the shit to savestates.
Arisotura Jan 26, 2026
b89207d
fix some bugs
Arisotura Jan 26, 2026
5490155
fix Wizard of Oz bugs
Arisotura Jan 26, 2026
1d07ee7
also fix savestate bugs
Arisotura Jan 26, 2026
79f4227
Merge remote-tracking branch 'origin/master' into blackmagic3
Arisotura Jan 26, 2026
1ce2760
really??
Arisotura Jan 26, 2026
b080e61
fix more bugs
Arisotura Jan 26, 2026
a83df1f
properly set the renderer when switching between DS and DSi modes
Arisotura Jan 26, 2026
73859c8
fix more bugs
Arisotura Jan 26, 2026
8c98c89
fix broken text in Chrono Trigger
Arisotura Jan 28, 2026
99363f6
fix another Bowser transition
Arisotura Jan 28, 2026
654dd1a
fix the remaining Bowser transition bugs
Arisotura Jan 28, 2026
cad79e8
fix Golden Sun flickering
Arisotura Jan 28, 2026
438f409
remove some junk
Arisotura Jan 28, 2026
a0aeef1
explicitly set clear color when presenting screens
Arisotura Jan 28, 2026
d1d1448
properly reset samplers in the compute renderer after rendering (fixe…
Arisotura Jan 28, 2026
a899e42
fix Ghost Trick speech bubble bug
Arisotura Jan 28, 2026
5a45948
fix bug with savestates and rotscale positions
Arisotura Jan 28, 2026
78f75ed
fix up VRAM display/capture color conversion
Arisotura Jan 30, 2026
ea45f87
blarg
Arisotura Jan 30, 2026
4d5eae7
fix bug in capture tracking system (when overwriting old captures at …
Arisotura Jan 31, 2026
36bded7
forcefully sync VRAM captures when saving a savestate
Arisotura Jan 31, 2026
3aa6714
fix other bugs
Arisotura Jan 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmake/MakeEmbed.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
file(READ ${INPUT_FILE} EMBED_CONTENTS)
file(WRITE ${OUTPUT_FILE}
"const char* k${VAR_NAME} = R\"(${EMBED_CONTENTS})\";\n"
)
20 changes: 10 additions & 10 deletions src/ARMJIT_Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1371,23 +1371,23 @@ void VRAMWrite(u32 addr, T val)
{
switch (addr & 0x00E00000)
{
case 0x00000000: NDS::Current->GPU.WriteVRAM_ABG<T>(addr, val); return;
case 0x00200000: NDS::Current->GPU.WriteVRAM_BBG<T>(addr, val); return;
case 0x00400000: NDS::Current->GPU.WriteVRAM_AOBJ<T>(addr, val); return;
case 0x00600000: NDS::Current->GPU.WriteVRAM_BOBJ<T>(addr, val); return;
default: NDS::Current->GPU.WriteVRAM_LCDC<T>(addr, val); return;
case 0x00000000: NDS::Current->GPU.SyncVRAM_ABG(addr, true); NDS::Current->GPU.WriteVRAM_ABG<T>(addr, val); return;
case 0x00200000: NDS::Current->GPU.SyncVRAM_BBG(addr, true); NDS::Current->GPU.WriteVRAM_BBG<T>(addr, val); return;
case 0x00400000: NDS::Current->GPU.SyncVRAM_AOBJ(addr, true); NDS::Current->GPU.WriteVRAM_AOBJ<T>(addr, val); return;
case 0x00600000: NDS::Current->GPU.SyncVRAM_BOBJ(addr, true); NDS::Current->GPU.WriteVRAM_BOBJ<T>(addr, val); return;
default: NDS::Current->GPU.SyncVRAM_LCDC(addr, true); NDS::Current->GPU.WriteVRAM_LCDC<T>(addr, val); return;
}
}
template <typename T>
T VRAMRead(u32 addr)
{
switch (addr & 0x00E00000)
{
case 0x00000000: return NDS::Current->GPU.ReadVRAM_ABG<T>(addr);
case 0x00200000: return NDS::Current->GPU.ReadVRAM_BBG<T>(addr);
case 0x00400000: return NDS::Current->GPU.ReadVRAM_AOBJ<T>(addr);
case 0x00600000: return NDS::Current->GPU.ReadVRAM_BOBJ<T>(addr);
default: return NDS::Current->GPU.ReadVRAM_LCDC<T>(addr);
case 0x00000000: NDS::Current->GPU.SyncVRAM_ABG(addr, false); return NDS::Current->GPU.ReadVRAM_ABG<T>(addr);
case 0x00200000: NDS::Current->GPU.SyncVRAM_BBG(addr, false); return NDS::Current->GPU.ReadVRAM_BBG<T>(addr);
case 0x00400000: NDS::Current->GPU.SyncVRAM_AOBJ(addr, false); return NDS::Current->GPU.ReadVRAM_AOBJ<T>(addr);
case 0x00600000: NDS::Current->GPU.SyncVRAM_BOBJ(addr, false); return NDS::Current->GPU.ReadVRAM_BOBJ<T>(addr);
default: NDS::Current->GPU.SyncVRAM_LCDC(addr, false); return NDS::Current->GPU.ReadVRAM_LCDC<T>(addr);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Args.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "DSi_NAND.h"
#include "FATStorage.h"
#include "FreeBIOS.h"
#include "GPU3D_Soft.h"
#include "GPU.h"
#include "SPI_Firmware.h"
#include "SPU.h"

Expand Down Expand Up @@ -116,7 +116,7 @@ struct NDSArgs
/// The 3D renderer to initialize the DS with.
/// Defaults to the software renderer.
/// Can be changed later at any time.
std::unique_ptr<melonDS::Renderer3D> Renderer3D = std::make_unique<SoftRenderer>();
std::unique_ptr<melonDS::Renderer> Renderer = nullptr;
};

/// Arguments to pass into the DSi constructor.
Expand Down
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ add_library(core STATIC
GBACart.cpp
GBACartMotionPak.cpp
GPU.cpp
GPU_Soft.cpp
GPU2D.cpp
GPU2D_Soft.cpp
GPU3D.cpp
Expand Down Expand Up @@ -87,14 +88,14 @@ if (ENABLE_GDBSTUB)
endif()

if (ENABLE_OGLRENDERER)
add_subdirectory(OpenGL_shaders)
target_sources(core PRIVATE
GPU_OpenGL.cpp
GPU_OpenGL_shaders.h
GPU2D_OpenGL.cpp
GPU3D_OpenGL.cpp
GPU3D_Compute.cpp
GPU3D_TexcacheOpenGL.cpp
GPU3D_TexcacheOpenGL.h
GPU3D_OpenGL_shaders.h
OpenGLSupport.cpp)

target_compile_definitions(core PUBLIC OGLRENDERER_ENABLED)
Expand Down
10 changes: 5 additions & 5 deletions src/DSi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1589,11 +1589,11 @@ void DSi::ARM9Write8(u32 addr, u8 val)
JIT.CheckAndInvalidate<0, ARMJIT_Memory::memregion_VRAM>(addr);
switch (addr & 0x00E00000)
{
case 0x00000000: GPU.WriteVRAM_ABG<u8>(addr, val); return;
case 0x00200000: GPU.WriteVRAM_BBG<u8>(addr, val); return;
case 0x00400000: GPU.WriteVRAM_AOBJ<u8>(addr, val); return;
case 0x00600000: GPU.WriteVRAM_BOBJ<u8>(addr, val); return;
default: GPU.WriteVRAM_LCDC<u8>(addr, val); return;
case 0x00000000: GPU.SyncVRAM_ABG(addr, true); GPU.WriteVRAM_ABG<u8>(addr, val); return;
case 0x00200000: GPU.SyncVRAM_BBG(addr, true); GPU.WriteVRAM_BBG<u8>(addr, val); return;
case 0x00400000: GPU.SyncVRAM_AOBJ(addr, true); GPU.WriteVRAM_AOBJ<u8>(addr, val); return;
case 0x00600000: GPU.SyncVRAM_BOBJ(addr, true); GPU.WriteVRAM_BOBJ<u8>(addr, val); return;
default: GPU.SyncVRAM_LCDC(addr, true); GPU.WriteVRAM_LCDC<u8>(addr, val); return;
}

case 0x08000000:
Expand Down
Loading
Loading