English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. C/C++ (https://eab.abime.net/forumdisplay.php?f=118)
-   -   WarpOS version of SDL (https://eab.abime.net/showthread.php?t=88760)

grelbfarlk 13 December 2017 04:16

Quote:

Originally Posted by Marlon_ (Post 1205751)
Elf2exe2 usage:
./elf2exe2 file.elf file.hunk

Exactly the same way elf2hunk works.

So it should work just the same with warpcollect.

Very exciting, I hope you make it work.

Hedeon 13 December 2017 07:55

Custom options are no longer supported, I mean. I use the -warpup option which is defined in the specs file to build for WarpOS. In the newer gcc versions only options compiled into gcc can be changed using the specs file. Custom options are ignored.


Quote:

Originally Posted by Marlon_ (Post 1205749)
So, yeah, specs files still work:
Code:

[marlon@hastur]:~/tmp/MilkyTracker/morphos-cross-toolchain/WarpOS$ ppc-morphos-gcc -v -warpup test.cpp
Reading specs from /opt/ppc-morphos/bin/../lib/gcc-lib/ppc-morphos/5.3.0/specs
COLLECT_GCC=ppc-morphos-gcc
COLLECT_LTO_WRAPPER=/opt/ppc-morphos/bin/../lib/gcc-lib/ppc-morphos/5.3.0/lto-wrapper
ppc-morphos-gcc: error: unrecognized command line option ‘-warpup’
Target: ppc-morphos
Configured with: ../gcc-5.3.0/configure --target=ppc-morphos --enable-languages=c,c++,objc --prefix=/gg --with-sysroot=/gg --libexecdir=/gg/lib --oldincludedir=/gg/include --program-prefix=ppc-morphos- --program-suffix=-5 --enable-threads=morphos --disable-bootstrap --with-pkgversion=GCC/MorphOS --with-bugurl=http://www.morphos-team.net/ --enable-version-specific-runtime-libs --with-gmp=/home/marlon/tmp/MilkyTracker/morphos/gcc5/libs --with-mpfr=/home/marlon/tmp/MilkyTracker/morphos/gcc5/libs --with-mpc=../libs
Thread model: morphos
gcc driver version 5.3.0 (GCC/MorphOS) executing gcc version 4.4.5

But I think the format might be different!


Marlon_ 13 December 2017 13:57

Quote:

Originally Posted by Hedeon (Post 1205781)
Custom options are no longer supported, I mean. I use the -warpup option which is defined in the specs file to build for WarpOS. In the newer gcc versions only options compiled into gcc can be changed using the specs file. Custom options are ignored.

the weird thing is, custom options still work if you specify the specs file with --specs= but not when gcc is automatically loading the specs file.
One could simply solve this (on Linux at least) by doing:
Code:

alias ppc-morphos-gcc='ppc-morphos-gcc --specs=SPECSFILE'
Regarding Elf2exe2, there are two alternatives that does essentially the same thing.
Elf2exe2 usage: ./Elf2exe2 elf-file hunk-file

1. elf2hunk from AROS repo: it does exactly this, but it's main purpose is to convert m68k-elf to m68k-hunk, so it requires some modification to produce the extended hunk format.
elf2hunk usage: ./elf2hunk elf-file hunk-file

2. vlink: according to the documentation it is possible to convert elf-files to amiga extended hunk format, I've done some tests, but with my version of vlink it gives me a segmentation fault for milkytracker, but works flawlessly with other smaller files.
vlink usage: ./vlink elf-file -bamigaehf -o hunk-file

I intend to investigate how vlink does things and do a fork of elf2hunk to replicate the functionality of Elf2exe2. All the information is there, someone just needs to do it.
The biggest hurdle is that I do not own a PPC accelerator, so I have no way to test the executables on hardware, but is it possible to set up UAE + QEMU-PPC to do a WarpOS setup?
If so how? Anyone got a guide?

Sorted!

emufan 13 December 2017 15:45

Quote:

Originally Posted by Marlon_ (Post 1205832)
QEMU-PPC to do a WarpOS setup?
If so how? Anyone got a guide?

get the PPC CPU core plugin, WinUAE 3.0 or later - and try the settings in winuae:

config -> expansion:
-> Accelerator Board Settings:
---> Phase 5 - CyberStorm
---> CyberStorm PPC
-> Accelerator Board ROM file:
---> Cyberstorm PPC (128k)
-> Accelerator Board memory: 128mb

expansion roms are on the ftp/zone - expansion_boot_roms.zip
maybe that is already enough - cannot remember exactly.

but I have no idea which system software you need

Marlon_ 13 December 2017 15:47

Quote:

Originally Posted by emufan (Post 1205854)
get the PPC CPU core plugin, WinUAE 3.0 or later - and try the settings in the attached image.
expansion roms are on the ftp/zone - expansion_boot_roms.zip
maybe that is already enough - cannot remember exactly.

I run Mac / Linux and FS-UAE, but I got it sorted. It's the same setup I use to test my OS4.1 binaries with.
All I had to do was installing up to date WarpOS on OS39. :)

emufan 13 December 2017 15:55

Quote:

Originally Posted by Marlon_ (Post 1205855)
I run Mac / Linux and FS-UAE, but I got it sorted. It's the same setup I use to test my OS4.1 binaries with.
All I had to do was installing up to date WarpOS on OS39. :)

ok, good :)

Hedeon 13 December 2017 21:46

I think EHF is only for StormC. The WarpOS stuff I compile mostly have the standard hunks..Try the Aros one, I'd say.

Marlon_ 13 December 2017 21:50

Quote:

Originally Posted by Hedeon (Post 1205919)
I think EHF is only for StormC. The WarpOS stuff I compile mostly have the standard hunks..Try the Aros one, I'd say.

I've gotten as far as setting up a warpos toolchain, but the elf files are broken when I compile this:
Code:

#include<stdio.h>

int main()
{
    printf("Hello World");
}

Code:

$ ppc-warpos-g++ -Wall -fno-rtti -mhard-float -O3 -fomit-frame-pointer -fno-exceptions  -warpup -t WarpOS/test.cpp -o test.elf
/opt/ppc-morphos/bin/ppc-morphos-ld: mode morphos
/opt/ppc-warpos/lib/startupwos.o
/tmp/ccWqeBbM.o
(/opt/ppc-warpos/lib//libcwos.a)__nocommandline.o
(/opt/ppc-warpos/lib//libcwos.a)printf.o
(/opt/ppc-warpos/lib//libcwos.a)vprintf.o
(/opt/ppc-warpos/lib//libcwos.a)__stdio.o
(/opt/ppc-warpos/lib//libcwos.a)fopen.o
(/opt/ppc-warpos/lib//libcwos.a)calloc.o
(/opt/ppc-warpos/lib//libcwos.a)malloc.o
(/opt/ppc-warpos/lib//libcwos.a)freopen.o
(/opt/ppc-warpos/lib//libcwos.a)free.o
(/opt/ppc-warpos/lib//libcwos.a)errno.o
(/opt/ppc-warpos/lib//libcwos.a)__fflush.o
(/opt/ppc-warpos/lib//libcwos.a)open.o
(/opt/ppc-warpos/lib//libcwos.a)__seterrno.o
(/opt/ppc-warpos/lib//libcwos.a)realloc.o
(/opt/ppc-warpos/lib//libcwos.a)__chkabort.o
(/opt/ppc-warpos/lib//libcwos.a)raise.o
(/opt/ppc-warpos/lib//libcwos.a)__signalfunc.o
(/opt/ppc-warpos/lib//libcwos.a)memmove.o
(/opt/ppc-warpos/lib//libcwos.a)bcopy.o
(/opt/ppc-warpos/lib//libcwos.a)__amigapath.o
(/opt/ppc-warpos/lib//libcwos.a)strdup.o
(/opt/ppc-warpos/lib//libcwos.a)__stdiowin.o
(/opt/ppc-warpos/lib//libcwos.a)exit.o
(/opt/ppc-warpos/lib//libcwos.a)vfprintf.o
(/opt/ppc-warpos/lib//libcwos.a)_ctype_.o
(/opt/ppc-warpos/lib//libcwos.a)fputc.o
(/opt/ppc-warpos/lib//libcwos.a)__swbuf.o
(/opt/ppc-warpos/lib//libcwos.a)isinf.o
(/opt/ppc-warpos/lib//libcwos.a)isnan.o
(/opt/ppc-warpos/lib//libcwos.a)__decimalpoint.o
(/opt/ppc-warpos/lib//libcwos.a)pow.emb.o
/opt/ppc-warpos/lib/end.o

Even running Elf2exe2 in WarpOS produces a broken binary hunk. :/



Do you have any test sources I can use to test build something?

grelbfarlk 14 December 2017 00:15

Quote:

Originally Posted by Marlon_ (Post 1205920)
I've gotten as far as setting up a warpos toolchain, but the elf files are broken when I compile this:


Do you have any test sources I can use to test build something?

How about bogomips?
https://github.com/Sakura-IT/SonnetA...ols/bogomips.c

Granted I've only tried to compile this under VBCC but it should work.

Also regarding UAE, from what I've seen, UAE is not so great for WarpOS. If the app launches then usually you're fine but I gave up on it as there's about a 50% chance the powerpc.library crashes on launching an app. So I could run a large compile and that would go fine up until elf2exe2 was called then about a 50% chance it would crash at that point.

Marlon_ 14 December 2017 03:13

Quote:

Originally Posted by grelbfarlk (Post 1205929)
How about bogomips?
https://github.com/Sakura-IT/SonnetA...ols/bogomips.c

Granted I've only tried to compile this under VBCC but it should work.

Also regarding UAE, from what I've seen, UAE is not so great for WarpOS. If the app launches then usually you're fine but I gave up on it as there's about a 50% chance the powerpc.library crashes on launching an app. So I could run a large compile and that would go fine up until elf2exe2 was called then about a 50% chance it would crash at that point.

Well, if I even get that far. According to elf2exe2, loadelfwos, vlink and elf2hunk, the compiler spits out junk. :P I've tested WarpOS binaries in UAE, so I know the issue doesn't lie within WarpOS.

grelbfarlk 14 December 2017 03:41

What kind of junk? Not that I'm going to be able to help but just curious. Also I believe in you, make it work.

Marlon_ 14 December 2017 03:55

Quote:

Originally Posted by grelbfarlk (Post 1205955)
What kind of junk? Not that I'm going to be able to help but just curious. Also I believe in you, make it work.

well, checkelfwos says .sdata 2 doesn't have memory allocation.
test.hunk generated by elf2hunk just gives me error #8000 0004 (memory), doesn't even launch WarpOS.
loadelfwos launches test.elf in WarpOS, but gives an error.
test.exe generated by elf2exe2 launches in WarpOS, and gives the same error as loadelfwos did.

Comparing test.hunk and test.exe in a binary/hex comparison/diff shows that he end result is completely different in the binaries.

But my conclusion is that something isn't exactly right when the binary was compiled in the toolchain either.

So far I've tested with gcc-5, but since gcc-4 works on MorphOS for Hedeon, I'll give that a go next. If that does work, that means I need to do changes to the specs file that Hedeon made for gcc-4 to make it work with gcc-5+ setups.

If you feel like messing about with this yourselves sometime, I've made a pretty straightforward morphos cross toolchain install script, which is located here: https://github.com/AmigaPorts/morphos-cross-toolchain

Then combine that with: http://aminet.net/package/dev/gcc/gcc-mos2wos

Replace warpcollect in lib/gcc-lib/ppc-morphos/[VERSION]/ with your own compile of http://aminet.net/package/dev/c/warpcollect with modified paths.

Or simply change lib/gcc-lib/ppc-morphos/[VERSION]/specs to use collect2 instead of warpcollect, and use Elf2exe2 on MorphOS/WarpOS

AROS elf2hunk is located here: https://github.com/michalsc/AROS/blo...unk/elf2hunk.c
it requires some modification and knowledge about elf and hunk headers.

I've already begun to make changes to the toolchain install script to accomodate for a warpos setup.
Usage:
Code:

$ ./toolchain-morphos -h
MorphOS Cross Toolchain v1.5
Usage: ./toolchain-morphos [OPTION]...

Options:
  -p,  --prefix                choose the path for your prefix. Default: /opt/ppc-morphos
  -g,  --gcc                    pick the version of gcc you want to install. Available versions: gcc4, gcc5 (default)
  -w,  -warpup                  install WarpOS toolchain
  -v,  --version                display the SDK-version of MorphOS and exit
  -h,  --help                  print this help

To install the MorphOS toolchain (works as far as I know):
Code:

./toolchain-morphos --prefix /opt/ppc-morphos --gcc gcc5
To install the incomplete WarpOS toolchain (edits only apply to gcc5 so far):
Code:

./toolchain-morphos --prefix /opt/ppc-warpos --gcc gcc5 -warpup

grelbfarlk 15 December 2017 01:36

Here is where I was going to show a screenshot of a new project that just got built but my sys partition has been eaten....
New version of SDL 1.2.15 working with new SDL_Mixer and SDL_Image let me finally get this running. Freesynd 0.7 for Classic Amiga.
https://i.imgur.com/yIBGNOP.png


Then I read the readme and it has a lot of problems like every shot is a one hit kill.... and stuff. Oh well it was a good test of the libs.

grelbfarlk 18 December 2017 02:27

Steve House fixed the ASL requester, it now works properly on WarpOS.

Marlon_ 18 December 2017 02:47

Quote:

Originally Posted by grelbfarlk (Post 1206614)
Steve House fixed the ASL requester, it now works properly on WarpOS.

And it looks alright as well? Can I get all your changes so I can apply them to the main source? Including makefile.

Assuming you're talking about MilkyTracker of course.

grelbfarlk 18 December 2017 03:38

Quote:

Originally Posted by Marlon_ (Post 1206615)
And it looks alright as well? Can I get all your changes so I can apply them to the main source? Including makefile.

Assuming you're talking about MilkyTracker of course.

No it doesn't look right yet, still BE mode in 16-bit. It does look ok in 24-bit. Also 8-bit doesn't work. Send me a PM with your email or something.

grelbfarlk 27 December 2017 20:04

Here someone see if they can make this work. It's Retroarch built with SNES2010, no other cores included-for now. I guess it needs xmb/monochrome/ and named_boxarts.png. Oh and a config file of some sort.

It's totally untested other than crashing with a black window looking for skins.

If it does work then I'll try to add some more cores. Final Burn Alpha seemed to build alright but it was built for MorphOS so optimistically it'd just need a recompile.

The xmb skin assets can be downloaded here:
https://github.com/libretro/retroarc...ive/master.zip

I guess XMB needs GL, so RGUI it is.


Attachment removed, I don't think it does anything.

A little progress :crazy
https://i.imgur.com/y67wYfd.png

grelbfarlk 31 December 2017 17:43

After trying to get various cores to work I found one that does sort of work to an extent. Libretro-PrBoom running from Retroarch:

https://i.imgur.com/DERO1VM.png

grelbfarlk 05 January 2018 01:25

Small status update, things are running faster but still not quite fast enough. PrBoom and Snes2005 cores work, PrBoom runs quite well and sound is good except for lacking music yet, Snes is still a bit slow and sound is glitchy. Problem I'm having with some of the other cores is the C++ limitation, or all of the game code in a C core is fine but it will have a single C++ source which causes all sorts of havoc. Haven't thought of a way of getting around that yet.
Also OpenTyrian kind of works but input is lagged to hell so it looks and sounds fine it's not playable because the input is horrible.

Had the idea to build the one .cpp include with 2.95.3 in a FBAlpha core, this was the result:
Code:

LD retroarch
/gg/ppc-amigaos/lib//libretro.a(libretro.o): In function `__default_alloc_template<false, 0>::_S_chunk_alloc(unsigned int, int &)':
libretro.o(.gnu.linkonce.t._S_chunk_alloc__t24__default_alloc_template2b0i0UiRi+0x14a):
undefined reference to `endl(ostream &)'
libretro.o(.gnu.linkonce.t._S_chunk_alloc__t24__default_alloc_template2b0i0UiRi+0x152):
undefined reference to `endl(ostream &)'
libretro.o(.gnu.linkonce.t._S_chunk_alloc__t24__default_alloc_template2b0i0UiRi+0x156):
undefined reference to `cerr'
libretro.o(.gnu.linkonce.t._S_chunk_alloc__t24__default_alloc_template2b0i0UiRi+0x16e):
undefined reference to `cerr'
libretro.o(.gnu.linkonce.t._S_chunk_alloc__t24__default_alloc_template2b0i0UiRi+0x170):
undefined reference to `ostream::operator<<(char const *)'
make: *** [retroarch] Error 1


trixster 05 January 2018 13:54

Great work so far grelbfarlk! Interesting updates!


All times are GMT +2. The time now is 20:17.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.06087 seconds with 11 queries