Skip to content

Commit

Permalink
Merge pull request #16 from azihassan/fix/ISSUE-14-palette-crash
Browse files Browse the repository at this point in the history
[ISSUE-14] Crash in palette_update code
  • Loading branch information
azihassan authored Oct 23, 2024
2 parents 25c05e8 + 8873aa8 commit 56aaa4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CMake/platforms/dreamcast.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ set(JOY_BUTTON_START 3)
#GPF SDL files
set(SDL_INCLUDE_DIR /usr/include/SDL/)
set(SDL_LIBRARY /usr/lib/libSDL.a)

add_compile_options(-flto=none)
9 changes: 3 additions & 6 deletions Source/utils/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ float GetDpiScalingFactor()
void SetVideoMode(int width, int height, int bpp, uint32_t flags)
{
Log("Setting video mode {}x{} bpp={} flags=0x{:08X}", width, height, bpp, flags);
#ifdef __DREAMCAST__
enable_dma_driver();
#endif
ghMainWnd = SDL_SetVideoMode(width, height, bpp, flags);
if (ghMainWnd == nullptr) {
ErrSdl();
Expand Down Expand Up @@ -323,6 +320,9 @@ bool SpawnWindow(const char *lpWindowName)
initFlags |= SDL_INIT_GAMECONTROLLER;

SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight");
#endif
#ifdef __DREAMCAST__
enable_dma_driver();
#endif
if (SDL_Init(initFlags) <= -1) {
ErrSdl();
Expand Down Expand Up @@ -478,9 +478,6 @@ void SetFullscreenMode()
if (*sgOptions.Graphics.fullscreen) {
flags |= SDL_FULLSCREEN;
}
#ifdef __DREAMCAST__
enable_dma_driver();
#endif
ghMainWnd = SDL_SetVideoMode(0, 0, 0, flags);
if (ghMainWnd == NULL) {
ErrSdl();
Expand Down

0 comments on commit 56aaa4e

Please sign in to comment.