Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large number of "unhandled jumps" and logical issues #14

Open
Lucas7yoshi opened this issue Jul 6, 2023 · 1 comment
Open

Large number of "unhandled jumps" and logical issues #14

Lucas7yoshi opened this issue Jul 6, 2023 · 1 comment

Comments

@Lucas7yoshi
Copy link

Lucas7yoshi commented Jul 6, 2023

blackjack.ysc (as of 2944) has a immense number of unhandled jumps in a large array of functions that all are basically just elaborate switch statements, all of which have defaults with goto's:

An example is the function at 0x7B6C

// Unhandled jump detected. Output should be considered invalid
char* _GET_DEALER_IDLE_SINGLE_ANIM(int iParam0, int iParam1) // Position - 0x7B6C Hash - 0x3782CC3B ^0x3782CC3B
{
	// [[some code trimmed for size]]
	if (uLocal_112.f_1550_DEALER_VARIATION[iParam0] >= 7)
	{
		switch (num)
		{
			case 0:
				return "female_idle_single_p01";
		
			case 1:
				return "female_idle_single_p02";
		
			case 2:
				return "female_idle_single_p03";
		
			case 3:
				return "female_idle_single_p04";
		
			default:
				goto 0xC0;
		}
	}
	else
	{
		switch (num)
		{
			case 0:
				return "idle_single_p01";
		
			case 1:
				return "idle_single_p02";
		
			case 2:
				return "idle_single_p03";
		
			case 3:
				return "idle_single_p04";
		
			default:
			
		}
	}

	return "";
}

These are all over blackjack.ysc

Logical issues

Conveniently easy to find by just searching for \t!
If statements appear to have parts of them escape into being inside of the code
Blackjack.c aswell:

void func_77(var uParam0) // Position - 0x89F1 Hash - 0x7623605C ^0x6B47B1A0
{
	Entity entity;

	if (NETWORK::NETWORK_DOES_NETWORK_ID_EXIST(*hand))
		!NETWORK::NETWORK_HAS_CONTROL_OF_NETWORK_ID(*hand);

	if (NETWORK::NETWORK_DOES_ENTITY_EXIST_WITH_NETWORK_ID(*hand))
	{
		entity = NETWORK::NET_TO_ENT(*hand);
		ENTITY::DELETE_ENTITY(&entity);
	}

	return;
}```
Some other functions in blackjack.ysc
0x19692
0x19476
0x1A2FB

Hopefully these aren't too much trouble, nonetheless the best decompiler :p
@maybegreat48
Copy link
Owner

has a immense number of unhandled jumps

There is not much I can do about this, though I could try to optimize the output when I have the time

If statements appear to have parts of them escape into being inside of the code

This is caused by remnants of debug code in the release version of the game. The decompiler removes trivial expressions already, but it can't remove functions or natives since it is impossible to predict the possible side-effects they could have

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants