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

Add some wrapped functions for Arkos Tracker 2 #71

Merged
merged 1 commit into from
Nov 6, 2019

Conversation

icecream95
Copy link
Contributor

With these patches, Arkos Tracker now works.

It seems to runs fine, with nothing obviously broken.

@icecream95
Copy link
Contributor Author

Some of the functions in the generated files got re-ordered - I think you should force the locale to "C" somehow when sorting the functions in rebuild_wrappers.py.

@@ -485,7 +485,7 @@ DATAB(_XInitDisplayLock_fn, 4)
// _XInitDynamicIM
// _XInitDynamicOM
//GO(XInitExtension
//GO(XInitImage
GO(XInitImage, iFp)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XImage contains callback. I'll add the handling of them. It may try to execute ARM code in X86 world if the program directly use the function pointer inside the XImage (with macro for example) insteadof using the regular funciton.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure enough, when I try to load a song file I get

Unimplemented Opcode E5 00 40 A0 E1 60 40 84

which looks suspiciously like ARM instructions.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it working now with may latest commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, so maybe it isn't this specific function that's causing the crash.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it crashes with the same unimplemented opcode?

@ptitSeb ptitSeb merged commit 718ceac into ptitSeb:dynarec Nov 6, 2019
@ptitSeb
Copy link
Owner

ptitSeb commented Nov 6, 2019

I think I know the cause of the issue: the function ___tls_get_addr(...) is probably incorrect. I'm trying to fix it.

Also, just to be sure, the "Ctrl+L" shortcut or File|Open menu just gives me a "cannot open file" error, with no dialog to choose a file. I need to drag'n drop a file into the app to open it. Do you have the same behavour?

@icecream95
Copy link
Contributor Author

The file open dialog seems to work fine for me.

I'm using libfreetype, libstdc++ and libgcc_s from Debian buster, maybe that could affect it.

Using gdb, it seems that the Unimplemented Opcode error is from trying to execute my_sighandler for the segfault as x86 code, so it was a result, not a cause, of the crash.

Maybe you could try writing my_sighandler so it can be executed both as ARM and x86, by having a jump instruction to another part of the function in one architecture that is a no-op in another?

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 8, 2019

Well, the Pandora on which I do most of my testing is pretty limited, with an old Linux among other things...

Still, I have managed to fix the crash at loading. I had to rework entirely the TLS (Thread Local Storage) handling. It's much cleaner now, and should work better in numerous software...

(On Pandora I didn't got any sound while playing, but I guess it's the ALSA driver on the pandora that is a bit too old for all this).

@icecream95
Copy link
Contributor Author

It works fine now.

I tried loading some of the MODs from TuxKart, and they loaded, but what it loaded I probably wouldn't call music...

That's probably a bug in Arkos Tracker - it's still alpha software at the moment.

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 9, 2019

I changed my config for Alsa, setting only 22050Hz and a 2048 bytes buffer (the Pandora don't handle smaller ones), and loading a "native" -channel soung: it workd fine, and music was ok.

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

Successfully merging this pull request may close these issues.

None yet

2 participants