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

Possible fix for bug mentioned in Discord #2485

Closed
wants to merge 5 commits into from
Closed

Possible fix for bug mentioned in Discord #2485

wants to merge 5 commits into from

Conversation

PugsyMAME
Copy link
Contributor

May possibly be a fix for this as well:- https://github.com/stenzek/duckstation/issues/1662

@Nucleoprotein
Copy link

Maybe this prevents crash but... why Bus::g_ram is null there?

@PugsyMAME
Copy link
Contributor Author

It crashes when it goes back to the frontend, after the power down of the emulator core. I'm surmissing that because the memory scanner window was closed down prior to power down it didn't close it properly when you hit power down. And it possibly does a clean up after and Bus::g_ram would be null at that time.

But I'm just guessing - it was a quick fix and didn't investigate more.

@andercard0
Copy link
Contributor

May possibly be a fix for this as well:- #1662

Yes, boot and debug fixed!

image

@Nucleoprotein
Copy link

@PugsyMAME
Thanks for exploitation, seems good.

@Sekai9
Copy link

Sekai9 commented Aug 12, 2021

I can confirm that this change fixes #1662
Thanks!

@stenzek
Copy link
Owner

stenzek commented Aug 13, 2021

There's still a race condition here - Bus::g_ram could go null between the if and memcpy, since the system shutdown happens on the emu thread. I've held off in fixing this because the proper solutions aren't really great (make shutdown synchronous, or do the search on the emu thread, the latter is probably the least rubbish of the two).

Cheat Type F6 lets you perform cheats in IF / ELSE IF / ELSE constructs along 
with multiple conditions for each one.

It supports conditions  D0, D1, D2, D3, E0, E1, E2, E3, A0, A1, A2, A3, D7 and 
two new types that will only be available in the F6 conditions :- 
E4 & E5 which are bit comparisons on bytes (set and clear). 

Any of those types which are "block conditionals" like D7 will be treated as a 
single condition with the other conditions so you wont need to worry about 
extra 00000000 FFFFs just for them (infact you can drop them completely apart
from the last 00000000 FFFF, which you can also drop if you have no trailing
cheat lines after the end of the construct.


#IF / ELSE IF / ELSE Statement Example with Notes
80001000 00000001   Setup Test Condition 1
80001004 00000002   Setup Test Condition 2
80001008 00000003   Setup Test Condition 3
8000100C 00000004   Setup Test Condition 4

                    1F = IF, last two digits determine the number of conditions to check
                    F600000x  x = 0 All conditions must be true, x = 1 At least One condition must be true                  
F6000000 1F000004   Check the next 4 lines as the conditions for the IF loop to be taken

D0001000 00000001  )
D0001004 00000002  )Conditions
D0001008 00000003  )
D000100C 00000004  )

80001010 00005555    Poke(s)
00000000 0000FFFF  End of IF Statement

F6000000 E15E1F02  E15E1F = ELSE IF (same format as IF) - Can have multiple ELSE IF Blocks or none at all
D0001008 00000003  )
D000100C 00000005  )Conditions
80001010 00008888     Poke(s)
00000000 0000FFFF  End of ELSE IF Statement 

F6000000 E15E0000  E15E = ELSE (no need for conditions - this will poke if the others dont)
80001010 0000AAAA    Poke(s)
00000000 0000FFFF End of ELSE Statement



#Multiple Test Using Joypad Left Thumb Directions, Look at Address 1100 in Debugger
F6000000 1F000001  
D7020002 00100000
90001100 50205055
90001104 53534552 
90001108 20204445
9000110C 20202020
F6000000 E15E1F01
D7020002 00400000
90001100 4E574F44
90001104 45525020
90001108 44455353
9000110C 20202020
F6000000 E15E1F01
D7020002 00800000
90001100 5446454C
90001104 45525020
90001108 44455353
9000110C 20202020
F6000000 E15E1F01
D7020002 00200000
90001100 48474952
90001104 52502054
90001108 45535345
9000110C 20202044
F6000000 E15E0000
90001100 20202020
90001104 20202020
90001108 20202020
9000110C 20202020
00000000 0000FFFF
@stenzek
Copy link
Owner

stenzek commented Apr 10, 2024

RAM stays persistently mapped across system instances now, so the original problem should no longer be an issue.

F6 type was already added in 0fd593e.

@stenzek stenzek closed this Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants