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

Make replayer code portable #3

Closed
wants to merge 4 commits into from
Closed

Conversation

PoroCYon
Copy link
Contributor

  • Exported symbols are now the same (as seen from C) across all (supported) platforms (No leading underscore bullshit)
  • section syntax differs a bit for NASM ELF output, now fixed.
  • More stuff of that ilk

Basically the same procedure as in gopher-atz/4klang#2 , except I was able to test the exporter now as well.

@askeksa
Copy link
Owner

askeksa commented May 26, 2019

Thank you for figuring out all the various changes necessary to make the converter and player Linux compatible!

I might want to make some of the changes in a slightly different way, but I will go through them to figure out how they best fit in. I'll probably have some questions along the way...

@askeksa
Copy link
Owner

askeksa commented Nov 2, 2019

OK, I finally got around to looking through this PR and trying out the changes, both on Linux (Ubuntu 16.04) and Windows.

I have made several changes from your original proposal, which I will describe in the following. To begin with, I have added the commits (which are still attributed to you) on a branch, so you have a chance to look through them before I merge them to master: https://github.com/askeksa/Oidos/tree/portable_player

So here are the things I changed:

  • Various minor changes to macro names and comments.
  • Renamed play.c to dump_wav.c to match the produced executable.
  • Section names on Windows are limited to 8 characters, so I changed some of them back and also changed the Windows macros to not add a prefix.
  • nasm doesn't seem to pre-define symbols identifying the platform, so I changed the platform switch in platform.inc to %ifidn __OUTPUT_FORMAT__, win32 as suggested by the nasm manual.
  • Defining ID3D11Texture2D_ID as a uint32_t array does not work with D3D11 code, which must have it as GUID, so I changed that back. Since it is guarded by #ifdef GUID_DEFINED, it should not disturb other platforms.
  • In random.asm, I simply define and export both the undecorated and decorated versions of ID3D11Texture2D_ID instead of having it depend on the platform.
  • I left out the renames of the conversion scripts. While I do realize that Linux conventionally uses all lowercase for files like this, it is not something that blocks them from being used, so for a cross-platform distribution, I prefer to leave them as they are. This also avoids breaking existing scripts.
  • OidosUpgrade.py is just an internal script for converting pre-2.0 Oidos songs (of which there exist none which haven't already been converted), so there is not much point in maintaining it. Therefore, I left out that change.
  • For the easy_elf feature, I merged it into easy_exe, so there's just one directory, now with an extra script in it. I also rewrote the script to work similarly to the Windows script (i.e. use a temp dir, delete temp files before rather than after).
  • The last commit was merged into the first one, so we just use _WIN32 right away.

Do these changes seem reasonable to you?

@PoroCYon
Copy link
Contributor Author

PoroCYon commented Nov 2, 2019

Yup, that all looks fine, no objections from me.

@askeksa
Copy link
Owner

askeksa commented Nov 3, 2019

Great. Thanks again for your contribution.

@askeksa askeksa closed this Nov 3, 2019
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