aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorgameblabla2019-10-11 13:38:25 +0200
committergameblabla2019-10-11 13:38:25 +0200
commitb029a0b25f2f0cf9775f6f720756760e1f6c6438 (patch)
treef121917aa23c48789356068faac1721278b050b8 /shell
parentcc878848a45db22abe284649c7e19f896a0abeb9 (diff)
downloadsnesemu-b029a0b25f2f0cf9775f6f720756760e1f6c6438.tar.gz
snesemu-b029a0b25f2f0cf9775f6f720756760e1f6c6438.tar.bz2
snesemu-b029a0b25f2f0cf9775f6f720756760e1f6c6438.zip
Fix text issues in Menu for Retrostone port and input code.
Diffstat (limited to 'shell')
-rw-r--r--shell/input/sdl/input.c6
-rw-r--r--shell/menu/font_drawing.c8
-rw-r--r--shell/video/retrostone/video_blit.c4
-rw-r--r--shell/video/retrostone/video_blit.h10
-rw-r--r--shell/video/sdl/video_blit.c2
-rw-r--r--shell/video/sdl/video_blit.h3
6 files changed, 18 insertions, 15 deletions
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;