Skip to content

Commit

Permalink
add vice icon to bottom screen
Browse files Browse the repository at this point in the history
  • Loading branch information
badda71 committed Apr 4, 2019
1 parent d0c61eb commit 497f751
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ LDFLAGS =\
# DEBUG DEFINES
DDEFINES = -DSDL_DEBUG=1 -DDEBUG=1 -DARCHDEP_EXTRA_LOG_CALL=1

CFLAGS = -DARM11 -D_3DS -D_GNU_SOURCE=1 -O2 -Werror=implicit-function-declaration -Wfatal-errors -Wl,-rpath -Wl,/usr/lib/vice/lib -Wmissing-prototypes -Wshadow -fdata-sections -ffunction-sections -march=armv6k -mfloat-abi=hard -mtp=soft -mtune=mpcore -mword-relocations -specs=3dsx.specs $(DDEFINES) $(INCLUDES)
CFLAGS = -DARM11 -D_3DS -D_GNU_SOURCE=1 -O2 -Werror=implicit-function-declaration -Wno-trigraphs -Wfatal-errors -Wl,-rpath -Wl,/usr/lib/vice/lib -Wmissing-prototypes -Wshadow -fdata-sections -ffunction-sections -march=armv6k -mfloat-abi=hard -mtp=soft -mtune=mpcore -mword-relocations -specs=3dsx.specs $(DDEFINES) $(INCLUDES)

CC = arm-none-eabi-gcc
ODIR = obj
Expand Down
20 changes: 20 additions & 0 deletions src/arch/sdl/uibottom.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "log.h"
#include "videoarch.h"
#include "uistatusbar.h"
#include "viceicon.h"

int uikbd_pos[4][4] = {
{0,0,320,120}, // normal keys
Expand Down Expand Up @@ -125,6 +126,7 @@ uikbd_key uikbd_keypos[KBD_NUMKEYS] = {
{ 63, 97, 147, 16, 66, 7, 4, 0} // SPACE
};

static SDL_Surface *vice_img=NULL;
static SDL_Surface *kbd_img=NULL;
static SDL_Rect bottom_r;
int uibottom_kbdactive = 1;
Expand Down Expand Up @@ -193,6 +195,24 @@ void sdl_uibottom_draw(void)
olds=s;
bottom_r = (SDL_Rect){ .x = 0, .y = s->h/2, .w = s->w, .h=s->h/2};
SDL_FillRect(s, &bottom_r, SDL_MapRGB(s->format, 0x30, 0x30, 0x30));

// display vice icon
if (vice_img == NULL) {
vice_img = SDL_CreateRGBSurfaceFrom(
viceicon.pixel_data,
viceicon.width,
viceicon.height,
viceicon.bytes_per_pixel*8,
viceicon.bytes_per_pixel*viceicon.width,
0x000000ff,
0x0000ff00,
0x00ff0000,
0xff000000);
}
SDL_BlitSurface(vice_img, NULL, s,
&(SDL_Rect){.x = (s->w-vice_img->w)/2, .y = 248});


if (kbd_img == NULL) {
char *fname = archdep_join_paths(archdep_user_config_path(),"ui_keyboard.bmp",NULL);
kbd_img = SDL_LoadBMP(fname);
Expand Down

0 comments on commit 497f751

Please sign in to comment.