Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

SDL 2.0 port

Last updated on 11 months ago
amigamiaamigamiaAdmin
Posted 11 months ago
Here is the old thread where I did some testing with SDL 2.0

https://arosworld.org/infusions/forum/viewthread.php?thread_id=1087&highlight=SDL+2&rowstart=0

Here is the response I received from the developer of AOS 4 SDL version:

Quote

Hi .....
First of all, that's the old repo. The new repo for AmigaOS 4.x is this one: https://github.co...ts/SDL-2.0
Sendond, I think it would be easier to port the MorphOS version, since MorphOS API more closely resembles AmigaOS 3.x and AROS API: https://github.co...ld2018/SDL

I thought SDL 2 was already ported to AROS (abiv1)?
Edited by amigamia on 10-01-2024 18:17, 11 months ago
M
magoriumSoftware Dev
Posted 11 months ago

For os4 support ? see here.
serk118ukserk118ukSoftware Dev
Posted 11 months ago

amigamia wrote:

@amigamia - Hi all, at first I was looking at the AOS4 source code but after a chat with one of the developers the suggestion came to switch to MOS code because it had many AROS similarities. However, I have not made any changes. Basically it's like I never started on modifying the MOS code.

It is best if we start from scratch and place the code on a git... server somewhere.


A github repo?
amigamiaamigamiaAdmin
Posted 11 months ago
Hi all, at first I was looking at the AOS4 source code but after a chat with one of the developers the suggestion came to switch to MOS code because it had many AROS similarities. However, I have not made any changes. Basically it's like I never started on modifying the MOS code.

It is best if we start from scratch and place the code on a git... server somewhere.
D
deadwoodAROS Dev
Posted 11 months ago
Thanks for reminding about lowlevel.library. It is indeed limited in a sense that it supports what Amiga had: mouse, digital joystick and CD-32 game pad. There seems to be some extensions for analog joystics done by Poseidon.

As to question about Get_ functions. You can probably just say 1 button, 2 axes, 0 hats and you will have Amiga-like joystick configuration and then you could use lowlevel.library. That's probably a good start.
serk118ukserk118ukSoftware Dev
Posted 11 months ago

serk118uk wrote:

@serk118uk -

Gundam wrote:

@Gundam -

deadwood wrote:

@deadwood
...
... I don't know much about how joysticks are handled
...
.



You have to use "lowlevel.library" to handle joysticks.

https://en.wikibooks.org/wiki/Aros/Developer/Docs/Libraries/LowLevel


Just checked Lowlevel.library sourcecode and
Lowlevel.library is patched to use poseidon but Lowlevel.library limited and not really a option.


My understanding not either so great about joypads, below functions from connected joypads or joysticks needed for sdl to function rightly.


(Temp function names but close enough lol)
Get_Joy_name()
Get_Joypad_Buttons()
Get_Joypad_Axis()
Get_Joypad_Hats()

How would i get above functions , for example number of buttons using Lowlevel.library ?
serk118ukserk118ukSoftware Dev
Posted 11 months ago

Gundam wrote:

@Gundam -

deadwood wrote:

@deadwood
...
... I don't know much about how joysticks are handled
...
.



You have to use "lowlevel.library" to handle joysticks.

https://en.wikibooks.org/wiki/Aros/Developer/Docs/Libraries/LowLevel


Just checked Lowlevel.library sourcecode and
Lowlevel.library is patched to use poseidon but Lowlevel.library limited and not really a option.


My understanding not either so great about joypads looking at Sdl 2.0, the below functions from connected joypad or joystick.

Get_Joy_name()
Get_Joypad_Buttons()
Get_Joypad_Axis()
Get_Joypad_Hats()

How would i get above functions , for example number of buttons using Lowlevel.library ?
G
GundamJunior Member
Posted 11 months ago

deadwood wrote:

@deadwood
...
... I don't know much about how joysticks are handled
...
.



You have to use "lowlevel.library" to handle joysticks.

https://en.wikibooks.org/wiki/Aros/Developer/Docs/Libraries/LowLevel
D
deadwoodAROS Dev
Posted 11 months ago
Ok, I had a quick look.

First of all the question is which version @amigamia is porting? Looking at the repository, AmigaOS4 version is not changed since 7 years, while MorphOS version seems to be kept up-to-date.

Additionally, the API of amigaimput is used via interfaces, so the codes would have to change even if we developed amigainput clone.

I looked at MorphOS version and sensors.library API seems to be quite straighforward. You can find it in MorphOS SDK.

All in all and taking into account that I don't know much about how joysticks are handled, I'd agree with your assesment of implementing sensors.library as a wrapper over APIs exposed by Poseidon.
serk118ukserk118ukSoftware Dev
Posted 11 months ago

deadwood wrote:

@deadwood - Can you point me to those sources (both for OS4 and MOS) where SDL2 is making calls into those modules (amigainput and sensor)?



Mos
https://github.co...joystick.c

Os 4
https://github.co...joystick.c
D
deadwoodAROS Dev
Posted 11 months ago
Can you point me to those sources (both for OS4 and MOS) where SDL2 is making calls into those modules (amigainput and sensor)?
serk118ukserk118ukSoftware Dev
Posted 11 months ago

deadwood wrote:

@deadwood - I assume you mean that SDL2 sources for OS4 use internally amigainput.library and SDL2 sources for MOS use sensor.hid internally? Is that correct understanding?


Yes correct deadwood...
D
deadwoodAROS Dev
Posted 11 months ago
I assume you mean that SDL2 sources for OS4 use internally amigainput.library and SDL2 sources for MOS use sensor.hid internally? Is that correct understanding?
serk118ukserk118ukSoftware Dev
Posted 11 months ago
I agree with deadwood,

I had a sneaky peek for my project need, one area might be bit problematic, mos uses sensor hid and os4 uses amigainput.library for joystick and joypad, we don't have any of them, I recompiled xinput class and library but that limits to only xinput controllers , I am not sure what's the best way to go by this.

I see few options..
1.use old sdl 1.2 joystick implemention or
2.use a usb gamepad hid.class (I think that's what morphos done , than again just guessing)

How would we implement? Option 2 maybe , we can configure the buttons and gamepad.hid sees every usb joypad I connect so far.

Do we compile a library arround hid.class and make the calls via hid.class or compile a cut down version of hid.class only for usb joypads/joysticks.

I mean separate joypad implementation from hid.class and call it sensors.hid like morphos or something else..

Any ideas ladies and gent..
Edited by serk118uk on 09-01-2024 09:24, 11 months ago
D
deadwoodAROS Dev
Posted 11 months ago
If you have specific questions and your modified source code is available somewhere to view I can try helping with compilation errors.
amigamiaamigamiaAdmin
Posted 11 months ago
I was but stopped for a while. I just recently picked it up again and tried to compile with no changes applied but still no luck. I am going to post some progress soon and perhaps with the help of the community we achieve this.
serk118ukserk118ukSoftware Dev
Posted 11 months ago
Hi ppl , I can not remember who but someone was working on porting SDL 2.0, what's the current state?
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You cannot download attachments in this forum.
Users who participated in discussion: amigamia, serk118uk, magorium, deadwood, Gundam
Sign In
Not a member yet? Click here to register.
Forgot Password?
Users Online Now
Guests Online 10
Members Online 0

Total Members: 268
Newest Member: ajfa
Member Polls
Should AROSWorld continue with AROS-Exec files (SMF based)?
Yes44 %
44% [12 Votes]
No26 %
26% [7 Votes]
Not sure30 %
30% [8 Votes]