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

Support for Amiga architecture #25

Open
tehKaiN opened this issue Mar 1, 2018 · 4 comments
Open

Support for Amiga architecture #25

tehKaiN opened this issue Mar 1, 2018 · 4 comments

Comments

@tehKaiN
Copy link

tehKaiN commented Mar 1, 2018

LHA has always been important for Amiga users. We have aminet.net, which is massive repository of Amiga-related software, and everything there is packed with LHA or LZX. With such strong tradition in mind I think it's very appropriate to have Amiga arch support. ;)

There is a precompiled lhasa versions on aminet, but its performance and size are not so well optimized. With some patches to Amiga GCC toolchain standard library, I've managed to build lhasa to filesize of 79KB, which is almost twice as small as one found on aminet. I'd gladly contribute lha_arch_amiga.c so that future versions may be built from source without any effort. Dunno how to do it with build system though: I'm not an automake guy and I've built it using self-made makefile. If you're willing to accept my pull request I'll try to learn a bit more and add required changes for automake too.

@fragglet
Copy link
Owner

fragglet commented Mar 1, 2018

Yes, please feel free to submit a pull request. Using autotools would be ideal but I don't know what the tooling situation is like on AmigaOS or whether it's practical to use it. So I encourage you to use that but it's not essential.

@tehKaiN
Copy link
Author

tehKaiN commented Mar 2, 2018

Okay, will do.

Currently most of folks are cross-compiling anyway and currently best-looking toolchain is using automake for its submodules, so that shouldn't be a problem. There are still some people who compile everything on their Amigas where at most only make is present, but they mostly have enough skill to come up with custom makefile. ;)

Also, I've noticed that you're using floats only for ratio calculation - removing this one usage adds many more optimization opportunities (stock Amigas don't have FPU so floats are slowly emulated), so I've made function which was returning float percents to return integer promilles, which are then displayed as dual %d - one with /10, the other with % 10. Dunno how you feel with this kind of optimization being added to your prog ;)

@tehKaiN
Copy link
Author

tehKaiN commented Mar 2, 2018

Okay, I've added pull request. There's still some work to be done.

I've read some tutorials about autotools, so I get the main concept, and there are even means to crosscompile. Since Amiga GCC toolchain has m68k-amigaos- one can simply write ./configure --host=m68k-amigaos to trigger crosscompiling. Problem is that autotools have some weird preset for some obsolete toolchain version and use strange cc flags, and also tool for linking library which is not really present in recent tooling.

My guess is that we need to override stuff that ./configure guessed with some lines in configure.ac. I still don't know how to do this but we need to set CC flags to include -fomit-frame-pointer -fbaserel and link flags to have -noixemul and optionally -flto to squeeze some more optimizations out of compiler. See Makefile.amiga on my branch for reference. I'll look into it right now, but I wouldn't mind hearing any ideas for doing such thing. ;)

Also, I'd like your opinion if scrapping float percentage for integer permilles stays or should I revert it.

@tehKaiN
Copy link
Author

tehKaiN commented Mar 2, 2018

The problem with autotools is that it uses libtool, which tries to build liblhasa in some prehistoric manner. Everything would be cool if automake could use $(AR) for Amiga linkage. I've searched the net for forcing such behavior but couldn't find anything.

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

2 participants