User File #38027689715276658

Upload All User Files

#38027689715276658 - Crash Bandicoot N-Tranced - lua v1.0

Crash N-Tranced - v1.0 BizHawk.lua
1057 downloads
Uploaded 3/31/2017 1:41 PM by Spikestuff (see all 287)
-- Crash N-Tranced lua v1.0 BizHawk
-- This is Community Work Please Help
-- Join in add updates of your own and add your name

-- Values Found by: Spikestuff
-- Script Code by: Spikestuff

memory.usememorydomain("EWRAM")

function data()
lvl = memory.readbyte(0x002744)
chka = memory.read_u8(0x015438)
chkb = memory.read_u8(0x015439)
chkc = memory.read_u8(0x0076DD)
chkd = memory.read_u8(0x0076E5)
--[[
gui.text(0,150,"Level: " .. lvl+1,"red")
gui.text(175,60,chka,"blue")
gui.text(215,60,chkb,"blue")
gui.text(175,76,chkc,"orange") -- 2nd Check
gui.text(215,76,chkd,"orange") -- 2nd Check
]]--
end

function normal_lvl()
data()
	if chka == 0 and chkb == 0 or chka == 27 and chkb == 59 or chka == 14 and chkb == 12 or chkc == 8 and chkd == 126 then else
		gui.text(0,70,"Pixel X: " .. memory.read_u32_le(0x014FD8))
		gui.text(0,86,"Pixel Y: " .. memory.read_u32_le(0x014FDC))
		gui.text(0,102,"Speed X: " .. memory.read_s16_le(0x015058))
		gui.text(0,118,"Speed Y: " .. memory.read_s16_le(0x01505C))
	end
	
	if lvl < 6 then
		if chka == 0 and chkb == 0 or chka == 27 and chkb == 59 or chka == 14 and chkb == 12 or chkc == 8 and chkd == 126 then
		else if lvl == 5 and chka == 212 and chkb == 86 then -- Level 6
			gui.text(0,276,"Slide Time: 22/" .. memory.read_s16_le(0x21844),"greenyellow")
			gui.text(0,292," Spin Time: 23/" .. memory.read_s16_le(0x21844),"greenyellow")
		else
			gui.text(0,276,"Slide Time: 22/" .. memory.read_s16_le(0x015444),"yellow")
			gui.text(0,292," Spin Time: 23/" .. memory.read_s16_le(0x015444),"yellow")
		end
	end
end
end

function bonus()
data()
	gui.text(0,70,"Pixel X: " .. memory.read_u32_le(0x0153F0))
	gui.text(0,86,"Pixel Y: " .. memory.read_u32_le(0x0153F4))
	gui.text(0,102,"Speed X: " .. memory.read_s16_le(0x015470))
	gui.text(0,118,"Speed Y: " .. memory.read_s16_le(0x015474))

	if lvl < 6 then
		gui.text(0,276,"Slide Time: 22/" .. memory.read_s16_le(0x01585C),"orange")
		gui.text(0,292," Spin Time: 23/" .. memory.read_s16_le(0x01585C),"orange")
	end
end

function warp_room()
	-- Mask Level Checking
	gui.text(175,44,"Mask Level: " .. memory.readbyte(0x0026F0),"yellow")
end

function timer()
data()

	if chkc ~= 8 and chkd ~= 126 then
		gui.text(0,134,memory.read_s16_le(0x0001CC),"orange") -- timer main/bonus levels
		else if lvl == 3 then
			gui.text(0,134,memory.read_s16_le(0x01A9B0),"orange") -- globe trottin' // Fails When Falling/Going Down Ramp
		else if lvl == 8 then
			gui.text(0,134,memory.read_s16_le(0x01AB50),"orange") -- barrel roll // Fails When Falling/Going Down Ramp
		else if lvl == 16 then
			gui.text(0,134,memory.read_s16_le(0x01AA70),"orange") -- rocks can roll // Fails When Falling/Going Down Ramp
		else
			gui.text(0,134,memory.read_s16_le(0x000F80),"orange") -- wakeboard/space
			end
		end
	end
end
end

while true do
	data()	
	timer()
	if chka == 212 and chkb == 86 then
	warp_room()
	else if chkc == 4 and chkd == 122 then
	bonus()
	else
	normal_lvl()
	end end
	
	emu.frameadvance()
end