0% found this document useful (0 votes)
8 views5 pages

Sonic RSDK Debug Mode Script

This document outlines the Debug Mode Object script for the RSDK Project: Sonic 1/Sonic 2, authored by Christian Whitehead and Simon Thomley. It includes function declarations, static values, and tables for managing debug mode functionalities such as spawning and drawing objects. The script also handles user input for touch controls and manages object states and interactions within the game environment.

Uploaded by

josepharturo2009
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Sonic RSDK Debug Mode Script

This document outlines the Debug Mode Object script for the RSDK Project: Sonic 1/Sonic 2, authored by Christian Whitehead and Simon Thomley. It includes function declarations, static values, and tables for managing debug mode functionalities such as spawning and drawing objects. The script also handles user input for touch controls and manages object states and interactions within the game environment.

Uploaded by

josepharturo2009
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

// ----------------------------------

// RSDK Project: Sonic 1/Sonic 2


// Script Description: Debug Mode Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

//-------Aliases-------//
private alias 9 : TYPE_DEBUGMODE

// Function declarations
reserve function DebugMode_SpawnBlank
reserve function DebugMode_DrawBlank

// Static Values
public value DebugMode_ObjCount = 0;

// Tables
public table DebugMode_TypesTable
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
end table

public table DebugMode_DrawTable


0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
end table

public table DebugMode_SpawnTable


0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
end table

function DebugMode_SpawnBlank
temp0 = 0
end function

function DebugMode_DrawBlank
DrawSprite(0)
end function

event ObjectMain
if [Link] == 1
CheckTouchRect(0, 96, [Link], [Link])
if checkResult > -1
arrayPos0 = checkResult
temp0 = touchscreen[arrayPos0].xpos
temp0 -= saveRAM[39]
temp1 = touchscreen[arrayPos0].ypos
temp1 -= saveRAM[40]
ATan2(temp2, temp0, temp1)
temp2 += 16
temp2 &= 255
temp2 >>= 5
switch temp2
case 0
[Link] = 1
break
case 1
[Link] = 1
[Link] = 1
break
case 2
[Link] = 1
break
case 3
[Link] = 1
[Link] = 1
break
case 4
[Link] = 1
break
case 5
[Link] = 1
[Link] = 1
break
case 6
[Link] = 1
break
case 7
[Link] = 1
[Link] = 1
break
end switch
end if
temp0 = [Link]
temp0 -= 48
temp1 = temp0
temp1 += 96
CheckTouchRect(temp0, 0, temp1, 56)
if checkResult > -1
arrayPos0 = checkResult
if touchscreen[arrayPos0].xpos > [Link]
if touchJump == 0
object.value17++
if object.value17 >= DebugMode_ObjCount
object.value17 = 0
end if
end if
touchJump = 1
else
if touchJump == 0
object.value17--
if object.value17 < 0
object.value17 += DebugMode_ObjCount
end if
end if
touchJump = 1
end if
else
CheckTouchRect([Link], 96, [Link], 240)
switch checkResult
case -1
touchJump = 0
break
case 0
[Link] = 1
if touchJump == 0
[Link] |= [Link]
end if
touchJump = [Link]
break
end switch
end if
temp0 = [Link]
temp0 -= 88
CheckTouchRect(temp0, 0, [Link], 40)
if checkResult > -1
PlaySfx(SfxName[Menu Back], 0)
[Link] = 5
end if
if [Link] == 1
PlaySfx(SfxName[Menu Back], 0)
[Link] = 5
end if
end if
CheckTouchRect(0, 0, 112, 56)
if checkResult > -1
[Link] = 1
end if
if touchDebug == 0
[Link] |= [Link]
end if
touchDebug = [Link]
temp0 = 0
if [Link] == 1
[Link] -= [Link]
temp0 = 1
end if
if [Link] == 1
[Link] += [Link]
temp0 = 1
end if
if [Link] == 1
[Link] -= [Link]
temp0 = 1
end if
if [Link] == 1
[Link] += [Link]
temp0 = 1
end if
if temp0 == 1
[Link] += 0xC00
if [Link] > 0x100000
[Link] = 0x100000
end if
else
[Link] = 0
end if
object.value3 = 0
object.value4 = 0
if [Link] == 1
if [Link] == 1
[Link] = TypeName[Tails Object]
else
[Link] = TypeName[Player Object]
end if
[Link] = 0
[Link] = 0
[Link] = 0
[Link] = PlayerObject_HandleAir
[Link] = ANI_WALKING
[Link] = 0
[Link] = 0
[Link] = 0
[Link] = -1
object.value18 = 4
[Link] = 1
[Link] = 1
[Link] = 1
else
if [Link] == 1
object.value17++
if object.value17 >= DebugMode_ObjCount
object.value17 = 0
end if
end if
if [Link] == 1
if [Link] == 1
object.value17--
if object.value17 < 0
object.value17 += DebugMode_ObjCount
end if
end if
else
if [Link] == 1
GetTableValue(temp0, object.value17, DebugMode_SpawnTable)
CallFunction(temp0)
object[tempObjectPos].priority = PRIORITY_XBOUNDS_DESTROY
end if
end if
end if
end event
event ObjectDraw
GetTableValue([Link], object.value17, DebugMode_TypesTable)
GetTableValue(temp0, object.value17, DebugMode_DrawTable)
CallFunction(temp0)
[Link] = TypeName[Debug Mode]
end event

event ObjectStartup
LoadSpriteSheet("Global/[Link]")
SpriteFrame(-8, -8, 16, 16, 188, 239)
DebugMode_ObjCount = 0
temp0 = 0
while temp0 < 128
SetTableValue(TypeName[Debug Mode], temp0, DebugMode_TypesTable)
SetTableValue(DebugMode_DrawBlank, temp0, DebugMode_DrawTable)
SetTableValue(DebugMode_SpawnBlank, temp0, DebugMode_SpawnTable)
temp0++
loop
end event

event RSDKDraw
DrawSprite(0)
end event

event RSDKLoad
LoadSpriteSheet("Global/[Link]")
SpriteFrame(-16, -16, 32, 32, 1, 143)
end event

You might also like