mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
Added plugin loader. Moved games, demos and the text viewer to loadable plugins. Copy your *.rock files to /.rockbox/rocks/
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3770 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ba371fb595
commit
3f54121fde
7 changed files with 37 additions and 38 deletions
|
|
@ -165,12 +165,6 @@ int rtc_write(int address, int value)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool oscillograph(void)
|
||||
{
|
||||
/* does nothing */
|
||||
return false;
|
||||
}
|
||||
|
||||
bool has_new_lcd(void)
|
||||
{
|
||||
return having_new_lcd;
|
||||
|
|
|
|||
|
|
@ -92,27 +92,34 @@ FIRMSRCS = $(LCDSRSC) id3.c debug.c usb.c mpeg.c power.c\
|
|||
|
||||
APPS = main.c tree.c menu.c credits.c main_menu.c language.c\
|
||||
playlist.c wps.c wps-display.c settings.c status.c icons.c\
|
||||
screens.c peakmeter.c viewer.c sleeptimer.c keyboard.c onplay.c\
|
||||
misc.c
|
||||
screens.c peakmeter.c sleeptimer.c keyboard.c onplay.c\
|
||||
misc.c plugin.c
|
||||
|
||||
MENUS = games_menu.c demo_menu.c settings_menu.c sound_menu.c
|
||||
|
||||
ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP)
|
||||
APPS += tetris.c sokoban.c bounce.c snow.c bmp.c widgets.c wormlet.c cube.c
|
||||
APPS += bmp.c widgets.c
|
||||
endif
|
||||
|
||||
SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c stubs.c \
|
||||
button-x11.c io.c thread.c sim_icons.c $(APPS) $(MENUS) $(FIRMSRCS)
|
||||
|
||||
ROCKSRC := $(wildcard $(APPDIR)/plugins/*.c)
|
||||
ROCKS := $(ROCKSRC:$(APPDIR)/plugins/%.c=$(OBJDIR)/%.rock)
|
||||
|
||||
OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o)
|
||||
|
||||
all: $(TARGET) $(EXTRA_TARGETS)
|
||||
all: $(TARGET) $(EXTRA_TARGETS) $(ROCKS)
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) *~ core $(TARGET) $(CLIENTS) $(OBJDIR)/lang.[cho] \
|
||||
$(OBJDIR)/build.lang $(OBJDIR)/*.o $(OBJDIR)/sysfont.c
|
||||
$(OBJDIR)/build.lang $(OBJDIR)/*.o $(OBJDIR)/sysfont.c \
|
||||
$(ROCKS) $(OBJDIR)/credits.raw
|
||||
$(RM) -r $(DEPS)
|
||||
|
||||
$(OBJDIR)/%.rock: $(APPDIR)/plugins/%.c $(APPDIR)/plugin.h
|
||||
$(CC) $(APPCFLAGS) -DPLUGIN -shared $< -o $@
|
||||
|
||||
distclean: clean
|
||||
$(RM) config.cache
|
||||
|
||||
|
|
@ -128,6 +135,9 @@ $(OBJDIR)/menu.o: $(APPDIR)/menu.c
|
|||
$(OBJDIR)/main_menu.o: $(APPDIR)/main_menu.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/plugin.o: $(APPDIR)/plugin.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/keyboard.o: $(MACHINEDIR)/keyboard.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
|
|
@ -152,24 +162,6 @@ $(OBJDIR)/icons.o: $(MACHINEDIR)/icons.c
|
|||
$(OBJDIR)/widgets.o: $(RECDIR)/widgets.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/tetris.o: $(RECDIR)/tetris.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/wormlet.o: $(RECDIR)/wormlet.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/sokoban.o: $(RECDIR)/sokoban.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/bounce.o: $(RECDIR)/bounce.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/cube.o: $(RECDIR)/cube.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/snow.o: $(RECDIR)/snow.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/main.o: $(APPDIR)/main.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
|
|
@ -182,9 +174,6 @@ $(OBJDIR)/wps.o: $(APPDIR)/wps.c
|
|||
$(OBJDIR)/sleeptimer.o: $(APPDIR)/sleeptimer.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/viewer.o: $(APPDIR)/viewer.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
$(OBJDIR)/wps-display.o: $(APPDIR)/wps-display.c
|
||||
$(CC) $(APPCFLAGS) -c $< -o $@
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifndef _X11_DIR_H_
|
||||
#define _X11_DIR_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
typedef void DIR;
|
||||
|
|
@ -29,7 +31,9 @@ typedef void * MYDIR;
|
|||
|
||||
extern MYDIR *x11_opendir(char *name);
|
||||
extern struct x11_dirent* x11_readdir(MYDIR* dir);
|
||||
extern void x11_closedir(MYDIR *dir);
|
||||
extern int x11_closedir(MYDIR *dir);
|
||||
|
||||
#ifndef NO_REDEFINES_PLEASE
|
||||
|
||||
#define DIR MYDIR
|
||||
#define dirent x11_dirent
|
||||
|
|
@ -37,3 +41,6 @@ extern void x11_closedir(MYDIR *dir);
|
|||
#define readdir(x) x11_readdir(x)
|
||||
#define closedir(x) x11_closedir(x)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -23,25 +23,28 @@
|
|||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
int x11_open(char *name, int opts);
|
||||
int x11_open(const char *name, int opts);
|
||||
int x11_close(int fd);
|
||||
int x11_filesize(int fd);
|
||||
int x11_creat(char *name, int mode);
|
||||
int x11_remove(char *name);
|
||||
int x11_rename(char *oldpath, char *newpath);
|
||||
|
||||
#ifndef NO_REDEFINES_PLEASE
|
||||
#define open(x,y) x11_open(x,y)
|
||||
#define close(x) x11_close(x)
|
||||
#define filesize(x) x11_filesize(x)
|
||||
#define creat(x,y) x11_creat(x,y)
|
||||
#define remove(x) x11_remove(x)
|
||||
#define rename(x,y) x11_rename(x,y)
|
||||
#endif
|
||||
|
||||
#include "../../firmware/include/file.h"
|
||||
|
||||
extern int open(char* pathname, int flags);
|
||||
extern int close(int fd);
|
||||
extern int printf(const char *format, ...);
|
||||
int open(const char* pathname, int flags);
|
||||
int close(int fd);
|
||||
int printf(const char *format, ...);
|
||||
int ftruncate(int fd, off_t length);
|
||||
|
||||
off_t lseek(int fildes, off_t offset, int whence);
|
||||
ssize_t read(int fd, void *buf, size_t count);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ void x11_closedir(MYDIR *dir)
|
|||
}
|
||||
|
||||
|
||||
int x11_open(char *name, int opts)
|
||||
int x11_open(const char *name, int opts)
|
||||
{
|
||||
char buffer[256]; /* sufficiently big */
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,10 @@
|
|||
|
||||
#include "../../firmware/export/kernel.h"
|
||||
|
||||
#ifndef NO_REDEFINES_PLEASE
|
||||
|
||||
#define sleep(x) x11_sleep(x)
|
||||
|
||||
#endif
|
||||
|
||||
void x11_sleep(int);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ int rockbox_snprintf (char *buf, size_t size, const char *fmt, ...);
|
|||
int rockbox_vsnprintf (char *buf, int size, const char *fmt, va_list ap);
|
||||
int rockbox_fprintf (int fd, const char *fmt, ...);
|
||||
|
||||
#ifndef NO_REDEFINES_PLEASE
|
||||
#define snprintf rockbox_snprintf
|
||||
#define vsnprintf rockbox_vsnprintf
|
||||
#define fprintf rockbox_fprintf
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue