Author Topic: OS/2 - ArcaOS - Native Games  (Read 17232 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 631
  • -Receive: 124
  • Posts: 3352
  • Karma: +29/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: OS/2 - ArcaOS - Native Games
« Reply #30 on: July 03, 2021, 07:10:07 pm »
Hi

Thanks Dave for giving it a try.  Here it is the TRP file I'm getting.

Are you using Netlabs RPM SDL to compile it (SDL_develop) or are you using the Digi's SDL to compile it?

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 229
  • Posts: 3216
  • Karma: +62/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #31 on: July 03, 2021, 07:40:17 pm »
Yes, it is the same trp. I used the Netlabs RPM to compile, I'll try Digi's later.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 229
  • Posts: 3216
  • Karma: +62/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #32 on: July 04, 2021, 06:16:26 am »
Digi's SDL trps the same.
What I think the bug is, is that it queries the list of possible full screen video modes, which here just returns one, 1680x1050 in my case, and then tries to go through the list of video modes to make sure they will work. At this point it crashes when trying to load the 2nd member of an array of one.
I'm not really a programmer and can't see the simple fix, I'll think on it some more.
The broken code is,
Code: [Select]
  else {
    IFDEBUG_VIDEO(sys_printf("xrick/video: SDL says, use these modes:\n"););
    for (i = 0; modes[i]; i++) {
      IFDEBUG_VIDEO(sys_printf("  %dx%d\n", modes[i]->w, modes[i]->h););
according to the trp report. the crash happens here (perhaps actually the 2 lines above?)
Code: [Select]
      if (modes[i]->w <= modes[mode]->w && modes[i]->w >= SYSVID_WIDTH &&
          modes[i]->h * SYSVID_WIDTH >= modes[i]->w * SYSVID_HEIGHT) {
        mode = i;
        fszoom = modes[mode]->w / SYSVID_WIDTH;
      }

Edit, pointed to crashing line.
« Last Edit: July 04, 2021, 06:21:28 am by Dave Yeo »

Jochen Schäfer

  • Full Member
  • ***
  • Thank You
  • -Given: 21
  • -Receive: 19
  • Posts: 171
  • Karma: +16/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #33 on: July 04, 2021, 10:52:34 am »
Hi.

While porting PrBoom+, I fixed some initialization bugs. The fixes are pushed into the BWW repo.
Perhaps, if you compile the repo version, it fixes things.


Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 631
  • -Receive: 124
  • Posts: 3352
  • Karma: +29/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: OS/2 - ArcaOS - Native Games
« Reply #34 on: July 28, 2021, 03:43:32 am »
Hi
- Kuklomenos   0.4.5   VORBISFI.DLL / SDL GNU GPL    *** Missing lib   

Does anybody knows where can I get "VORBISFI.DLL" ? It seems that the latest libvorbis on the Netlabs RPM does not has that file.

Update: I found it on libvorbis-1.2.0.zip. But I'm getting this trap on running it.

Regards
« Last Edit: July 28, 2021, 04:15:23 am by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Mentore

  • Jr. Member
  • **
  • Thank You
  • -Given: 27
  • -Receive: 5
  • Posts: 84
  • Karma: +3/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #35 on: July 28, 2021, 09:05:13 am »
Digi's SDL trps the same.
What I think the bug is, is that it queries the list of possible full screen video modes, which here just returns one, 1680x1050 in my case, and then tries to go through the list of video modes to make sure they will work. At this point it crashes when trying to load the 2nd member of an array of one.
I'm not really a programmer and can't see the simple fix, I'll think on it some more.
The broken code is,
Code: [Select]
  else {
    IFDEBUG_VIDEO(sys_printf("xrick/video: SDL says, use these modes:\n"););
    for (i = 0; modes[i]; i++) {
      IFDEBUG_VIDEO(sys_printf("  %dx%d\n", modes[i]->w, modes[i]->h););

I actually don't like the for cycle written above: (reported below)

Code: [Select]
    for (i = 0; modes[i]; i++) {

It implies that the cycle should stop after cycling through all the items in the "modes" array but I feel this should be written better asking for the actual length of the array. Don't know if this is C-99 or some more modern incarnation (this code uses lambda expressions so I assume is pretty modern, and I'm no expert in this) but this writing leaves me perplexed.

Mentore

Jochen Schäfer

  • Full Member
  • ***
  • Thank You
  • -Given: 21
  • -Receive: 19
  • Posts: 171
  • Karma: +16/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #36 on: July 28, 2021, 11:50:09 am »
Problem is, that you don't know the size of array in C/C++. That is why APIs almost always give you an list size or a 0 terminated list.
The latter is what this "for" is assuming. But we have a field "num_display_modes" in the display structure, that could be used.
But in BWWs version, I fixed an init error in the display structures, which should be applied to Digis version, if not already done.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 229
  • Posts: 3216
  • Karma: +62/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #37 on: July 28, 2021, 05:39:01 pm »
But in BWWs version, I fixed an init error in the display structures, which should be applied to Digis version, if not already done.

I didn't find your fix.

Lars

  • Hero Member
  • *****
  • Thank You
  • -Given: 2
  • -Receive: 80
  • Posts: 852
  • Karma: +27/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #38 on: July 28, 2021, 06:11:09 pm »
But in BWWs version, I fixed an init error in the display structures, which should be applied to Digis version, if not already done.

I didn't find your fix.

https://github.com/bitwiseworks/SDL2-os2/commit/f5057a506716d15c405a545403b316e807d7069e

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 631
  • -Receive: 124
  • Posts: 3352
  • Karma: +29/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: OS/2 - ArcaOS - Native Games
« Reply #39 on: July 28, 2021, 10:55:08 pm »
Hi

I have a noob question about SDL development. For games that had been developed with SDL 1x, is it possible to recompile those with SDL 2.x? or all the game code (like functions calls, etc) will need to be changed to use the SDL 2.x instead?

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 229
  • Posts: 3216
  • Karma: +62/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #40 on: July 29, 2021, 01:50:31 am »
But in BWWs version, I fixed an init error in the display structures, which should be applied to Digis version, if not already done.

I didn't find your fix.

https://github.com/bitwiseworks/SDL2-os2/commit/f5057a506716d15c405a545403b316e807d7069e

Thanks, guess I'll try to build it.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 229
  • Posts: 3216
  • Karma: +62/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #41 on: July 29, 2021, 01:56:57 am »
Hi

I have a noob question about SDL development. For games that had been developed with SDL 1x, is it possible to recompile those with SDL 2.x? or all the game code (like functions calls, etc) will need to be changed to use the SDL 2.x instead?

Quickly looking, it seems the video handling has changed, things like no more full screen, rather a large window, perhaps with no menu etc. And the keyboard input also has changed, might mostly affect Unicode, along with changes in the event queue. Seems a lot of games are focused on the hardware rendering.
This is the page I read, https://www.doomworld.com/forum/topic/86368-sdl-1x-vs-sdl-2/

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 229
  • Posts: 3216
  • Karma: +62/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #42 on: July 29, 2021, 02:01:25 am »
Has anyone looked at how hard it would be to add USB Joystick support to SDL? I know next to nothing about it except a little experience with old style joysticks.
Seems basic support would be 2 axis and 2 button support, for many games even joypad support where a couple of buttons and the axis is basically binary or trinary, would be nice.
I ask because I recently revisited Rocks'N'Diamonds (our SDL mixer needs mod support), which reminded me how much more fun it was to play with a joypad rather then the keyboard.

Paul Smedley

  • Hero Member
  • *****
  • Thank You
  • -Given: 63
  • -Receive: 129
  • Posts: 894
  • Karma: +81/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #43 on: July 29, 2021, 04:59:46 am »
Hi Dave,
Has anyone looked at how hard it would be to add USB Joystick support to SDL? I know next to nothing about it except a little experience with old style joysticks.
Seems basic support would be 2 axis and 2 button support, for many games even joypad support where a couple of buttons and the axis is basically binary or trinary, would be nice.
I ask because I recently revisited Rocks'N'Diamonds (our SDL mixer needs mod support), which reminded me how much more fun it was to play with a joypad rather then the keyboard.

I haven't looked into it at all, but I'd assume any support would use libusb (which we have) so surely it wouldn't be that difficult.

Cheers,

Paul.

Jochen Schäfer

  • Full Member
  • ***
  • Thank You
  • -Given: 21
  • -Receive: 19
  • Posts: 171
  • Karma: +16/-0
    • View Profile
Re: OS/2 - ArcaOS - Native Games
« Reply #44 on: July 29, 2021, 08:48:43 am »
Has anyone looked at how hard it would be to add USB Joystick support to SDL? I know next to nothing about it except a little experience with old style joysticks.
Seems basic support would be 2 axis and 2 button support, for many games even joypad support where a couple of buttons and the axis is basically binary or trinary, would be nice.
I ask because I recently revisited Rocks'N'Diamonds (our SDL mixer needs mod support), which reminded me how much more fun it was to play with a joypad rather then the keyboard.
I have thought about it, and it is on my bucket list. The linux drivers use the hidapi library (it is even part of SDL2). I was thinking about using that code for OS/2.