gTable12 is not a typo
Index a global array with a constant, and the scaling, the add — all of it — happens at compile time. The element's address is just base + constant, and that constant folds directly into the relocation. Here's thirdSlot, which returns element 3 of the global word array gTable:
lui v0, %hi(gTable12)
lw v0, %lo(gTable12)(v0)
jr ra
nop
Two instructions — identical to reading a plain global. The only trace of the array is in how the diff prints the relocation: the byte offset is glued onto the symbol name, so gTable12 means "gTable, plus 12 bytes". Twelve bytes into an array of 4-byte words is element 3: gTable[3].
That glued number is always in bytes, so recovering the C index means dividing by the element size — the size given by the array's declaration. Misread gTable12 as "element 12" and your compile will reach for a slot far away; the diff will show mismatched addends immediately, which is your cue to recheck the arithmetic.
The target reads one constant slot of a global word array. Read the addend, do the division, write the index.
Your task
extern s32 gGrid[40]; is declared for you. Write func_801965f4 to reproduce the target assembly.