# HG changeset patch # User TomW # Date 1408976571 -3600 # Node ID ad7d877a3b53a99faf4d0191f8fbed7bef6ab8e3 # Parent f6069ee5e9d771323139963a276c985286b4d961 Fixed Z range on ViRGE S3D, fixes Grim Fandango. diff -r f6069ee5e9d7 -r ad7d877a3b53 src/vid_s3_virge.c --- a/src/vid_s3_virge.c Sun Aug 24 14:08:17 2014 +0100 +++ b/src/vid_s3_virge.c Mon Aug 25 15:22:51 2014 +0100 @@ -2330,7 +2330,7 @@ { int x = (state->x1 + ((1 << 20) - 1)) >> 20; int xe = (state->x2 + ((1 << 20) - 1)) >> 20; - uint32_t z = state->base_z; + uint32_t z = (state->base_z > 0) ? (state->base_z << 1) : 0; if (x_dir < 0) { x--; @@ -2419,7 +2419,7 @@ for (; x != xe; x = (x + x_dir) & 0xfff) { int update = 1; - int16_t src_z; + uint16_t src_z; _x = x; _y = state->y; if (use_z)