User File #637981889562233969

Upload All User Files

#637981889562233969 - Darkman object data

Darkman.lua
Game: Darkman ( NES, see all files )
96 downloads
Uploaded 9/7/2022 11:09 PM by Denial140 (see all 20)
Displays object slots, HP, timers and states onscreen.
emu.speedmode("normal")

xH = {0, 0, 0, 0, 0, 0, 0, 0, 0}
xL = {0, 0, 0, 0, 0, 0, 0, 0, 0}
xS = {0, 0, 0, 0, 0, 0, 0, 0, 0}
yH = {0, 0, 0, 0, 0, 0, 0, 0, 0}
yL = {0, 0, 0, 0, 0, 0, 0, 0, 0}
yS = {0, 0, 0, 0, 0, 0, 0, 0, 0}
hp = {0, 0, 0, 0, 0, 0, 0, 0, 0}
hitTimer = {0, 0, 0, 0, 0, 0, 0, 0, 0}
state = {0, 0, 0, 0, 0, 0, 0, 0, 0}
test = {0, 0, 0, 0, 0, 0, 0, 0, 0}



while true do
	cameraL = memory.readbyte(0x005A)
	cameraH = memory.readbytesigned(0x005B)
	frame = memory.readbyte(0x0338)
	plat = memory.readbyte(0x337)
	
	for i = 1,9 do
		xH[i] = memory.readbytesigned(0x00B6+i)
		xL[i] = memory.readbyte(0x00AC+i)
		yH[i] = memory.readbytesigned(0x00CA+i)
		yL[i] = memory.readbyte(0x00C0+i)
		hp[i] = memory.readbyte(0x037C+i)
		hitTimer[i] = memory.readbyte(0x00D4+i)
		state[i] = memory.readbyte(0x03C2+i)
		test[i] = memory.readbyte(0x03B8+i)
		
		if (yH[i] > 0) then
			xS[i] = xL[i]
			yS[i] = 256*(yH[i] - cameraH) + (yL[i] - cameraL)
		else
			xS[i] = 256*(xH[i] - cameraH) + (xL[i] - cameraL)
			yS[i] = yL[i]
		end;
		
		gui.text(0,20,frame)
		gui.text(0,40,plat)
		gui.text(xS[i], yS[i], i)
		gui.text(xS[i], yS[i] + 10, hp[i])
		gui.text(xS[i], yS[i] + 20, hitTimer[i])
		gui.text(xS[i], yS[i] + 30, state[i])
		gui.text(xS[i], yS[i] + 40, test[i])
	end;
	
	emu.frameadvance()
end