From dbc5b511ba0e36832c1329ec085295c4844dd726 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Fri, 24 Feb 2023 03:47:14 +0100 Subject: [PATCH] [Research] BLITPERF: Allow the GRCG sprite color to be customized spaztron64 suggested that the GRCG might not always write all 4 planes if one of the tile registers is 0. By changing the color and comparing the results of this benchmark, we can prove that real hardware has no such optimization. Completes P0233, funded by [Anonymous]. --- Research/BLITPERF.CPP | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Research/BLITPERF.CPP b/Research/BLITPERF.CPP index 401ff231..f64d0170 100644 --- a/Research/BLITPERF.CPP +++ b/Research/BLITPERF.CPP @@ -218,6 +218,7 @@ Sprite sprites[14500]; enum option_type_t { OPT_SPRITE_COUNT, OPT_DURATION, + OPT_SPRITE_COL, OPT_COUNT, OPT_INVALID = -1 }; @@ -309,7 +310,8 @@ void Test::run(bool grcg, const char* prompt, test_func_t func) graph_clear(); if(grcg) { - GRCGStaticColor grcg(GC_RMW); + GRCG grcg(GC_RMW); + grcg.setcolor(opt[OPT_SPRITE_COL].val); sprite_loop(func); } else { sprite_loop(func); @@ -354,8 +356,9 @@ void Test::run(bool grcg_only) // --------- Test t = {{ - { 'c', "Sprite count", 2000, 1, (sizeof(sprites) / sizeof(sprites[0])) }, + { 's', "Sprite count", 2000, 1, (sizeof(sprites) / sizeof(sprites[0])) }, { 'd', "Frames per test", 100, 1, 999 }, + { 'c', "GRCG sprite color", 2, 0x1, 0xF }, }}; const Palette4 PALETTE = {