Ah, that script. I have a version of my own. Considering the link is no longer useful, I'll make a direct post here:
Download SimCityViewer.luaLanguage: lua
--lua script for snes9x rerecording+lua. For SimCity (U)
--Original by Dammit. Mostly rewritten by FatRatKnight, Feb 10 2010.
local ShowNum, ShowGrid= true, true
local ShowHex= false
local Control= 2
local SwitchNum, SwitchGrid= "X","Y"
local SwitchVal= "A"
local SwitchDisp= "B"
local Brd,Bck= {},{}
Brd[0],Bck[0]= 0x00000060,0x00000000 --Black ; value zero
Brd[1],Bck[1]= 0x005A00C0,0x005A0038 --V.Dark Green; Rock bottom, non-zero
Brd[2],Bck[2]= 0x008C00C0,0x008C0038 --Dark Green ; Pitifully low
Brd[3],Bck[3]= 0x00BD00C0,0x00BD0038 --Green ; Somewhat low
Brd[4],Bck[4]= 0x00FF00C0,0x00FF0038 --Bright Green; Near-mid, but low
Brd[5],Bck[5]= 0xFFFF00C0,0xFFFF0038 --Yellow ; Near-mid, but high
Brd[6],Bck[6]= 0xFFB500C0,0xFFB50038 --YellowOrange; Somewhat high
Brd[7],Bck[7]= 0xFF6300C0,0xFF630038 --Orange ; Rather high, I say
Brd[8],Bck[8]= 0xFF0000C0,0xFF000038 --Pure red ; Absolute top
local view -- Declaring that view exists here so functions can access it!
local FieldW , FieldH= 120 , 100 -- Size of game's map
local CamW , CamH = 32 , 28 -- Size of camera
local CamX,CamY= 0x7E01BD,0x7E01BF -- Memory where camera position is stored
--*****************************************************************************
local function Byte_U(Index,TileX,TileY)
--*****************************************************************************
local Bx= view[Index]["Bx"]
local Offset= math.floor(TileX/Bx) + math.floor(TileY/Bx)*math.floor(FieldW/Bx)
local Val= memory.readbyte(view[Index]["addr"]+Offset)
local C= 0
if Val ~= 0 then
C= math.floor((Val+0x1F)/0x20)
end
return Bck[C], Brd[C], Val
end
--*****************************************************************************
local function Bit___(Index,TileX,TileY) --Assumed box size is 1
--*****************************************************************************
local Offset= math.floor(TileX/8) + TileY*math.floor(FieldW/8)
local WhichBit= bit.rshift(0x80 , TileX % 8)
local Test= memory.readbyte(view[Index]["addr"]+Offset)
Test= (bit.band(Test,WhichBit) ~= 0)
local Background, Border= 0x00B50038, 0x00B500C0
if Test then Background, Border= 0xFF840038, 0xFF8400C0 end
return Background, Border, nil
end
--*****************************************************************************
local function Word_S(Index,TileX,TileY) --Assumed it's Pop.Growth
--*****************************************************************************
local Bx= view[Index]["Bx"]
local Offset= math.floor(TileX/Bx) + math.floor(TileY/Bx)*math.floor(FieldW/Bx)
Val= memory.readwordsigned(view[Index]["addr"]+Offset*2)
local C= 0
if Val ~= 0 then
C= math.floor(( Val+300 )/60)
C= math.min(math.max( 1,C ),8)
end
return Bck[C], Brd[C], Val
end
view = { -- Now define view, containing above functions
-- {addr=0x7F0000, Mthd=Byte_U, Bx=4, name="Mystery" }, -- Was it charts?
{addr=0x7F6B00, Mthd=Byte_U, Bx=2, name="Land value" },
{addr=0x7F76B8, Mthd=Byte_U, Bx=2, name="Crime" },
{addr=0x7F8270, Mthd=Byte_U, Bx=2, name="Pollution" },
{addr=0x7F8E28, Mthd=Byte_U, Bx=2, name="Pop.density"},
{addr=0x7F99E0, Mthd=Byte_U, Bx=2, name="Traffic" },
{addr=0x7FA598, Mthd=Bit___, Bx=1, name="Power" },
{addr=0x7FAB74, Mthd=Byte_U, Bx=4, name="LVmod:Parks"},
{addr=0x7FAE62, Mthd=Word_S, Bx=8, name="Growth rate"},
{addr=0x7FAFE8, Mthd=Byte_U, Bx=8, name="Police" },
{addr=0x7FB0AB, Mthd=Byte_U, Bx=8, name="Fire" }--,
-- {addr=0x7FB16E, Mthd=Word_S, Bx=8, name="Tmp_Fire" },
-- {addr=0x7FB2F4, Mthd=Word_S, Bx=8, name="Tmp_Police" },
-- {addr=0x7FB47A, Mthd=Word_S, Bx=8, name="Com_Rate?" },
-- {addr=0x7FB600, Mthd=Byte_U, Bx=2, name="AltPollute1"},
-- {addr=0x7FC1B8, Mthd=Byte_U, Bx=2, name="AltPollute2"},
-- {addr=0x7FCD70, Mthd=Byte_U, Bx=4, name="LndVal.Mod "},
-- {addr=0x7FD05E, Mthd=Word_S, Bx=8, name="Tmp2_Police"}
}
--*****************************************************************************
local function FindCam()
--*****************************************************************************
return memory.readwordsigned(CamX), memory.readwordsigned(CamY)
end
--*****************************************************************************
local function ToDec(Num)
--*****************************************************************************
if not Num then return end
return string.format("%d",Num)
end
--*****************************************************************************
local function ToHex(Num)
--*****************************************************************************
if not Num then return end
if Num < 0 then
Num= Num+0x10000
end
return string.format("%X",Num)
end
local ToString= ToDec
if ShowHex == true then ToString= ToHex end
--*****************************************************************************
local function ShowStats(Left,Top,Right,Bottom, Fill,Bord,Str)
--*****************************************************************************
if ShowGrid then gui.box(Left,Top,Right,Bottom,Fill,Bord) end
if Str and ShowNum then
if Right-Left >= string.len(Str)*4+3 then
gui.text(Left+2,Top+1,Str)
end
end
end
--*****************************************************************************
local function DisplayScreen(Index)
--*****************************************************************************
local Left,Top= FindCam()
local BoxSize= view[Index]["Bx"]
local ReadData= view[Index]["Mthd"]
local TileY= math.floor(math.max(Top, 0)/BoxSize)*BoxSize
repeat
local Temp= math.min(TileY+BoxSize,FieldH+1)
local BoxUp= math.max((TileY-Top)*8,0)
local BoxDn= math.min((Temp-Top)*8 - 1 , 223)
local TileX= math.floor(math.max(Left, 0)/BoxSize)*BoxSize
repeat
Temp= math.min(TileX+BoxSize,FieldW+1)
local BoxLf= math.max((TileX-Left)*8,0)
local BoxRt= math.min((Temp-Left)*8 - 1 , 255)
local Fill,Bord,Num= ReadData(Index,TileX,TileY)
Num= ToString(Num)
ShowStats(BoxLf,BoxUp,BoxRt,BoxDn, Fill,Bord,Num)
TileX= TileX+BoxSize
until (TileX >= Left+CamW) or (TileX >= FieldW)
TileY= TileY+BoxSize
until (TileY >= Top+CamH) or (TileY >= FieldH)
end
local Index= 1
--*****************************************************************************
local function DisplayStuff()
--*****************************************************************************
local mode= memory.readbyte(0x7E0009)
if (mode == 31) or (mode == 36) then
if ShowNum or ShowGrid then
DisplayScreen(Index)
gui.text(200,215,view[Index].name,0x00FF00FF)
end
end
end
gui.register(DisplayStuff)
local LastBtn= {}
--*****************************************************************************
while true do
--*****************************************************************************
local Btn= joypad.get(Control)
if Btn[SwitchVal] and not LastBtn[SwitchVal] then
Index= Index+1
if not view[Index] then Index= 1 end
end
if Btn[SwitchNum] and not LastBtn[SwitchNum] then
ShowNum= not ShowNum
end
if Btn[SwitchGrid] and not LastBtn[SwitchGrid] then
ShowGrid= not ShowGrid
end
LastBtn= Btn
emu.frameadvance()
end
Should work with the latest Snes9x 1.51 we have. If not, let me know.