User File #47351426954794975

Upload All User Files

#47351426954794975 - Kuru Kuru Kururin - OoB view v1.1 VBA

Kururin OoO view v1.1 VBA.lua
850 downloads
Uploaded 5/25/2018 11:13 AM by ThunderAxe31 (see all 111)
--Kuru Kuru Kururin - OoB view v1.1 (converted for VBA-rr) by ThunderAxe31
--TODO:
--find all wall tile types
--helirin display

local addr_map_x_size = 0x0300313E
local addr_map_y_size = 0x0300313C
local addr_x_pos      = 0x03004546
local addr_y_pos      = 0x0300454A
local addr_rotate     = 0x03004573

local x_end = 30
local y_end = 20

while true do
	local map_x_size = memory.readword(addr_map_x_size)
	local map_y_size = memory.readword(addr_map_y_size)
	local x_pos = memory.readwordsigned(addr_x_pos) -104
	local y_pos = (memory.readwordsigned(addr_y_pos)  -80)%(map_x_size*8)
	local x_mod = x_pos%8
	local y_mod = y_pos%8
	local x_pos_floor = math.floor(x_pos/8)
	local y_pos_floor = math.floor(y_pos/8)
	
	gui.rect(0, 0, 239, 159, 0xFFFFFFFF)
	
	for y=0, y_end do
		for x=0, x_end do
			local tile_addr = (x_pos_floor +x)*2 +((y_pos_floor +y) %map_x_size) *map_y_size *2
			local tile_type = memory.readword(0x02000000 +tile_addr)
			local x_tile = x*8 -x_mod
			local y_tile = y*8 -y_mod
			if (tile_type == 0x0003) or (tile_type == 0x0403) or (tile_type == 0x0803) or (tile_type == 0x0C03) or (tile_type == 0x0004) or (tile_type == 0x0404) or (tile_type == 0x0804) or (tile_type == 0x0C04) or (tile_type == 0x0021) or (tile_type == 0x0421) or (tile_type == 0x0821) or (tile_type == 0x0C21) or (tile_type == 0x0033) or (tile_type == 0x0433) or (tile_type == 0x0833) or (tile_type == 0x0C33) or (tile_type == 0x0041) or (tile_type == 0x041) or (tile_type == 0x0841) or (tile_type == 0x0C41) or (tile_type == 0x0035) or (tile_type == 0x0435) or (tile_type == 0x0835) or (tile_type == 0x0C35) or (tile_type == 0x0030) or (tile_type == 0x0430) or (tile_type == 0x0830) or (tile_type == 0x0C30) or (tile_type == 0x0024) or (tile_type == 0x0424) or (tile_type == 0x0824) or (tile_type == 0x0C24) or (tile_type == 0x0005) or (tile_type == 0x0405) or (tile_type == 0x0805) or (tile_type == 0x0C05) then
				gui.rect(x_tile, y_tile, x_tile +7, y_tile +7, null, 0xFF0000FF)
			elseif (tile_type == 0x0063) or (tile_type == 0x0463) or (tile_type == 0x0863) then
				gui.line(x_tile+4,y_tile+3,x_tile+7,y_tile, 0xFF0000FF)
				gui.line(x_tile+7,y_tile,x_tile+7,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+7,x_tile+4,y_tile+4, 0xFF0000FF)
				gui.line(x_tile+4,y_tile+4,x_tile+4,y_tile+3, 0xFF0000FF)
			elseif (tile_type == 0x0C63) then
				gui.line(x_tile,y_tile,x_tile+3,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+3,x_tile+3,y_tile+4, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+4,x_tile,y_tile+7, 0xFF0000FF)
				gui.line(x_tile,y_tile+7,x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x000B) or (tile_type == 0x0010) then
				gui.line(x_tile +7, y_tile, x_tile +7, y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7, y_tile +7, x_tile, y_tile +7, 0xFF0000FF)
				gui.line(x_tile, y_tile +7, x_tile +7, y_tile, 0xFF0000FF)
			elseif (tile_type == 0x040B) then
				gui.line(x_tile,y_tile, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x080B) then
				gui.line(x_tile,y_tile, x_tile +7,y_tile, 0xFF0000FF)
				gui.line(x_tile +7,y_tile, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0C0B) or (tile_type == 0x0C10) then
				gui.line(x_tile,y_tile, x_tile +7,y_tile,0xFF0000FF)
				gui.line(x_tile +7,y_tile, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0072) then
				gui.line(x_tile +7,y_tile +4, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile +7,y_tile +4, 0xFF0000FF)
			elseif (tile_type == 0x0472) then
				gui.line(x_tile,y_tile +4, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile,y_tile +4, 0xFF0000FF)
			elseif (tile_type == 0x0872) then
				gui.line(x_tile,y_tile, x_tile +7,y_tile, 0xFF0000FF)
				gui.line(x_tile +7,y_tile, x_tile +7,y_tile +3, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +3, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0C72) then
				gui.line(x_tile,y_tile, x_tile +7,y_tile, 0xFF0000FF)
				gui.line(x_tile +7,y_tile, x_tile,y_tile +3, 0xFF0000FF)
				gui.line(x_tile,y_tile +3, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0073) or (tile_type == 0x0042) then
				gui.line(x_tile,y_tile +3, x_tile +7,y_tile, 0xFF0000FF)
				gui.line(x_tile +7,y_tile, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile,y_tile +3, 0xFF0000FF)
			elseif (tile_type == 0x0473) or (tile_type == 0x0442) then
				gui.line(x_tile,y_tile, x_tile +7,y_tile +3, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +3, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0873) or (tile_type == 0x0842) then
				gui.line(x_tile,y_tile, x_tile +7,y_tile, 0xFF0000FF)
				gui.line(x_tile +7,y_tile, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile,y_tile +4, 0xFF0000FF)
				gui.line(x_tile,y_tile +4, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0C73) or (tile_type == 0x0C42) then
				gui.line(x_tile,y_tile, x_tile +7,y_tile, 0xFF0000FF)
				gui.line(x_tile +7,y_tile, x_tile +7,y_tile +4, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +4, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x003D) or (tile_type == 0x0C36) then
				gui.line(x_tile +3,y_tile, x_tile +7,y_tile, 0xFF0000FF)
				gui.line(x_tile +7,y_tile, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile +3,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x043D) or (tile_type == 0x0836) then
				gui.line(x_tile,y_tile, x_tile +4,y_tile, 0xFF0000FF)
				gui.line(x_tile +4,y_tile, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x083D) or (tile_type == 0x0436) then
				gui.line(x_tile,y_tile, x_tile +7,y_tile, 0xFF0000FF)
				gui.line(x_tile +7,y_tile, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile +3,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +3,y_tile +7, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0C3D) or (tile_type == 0x0036) then
				gui.line(x_tile,y_tile, x_tile +7,y_tile, 0xFF0000FF)
				gui.line(x_tile +7,y_tile, x_tile +4,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +4,y_tile +7, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x001D) or (tile_type == 0x0034) then
				gui.line(x_tile +7,y_tile, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile +4,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +4,y_tile +7, x_tile +7,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x041D) then
				gui.line(x_tile,y_tile, x_tile +3,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +3,y_tile +7, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x081D) then
				gui.line(x_tile +4,y_tile, x_tile +7,y_tile, 0xFF0000FF)
				gui.line(x_tile +7,y_tile, x_tile +7,y_tile +7, 0xFF0000FF)
				gui.line(x_tile +7,y_tile +7, x_tile +4,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0C1D) then
				gui.line(x_tile,y_tile, x_tile +3,y_tile, 0xFF0000FF)
				gui.line(x_tile +3,y_tile, x_tile,y_tile +7, 0xFF0000FF)
				gui.line(x_tile,y_tile +7, x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0009) or (tile_type == 0x0409) then
				gui.rect(x_tile, y_tile +4, x_tile +7, y_tile +7, null, 0xFF0000FF)
			elseif (tile_type == 0x006D) or (tile_type == 0x046D) then
				gui.rect(x_tile, y_tile, x_tile +7, y_tile +3, null, 0xFF0000FF)
			elseif (tile_type == 0x0864) then
				gui.line(x_tile,y_tile,x_tile+4,y_tile+4, 0xFF0000FF)
				gui.line(x_tile+4,y_tile+4,x_tile+7,y_tile+4, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+4,x_tile+7,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+7,x_tile,y_tile+7, 0xFF0000FF)
				gui.line(x_tile,y_tile+7,x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0C64) then
				gui.line(x_tile,y_tile+4,x_tile+3,y_tile+4, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+4,x_tile+7,y_tile, 0xFF0000FF)
				gui.line(x_tile+7,y_tile,x_tile+7,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+7,x_tile,y_tile+7, 0xFF0000FF)
				gui.line(x_tile,y_tile+7,x_tile,y_tile+4, 0xFF0000FF)
			elseif (tile_type == 0x0865) then
				gui.line(x_tile,y_tile,x_tile+7,y_tile, 0xFF0000FF)
				gui.line(x_tile+7,y_tile,x_tile+7,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+3,x_tile+3,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+3,x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0C65) then
				gui.line(x_tile,y_tile,x_tile+7,y_tile, 0xFF0000FF)
				gui.line(x_tile+7,y_tile,x_tile+4,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+4,y_tile+3,x_tile,y_tile+3, 0xFF0000FF)
				gui.line(x_tile,y_tile+3,x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0026) or (tile_type == 0x0409) then
				gui.rect(x_tile +4, y_tile, x_tile +7, y_tile +7, null, 0xFF0000FF)
			elseif (tile_type == 0x002F) or (tile_type == 0x046D) then
				gui.rect(x_tile, y_tile, x_tile +3, y_tile +7, null, 0xFF0000FF)
			elseif (tile_type == 0x0467) then
				gui.line(x_tile,y_tile,x_tile+7,y_tile, 0xFF0000FF)
				gui.line(x_tile+7,y_tile,x_tile+7,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+7,x_tile+4,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+4,y_tile+7,x_tile+4,y_tile+4, 0xFF0000FF)
				gui.line(x_tile+4,y_tile+4,x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0C67) then
				gui.line(x_tile+4,y_tile,x_tile+7,y_tile, 0xFF0000FF)
				gui.line(x_tile+7,y_tile,x_tile+7,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+7,x_tile,y_tile+7, 0xFF0000FF)
				gui.line(x_tile,y_tile+7,x_tile+4,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+4,y_tile+3,x_tile+4,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0466) then
				gui.line(x_tile,y_tile,x_tile+3,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+3,x_tile+3,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+7,x_tile,y_tile+7, 0xFF0000FF)
				gui.line(x_tile,y_tile+7,x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0C66) then
				gui.line(x_tile,y_tile,x_tile+3,y_tile, 0xFF0000FF)
				gui.line(x_tile+3,y_tile,x_tile+3,y_tile+4, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+4,x_tile,y_tile+7, 0xFF0000FF)
				gui.line(x_tile,y_tile+7,x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0067) then
				gui.line(x_tile,y_tile,x_tile+7,y_tile, 0xFF0000FF)
				gui.line(x_tile+7,y_tile,x_tile+3,y_tile+4, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+4,x_tile+3,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+7,x_tile,y_tile+7, 0xFF0000FF)
				gui.line(x_tile,y_tile+7,x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0867) then
				gui.line(x_tile,y_tile,x_tile+3,y_tile, 0xFF0000FF)
				gui.line(x_tile+3,y_tile,x_tile+3,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+3,x_tile+7,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+7,x_tile,y_tile+7, 0xFF0000FF)
				gui.line(x_tile,y_tile+7,x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0066) then
				gui.line(x_tile+7,y_tile,x_tile+7,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+7,x_tile+4,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+4,y_tile+7,x_tile+4,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+4,y_tile+3,x_tile+7,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0866) then
				gui.line(x_tile+4,y_tile,x_tile+7,y_tile, 0xFF0000FF)
				gui.line(x_tile+7,y_tile,x_tile+7,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+7,x_tile+4,y_tile+4, 0xFF0000FF)
				gui.line(x_tile+4,y_tile+4,x_tile+4,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0064) then
				gui.line(x_tile,y_tile,x_tile+7,y_tile, 0xFF0000FF)
				gui.line(x_tile+7,y_tile,x_tile+7,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+3,x_tile+4,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+4,y_tile+3,x_tile,y_tile+7, 0xFF0000FF)
				gui.line(x_tile,y_tile+7,x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0464) then
				gui.line(x_tile,y_tile,x_tile+7,y_tile, 0xFF0000FF)
				gui.line(x_tile+7,y_tile,x_tile+7,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+7,x_tile+3,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+3,x_tile,y_tile+3, 0xFF0000FF)
				gui.line(x_tile,y_tile+3,x_tile,y_tile, 0xFF0000FF)
			elseif (tile_type == 0x0065) then
				gui.line(x_tile,y_tile+7,x_tile+4,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+4,y_tile+3,x_tile+7,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+3,x_tile+7,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+7,x_tile,y_tile+7, 0xFF0000FF)
			elseif (tile_type == 0x0465) then
				gui.line(x_tile,y_tile+3,x_tile+3,y_tile+3, 0xFF0000FF)
				gui.line(x_tile+3,y_tile+3,x_tile+7,y_tile+7, 0xFF0000FF)
				gui.line(x_tile+7,y_tile+7,x_tile,y_tile+7, 0xFF0000FF)
				gui.line(x_tile,y_tile+7,x_tile,y_tile+3, 0xFF0000FF)
			elseif (tile_type == 0x00FB) or (tile_type == 0x00FD) or (tile_type == 0x00EA) or (tile_type == 0x00ED) then
				gui.rect(x_tile, y_tile, x_tile +7, y_tile +7, null, 0x4040FFFF)
			elseif (tile_type == 0x00FE) or (tile_type == 0x04FE) or (tile_type == 0x08FE) or (tile_type == 0x0CFE) or (tile_type == 0x00FF) or (tile_type == 0x04FF) or (tile_type == 0x08FF) or (tile_type == 0x0CFF) then
				gui.rect(x_tile, y_tile, x_tile +7, y_tile +7, null, 0xD0D000FF)
			end
		end
	end
	
	gui.line(120, 77, 120, 83, 0x000000FF)
	gui.line(117, 80, 123, 80, 0x000000FF)
	
	vba.frameadvance()
end