From 5f73d61b27a8d51269b54dde1c456d2d2f7dc865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Czekan=CC=81ski?= Date: Thu, 22 Apr 2021 23:53:04 +0200 Subject: [PATCH] gpu/clut-cache: added x wraparound test --- gpu/clut-cache/main.c | 16 +++++++++++++++- gpu/clut-cache/vram.png | Bin 4059 -> 5943 bytes 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gpu/clut-cache/main.c b/gpu/clut-cache/main.c index c75a98b..0d3932b 100644 --- a/gpu/clut-cache/main.c +++ b/gpu/clut-cache/main.c @@ -253,13 +253,25 @@ void testE1NotInvalidatingCache() { y += 16; } +void testLongClutXWrapping() { + y += 32; + int clutx = 1024-64; + writeTestClut(clutx, y); + + setE1(bit8, 0, 0); + rectangle(0, y+2, 0, 1, clutx, y); + + y += 16; +} + int main() { initVideo(320, 240); printf("\ngpu/clut-cache\n"); printf("GPU caches the palette/CLUT before rendering 4/8bit textured primitives.\n"); printf("This test check this by rendering textured rectangle over currently used CLUT (first 4 lines).\n"); printf("Next 3 tests check if Clear Cache or using different CLUT position does invalidate the CLUT$.\n"); - printf("Last 5 tests verify when CLUT$ is reloaded when different texture modes are used.\n"); + printf("Next 5 tests verify when CLUT$ is reloaded when different texture modes are used.\n"); + printf("Last test checks what CLUT does when placed on the x wraparound\n"); printf("No assertions are made, please compare output with the VRAM dump.\n\n"); clearScreen(); @@ -284,6 +296,8 @@ int main() { testClutCacheInvalidatedAfterChangingTextureModeFromReservedTo8(); testE1NotInvalidatingCache(); + testLongClutXWrapping(); + DrawSync(0); printf("Done\n"); diff --git a/gpu/clut-cache/vram.png b/gpu/clut-cache/vram.png index 7715064ed3fc9fb99941a18c926e0ce4610aad78..cb0b4514ff7ffaea80c4e95eae6b310166e8656c 100644 GIT binary patch literal 5943 zcmeHLe^3)w9$&H6YNwz#?Qv}>I2y#WmY*Vo9|1bH5PyVT&!Wslf)$giMWRFufh?h= zb9iS5>gE(e0_)w(jdNo!)TF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