Skip to content

Commit

Permalink
Picture and logo for menu background.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorgelig committed May 25, 2019
1 parent ac7ba6d commit 8231267
Show file tree
Hide file tree
Showing 16 changed files with 792 additions and 67 deletions.
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SHELL = /bin/bash -o pipefail
BASE = arm-linux-gnueabihf

CC = $(BASE)-gcc
LD = $(CC)
LD = $(BASE)-ld
STRIP = $(BASE)-strip

ifeq ($(V),1)
Expand All @@ -22,6 +22,7 @@ INCLUDE += -I./lib/miniz
PRJ = MiSTer
SRC = $(wildcard *.c)
SRC2 = $(wildcard *.cpp)
IMG = $(wildcard *.png)
MINIMIG_SRC = $(wildcard ./support/minimig/*.cpp)
SHARPMZ_SRC = $(wildcard ./support/sharpmz/*.cpp)
ARCHIE_SRC = $(wildcard ./support/archie/*.cpp)
Expand All @@ -32,18 +33,20 @@ LIBCO_SRC = lib/libco/arm.c
LODEPNG_SRC = lib/lodepng/lodepng.cpp
MINIZ_SRC = $(wildcard ./lib/miniz/*.c)

IMLIB2_LIB = -Llib/imlib2 -lfreetype -lbz2 -lpng16 -lz -lImlib2

VPATH = ./:./support/minimig:./support/sharpmz:./support/archie:./support/st:./support/x86:./support/snes

OBJ = $(SRC:.c=.c.o) $(SRC2:.cpp=.cpp.o) $(MINIMIG_SRC:.cpp=.cpp.o) $(SHARPMZ_SRC:.cpp=.cpp.o) $(ARCHIE_SRC:.cpp=.cpp.o) $(ST_SRC:.cpp=.cpp.o) $(X86_SRC:.cpp=.cpp.o) $(SNES_SRC:.cpp=.cpp.o) $(LIBCO_SRC:.c=.c.o) $(MINIZ_SRC:.c=.c.o) $(LODEPNG_SRC:.cpp=.cpp.o)
OBJ = $(SRC:.c=.c.o) $(SRC2:.cpp=.cpp.o) $(IMG:.png=.png.o) $(MINIMIG_SRC:.cpp=.cpp.o) $(SHARPMZ_SRC:.cpp=.cpp.o) $(ARCHIE_SRC:.cpp=.cpp.o) $(ST_SRC:.cpp=.cpp.o) $(X86_SRC:.cpp=.cpp.o) $(SNES_SRC:.cpp=.cpp.o) $(LIBCO_SRC:.c=.c.o) $(MINIZ_SRC:.c=.c.o) $(LODEPNG_SRC:.cpp=.cpp.o)
DEP = $(SRC:.c=.cpp.d) $(SRC2:.cpp=.cpp.d) $(MINIMIG_SRC:.cpp=.cpp.d) $(SHARPMZ_SRC:.cpp=.cpp.d) $(ARCHIE_SRC:.cpp=.cpp.d) $(ST_SRC:.cpp=.cpp.d) $(X86_SRC:.cpp=.cpp.d) $(SNES_SRC:.cpp=.cpp.d) $(LIBCO_SRC:.c=.c.d) $(MINIZ_SRC:.c=.c.d) $(LODEPNG_SRC:.cpp=.cpp.d)

DFLAGS = $(INCLUDE) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DVDATE=\"`date +"%y%m%d"`\"
CFLAGS = $(DFLAGS) -Wall -Wextra -Wno-strict-aliasing -c -O3
LFLAGS = -lc -lstdc++ -lrt
LFLAGS = -lc -lstdc++ -lrt $(IMLIB2_LIB)

$(PRJ): $(OBJ)
$(Q)$(info $@)
$(Q)$(LD) -o $@ $+ $(LFLAGS)
$(Q)$(CC) -o $@ $+ $(LFLAGS)
$(Q)cp $@ $@.elf
$(Q)$(STRIP) $@

Expand All @@ -66,6 +69,10 @@ cleanall:
$(Q)$(info $<)
$(Q)$(CC) $(CFLAGS) -std=gnu++14 -o $@ -c $< 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g'

%.png.o: %.png
$(Q)$(info $<)
$(Q)$(LD) -r -b binary -o $@ $< 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g'

-include $(DEP)
%.c.d: %.c
$(Q)$(CC) $(DFLAGS) -MM $< -MT $@ -MT $*.c.o -MF $@ 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g'
Expand Down
1 change: 1 addition & 0 deletions MiSTer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ vscale_border=0 ; set vertical border for TVs cutting the upper/bottom pa
rbf_hide_datecode=0 ; 1 - hides datecodes from rbf file names. Press F2 for quick temporary toggle
menu_pal=0 ; 1 - PAL mode for menu core
hdmi_limited=0 ; 1 - use limited (16..235) color range over HDMI
fb_size=0 ; 0 - automatic, 1 - full size, 2 - 1/2 of resolution, 4 - 1/4 of resolution.

; lastcore - Autoboot the last loaded core (corename autosaved in CONFIG/lastcore.dat) first found on the SD/USB
; lastexactcore - Autoboot the last loaded exact core (corename_yyyymmdd.rbf autosaved in CONFIG/lastcore.dat) first found on the SD/USB
Expand Down
1 change: 1 addition & 0 deletions MiSTer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
<ClInclude Include="hardware.h" />
<ClInclude Include="ini_parser.h" />
<ClInclude Include="input.h" />
<ClInclude Include="lib\imlib2\Imlib2.h" />
<ClInclude Include="lib\libco\libco.h" />
<ClInclude Include="lib\libco\settings.h" />
<ClInclude Include="lib\lodepng\lodepng.h" />
Expand Down
3 changes: 3 additions & 0 deletions MiSTer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -291,5 +291,8 @@
<ClInclude Include="video.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="lib\imlib2\Imlib2.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ void MiSTer_ini_parse()
{
memset(&cfg, 0, sizeof(cfg));
cfg.bootscreen = 1;
cfg.fb_size = 1;
ini_parse(&ini_cfg);
}

Expand Down
18 changes: 14 additions & 4 deletions file_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,11 @@ int FileWriteSec(fileTYPE *file, void *pBuffer)
return FileWriteAdv(file, pBuffer, 512);
}

int FileSave(const char *name, void *pBuffer, int size)
int FileSave(const char *name, void *pBuffer, int size, int sys)
{
sprintf(full_path, "%s/%s", getRootDir(), name);
if(!sys) sprintf(full_path, "%s/%s", getRootDir(), name);
else strcpy(full_path, name);

int fd = open(full_path, O_WRONLY | O_CREAT | O_TRUNC | O_SYNC, S_IRWXU | S_IRWXG | S_IRWXO);
if (fd < 0)
{
Expand All @@ -523,9 +525,11 @@ int FileSaveConfig(const char *name, void *pBuffer, int size)
return FileSave(path, pBuffer, size);
}

int FileLoad(const char *name, void *pBuffer, int size)
int FileLoad(const char *name, void *pBuffer, int size, int sys)
{
sprintf(full_path, "%s/%s", getRootDir(), name);
if (!sys) sprintf(full_path, "%s/%s", getRootDir(), name);
else strcpy(full_path, name);

int fd = open(full_path, O_RDONLY);
if (fd < 0)
{
Expand Down Expand Up @@ -567,6 +571,12 @@ int FileLoadConfig(const char *name, void *pBuffer, int size)
return FileLoad(path, pBuffer, size);
}

int FileExists(const char *name)
{
sprintf(full_path, "%s/%s", getRootDir(), name);
return !access(full_path, F_OK);
}

int FileCanWrite(const char *name)
{
sprintf(full_path, "%s/%s", getRootDir(), name);
Expand Down
5 changes: 3 additions & 2 deletions file_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ int FileReadSec(fileTYPE *file, void *pBuffer);
int FileWriteAdv(fileTYPE *file, void *pBuffer, int length);
int FileWriteSec(fileTYPE *file, void *pBuffer);

int FileExists(const char *name);
int FileCanWrite(const char *name);

#define SAVE_DIR "saves"
Expand All @@ -70,8 +71,8 @@ void FileGenerateSavePath(const char *name, char* out_name);
#define SCREENSHOT_DEFAULT "screen"
void FileGenerateScreenshotName(const char *name, char *out_name, int buflen);

int FileSave(const char *name, void *pBuffer, int size);
int FileLoad(const char *name, void *pBuffer, int size); // supply pBuffer = 0 to get the file size without loading
int FileSave(const char *name, void *pBuffer, int size, int sys = 0);
int FileLoad(const char *name, void *pBuffer, int size, int sys = 0); // supply pBuffer = 0 to get the file size without loading

//save/load from config dir
#define CONFIG_DIR "config"
Expand Down
Loading

0 comments on commit 8231267

Please sign in to comment.