Skip to content

Latest commit

 

History

History
171 lines (142 loc) · 17.4 KB

CVARS.md

File metadata and controls

171 lines (142 loc) · 17.4 KB

PS2 backend cvars

Every cvar registered by the PS2 backend under src/ps2/, with its default in the debug (make) and release (make release) builds. See the README for the bigger picture.

  • Arch. marks CVAR_ARCHIVE cvars: they are written to config.cfg and read back on the next boot, so the value in your config, not the default, is what a run starts with.
  • Menu marks the cvars the game menu's video options page sets (vid.cpp); the page says which apply live and which need a map load or a restart.
  • — in the release column means the cvar is not registered at all there: the code that reads it is compiled out with PS2_QUAKE_DEBUG / PS2_QUAKE_PROFILE. Archived cvars never get a —. Every build registers them, even where nothing reads them, because the quit drops an archived cvar the build never registered from config.cfg.

Renderer: video and frame

Cvar Debug Release Flags Description
ps2_fb_width 640 640 Arch., Menu Framebuffer width in pixels (512 or 640); read at startup.
ps2_video_mode auto auto Arch., Menu TV standard: auto (the console's own), ntsc (59.94 Hz) or pal (50 Hz); read at startup. A PAL console can drive NTSC if the TV takes 60 Hz. The fatal-error screen follows it too.
ps2_fb_height 0 0 Arch., Menu Framebuffer height in pixels: 0 (auto) is the video mode's full height, 448 for NTSC and 512 for PAL; a taller value than the mode shows is clamped. 512 lines leave 240 KB less VRAM for textures. Read at startup.
ps2_fb_16bit 1 1 Arch., Menu 16-bit colour buffers (more VRAM for textures) instead of 32-bit; read at startup.
ps2_fb_dither 0 0 Arch., Menu GS dithering, to hide the 16-bit framebuffer's colour banding.
ps2_gs_latency 1 1 Arch., Menu Let the GS draw a frame while the next is built: faster, one frame more input lag.
ps2_intensity 2 2 Arch., Menu Brightness scale of walls and models (ref_gl's intensity, floored at 1); read at startup.
vid_gamma 1 1 Arch., Menu The picture's brightness (id's cvar): everything drawn through the palette shows as pow(colour * contrast, gamma), lower is brighter. The video menu's "brightness" slider steps it from 1.3 down to 0.5 in tenths, as id's did; the console takes 0.25 to 4. Applies at the next frame.
ps2_screen_x 0 0 Arch., Menu Where the picture sits on the TV: pixels to the right (negative: left) of the standard's usual place, -32 to 32, for a set that cuts an edge off. The GS DISPLAY register's origin moves, nothing is redrawn, and the picture clips where it meets the blanking. Applies at the next frame, and the GS comes up with it; the error screen follows it too. The video menu's "screen x" row, which marks the picture's edge while it or "screen y" is under the cursor. PCSX2 ignores it unless its pcrtc_offsets setting is on.
ps2_screen_y 0 0 Arch., Menu As ps2_screen_x, rows down (negative: up), -16 to 16: the room above the picture is a few lines on NTSC before it clips. The video menu's "screen y" row.
ps2_vsync_spin 0 0 Wait for vsync by spinning on the GS status register, as every build before 2026-10-26 did, instead of sleeping on the vblank interrupt. An A/B switch: the sleep gives the frame's idle time (8-11 ms a field) to the other threads, the music reader and the background loader.
vid_contrast 1 1 Arch., Menu The picture's contrast, the same curve's multiplier (the Quake port's, from QuakeSpasm). The "contrast" slider steps it from 1 to 2 in tenths; the console takes 0.25 to 4. Applies at the next frame.
ps2_polyblend 1 1 Fullscreen damage/powerup/underwater tint (ref_gl's gl_polyblend).
r_particles 1 1 Arch., Menu The particles' look: 1 is the soft round sprite, the particle image's coverage over a quad blown up 1.5x as ref_gl's textured path did; 2 is the classic flat square ref_gl's GL_POINTS path drew, the same GS sprite untextured, sized to ref_gl's point attenuation (about 400 / depth pixels). The video menu's "particles" row, "hd" and "classic". Applies at the next frame.

Renderer: textures and sky

Cvar Debug Release Flags Description
ps2_mipmaps 1 1 Arch., Menu Load walls with their WAL mip levels; applies on the next map load.
ps2_mip_filter bilinear bilinear Arch., Menu Wall and model skin filtering: nearest, bilinear or trilinear.
ps2_mip_bias 0 0 Arch., Menu Wall mip level bias, in levels; positive is blurrier.
ps2_st_rebase 1 1 Arch. Shift each wall face's texture coordinates by whole repeats so they start near zero, which keeps precision the GS would lose on large values; the same texels either way. Applies on the next map load.
ps2_skymip 0 0 Arch., Menu Load the sky faces at half resolution to save VRAM (ref_gl's gl_skymip).
ps2_sky_full_bounds 0 0 Debug: draw all six sky faces whole, ignoring what is visible.

Renderer: lighting

Cvar Debug Release Flags Description
ps2_dynamic_lightmaps 2 2 Arch., Menu Dynamic lights: 0 = flares, 1 = per-luxel lightmap rebuild, 2 = per-vertex point lights on VU1.
ps2_dlight_scale 0.1 0.1 Arch., Menu Brightness of the VU1 point lights in mode 2.
ps2_lightmap_modulate 1 1 Arch. Scales every luxel and the entity lighting (ref_gl's gl_modulate).
ps2_lightstyle_epsilon 0.3 0.3 Arch. How far an animated light style must move before its surfaces are rebaked; 0 is exact.
ps2_lightmap_color 1 1 Arch. Debug: 0 drops the per-vertex lightmap chroma, leaving lighting monochrome.
ps2_lightmaps 1 1 Debug: 0 drops the lightmap pass, leaving the world fullbright.
ps2_lightmap_only 0 0 Debug: 1 drops the diffuse textures, showing the lighting alone.

Renderer: MD2 models

Cvar Debug Release Flags Description
ps2_md2_shadows 1 1 Arch., Menu Blob shadows under monsters and items.
ps2_md2_lerp_on 1 1 Interpolate between animation keyframes; 0 snaps to the current frame.
ps2_md2_vu_lerp 1 1 Do the keyframe lerp on VU1 rather than on the EE.
ps2_md2_cullface 1 1 Model face culling: 0 = none, 1 = negative, 2 = positive winding.

Renderer: isolating parts of the frame

Cvar Debug Release Flags Description
ps2_skip_world 0 0 Skip all world geometry.
ps2_skip_alpha_surfaces 0 0 Skip the translucent glass/water pass.
ps2_skip_brushmodels 0 0 Skip brush model entities (doors, platforms, props).
ps2_skip_sprites 0 0 Skip sprites.
ps2_skip_entities 0 0 Skip all entities.
ps2_skip_particles 0 0 Skip particles.
ps2_skip_sky 0 0 Skip the sky pass.
ps2_skip_weapon_model 0 0 Skip the view weapon.
ps2_force_null_models 0 0 Draw every entity as the octahedron placeholder.

Debug overlays and profiling

Cvar Debug Release Flags Description
ps2_show_fps 1 0 Arch., Menu FPS counter at the top right; independent of ps2_debug_overlays.
ps2_debug_overlays 1 0 Arch., Menu Master switch for the profile, memory, VRAM and draw stats panels below.
ps2_show_memstats 1 0 Arch. Per-tag heap usage panel.
ps2_show_vramstats 1 0 Arch. Texture heap occupancy and per-frame uploads panel.
ps2_show_drawstats 1 0 Arch. Nodes, surfaces, triangles, batches, entities, particles and dlights per frame.
ps2_show_profile 1 0 Arch. Per-stage frame timings panel; does nothing in release, where the profiler is compiled out.
ps2_frame_log 0 — Log per-frame timings and counters to stdout in batches, for the frame_log scripts.
ps2_logfile 0 0 Copy the console, Sys_Error and the reports printed before it (pipeline hang dump, stack traces, out-of-memory stats) to quake2.log next to baseq2/, one open/append/close per write so a hang leaves the log on the drive. A Sys_Error and the reports before it are written even at 0, so a console crash always leaves quake2.log with the header and the report. Defaults to 1 in a build with PS2_QUAKE_LOAD_TRACE set to 1. The Options menu's debug page sets it. A disc build writes it to the emulator's host: (beside the image in PCSX2), and on a console nowhere.
ps2_perftest 0 0 Arch. Unattended perf run: plays the attract demos with the frame log on, then quits; does nothing in release, where the profiler is compiled out. The debug page's "start perf test" sets it.

File system and background loading

Cvar Debug Release Flags Description
ps2_aio 1 1 The background loader (src/ps2/fs/async_io.cpp): a thread one priority below the main one that reads file ranges and inflates pack entries while frames run. 0 makes every client load synchronously, the A/B switch. Read at each request.
ps2_aio_throttle_kbps 0 0 Loader throughput cap in KB/s, as a sleep after each 32 KB chunk (plus 5 ms per chunk for the command), so PCSX2's instant host reads pace like a drive; 900 is a USB stick's. 0 is off.
ps2_aio_pump_us 2000 2000 The per-frame budget, in microseconds, for turning the loader's landed reads into assets at the top of PS2_BeginFrame (src/ps2/fs/aio_pump.cpp): sounds first (GetWavinfo and the resample). At least one is finished per frame whatever the budget.
ps2_readahead_kb 512 512 The read-ahead ring a cinematic (.cin) or demo (.dm2) streams through (src/ps2/fs/readahead_stream.cpp): 32 KB chunks the loader keeps in flight ahead of the reader, 512 KB at most, 256 when memory is short. 0 reads them through a plain stdio stream on the main thread as before, the A/B switch. Read at each open; a deflated pkz entry always gets the plain stream.

Sound and music

Cvar Debug Release Flags Description
ps2_disable_sound 0 0 Arch. Skip audio bring-up at boot and run silent.
ps2_sound_async 1 1 Submits the mixed audio to audsrv from a thread of its own (submit_thread.h), so the main thread never waits on the IOP's two RPCs; a frame whose previous send is still out sends nothing (sndFree -2) and the next sends both. 0 submits on the main thread, as before, with ps2_sound_defer's hold: the A/B switch.
ps2_sound_defer 1 1 With ps2_sound_async 0 only: holds the frame's audio submit back, while the last one is under 30 ms old, while the loader or the music reader has a file call out: on the HDD the audsrv RPCs would wait for it on the IOP. 0 off, 1 when the game data is on the HDD, 2 always (to exercise it in PCSX2 with ps2_aio_throttle_kbps). Held-back frames log sndFree -2.
cd_nocd 0 0 Arch. Turn the streamed soundtrack off (the Options menu's "background music" toggle).
cd_volume 0.7 0.7 Arch. Music volume, 0-1 (the Options menu's "music volume" slider).
cd_loopcount 4 4 Times a map's track plays before switching to cd_looptrack.
cd_looptrack 11 11 The ambient track looped for good once cd_loopcount runs out.

Input

Cvar Debug Release Flags Description
in_joystick 1 1 Arch. Use the gamepad's analog sticks (the Options menu's "gamepad movement" toggle).
in_swapsticks 0 0 Arch. Swap the sticks' jobs: 1 moves with the right stick and looks with the left (the Options menu's "swap sticks"). The joy_* cvars follow the job, not the stick: the yaw/pitch ones always tune the camera stick, the forward/side ones the move stick.
joy_yawsensitivity 1 1 Camera stick (right, or left with in_swapsticks) horizontal (turn) speed; negative inverts the axis.
joy_pitchsensitivity 1 1 Camera stick vertical (look) speed; negative inverts the axis.
joy_forwardsensitivity 1 1 Move stick (left, or right with in_swapsticks) vertical (move) speed; negative inverts the axis.
joy_sidesensitivity 1 1 Move stick horizontal (strafe) speed; negative inverts the axis.
joy_yawthreshold 0.25 0.25 Arch. Camera stick horizontal dead zone, as a fraction of full deflection. The travel past each dead zone is rescaled, so the response starts from zero at its edge. Raise it if a worn pad turns the camera with the stick released.
joy_pitchthreshold 0.25 0.25 Arch. Camera stick vertical dead zone.
joy_forwardthreshold 0.25 0.25 Arch. Move stick vertical dead zone.
joy_sidethreshold 0.25 0.25 Arch. Move stick horizontal dead zone.
in_rumble 1 1 Arch. Gamepad force feedback (the Options menu's "gamepad rumble").
in_rumbledebug 0 0 Print each rumble effect as it starts.
in_keyboard 1 0 Arch. Bring up the USB keyboard driver (one-shot; the IOP modules load once). A keyboard is polled every frame while in use (a key within 10 s, or one held), four times a second otherwise. A disc build has no keyboard driver, and ignores it.
in_keyboarddebug 0 0 Print every raw USB scan code the keyboard driver delivers.

Save games

Cvar Debug Release Flags Description
ps2_savedevice mc mc Arch. Where save games and config.cfg go: mc, the memory card in MEMORY CARD slot 1, or the drive the game booted from, usb (a USB drive), hdd (the hard disk) or host (the emulator's host: filesystem), in baseq2/save/ there. Every device holds the same compressed slot files, under the same notice. A value naming a drive the game didn't boot from means the card. config.cfg follows it (see the README's Save games section). ps2_saveinfo shows where saves are going and lists them. The Game menu's "save device" row steps between the card and the boot drive; config.cfg follows on leaving the page, as after any menu change. A disc build always saves to the card, whatever it says, and has no such row.

Bring-up scenes and tests

All debug builds only, apart from ps2_test_quit, which profiling builds register too (for the perf test).

Cvar Debug Release Flags Description
ps2_testcube 0 — Draw the spinning textured cube, a VU1 path smoke test.
ps2_testcube_tess 8 — Cube face tessellation (N x N quads), to exercise chunked batch submission.
ps2_testcube_vram_tex_eviction 0 — Slide the cube's textures through a window that forces VRAM evictions and re-uploads.
ps2_testcube_vulerp 0 — Draw the cube through the MD2 keyframe-lerp VU path.
ps2_testcin 0 — Play every stock cinematic in turn.
ps2_testaio 0 — Background loader self-test: a fixed file list read through the loader and through FS_LoadFile and compared, as the drive is and throttled to 900 KB/s, with a main-thread read timed every frame meanwhile; ends in AioTest: PASS/FAIL, then quits unless ps2_test_quit is 0.
ps2_testmaps 0 — Load all 39 stock maps in order, logging memory use per map; a map that takes over 240 s to load is skipped. The debug page's "start map cycle" sets it.
ps2_testmaps_dwell 8 — Seconds ps2_testmaps stays in each map once loaded.
ps2_testsaves 0 — Save game test: 1 = the boot drive (host files under PCSX2), 2 = the boot drive and the memory card, 3 = load an earlier run's save from the boot drive only.
ps2_test_quit 1 — Quit the game when the perf test, the map cycle or the save test finishes; 0 keeps it up, with the test's cvar back at 0, for the next test. The debug page's "quit after a test" sets it.

Engine cvars with PS2-specific defaults

Registered by id's code rather than the backend, but set up or read differently here:

Cvar Debug Release Flags Description
developer 1 0 Engine debug prints (Com_DPrintf); the default follows the build here.
crosshair_scale 1 1 Arch. New on this port, beside id's crosshair: the crosshair's size on screen, as a multiple of the pic's own, 0.5 to 4, still centred (cl_view.c). The Options menu's "crosshair size" row steps 1x to 3x in halves. Pics are point-sampled, so a whole number keeps every line of it the same width. Applies at the next frame.
s_khz 22 22 Arch. Sound output rate: 11, 22 or 44 (kHz); anything else falls back to 22.
sensitivity 3 3 Arch. The right stick's turning and looking speed, as a multiple of the default 3: 6 turns twice as fast (the Options menu's "camera rotation speed", 1 to 11). There is no mouse.
m_pitch 0.022 0.022 Arch. Only its sign is read: negative flips the right stick's up and down (the Options menu's "invert look Y axis"), as win32's joystick code did with the mouse inverted.