From ecd978360d79ba71df598f372be65cc1c0e34d80 Mon Sep 17 00:00:00 2001 From: OBATA Akio Date: Wed, 5 Jan 2022 16:36:10 +0900 Subject: noatun-plugins: change to use SDL feature to handle data for SDL With own imcompleted endianness checkes, systems might be mis-detected as big endian. Change to use SDL macros to determine endianness. Change to use SDL function to byte swap Change to use SDL tyepdef for appropriate size integer type Signed-off-by: OBATA Akio --- noatun-plugins/synaescope/sdlwrap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'noatun-plugins/synaescope/sdlwrap.cpp') diff --git a/noatun-plugins/synaescope/sdlwrap.cpp b/noatun-plugins/synaescope/sdlwrap.cpp index f40d384..920e150 100644 --- a/noatun-plugins/synaescope/sdlwrap.cpp +++ b/noatun-plugins/synaescope/sdlwrap.cpp @@ -150,8 +150,8 @@ void SdlScreen::show() { SDL_LockSurface(surface); - unsigned long *ptr2 = (unsigned long*)core->output(); - unsigned long *ptr1 = (unsigned long*)( surface->pixels ); + Uint32 *ptr2 = (Uint32*)core->output(); + Uint32 *ptr1 = (Uint32*)( surface->pixels ); int i = core->outWidth*core->outHeight/4; do { @@ -161,7 +161,7 @@ void SdlScreen::show() unsigned int const r2 = *(ptr2++); //if (r1 || r2) { -#ifdef LITTLEENDIAN +#if SDL_BYTEORDER == SDL_LIT_ENDIAN unsigned int const v = ((r1 & 0x000000f0ul) >> 4) | ((r1 & 0x0000f000ul) >> 8) -- cgit v1.2.3