FS#9901 by Joshua Simmons for the Goban plugin: Goban overlay for the Archos targets.
This is a first try to enable this plugin for low memory targets like our old archoses :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20069 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
00215348d0
commit
37183be69c
7 changed files with 126 additions and 36 deletions
|
@ -107,6 +107,11 @@ rockboy.c
|
|||
zxbox.c
|
||||
#endif
|
||||
|
||||
/* overlay loader for Goban */
|
||||
#if (PLUGIN_BUFFER_SIZE < 0x10000) && !defined(SIMULATOR)
|
||||
goban.c
|
||||
#endif
|
||||
|
||||
/* not support recorder models for now */
|
||||
#if (LCD_WIDTH > 112) && (LCD_HEIGHT > 64)
|
||||
fireworks.c
|
||||
|
|
|
@ -20,10 +20,7 @@ chessbox
|
|||
jpeg
|
||||
sudoku
|
||||
reversi
|
||||
/* Plugin is about 40k, rounding up to 65k to be safe. */
|
||||
#if (defined(PLUGIN_BUFFER_SIZE) && PLUGIN_BUFFER_SIZE >= 0x10000)
|
||||
goban
|
||||
#endif
|
||||
#ifndef OLYMPUS_MROBE_500
|
||||
zxbox
|
||||
#endif
|
||||
|
|
43
apps/plugins/goban/archos.lds
Normal file
43
apps/plugins/goban/archos.lds
Normal file
|
@ -0,0 +1,43 @@
|
|||
#include "config.h"
|
||||
|
||||
/* linker script for goban as an overlay */
|
||||
|
||||
OUTPUT_FORMAT(elf32-sh)
|
||||
|
||||
#define DRAMORIG 0x09000000
|
||||
#define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
|
||||
|
||||
#define OVERLAY_LENGTH 0x10000
|
||||
#define OVERLAY_ORIGIN (DRAMORIG + (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - OVERLAY_LENGTH)
|
||||
|
||||
MEMORY
|
||||
{
|
||||
OVERLAY_RAM : ORIGIN = OVERLAY_ORIGIN, LENGTH = OVERLAY_LENGTH
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.header : {
|
||||
_plugin_start_addr = .;
|
||||
KEEP(*(.header))
|
||||
} > OVERLAY_RAM
|
||||
|
||||
.text : {
|
||||
*(.text*)
|
||||
} > OVERLAY_RAM
|
||||
|
||||
.rodata : {
|
||||
*(.rodata*)
|
||||
} > OVERLAY_RAM
|
||||
|
||||
.data : {
|
||||
*(.data*)
|
||||
} > OVERLAY_RAM
|
||||
|
||||
.bss : {
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(0x4);
|
||||
_plugin_end_addr = .;
|
||||
} > OVERLAY_RAM
|
||||
}
|
|
@ -1,25 +1,37 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007-2009 Joshua Simmons <mud at majidejima dot com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include "plugin.h"
|
||||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007-2009 Joshua Simmons <mud at majidejima dot com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#include "plugin.h"
|
||||
|
||||
#if PLUGIN_BUFFER_SIZE < 0x10000 && !defined(SIMULATOR)
|
||||
|
||||
#include "lib/overlay.h"
|
||||
|
||||
PLUGIN_HEADER
|
||||
|
||||
enum plugin_status plugin_start(const void* parameter)
|
||||
{
|
||||
return run_overlay(parameter, PLUGIN_GAMES_DIR "/goban.ovl", "Goban");
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "lib/playback_control.h"
|
||||
#include "lib/configfile.h"
|
||||
|
||||
|
|
|
@ -8,15 +8,41 @@
|
|||
#
|
||||
|
||||
|
||||
GOBANSRCDIR := $(APPSDIR)/plugins/goban
|
||||
GOBANBUILDDIR := $(BUILDDIR)/apps/plugins/goban
|
||||
GOBAN_SRCDIR := $(APPSDIR)/plugins/goban
|
||||
GOBAN_BUILDDIR := $(BUILDDIR)/apps/plugins/goban
|
||||
|
||||
ROCKS += $(GOBANBUILDDIR)/goban.rock
|
||||
|
||||
|
||||
GOBAN_SRC := $(call preprocess, $(GOBANSRCDIR)/SOURCES)
|
||||
GOBAN_SRC := $(call preprocess, $(GOBAN_SRCDIR)/SOURCES)
|
||||
GOBAN_OBJ := $(call c2obj, $(GOBAN_SRC))
|
||||
|
||||
OTHER_SRC += $(GOBAN_SRC)
|
||||
|
||||
$(GOBANBUILDDIR)/goban.rock: $(GOBAN_OBJ)
|
||||
ifndef SIMVER
|
||||
ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
|
||||
### archos recorder targets
|
||||
GOBAN_INLDS := $(GOBAN_SRCDIR)/archos.lds
|
||||
ROCKS += $(GOBAN_BUILDDIR)/goban.ovl
|
||||
else
|
||||
### all other targets
|
||||
GOBAN_INLDS := $(APPSDIR)/plugins/plugin.lds
|
||||
ROCKS += $(GOBAN_BUILDDIR)/goban.rock
|
||||
endif
|
||||
GOBAN_OVLFLAGS = -T$(GOBAN_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
|
||||
GOBAN_OUTLDS = $(GOBAN_BUILDDIR)/goban.lds
|
||||
else
|
||||
### simulator
|
||||
ROCKS += $(GOBAN_BUILDDIR)/goban.rock
|
||||
GOBAN_OVLFLAGS = $(SHARED_FLAG) # <-- from Makefile
|
||||
endif
|
||||
|
||||
$(GOBAN_OUTLDS): $(GOBAN_INLDS) $(GOBAN_OBJ)
|
||||
$(call PRINTS,PP $(<F))$(call preprocess2file,$<,$@)
|
||||
|
||||
$(GOBAN_BUILDDIR)/goban.rock: $(GOBAN_OBJ) $(GOBAN_OUTLDS)
|
||||
|
||||
$(GOBAN_BUILDDIR)/goban.ovl: $(GOBAN_OBJ) $(GOBAN_OUTLDS)
|
||||
$(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
|
||||
$(filter %.o, $^) \
|
||||
$(filter %.a, $^) \
|
||||
-lgcc $(GOBAN_OVLFLAGS)
|
||||
$(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@
|
||||
|
||||
|
|
|
@ -326,7 +326,7 @@ setup_sgf (void)
|
|||
|
||||
if (total_storage_size < MIN_STORAGE_BUFFER_SIZE)
|
||||
{
|
||||
rb->splash (2 * HZ, "Stopping music playback to get more space");
|
||||
rb->splash (1 * HZ, "Stopping music playback to get more space");
|
||||
DEBUGF ("storage_buffer_size < MIN!!: %d\n", (int) total_storage_size);
|
||||
|
||||
temp_buffer = rb->plugin_get_audio_buffer (&size);
|
||||
|
@ -335,7 +335,7 @@ setup_sgf (void)
|
|||
|
||||
if (total_storage_size < MIN_STORAGE_BUFFER_SIZE)
|
||||
{
|
||||
rb->splash (5 * HZ, "Low memory. Large files may not load.");
|
||||
rb->splash (1 * HZ, "Low memory. Large files may not load.");
|
||||
|
||||
DEBUGF ("storage_buffer_size < MIN!!!!: %d\n",
|
||||
(int) total_storage_size);
|
||||
|
@ -387,6 +387,15 @@ setup_storage_buffer (char *temp_buffer, size_t size)
|
|||
unsigned int index = 0;
|
||||
int temp;
|
||||
|
||||
#if PLUGIN_BUFFER_SIZE < 0x10000 && !defined(SIMULATOR)
|
||||
/* loaded as an overlay plugin, protect from overwriting ourselves */
|
||||
if (plugin_start_addr >= (unsigned char *) temp_buffer &&
|
||||
plugin_start_addr < (unsigned char *) temp_buffer + size)
|
||||
{
|
||||
size = plugin_start_addr - (unsigned char *) temp_buffer;
|
||||
}
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (index >= sizeof (storage_initialized) /
|
||||
|
|
|
@ -35,9 +35,7 @@ text files%
|
|||
|
||||
{\input{plugins/flipit.tex}}
|
||||
|
||||
\nopt{recorder,recorderv2fm,ondio}{
|
||||
\opt{lcd_bitmap}{\input{plugins/goban.tex}}
|
||||
}
|
||||
|
||||
\opt{lcd_non-mono}{\nopt{h10_5gb,ipodmini,c200}{
|
||||
\input{plugins/invadrox.tex}}}
|
||||
|
|
Loading…
Reference in a new issue