English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 24 September 2017, 04:18   #1
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,902
WarpOS version of SDL

Does anyone know of or have an SDL link library for WarpOS for GCC 2.95.3?
I have found a StormC version and what I think is a SAS/C version but nothing for GCC or the source for it.

http://aminet.net/package/dev/misc/AmigaSDLstorm4

I am aware of the WarpSDL.library from OnyxSoft.

http://www.onyxsoft.se/warpsdl.html

But no source is available and I'm not smart enough to convert all those to openlibrary calls even if all of the functions are available.

Just as an experiment I tried compiling the old OS4 version of ScummVM 0.11.1 which fails on the OS FS stuff and SDL, but 589 other objects were compiled.
grelbfarlk is offline  
Old 28 September 2017, 04:03   #2
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,902
So I found an older version which includes a WarpOS version and managed to get it all to compile except for the PPC Tasks and Threads part. These didn't compile.

Prerequisite `SDL_syssem.wo' of target `libSDL_wos.a' does not exist.
Prerequisite `SDL_systhread.wo' of target `libSDL_wos.a' does not exist.
Prerequisite `SDL_thread.wo' of target `libSDL_wos.a' does not exist.

ppc-amigaos-gcc -warpup -O2 -fomit-frame-pointer -I./proto -I./devices -I./clib -DENABLE_CYBERGRAPHICS -DENABLE_AHI -DNO_SIGNAL_H -DWARPOS -DNO_AMIGADEBUG -o SDL_syssem.wo -c SDL_syssem.c
In file included from SDL_syssem.c:34:
/ade/os-includeppc/powerpc/semaphoresPPC.h:11: field `ssppc_SS' has incomplete type
make: [SDL_syssem.wo] Error 1 (ignored)
ppc-amigaos-gcc -warpup -O2 -fomit-frame-pointer -I./proto -I./devices -I./clib -DENABLE_CYBERGRAPHICS -DENABLE_AHI -DNO_SIGNAL_H -DWARPOS -DNO_AMIGADEBUG -o SDL_systhread.wo -c SDL_systhread.c
In file included from /ade/os-includeppc/powerpc/portsPPC.h:13,
from /ade/os-includeppc/powerpc/tasksPPC.h:5,
from SDL_systhread.c:68:
/ade/os-includeppc/powerpc/semaphoresPPC.h: In function `RunThread':
/ade/os-includeppc/powerpc/semaphoresPPC.h:11: field `ssppc_SS' has incomplete type
In file included from SDL_systhread.c:68:
/ade/os-includeppc/powerpc/tasksPPC.h:28: field `tp_Task' has incomplete type
SDL_systhread.c: In function `SDL_SYS_CreateThread':
SDL_systhread.c:160: warning: assignment makes pointer from integer without a cast
make: [SDL_systhread.wo] Error 1 (ignored)
ppc-amigaos-gcc -warpup -O2 -fomit-frame-pointer -I./proto -I./devices -I./clib -DENABLE_CYBERGRAPHICS -DENABLE_AHI -DNO_SIGNAL_H -DWARPOS -DNO_AMIGADEBUG -o SDL_thread.wo -c SDL_thread.c
SDL_thread.c: In function `SDL_CreateThread':
SDL_thread.c:227: warning: assignment makes pointer from integer without a cast
SDL_thread.c: At top level:
SDL_thread.c:48: storage size of `thread_lock' isn't known

make: [SDL_thread.wo] Error 1 (ignored)


Which it seems to be complaining about:



In sdlssyemc: Line 38:
struct SDL_semaphore
{
struct SignalSemaphore Sem;
Uint32 count;
Uint32 waiters_count;
SDL_mutex *count_lock;
SDL_cond *count_nonzero;
};
In Semawhoresppc.h:

struct SignalSemaphorePPC {
struct SignalSemaphore ssppc_SS;
APTR ssppc_reserved; /* private */
UWORD ssppc_lock; /* private */
};

Last edited by grelbfarlk; 28 September 2017 at 21:40.
grelbfarlk is offline  
Old 29 September 2017, 02:59   #3
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,902
*Update* turns out I wasn't including the right file.

Done, I mean if it works.

Last edited by grelbfarlk; 29 September 2017 at 03:48. Reason: Because I'm a stupid.
grelbfarlk is offline  
Old 29 September 2017, 03:26   #4
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
the .lib do indeed look like sas/c compatible stuff. fileheader on those gcc made .a look different.

some moons ago I was building successfully sdl with SDL-AmigaSrc.lha.
using Makefile.cross. IIRC i only enabled "-DNO_AMIGADEBUG".

it was build for 68k, not sure about ppc. cannot remember which compiler, maybe
2.95 gcc or the one from AmiDevCpp ( gcc 3.5) - on a win7 box.
emufan is offline  
Old 29 September 2017, 09:40   #5
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 758
Grelbfarlk: Can you compile a simple intuition program and test if it works?
Cowcat is offline  
Old 29 September 2017, 12:19   #6
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Cowcat View Post
Grelbfarlk: Can you compile a simple intuition program and test if it works?
I have 3 gcc crosscompiler on my winbox. some sources compile with 2.95,
others with 6.x only. most compatible gcc comes with AmiDevCPP - gcc3.4.

you can use AmiDevCpp's gcc from a dos command shell.

open a cmd, cd to AmiDevCpp/bin and start a bash. basicaly it is a cygwin environment.
after starting bash.exe I only add path:
Code:
export PATH=/cygdrive/d/AmiDevCpp/usr/local/amiga/bin:/cygdrive/d/AmiDevCpp/bin:$PATH
this way you can use ./configure scripts, which is impossible with the AmiDevCpp gui version.
it does also have ppc-amigaos-gcc-4.2.0.exe incl the compiler tools for that.

#1) sometimes it is usefull to use CFLAGS like -std=c99 .
not sure if the following options apply to warpos / ppc aswell:
gcc with -noixemul or -mcrt=clib2 or -mcrt=nix13 or without any of them, can make big difference.

#2) and offten you try to find some errors in the source code, but the troublemaker is the incompatibe compiler ...

Quote:
Originally Posted by grelbfarlk View Post
*Update* turns out I wasn't including the right file.
... or the wrong includes

Last edited by emufan; 29 September 2017 at 12:40.
emufan is offline  
Old 30 September 2017, 00:45   #7
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,902
Very interesting Emufan, I didn't know there was a cross compiler for WarpOS in Amidevcpp. I'll look into that.

Here's the lib if anyone wants to give it a try making it do something. It's compiled in gcc 2.95.3.

Version 1.2.6 (really old).

Last edited by grelbfarlk; 22 June 2018 at 03:22.
grelbfarlk is offline  
Old 30 September 2017, 01:11   #8
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
congrats

1.2.6 is old, but good enough for the amiga. I'm using them for the sdl emulators.
btw. I'm using the includes by Novacoder - SDL_AGA.
take a look at the SDL_config* files. maybe usefull somehow.
emufan is offline  
Old 30 September 2017, 01:31   #9
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,902
now if I could only figure out how to use ppc-amigaos-g++ to actually link to the thing properly, I might could meet Cowcat's challenge of opening a simple intution window.
grelbfarlk is offline  
Old 30 September 2017, 02:12   #10
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
hmm, link with libSDl.a ? something like this:
g++ example.cpp libSDl.a -o example.exe

btw: some good point of AmiDevCpp, it does have the ability to produce binaries,
which uses ixemul.library. this was of great use, when it came to source code with path/directory/filehandling.
this happens if you do not use any of the 3 CFLAGs i wrote above.
emufan is offline  
Old 30 September 2017, 02:17   #11
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,902
Quote:
Originally Posted by emufan View Post
hmm, link with libSDl.a ? something like this:
g++ example.cpp libSDl.a -o example.exe

btw: some good point of AmiDevCpp, it does have the ability to produce binaries,
which uses ixemul.library. this was of great use, when it came to source code with path/directory/filehandling.
this happens if you do not use any of the 3 CFLAGs i wrote above.
Are you sure that the cross compiler for AmiDevCPP works with Warpos? The ppc-amigaos-gcc stuff seems to just be for OS4.
grelbfarlk is offline  
Old 30 September 2017, 02:18   #12
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by grelbfarlk View Post
Are you sure that the cross compiler for AmiDevCPP works with Warpos? The ppc-amigaos-gcc stuff seems to just be for OS4.
I cannot say for sure, never did any ppc stuff, just saw the *ppc* binary

#1) in the gui i can only find new project for amiga-68k and amiga-OS4. my bad :/
emufan is offline  
Old 30 September 2017, 05:06   #13
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,902
Pretty sure the lib is a failure. No matter what I try to link it with I get stuff like:
Code:
Error: Undefined Symbol: SDL_LoadBMP_RW
Error: Undefined Symbol: SDL_Quit
Error: Undefined Symbol: SDL_RWFromFile
Error: Undefined Symbol: SDL_Delay
Error: Undefined Symbol: SDL_UpperBlit
Error: Undefined Symbol: SDL_Init
Error: Undefined Symbol: SDL_FreeSurface
Error: Undefined Symbol: SDL_Flip
Error: Undefined Symbol: SDL_SetVideoMode
Or a ton of Undefined Symbols from Intuition, Exec, CGX...
Like this:
Code:
Error: Undefined Symbol: ChangeScreenBuffer
Error: Undefined Symbol: BltMaskBitMapRastPort
Error: Undefined Symbol: OpenScreenTags
Error: Undefined Symbol: ChangeWindowBox
Error: Undefined Symbol: CreateIORequest
Error: Undefined Symbol: WaitTOF
Error: Undefined Symbol: AllocVec
Error: Undefined Symbol: FreeScreenBuffer
Error: Undefined Symbol: ClearPointer
Error: Undefined Symbol: SetPointer
Error: Undefined Symbol: OpenWindowTags
Error: Undefined Symbol: UnlockPubScreen
Error: Undefined Symbol: ReleasePen
Error: Undefined Symbol: CheckIO
Error: Undefined Symbol: DeleteMsgPort
Error: Undefined Symbol: BltBitMap
Error: Undefined Symbol: AllocMem
Error: Undefined Symbol: AbortIO
Error: Undefined Symbol: GetMsg
Error: Undefined Symbol: BltBitMapRastPort
Error: Undefined Symbol: SetWindowTitles
Error: Undefined Symbol: CloseWindow
Error: Undefined Symbol: CreateMsgPort
Error: Undefined Symbol: GetSysTimePPC
Error: Undefined Symbol: LockPubScreen
Error: Undefined Symbol: Wait
Error: Undefined Symbol: PPCCallOS
Error: Undefined Symbol: CloseDevice
Error: Undefined Symbol: AllocScreenBuffer
Error: Undefined Symbol: DeleteIORequest
Error: Undefined Symbol: NextDisplayInfo
Error: Undefined Symbol: AllocBitMap
Error: Undefined Symbol: OpenLibrary
Error: Undefined Symbol: GetVPModeID
Error: Undefined Symbol: SendIO
Error: Undefined Symbol: Delay
Error: Undefined Symbol: WindowLimits
Error: Undefined Symbol: FreeBitMap
Error: Undefined Symbol: ReadJoyPort
Error: Undefined Symbol: FreeVec
Error: Undefined Symbol: CloseScreen
Error: Undefined Symbol: FindDisplayInfo
Error: Undefined Symbol: WaitIO
Error: Undefined Symbol: LoadRGB32
Error: Undefined Symbol: InitRastPort
Error: Undefined Symbol: FreeMem
Error: Undefined Symbol: ReplyMsg
Error: Undefined Symbol: GetDisplayInfoData
Error: Undefined Symbol: ObtainBestPenA
Error: Undefined Symbol: RawKeyConvert
Error: Undefined Symbol: OpenDevice
Error: Undefined Symbol: CloseLibrary

Last edited by grelbfarlk; 30 September 2017 at 05:23.
grelbfarlk is offline  
Old 30 September 2017, 11:39   #14
Cowcat
Registered User
 
Join Date: Apr 2013
Location: Mallorca
Posts: 758
As I explained in other thread, the gcc-warpos stuff doesn't work now AFAIK. I asume the compiled gcc binaries/libraries where done with old warpos includes. I tried to correct some of those (specially some function calls inlines that needed more parameters/registers), but no luck for now.

But I don't know any binary done by this gcc version to compare for example with an old or new warpos kernel.
Cowcat is offline  
Old 30 September 2017, 12:50   #15
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by grelbfarlk View Post
Pretty sure the lib is a failure. No matter what I try to link it with I get stuff like:
Code:
Error: Undefined Symbol: SDL_LoadBMP_RW
Error: Undefined Symbol: SDL_Quit
Error: Undefined Symbol: SDL_RWFromFile
Error: Undefined Symbol: SDL_Delay
Error: Undefined Symbol: SDL_UpperBlit
Error: Undefined Symbol: SDL_Init
Error: Undefined Symbol: SDL_FreeSurface
Error: Undefined Symbol: SDL_Flip
Error: Undefined Symbol: SDL_SetVideoMode
try the nm command and look if those function are in the libSDL.a:
Code:
$ m68k-amigaos-nm.exe -l libSDL.a | grep SDL_Flip
0000089c T _SDL_Flip
and ensure you have libSDl.a in last position in the object link order.
Quote:
Or a ton of Undefined Symbols from Intuition, Exec, CGX...
Like this:
Code:
Error: Undefined Symbol: ChangeScreenBuffer
Error: Undefined Symbol: BltMaskBitMapRastPort
Error: Undefined Symbol: OpenScreenTags
Error: Undefined Symbol: ChangeWindowBox
Error: Undefined Symbol: CreateIORequest
Error: Undefined Symbol: OpenDevice
Error: Undefined Symbol: CloseLibrary
with the m68k cross compilers those issue may be fixed by using libauto, -lAuto , -lauto.
-noixemul is ment to take care of those aswell.
not all compilers support those commands, or have their functionality, it seems.

Last edited by emufan; 30 September 2017 at 13:02.
emufan is offline  
Old 30 September 2017, 13:33   #16
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by emufan View Post
Quote:
Code:
Error: Undefined Symbol: SDL_Flip
try the nm command and look if those function are in the libSDL.a:
Code:
$ m68k-amigaos-nm.exe -l libSDL.a | grep SDL_Flip
0000089c T _SDL_Flip
and ensure you have libSDl.a in last position in the object link order.
I didn't read all of this thread, but your PPC-gcc seems to be configured for ELF V.4-ABI, not WarpOS PowerOpen-ABI. In ELF the compiler creates (and refers to) symbols without leading underscore. The library, on the other hand, looks like a real WarpOS library with underscores.
phx is offline  
Old 30 September 2017, 13:38   #17
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by phx View Post
I didn't read all of this thread
in this case, bad choice
it's about grelbfarlk attemp to create a libsSDl for warpOS.
i only gave some hint on how I did things with building m68k version of libSDL.

but any help is welcome

#1) your vbcc does have support for warpos, does build wos binaries?

#2) zoned: stormc4_gnu_sources.part1.rar stormc4_gnu_sources.part2.rar
which should have wos support?
there are some bin-utils binaries included. not sure if 68k or wos.
project files for StormC4 to rebuild them seems to be there too, also some Makefies.

is StormC4 still being sold? I can find StormC3 only. anyone with StormC4 installer?

#3) tested the bin-utils from stromc archive, no ppc support it seems:
Code:
3.SYS:binutils> nm-new -l ram:libSDL_wos.a 
nm-new: SDL_error.wo: File format not recognized
nm-new: SDL_fatal.wo: File format not recognized
nm-new: SDL_yuv.wo: File format not recognized
nm-new: SDL_yuv_sw.wo: File format not recognized
nm-new: SDL_yuv_mmx.wo: File format not recognized
...
the Undefined Symbol are not available. ?

Last edited by emufan; 30 September 2017 at 14:36.
emufan is offline  
Old 30 September 2017, 14:11   #18
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,902
Quote:
Originally Posted by emufan View Post
in this case, bad choice
it's about grelbfarlk attemp to create a libsSDl for warpOS.
i only gave some hint on how I did things with building m68k version of libSDL.

but any help is welcome

#1) your vbcc does have support for warpos, does build wos binaries?
Yeah it does, actually Hedeon suggested trying VBCC to build some of these objects when GCC wasn't giving me any useful errors. That's what lead me to find that it was puking on the includes.

nm says: For SDL_Flip
000012d8 T SDL_Flip
U SDL_FormatChanged (null):0
U SDL_FreeFormat (null):0
U SDL_FreeSurface (null):0

And SDL_Init
0000015c T SDL_Init

Last edited by grelbfarlk; 30 September 2017 at 14:19.
grelbfarlk is offline  
Old 30 September 2017, 14:43   #19
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by grelbfarlk View Post
Yeah it does, actually Hedeon suggested trying VBCC to build some of these objects when GCC wasn't giving me any useful errors. That's what lead me to find that it was puking on the includes.

nm says: For SDL_Flip
000012d8 T SDL_Flip
U SDL_FormatChanged (null):0
U SDL_FreeFormat (null):0
U SDL_FreeSurface (null):0

And SDL_Init
0000015c T SDL_Init
I get the same for the 68k version. with different offset and leading "_".
hmm, you did link with the correct version: g++ ... libSDL_wos.a
dont use -lSDL to ensure you link with the correct one.
emufan is offline  
Old 30 September 2017, 14:47   #20
grelbfarlk
Registered User
 
Join Date: Dec 2015
Location: USA
Posts: 2,902
Quote:
Originally Posted by emufan View Post
I get the same for the 68k version. with different offset and leading "_".
hmm, you did link with the correct version: g++ ... libSDL_wos.a
dont use -lSDL to ensure you link with the correct one.
I use -lSDL_wos or -LlibSDL_wos.a same difference. -lauto and -lAuto are not found.

If I do:
ppc-amigaos-g++ -warpup -lSDL_wos sdltest2.cpp -o sdltest801.elf
that gives me:
Error: Undefined Symbol: SDL_LoadBMP_RW
Error: Undefined Symbol: SDL_Quit
Error: Undefined Symbol: SDL_RWFromFile
Error: Undefined Symbol: SDL_Delay
Error: Undefined Symbol: SDL_UpperBlit
Error: Undefined Symbol: SDL_Init
Error: Undefined Symbol: SDL_FreeSurface
Error: Undefined Symbol: SDL_Flip
Error: Undefined Symbol: SDL_SetVideoMode

If I do:
ppc-amigaos-g++ sdltest2.cpp -warpup -lSDL_wos -o sdltest801.elf

Error: Undefined Symbol: ChangeScreenBuffer
Error: Undefined Symbol: BltMaskBitMapRastPort
Error: Undefined Symbol: OpenScreenTags
Error: Undefined Symbol: ChangeWindowBox
Error: Undefined Symbol: CreateIORequest
Error: Undefined Symbol: WaitTOF
Error: Undefined Symbol: AllocVec
Error: Undefined Symbol: FreeScreenBuffer
Error: Undefined Symbol: ClearPointer
Error: Undefined Symbol: SetPointer
Error: Undefined Symbol: OpenWindowTags
Error: Undefined Symbol: UnlockPubScreen
Error: Undefined Symbol: ReleasePen
Error: Undefined Symbol: CheckIO
Error: Undefined Symbol: DeleteMsgPort
Error: Undefined Symbol: BltBitMap
Error: Undefined Symbol: AllocMem
Error: Undefined Symbol: AbortIO
Error: Undefined Symbol: GetMsg
Error: Undefined Symbol: BltBitMapRastPort
Error: Undefined Symbol: SetWindowTitles
Error: Undefined Symbol: CloseWindow
Error: Undefined Symbol: CreateMsgPort
Error: Undefined Symbol: GetSysTimePPC
Error: Undefined Symbol: LockPubScreen
Error: Undefined Symbol: Wait
Error: Undefined Symbol: PPCCallOS
Error: Undefined Symbol: CloseDevice
Error: Undefined Symbol: AllocScreenBuffer
Error: Undefined Symbol: DeleteIORequest
Error: Undefined Symbol: NextDisplayInfo
Error: Undefined Symbol: AllocBitMap
Error: Undefined Symbol: OpenLibrary
Error: Undefined Symbol: GetVPModeID
Error: Undefined Symbol: SendIO
Error: Undefined Symbol: Delay
Error: Undefined Symbol: WindowLimits
Error: Undefined Symbol: FreeBitMap
Error: Undefined Symbol: ReadJoyPort
Error: Undefined Symbol: FreeVec
Error: Undefined Symbol: CloseScreen
Error: Undefined Symbol: FindDisplayInfo
Error: Undefined Symbol: WaitIO
Error: Undefined Symbol: LoadRGB32
Error: Undefined Symbol: InitRastPort
Error: Undefined Symbol: FreeMem
Error: Undefined Symbol: ReplyMsg
Error: Undefined Symbol: GetDisplayInfoData
Error: Undefined Symbol: ObtainBestPenA
Error: Undefined Symbol: RawKeyConvert
Error: Undefined Symbol: OpenDevice
Error: Undefined Symbol: CloseLibrary
Error: Error processing Elffile !

Last edited by grelbfarlk; 30 September 2017 at 14:53.
grelbfarlk is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sdl-1.2.15 Marlon_ Coders. C/C++ 40 13 March 2018 14:43
UAE for WarpOS 0.8.12 grelbfarlk request.Apps 0 23 November 2016 01:14
WarpOS Programming Help? esc support.Other 8 21 October 2015 10:37
WinUAE w/SDL mangamuscle request.UAE Wishlist 8 31 January 2007 11:41
What do you know about Amiga SDL? Tolismlf Amiga scene 6 15 November 2004 18:54

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:39.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.18366 seconds with 14 queries