Update C-Dogs SDL 0.6.5


canseco

Very Active Member
Joined
Jun 1, 2004
Messages
885
Location
Spain
C-Dogs SDL 0.6.5

preview1.png


C-Dogs SDL is a port of a really fun old DOS game to modern operating systems, using the SDL2 media libraries for graphics, sound and input (hence the name).

Changelog


0.4.1.1
- Initial release
0.6.2.2
- Latest stable release.
- Changed default config for OpenPandora.
0.6.2.3
- Fix game not working with 4.10 SGX drivers, thanks to ptitSeb patch.
0.6.2.4
- Fix support for wide resolution, thanks to congusbongus.
0.6.4.0
- Latest stable release.
- Changed default control mapping. See below.
0.6.5.0
- Latest stable release.
- Updated libs and source code inside the PND.

Input control keys:

Dpad: movement
B button: Accept/fire
X button: Cancel/Run/Change weapon
Y button: Show map

Link to homepage:
https://cxong.github.io/cdogs-sdl/
Link to repo:
https://repo.openpandora.org/?page=detail&app=cdogs-sdl
 
Last edited:
Hi all !

@canseco : thanks for updating your C-Dogs SDL package, it's really appreciated :)

Unfortunately, it doesn't work on my Rebirth Unit, with latest SZ release installed and SGX driver 4.10:
=======================================================================================
PND : /media/Pandora/pandora/menu/cdogs-sdl.pnd
PND_FSTYPE : Squashfs
APPDATADIR : /media/Pandora/pandora/appdata/cdogs-sdl
APPDD_FSTYPE : ext3
PND_CPUSPEED : <unset>
EXENAME : start.sh
ARGUMENTS : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -t squashfs -o ro "/dev/loop0" "/mnt/utmp/cdogs-sdl"
Mounting the Union FS : mount -t aufs -o exec,dirs="/media/Pandora/pandora/appdata/cdogs-sdl=rw+nolwh":"/mnt/pnd/cdogs-sdl=rr" none "/mnt/utmp/cdogs-sdl"
[SUCCESS]--- Mount the PND ----------
[ START ]--- Starting the application ( start.sh ) ----------
no config found. creating default-config
INFO [MAIN ] [files.c:622] SetupConfigDir(): Creating config dir /mnt/utmp/cdogs-sdl/.config/cdogs-sdl/...
INFO [MAIN ] [files.c:627] SetupConfigDir(): Config dir already exists.
INFO [MAIN ] [cdogs.c:260] main(): Command line (1 args): ./cdogs-sdl
INFO [MAIN ] [cdogs.c:395] main(): data dir(/mnt/utmp/cdogs-sdl)
INFO [MAIN ] [cdogs.c:396] main(): config dir(/mnt/utmp/cdogs-sdl/.config/cdogs-sdl/)
INFO [INPUT] [joystick.c:60] JoyInit(): 2 controllers found
INFO [GFX ] [grafx.c:229] GraphicsInitialize(): graphics mode(320x240 2x)
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
ERROR [GFX ] [grafx.c:252] GraphicsInitialize(): cannot create window or renderer: Couldn't find matching render driver
WARN [MAIN ] [cdogs.c:431] main(): Cannot initialise video; trying default config
INFO [GFX ] [grafx.c:229] GraphicsInitialize(): graphics mode(320x240 2x)
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred
WSEGL_InitialiseDisplay: DRI2OpenConnection failed
ERROR [GFX ] [grafx.c:252] GraphicsInitialize(): cannot create window or renderer: Couldn't find matching render driver
ERROR [MAIN ] [cdogs.c:438] main(): Video didn't init!
C-Dogs SDL v0.6.2
Original Code Copyright Ronny Wester 1995
Game Data Copyright Ronny Wester 1995
SDL Port by Jeremy Chin, Lucas Martin-King and Cong Xu, Copyright 2003-2016

[22;32m[0m[01;34m[0m[22;33m[0m[22;36m[0m[22;32m[0m[22;32m[0m[01;34m[0m[22;33m[0m[22;36m[0m[22;32m[0mError loading autosave '/mnt/utmp/cdogs-sdl/.config/cdogs-sdl/autosave.json'
[22;32m[0m[01;34m[0m[22;33m[0m[22;36m[0m[22;32m[0mscancode = 0xa, i=2a key=0x67
[22;32m[0m[01;34m[0m[22;33m[0m[22;36m[0m[22;32m[0m[22;32m[0m[01;34m[0m[22;33m[0m[22;36m[0m[22;32m[0mUnable to open scores.dat
[22;32m[0m[01;34m[0m[22;33m[0m[22;36m[0m[22;32m[0m[22;32m[0m[01;34m[0m[22;33m[0m[22;36m[0m[22;32m[0mX11_GL_LoadLibrary(0xe5b90, (null))
LIBGL: Initialising glshim
libGL:loaded: libGLES_CM.so
libGL:loaded: libEGL.so
libGL: built on May 13 2016 04:46:35
LIBGL: Current folder is:/mnt/utmp/cdogs-sdl/bin
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
GLES2_CreateRenderer(...)
X11_GL_LoadLibrary(0xe5b90, (null))
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
X11_GL_LoadLibrary(0xe5b90, (null))
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
X11_GL_LoadLibrary(0xe5b90, (null))
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
GLES2_CreateRenderer(...)
X11_GL_LoadLibrary(0xe5b90, (null))
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
X11_GL_LoadLibrary(0xe5b90, (null))
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
[22;31m[0m[01;34m[0m[22;33m[0m[22;36m[0m[22;31m[0m[01;33m[0m[01;34m[0m[22;33m[0m[22;36m[0m[01;33m[0m[22;32m[0m[01;34m[0m[22;33m[0m[22;36m[0m[22;32m[0mX11_GL_LoadLibrary(0xe5b90, (null))
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
GLES2_CreateRenderer(...)
X11_GL_LoadLibrary(0xe5b90, (null))
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
X11_GL_LoadLibrary(0xe5b90, (null))
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
X11_GL_LoadLibrary(0xe5b90, (null))
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
GLES2_CreateRenderer(...)
X11_GL_LoadLibrary(0xe5b90, (null))
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
X11_GL_LoadLibrary(0xe5b90, (null))
Unable to initialize EGL display.
ERROR: EGL Error detected: EGL_NOT_INITIALIZED (0x3001)
[22;31m[0m[01;34m[0m[22;33m[0m[22;36m[0m[22;31m[0m[22;31m[0m[01;34m[0m[22;33m[0m[22;36m[0m[22;31m[0m[SUCCESS]--- Starting the application ( start.sh ) ----------
[ START ]--- Restoring the frame buffer status ----------
[SUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- Restoring nub mode ----------
[SUCCESS]--- Restoring nub mode ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[SUCCESS]--- Waiting the Union to be available ----------
rmdir: failed to remove `/mnt/utmp/cdogs-sdl': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[SUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[SUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 29

Cheers, Magic Sam
 
Hi all :)

@canseco : your package works with SGX driver 4.03.00.02, but fails to start with 4.10.

Is it to be expected ?

Cheers, Magic Sam
 
Just use
Code:
export LIBGL_FB=1
and ensure it select and stays Fullscreen, and that should be enough.
You can also probably use the GLES2 renderer of SDL2 with
Code:
export SDL_VIDEO_GLES2=1 
export SDL_VIDEO_GL_DRIVER=libGLESv2.so
(in that mode, the LIBGL_FB=1 is implicit).
 
I did a quick test with 4.03.02 and 4.10 and it works, will update ASAP. Thanks.
[doublepost=1470064390,1470063888][/doublepost]Changelog

0.6.2.3
- Fix game not working with 4.10 SGX drivers, thanks to ptitSeb patch.
 
Hi all :)

@canseco : I'm sorry to report your updated version is still not working correctly with SGX driver 4.10.

The game starts this time, but controls don't work as expected: pressing up/down in the menu brings XFCE icons to the foreground...

I hope my bug report makes some sense, because I have quite a headache right now :p

Cheers, Magic Sam
 
the "LIBGL_FB=1" make the game show as fullscreen, but it may work in a window, making mouse click interact with the desktop.. That why, when using FrameBuffer mode, you must force Fullscreen mode in the game.
 
The default config i did for the game, is already on fullscreen mode.

I did a quick test again, with XFCE, 4.10 drivers, deleted appdata folder and reboot, and it works fine.

Did you tried to reinstalled SGX drivers?
 
Hi all :)

@canseco : you were right, re-installing the drivers did the trick !

EDIT: @canseco : the game can be pretty slow (~10 FPS) when there are a lot of baddies on screen...

Cheers, Magic Sam
 
Last edited:
Hi, I'm the maintainer of C-Dogs SDL, thanks for the port and for playing!

@canseco you can pass the arguments "--screen=400x240 --scale=2" to take advantage of the full screen space. It may be good to disable menu options that don't make sense, like input remapping or changing the resolution. See for example what was done for the GCW-Zero port: https://github.com/cxong/cdogs-sdl/search?utf8=✓&q=__GCWZERO__

@Magic Sam try turning gore off in the options. Turning fog off can also help but probably not in the situation you describe. Particles are unoptimised so I can add an option to also turn off brass shells in a future version. Unfortunately getting the full 70fps will be hard; even with very little action the GCW-Zero only manages 30-40fps, so I guess Pandora will be similar.
 
Hi all :)

@congusbongus : welcome to our friendly community !

I turned off gore and fog effects, and it actually helped a little with the framerate (~20 FPS in the 2nd level of the first campaign "the sand"). The 3rd level was unfortunately too slow to be playable (~10 FPS).

Turning shadows off made things worse, so I left them on.

I'm looking forward to playing your next version without brass shells :)

EDIT: thanks for issue #448 on your github repository !

Cheers, Magic Sam
 
Last edited:
I did some extensive and i did enjoy it a lot, ;)

@canseco you can pass the arguments "--screen=400x240 --scale=2" to take advantage of the full screen space.

This is what happens when i try to use those arguments:

cdogs-scaling.png


I'm getting 38 to 49 FPS, with all effects at max, on 1GHZ OpenPandora. It could be lower on Classic and Rebirth versions.

you can also try with LIBGL_BATCH=1 and see if it improve things a bit.

I did try that variable, but it doesn't seem to make any difference, but i would include it anyway for older models.
 
@canseco by default the game will only allow valid resolutions detected by SDL_GetDisplayMode, but I heard it's not perfect plus it doesn't make much sense in SDL2 because it can do accelerated scaling, so I'll have a look and remove that check. In the mean time you can pass in "--forcemode" to bypass that check.
 
I'm not sure about SDL2, but I know Notaz's SDL can do hardware scaling if need be and it "should" be faster.
 
In the mean time you can pass in "--forcemode" to bypass that check.

That option seems to do the job, but FPS goes down to 29-39 and doesn't feel too smooth.

Limiting resolutions to 320x240 and 400x240 with scale 2 seems enough for this port, i just wish the accelerated scaling would work as good as Notaz's SDL1.

I would upload a new release ASAP.
[doublepost=1470401466,1470400005][/doublepost]Changelog

0.6.2.4
- Fix support for wide resolution, thanks to congusbongus.
 
SDL2 only use GL/GLES1/GLES2. SDL1 use FB. There is a huge difference, especialy for 2D bilitting game, where you need to update the surface many time. In SDL1, you just write in the FB. In SDL2, you update a texture and then you blit it. Updating a texture can be framerate killer on the Pandora.
 
Back
Top