User File #49487402668401237

Upload All User Files

#49487402668401237 - GBA Pac-Man World - cam hack

GBA Pac-Man World - cam hack.lua
Game: Pac-Man World ( GBA, see all files )
657 downloads
Uploaded 8/29/2018 3:53 PM by ThunderAxe31 (see all 111)
Just as the name says: it forces the camera to be perfectly stuck on Pac-Man's position.
Note that it causes desync if used before approaching room exits.
--GBA Pac-Man World - cam hack v1.0 by ThunderAxe31

local x_player_addr = 0x000B40
local y_player_addr = 0x000B44
local z_player_addr = 0x000B48

local x_camera_addr = 0x000D08
local y_camera_addr = 0x000D0C


if memory.usememorydomain("EWRAM") then
	while true do
		
		local x_player = memory.read_s32_le(x_player_addr)
		local y_player = memory.read_s32_le(y_player_addr)
		local z_player = memory.read_s32_le(z_player_addr)
		
		memory.write_s32_le(x_camera_addr,  x_player -math.floor(y_player/4))
		memory.write_s32_le(y_camera_addr, -z_player +math.floor(y_player/2))
		
		emu.frameadvance()
	end
end