I don't recall it saying a line number before. It's just a complete system freeze now when I go to "Redefine Keys". No shell output. That's the last testing I can do for a week. The game doesn't take long to port though if you want to grab the git repo and have a look.
Edit: Very quickly rebuilt with SDL_SCANCODE_ESCAPE and now the escape key works. Got the bad_alloc message back now:
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
I could edit the source and see exactly where it breaks or freezes, but I don't have the time now, and for a little while.
By the way, are you sure that SDLK_ESCAPE needed to be changed and not an indication of a larger problem? If I recall correctly, checkkeys didn't report the Key Pressed/Released (or maybe it was the "Text:" line it didn't show) when pressing Escape, unlike any other character.
Edit 2: It's the "Text:" line that doesn't show, but it looks like that's probably normal (Cursor Keys & Enter don't show it either). Gotta go now!
Edited by MickJT on 2016/7/16 18:23:37 Edited by MickJT on 2016/7/16 18:25:27 Edited by MickJT on 2016/7/16 18:32:44
r135 is supposed to merge 2.0.4 modifications into our branch. Patch was 7 megabytes (pain) so I expect there to be new issues.
One obvious problem is that .so is not generated at the moment. As a workaround, remove -no-undefined from generated makefile (libtool's flag). Hopefully we could get rid of pthreads dependency with SDL2.
Testautomation seems to give some failures and there are probably some unimplemented backend functions but they will be added later.
Here you are, found another game that has the "shift to the right" issue
Mystery House SDL1 Correct Alignment
Mystery House SDL2 Shifted Alignment (PuTTy log)
[OS4_WarpMouse] Warping mouse to 542, 118
[OS4_WarpMouse] Building event structure
[OS4_WarpMouse] Fire!
[OS4_WarpMouse] Done
[OS4_DestroyRenderer] Freeing renderer bitmap 0x450A29A8
[OS4_SetDisplayMode] Desktop mode passed
[OS4_SetWindowFullscreen] Trying to set 'Hi-Res Adventure #1: Mystery House (Apple II/English)' into window mode
[OS4_SetWindowFullscreen] Window 'Hi-Res Adventure #1: Mystery House (Apple II/English)' is being destroyed, mode change ignored
[OS4_WarpMouse] Warping mouse to 542, 116
[OS4_WarpMouse] Building event structure
[OS4_WarpMouse] Fire!
[OS4_WarpMouse] Done
[OS4_HideWindow] Called
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_SetWindowGrabInternal] Window 0x4B01CBC0 ('Hi-Res Adventure #1: Mystery House (Apple II/English)') input was released
[OS4_ShowCursor] Hiding cursor
[OS4_SetPointerForEachWindow] Setting pointer object/type 0x4B01F2A4/16 for window 0x4B01CBC0
[OS4_DestroyWindow] Called for 'Hi-Res Adventure #1: Mystery House (Apple II/English)' (flags 0xB)
[OS4_CloseWindowInternal] Closing window 'Hi-Res Adventure #1: Mystery House (Apple II/English)'
[OS4_CloseScreenInternal] Close screen 0x4B01A590
[OS4_GL_FreeBuffers] Called
[OS4_GL_UnloadLibrary] Called
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_GL_LoadLibrary] Called 0
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_CreateWindow] Open fullscreen window with delay
[OS4_ShowWindow] Called
[OS4_RaiseWindow] Called
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_SetDisplayMode] Opening screen id 1342182144: 640*480*24
[OS4_SetWindowFullscreen] Trying to set 'Hi-Res Adventure #1: Mystery House (Apple II/English)' into fullscreen mode
[OS4_SetWindowFullscreen] System window doesn't exist yet, let's open it
[OS4_GetIDCMPFlags] Called
[OS4_GetWindowFlags] Called
[OS4_GetScreenForWindow] Fullscreen
[OS4_CreateWindowInternal] Trying to open window 'Hi-Res Adventure #1: Mystery House (Apple II/English)' at (1000,528) of size (560x384)
[OS4_CreateRenderer] Creating renderer for 'Hi-Res Adventure #1: Mystery House (Apple II/English)' (flags 0x0)
[OS4_CreateRenderer] VSYNC: off
[OS4_ActivateRenderer] Allocating VRAM bitmap 640*480*32 for renderer
[OS4_UpdateClipRect] Cliprect: (0,0) - 640*480
[OS4_GetOutputSize] w=640, h=480
[OS4_SetWindowGrabInternal] Window 0x4B01CBC0 ('(null)') input was released
[OS4_WindowEvent] Called with event 12
The Kite SDL1 Correct Alignment
The Kite SDL2 Shifted Alignment (PuTTy log)
[OS4_DestroyRenderer] Freeing renderer bitmap 0x2D200478
[OS4_SetDisplayMode] Desktop mode passed
[OS4_SetWindowFullscreen] Trying to set 'The Kite (Version 1.3.e/Windows/English)' into window mode
[OS4_SetWindowFullscreen] Window 'The Kite (Version 1.3.e/Windows/English)' is being destroyed, mode change ignored
[OS4_WarpMouse] Warping mouse to 264, 255
[OS4_WarpMouse] Building event structure
[OS4_WarpMouse] Fire!
[OS4_WarpMouse] Done
[OS4_HideWindow] Called
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_SetWindowGrabInternal] Window 0x4F60F108 ('The Kite (Version 1.3.e/Windows/English)') input was released
[OS4_ShowCursor] Hiding cursor
[OS4_SetPointerForEachWindow] Setting pointer object/type 0x46721C74/16 for window 0x4F60F108
[OS4_DestroyWindow] Called for 'The Kite (Version 1.3.e/Windows/English)' (flags 0xB)
[OS4_CloseWindowInternal] Closing window 'The Kite (Version 1.3.e/Windows/English)'
[OS4_CloseScreenInternal] Close screen 0x4671F758
[OS4_GL_FreeBuffers] Called
[OS4_GL_UnloadLibrary] Called
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_GL_LoadLibrary] Called 0
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_CreateWindow] Open fullscreen window with delay
[OS4_ShowWindow] Called
[OS4_RaiseWindow] Called
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_SetDisplayMode] Opening screen id 1342313216: 800*600*24
[OS4_SetWindowFullscreen] Trying to set 'The Kite (Version 1.3.e/Windows/English)' into fullscreen mode
[OS4_SetWindowFullscreen] System window doesn't exist yet, let's open it
[OS4_GetIDCMPFlags] Called
[OS4_GetWindowFlags] Called
[OS4_GetScreenForWindow] Fullscreen
[OS4_CreateWindowInternal] Trying to open window 'The Kite (Version 1.3.e/Windows/English)' at (880,420) of size (800x600)
[OS4_CreateRenderer] Creating renderer for 'The Kite (Version 1.3.e/Windows/English)' (flags 0x0)
[OS4_CreateRenderer] VSYNC: off
[OS4_ActivateRenderer] Allocating VRAM bitmap 800*600*32 for renderer
[OS4_UpdateClipRect] Cliprect: (0,0) - 800*600
[OS4_GetOutputSize] w=832, h=600
[OS4_UpdateViewport] Cliprect: (0,0) - 832*600
[OS4_DestroyRenderer] Freeing renderer bitmap 0x46743EB8
[OS4_SetDisplayMode] Desktop mode passed
[OS4_SetWindowFullscreen] Trying to set 'The Kite (Version 1.3.e/Windows/English)' into window mode
[OS4_SetWindowFullscreen] Window 'The Kite (Version 1.3.e/Windows/English)' is being destroyed, mode change ignored
[OS4_HideWindow] Called
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_DestroyWindow] Called for 'The Kite (Version 1.3.e/Windows/English)' (flags 0xB)
[OS4_CloseWindowInternal] Closing window '(null)'
[OS4_CloseScreenInternal] Close screen 0x4671F758
[OS4_GL_FreeBuffers] Called
[OS4_GL_UnloadLibrary] Called
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_GL_LoadLibrary] Called 0
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_CreateWindow] Open fullscreen window with delay
[OS4_ShowWindow] Called
[OS4_RaiseWindow] Called
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_GetDisplayBounds] x=0, y=0, w=2560, h=1440
[OS4_SetDisplayMode] Opening screen id 1342444288: 1280*720*24
Gronk...
[OS4_SetWindowFullscreen] Trying to set 'The Kite (Version 1.3.e/Windows/English)' into fullscreen mode
[OS4_SetWindowFullscreen] System window doesn't exist yet, let's open it
[OS4_GetIDCMPFlags] Called
[OS4_GetWindowFlags] Called
[OS4_GetScreenForWindow] Fullscreen
[OS4_CreateWindowInternal] Trying to open window 'The Kite (Version 1.3.e/Windows/English)' at (727,370) of size (1105x700)
[OS4_CreateRenderer] Creating renderer for 'The Kite (Version 1.3.e/Windows/English)' (flags 0x0)
[OS4_CreateRenderer] VSYNC: off
[OS4_ActivateRenderer] Allocating VRAM bitmap 1280*720*32 for renderer
[OS4_UpdateClipRect] Cliprect: (0,0) - 1280*720
[OS4_GetOutputSize] w=1280, h=720
[OS4_SetWindowGrabInternal] Window 0x4F60F8E8 ('(null)') input was released
[OS4_WindowEvent] Called with event 12
Finally checked those logs. It looks like SDL2 opens a new screen but when window is created, it uses some strange x/y coordinates for position (would have expected 0,0). I have to do some fullscreen tests.
When programmer passes SDL_WINDOWPOS_CENTERED parameter, SDL2 most likely uses the information of the first stored display, which on our system is probably your Workbench screen. Then it calculates new window coordinates based on the dimensions of your WB screen, which might not match the application's expectations...that explains funny readings in the serial log.
For now, it looks as if the most simplest solution would be to ignore SDL2's window centering code and center the window on AmigaOS backend side. This solution needs a bit more testing before commit.
As a workaround, you can try to pass X=0, Y=0 for your window.
The in source change to 0, 0 made the game screen start at, of course, 0, 0
But there are still important portions cut off as you can see in the picture
I haven't tried building SDL2 myself as i wouldn't know how to properly create libraries, i leave that to the pros to not stir up any more dust when reporting errors i made myself on the way of building sdl2
Looking at the earlier serial log, we can observe that window width was less than 640. I am not sure why is that, did game want it or did SDL2 screw it somehow?
Please, if you have time, try compiling r139. I know that Davide can build SDL2 without issues, for example. It should work, unless your SDK is somehow broken. (ok, .so build is currently broken, it's a known issue)
I hope we could have another SDL2 release this year, but there are still some open issues.