Well, isn't it strange. Either ITimer opening fails or somebody writes NULL over it. SDL1 doesn't do much checking. I will try to add some debug and push the changes into some branch. (Also SDL1 doesn't call CloseDevice for its timer requests.)
I will also rename some functions because now there is almost symbol collision with os4timer_init and os4timer_Init...
@Capehill I can be wrong, but you already do so?:) I mean os4timer_Init are from adtools version, in your one it is already removed and called os4timer_init. Its just for me when i grab adtools version of sdl_os4timer.c (which have os4timer_Init), i gad to change it.
Btw, i thinking about different ogl renders, and imho inbuild everything in are good idea. And just add more flags to sdl_init. I.e SDL_OPENGL = minigl. SDL_GL4ES = gl4es, SDL_OGLES2 = ogles2. Imho easy enough. And refactoring probably can be something like: sdl_os4ogl_common.c - there all code which can be shared. Sdl_os4minigl_* - for all minigl files Sdl_os4gl4es_* and Sdl_ogles2_* - for gl4es and ogles.
And no need to worry about configuring, just all at once.
Naming things is the hardest part in programming. My advice is that try to be consistent with whatever style you choose. Luckily it should be simple to rename files in Git :)
Configure script would need checks / switches for gl4es and ogles2?
@Capehill Good news, itimer_fix branch just works!
I then retested to be sure: i downloaded again master branch, and rebuild it from scratch, and linked against that libsdl.a : crasehes. Then linked against itimer_fix's libsdl.a : no crash.
There is debug output if it will have any interst:
Quote:
[os4timer_GetTicks] ITimer NULL [os4timer_initialize] timer = 0x6FF51050 [os4timer_initialize] ITimer = 0x6FF9D400 [os4timer_Init] Initializing timer for thread 0x6D44D1D0 [os4timer_Init] Done [os4video_Available] Probing Picasso96API.library [os4video_Available] Success [os4video_CreateDevice] Creating OS4 video device [os4video_CreateDevice] Compositing should be possible, gfx version 54 [os4video_CreateDevice] Device created [SDL_SYS_JoystickInit] ENUM RETURNED: 0 [SDL_SYS_JoystickInit] Found 0 joysticks [os4video_SetVideoMode] Requesting new video mode 640x480x32 [os4video_SetVideoMode] Requested flags: ANYFORMAT OPENGL RESIZEABLE [os4video_SetVideoMode] Current mode 0x0x32 [os4video_SetVideoMode] Current mode flags [os4video_SetVideoMode] Current hwdata 0x00000000 [os4video_SetVideoMode] Creating new display [os4video_SetVideoMode] Deleting old display [os4video_SetVideoMode] Calling CreateDisplay [os4video_CreateDisplay] Creating a 640x480x32 display [os4video_CreateDisplay] Window mode [os4video_CreateDisplay] Screen depth:32 pixel format:6 [getBestWindowPosition] Visible screen: (0,0)/(1440x900) [openSDLwindow] Trying to open window at (395,194) of size (640x480) [os4video_SetVideoMode] New display created [os4video_SetVideoMode] Obtained flags: ANYFORMAT OPENGL RESIZEABLE [os4timer_Init] Initializing timer for thread 0x6AE4A1F0 [os4timer_Init] Done [os4timer_Destroy] Freeing timer for thread 0x6AE4A1F0 [os4video_VideoQuit] In VideoQuit, this = 0x6C4515E0 [os4video_VideoQuit] DeleteCurrentDisplay [os4video_DeleteCurrentDisplay] Closing window [os4video_VideoQuit] Checking pubscreen [os4video_FreeHWSurface] Freeing HW surface 0x674CCDF0 [os4timer_Destroy] Freeing timer for thread 0x6D44D1D0 [os4timer_quit] Called
Configure script would need checks / switches for gl4es and ogles2?
From SDL1 side, as far as i see it, only needs "includes". So, for GL4ES and for OGLES2 includes are different of couse. For GL4ES i at moment do not know how to reliazse SDK , as GL directory already holded by minigl, so probably it should be something like GL4ES. And for ogles2 its OGLES2.
We can add configure flags like :
--enable-minigl --enable-gl4es --enable-ogles2
So to build only files need, or all of them.
Through, as it in our hands to make releaes, then, why worry, we can just add no flags, and build everything by default :) But sure, more configure options better, just more time consuming :)
@Capehill Yeah, seems many games do so. I also see you merge branches 1.2.15 and itimer-fix : good ! But question is: is there any flag in SDL , to avoid build "debug prinfs" ? I mean, you probably remember that issues with slow Grafx2 startup because of too much debug prinfs. So to just be able to build SDL without debug prinfs at all.
I also seeing today sdl2 source code more close (those ones about opengl), we probably can follow exactly the same theme naming.
There is only a preprocessor flag which is a little bit unfortunate from usage point of view. SDL1 isn't currently stable / tested enough that I would disable those. Usually there isn't debug enabled in busy places though, they are more related to resource handling.
What about adding an ENV parameter for debug? I'm not too eager to build a separate debug libraries either.
@Capehil I just mean that we can have -DDEBUG options added when we internally want to build debug versions (only for us). And then, when no -DDEBUG option added, then no debug compiled in (and those will be released version).
9/0.NO NAME:> test Available fullscreen resolutions: 1920x1200 1600x1200 1440x900 1024x768 1280x720 800x600 640x480
Thanks a bunch :)
Will test it on games now.
Through, i noticed that you use BMA_BYTESPERROW and BMA_BASEADDRESS, which was added to graphics.library in 10.8.2017, so that one probably not released and in beta currently, which mean that you probably can't release 1.2.15 till some new update of os4 will happens :)
EDIT1: tested on game which use SDL_GetVideoInfo + SDL_ListModes() for fullscreen and for window modes : works in both modes !
@Capehill Maybe its me, but can latest changes (hwsurface, and co), being somehow related to issue i have now: when i build some game with gl4es added over adtools version of SDL1, all looks correct:
When i build that game with that gl4es added over list-fix version of SDL, i have that:
Code of game not changed of course, just in link string only swap for tests on -lSDL_adtools_gl4es on -lSDL_listfix_gl4es.
What is missed on second screenshot, its whole things which on runing "fade in", so probably some alpha used, or something.
Through, need to add, that MiniGL version works. What can mean that maybe i should add something new when add gl4es in compare with previous variant ?