Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Simulator dummy functions

Re: Simulator dummy functions

From: Stéphane Doyon <s.doyon_at_videotron.ca>
Date: Tue, 16 Oct 2007 13:38:03 -0400 (EDT)

On Mon, 15 Oct 2007, pondlife wrote:

> Hi Stéphane,
>
> Ideally, the same code *should* be compiled in (and run) on the sim.
> Obviously this doesn't apply to some low-level code (e.g. FAT support,
> hardware access), but I would think talk.c shouldn't need to be split.
>
> What function were you thinking of?

On Mon, 15 Oct 2007, Nils wrote:

> talk.c is not built for hwcodec sims as they don't have playback at all, it
> is however built and works in swcodec sims.

Right, I should have specified HWCODEC sim.
talk.h has this:

/* We don't build talk.c for hwcodec sims so we need to define these as
empty */
#if defined(SIMULATOR) && !(CONFIG_CODEC == SWCODEC)
#define talk_force_enqueue_next(...)
#define talk_idarray(...)
#define talk_ids(...)
#define cond_talk_ids(...)
#define cond_talk_ids_fq(...)
#define shutup(...)

... so those are grouped. In talk.h there's also:
#if CONFIG_RTC
/* this is in talk.c which isnt compiled for hwcodec simulator */
#if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC
void talk_date_time(struct tm *time, bool speak_current_time_string);
#else
#define talk_date_time(t, s)
#endif
#endif /* CONFIG_RTC */

and then in uisimulator/common/stubs.c we have:

#if CONFIG_CODEC != SWCODEC
void talk_init(void)
{
}

int talk_buffer_steal(void)
{
     return 0;
}

int talk_id(int id, bool enqueue)
{
     (void)id;
     (void)enqueue;
     return 0;
}

int talk_file(char* filename, bool enqueue)
{
     (void)filename;
     (void)enqueue;
     return 0;
}

... and so on.

I'll eventually need to add functions and I might want to cleanup some
things in there, so I thought I should ask where I should put my dummy
stubs for the HWCODEC sim, and I should probably straighten things up so
they're all in the same place.

-- 
Stéphane Doyon
<s.doyon_at_videotron.ca>
http://pages.videotron.com/sdoyon/
Received on 2007-10-16

Page was last modified "Jan 10 2012" The Rockbox Crew
aaa