diff options
author | gameblabla | 2019-10-11 13:38:25 +0200 |
---|---|---|
committer | gameblabla | 2019-10-11 13:38:25 +0200 |
commit | b029a0b25f2f0cf9775f6f720756760e1f6c6438 (patch) | |
tree | f121917aa23c48789356068faac1721278b050b8 | |
parent | cc878848a45db22abe284649c7e19f896a0abeb9 (diff) | |
download | snesemu-b029a0b25f2f0cf9775f6f720756760e1f6c6438.tar.gz snesemu-b029a0b25f2f0cf9775f6f720756760e1f6c6438.tar.bz2 snesemu-b029a0b25f2f0cf9775f6f720756760e1f6c6438.zip |
Fix text issues in Menu for Retrostone port and input code.
-rw-r--r-- | Makefile.retrostone | 6 | ||||
-rwxr-xr-x | package_OPK | 31 | ||||
-rw-r--r-- | shell/input/sdl/input.c | 6 | ||||
-rw-r--r-- | shell/menu/font_drawing.c | 8 | ||||
-rw-r--r-- | shell/video/retrostone/video_blit.c | 4 | ||||
-rw-r--r-- | shell/video/retrostone/video_blit.h | 10 | ||||
-rw-r--r-- | shell/video/sdl/video_blit.c | 2 | ||||
-rw-r--r-- | shell/video/sdl/video_blit.h | 3 |
8 files changed, 52 insertions, 18 deletions
diff --git a/Makefile.retrostone b/Makefile.retrostone index f0d41b8..0857a1e 100644 --- a/Makefile.retrostone +++ b/Makefile.retrostone @@ -1,9 +1,9 @@ -PRGNAME = PocketSNES +PRGNAME = snes9x -VIDEO_BACKEND = sdl +VIDEO_BACKEND = retrostone INPUT_BACKEND = sdl SOUND_BACKEND = alsa -PROFILE = 0 +PROFILE = APPLY # define regarding OS, which compiler to use CC = /opt/retrostone-toolchain/bin/arm-buildroot-linux-musleabihf-gcc diff --git a/package_OPK b/package_OPK new file mode 100755 index 0000000..bcdba1f --- /dev/null +++ b/package_OPK @@ -0,0 +1,31 @@ +#!/bin/sh + +mkdir -p opk +cp ./snes9x opk/snes9x +cp ./snes9x.png opk/snes9x.png + +# https://unix.stackexchange.com/questions/219268/how-to-add-new-lines-when-using-echo +print() + case ${IFS- } in + (\ *) printf %b\\n "$*";; + (*) IFS=\ $IFS + printf %b\\n "$*" + IFS=${IFS#?} +esac + +# Create GmenuNx entry file plus other things + +print '[Desktop Entry] +Type=Application +Name=Snes9x2005 +Comment=Super NES emulator +Exec=snes9x %f +Icon=snes9x +Terminal=false +Type=Application +Categories=emulators; +X-OD-NeedsDownscaling=false' > opk/default."$1".desktop + +mksquashfs ./opk snes9x_"$1".opk -all-root -noappend -no-exports -no-xattrs + +rm -r opk diff --git a/shell/input/sdl/input.c b/shell/input/sdl/input.c index b2b78e7..d47b889 100644 --- a/shell/input/sdl/input.c +++ b/shell/input/sdl/input.c @@ -64,9 +64,9 @@ uint32_t S9xReadJoypad(int32_t port) CASE(option.config_buttons[0][8], SNES_TL_MASK); CASE(option.config_buttons[0][9], SNES_TR_MASK); CASE(option.config_buttons[0][0], SNES_UP_MASK); - CASE(option.config_buttons[0][1], SNES_DOWN_MASK); - CASE(option.config_buttons[0][2], SNES_LEFT_MASK); - CASE(option.config_buttons[0][3], SNES_RIGHT_MASK); + CASE(option.config_buttons[0][1], SNES_RIGHT_MASK); + CASE(option.config_buttons[0][2], SNES_DOWN_MASK); + CASE(option.config_buttons[0][3], SNES_LEFT_MASK); if (keystate[SDLK_END]) emulator_state = 1; diff --git a/shell/menu/font_drawing.c b/shell/menu/font_drawing.c index c1c97b9..9b964ef 100644 --- a/shell/menu/font_drawing.c +++ b/shell/menu/font_drawing.c @@ -11,9 +11,9 @@ extern int32_t screen_width; static inline void setPixel(uint16_t* restrict buffer, uint32_t x, uint32_t y, uint16_t c) { - if (x < HOST_WIDTH_RESOLUTION && y < HOST_HEIGHT_RESOLUTION) + if (x < BACKBUFFER_WIDTH_RESOLUTION && y < BACKBUFFER_HEIGHT_RESOLUTION) { - *((uint16_t* restrict)buffer + ((x) + (y) * HOST_WIDTH_RESOLUTION)) = c; + *((uint16_t* restrict)buffer + ((x) + (y) * BACKBUFFER_WIDTH_RESOLUTION)) = c; } } @@ -91,7 +91,7 @@ static void drawChar(uint16_t* restrict buffer, uint32_t *x, uint32_t *y, uint32 *x = margin; *y += 8; } - else if(*y < (HOST_HEIGHT_RESOLUTION-1)) + else if(*y < (BACKBUFFER_HEIGHT_RESOLUTION-1)) { charSprite = ch * 8 + n2DLib_font; // Draw charSprite as monochrome 8*8 image using given color @@ -118,7 +118,7 @@ static void drawString(uint16_t* restrict buffer, uint32_t *x, uint32_t *y, uint uint32_t i; size_t size_font; - size_font = strnlen(str, (HOST_WIDTH_RESOLUTION/8)) + 1; + size_font = strnlen(str, (BACKBUFFER_WIDTH_RESOLUTION/8)) + 1; for(i = 0; i < size_font; i++) drawChar(buffer, x, y, _x, str[i], fc, olc); } diff --git a/shell/video/retrostone/video_blit.c b/shell/video/retrostone/video_blit.c index 26bc298..7dcdce1 100644 --- a/shell/video/retrostone/video_blit.c +++ b/shell/video/retrostone/video_blit.c @@ -54,9 +54,9 @@ void Init_Video() SDL_ShowCursor(0); - sdl_screen = SDL_SetVideoMode(680, 448, 16, SDL_HWSURFACE); + sdl_screen = SDL_SetVideoMode(0, 0, 16, SDL_HWSURFACE); - backbuffer = SDL_CreateRGBSurface(SDL_SWSURFACE, HOST_WIDTH_RESOLUTION, HOST_HEIGHT_RESOLUTION, 16, 0,0,0,0); + backbuffer = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 240, 16, 0,0,0,0); Set_Video_InGame(); } diff --git a/shell/video/retrostone/video_blit.h b/shell/video/retrostone/video_blit.h index 8e1c81c..09aab60 100644 --- a/shell/video/retrostone/video_blit.h +++ b/shell/video/retrostone/video_blit.h @@ -3,13 +3,13 @@ #include <SDL/SDL.h> -#define HOST_WIDTH_RESOLUTION (sdl_screen->w) -#define HOST_HEIGHT_RESOLUTION (sdl_screen->h) +#define HOST_WIDTH_RESOLUTION sdl_screen->w +#define HOST_HEIGHT_RESOLUTION sdl_screen->h -#define INTERNAL_WSWAN_WIDTH 224 -#define INTERNAL_WSWAN_HEIGHT 144 +#define BACKBUFFER_WIDTH_RESOLUTION backbuffer->w +#define BACKBUFFER_HEIGHT_RESOLUTION backbuffer->h -extern SDL_Surface *screen, *wswan_vs, *backbuffer; +extern SDL_Surface *sdl_screen, *backbuffer; extern uint32_t width_of_surface; extern uint32_t* Draw_to_Virtual_Screen; diff --git a/shell/video/sdl/video_blit.c b/shell/video/sdl/video_blit.c index 9778039..fef7033 100644 --- a/shell/video/sdl/video_blit.c +++ b/shell/video/sdl/video_blit.c @@ -56,7 +56,7 @@ void Init_Video() sdl_screen = SDL_SetVideoMode(HOST_WIDTH_RESOLUTION, HOST_HEIGHT_RESOLUTION, 16, SDL_HWSURFACE); - backbuffer = SDL_CreateRGBSurface(SDL_SWSURFACE, HOST_WIDTH_RESOLUTION, HOST_HEIGHT_RESOLUTION, 16, 0,0,0,0); + backbuffer = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 240, 16, 0,0,0,0); Set_Video_InGame(); } diff --git a/shell/video/sdl/video_blit.h b/shell/video/sdl/video_blit.h index b34518b..08528e1 100644 --- a/shell/video/sdl/video_blit.h +++ b/shell/video/sdl/video_blit.h @@ -6,6 +6,9 @@ #define HOST_WIDTH_RESOLUTION sdl_screen->w #define HOST_HEIGHT_RESOLUTION sdl_screen->h +#define BACKBUFFER_WIDTH_RESOLUTION backbuffer->w +#define BACKBUFFER_HEIGHT_RESOLUTION backbuffer->h + extern SDL_Surface *sdl_screen, *backbuffer; extern uint32_t width_of_surface; |