Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently).
The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR). The new define is to (de-)select code to compile on hosted platforms generally. Should be no functional change to targets or the simulator. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
02e04585bd
commit
35e8b1429a
|
@ -42,7 +42,7 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
|
|
||||||
#ifdef AUDIO_CPU_BOOST
|
#ifdef AUDIO_CPU_BOOST
|
||||||
static void audio_cpu_boost(bool state)
|
static void audio_cpu_boost(bool state)
|
||||||
|
@ -115,7 +115,7 @@ int audio_get_spdif_sample_rate(void)
|
||||||
} /* audio_get_spdif_sample_rate */
|
} /* audio_get_spdif_sample_rate */
|
||||||
#endif /* HAVE_SPDIF_IN */
|
#endif /* HAVE_SPDIF_IN */
|
||||||
|
|
||||||
#else /* SIMULATOR */
|
#else /* PLATFORM_HOSTED */
|
||||||
|
|
||||||
/** Sim stubs **/
|
/** Sim stubs **/
|
||||||
|
|
||||||
|
@ -153,4 +153,4 @@ int audio_get_spdif_sample_rate(void)
|
||||||
} /* audio_get_spdif_sample_rate */
|
} /* audio_get_spdif_sample_rate */
|
||||||
#endif /* HAVE_SPDIF_IN */
|
#endif /* HAVE_SPDIF_IN */
|
||||||
|
|
||||||
#endif /* !SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#if defined(SIMULATOR) && defined(__APPLE__)
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
|
||||||
osx_dummy.bmp
|
osx_dummy.bmp
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#if defined(SIMULATOR) && defined(__APPLE__)
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
|
||||||
osx_remote_dummy.bmp
|
osx_remote_dummy.bmp
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1488,7 +1488,7 @@ void buffering_thread(void)
|
||||||
base_handle_id = (int)ev.data;
|
base_handle_id = (int)ev.data;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
case SYS_USB_CONNECTED:
|
case SYS_USB_CONNECTED:
|
||||||
LOGFQUEUE("buffering < SYS_USB_CONNECTED");
|
LOGFQUEUE("buffering < SYS_USB_CONNECTED");
|
||||||
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
||||||
|
|
|
@ -54,20 +54,20 @@
|
||||||
#define LOGF_ENABLE
|
#define LOGF_ENABLE
|
||||||
#include "logf.h"
|
#include "logf.h"
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
#define PREFIX(_x_) sim_ ## _x_
|
|
||||||
#else
|
|
||||||
#define PREFIX
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#define PREFIX(_x_) sim_ ## _x_
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
unsigned char codecbuf[CODEC_SIZE];
|
unsigned char codecbuf[CODEC_SIZE];
|
||||||
#endif
|
#endif
|
||||||
void *sim_codec_load_ram(char* codecptr, int size, void **pd);
|
void *sim_codec_load_ram(char* codecptr, int size, void **pd);
|
||||||
void sim_codec_close(void *pd);
|
void sim_codec_close(void *pd);
|
||||||
#else
|
|
||||||
|
#else /* !PLATFORM_HOSTED */
|
||||||
|
|
||||||
|
#define PREFIX
|
||||||
#define sim_codec_close(x)
|
#define sim_codec_close(x)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
size_t codec_size;
|
size_t codec_size;
|
||||||
|
@ -77,7 +77,7 @@ extern void* plugin_get_audio_buffer(size_t *buffer_size);
|
||||||
#undef open
|
#undef open
|
||||||
static int open(const char* pathname, int flags, ...)
|
static int open(const char* pathname, int flags, ...)
|
||||||
{
|
{
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
int fd;
|
int fd;
|
||||||
if (flags & O_CREAT)
|
if (flags & O_CREAT)
|
||||||
{
|
{
|
||||||
|
@ -201,7 +201,7 @@ static int codec_load_ram(int size, struct codec_api *api)
|
||||||
{
|
{
|
||||||
struct codec_header *hdr;
|
struct codec_header *hdr;
|
||||||
int status;
|
int status;
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
hdr = (struct codec_header *)codecbuf;
|
hdr = (struct codec_header *)codecbuf;
|
||||||
|
|
||||||
if (size <= (signed)sizeof(struct codec_header)
|
if (size <= (signed)sizeof(struct codec_header)
|
||||||
|
@ -220,7 +220,7 @@ static int codec_load_ram(int size, struct codec_api *api)
|
||||||
|
|
||||||
codec_size = hdr->end_addr - codecbuf;
|
codec_size = hdr->end_addr - codecbuf;
|
||||||
|
|
||||||
#else /* SIMULATOR */
|
#elif (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
void *pd;
|
void *pd;
|
||||||
|
|
||||||
hdr = sim_codec_load_ram(codecbuf, size, &pd);
|
hdr = sim_codec_load_ram(codecbuf, size, &pd);
|
||||||
|
@ -241,7 +241,7 @@ static int codec_load_ram(int size, struct codec_api *api)
|
||||||
|
|
||||||
codec_size = codecbuf - codecbuf;
|
codec_size = codecbuf - codecbuf;
|
||||||
|
|
||||||
#endif /* SIMULATOR */
|
#endif /* CONFIG_PLATFORM */
|
||||||
if (hdr->api_version > CODEC_API_VERSION
|
if (hdr->api_version > CODEC_API_VERSION
|
||||||
|| hdr->api_version < CODEC_MIN_API_VERSION) {
|
|| hdr->api_version < CODEC_MIN_API_VERSION) {
|
||||||
sim_codec_close(pd);
|
sim_codec_close(pd);
|
||||||
|
|
|
@ -254,7 +254,7 @@ extern unsigned char codecbuf[];
|
||||||
extern size_t codec_size;
|
extern size_t codec_size;
|
||||||
|
|
||||||
#ifdef CODEC
|
#ifdef CODEC
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
/* plugin_* is correct, codecs use the plugin linker script */
|
/* plugin_* is correct, codecs use the plugin linker script */
|
||||||
extern unsigned char plugin_start_addr[];
|
extern unsigned char plugin_start_addr[];
|
||||||
extern unsigned char plugin_end_addr[];
|
extern unsigned char plugin_end_addr[];
|
||||||
|
|
|
@ -36,7 +36,7 @@ extern enum codec_status codec_main(void);
|
||||||
|
|
||||||
enum codec_status codec_start(void)
|
enum codec_status codec_start(void)
|
||||||
{
|
{
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#ifdef USE_IRAM
|
#ifdef USE_IRAM
|
||||||
ci->memcpy(iramstart, iramcopy, iramend - iramstart);
|
ci->memcpy(iramstart, iramcopy, iramend - iramstart);
|
||||||
ci->memset(iedata, 0, iend - iedata);
|
ci->memset(iedata, 0, iend - iedata);
|
||||||
|
|
|
@ -24,6 +24,6 @@ setjmp_cf.S
|
||||||
setjmp_mips.S
|
setjmp_mips.S
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined(SIMULATOR) && defined(__APPLE__)
|
#elif (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
|
||||||
osx.dummy.c
|
osx.dummy.c
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -104,6 +104,7 @@
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
#include "tlsf.h"
|
#include "tlsf.h"
|
||||||
|
|
||||||
#if !defined(__GNUC__)
|
#if !defined(__GNUC__)
|
||||||
|
@ -164,7 +165,8 @@
|
||||||
#define PAGE_SIZE (getpagesize())
|
#define PAGE_SIZE (getpagesize())
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ROCKBOX) && defined(SIMULATOR) || !defined(ROCKBOX)
|
#if defined(ROCKBOX) && (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(DEBUG) \
|
||||||
|
|| !defined(ROCKBOX)
|
||||||
int printf(const char* fmt, ...);
|
int printf(const char* fmt, ...);
|
||||||
#define PRINT_MSG(fmt, args...) printf(fmt, ## args)
|
#define PRINT_MSG(fmt, args...) printf(fmt, ## args)
|
||||||
#define ERROR_MSG(fmt, args...) printf(fmt, ## args)
|
#define ERROR_MSG(fmt, args...) printf(fmt, ## args)
|
||||||
|
|
|
@ -37,10 +37,8 @@
|
||||||
|
|
||||||
#include "m4a.h"
|
#include "m4a.h"
|
||||||
|
|
||||||
#if defined(DEBUG) || defined(SIMULATOR)
|
|
||||||
#ifdef DEBUGF
|
|
||||||
#undef DEBUGF
|
#undef DEBUGF
|
||||||
#endif
|
#if defined(DEBUG)
|
||||||
#define DEBUGF qtmovie->stream->ci->debugf
|
#define DEBUGF qtmovie->stream->ci->debugf
|
||||||
#else
|
#else
|
||||||
#define DEBUGF(...)
|
#define DEBUGF(...)
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
/* TGB is the only target fast enough for gaussian and realtime BRR decode */
|
/* TGB is the only target fast enough for gaussian and realtime BRR decode */
|
||||||
/* echo is almost fast enough but not quite */
|
/* echo is almost fast enough but not quite */
|
||||||
#if defined(TOSHIBA_GIGABEAT_F) || defined(TOSHIBA_GIGABEAT_S) ||\
|
#if defined(TOSHIBA_GIGABEAT_F) || defined(TOSHIBA_GIGABEAT_S) ||\
|
||||||
defined(SIMULATOR) || MEMORYSIZE <= 2
|
(CONFIG_PLATFORM & PLATFORM_HOSTED) || MEMORYSIZE <= 2
|
||||||
/* Don't cache BRR waves */
|
/* Don't cache BRR waves */
|
||||||
#define SPC_BRRCACHE 0
|
#define SPC_BRRCACHE 0
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
#ifndef SIMULATOR
|
#include "config.h"
|
||||||
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#include "libc/ctype.c"
|
#include "libc/ctype.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
#include "lcd-remote.h"
|
#include "lcd-remote.h"
|
||||||
#include "crc32.h"
|
#include "crc32.h"
|
||||||
#include "logf.h"
|
#include "logf.h"
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#include "disk.h"
|
#include "disk.h"
|
||||||
#include "adc.h"
|
#include "adc.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
|
@ -276,7 +276,7 @@ static unsigned int ticks, boost_ticks, freq_sum;
|
||||||
|
|
||||||
static void dbg_audio_task(void)
|
static void dbg_audio_task(void)
|
||||||
{
|
{
|
||||||
#ifndef SIMULATOR
|
#ifdef CPUFREQ_NORMAL
|
||||||
if(FREQ > CPUFREQ_NORMAL)
|
if(FREQ > CPUFREQ_NORMAL)
|
||||||
boost_ticks++;
|
boost_ticks++;
|
||||||
freq_sum += FREQ/1000000; /* in MHz */
|
freq_sum += FREQ/1000000; /* in MHz */
|
||||||
|
@ -371,7 +371,7 @@ static bool dbg_buffering_thread(void)
|
||||||
|
|
||||||
screens[i].putsf(0, line++, "handle count: %d", (int)d.num_handles);
|
screens[i].putsf(0, line++, "handle count: %d", (int)d.num_handles);
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
screens[i].putsf(0, line++, "cpu freq: %3dMHz",
|
screens[i].putsf(0, line++, "cpu freq: %3dMHz",
|
||||||
(int)((FREQ + 500000) / 1000000));
|
(int)((FREQ + 500000) / 1000000));
|
||||||
#endif
|
#endif
|
||||||
|
@ -758,7 +758,7 @@ static bool dbg_hw_info(void)
|
||||||
#endif /* !HAVE_LCD_BITMAP */
|
#endif /* !HAVE_LCD_BITMAP */
|
||||||
#endif /* !SIMULATOR */
|
#endif /* !SIMULATOR */
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
static const char* dbg_partitions_getname(int selected_item, void *data,
|
static const char* dbg_partitions_getname(int selected_item, void *data,
|
||||||
char *buffer, size_t buffer_len)
|
char *buffer, size_t buffer_len)
|
||||||
{
|
{
|
||||||
|
@ -786,7 +786,7 @@ bool dbg_partitions(void)
|
||||||
info.get_name = dbg_partitions_getname;
|
info.get_name = dbg_partitions_getname;
|
||||||
return simplelist_show_list(&info);
|
return simplelist_show_list(&info);
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
#if defined(CPU_COLDFIRE) && defined(HAVE_SPDIF_OUT)
|
#if defined(CPU_COLDFIRE) && defined(HAVE_SPDIF_OUT)
|
||||||
static bool dbg_spdif(void)
|
static bool dbg_spdif(void)
|
||||||
|
@ -928,7 +928,7 @@ static bool dbg_spdif(void)
|
||||||
lcd_putsf(0, line++, "Clock accuracy: %d", x);
|
lcd_putsf(0, line++, "Clock accuracy: %d", x);
|
||||||
line++;
|
line++;
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
lcd_putsf(0, line++, "Measured freq: %ldHz",
|
lcd_putsf(0, line++, "Measured freq: %ldHz",
|
||||||
spdif_measure_frequency());
|
spdif_measure_frequency());
|
||||||
#endif
|
#endif
|
||||||
|
@ -950,7 +950,7 @@ static bool dbg_spdif(void)
|
||||||
}
|
}
|
||||||
#endif /* CPU_COLDFIRE */
|
#endif /* CPU_COLDFIRE */
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
/* button definitions */
|
/* button definitions */
|
||||||
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
|
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
|
||||||
|
@ -1334,9 +1334,9 @@ bool dbg_ports(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_LCD_BITMAP */
|
#endif /* !HAVE_LCD_BITMAP */
|
||||||
#endif /* !SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
#if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR)
|
#if (CONFIG_RTC == RTC_PCF50605) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
static bool dbg_pcf(void)
|
static bool dbg_pcf(void)
|
||||||
{
|
{
|
||||||
int line;
|
int line;
|
||||||
|
@ -1423,7 +1423,7 @@ static bool dbg_cpufreq(void)
|
||||||
}
|
}
|
||||||
#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
|
#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
|
||||||
|
|
||||||
#if defined(HAVE_TSC2100) && !defined(SIMULATOR)
|
#if defined(HAVE_TSC2100) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#include "tsc2100.h"
|
#include "tsc2100.h"
|
||||||
static char *itob(int n, int len)
|
static char *itob(int n, int len)
|
||||||
{
|
{
|
||||||
|
@ -1493,7 +1493,7 @@ static bool tsc2100_debug(void)
|
||||||
return simplelist_show_list(&info);
|
return simplelist_show_list(&info);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
/*
|
/*
|
||||||
* view_battery() shows a automatically scaled graph of the battery voltage
|
* view_battery() shows a automatically scaled graph of the battery voltage
|
||||||
|
@ -1785,7 +1785,7 @@ static bool view_battery(void)
|
||||||
#endif /* HAVE_LCD_BITMAP */
|
#endif /* HAVE_LCD_BITMAP */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD)
|
#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD)
|
||||||
|
|
||||||
#if (CONFIG_STORAGE & STORAGE_MMC)
|
#if (CONFIG_STORAGE & STORAGE_MMC)
|
||||||
|
@ -2106,7 +2106,7 @@ static bool dbg_disk_info(void)
|
||||||
info.scroll_all = true;
|
info.scroll_all = true;
|
||||||
return simplelist_show_list(&info);
|
return simplelist_show_list(&info);
|
||||||
}
|
}
|
||||||
#endif /* !SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
#ifdef HAVE_DIRCACHE
|
#ifdef HAVE_DIRCACHE
|
||||||
static int dircache_callback(int btn, struct gui_synclist *lists)
|
static int dircache_callback(int btn, struct gui_synclist *lists)
|
||||||
|
@ -2672,10 +2672,10 @@ static const struct the_menu_item menuitems[] = {
|
||||||
|| CONFIG_CPU == DM320 || defined(CPU_S5L870X) || CONFIG_CPU == AS3525v2
|
|| CONFIG_CPU == DM320 || defined(CPU_S5L870X) || CONFIG_CPU == AS3525v2
|
||||||
{ "View I/O ports", dbg_ports },
|
{ "View I/O ports", dbg_ports },
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR)
|
#if (CONFIG_RTC == RTC_PCF50605) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
{ "View PCF registers", dbg_pcf },
|
{ "View PCF registers", dbg_pcf },
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_TSC2100) && !defined(SIMULATOR)
|
#if defined(HAVE_TSC2100) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
{ "TSC2100 debug", tsc2100_debug },
|
{ "TSC2100 debug", tsc2100_debug },
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||||
|
@ -2689,18 +2689,18 @@ static const struct the_menu_item menuitems[] = {
|
||||||
#endif
|
#endif
|
||||||
{ "View OS stacks", dbg_os },
|
{ "View OS stacks", dbg_os },
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
{ "View battery", view_battery },
|
{ "View battery", view_battery },
|
||||||
#endif
|
#endif
|
||||||
{ "Screendump", dbg_screendump },
|
{ "Screendump", dbg_screendump },
|
||||||
#endif
|
#endif
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
{ "View HW info", dbg_hw_info },
|
{ "View HW info", dbg_hw_info },
|
||||||
#endif
|
#endif
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
{ "View partitions", dbg_partitions },
|
{ "View partitions", dbg_partitions },
|
||||||
#endif
|
#endif
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
{ "View disk info", dbg_disk_info },
|
{ "View disk info", dbg_disk_info },
|
||||||
#if (CONFIG_STORAGE & STORAGE_ATA)
|
#if (CONFIG_STORAGE & STORAGE_ATA)
|
||||||
{ "Dump ATA identify info", dbg_identify_info},
|
{ "Dump ATA identify info", dbg_identify_info},
|
||||||
|
|
|
@ -597,7 +597,7 @@ int ft_enter(struct tree_context* c)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
/* firmware file */
|
/* firmware file */
|
||||||
case FILE_ATTR_MOD:
|
case FILE_ATTR_MOD:
|
||||||
splash(0, ID2P(LANG_WAIT));
|
splash(0, ID2P(LANG_WAIT));
|
||||||
|
|
|
@ -115,6 +115,8 @@
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#ifdef SIMULATOR
|
||||||
#include "sim_tasks.h"
|
#include "sim_tasks.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SDL
|
||||||
#include "system-sdl.h"
|
#include "system-sdl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -313,7 +315,7 @@ static void init_tagcache(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
|
|
||||||
static void init(void)
|
static void init(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -347,7 +347,7 @@ static int info_action_callback(int action, struct gui_synclist *lists)
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
struct info_data *info = (struct info_data *)lists->data;
|
struct info_data *info = (struct info_data *)lists->data;
|
||||||
int i;
|
int i;
|
||||||
info->new_data = true;
|
info->new_data = true;
|
||||||
|
|
|
@ -251,7 +251,7 @@ static void system_restore(void)
|
||||||
|
|
||||||
static bool clean_shutdown(void (*callback)(void *), void *parameter)
|
static bool clean_shutdown(void (*callback)(void *), void *parameter)
|
||||||
{
|
{
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
(void)callback;
|
(void)callback;
|
||||||
(void)parameter;
|
(void)parameter;
|
||||||
bookmark_autobookmark(false);
|
bookmark_autobookmark(false);
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
/* Define LOGF_ENABLE to enable logf output in this file */
|
/* Define LOGF_ENABLE to enable logf output in this file */
|
||||||
/*#define LOGF_ENABLE*/
|
/*#define LOGF_ENABLE*/
|
||||||
#include "logf.h"
|
#include "logf.h"
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#endif
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -468,7 +468,7 @@ unsigned char *audio_get_recording_buffer(size_t *buffer_size)
|
||||||
|
|
||||||
bool audio_load_encoder(int afmt)
|
bool audio_load_encoder(int afmt)
|
||||||
{
|
{
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
const char *enc_fn = get_codec_filename(afmt | CODEC_TYPE_ENCODER);
|
const char *enc_fn = get_codec_filename(afmt | CODEC_TYPE_ENCODER);
|
||||||
if (!enc_fn)
|
if (!enc_fn)
|
||||||
return false;
|
return false;
|
||||||
|
@ -493,7 +493,7 @@ bool audio_load_encoder(int afmt)
|
||||||
|
|
||||||
void audio_remove_encoder(void)
|
void audio_remove_encoder(void)
|
||||||
{
|
{
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
/* force encoder codec unload (if currently loaded) */
|
/* force encoder codec unload (if currently loaded) */
|
||||||
if (ci.enc_codec_loaded <= 0)
|
if (ci.enc_codec_loaded <= 0)
|
||||||
return;
|
return;
|
||||||
|
@ -2008,7 +2008,7 @@ static void audio_thread(void)
|
||||||
LOGFQUEUE("audio < Q_AUDIO_TRACK_CHANGED");
|
LOGFQUEUE("audio < Q_AUDIO_TRACK_CHANGED");
|
||||||
audio_finalise_track_change();
|
audio_finalise_track_change();
|
||||||
break;
|
break;
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
case SYS_USB_CONNECTED:
|
case SYS_USB_CONNECTED:
|
||||||
LOGFQUEUE("audio < SYS_USB_CONNECTED");
|
LOGFQUEUE("audio < SYS_USB_CONNECTED");
|
||||||
if (playing)
|
if (playing)
|
||||||
|
|
|
@ -1318,7 +1318,7 @@ static void playlist_thread(void)
|
||||||
dirty_pointers = false;
|
dirty_pointers = false;
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
case SYS_USB_CONNECTED:
|
case SYS_USB_CONNECTED:
|
||||||
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
||||||
usb_wait_for_disconnect(&playlist_queue);
|
usb_wait_for_disconnect(&playlist_queue);
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
#include "usbstack/usb_hid.h"
|
#include "usbstack/usb_hid.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
#define PREFIX(_x_) sim_ ## _x_
|
#define PREFIX(_x_) sim_ ## _x_
|
||||||
#else
|
#else
|
||||||
#define PREFIX
|
#define PREFIX
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
static unsigned int open_files;
|
static unsigned int open_files;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
static unsigned char pluginbuf[PLUGIN_BUFFER_SIZE];
|
static unsigned char pluginbuf[PLUGIN_BUFFER_SIZE];
|
||||||
void *sim_plugin_load(char *plugin, void **pd);
|
void *sim_plugin_load(char *plugin, void **pd);
|
||||||
void sim_plugin_close(void *pd);
|
void sim_plugin_close(void *pd);
|
||||||
|
@ -157,7 +157,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
lcd_yuv_set_options,
|
lcd_yuv_set_options,
|
||||||
#endif
|
#endif
|
||||||
#endif /* MEMORYSIZE > 2 */
|
#endif /* MEMORYSIZE > 2 */
|
||||||
#elif (LCD_DEPTH < 4) && !defined(SIMULATOR)
|
#elif (LCD_DEPTH < 4) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
lcd_blit_mono,
|
lcd_blit_mono,
|
||||||
lcd_blit_grey_phase,
|
lcd_blit_grey_phase,
|
||||||
#endif /* LCD_DEPTH */
|
#endif /* LCD_DEPTH */
|
||||||
|
@ -366,7 +366,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
reset_poweroff_timer,
|
reset_poweroff_timer,
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
system_memory_guard,
|
system_memory_guard,
|
||||||
&cpu_frequency,
|
&cpu_frequency,
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
cpu_boost,
|
cpu_boost,
|
||||||
#endif
|
#endif
|
||||||
#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
|
#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
|
||||||
#endif /* !SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
#ifdef HAVE_SCHEDULER_BOOSTCTRL
|
#ifdef HAVE_SCHEDULER_BOOSTCTRL
|
||||||
trigger_cpu_boost,
|
trigger_cpu_boost,
|
||||||
cancel_cpu_boost,
|
cancel_cpu_boost,
|
||||||
|
@ -415,7 +415,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
remove_event,
|
remove_event,
|
||||||
send_event,
|
send_event,
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
/* special simulator hooks */
|
/* special simulator hooks */
|
||||||
#if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8
|
#if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8
|
||||||
sim_lcd_ex_init,
|
sim_lcd_ex_init,
|
||||||
|
@ -437,7 +437,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
memset,
|
memset,
|
||||||
memcpy,
|
memcpy,
|
||||||
memmove,
|
memmove,
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
_ctype_,
|
_ctype_,
|
||||||
#endif
|
#endif
|
||||||
atoi,
|
atoi,
|
||||||
|
@ -467,7 +467,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
#ifdef AUDIOHW_HAVE_EQ
|
#ifdef AUDIOHW_HAVE_EQ
|
||||||
sound_enum_hw_eq_band_setting,
|
sound_enum_hw_eq_band_setting,
|
||||||
#endif
|
#endif
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
mp3_play_data,
|
mp3_play_data,
|
||||||
mp3_play_pause,
|
mp3_play_pause,
|
||||||
mp3_play_stop,
|
mp3_play_stop,
|
||||||
|
@ -589,7 +589,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
battery_level,
|
battery_level,
|
||||||
battery_level_safe,
|
battery_level_safe,
|
||||||
battery_time,
|
battery_time,
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
battery_voltage,
|
battery_voltage,
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
|
@ -603,7 +603,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* misc */
|
/* misc */
|
||||||
#if !defined(SIMULATOR)
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
&errno,
|
&errno,
|
||||||
#endif
|
#endif
|
||||||
srand,
|
srand,
|
||||||
|
@ -727,15 +727,15 @@ int plugin_load(const char* plugin, const void* parameter)
|
||||||
{
|
{
|
||||||
int rc, i;
|
int rc, i;
|
||||||
struct plugin_header *hdr;
|
struct plugin_header *hdr;
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
void *pd;
|
void *pd;
|
||||||
#else /* !SIMULATOR */
|
#else /* PLATFOR_NATIVE */
|
||||||
int fd;
|
int fd;
|
||||||
ssize_t readsize;
|
ssize_t readsize;
|
||||||
#if NUM_CORES > 1
|
#if NUM_CORES > 1
|
||||||
unsigned my_core;
|
unsigned my_core;
|
||||||
#endif
|
#endif
|
||||||
#endif /* !SIMULATOR */
|
#endif /* CONFIG_PLATFORM */
|
||||||
|
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
fb_data* old_backdrop;
|
fb_data* old_backdrop;
|
||||||
|
@ -755,7 +755,7 @@ int plugin_load(const char* plugin, const void* parameter)
|
||||||
splash(0, ID2P(LANG_WAIT));
|
splash(0, ID2P(LANG_WAIT));
|
||||||
strcpy(current_plugin, plugin);
|
strcpy(current_plugin, plugin);
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
hdr = sim_plugin_load((char *)plugin, &pd);
|
hdr = sim_plugin_load((char *)plugin, &pd);
|
||||||
if (pd == NULL) {
|
if (pd == NULL) {
|
||||||
splashf(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
|
splashf(HZ*2, str(LANG_PLUGIN_CANT_OPEN), plugin);
|
||||||
|
@ -990,7 +990,7 @@ static int open_wrapper(const char* pathname, int flags, ...)
|
||||||
/* we don't have an 'open' function. it's a define. and we need
|
/* we don't have an 'open' function. it's a define. and we need
|
||||||
* the real file_open, hence PREFIX() doesn't work here */
|
* the real file_open, hence PREFIX() doesn't work here */
|
||||||
int fd;
|
int fd;
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
if (flags & O_CREAT)
|
if (flags & O_CREAT)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
|
@ -233,7 +233,7 @@ struct plugin_api {
|
||||||
void (*lcd_yuv_set_options)(unsigned options);
|
void (*lcd_yuv_set_options)(unsigned options);
|
||||||
#endif
|
#endif
|
||||||
#endif /* MEMORYSIZE > 2 */
|
#endif /* MEMORYSIZE > 2 */
|
||||||
#elif (LCD_DEPTH < 4) && !defined(SIMULATOR)
|
#elif (LCD_DEPTH < 4) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
void (*lcd_blit_mono)(const unsigned char *data, int x, int by, int width,
|
void (*lcd_blit_mono)(const unsigned char *data, int x, int by, int width,
|
||||||
int bheight, int stride);
|
int bheight, int stride);
|
||||||
void (*lcd_blit_grey_phase)(unsigned char *values, unsigned char *phases,
|
void (*lcd_blit_grey_phase)(unsigned char *values, unsigned char *phases,
|
||||||
|
@ -474,7 +474,7 @@ struct plugin_api {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void (*reset_poweroff_timer)(void);
|
void (*reset_poweroff_timer)(void);
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
int (*system_memory_guard)(int newmode);
|
int (*system_memory_guard)(int newmode);
|
||||||
long *cpu_frequency;
|
long *cpu_frequency;
|
||||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||||
|
@ -484,7 +484,7 @@ struct plugin_api {
|
||||||
void (*cpu_boost)(bool on_off);
|
void (*cpu_boost)(bool on_off);
|
||||||
#endif
|
#endif
|
||||||
#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
|
#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
|
||||||
#endif /* !SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
#ifdef HAVE_SCHEDULER_BOOSTCTRL
|
#ifdef HAVE_SCHEDULER_BOOSTCTRL
|
||||||
void (*trigger_cpu_boost)(void);
|
void (*trigger_cpu_boost)(void);
|
||||||
void (*cancel_cpu_boost)(void);
|
void (*cancel_cpu_boost)(void);
|
||||||
|
@ -530,7 +530,7 @@ struct plugin_api {
|
||||||
void (*remove_event)(unsigned short id, void (*handler)(void *data));
|
void (*remove_event)(unsigned short id, void (*handler)(void *data));
|
||||||
void (*send_event)(unsigned short id, void *data);
|
void (*send_event)(unsigned short id, void *data);
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
/* special simulator hooks */
|
/* special simulator hooks */
|
||||||
#if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8
|
#if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8
|
||||||
void (*sim_lcd_ex_init)(unsigned long (*getpixel)(int, int));
|
void (*sim_lcd_ex_init)(unsigned long (*getpixel)(int, int));
|
||||||
|
@ -553,7 +553,7 @@ struct plugin_api {
|
||||||
void* (*memset)(void *dst, int c, size_t length);
|
void* (*memset)(void *dst, int c, size_t length);
|
||||||
void* (*memcpy)(void *out, const void *in, size_t n);
|
void* (*memcpy)(void *out, const void *in, size_t n);
|
||||||
void* (*memmove)(void *out, const void *in, size_t n);
|
void* (*memmove)(void *out, const void *in, size_t n);
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
const unsigned char *_rbctype_;
|
const unsigned char *_rbctype_;
|
||||||
#endif
|
#endif
|
||||||
int (*atoi)(const char *str);
|
int (*atoi)(const char *str);
|
||||||
|
@ -584,7 +584,7 @@ struct plugin_api {
|
||||||
int (*sound_enum_hw_eq_band_setting)(unsigned int band,
|
int (*sound_enum_hw_eq_band_setting)(unsigned int band,
|
||||||
unsigned int band_setting);
|
unsigned int band_setting);
|
||||||
#endif /* AUDIOHW_HAVE_EQ */
|
#endif /* AUDIOHW_HAVE_EQ */
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
void (*mp3_play_data)(const unsigned char* start, int size,
|
void (*mp3_play_data)(const unsigned char* start, int size,
|
||||||
void (*get_more)(unsigned char** start, size_t* size));
|
void (*get_more)(unsigned char** start, size_t* size));
|
||||||
void (*mp3_play_pause)(bool play);
|
void (*mp3_play_pause)(bool play);
|
||||||
|
@ -593,7 +593,7 @@ struct plugin_api {
|
||||||
#if CONFIG_CODEC != SWCODEC
|
#if CONFIG_CODEC != SWCODEC
|
||||||
void (*bitswap)(unsigned char *data, int length);
|
void (*bitswap)(unsigned char *data, int length);
|
||||||
#endif
|
#endif
|
||||||
#endif /* !SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
const unsigned long *audio_master_sampr_list;
|
const unsigned long *audio_master_sampr_list;
|
||||||
const unsigned long *hw_freq_sampr;
|
const unsigned long *hw_freq_sampr;
|
||||||
|
@ -731,7 +731,7 @@ struct plugin_api {
|
||||||
int (*battery_level)(void);
|
int (*battery_level)(void);
|
||||||
bool (*battery_level_safe)(void);
|
bool (*battery_level_safe)(void);
|
||||||
int (*battery_time)(void);
|
int (*battery_time)(void);
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
unsigned int (*battery_voltage)(void);
|
unsigned int (*battery_voltage)(void);
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
|
@ -745,7 +745,7 @@ struct plugin_api {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* misc */
|
/* misc */
|
||||||
#if !defined(SIMULATOR)
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
int* __errno;
|
int* __errno;
|
||||||
#endif
|
#endif
|
||||||
void (*srand)(unsigned int seed);
|
void (*srand)(unsigned int seed);
|
||||||
|
@ -902,7 +902,7 @@ struct plugin_header {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef PLUGIN
|
#ifdef PLUGIN
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
extern unsigned char plugin_start_addr[];
|
extern unsigned char plugin_start_addr[];
|
||||||
extern unsigned char plugin_end_addr[];
|
extern unsigned char plugin_end_addr[];
|
||||||
#define PLUGIN_HEADER \
|
#define PLUGIN_HEADER \
|
||||||
|
@ -911,14 +911,14 @@ extern unsigned char plugin_end_addr[];
|
||||||
__attribute__ ((section (".header")))= { \
|
__attribute__ ((section (".header")))= { \
|
||||||
PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \
|
PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \
|
||||||
plugin_start_addr, plugin_end_addr, plugin_start, &rb };
|
plugin_start_addr, plugin_end_addr, plugin_start, &rb };
|
||||||
#else /* SIMULATOR */
|
#else /* PLATFORM_HOSTED */
|
||||||
#define PLUGIN_HEADER \
|
#define PLUGIN_HEADER \
|
||||||
const struct plugin_api *rb DATA_ATTR; \
|
const struct plugin_api *rb DATA_ATTR; \
|
||||||
const struct plugin_header __header \
|
const struct plugin_header __header \
|
||||||
__attribute__((visibility("default"))) = { \
|
__attribute__((visibility("default"))) = { \
|
||||||
PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \
|
PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \
|
||||||
NULL, NULL, plugin_start, &rb };
|
NULL, NULL, plugin_start, &rb };
|
||||||
#endif /* SIMULATOR */
|
#endif /* CONFIG_PLATFORM */
|
||||||
|
|
||||||
#ifdef PLUGIN_USE_IRAM
|
#ifdef PLUGIN_USE_IRAM
|
||||||
/* Declare IRAM variables */
|
/* Declare IRAM variables */
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
* they will grep for "YES" to see if overlay plugins must be built
|
* they will grep for "YES" to see if overlay plugins must be built
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if PLUGIN_BUFFER_SIZE <= 0x20000 && !defined(SIMULATOR)
|
#if PLUGIN_BUFFER_SIZE <= 0x20000 && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
YES
|
YES
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -65,7 +65,7 @@ iriverify.c
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef SIMULATOR /* those plugins only run on hardware */
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE) /* those plugins only run on hardware */
|
||||||
|
|
||||||
/* Overlays loaders */
|
/* Overlays loaders */
|
||||||
#if PLUGIN_BUFFER_SIZE <= 0x20000 && defined(HAVE_LCD_BITMAP)
|
#if PLUGIN_BUFFER_SIZE <= 0x20000 && defined(HAVE_LCD_BITMAP)
|
||||||
|
@ -132,7 +132,7 @@ wavplay.c
|
||||||
wavrecord.c
|
wavrecord.c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ PLUGIN_IRAM_DECLARE
|
||||||
|
|
||||||
#undef SYNC
|
#undef SYNC
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#define SYNC
|
#define SYNC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,6 @@ superdom_boarditems.160x128x1.bmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* HAVE_LCD_BITMAP */
|
#endif /* HAVE_LCD_BITMAP */
|
||||||
#if defined(SIMULATOR) && defined(__APPLE__)
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
|
||||||
osx.dummy.bmp
|
osx.dummy.bmp
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#if defined(SIMULATOR) && defined(__APPLE__)
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
|
||||||
osx.dummy.bmp
|
osx.dummy.bmp
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#if defined(SIMULATOR) && defined(__APPLE__)
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
|
||||||
osx.dummy.bmp
|
osx.dummy.bmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1185,7 +1185,7 @@ static byte chip8_keymap[16];
|
||||||
static unsigned long starttimer; /* Timer value at the beginning */
|
static unsigned long starttimer; /* Timer value at the beginning */
|
||||||
static unsigned long cycles; /* Number of update cycles (50Hz) */
|
static unsigned long cycles; /* Number of update cycles (50Hz) */
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
static bool is_playing;
|
static bool is_playing;
|
||||||
|
|
||||||
/* one frame of bitswapped mp3 data */
|
/* one frame of bitswapped mp3 data */
|
||||||
|
@ -1208,14 +1208,14 @@ static void callback(unsigned char** start, size_t* size)
|
||||||
*start = beep; /* give it the same frame again */
|
*start = beep; /* give it the same frame again */
|
||||||
*size = sizeof(beep);
|
*size = sizeof(beep);
|
||||||
}
|
}
|
||||||
#endif /* !SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/* Turn sound on */
|
/* Turn sound on */
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
static void chip8_sound_on (void)
|
static void chip8_sound_on (void)
|
||||||
{
|
{
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
if (!is_playing)
|
if (!is_playing)
|
||||||
rb->mp3_play_pause(true); /* kickoff audio */
|
rb->mp3_play_pause(true); /* kickoff audio */
|
||||||
#endif
|
#endif
|
||||||
|
@ -1226,7 +1226,7 @@ static void chip8_sound_on (void)
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
static void chip8_sound_off (void)
|
static void chip8_sound_off (void)
|
||||||
{
|
{
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
if (!is_playing)
|
if (!is_playing)
|
||||||
rb->mp3_play_pause(false); /* pause audio */
|
rb->mp3_play_pause(false); /* pause audio */
|
||||||
#endif
|
#endif
|
||||||
|
@ -1266,7 +1266,7 @@ static void chip8_update_display(void)
|
||||||
*row++ = w;
|
*row++ = w;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(SIMULATOR) || (LCD_DEPTH > 1)
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || (LCD_DEPTH > 1)
|
||||||
rb->lcd_set_drawmode(DRMODE_SOLID);
|
rb->lcd_set_drawmode(DRMODE_SOLID);
|
||||||
rb->lcd_mono_bitmap(lcd_framebuf[0], CHIP8_X, CHIP8_Y, CHIP8_LCDWIDTH,
|
rb->lcd_mono_bitmap(lcd_framebuf[0], CHIP8_X, CHIP8_Y, CHIP8_LCDWIDTH,
|
||||||
CHIP8_HEIGHT);
|
CHIP8_HEIGHT);
|
||||||
|
@ -1428,7 +1428,7 @@ static bool chip8_run(const char* file)
|
||||||
#endif
|
#endif
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
/* init sound */
|
/* init sound */
|
||||||
is_playing = rb->mp3_is_playing(); /* would we disturb playback? */
|
is_playing = rb->mp3_is_playing(); /* would we disturb playback? */
|
||||||
if (!is_playing) /* no? then we can make sound */
|
if (!is_playing) /* no? then we can make sound */
|
||||||
|
@ -1442,7 +1442,7 @@ static bool chip8_run(const char* file)
|
||||||
cycles = 0;
|
cycles = 0;
|
||||||
chip8();
|
chip8();
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
if (!is_playing)
|
if (!is_playing)
|
||||||
{ /* stop it if we used audio */
|
{ /* stop it if we used audio */
|
||||||
rb->mp3_play_stop(); /* Stop audio playback */
|
rb->mp3_play_stop(); /* Stop audio playback */
|
||||||
|
|
|
@ -62,7 +62,7 @@ int fileexists(const char * fname)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
int my_open(const char *file, int flags, ...)
|
int my_open(const char *file, int flags, ...)
|
||||||
{
|
{
|
||||||
if(fpoint==8)
|
if(fpoint==8)
|
||||||
|
@ -111,7 +111,7 @@ int my_close(int id)
|
||||||
|
|
||||||
bool noprintf=0; // Variable disables printf lcd updates to protect grayscale lib/direct lcd updates
|
bool noprintf=0; // Variable disables printf lcd updates to protect grayscale lib/direct lcd updates
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
// Here is a hacked up printf command to get the output from the game.
|
// Here is a hacked up printf command to get the output from the game.
|
||||||
int printf(const char *fmt, ...)
|
int printf(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
@ -751,7 +751,7 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
printf("There were still: %d files open\n", fpoint);
|
printf("There were still: %d files open\n", fpoint);
|
||||||
while(fpoint>0)
|
while(fpoint>0)
|
||||||
{
|
{
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
close(filearray[fpoint]);
|
close(filearray[fpoint]);
|
||||||
#else
|
#else
|
||||||
rb->close(filearray[fpoint]);
|
rb->close(filearray[fpoint]);
|
||||||
|
|
|
@ -42,7 +42,7 @@ char *my_strtok( char * s, const char * delim );
|
||||||
#undef read_line
|
#undef read_line
|
||||||
#define read_line(a,b,c) rb->read_line((a),(b),(c))
|
#define read_line(a,b,c) rb->read_line((a),(b),(c))
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
#define open(a, ...) rb->open((a), __VA_ARGS__)
|
#define open(a, ...) rb->open((a), __VA_ARGS__)
|
||||||
#define close(a) rb->close((a))
|
#define close(a) rb->close((a))
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
|
||||||
#if PLUGIN_BUFFER_SIZE < 0x10000 && !defined(SIMULATOR)
|
#if PLUGIN_BUFFER_SIZE < 0x10000 && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
|
|
||||||
#include "lib/overlay.h"
|
#include "lib/overlay.h"
|
||||||
|
|
||||||
|
|
|
@ -386,7 +386,7 @@
|
||||||
#define PLUGIN_ABORT 11
|
#define PLUGIN_ABORT 11
|
||||||
#define PLUGIN_OUTOFMEM 12
|
#define PLUGIN_OUTOFMEM 12
|
||||||
|
|
||||||
#if !defined(SIMULATOR) && defined(HAVE_DISK_STORAGE)
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && defined(HAVE_DISK_STORAGE)
|
||||||
#define DISK_SPINDOWN
|
#define DISK_SPINDOWN
|
||||||
#endif
|
#endif
|
||||||
#if PLUGIN_BUFFER_SIZE >= MIN_MEM
|
#if PLUGIN_BUFFER_SIZE >= MIN_MEM
|
||||||
|
|
|
@ -28,7 +28,7 @@ grey_sh.S
|
||||||
|
|
||||||
#endif /* HAVE_LCD_BITMAP && LCD_DEPTH < 4 */
|
#endif /* HAVE_LCD_BITMAP && LCD_DEPTH < 4 */
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
overlay.c
|
overlay.c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ pluginlib_albumart.c
|
||||||
pluginlib_touchscreen.c
|
pluginlib_touchscreen.c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
|
|
||||||
#ifdef CPU_ARM
|
#ifdef CPU_ARM
|
||||||
../../codecs/lib/setjmp_arm.S
|
../../codecs/lib/setjmp_arm.S
|
||||||
|
@ -90,4 +90,4 @@ pluginlib_touchscreen.c
|
||||||
../../codecs/lib/setjmp_mips.S
|
../../codecs/lib/setjmp_mips.S
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* !SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#define __PLUGINLIB_EXIT_H__
|
#define __PLUGINLIB_EXIT_H__
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#include "../../codecs/lib/setjmp.h"
|
#include "../../codecs/lib/setjmp.h"
|
||||||
#else
|
#else
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define _ROCKCONF_H_ /* Protect against unwanted include */
|
#define _ROCKCONF_H_ /* Protect against unwanted include */
|
||||||
#include "lua.h"
|
#include "lua.h"
|
||||||
|
|
||||||
#if !defined(SIMULATOR)
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
int errno = 0;
|
int errno = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#undef LUA_PATH_DEFAULT
|
#undef LUA_PATH_DEFAULT
|
||||||
#define LUA_PATH_DEFAULT "$/?.lua;" "$/?/init.lua;" VIEWERS_DIR"/lua/?.lua;" VIEWERS_DIR"/lua/?/init.lua;"
|
#define LUA_PATH_DEFAULT "$/?.lua;" "$/?/init.lua;" VIEWERS_DIR"/lua/?.lua;" VIEWERS_DIR"/lua/?/init.lua;"
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#include "../../codecs/lib/setjmp.h"
|
#include "../../codecs/lib/setjmp.h"
|
||||||
#else
|
#else
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#define PREFIX(_x_) sim_ ## _x_
|
#define PREFIX(_x_) sim_ ## _x_
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
improved to increase MAX_VOICES for targets that can do 22kHz */
|
improved to increase MAX_VOICES for targets that can do 22kHz */
|
||||||
#ifdef CPU_PP
|
#ifdef CPU_PP
|
||||||
#define MAX_VOICES 16
|
#define MAX_VOICES 16
|
||||||
|
#elif (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
|
#define MAX_VOICES 48
|
||||||
#else
|
#else
|
||||||
#define MAX_VOICES 24 /* Note: 24 midi channels is the minimum general midi spec implementation */
|
#define MAX_VOICES 24 /* Note: 24 midi channels is the minimum general midi spec implementation */
|
||||||
#endif /* CPU_PP */
|
#endif /* CPU_PP */
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "arcade.h"
|
#include "arcade.h"
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
|
|
||||||
#if defined(SIMULATOR) || !defined(IRIVER_H300_SERIES)
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) || !defined(IRIVER_H300_SERIES)
|
||||||
|
|
||||||
void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf)
|
void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf)
|
||||||
{
|
{
|
||||||
|
|
|
@ -403,7 +403,7 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
= rb->plugin_get_audio_buffer(&audio_buffer_free);
|
= rb->plugin_get_audio_buffer(&audio_buffer_free);
|
||||||
plugbuf=false;
|
plugbuf=false;
|
||||||
}
|
}
|
||||||
#if MEM <= 8 && !defined(SIMULATOR)
|
#if MEM <= 8 && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
/* loaded as an overlay plugin, protect from overwriting ourselves */
|
/* loaded as an overlay plugin, protect from overwriting ourselves */
|
||||||
if ((unsigned)(plugin_start_addr - (unsigned char *)audio_bufferbase)
|
if ((unsigned)(plugin_start_addr - (unsigned char *)audio_bufferbase)
|
||||||
< audio_buffer_free)
|
< audio_buffer_free)
|
||||||
|
|
|
@ -697,7 +697,7 @@ static enum plugin_status test_track(const char* filename)
|
||||||
rb->snprintf(str,sizeof(str),"%d.%02d%% realtime",(int)speed/100,(int)speed%100);
|
rb->snprintf(str,sizeof(str),"%d.%02d%% realtime",(int)speed/100,(int)speed%100);
|
||||||
log_text(str,true);
|
log_text(str,true);
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
/* show effective clockrate in MHz needed for realtime decoding */
|
/* show effective clockrate in MHz needed for realtime decoding */
|
||||||
if (speed > 0)
|
if (speed > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -114,7 +114,7 @@ static bool test_fs(void)
|
||||||
|
|
||||||
log_init();
|
log_init();
|
||||||
log_text("test_disk WRITE&VERIFY", true);
|
log_text("test_disk WRITE&VERIFY", true);
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
rb->snprintf(text_buf, sizeof(text_buf), "CPU clock: %ld Hz",
|
rb->snprintf(text_buf, sizeof(text_buf), "CPU clock: %ld Hz",
|
||||||
*rb->cpu_frequency);
|
*rb->cpu_frequency);
|
||||||
log_text(text_buf, true);
|
log_text(text_buf, true);
|
||||||
|
@ -304,7 +304,7 @@ static bool test_speed(void)
|
||||||
rb->memset(audiobuf, 'T', audiobuflen);
|
rb->memset(audiobuf, 'T', audiobuflen);
|
||||||
log_init();
|
log_init();
|
||||||
log_text("test_disk SPEED TEST", true);
|
log_text("test_disk SPEED TEST", true);
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
rb->snprintf(text_buf, sizeof(text_buf), "CPU clock: %ld Hz",
|
rb->snprintf(text_buf, sizeof(text_buf), "CPU clock: %ld Hz",
|
||||||
*rb->cpu_frequency);
|
*rb->cpu_frequency);
|
||||||
log_text(text_buf, true);
|
log_text(text_buf, true);
|
||||||
|
|
|
@ -340,7 +340,7 @@ static void time_greyscale(void)
|
||||||
/* plugin entry point */
|
/* plugin entry point */
|
||||||
enum plugin_status plugin_start(const void* parameter)
|
enum plugin_status plugin_start(const void* parameter)
|
||||||
{
|
{
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
char str[32];
|
char str[32];
|
||||||
int cpu_freq;
|
int cpu_freq;
|
||||||
#endif
|
#endif
|
||||||
|
@ -350,7 +350,7 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
(void)parameter;
|
(void)parameter;
|
||||||
|
|
||||||
log_init();
|
log_init();
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
cpu_freq = *rb->cpu_frequency; /* remember CPU frequency */
|
cpu_freq = *rb->cpu_frequency; /* remember CPU frequency */
|
||||||
#endif
|
#endif
|
||||||
backlight_force_on(); /* backlight control in lib/helper.c */
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
|
@ -370,7 +370,7 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
time_remote_update();
|
time_remote_update();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
if (*rb->cpu_frequency != cpu_freq)
|
if (*rb->cpu_frequency != cpu_freq)
|
||||||
rb->snprintf(str, sizeof(str), "CPU clock changed!");
|
rb->snprintf(str, sizeof(str), "CPU clock changed!");
|
||||||
else
|
else
|
||||||
|
|
|
@ -194,7 +194,7 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
|
|
||||||
rb->screens[0]->clear_display();
|
rb->screens[0]->clear_display();
|
||||||
rb->screens[0]->putsf(0, line++, "%s", boost?"boosted":"unboosted");
|
rb->screens[0]->putsf(0, line++, "%s", boost?"boosted":"unboosted");
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
rb->screens[0]->putsf(0, line++, "clock: %d Hz", *rb->cpu_frequency);
|
rb->screens[0]->putsf(0, line++, "clock: %d Hz", *rb->cpu_frequency);
|
||||||
#endif
|
#endif
|
||||||
rb->screens[0]->putsf(0, line++, "loop#: %d", ++count);
|
rb->screens[0]->putsf(0, line++, "loop#: %d", ++count);
|
||||||
|
|
|
@ -420,10 +420,10 @@ int radio_screen(void)
|
||||||
bool have_recorded = false;
|
bool have_recorded = false;
|
||||||
int timeout = current_tick + HZ/10;
|
int timeout = current_tick + HZ/10;
|
||||||
unsigned int last_seconds = 0;
|
unsigned int last_seconds = 0;
|
||||||
#ifndef SIMULATOR
|
#if !defined(SIMULATOR)
|
||||||
unsigned int seconds = 0;
|
unsigned int seconds = 0;
|
||||||
struct audio_recording_options rec_options;
|
struct audio_recording_options rec_options;
|
||||||
#endif
|
#endif /* SIMULATOR */
|
||||||
#endif /* CONFIG_CODEC != SWCODEC */
|
#endif /* CONFIG_CODEC != SWCODEC */
|
||||||
#ifndef HAVE_NOISY_IDLE_MODE
|
#ifndef HAVE_NOISY_IDLE_MODE
|
||||||
int button_timeout = current_tick + (2*HZ);
|
int button_timeout = current_tick + (2*HZ);
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#ifdef SIMULATOR
|
#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
|
||||||
#include <stdlib.h> /* sim uses rand for peakmeter simulation */
|
#include <stdlib.h> /* sim uses rand for peakmeter simulation */
|
||||||
#endif
|
#endif
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -538,7 +538,7 @@ void pm_reset_clipcount(void)
|
||||||
void peak_meter_playback(bool playback)
|
void peak_meter_playback(bool playback)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
(void)playback;
|
(void)playback;
|
||||||
#elif CONFIG_CODEC == SWCODEC
|
#elif CONFIG_CODEC == SWCODEC
|
||||||
pm_playback = playback;
|
pm_playback = playback;
|
||||||
|
@ -595,7 +595,7 @@ void peak_meter_peek(void)
|
||||||
left = pm_cur_left;
|
left = pm_cur_left;
|
||||||
right = pm_cur_right;
|
right = pm_cur_right;
|
||||||
#else
|
#else
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
pm_cur_left = left = mas_codec_readreg(pm_src_left);
|
pm_cur_left = left = mas_codec_readreg(pm_src_left);
|
||||||
pm_cur_right = right = mas_codec_readreg(pm_src_right);
|
pm_cur_right = right = mas_codec_readreg(pm_src_right);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -24,6 +24,7 @@ http://www.audioscrobbler.net/wiki/Portable_Player_Logging
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <config.h>
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "logf.h"
|
#include "logf.h"
|
||||||
#include "metadata.h"
|
#include "metadata.h"
|
||||||
|
@ -70,7 +71,7 @@ static unsigned long timestamp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Crude work-around for Archos Sims - return a set amount */
|
/* Crude work-around for Archos Sims - return a set amount */
|
||||||
#if (CONFIG_CODEC != SWCODEC) && defined(SIMULATOR)
|
#if (CONFIG_CODEC != SWCODEC) && (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
unsigned long audio_prev_elapsed(void)
|
unsigned long audio_prev_elapsed(void)
|
||||||
{
|
{
|
||||||
return 120000;
|
return 120000;
|
||||||
|
|
|
@ -837,7 +837,7 @@ void settings_apply(bool read_disk)
|
||||||
#ifdef HAVE_DISK_STORAGE
|
#ifdef HAVE_DISK_STORAGE
|
||||||
storage_spindown(global_settings.disk_spindown);
|
storage_spindown(global_settings.disk_spindown);
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_CODEC == MAS3507D) && !defined(SIMULATOR)
|
#if (CONFIG_CODEC == MAS3507D) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
dac_line_in(global_settings.line_in);
|
dac_line_in(global_settings.line_in);
|
||||||
#endif
|
#endif
|
||||||
set_poweroff_timeout(global_settings.poweroff);
|
set_poweroff_timeout(global_settings.poweroff);
|
||||||
|
|
|
@ -45,7 +45,7 @@ void status_set_ffmode(enum playmode mode);
|
||||||
enum playmode status_get_ffmode(void);
|
enum playmode status_get_ffmode(void);
|
||||||
int current_playmode(void);
|
int current_playmode(void);
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_CHARCELLS
|
#ifdef HAVE_LCD_CHARCELLS
|
||||||
|
|
|
@ -4442,7 +4442,7 @@ static void tagcache_thread(void)
|
||||||
case SYS_POWEROFF:
|
case SYS_POWEROFF:
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
case SYS_USB_CONNECTED:
|
case SYS_USB_CONNECTED:
|
||||||
logf("USB: TagCache");
|
logf("USB: TagCache");
|
||||||
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
||||||
|
|
|
@ -10,7 +10,7 @@ usb.c
|
||||||
logf.c
|
logf.c
|
||||||
#endif /* ROCKBOX_HAS_LOGF */
|
#endif /* ROCKBOX_HAS_LOGF */
|
||||||
kernel.c
|
kernel.c
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#ifdef RB_PROFILE
|
#ifdef RB_PROFILE
|
||||||
profile.c
|
profile.c
|
||||||
#endif /* RB_PROFILE */
|
#endif /* RB_PROFILE */
|
||||||
|
@ -19,7 +19,7 @@ rolo.c
|
||||||
#endif /* !defined(BOOTLOADER) || defined(CPU_SH) */
|
#endif /* !defined(BOOTLOADER) || defined(CPU_SH) */
|
||||||
thread.c
|
thread.c
|
||||||
timer.c
|
timer.c
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
#ifdef HAVE_SDL
|
#ifdef HAVE_SDL
|
||||||
target/hosted/sdl/button-sdl.c
|
target/hosted/sdl/button-sdl.c
|
||||||
target/hosted/sdl/kernel-sdl.c
|
target/hosted/sdl/kernel-sdl.c
|
||||||
|
@ -40,13 +40,13 @@ panic.c
|
||||||
debug.c
|
debug.c
|
||||||
|
|
||||||
/* Standard library */
|
/* Standard library */
|
||||||
#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__)
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(__MINGW32__) || defined(__CYGWIN__)
|
||||||
libc/errno.c
|
libc/errno.c
|
||||||
libc/strtok.c
|
libc/strtok.c
|
||||||
/* alsa on linux requires a more advanced sprintf, i.e. not ours */
|
/* alsa on linux requires a more advanced sprintf, i.e. not ours */
|
||||||
libc/sprintf.c
|
libc/sprintf.c
|
||||||
#endif /* !SIMULATOR || __MINGW32__ || __CYGWIN__ */
|
#endif /* PLATFORM_NATIVE || __MINGW32__ || __CYGWIN__ */
|
||||||
#if !defined(SIMULATOR)
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
libc/atoi.c
|
libc/atoi.c
|
||||||
libc/ctype.c
|
libc/ctype.c
|
||||||
libc/memcmp.c
|
libc/memcmp.c
|
||||||
|
@ -70,11 +70,11 @@ common/crc32.c
|
||||||
#ifdef MI4_FORMAT
|
#ifdef MI4_FORMAT
|
||||||
common/crc32-mi4.c
|
common/crc32-mi4.c
|
||||||
#endif
|
#endif
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
common/dir_uncached.c
|
common/dir_uncached.c
|
||||||
common/file.c
|
common/file.c
|
||||||
common/disk.c
|
common/disk.c
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
#ifdef HAVE_DIRCACHE
|
#ifdef HAVE_DIRCACHE
|
||||||
common/dircache.c
|
common/dircache.c
|
||||||
#endif /* HAVE_DIRCACHE */
|
#endif /* HAVE_DIRCACHE */
|
||||||
|
@ -143,21 +143,21 @@ backlight-sw-fading.c
|
||||||
/* Misc. */
|
/* Misc. */
|
||||||
drivers/led.c
|
drivers/led.c
|
||||||
drivers/button.c
|
drivers/button.c
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#ifdef HAVE_DAC3550A
|
#ifdef HAVE_DAC3550A
|
||||||
drivers/dac.c
|
drivers/dac.c
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SERIAL
|
#ifdef HAVE_SERIAL
|
||||||
drivers/serial.c
|
drivers/serial.c
|
||||||
#endif
|
#endif
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
drivers/touchscreen.c
|
drivers/touchscreen.c
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Storage */
|
/* Storage */
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#if (CONFIG_STORAGE & STORAGE_MMC)
|
#if (CONFIG_STORAGE & STORAGE_MMC)
|
||||||
drivers/ata_mmc.c
|
drivers/ata_mmc.c
|
||||||
#endif
|
#endif
|
||||||
|
@ -184,7 +184,7 @@ drivers/fat.c
|
||||||
#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD)
|
#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD)
|
||||||
sdmmc.c
|
sdmmc.c
|
||||||
#endif
|
#endif
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
/* EEPROM */
|
/* EEPROM */
|
||||||
#ifdef HAVE_EEPROM
|
#ifdef HAVE_EEPROM
|
||||||
|
@ -195,7 +195,7 @@ eeprom_settings.c
|
||||||
#endif /* HAVE_EEPROM */
|
#endif /* HAVE_EEPROM */
|
||||||
|
|
||||||
/* RTC */
|
/* RTC */
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#if (CONFIG_RTC == RTC_M41ST84W)
|
#if (CONFIG_RTC == RTC_M41ST84W)
|
||||||
drivers/rtc/rtc_m41st84w.c
|
drivers/rtc/rtc_m41st84w.c
|
||||||
#elif (CONFIG_RTC == RTC_PCF50606)
|
#elif (CONFIG_RTC == RTC_PCF50606)
|
||||||
|
@ -225,13 +225,13 @@ drivers/rtc/rtc_s35390a.c
|
||||||
#elif (CONFIG_RTC == RTC_D2)
|
#elif (CONFIG_RTC == RTC_D2)
|
||||||
drivers/rtc/rtc_d2.c
|
drivers/rtc/rtc_d2.c
|
||||||
#endif /* (CONFIG_RTC == RTC_) */
|
#endif /* (CONFIG_RTC == RTC_) */
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
#ifndef BOOTLOADER
|
#ifndef BOOTLOADER
|
||||||
/* Tuner */
|
/* Tuner */
|
||||||
#if CONFIG_TUNER
|
#if CONFIG_TUNER
|
||||||
tuner.c
|
tuner.c
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#if (CONFIG_TUNER & LV24020LP)
|
#if (CONFIG_TUNER & LV24020LP)
|
||||||
drivers/tuner/lv24020lp.c
|
drivers/tuner/lv24020lp.c
|
||||||
#endif /* (CONFIG_TUNER & LV24020LP) */
|
#endif /* (CONFIG_TUNER & LV24020LP) */
|
||||||
|
@ -254,7 +254,7 @@ drivers/tuner/ipod_remote_tuner.c
|
||||||
#if (CONFIG_TUNER & RDA5802)
|
#if (CONFIG_TUNER & RDA5802)
|
||||||
drivers/tuner/rda5802.c
|
drivers/tuner/rda5802.c
|
||||||
#endif /* (CONFIG_TUNER & RDA5802) */
|
#endif /* (CONFIG_TUNER & RDA5802) */
|
||||||
#endif /*SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
#endif /* CONFIG_TUNER */
|
#endif /* CONFIG_TUNER */
|
||||||
#endif /* BOOTLOADER */
|
#endif /* BOOTLOADER */
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ drivers/mas.c
|
||||||
#endif /* SWCODEC */
|
#endif /* SWCODEC */
|
||||||
|
|
||||||
/* Audio codec */
|
/* Audio codec */
|
||||||
#if !defined(SIMULATOR) && !defined(BOOTLOADER)
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER)
|
||||||
#if defined(HAVE_UDA1380)
|
#if defined(HAVE_UDA1380)
|
||||||
drivers/audio/uda1380.c
|
drivers/audio/uda1380.c
|
||||||
#elif defined(HAVE_WM8751) \
|
#elif defined(HAVE_WM8751) \
|
||||||
|
@ -319,7 +319,7 @@ drivers/audio/sdl.c
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
target/hosted/sdl/pcm-sdl.c
|
target/hosted/sdl/pcm-sdl.c
|
||||||
#endif
|
#endif
|
||||||
#endif /* !defined(SIMULATOR) && !defined(BOOTLOADER) */
|
#endif /* (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER) */
|
||||||
|
|
||||||
/* USB Stack */
|
/* USB Stack */
|
||||||
#if !defined(SIMULATOR)
|
#if !defined(SIMULATOR)
|
||||||
|
@ -531,10 +531,10 @@ libc/memmove.c
|
||||||
libc/memset.c
|
libc/memset.c
|
||||||
common/memset16.c
|
common/memset16.c
|
||||||
libc/strlen.c
|
libc/strlen.c
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
crt0.S
|
crt0.S
|
||||||
drivers/i2c.c
|
drivers/i2c.c
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
#endif /* defined(CPU_*) */
|
#endif /* defined(CPU_*) */
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,9 @@
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
#include "lcd-remote.h"
|
#include "lcd-remote.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_BACKLIGHT) && defined(BACKLIGHT_FULL_INIT)
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#ifndef SIMULATOR
|
||||||
#include "backlight-target.h"
|
#include "backlight-target.h"
|
||||||
#else
|
#else
|
||||||
|
@ -51,8 +54,6 @@
|
||||||
#include "backlight-sw-fading.h"
|
#include "backlight-sw-fading.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_BACKLIGHT) && defined(BACKLIGHT_FULL_INIT)
|
|
||||||
|
|
||||||
#define BACKLIGHT_FADE_IN_THREAD \
|
#define BACKLIGHT_FADE_IN_THREAD \
|
||||||
(CONFIG_BACKLIGHT_FADING & (BACKLIGHT_FADING_SW_SETTING \
|
(CONFIG_BACKLIGHT_FADING & (BACKLIGHT_FADING_SW_SETTING \
|
||||||
|BACKLIGHT_FADING_SW_HW_REG \
|
|BACKLIGHT_FADING_SW_HW_REG \
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
unsigned char audiobuffer[(MEM*1024-256)*1024];
|
unsigned char audiobuffer[(MEM*1024-256)*1024];
|
||||||
unsigned char *audiobufend = audiobuffer + sizeof(audiobuffer);
|
unsigned char *audiobufend = audiobuffer + sizeof(audiobuffer);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -171,7 +171,7 @@ static bool check_event_queue(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
/* scan and build static data (avoid redundancy on stack) */
|
/* scan and build static data (avoid redundancy on stack) */
|
||||||
static struct
|
static struct
|
||||||
{
|
{
|
||||||
|
@ -301,7 +301,7 @@ static int dircache_scan_and_build(IF_MV2(int volume,) struct dircache_entry *ce
|
||||||
|
|
||||||
return sab_process_dir(0, ce);
|
return sab_process_dir(0, ce);
|
||||||
}
|
}
|
||||||
#else /* !SIMULATOR */
|
#elif (CONFIG_PLATFORM & PLATFORM_HOSTED) /* PLATFORM_HOSTED */
|
||||||
static char sab_path[MAX_PATH];
|
static char sab_path[MAX_PATH];
|
||||||
|
|
||||||
static int sab_process_dir(struct dircache_entry *ce)
|
static int sab_process_dir(struct dircache_entry *ce)
|
||||||
|
@ -400,7 +400,7 @@ static int dircache_scan_and_build(IF_MV2(int volume,) struct dircache_entry *ce
|
||||||
strlcpy(sab_path, "/", sizeof sab_path);
|
strlcpy(sab_path, "/", sizeof sab_path);
|
||||||
return sab_process_dir(ce);
|
return sab_process_dir(ce);
|
||||||
}
|
}
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal function to get a pointer to dircache_entry for a given filename.
|
* Internal function to get a pointer to dircache_entry for a given filename.
|
||||||
|
@ -689,7 +689,7 @@ static void dircache_thread(void)
|
||||||
dircache_initialized = false;
|
dircache_initialized = false;
|
||||||
break ;
|
break ;
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
case SYS_USB_CONNECTED:
|
case SYS_USB_CONNECTED:
|
||||||
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
||||||
usb_wait_for_disconnect(&dircache_queue);
|
usb_wait_for_disconnect(&dircache_queue);
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
#include "powermgmt.h"
|
#include "powermgmt.h"
|
||||||
#ifdef SIMULATOR
|
#ifdef HAVE_SDL
|
||||||
#include "button-sdl.h"
|
#include "button-sdl.h"
|
||||||
#else
|
#else
|
||||||
#include "button-target.h"
|
#include "button-target.h"
|
||||||
|
@ -215,7 +215,7 @@ static void button_tick(void)
|
||||||
|
|
||||||
/* Safety net for players without hardware
|
/* Safety net for players without hardware
|
||||||
poweroff */
|
poweroff */
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
if(repeat_count > POWEROFF_COUNT * 10)
|
if(repeat_count > POWEROFF_COUNT * 10)
|
||||||
power_off();
|
power_off();
|
||||||
#endif
|
#endif
|
||||||
|
@ -440,7 +440,7 @@ static int button_flip(int button)
|
||||||
{
|
{
|
||||||
int newbutton = button;
|
int newbutton = button;
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
newbutton &=
|
newbutton &=
|
||||||
~(BUTTON_LEFT | BUTTON_RIGHT
|
~(BUTTON_LEFT | BUTTON_RIGHT
|
||||||
#if defined(BUTTON_UP) && defined(BUTTON_DOWN)
|
#if defined(BUTTON_UP) && defined(BUTTON_DOWN)
|
||||||
|
|
|
@ -43,7 +43,7 @@ enum {
|
||||||
DISK_EVENT_SPINUP = (EVENT_CLASS_DISK|1),
|
DISK_EVENT_SPINUP = (EVENT_CLASS_DISK|1),
|
||||||
};
|
};
|
||||||
|
|
||||||
#define USING_STORAGE_CALLBACK !defined(SIMULATOR) \
|
#define USING_STORAGE_CALLBACK (CONFIG_PLATFORM & PLATFORM_NATIVE) \
|
||||||
&& ! ((CONFIG_STORAGE & STORAGE_NAND) \
|
&& ! ((CONFIG_STORAGE & STORAGE_NAND) \
|
||||||
&& (CONFIG_NAND == NAND_IFP7XX)) \
|
&& (CONFIG_NAND == NAND_IFP7XX)) \
|
||||||
&& !defined(BOOTLOADER)
|
&& !defined(BOOTLOADER)
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#endif /* CONFIG_CODEC == SWCODEC */
|
#endif /* CONFIG_CODEC == SWCODEC */
|
||||||
|
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
#define audio_play(x) sim_audio_play(x)
|
#define audio_play(x) sim_audio_play(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
/* defined in linker script */
|
/* defined in linker script */
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
extern unsigned char *audiobufend;
|
|
||||||
#else
|
|
||||||
extern unsigned char audiobufend[];
|
extern unsigned char audiobufend[];
|
||||||
|
#else
|
||||||
|
extern unsigned char *audiobufend;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern unsigned char *audiobuf;
|
extern unsigned char *audiobuf;
|
||||||
|
|
|
@ -74,6 +74,13 @@
|
||||||
#define AT91SAM9260 9260
|
#define AT91SAM9260 9260
|
||||||
#define AS3525v2 35252
|
#define AS3525v2 35252
|
||||||
|
|
||||||
|
/* platforms
|
||||||
|
* bit fields to allow PLATFORM_HOSTED to be OR'ed e.g. with a
|
||||||
|
* possible future PLATFORM_ANDROID (some OSes might need totally different
|
||||||
|
* handling to run on them than a stand-alone application) */
|
||||||
|
#define PLATFORM_NATIVE (1<<0)
|
||||||
|
#define PLATFORM_HOSTED (1<<1)
|
||||||
|
|
||||||
/* CONFIG_KEYPAD */
|
/* CONFIG_KEYPAD */
|
||||||
#define PLAYER_PAD 1
|
#define PLAYER_PAD 1
|
||||||
#define RECORDER_PAD 2
|
#define RECORDER_PAD 2
|
||||||
|
@ -497,6 +504,10 @@ Lyre prototype 1 */
|
||||||
#define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
|
#define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_PLATFORM
|
||||||
|
#define CONFIG_PLATFORM PLATFORM_NATIVE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_TUNER
|
#ifndef CONFIG_TUNER
|
||||||
#define CONFIG_TUNER 0
|
#define CONFIG_TUNER 0
|
||||||
#endif
|
#endif
|
||||||
|
@ -675,10 +686,10 @@ Lyre prototype 1 */
|
||||||
#define HAVE_EXTENDED_MESSAGING_AND_NAME
|
#define HAVE_EXTENDED_MESSAGING_AND_NAME
|
||||||
#define HAVE_WAKEUP_EXT_CB
|
#define HAVE_WAKEUP_EXT_CB
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#define HAVE_PRIORITY_SCHEDULING
|
#define HAVE_PRIORITY_SCHEDULING
|
||||||
#define HAVE_SCHEDULER_BOOSTCTRL
|
#define HAVE_SCHEDULER_BOOSTCTRL
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
#define HAVE_SEMAPHORE_OBJECTS
|
#define HAVE_SEMAPHORE_OBJECTS
|
||||||
|
|
||||||
|
@ -744,7 +755,7 @@ Lyre prototype 1 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* IRAM usage */
|
/* IRAM usage */
|
||||||
#if !defined(SIMULATOR) && /* Not for simulators */ \
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && /* Not for hosted environments */ \
|
||||||
(((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
|
(((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
|
||||||
defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
|
defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
|
||||||
defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
|
defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
|
||||||
|
@ -780,9 +791,10 @@ Lyre prototype 1 */
|
||||||
#define IBSS_ATTR
|
#define IBSS_ATTR
|
||||||
#define STATICIRAM static
|
#define STATICIRAM static
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) || \
|
#if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) || \
|
||||||
(CONFIG_CPU == IMX31L)) \
|
(CONFIG_CPU == IMX31L)) \
|
||||||
&& !defined(SIMULATOR) && !defined(BOOTLOADER)
|
&& (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER)
|
||||||
/* Functions that have INIT_ATTR attached are NOT guaranteed to survive after
|
/* Functions that have INIT_ATTR attached are NOT guaranteed to survive after
|
||||||
* root_menu() has been called. Their code may be overwritten by other data or
|
* root_menu() has been called. Their code may be overwritten by other data or
|
||||||
* code in order to save RAM, and references to them might point into
|
* code in order to save RAM, and references to them might point into
|
||||||
|
@ -799,7 +811,7 @@ Lyre prototype 1 */
|
||||||
#define INIT_ATTR
|
#define INIT_ATTR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SIMULATOR) && defined(__APPLE__)
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
|
||||||
#define DATA_ATTR __attribute__ ((section("__DATA, .data")))
|
#define DATA_ATTR __attribute__ ((section("__DATA, .data")))
|
||||||
#else
|
#else
|
||||||
#define DATA_ATTR __attribute__ ((section(".data")))
|
#define DATA_ATTR __attribute__ ((section(".data")))
|
||||||
|
@ -923,7 +935,7 @@ Lyre prototype 1 */
|
||||||
|
|
||||||
#else /* BOOTLOADER */
|
#else /* BOOTLOADER */
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
//#define USB_ENABLE_SERIAL
|
//#define USB_ENABLE_SERIAL
|
||||||
#define USB_ENABLE_STORAGE
|
#define USB_ENABLE_STORAGE
|
||||||
|
|
||||||
|
@ -941,11 +953,11 @@ Lyre prototype 1 */
|
||||||
/* This attribute can be used to enable to detection of plugin file handles leaks.
|
/* This attribute can be used to enable to detection of plugin file handles leaks.
|
||||||
* When enabled, the plugin core will monitor open/close/creat and when the plugin exits
|
* When enabled, the plugin core will monitor open/close/creat and when the plugin exits
|
||||||
* will display an error message if the plugin leaked some file handles */
|
* will display an error message if the plugin leaked some file handles */
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#define HAVE_PLUGIN_CHECK_OPEN_CLOSE
|
#define HAVE_PLUGIN_CHECK_OPEN_CLOSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_DIRCACHE) && !defined(SIMULATOR)
|
#if defined(HAVE_DIRCACHE) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#define HAVE_IO_PRIORITY
|
#define HAVE_IO_PRIORITY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -101,4 +101,5 @@
|
||||||
|
|
||||||
#define HAVE_SDL
|
#define HAVE_SDL
|
||||||
#define HAVE_SDL_AUDIO
|
#define HAVE_SDL_AUDIO
|
||||||
|
#define CONFIG_PLATFORM PLATFORM_HOSTED
|
||||||
#define _ISOC99_SOURCE 1
|
#define _ISOC99_SOURCE 1
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
*/
|
*/
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
|
#if defined(HAVE_LCD_BITMAP) || (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
#ifndef __PCTOOL__
|
#ifndef __PCTOOL__
|
||||||
#include "font_cache.h"
|
#include "font_cache.h"
|
||||||
#include "sysfont.h"
|
#include "sysfont.h"
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#if (CONFIG_CPU == SH7034) && !defined(SIMULATOR)
|
#if (CONFIG_CPU == SH7034) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
|
|
||||||
#define ROM_VERSION (*(short *)0x020000fe)
|
#define ROM_VERSION (*(short *)0x020000fe)
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ static inline int tuner_detect_type(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* (CONFIG_CPU == SH7034) && !SIMULATOR */
|
#endif /* (CONFIG_CPU == SH7034) && (CONFIG_PLATFORM & PLATFORM_NATIVE) */
|
||||||
|
|
||||||
#ifdef ARCHOS_PLAYER
|
#ifdef ARCHOS_PLAYER
|
||||||
bool is_new_player(void);
|
bool is_new_player(void);
|
||||||
|
|
|
@ -201,7 +201,7 @@ static inline void call_tick_tasks(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SIMULATOR) && !defined(PLUGIN) && !defined(CODEC)
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && !defined(PLUGIN) && !defined(CODEC)
|
||||||
#define sleep(x) sim_sleep(x)
|
#define sleep(x) sim_sleep(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ void ide_power_enable(bool on);
|
||||||
bool charging_state(void);
|
bool charging_state(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
|
|
||||||
void power_init(void) INIT_ATTR;
|
void power_init(void) INIT_ATTR;
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ extern unsigned int power_thread_inputs;
|
||||||
#include "powermgmt-target.h"
|
#include "powermgmt-target.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
|
|
||||||
/* Generic current values that are intentionally meaningless - config header
|
/* Generic current values that are intentionally meaningless - config header
|
||||||
* should define proper numbers.*/
|
* should define proper numbers.*/
|
||||||
|
@ -129,7 +129,7 @@ extern const unsigned short percent_to_volt_charge[11];
|
||||||
/* Start up power management thread */
|
/* Start up power management thread */
|
||||||
void powermgmt_init(void) INIT_ATTR;
|
void powermgmt_init(void) INIT_ATTR;
|
||||||
|
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
/* Returns battery statust */
|
/* Returns battery statust */
|
||||||
int battery_level(void); /* percent */
|
int battery_level(void); /* percent */
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct storage_info
|
||||||
char *revision;
|
char *revision;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined(SIMULATOR) && !defined(CONFIG_STORAGE_MULTI)
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(CONFIG_STORAGE_MULTI)
|
||||||
/* storage_spindown, storage_sleep and storage_spin are passed as
|
/* storage_spindown, storage_sleep and storage_spin are passed as
|
||||||
* pointers, which doesn't work with argument-macros.
|
* pointers, which doesn't work with argument-macros.
|
||||||
*/
|
*/
|
||||||
|
@ -185,7 +185,7 @@ struct storage_info
|
||||||
#else
|
#else
|
||||||
//#error No storage driver!
|
//#error No storage driver!
|
||||||
#endif
|
#endif
|
||||||
#else /* NOT CONFIG_STORAGE_MULTI and NOT SIMULATOR*/
|
#else /* NOT CONFIG_STORAGE_MULTI and PLATFORM_NATIVE*/
|
||||||
|
|
||||||
/* Simulator and multi-driver use normal functions */
|
/* Simulator and multi-driver use normal functions */
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ int get_cpu_boost_counter(void);
|
||||||
|
|
||||||
|
|
||||||
/* newer? SDL includes endian.h, So we ignore it */
|
/* newer? SDL includes endian.h, So we ignore it */
|
||||||
#if defined(SIMULATOR) || defined(__PCTOOL__)
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) || defined(__PCTOOL__)
|
||||||
#undef letoh16
|
#undef letoh16
|
||||||
#undef letoh32
|
#undef letoh32
|
||||||
#undef htole16
|
#undef htole16
|
||||||
|
@ -234,8 +234,11 @@ enum {
|
||||||
|
|
||||||
#if !defined(SIMULATOR) && !defined(__PCTOOL__)
|
#if !defined(SIMULATOR) && !defined(__PCTOOL__)
|
||||||
#include "system-target.h"
|
#include "system-target.h"
|
||||||
#elif defined(HAVE_SDL) /* SIMULATOR */
|
#elif defined(HAVE_SDL) /* SDL build */
|
||||||
#include "system-sdl.h"
|
#include "system-sdl.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
static inline uint16_t swap16(uint16_t value)
|
static inline uint16_t swap16(uint16_t value)
|
||||||
/*
|
/*
|
||||||
result[15..8] = value[ 7..0];
|
result[15..8] = value[ 7..0];
|
||||||
|
@ -268,7 +271,7 @@ static inline uint32_t swap_odd_even32(uint32_t value)
|
||||||
return (t >> 8) | ((t ^ value) << 8);
|
return (t >> 8) | ((t ^ value) << 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !SIMULATOR */
|
#endif /* PLATFORM_HOSTED */
|
||||||
|
|
||||||
#ifndef BIT_N
|
#ifndef BIT_N
|
||||||
#define BIT_N(n) (1U << (n))
|
#define BIT_N(n) (1U << (n))
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
|
|
||||||
#define DEFAULT_STACK_SIZE 0x400 /* Bytes */
|
#define DEFAULT_STACK_SIZE 0x400 /* Bytes */
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
/* Need to keep structures inside the header file because debug_menu
|
/* Need to keep structures inside the header file because debug_menu
|
||||||
* needs them. */
|
* needs them. */
|
||||||
#ifdef CPU_COLDFIRE
|
#ifdef CPU_COLDFIRE
|
||||||
|
@ -135,15 +135,15 @@ struct regs
|
||||||
uint32_t start; /* 44 - Thread start address, or NULL when started */
|
uint32_t start; /* 44 - Thread start address, or NULL when started */
|
||||||
};
|
};
|
||||||
#endif /* CONFIG_CPU */
|
#endif /* CONFIG_CPU */
|
||||||
#else
|
#elif (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
struct regs
|
struct regs
|
||||||
{
|
{
|
||||||
void *t; /* Simulator OS thread */
|
void *t; /* OS thread */
|
||||||
void *told; /* Last thread in slot (explained in thead-sdl.c) */
|
void *told; /* Last thread in slot (explained in thead-sdl.c) */
|
||||||
void *s; /* Semaphore for blocking and wakeup */
|
void *s; /* Semaphore for blocking and wakeup */
|
||||||
void (*start)(void); /* Start function */
|
void (*start)(void); /* Start function */
|
||||||
};
|
};
|
||||||
#endif /* !SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
/* NOTE: The use of the word "queue" may also refer to a linked list of
|
/* NOTE: The use of the word "queue" may also refer to a linked list of
|
||||||
threads being maintained that are normally dealt with in FIFO order
|
threads being maintained that are normally dealt with in FIFO order
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
#if defined(SIMULATOR)
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
#define TIMER_FREQ 1000000
|
#define TIMER_FREQ 1000000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ extern const struct fm_region_data fm_region_data[TUNER_NUM_REGIONS];
|
||||||
|
|
||||||
#if CONFIG_TUNER
|
#if CONFIG_TUNER
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
int tuner_set(int setting, int value);
|
int tuner_set(int setting, int value);
|
||||||
int tuner_get(int setting);
|
int tuner_get(int setting);
|
||||||
#ifdef HAVE_RDS_CAP
|
#ifdef HAVE_RDS_CAP
|
||||||
|
@ -142,7 +142,7 @@ extern int (*tuner_get)(int setting);
|
||||||
#include "ipod_remote_tuner.h"
|
#include "ipod_remote_tuner.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_HOSTED */
|
||||||
|
|
||||||
/* Additional messages that get enumerated after tuner driver headers */
|
/* Additional messages that get enumerated after tuner driver headers */
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
/* check whether a function is inside the valid memory location */
|
/* check whether a function is inside the valid memory location */
|
||||||
#define IS_FUNCPTR(fp) ({/
|
#define IS_FUNCPTR(fp) ({/
|
||||||
extern char _text[];/
|
extern char _text[];/
|
||||||
|
@ -21,4 +21,4 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef __DBGCHECK_H__
|
#endif // #ifndef __DBGCHECK_H__
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define ATTR_ARCHIVE 0x20
|
#define ATTR_ARCHIVE 0x20
|
||||||
#define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */
|
#define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
#define dirent_uncached sim_dirent
|
#define dirent_uncached sim_dirent
|
||||||
#define DIR_UNCACHED SIM_DIR
|
#define DIR_UNCACHED SIM_DIR
|
||||||
#define opendir_uncached sim_opendir
|
#define opendir_uncached sim_opendir
|
||||||
|
@ -57,7 +57,7 @@ struct dirent_uncached {
|
||||||
#include "fat.h"
|
#include "fat.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
bool busy;
|
bool busy;
|
||||||
long startcluster;
|
long startcluster;
|
||||||
struct fat_dir fatdir;
|
struct fat_dir fatdir;
|
||||||
|
@ -66,7 +66,7 @@ typedef struct {
|
||||||
int volumecounter; /* running counter for faked volume entries */
|
int volumecounter; /* running counter for faked volume entries */
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
/* simulator: */
|
/* simulator/application: */
|
||||||
void *dir; /* actually a DIR* dir */
|
void *dir; /* actually a DIR* dir */
|
||||||
char *name;
|
char *name;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -36,7 +36,7 @@ struct travel_data {
|
||||||
struct dircache_entry *first;
|
struct dircache_entry *first;
|
||||||
struct dircache_entry *ce;
|
struct dircache_entry *ce;
|
||||||
struct dircache_entry *down_entry;
|
struct dircache_entry *down_entry;
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
DIR_UNCACHED *dir, *newdir;
|
DIR_UNCACHED *dir, *newdir;
|
||||||
struct dirent_uncached *entry;
|
struct dirent_uncached *entry;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#define MAX_PATH 260
|
#define MAX_PATH 260
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include "config.h"
|
||||||
#include "_ansi.h"
|
#include "_ansi.h"
|
||||||
|
|
||||||
#define MAX_OPEN_FILES 11
|
#define MAX_OPEN_FILES 11
|
||||||
|
@ -49,7 +50,7 @@
|
||||||
#define O_TRUNC 0x10
|
#define O_TRUNC 0x10
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SIMULATOR) && !defined(PLUGIN) && !defined(CODEC)
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && !defined(PLUGIN) && !defined(CODEC)
|
||||||
#define open(x, ...) sim_open(x, __VA_ARGS__)
|
#define open(x, ...) sim_open(x, __VA_ARGS__)
|
||||||
#define creat(x,m) sim_creat(x,m)
|
#define creat(x,m) sim_creat(x,m)
|
||||||
#define remove(x) sim_remove(x)
|
#define remove(x) sim_remove(x)
|
||||||
|
@ -78,7 +79,7 @@ extern int fsync(int fd);
|
||||||
extern ssize_t read(int fd, void *buf, size_t count);
|
extern ssize_t read(int fd, void *buf, size_t count);
|
||||||
extern off_t lseek(int fildes, off_t offset, int whence);
|
extern off_t lseek(int fildes, off_t offset, int whence);
|
||||||
extern int file_creat(const char *pathname);
|
extern int file_creat(const char *pathname);
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
/* posix compatibility function */
|
/* posix compatibility function */
|
||||||
static inline int creat(const char *pathname, mode_t mode)
|
static inline int creat(const char *pathname, mode_t mode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -208,7 +208,7 @@ void _logf(const char *fmt, ...)
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
vsnprintf(buf, sizeof buf, fmt, ap);
|
vsnprintf(buf, sizeof buf, fmt, ap);
|
||||||
DEBUGF("%s\n", buf);
|
DEBUGF("%s\n", buf);
|
||||||
|
|
|
@ -41,7 +41,7 @@ void panicf( const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
/* Disable interrupts */
|
/* Disable interrupts */
|
||||||
#ifdef CPU_ARM
|
#ifdef CPU_ARM
|
||||||
disable_interrupt(IRQ_FIQ_STATUS);
|
disable_interrupt(IRQ_FIQ_STATUS);
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include "logf.h"
|
#include "logf.h"
|
||||||
#include "lcd-remote.h"
|
#include "lcd-remote.h"
|
||||||
#ifdef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ enum charge_state_type charge_state = DISCHARGING;
|
||||||
#endif
|
#endif
|
||||||
#endif /* CONFIG_CHARGING */
|
#endif /* CONFIG_CHARGING */
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
static int shutdown_timeout = 0;
|
static int shutdown_timeout = 0;
|
||||||
/*
|
/*
|
||||||
* Average battery voltage and charger voltage, filtered via a digital
|
* Average battery voltage and charger voltage, filtered via a digital
|
||||||
|
@ -830,7 +830,7 @@ void cancel_shutdown(void)
|
||||||
|
|
||||||
shutdown_timeout = 0;
|
shutdown_timeout = 0;
|
||||||
}
|
}
|
||||||
#endif /* SIMULATOR */
|
#endif /* PLATFORM_NATIVE */
|
||||||
|
|
||||||
/* Send system battery level update events on reaching certain significant
|
/* Send system battery level update events on reaching certain significant
|
||||||
levels. This must be called after battery_percent has been updated. */
|
levels. This must be called after battery_percent has been updated. */
|
||||||
|
|
|
@ -242,7 +242,7 @@ static bool scroll_process_message(int delay)
|
||||||
usb_wait_for_disconnect(&scroll_queue);
|
usb_wait_for_disconnect(&scroll_queue);
|
||||||
sync_display_ticks();
|
sync_display_ticks();
|
||||||
return true;
|
return true;
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
case SYS_REMOTE_PLUGGED:
|
case SYS_REMOTE_PLUGGED:
|
||||||
if (!remote_initialized)
|
if (!remote_initialized)
|
||||||
sync_display_ticks();
|
sync_display_ticks();
|
||||||
|
@ -280,7 +280,7 @@ static void scroll_thread(void)
|
||||||
delay = current_tick;
|
delay = current_tick;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
!remote_initialized ||
|
!remote_initialized ||
|
||||||
#endif
|
#endif
|
||||||
(tick_remote = lcd_remote_scroll_info.last_scroll +
|
(tick_remote = lcd_remote_scroll_info.last_scroll +
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
#include "mas.h"
|
#include "mas.h"
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
#if CONFIG_CPU == PNX0101
|
#if CONFIG_CPU == PNX0101
|
||||||
#include "pnx0101.h"
|
#include "pnx0101.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -257,7 +257,7 @@ static void set_prescaled_volume(void)
|
||||||
dsp_callback(DSP_CALLBACK_SET_SW_VOLUME, 0);
|
dsp_callback(DSP_CALLBACK_SET_SW_VOLUME, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#ifndef HAVE_SDL_AUDIO
|
||||||
#if CONFIG_CODEC == MAS3507D
|
#if CONFIG_CODEC == MAS3507D
|
||||||
dac_volume(tenthdb2reg(l), tenthdb2reg(r), false);
|
dac_volume(tenthdb2reg(l), tenthdb2reg(r), false);
|
||||||
#elif defined(HAVE_UDA1380) || defined(HAVE_WM8975) || defined(HAVE_WM8758) \
|
#elif defined(HAVE_UDA1380) || defined(HAVE_WM8975) || defined(HAVE_WM8758) \
|
||||||
|
@ -276,9 +276,9 @@ static void set_prescaled_volume(void)
|
||||||
#elif defined(HAVE_JZ4740_CODEC) || defined(HAVE_SDL_AUDIO)
|
#elif defined(HAVE_JZ4740_CODEC) || defined(HAVE_SDL_AUDIO)
|
||||||
audiohw_set_volume(current_volume);
|
audiohw_set_volume(current_volume);
|
||||||
#endif
|
#endif
|
||||||
#else /* SIMULATOR */
|
#else /* HAVE_SDL_AUDIO */
|
||||||
audiohw_set_volume(current_volume);
|
audiohw_set_volume(current_volume);
|
||||||
#endif /* !SIMULATOR */
|
#endif /* !HAVE_SDL_AUDIO */
|
||||||
}
|
}
|
||||||
#endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */
|
#endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */
|
||||||
|
|
||||||
|
@ -714,7 +714,7 @@ void sound_set(int setting, int value)
|
||||||
&& !defined(HAVE_WM8758) && !defined(HAVE_TSC2100) \
|
&& !defined(HAVE_WM8758) && !defined(HAVE_TSC2100) \
|
||||||
&& !defined (HAVE_WM8711) && !defined (HAVE_WM8721) \
|
&& !defined (HAVE_WM8711) && !defined (HAVE_WM8721) \
|
||||||
&& !defined (HAVE_WM8731) && !defined (HAVE_WM8978) \
|
&& !defined (HAVE_WM8731) && !defined (HAVE_WM8978) \
|
||||||
&& !defined(HAVE_AK4537)) || defined(SIMULATOR)
|
&& !defined(HAVE_AK4537)) || (CONFIG_PLATFORM & PLATFORM_HOSTED)
|
||||||
int sound_val2phys(int setting, int value)
|
int sound_val2phys(int setting, int value)
|
||||||
{
|
{
|
||||||
#if CONFIG_CODEC == MAS3587F
|
#if CONFIG_CODEC == MAS3587F
|
||||||
|
@ -820,7 +820,7 @@ int sound_val2phys(int setting, int value)
|
||||||
return value;
|
return value;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* !defined(HAVE_AS3514) || defined(SIMULATOR) */
|
#endif /* CONFIG_CODECs || PLATFORM_HOSTED */
|
||||||
|
|
||||||
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
|
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
|
||||||
/* This function works by telling the decoder that we have another
|
/* This function works by telling the decoder that we have another
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
|
||||||
long cpu_frequency SHAREDBSS_ATTR = CPU_FREQ;
|
long cpu_frequency SHAREDBSS_ATTR = CPU_FREQ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue