Пример #1
0
void	moonjump_jap(void)
{
	int		loc;
	u32		Z;

    if (!(any_is_pressed(R)) && is_pressed(BUTTON_L)) //it's better to test the negation first
	{
		loc = READU32(0x17321644);
		Z = READU32(0x17321514);
		if (Z >= 0x440F0000)
		{
			if (loc == -1)
			{
				WRITEU32(0x17321514, 0x440F0000);
			}
			else
			{
				WRITEU32(0x17321640, 0x440F0000);
			}
		}
		else
		{
			if (loc == -1)
			{
				ADDTOFLOAT(0x17321514, 0x00000006);
			}
			else
			{
				ADDTOFLOAT(0x17321640, 0x00000006);
			}
		}	
	}
}
Пример #2
0
void    moonjump(void)
{
    int     loc;
    u32     height;

    if (!(any_is_pressed(R)) && is_pressed(BUTTON_L)) //it's better to test the negation first
    {
        loc = READU32(g_location);
        height = READU32(g_outdoor_pos_y);
        if (height >= 0x440F0000)
        {
            if (loc == -1)
            {
                WRITEU32(g_outdoor_pos_y, 0x440F0000);
            }
            else
            {
                WRITEU32(g_indoor_pos_y, 0x440F0000);
            }
        }
        else
        {
            if (loc == -1)
            {
                ADDTOFLOAT(g_outdoor_pos_y, 6.0);
            }
            else
            {
                ADDTOFLOAT(g_indoor_pos_y, 6.0);
            }
        }   
    }
}
Пример #3
0
void    teleport(void)
{
    static u32    indoor_X[3] = { 0 };
    static u32    indoor_Y[3] = { 0 };
    static u32    outdoor_X[3] = { 0 };
    static u32    outdoor_Y[3] = { 0 };
    int           loc;
    int           slot;

    if (!is_pressed(BUTTON_B) && !g_text_activated)
        return;

    //Pointer to define whether player is indoors or not
    loc = READU32(g_location);
    if (is_pressed(BUTTON_L)) //If L is pressed then use slot3
        slot = 2;
    else if (is_pressed(BUTTON_R)) //If R is pressed then use slot2
        slot = 1;
    else //If noting is pressed then use slot0
        slot = 0;
    if (is_pressed(BUTTON_B + BUTTON_DU)
        || (g_teleport_save && g_text_activated))
    {       
        if (loc == -1) 
        {           
            outdoor_X[slot] = READU32(g_outdoor_pos_x);
            outdoor_Y[slot] = READU32(g_outdoor_pos_z);
        }
        else
        {
            indoor_X[slot] = READU32(g_indoor_pos_x);
            indoor_Y[slot] = READU32(g_indoor_pos_z);
        }
    }
    else if (is_pressed(BUTTON_B + BUTTON_DD)
             || (!g_teleport_save && g_text_activated))
    {
        if (loc == -1)
        {
            WRITEU32(g_outdoor_pos_x, outdoor_X[slot]);
            WRITEU32(g_outdoor_pos_z, outdoor_Y[slot]);
        }
        else
        {
            WRITEU32(g_indoor_pos_x, indoor_X[slot]);
            WRITEU32(g_indoor_pos_z, indoor_Y[slot]);
        }
    }
}
Пример #4
0
void    writePlayer(u32 offset, u32 data)
{
    u32     address;
    
    address = READU32(g_player_ptr);
    WRITEU32(address + offset, data);  
}
Пример #5
0
void    writeSlot(int slot, u32 item)
{
    u32     offset;
    
    offset = READU32(g_player_ptr);
    if (offset != 0 && item > 0x1000 && (item < 0x4000 || item == 0x7FFE))
    {
        WRITEU32(offset + 0x6BD0 + (slot * 4), item);
    }  
}
Пример #6
0
void	duplicate4_jap(void)//JAP
{
	u32			dupe = 0;
	u32			dupe0 = 0;
	u32			dupe1 = 0;
	u32			dupe2 = 0;
	u32			dupe3 = 0;
	u32			dupe4 = 0;
	
	if (is_pressed(BUTTON_R))
	{
		dupe = READU32(0x16074000);
		dupe0 = READU32(0xAEEC28); //online pointer0
		dupe1 = READU32(0xAF8B38); //online pointer1
		dupe2 = READU32(0xB02A48); //online pointer2
		dupe3 = READU32(0xB0C958);
		dupe4 = READU32(0xB0BA58);
		WRITEU32(0x16074004, dupe);
		WRITEU32(0xAEEC2C, dupe0);
		WRITEU32(0xAF8B3C, dupe1);
		WRITEU32(0xB02A4C, dupe2);	
		WRITEU32(0xB0C96C, dupe3);
		WRITEU32(0xB0BA6C, dupe4);
	}
}
Пример #7
0
void    seeder(void)
{
    int     input;

    if (!is_pressed(BUTTON_L))
        return;
    get_input_id(&input, NULL);
    if (is_pressed(BUTTON_L + A))
    {
        WRITEU32(g_seed, 0x80000000 + input);
    }
    else
    {        
        WRITEU16(g_seed, input);
    }
}
Пример #8
0
void    speed(void)
{
    u32     velocity;

    if (is_pressed(BUTTON_B))
    {
        velocity = READU32(g_velocity);
        if (velocity >= 0x41A79DB3)
        {
            WRITEU32(g_velocity, 0x41A79DB3);
        }
        else if (velocity > 0)
        {
            ADDTOFLOAT(g_velocity, 2.0);
        }
    }
}
Пример #9
0
void	speed_jap(void) //JAP
{
	u32			  velocity;

	if (is_pressed(BUTTON_B))
	{
		velocity = READU32(0x173B8BBC);
		if (velocity >= 0x41A79DB3)
		{
			WRITEU32(0x173B8BBC, 0x41A79DB3);
		}
		else if (velocity > 0)
		{
			add_to_address((void*)0x173B8BBC, 0x00000002);
		}
	}
}
Пример #10
0
void    duplicate(void)
{
    
 //   u32 dupe0 = 0;
 //   u32 dupe1 = 0;
 //   u32 dupe2 = 0;
 //   u32 dupe3 = 0;
 //   u32 dupe4 = 0;
 //   u32 dupe5 = 0;
    u32     dupe = 0;
    u32     offset;
    u8      player;
    /* OFFSETS FOUND 
    ** 0xAAb0e0 only player on island.
    ** 0xA8C360 2nd player on island.
    ** 0xAA0C60 3rd player on island.        
    */   
    if (is_pressed(BUTTON_R))
    {
        player = READU8(g_player);
        // Player 4 should be the highest value stored here. 
        // It goes to 0x7 when visiting a dream and someone's town I think?
        if (player <= 0x3)
        {
            offset = player * 0xA480;
        }
        dupe = READU32(g_inv + offset);
        //dupe0 = READU32(0xAB36E0); //online pointer0
        //dupe1 = READU32(0xABDB60); //online pointer1
        //dupe2 = READU32(0xAC7FE0); //online pointer2
        //dupe3 = READU32(0xAAb0e0);
        //dupe4 = READU32(0xA8C360);
        //dupe5 = READU32(0xAA0C60);
        WRITEU32(g_inv + offset + 0x4, dupe);
        //WRITEU32(0xAB36E4, dupe0); //player 2
        //WRITEU32(0xABDB64, dupe1); //player 3
        //WRITEU32(0xAC7FE4, dupe2); //player 4
        //WRITEU32(0xAAb0e4, dupe3);
        //WRITEU32(0xA8C364, dupe4);
        //WRITEU32(0xAA0C64, dupe5);
    }
}
Пример #11
0
void quench(void)
{
    u32     address;
    u32     item;

    if (!is_pressed(BUTTON_R + BUTTON_A) && !g_text_activated)
        return;
    // Parse all items in Town
    for (address = g_town_items; address < g_town_items + RANGE_TOWN_ITEMS; address += ITEM_BYTES)
    {
        item = READU16(address);
        // Deal with wilted flower
        if (item >= 0xCE && item <= 0xF7)
        {
            item -= 0x2F;
        }
        // If item is a flower add water flag
        if (item >= 0x9F && item <= 0xC8)
        {
            item |= 0x40000000;
            WRITEU32(address, item);
        }
    }
}
Пример #12
0
void    warping(void)
{
    if (upper_left_touched())
    {
        WRITEU32(g_outdoor_pos_x, 0x4427405E);
        WRITEU32(g_outdoor_pos_y, 0x42E00000);
        WRITEU32(g_outdoor_pos_z, 0x44253715);
        wait_keys_released(KEY_TOUCH);
    }
    if (upper_right_touched())
    {
        WRITEU32(g_outdoor_pos_x, 0x442C4000);
        WRITEU32(g_outdoor_pos_y, 0x42E00000);
        WRITEU32(g_outdoor_pos_z, 0x45239943);
        wait_keys_released(KEY_TOUCH);
    }
    if (lower_left_touched())
    {
        WRITEU32(g_outdoor_pos_x, 0x450A7F48);
        WRITEU32(g_outdoor_pos_z, 0x42E00000);
        WRITEU32(g_outdoor_pos_z, 0x4442761E);
        wait_keys_released(KEY_TOUCH);
    }
    if (lower_right_touched())
    {
        WRITEU32(g_outdoor_pos_x, 0x45071000);
        WRITEU32(g_outdoor_pos_y, 0x42E00000);
        WRITEU32(g_outdoor_pos_z, 0x451E028E);
        wait_keys_released(KEY_TOUCH);
    }
}
Пример #13
0
void	warping_jap(void)
{
	if (upper_left_touched())
	{
		WRITEU32(0x173B8B98, 0x4427405E);
		WRITEU32(0x173B8B94, 0x42E00000);
		WRITEU32(0x173B8B90, 0x44253715);
		wait_keys_released(KEY_TOUCH);
	}
	if (upper_right_touched())
	{
		WRITEU32(0x173B8B98, 0x442C4000);
		WRITEU32(0x173B8B94, 0x42E00000);
		WRITEU32(0x173B8B90, 0x45239943);
		wait_keys_released(KEY_TOUCH);
	}
	if (lower_left_touched())
	{
		WRITEU32(0x173B8B98, 0x450A7F48);
		WRITEU32(0x173B8B94, 0x42E00000);
		WRITEU32(0x173B8B90, 0x4442761E);
		wait_keys_released(KEY_TOUCH);
	}
	if (lower_right_touched())
	{
		WRITEU32(0x173B8B98, 0x45071000);
		WRITEU32(0x173B8B94, 0x42E00000);
		WRITEU32(0x173B8B90, 0x451E028E);
		wait_keys_released(KEY_TOUCH);
	}
}
Пример #14
0
void    teleport_jap(void) //JAP
{
	static u32    indoor_X[3] = { 0 };
	static u32    indoor_Y[3] = { 0 };
	static u32    outdoor_X[3] = { 0 };
	static u32    outdoor_Y[3] = { 0 };
	static int    loc = 0;

	if (is_pressed(BUTTON_B)) //Pointer to define whether player is indoors or not
	{
		loc = READU32(0x173B8CC4);
	}
	if (is_pressed(BUTTON_B + BUTTON_DU))
	{
		if (loc == -1)
		{
			if (is_pressed(BUTTON_L)) //If L is pressed then save in slot3
			{
				outdoor_X[2] = READU32(0x173B8B90);
				outdoor_Y[2] = READU32(0x173B8B98);
			}
			else if (is_pressed(BUTTON_R)) //If R is pressed then save in slot2
			{
				outdoor_X[1] = READU32(0x173B8B90);
				outdoor_Y[1] = READU32(0x173B8B98);
			}
			else //If noting is pressed then save in slot0
			{
				outdoor_X[0] = READU32(0x173B8B90);
				outdoor_Y[0] = READU32(0x173B8B98);
			}
		}
		else
		{
			if (is_pressed(BUTTON_L)) //If L is pressed then save in slot3
			{
				indoor_X[2] = READU32(0x173B8CBC);
				indoor_Y[2] = READU32(0x173B8CC4);
			}
			else if (is_pressed(BUTTON_R)) //If R is pressed then save in slot2
			{
				indoor_X[1] = READU32(0x173B8CBC);
				indoor_Y[1] = READU32(0x173B8CC4);
			}
			else //If noting is pressed then save in slot0
			{
				indoor_X[0] = READU32(0x173B8CBC);
				indoor_Y[0] = READU32(0x173B8CC4);
			}
		}
	}
	if (is_pressed(BUTTON_B + BUTTON_DD))
	{
		loc = READU32(0x17321644);
		if (loc == -1)
		{

			if (is_pressed(BUTTON_L)) //If L is pressed then restore slot3
			{
				WRITEU32(0x173B8B90, outdoor_X[2]);
				WRITEU32(0x173B8B98, outdoor_Y[2]);
			}
			else if (is_pressed(BUTTON_R)) //If R is pressed then restore slot2
			{
				WRITEU32(0x173B8B90, outdoor_X[1]);
				WRITEU32(0x173B8B98, outdoor_Y[1]);
			}
			else //If noting is pressed then restore slot0
			{
				WRITEU32(0x173B8B90, outdoor_X[0]);
				WRITEU32(0x173B8B98, outdoor_Y[0]);
			}
		}
		else
		{
			if (is_pressed(BUTTON_L)) //If L is pressed then restore slot3
			{
				WRITEU32(0x173B8CBC, indoor_X[2]);
				WRITEU32(0x173B8CC4, indoor_Y[2]);
			}
			else if (is_pressed(BUTTON_R)) //If R is pressed then restore slot2
			{
				WRITEU32(0x173B8CBC, indoor_X[1]);
				WRITEU32(0x173B8CC4, indoor_Y[1]);
			}
			else //If noting is pressed then restore slot0
			{
				WRITEU32(0x173B8CBC, indoor_X[0]);
				WRITEU32(0x173B8CC4, indoor_Y[0]);
			}
		}
	}
}