Repository navigation
The VRAM extended to 1024x1024 for textures; the wide canvas's pad for the game - #109
Merged
Merged
Conversation
…r the game A game that draws more than its PS1 screen held may need more texture room than the 1 MB VRAM has (dw2003recomp issue #78: the field's 3 more map tiles for a 16:9 picture). port_video_vram_extend makes gpu.c's VRAM 1024x1024 in Psy-Q's 2 MB layout: getTPage's y bit 9 is the texture page's bit 11, getClut's the CLUT's bit 15, both ignored as before without it; transfers, fills and copies wrap at the VRAM's height. Only textures and CLUTs live in rows 512-1023: the drawing area and the display stay below. The hardware renderer's VRAM copy has 1024 rows (its target keeps 512; a transfer or copy there is drawn only where it reaches the target), the texture keys track the extra rows, and a save state holds them as a block of its own. port_video_widescreen_pad tells a game how far past the display's edges the wide canvas shows, so that its 2D can draw that far. Without the call everything is as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For dw2003recomp issue #78 (the widescreen field). The game's PR moves its pin here.
Why
The first game's field draws streamed 128x128 map tiles from 12 VRAM slots, exactly what a 320-wide screen shows. A 16:9 picture needs 3 more slots, and the 1 MB VRAM has no room left (x 640-1023 is full). The game also needs to know how far past the screen's edges the wide canvas shows, so its 2D can draw that far.
What
port_video_vram_extend()makesgpu.c's VRAM 1024x1024 in Psy-Q's 2 MB layout:getTPagealready puts y's bit 9 into the texture page's bit 11, andgetClutputs it into the CLUT's bit 15. The game reaches rows 512-1023 with its own macros, with no new shim API.gpu_vram_ext), present only when extended.port_video_widescreen_pad()returns the canvas's columns past each side of the display, as of the last vsync: 53 at 16:9, 32 at 16:10, and 0 while the picture is 4:3.psyq/README.md.tests/psyq/psyq_test.ctest_vram_extend. Before the extension, page y 512 and CLUT row 1012 read rows 0 and 500. After it, they read rows 512 and 1012, and a transfer there leaves rows 0-511 alone.Gates
tests/psyq_test.py(2341 checks, -O0 and -O2),tests/shim_test.py,tests/hello_test.py,tests/hello_test.py --menu --gpu,psyq/check.sh --compile: pass.tests/port/render_gpu.pypasses. Its VRAM check compares the rasteriser's whole target with the software VRAM every 10 vsyncs; the battle and the new field widescreen checks pass too.run.py,savestate.py,mods.py --only widescreenandsettings.pypass.scripts/build.sh --checkmatches.🤖 Generated with Claude Code