Skip to content

Commit

Permalink
Merge pull request #12 from noahw2021/osx-fix-3
Browse files Browse the repository at this point in the history
Fix SDL bug on Windows
  • Loading branch information
noahwooten05 authored Nov 27, 2023
2 parents 7946d79 + 0fec3ff commit 3124cf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Binary file not shown.
8 changes: 6 additions & 2 deletions plasm2_emu/devices/video/video_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ void VideoiCopyRect(WORD16 x, WORD16 y, WORD16 w, WORD16 h, WORD64 ptr) {
if (!VAdr) {
cpui_csm_msg(CSM_PAGETOOSMALL, ptr);
}
SDL_Surface* Surface = SDL_CreateRGBSurfaceFrom((cpuctx->PhysicalMemory + VAdr), w, h, 32, 32, RMASK, GMASK, BMASK, AMASK);
SDL_Texture* TargetTexture = SDL_CreateTextureFromSurface(Renderer, Surface);
#ifdef _WIN32
SDL_Surface* Surface = SDL_CreateRGBSurfaceFrom((cpuctx->PhysicalMemory + VAdr), w, h, 32 * w, 32, RMASK, GMASK, BMASK, AMASK);
#else
SDL_Surface* Surface = SDL_CreateRGBSurfaceFrom((cpuctx->PhysicalMemory + VAdr), w, h, 32, 32, RMASK, GMASK, BMASK, AMASK);
#endif
SDL_Texture* TargetTexture = SDL_CreateTextureFromSurface(Renderer, Surface);
SDL_FreeSurface(Surface);
SDL_Rect DestRect = { x, y, w, h };
SDL_RenderCopy(Renderer, TargetTexture, NULL, &DestRect);
Expand Down

0 comments on commit 3124cf8

Please sign in to comment.