//
// traceColorForIndex from 0x369c6c to 0x369d92 (294 bytes)
//
// 2 xrefs:
// > drawTrace @ 0x378190
// > processTrace @ 0x379578
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall traceColorForIndex(int a1)
{
unsigned __int8 v1; // r3
__int16 v2; // r2
__int16 *v3; // r3
__int16 v5; // [sp+4h] [bp-8h]
v1 = 0;
switch ( a1 % 20 )
{
case 0:
v3 = &word_9AA6C6;
v2 = -1;
goto LABEL_23;
case 1:
v3 = &word_9AA6C9;
v2 = 255;
goto LABEL_23;
case 2:
v3 = &word_9AA6CC;
v2 = -256;
goto LABEL_23;
case 3:
v5 = 255;
return (unsigned __int8)v5 | (unsigned __int16)(HIBYTE(v5) << 8) | (v1 << 16);
case 4:
v5 = -256;
return (unsigned __int8)v5 | (unsigned __int16)(HIBYTE(v5) << 8) | (v1 << 16);
case 5:
v5 = 0;
v1 = -1;
return (unsigned __int8)v5 | (unsigned __int16)(HIBYTE(v5) << 8) | (v1 << 16);
case 6:
v3 = &word_9AA6CF;
v2 = -32513;
goto LABEL_23;
case 7:
v3 = &word_9AA6D2;
v2 = 128;
goto LABEL_23;
case 8:
v3 = &word_9AA6D5;
v2 = -256;
goto LABEL_23;
case 9:
v3 = &word_9AA6D8;
v2 = 0x8000;
goto LABEL_23;
case 10:
v3 = &word_9AA6DB;
v2 = 255;
goto LABEL_23;
case 11:
v3 = &word_9AA6DE;
v2 = -128;
goto LABEL_23;
case 12:
v3 = &word_9AA6E1;
v2 = -32513;
goto LABEL_23;
case 13:
v3 = &word_9AA6E4;
v2 = -128;
goto LABEL_23;
case 14:
v3 = &word_9AA6E7;
v2 = -16129;
goto LABEL_23;
case 15:
v3 = &word_9AA6EA;
v2 = -192;
goto LABEL_23;
case 16:
v3 = &word_9AA6ED;
v2 = -256;
goto LABEL_23;
case 17:
v3 = &word_9AA6F0;
v2 = -16384;
goto LABEL_23;
case 18:
v3 = &word_9AA6F3;
v2 = 192;
goto LABEL_23;
case 19:
v3 = &word_9AA6F6;
v2 = 255;
goto LABEL_23;
default:
v3 = &word_9AA6F9;
v2 = -1;
LABEL_23:
v1 = *((_BYTE *)v3 + 2);
v5 = v2;
return (unsigned __int8)v5 | (unsigned __int16)(HIBYTE(v5) << 8) | (v1 << 16);
}
}