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

Few more updates #15

Closed
bloodyplayer opened this issue Aug 2, 2023 · 24 comments
Closed

Few more updates #15

bloodyplayer opened this issue Aug 2, 2023 · 24 comments
Labels
enhancement New feature or request

Comments

@bloodyplayer
Copy link

bloodyplayer commented Aug 2, 2023

Jpatch Dev's

  • I recomment to restore the idle camera from gta sa pc/ps2.
  • Two, that is to separate horn and hydraulics lift as button separately for lowrider cars
  • Remove crouching ability for few weapons in game for chainsaw, minigun, flamethrower, fire extinguisher because this didn't feel real and add a crosshair for flamethrower like in GTA SA pc
  • add icon and it's camera for unused ps2 pay s' spray in lv for improved main.scm users
  • lastly kindly add a crosshair for tank cannon like in other games like in PUBG and C. O. D pls for a better shooting
@BengbuGuards
Copy link

@RusJJ I have an idea but I don't want to open another issue so I'll say here.

In PC version, emergency vehicles have two kinds of siren, the second siren can be actived by keeping pressing H while the default siren is on.

Mobile disabled it by bad code implement. I have an idea to reenable that:

  1. Place a 4-byte NOP at
    CVehicle::ProcessSirenAndHorn + 0x7A

  2. Place 0x2100 ( MOVS R1, #0 ) at CVehicle::ProcessSirenAndHorn + 0x7A + 4

  3. Place a 4-byte NOP at CVehicle::ProcessSirenAndHorn + 0xB0

That's "SecondSirenFix" at all.

@RusJJ
Copy link
Collaborator

RusJJ commented Aug 8, 2023

That's "SecondSirenFix" at all.

Grab the artifact at https://github.com/AndroidModLoader/JPatch/actions/runs/5796999054 and test it if you like. Let me know!

@BengbuGuards
Copy link

BengbuGuards commented Aug 9, 2023

@RusJJ I'm glad to see that you did it. I tried it :)
The second siren works well but after releasing the button the siren state will be reversed. I think the code implement should be that:

aml->Write(pGTASA + 0x590132, "\xAF\xF3\x00\x80\x00\x21", 6);
aml->Write(pGTASA + 0x590168, "\xAF\xF3\x00\x80", 4); // It's NOP.W so it doesn't make glitch (maybe?)

Based on cleo code:

{$CLEO .csa}
0DD0: 11@ = get_label_addr @CVehicle_ProcessSirenAndHorn
0DD1: 11@ = get_func_addr_by_cstr_name 11@
11@ -= 1
11@ += 0x7A // MOVS  R1, #0 
0DD9: write_mem_addr 11@ value 0x8000F3AF size 4 add_ib 0 protect 1 // NOP.W
11@ += 4  // CMP.W  R1, R0,LSR#7
0DD9: write_mem_addr 11@ value 0x2100 size 2 add_ib 0 protect 1 // MOVS  R1, #0 
11@ += 0x32 // BICGT.W  R2, R2, #0x8000
0DD9: write_mem_addr 11@ value 0x8000F3AF size 4 add_ib 0 protect 1 // NOP.W


:CVehicle_ProcessSirenAndHorn
hex
    "_ZN8CVehicle19ProcessSirenAndHornEb" 00
end

@RusJJ
Copy link
Collaborator

RusJJ commented Aug 9, 2023

BICGT.W R2, R2, #0x8000

This is not a NOP. NOP in Thumb/ThumbV2 execution set is BF00, or any MOV Rd,Rd. BICGT is a working instruction: https://developer.arm.com/documentation/ddi0406/cb/Application-Level-Architecture/Instruction-Details/Alphabetical-list-of-instructions/BIC--register-

@BengbuGuards
Copy link

This is not a NOP. NOP in Thumb/ThumbV2 execution set is BF00, or any MOV Rd,Rd. BICGT is a working instruction: https://developer.arm.com/documentation/ddi0406/cb/Application-Level-Architecture/Instruction-Details/Alphabetical-list-of-instructions/BIC--register-

Hmm, that's games original opcode, and what we are going to write is NOP. (0x8000F3AF) All the patch has been verified by me in IDA.

@RusJJ
Copy link
Collaborator

RusJJ commented Aug 9, 2023

No, that's not the reason. Try now.

@BengbuGuards
Copy link

I tried again and the problem doesn't change. The third step (to make game don't reverse siren state when press the horn button for more than 0.2 second) was strange but my cleo code works properly. PlaceNOP(xxx, 2) will write 00 BF 00 BF in memory, but my idea is write AF F3 00 80 in memory. Or try that in IDA, change these bytes and decompile that function.

@BengbuGuards
Copy link

@RusJJ At least, I found the way to enable to control polmavs' searchlight.

Just hook CPad::HornJustDown(), check if the vehicle is a polmav, if so, call CTouchInterface::IsReleased(), if not, call original function.;)

@BengbuGuards
Copy link

Because, polmavs' vehicle class is 3, and HornJustDown will check that, so we need to do a special check.

And about the second siren fix, we really need to write a 64-bit NOP at pGTASA + 0x590168, or the code logic will be wrong(?).

@bloodyplayer
Copy link
Author

Bros what is the answer for my request?

@BengbuGuards
Copy link

@bloodyplayer I see. For №2, that's by game design, no bug.

For crosshair of flamethrower, that's related to whether we are aiming.

And crouch ability, PC mixsets will not make us able to crouch with file ex, that's true.

About LV pay'n spray, even a small cleo script can do that.

At last, tanks won't shoot at some fixed point on screen, the crosshair will be useless. Or you need a useful crosshair, sadly we need to rewrite game's tank fire system at all, that's to difficult.(A PC mod did that, but still has many problems)

@bloodyplayer
Copy link
Author

bloodyplayer commented Aug 14, 2023 via email

@bloodyplayer
Copy link
Author

Can we see idle cam in the next update it will be look cool
Like in ps2/pc

@RusJJ
Copy link
Collaborator

RusJJ commented Aug 20, 2023

we really need to write a 64-bit NOP at pGTASA + 0x590168, or the code logic will be wrong(?)
Ok, i got some time to investigate on this. Yes, it should be 4-byte opcode, otherwise the next important opcode "EOR" will be always called no matter what (because of IT instruction).

Can we see idle cam in the next update it will be look cool
Checked the game code, probably, that's possible. But dont wait for it now.

idle in air
Most likely it's a glitch. Im not going to add this.

@BengbuGuards
Copy link

@RusJJ Works properly :)

Jetpack can be hovered in, just press Q and E on PC (some versions have bug, but no matter). It's also a command to look back, so pressing screen in mobile version makes jetpack to hover. Add a button to control is a good idea perhaps? Like control hydra's jet mode by button.

@BengbuGuards
Copy link

Add a button to control is a good idea perhaps? Like control hydra's jet mode by button.

After 5 minutes trying, I found a VERY simple method to let us hover jetpack by button:In CPad::GetJetpackHover() func, turn CTouchInterface::IsHeldDown(175, 1) to CTouchInterface::IsTouched(30, 1, 0)

3FA49A: MOVS  R0, #175 -> MOVS  R0, #30 ; We can use any widget id but 30 (nitro ctrl) is the best I think ;)
3FA4A0: BLX  j__ZN15CTouchInterface10IsHeldDownENS_9WidgetIDsEi -> BLX  j__ZN15CTouchInterface9IsTouchedENS_9WidgetIDsEP9CVector2Di ; Now we needn't long press

@bloodyplayer
Copy link
Author

Add a button to control is a good idea perhaps? Like control hydra's jet mode by button.

After 5 minutes trying, I found a VERY simple method to let us hover jetpack by button:In CPad::GetJetpackHover() func, turn CTouchInterface::IsHeldDown(175, 1) to CTouchInterface::IsTouched(30, 1, 0)

3FA49A: MOVS  R0, #175 -> MOVS  R0, #30 ; We can use any widget id but 30 (nitro ctrl) is the best I think ;)
3FA4A0: BLX  j__ZN15CTouchInterface10IsHeldDownENS_9WidgetIDsEi -> BLX  j__ZN15CTouchInterface9IsTouchedENS_9WidgetIDsEP9CVector2Di ; Now we needn't long press

Will it available for players soon bro?

@BengbuGuards
Copy link

Will it available for players soon bro?

It's up to Killman to decide.

@bloodyplayer
Copy link
Author

bloodyplayer commented Aug 21, 2023 via email

@BengbuGuards
Copy link

BengbuGuards commented Aug 23, 2023

It seems that my jetpack patch solution does not define the R2 register, will make a bug. So the best way is hook CTouchInterface::IsHeldDown, do a special check if player is on a jetpack, and call IsTouched(30, 0, 2).

@RusJJ What's more, boat Predator has a fixed gun can used by player and cops, but in mobile version, it has messed up. A very simple way to patch is that:

5E2940: MOVS  R1, #0 -> #1

And it will work when FixMissingShootBtnForSWAT option of JPatch is enabled.

@bloodyplayer
Copy link
Author

bloodyplayer commented Aug 23, 2023 via email

@bloodyplayer
Copy link
Author

Thank u for ur reply guys I have two requests: 1) for jetpack instead of holding the screen for being idle in air instead add a lock button for being idle it would be easy for rotating the camera 360° and shooting 2) can the countermeasures of hydra can restored? For mobile war drum studios screwed that to implement in the game I think so 🤔 #(shooting a minigun/flamethrower when Crouching it's animation is weird) I hope u guys rock for gta sa mobile improvements

On Sun, Aug 13, 2023, 6:46 AM 小流汗黄豆 @.> wrote: @bloodyplayer https://github.com/bloodyplayer I see. For №2, that's by game design, no bug. For crosshair of flamethrower, that's related to whether we are aiming. And crouch ability, PC mixsets will not make us able to crouch with file ex, that's true. About LV pay'n spray, even a small cleo script can do that. At last, tanks won't shoot at some fixed point on screen, the crosshair will be useless. Or you need a useful crosshair, sadly we need to rewrite game's tank fire system at all, that's to difficult.(A PC mod did that, but still has many problems) — Reply to this email directly, view it on GitHub <#15 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6U3YZL37BLS4BQGIPHSRSDXVATILANCNFSM6AAAAAA3AS34MM . You are receiving this because you were mentioned.Message ID: @.>

Will these things get a response in future?

@RusJJ
Copy link
Collaborator

RusJJ commented Jan 21, 2024

No, if you will beg for it every day

@RusJJ RusJJ added the enhancement New feature or request label Jan 25, 2024
@RusJJ
Copy link
Collaborator

RusJJ commented Jan 25, 2024

Some of the features will be in the future JPatch. If they are not, that means im not going to do this. Like asking me to add missing icon in a third-party main.scm ... 🤦

@RusJJ RusJJ closed this as completed Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants