OpenGTA2?
Re: OpenGTA2?
Mm okay, good point. I'll try to to see in slow motion
Re: OpenGTA2?
Welcome to the forum. Are you just curious or are you creating something? Why did you post in this topic?
Re: OpenGTA2?
Thanks

Actually i'm creating my own remake of gta1 entirely from scratch (but it currently on very very early stage) and now collecting some info which i believe might be helpful.
I didn't want to create new topic for this tiny question, so I wrote here, sorry )
Re: OpenGTA2?
SEKTOR
I attached the screenshot. The nr 1 in red box is the wasted.wav I havent yet digged so deeply into this, this function is choosing what audio is played:
What is the "nicked"?
Fried should be played when ped is torched? I guess.
Have to dig deeper to find out why is wasted always called.
I looked into GTA2.exe, it seems it always calls wasted.wav for dying or something. Its hardcoded.Sektor wrote: ↑09 Feb 2017, 01:42 Likely way outside the scope of this project but are you able to debug audio? I want the shocking.wav to play when you die on train tracks, it displays the "shocking!" text but instead plays wasted.wav. Other sounds aren't played either like toasted and game over. Shocking.wav will actually play if it's your last life although in that case you'd think gameover.wav should play.
I attached the screenshot. The nr 1 in red box is the wasted.wav I havent yet digged so deeply into this, this function is choosing what audio is played:
Code: Select all
char * __fastcall FUN_00564430(int param_1)
{
switch(*(undefined4 *)(param_1 + 0x44)) {
case 0:
case 1:
return s_wasted_0061aed4;
case 2:
return s_fried_0061aecc;
case 3:
return s_nicked_0061aec4;
case 4:
return s_shocked_0061aebc;
default:
return (char *)0;
}
}
Fried should be played when ped is torched? I guess.
Have to dig deeper to find out why is wasted always called.
Always wear safety glasses while programming.
Re: OpenGTA2?
I wonder if anyone would be interested in fully reversing GTA2 original exe?
This would mean:
1. Disassemble the game to asm source.
2. Re-assemble and patch any time stamps in the PE header/debug info so it produces exactly the same original exe file.
3. Re-create the MSVC6 build environment.
4. Replace each asm function 1 by 1 with C/C++ code that produces exactly the same assembly instructions as the original function.
This would mean:
1. Disassemble the game to asm source.
2. Re-assemble and patch any time stamps in the PE header/debug info so it produces exactly the same original exe file.
3. Re-create the MSVC6 build environment.
4. Replace each asm function 1 by 1 with C/C++ code that produces exactly the same assembly instructions as the original function.
Re: OpenGTA2?
this is a huge undertaking and very difficult to automate. however there are some new approaches for disassemblers that use machine learning which look very promising. i think effort is best spent in improving those tools and adapting it to the build environment gta2 was made with. decompiling will probably never be fully automated but my vision for the perfect decompile would be one that is able to take a bunch of user input like the memory addresses that the community found including descriptions and any other known variables and then let the ai work backwards from there giving the internal objects proper names and groupings based on the provided information
yur sa'nok ngeyä
Re: OpenGTA2?
Yep I fully expect this would be a multi person multi year project. Also agree that it can't really be automated. It would be manual work on around 5-6k functions.
I wouldn't do this alone if but we had say 5-10 people working on it then it could be possible to do within a few years.
I wouldn't do this alone if but we had say 5-10 people working on it then it could be possible to do within a few years.
Re: OpenGTA2?
- Im willing to join.
- I love GTA2
- I have "worked" previously as cr@cker and reverse engineered many exes/apps
It's 20 years old game.
In 2002 or 2004 they recompiled the sources of GTA1 and GTA2 and released the classics (now unavailable).
It means they have the sourcecode.
Even Microsoft is releasing lots of source lately. Why R* cant just release this messy old 20 years old code, put it on GitHub or something with specific license and let it be.
GTA1 is even older but also interesting to have with sources.
So many ports and mods could be made for both GTA1 and GTA2.
Always wear safety glasses while programming.
Re: OpenGTA2?
I think the first thing to be done is to collect all known versions of GTA2 for cross comparison and hope of any symbol leaks or debug compiled versions.
I know of these versions:
-PS1 release
-PC demo
-PC retail
-PC "rockstar classics"
I know of these versions:
-PS1 release
-PC demo
-PC retail
-PC "rockstar classics"
Re: OpenGTA2?
there were also some special releases for some language regions and multiple official patches
yur sa'nok ngeyä
Re: OpenGTA2?
Really?
I have original, the 9.6F, Playstation and demo version.
I know there is a russian version also.
Dunno about others.
I have demo and PS version on dvds somewhere.
Have to dig out
I have original, the 9.6F, Playstation and demo version.
I know there is a russian version also.
Dunno about others.
I have demo and PS version on dvds somewhere.
Have to dig out
Always wear safety glasses while programming.
Re: OpenGTA2?
there was a japanese version as well. i collected some additional versions in the game pakx.
yur sa'nok ngeyä
Re: OpenGTA2?
Nice.
It would be great to find these all.
I doubt that they were compiled differently but who knows..
BTW: here are all the known .cpp files from GTA2.EXE, the original ones that were actually in source tree. Maybe 1-2 missing, dunno, but i will add them once i find them.

It would be great to find these all.
I doubt that they were compiled differently but who knows..
BTW: here are all the known .cpp files from GTA2.EXE, the original ones that were actually in source tree. Maybe 1-2 missing, dunno, but i will add them once i find them.
Always wear safety glasses while programming.
Re: OpenGTA2?
i was searching for releases quite thorowly back then but i dont remember any details anymore. if you want to find every release i suggest researching what once existed and then if you cannot find downloads anymore to ask on retro forums and subreddits
yur sa'nok ngeyä
Re: OpenGTA2?
https://github.com/paulsapps/GTA2Hax
"Reimplementation of DmaVideo.dll and d3ddll.dll for GTA2"
Someone did this a few years ago.
"Reimplementation of DmaVideo.dll and d3ddll.dll for GTA2"
Someone did this a few years ago.
Re: OpenGTA2?
There's the freeloader version but that also has no debug symbols. The exe is larger than 9.6f. It was officially licensed and recompiled but the freeloader company went out of business.
I included their original installers and manuals but all you really want to look at is gta2freeloader.exe
https://gtamp.com/GTA2/gta2freeloader.7z , it's v10.5
I included their original installers and manuals but all you really want to look at is gta2freeloader.exe
https://gtamp.com/GTA2/gta2freeloader.7z , it's v10.5
Re: OpenGTA2?
So it means freeloader had sourcecode?
Why they bought the source anyway?
Whats the point. Same game. No changes.
I wonder if the guys from freeloader still have the sourcecode.
Why they bought the source anyway?
Whats the point. Same game. No changes.
I wonder if the guys from freeloader still have the sourcecode.
Always wear safety glasses while programming.
Re: OpenGTA2?
I loaded the gta2 demo exe into Ghidra and found a lot of strings referring to cpp files that are the source code of the game. Looking further, these strings appear to be referred from A LOT of functions. I am not too well versed in compilers and macros etc... but from what I read, it appears that the __FILE__ macro was used, printing the name of the current input file, i.e. the file that was compiled into that exact function.
I dont know if I am very hopeful now, but does this not mean that it is possible to determine what parts of the decompiled exe comes from which source file? Is this useful?
0060a0e4 C:\gbh\coop89demo\audicoll.cpp C:\gbh\coop89demo\audicoll.cpp ds
0060a28c C:\gbh\coop89demo\camera.cpp C:\gbh\coop89demo\camera.cpp ds
0060a2b0 C:\gbh\coop89demo\car.cpp C:\gbh\coop89demo\car.cpp ds
0060a310 C:\gbh\coop89demo\carcont.cpp C:\gbh\coop89demo\carcont.cpp ds
0060a34c C:\gbh\coop89demo\carinfo.cpp C:\gbh\coop89demo\carinfo.cpp ds
0060a38c C:\gbh\coop89demo\char.cpp C:\gbh\coop89demo\char.cpp ds
0060a424 C:\gbh\coop89demo\charlist.cpp C:\gbh\coop89demo\charlist.cpp ds
0060a444 C:\gbh\coop89demo\collide.cpp C:\gbh\coop89demo\collide.cpp ds
0060a478 C:\gbh\coop89demo\crane.cpp C:\gbh\coop89demo\crane.cpp ds
0060a494 C:\gbh\coop89demo\credits.cpp C:\gbh\coop89demo\credits.cpp ds
0060a4bc C:\gbh\coop89demo\crusher.cpp C:\gbh\coop89demo\crusher.cpp ds
0060a50c C:\gbh\coop89demo\display.cpp C:\gbh\coop89demo\display.cpp ds
0060a560 C:\gbh\coop89demo\diutil.cpp C:\gbh\coop89demo\diutil.cpp ds
0060a688 C:\gbh\coop89demo\door.cpp C:\gbh\coop89demo\door.cpp ds
0060e4b4 C:\gbh\coop89demo\File.cpp C:\gbh\coop89demo\File.cpp ds
0060e4e0 C:\gbh\coop89demo\fireman.cpp C:\gbh\coop89demo\fireman.cpp ds
0060fe40 C:\gbh\coop89demo\frontend2.cpp C:\gbh\coop89demo\frontend2.cpp ds
006101fc C:\gbh\coop89demo\game.cpp C:\gbh\coop89demo\game.cpp ds
006107ac C:\gbh\coop89demo\Group.cpp C:\gbh\coop89demo\Group.cpp ds
00610ae0 C:\gbh\coop89demo\input.cpp C:\gbh\coop89demo\input.cpp ds
00610b5c C:\gbh\coop89demo\kanji.cpp C:\gbh\coop89demo\kanji.cpp ds
00610bb4 C:\gbh\coop89demo\keybrd.cpp C:\gbh\coop89demo\keybrd.cpp ds
00610cb4 C:\gbh\coop89demo\main.cpp C:\gbh\coop89demo\main.cpp ds
00610d2c C:\gbh\coop89demo\map.cpp C:\gbh\coop89demo\map.cpp ds
00610eb8 C:\gbh\coop89demo\mapdraw.cpp C:\gbh\coop89demo\mapdraw.cpp ds
00610ed8 C:\gbh\coop89demo\maths.cpp C:\gbh\coop89demo\maths.cpp ds
00610f40 C:\gbh\coop89demo\medical.cpp C:\gbh\coop89demo\medical.cpp ds
00610f60 C:\gbh\coop89demo\Memory.cpp C:\gbh\coop89demo\Memory.cpp ds
006111ac C:\gbh\coop89demo\miss2.cpp C:\gbh\coop89demo\miss2.cpp ds
00611280 C:\gbh\coop89demo\multip.cpp C:\gbh\coop89demo\multip.cpp ds
00613ba0 C:\gbh\coop89demo\NetUI.cpp C:\gbh\coop89demo\NetUI.cpp ds
00613d2c C:\gbh\coop89demo\object.cpp C:\gbh\coop89demo\object.cpp ds
00613d54 C:\gbh\coop89demo\objecti.cpp C:\gbh\coop89demo\objecti.cpp ds
00613d74 C:\gbh\coop89demo\park.cpp C:\gbh\coop89demo\park.cpp ds
00613d98 C:\gbh\coop89demo\particle.cpp C:\gbh\coop89demo\particle.cpp ds
00613dc0 C:\gbh\coop89demo\ped.cpp C:\gbh\coop89demo\ped.cpp ds
00613fe0 C:\gbh\coop89demo\physics.cpp C:\gbh\coop89demo\physics.cpp ds
006140f8 C:\gbh\coop89demo\player.cpp C:\gbh\coop89demo\player.cpp ds
00614e20 C:\gbh\coop89demo\plydat.cpp C:\gbh\coop89demo\plydat.cpp ds
00614e48 C:\gbh\coop89demo\pubtrans.cpp C:\gbh\coop89demo\pubtrans.cpp ds
00614e98 C:\gbh\coop89demo\recycle.cpp C:\gbh\coop89demo\recycle.cpp ds
00614ebc C:\gbh\coop89demo\registry.cpp C:\gbh\coop89demo\registry.cpp ds
00614fc0 C:\gbh\coop89demo\Routef.cpp C:\gbh\coop89demo\Routef.cpp ds
0061513c C:\gbh\coop89demo\sid.cpp C:\gbh\coop89demo\sid.cpp ds
0061515c C:\gbh\coop89demo\sprite.cpp C:\gbh\coop89demo\sprite.cpp ds
00615190 C:\gbh\coop89demo\sprlist.cpp C:\gbh\coop89demo\sprlist.cpp ds
006151b0 C:\gbh\coop89demo\style.cpp C:\gbh\coop89demo\style.cpp ds
00615254 C:\gbh\coop89demo\taxi.cpp C:\gbh\coop89demo\taxi.cpp ds
00615498 C:\gbh\coop89demo\text.cpp C:\gbh\coop89demo\text.cpp ds
006154e4 C:\gbh\coop89demo\texture.cpp C:\gbh\coop89demo\texture.cpp ds
00615504 C:\gbh\coop89demo\tileanim.cpp C:\gbh\coop89demo\tileanim.cpp ds
006155c4 C:\gbh\coop89demo\traffic.cpp C:\gbh\coop89demo\traffic.cpp ds
00615634 C:\gbh\coop89demo\tree.cpp C:\gbh\coop89demo\tree.cpp ds
00615650 C:\gbh\coop89demo\trigger.cpp C:\gbh\coop89demo\trigger.cpp ds
006156c8 C:\gbh\coop89demo\user.cpp C:\gbh\coop89demo\user.cpp ds
006157c0 C:\gbh\coop89demo\video.cpp C:\gbh\coop89demo\video.cpp ds
006158c0 C:\gbh\coop89demo\weapon.cpp C:\gbh\coop89demo\weapon.cpp ds
0061590c C:\gbh\coop89demo\winmain.cpp C:\gbh\coop89demo\winmain.cpp ds
I dont know if I am very hopeful now, but does this not mean that it is possible to determine what parts of the decompiled exe comes from which source file? Is this useful?
0060a0e4 C:\gbh\coop89demo\audicoll.cpp C:\gbh\coop89demo\audicoll.cpp ds
0060a28c C:\gbh\coop89demo\camera.cpp C:\gbh\coop89demo\camera.cpp ds
0060a2b0 C:\gbh\coop89demo\car.cpp C:\gbh\coop89demo\car.cpp ds
0060a310 C:\gbh\coop89demo\carcont.cpp C:\gbh\coop89demo\carcont.cpp ds
0060a34c C:\gbh\coop89demo\carinfo.cpp C:\gbh\coop89demo\carinfo.cpp ds
0060a38c C:\gbh\coop89demo\char.cpp C:\gbh\coop89demo\char.cpp ds
0060a424 C:\gbh\coop89demo\charlist.cpp C:\gbh\coop89demo\charlist.cpp ds
0060a444 C:\gbh\coop89demo\collide.cpp C:\gbh\coop89demo\collide.cpp ds
0060a478 C:\gbh\coop89demo\crane.cpp C:\gbh\coop89demo\crane.cpp ds
0060a494 C:\gbh\coop89demo\credits.cpp C:\gbh\coop89demo\credits.cpp ds
0060a4bc C:\gbh\coop89demo\crusher.cpp C:\gbh\coop89demo\crusher.cpp ds
0060a50c C:\gbh\coop89demo\display.cpp C:\gbh\coop89demo\display.cpp ds
0060a560 C:\gbh\coop89demo\diutil.cpp C:\gbh\coop89demo\diutil.cpp ds
0060a688 C:\gbh\coop89demo\door.cpp C:\gbh\coop89demo\door.cpp ds
0060e4b4 C:\gbh\coop89demo\File.cpp C:\gbh\coop89demo\File.cpp ds
0060e4e0 C:\gbh\coop89demo\fireman.cpp C:\gbh\coop89demo\fireman.cpp ds
0060fe40 C:\gbh\coop89demo\frontend2.cpp C:\gbh\coop89demo\frontend2.cpp ds
006101fc C:\gbh\coop89demo\game.cpp C:\gbh\coop89demo\game.cpp ds
006107ac C:\gbh\coop89demo\Group.cpp C:\gbh\coop89demo\Group.cpp ds
00610ae0 C:\gbh\coop89demo\input.cpp C:\gbh\coop89demo\input.cpp ds
00610b5c C:\gbh\coop89demo\kanji.cpp C:\gbh\coop89demo\kanji.cpp ds
00610bb4 C:\gbh\coop89demo\keybrd.cpp C:\gbh\coop89demo\keybrd.cpp ds
00610cb4 C:\gbh\coop89demo\main.cpp C:\gbh\coop89demo\main.cpp ds
00610d2c C:\gbh\coop89demo\map.cpp C:\gbh\coop89demo\map.cpp ds
00610eb8 C:\gbh\coop89demo\mapdraw.cpp C:\gbh\coop89demo\mapdraw.cpp ds
00610ed8 C:\gbh\coop89demo\maths.cpp C:\gbh\coop89demo\maths.cpp ds
00610f40 C:\gbh\coop89demo\medical.cpp C:\gbh\coop89demo\medical.cpp ds
00610f60 C:\gbh\coop89demo\Memory.cpp C:\gbh\coop89demo\Memory.cpp ds
006111ac C:\gbh\coop89demo\miss2.cpp C:\gbh\coop89demo\miss2.cpp ds
00611280 C:\gbh\coop89demo\multip.cpp C:\gbh\coop89demo\multip.cpp ds
00613ba0 C:\gbh\coop89demo\NetUI.cpp C:\gbh\coop89demo\NetUI.cpp ds
00613d2c C:\gbh\coop89demo\object.cpp C:\gbh\coop89demo\object.cpp ds
00613d54 C:\gbh\coop89demo\objecti.cpp C:\gbh\coop89demo\objecti.cpp ds
00613d74 C:\gbh\coop89demo\park.cpp C:\gbh\coop89demo\park.cpp ds
00613d98 C:\gbh\coop89demo\particle.cpp C:\gbh\coop89demo\particle.cpp ds
00613dc0 C:\gbh\coop89demo\ped.cpp C:\gbh\coop89demo\ped.cpp ds
00613fe0 C:\gbh\coop89demo\physics.cpp C:\gbh\coop89demo\physics.cpp ds
006140f8 C:\gbh\coop89demo\player.cpp C:\gbh\coop89demo\player.cpp ds
00614e20 C:\gbh\coop89demo\plydat.cpp C:\gbh\coop89demo\plydat.cpp ds
00614e48 C:\gbh\coop89demo\pubtrans.cpp C:\gbh\coop89demo\pubtrans.cpp ds
00614e98 C:\gbh\coop89demo\recycle.cpp C:\gbh\coop89demo\recycle.cpp ds
00614ebc C:\gbh\coop89demo\registry.cpp C:\gbh\coop89demo\registry.cpp ds
00614fc0 C:\gbh\coop89demo\Routef.cpp C:\gbh\coop89demo\Routef.cpp ds
0061513c C:\gbh\coop89demo\sid.cpp C:\gbh\coop89demo\sid.cpp ds
0061515c C:\gbh\coop89demo\sprite.cpp C:\gbh\coop89demo\sprite.cpp ds
00615190 C:\gbh\coop89demo\sprlist.cpp C:\gbh\coop89demo\sprlist.cpp ds
006151b0 C:\gbh\coop89demo\style.cpp C:\gbh\coop89demo\style.cpp ds
00615254 C:\gbh\coop89demo\taxi.cpp C:\gbh\coop89demo\taxi.cpp ds
00615498 C:\gbh\coop89demo\text.cpp C:\gbh\coop89demo\text.cpp ds
006154e4 C:\gbh\coop89demo\texture.cpp C:\gbh\coop89demo\texture.cpp ds
00615504 C:\gbh\coop89demo\tileanim.cpp C:\gbh\coop89demo\tileanim.cpp ds
006155c4 C:\gbh\coop89demo\traffic.cpp C:\gbh\coop89demo\traffic.cpp ds
00615634 C:\gbh\coop89demo\tree.cpp C:\gbh\coop89demo\tree.cpp ds
00615650 C:\gbh\coop89demo\trigger.cpp C:\gbh\coop89demo\trigger.cpp ds
006156c8 C:\gbh\coop89demo\user.cpp C:\gbh\coop89demo\user.cpp ds
006157c0 C:\gbh\coop89demo\video.cpp C:\gbh\coop89demo\video.cpp ds
006158c0 C:\gbh\coop89demo\weapon.cpp C:\gbh\coop89demo\weapon.cpp ds
0061590c C:\gbh\coop89demo\winmain.cpp C:\gbh\coop89demo\winmain.cpp ds
Re: OpenGTA2?
Just giving a update to this problem. The function of your screenshot is the one below:B-$hep wrote: ↑26 Sep 2019, 18:20 I looked into GTA2.exe, it seems it always calls wasted.wav for dying or something. Its hardcoded.
I attached the screenshot. The nr 1 in red box is the wasted.wav
Untitled.png
I havent yet digged so deeply into this, this function is choosing what audio is played:
Code: Select all
char * __fastcall FUN_00564430(int param_1) { switch(*(undefined4 *)(param_1 + 0x44)) { case 0: case 1: return s_wasted_0061aed4; case 2: return s_fried_0061aecc; case 3: return s_nicked_0061aec4; case 4: return s_shocked_0061aebc; default: return (char *)0; } }
Code: Select all
void Player::sub_567130() // gta2 10.5 address
{
Ped* pPed_killer;
Player* player_killer; // this function seems to handle the player death
if (bStartNetworkGame_7081F0)
{
// Ped: field_204 = the ID of the ped who killed this player/Player
if (field_2C4_player_ped->field_204 == 0)
{
player_killer = NULL;
}
else if ((pPed_killer = gChar_C_6787BC->sub_4710C0(field_2C4_player_ped->field_204)) == 0)
{
player_killer = NULL;
}
else if (pPed_killer->sub_45EDE0(2) == 0)
{
player_killer = NULL;
}
else if ((player_killer = pPed_killer->field_15C_player_weapons) == NULL)
{
player_killer = NULL;
}
(&gYouthful_einstein_6F8450)->sub_516740( // tag mode death handler
gGame_0x40_67E008->field_4_players[field_2E_idx],
player_killer); // if player_killer != NULL then 'player_killer' now is "IT"
}
field_29 = 0;
field_2C4_player_ped->field_21C &= ~0x800u;
if (field_28 == 0)
{
if (field_0)
{
if (field_684_lives.field_0 > 1 || bStartNetworkGame_7081F0)
{
gGarox_2B00_706620->field_111C.sub_5D1A00( // It's really ugly, it's probably inlined
gText_0x14_704DFC->Find_5B5F90(GetDeathText_569F00()), // GetDeathText_569F00 gives you WASTED, SHOCKED, TOASTED texts
1);
gRoot_sound_66B038.sub_40F090(29); // Wasted.wav
}
else
{
gGarox_2B00_706620->field_111C.sub_5D1A00(gText_0x14_704DFC->Find_5B5F90("g_over"), 3);
gRoot_sound_66B038.sub_40F090(21); // Supposed to be Game_over.wav
}
}
field_44_death_type = 0;
if (field_2D0)
{
Player::sub_5695A0();
}
field_28 = 1;
field_2C = 70;
if (field_684_lives.field_0 > 1)
{
field_2C8_unkq = gChar_C_6787BC->sub_470F90(field_2C4_player_ped);
field_2C8_unkq->field_170_selected_weapon = 0;
field_2C8_unkq->field_200 = 0;
field_2C8_unkq->field_21C &= ~0x800u;
field_2C8_unkq->field_267 = 0;
field_68 = 2;
memcpy(&field_208_aux_game_camera, &field_90_game_camera, sizeof(field_208_aux_game_camera));
field_2D0 = 1;
}
Player::sub_5670B0();
}
else
{
if (field_2C8_unkq)
{
field_2C8_unkq->field_21C &= ~0x800u;
}
if (field_2C == 0)
{
if (field_684_lives.field_0 > 0 || bStartNetworkGame_7081F0)
{
Player::sub_5647D0();
if (!bKeep_weapons_after_death_67D54D)
{
Player::sub_564C00();
Player::sub_564C50(); // remove weapons from dead player
Player::sub_564CF0();
}
field_68 = 0;
field_90_game_camera.sub_435DD0();
field_90_game_camera.inline_sub_475B60();
if (field_2C8_unkq != NULL)
{
field_2C8_unkq->sub_45EB60();
field_2C8_unkq = NULL;
field_2D0 = 0;
}
field_2C4_player_ped->sub_45C410();
field_28 = 0;
}
else
{
gGame_0x40_67E008->sub_4B8C00(0, 3);
}
}
else
{
field_2C--;
}
}
}
Code: Select all
void sound_obj::ProcessType10_418CA0() // gta2 10.5 address
{
s32 voc_idx;
if (field_544C[0].field_4_fp)
{
switch (field_544C[0].field_18)
{
case 9:
voc_idx = 0;
break;
case 10:
voc_idx = 1;
break;
case 17:
voc_idx = 2;
break;
case 7:
voc_idx = 3;
break;
case 6:
voc_idx = 4;
break;
case 8:
voc_idx = 5;
break;
case 4:
voc_idx = 6;
break;
case 18:
voc_idx = 8;
break;
case 19:
voc_idx = 9;
break;
case 20:
voc_idx = 10;
break;
case 5:
voc_idx = 12;
break;
case 2:
voc_idx = 13;
break;
case 1:
voc_idx = 14;
break;
case 22:
voc_idx = 15;
break;
case 23:
voc_idx = 16;
break;
case 12:
voc_idx = 17;
break;
case 11:
voc_idx = 18;
break;
case 24:
voc_idx = 19;
break;
case 25:
voc_idx = 20;
break;
case 26:
voc_idx = 21;
break;
case 27:
voc_idx = 22;
break;
case 28:
voc_idx = 23;
break;
case 29:
voc_idx = 24;
break;
case 3:
voc_idx = 25;
break;
case 30:
voc_idx = 26;
break;
case 33:
voc_idx = 55;
break;
case 34:
voc_idx = 56;
break;
case 35:
voc_idx = 57;
break;
case 36:
voc_idx = 58;
break;
case 37:
voc_idx = 59;
break;
case 38:
voc_idx = 60;
break;
case 39:
voc_idx = 61;
break;
case 40:
voc_idx = 62;
break;
case 41:
voc_idx = 63;
break;
case 42:
voc_idx = 64;
break;
case 43:
voc_idx = 65;
break;
case 44:
voc_idx = 66;
break;
case 45:
voc_idx = 67;
break;
case 46:
voc_idx = 68;
break;
case 47:
voc_idx = 69;
break;
case 48:
voc_idx = 70;
break;
case 49:
voc_idx = 71;
break;
case 50:
voc_idx = 72;
break;
case 51:
voc_idx = 73;
break;
case 52:
voc_idx = 74;
break;
case 53:
voc_idx = 75;
break;
case 54:
voc_idx = 76;
break;
case 55:
voc_idx = 77;
break;
case 56:
voc_idx = 78;
break;
case 57:
voc_idx = 79;
break;
case 58:
voc_idx = 80;
break;
case 59:
voc_idx = 81;
break;
case 60:
voc_idx = 82;
break;
case 61:
voc_idx = 83;
break;
case 62:
voc_idx = 84;
break;
case 31:
case 32:
voc_idx = (field_1454_anRandomTable[0] % 13u) + 85;
if (voc_idx == 99)
{
field_544C[0].field_18 = 0;
return;
}
break;
default:
field_544C[0].field_18 = 0;
return;
}
gSampManager_6FFF00.PlayVocal_58E510(1, voc_idx, 1);
gSampManager_6FFF00.SetVocalVolume_58E6D0(1, 127 * field_24_sfx_vol / 127);
field_544C[0].field_18 = 0;
}
}