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

Hellhound crashes after a short while #22

Open
Tatsuya79 opened this issue Jun 5, 2017 · 24 comments
Open

Hellhound crashes after a short while #22

Tatsuya79 opened this issue Jun 5, 2017 · 24 comments

Comments

@Tatsuya79
Copy link

This game works fine in winx68k 0.65 in windows and in px68k stand-alone 0.15 on android.
It crashes 10-15s after starting to play in Retroarch.

While troubleshooting, I tried to disable MIDI with MIDI_SW=false in config.
With other emulators it just makes the game switch from MIDI to internal sound while booting.

Here in Retroarch it goes into an error loop spamming:
BusError: eafa09
func = cpu_readmem24 addr = eafa09 flag = 1

@Tatsuya79
Copy link
Author

Tatsuya79 commented Jun 6, 2017

I went with more testing of upstream px68k on Android.
The game freezing after a short while happened in version 0.10 and got fixed with 0.11.

The fix should be into those 2 commits:
hissorii@f719f1f (this one is the important one)
hissorii@8e10743

This commit is mentioned as a fix to Dragon Quest 1 freezing in the readme.

@Tatsuya79
Copy link
Author

Those other commits would be interesting to investigate too if they make more sense for you than they do for me.
Perhaps not related with Hellhound, but could be.
Particularly that bus error looping when disabling midi? (never could reproduce that bug on stand-alone)

hissorii@7626916
hissorii@4186974

@Tatsuya79
Copy link
Author

Is this related to the DC68K_NO_JUMP_TABLE tag in makefile.libretro and the left out m68000/c68k/gen68k.c ?
I see some code similar to what I'm trying to port there but I don't understand it.

@r-type
Copy link

r-type commented Jun 6, 2017

no gen68k.c is only needed for generate c68k files. when regen file with DC68K_NO_JUMP_TABLE , i
deleted them for cleanup.
BTW original file could be retrieve here
https://github.com/kenyahiro/px68k/commits/master

@r-type
Copy link

r-type commented Jun 6, 2017

to build the c68k core i used this cmd.

gcc gen68k.c -DC68K_GEN -DC68K_NO_JUMP_TABLE -o gencpu

if we want to add the fix in the first commit , I think it's here.

https://github.com/kenyahiro/px68k/blob/master/m68000/c68k/gen68k.inc#L882

@r-type
Copy link

r-type commented Jun 6, 2017

to tweak
wf_op("\tCPU->flag_X = CPU->flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;\n");

addx here
https://github.com/kenyahiro/px68k/blob/master/m68000/c68k/gen68k.inc#L830
wf_op("\tCPU->flag_X = CPU->flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;\n");

@r-type
Copy link

r-type commented Jun 6, 2017

I've done the mod for (subx/addx), can you test it ?
it doesn’t freeze for me any more, but command for moving are odd.
I would like to see if there is no regression with this mod.

http://dl.free.fr/jVTKTV1ZL

@r-type
Copy link

r-type commented Jun 6, 2017

for the record i change
set_addx_flag
//ORIG wf_op("\tCPU->flag_X = CPU->flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;\n");
wf_op("\tCPU->flag_X = CPU->flag_C = ((((src & 1) + (dst & 1) + (((CPU->flag_X >> 8) & 1) & 1)) >> 1) + (src >> 1) + (dst >> 1)) >> 23;\n");

set_subx_flag
//ORIG wf_op("\tCPU->flag_X = CPU->flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;\n");
wf_op("\tCPU->flag_X = CPU->flag_C = ((((src & 1) + (res & 1) + (((CPU->flag_X >> 8) & 1) & 1)) >> 1) + (src >> 1) + (res >> 1)) >> 23;\n");

@r-type
Copy link

r-type commented Jun 6, 2017

internal music works also

@Tatsuya79
Copy link
Author

Great! Does not freeze any more! 👍
Didn't notice anything wrong with the controls, have to test more...

Internal music already worked before.
The problem is a bus error loop when changing MIDI_SW to false in config.
It still happens with your changes but retro-wertz told me he managed to make it switch to internal sound, idk how yet.

@r-type
Copy link

r-type commented Jun 6, 2017

cool ,I will backport the change then .
i will look all to see if there are other fix to backport to new c68k core.
Did the sound works find with ssf2 in android with standalone?
I really would like to find a way to fix under linux 64 without having to do heavy change like changing the size of ptr ...

@Tatsuya79
Copy link
Author

Just tried sf2ce on stand-alone android, internal music works fine.

I couldn't start the game at first because I had MIDI_SW=false...
This option is annoying. I'll leave it on true now.

@r-type r-type closed this as completed in 91d3b93 Jun 6, 2017
@r-type
Copy link

r-type commented Jun 6, 2017

leave it open for the MIDI_SW buserr

@r-type r-type reopened this Jun 6, 2017
@Tatsuya79
Copy link
Author

Just tested max speed with Akazukin Chachacha.
750fps before, 1000fps now. :)

@ghost
Copy link

ghost commented Jun 8, 2017

this is re-confimed to be working on newly regenerated cpu core.
with regards to the bus_error, if this matters, the old code does not have all adresses used, only the ones used. new code layout uses Read/Write Tables for the address, which includes rm_buserr.

@r-type @Tatsuya79
isnt suppose to be the hellhound patch is on "set_addx_flag" and "set_subx_flag"? i think its wrongly placed in "set_sub_flag" instead.

this PR should correct this if this was the case....
#28

@r-type
Copy link

r-type commented Jun 9, 2017

Yes you are right , but i prefere regenreate the core (and fix gencpu.inc) instead of the PR

@r-type
Copy link

r-type commented Jun 9, 2017

BTW does it mean that only addx fix the helllhound ?

@ghost
Copy link

ghost commented Jun 9, 2017 via email

@r-type
Copy link

r-type commented Jun 9, 2017

originally hissorii patched for subx and addx . i will keep the two for now. i ill update patch

@Tatsuya79
Copy link
Author

For Hellhound only that one hissorii@f719f1f is enough.
Then I added references to some other hissorii did.

@Tatsuya79
Copy link
Author

Perhaps some fixes here need to be ported as well?

hissorii@4186974
hissorii@8e9cbb0

@ghost
Copy link

ghost commented Jun 16, 2017

we should really try to port the BusErrHandling section of px68k, this is needed at least for x6800 since most games try to detect midi ports, and will revert to internal midi if BusErrHandling was emulated(since we do not have midi port).

i manage to port the code but its not working right. i only managed to get something like this:
chourensha 68k v1 01 1995 famibe no yosshin -170616-153418

code : https://hastebin.com/irevadevid.php
if you read the value from (PC - CPU->BasePC)) - 2 and GET_SR, it matches the ones in the screenshot, so its probably near correct. im not experience enough with programming, so im not sure where to go from here.

@r-type
Copy link

r-type commented Jun 16, 2017

Now ,
If i boot with MIDI_SW=false , HellBound. music works fine and i it change the config to MIDI_SW=true.
Can you give me the name of the game that cause the error in you screenshot to test ?

@gingerbeardman
Copy link

@r-type game is 超連射68K (Chō Ren Sha 68K) https://en.wikipedia.org/wiki/Cho_Ren_Sha_68K

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

3 participants