ec82764bef
RTL (GS rasterizer, EE core stub, platform bridge, LPDDR4B path), sim regression (272 TBs), docs, and tooling. Copyrighted PS2 content (BIOS, game code, GS dumps, and all dump-derived textures/traces) is excluded via .gitignore and stays local. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
47 lines
4.4 KiB
Bash
Executable File
47 lines
4.4 KiB
Bash
Executable File
#!/bin/sh
|
|
# retroDE_ps2 — Ch336 >FIFO_DEPTH FRAMEBUFFER ACCUMULATION silicon proof.
|
|
#
|
|
# A 14-primitive scene (FIFO depth is 8) renders in TWO batches that COMPOSE into one framebuffer
|
|
# instead of wiping each other (the pre-Ch336 behavior):
|
|
# batch 0 (prims 0-7, tiles 0-7) = RED (clears + full-flushes the framebuffer)
|
|
# batch 1 (prims 8-13, tiles 8-13) = BLUE (sparse-flushes only its pixels onto the accumulated FB)
|
|
# PROOF: the RED top-half AND the BLUE bottom-rows are simultaneously visible at the end. If batches
|
|
# wiped each other, the RED tiles (0-7) would be green. v1 = color accumulation, per-batch Z
|
|
# (shapes are tile-separated, so per-batch Z is honest). records = 14.
|
|
#
|
|
# REQUIRES the Ch336 bitstream (TILE_ACCUM_ENABLE) — a re-fit from Ch335.
|
|
# Register map identical to ps2_feeder_test.sh (BASE 0x40000000).
|
|
|
|
set -u
|
|
BASE="${PS2_BRIDGE_BASE:-0x40000000}"
|
|
DEVMEM="${DEVMEM:-busybox devmem}"
|
|
OFF_STATUS=0x0D8; OFF_LO=0x0DC; OFF_HI=0x0E4; OFF_GO=0x0E8
|
|
w() { $DEVMEM $(printf "0x%X" $(( BASE + $1 ))) w "$2" >/dev/null; }
|
|
r() { $DEVMEM $(printf "0x%X" $(( BASE + $1 ))) w; }
|
|
|
|
ACCUM="000000000000000e 0000000000010000 0000000000000044 0000000000050000 0000000000000002 0000000088004060 0000000000000053 00000000ff0000ff 0000000000000000 0000500000100010 00000000ff0000ff 0000000000000030 00005000001000e0 00000000ff0000ff 00000000000c0000 0000500000e00010 00000000ff0000ff 0000000000000000 0000510000100110 00000000ff0000ff 0000000000000030 00005100001001e0 00000000ff0000ff 00000000000c0000 0000510000e00110 00000000ff0000ff 0000000000000000 0000520000100210 00000000ff0000ff 0000000000000030 00005200001002e0 00000000ff0000ff 00000000000c0000 0000520000e00210 00000000ff0000ff 0000000000000000 0000530000100310 00000000ff0000ff 0000000000000030 00005300001003e0 00000000ff0000ff 00000000000c0000 0000530000e00310 00000000ff0000ff 0000000000000000 0000540001100010 00000000ff0000ff 0000000000000030 00005400011000e0 00000000ff0000ff 00000000000c0000 0000540001e00010 00000000ff0000ff 0000000000000000 0000550001100110 00000000ff0000ff 0000000000000030 00005500011001e0 00000000ff0000ff 00000000000c0000 0000550001e00110 00000000ff0000ff 0000000000000000 0000560001100210 00000000ff0000ff 0000000000000030 00005600011002e0 00000000ff0000ff 00000000000c0000 0000560001e00210 00000000ff0000ff 0000000000000000 0000570001100310 00000000ff0000ff 0000000000000030 00005700011003e0 00000000ff0000ff 00000000000c0000 0000570001e00310 00000000ffff0000 0000000000000000 0000580002100010 00000000ffff0000 0000000000000030 00005800021000e0 00000000ffff0000 00000000000c0000 0000580002e00010 00000000ffff0000 0000000000000000 0000590002100110 00000000ffff0000 0000000000000030 00005900021001e0 00000000ffff0000 00000000000c0000 0000590002e00110 00000000ffff0000 0000000000000000 00005a0002100210 00000000ffff0000 0000000000000030 00005a00021002e0 00000000ffff0000 00000000000c0000 00005a0002e00210 00000000ffff0000 0000000000000000 00005b0002100310 00000000ffff0000 0000000000000030 00005b00021003e0 00000000ffff0000 00000000000c0000 00005b0002e00310 00000000ffff0000 0000000000000000 00005c0003100010 00000000ffff0000 0000000000000030 00005c00031000e0 00000000ffff0000 00000000000c0000 00005c0003e00010 00000000ffff0000 0000000000000000 00005d0003100110 00000000ffff0000 0000000000000030 00005d00031001e0 00000000ffff0000 00000000000c0000 00005d0003e00110"
|
|
|
|
wait_ready() {
|
|
i=0
|
|
while [ $i -lt 300 ]; do st=$(r $OFF_STATUS); [ $(( st & 1 )) -eq 1 ] && return 0; i=$(( i + 1 )); sleep 0.01 2>/dev/null || true; done
|
|
echo " !! feeder never reported ready — is this the Ch336 bitstream?"; return 1
|
|
}
|
|
|
|
echo "=== Ch336 >FIFO_DEPTH framebuffer accumulation — 14-prim scene (2 batches: RED + BLUE) ==="
|
|
wait_ready || exit 1
|
|
echo "streaming 14-prim scene (>FIFO depth), then GO ..."
|
|
w $OFF_STATUS 0x0; n=0
|
|
for word in $ACCUM; do
|
|
lo=$(printf '%s' "$word" | cut -c9-16); hi=$(printf '%s' "$word" | cut -c1-8)
|
|
w $OFF_LO 0x$lo; w $OFF_HI 0x$hi; n=$(( n + 1 ))
|
|
done
|
|
echo "wrote $n words; bridge staging addr now=$(( $(r $OFF_LO) )) (expect $n)"
|
|
wait_ready || exit 1
|
|
w $OFF_GO 0x1
|
|
wait_ready || exit 1
|
|
rec=$(r $OFF_HI)
|
|
echo "records=$(( rec )) (expect 14) fifo_wait_cycles=$(( $(r $OFF_GO) ))"
|
|
[ $(( rec )) -eq 14 ] || { echo " !! records != 14"; exit 1; }
|
|
echo "=== done — HDMI: RED triangles in the TOP HALF (tiles 0-7, batch 0) AND blue triangles in"
|
|
echo " the lower rows (tiles 8-13, batch 1) — BOTH visible = the two FIFO batches accumulated. ==="
|