Well, maybe I'm not Neoblast... but I can try to compile DMC with SD support

Also, I want to comment a few things to improve the compilation:
- inttypes.h should be not redeclared in the compilation (GCC4 complains about that). One easy fix is to add an #ifdef
Code:
#ifndef HAVE_INTTYPES_H
#define HAVE_INTTYPES_H
(blabla...)
#endif
- I saw that you are using an old version of KOS, so the thd_create functions need to be corrected with the deatach argument.
Files that affect: wave_core.c, mp4dec.c, flac_dec.c, a52dec.c, mpg123_snddrv.c, ogg_spu.c, fifo.c, snddrv.c
- Next, you are using old and deprecated functions of KOS Maple (src/music_list.c).
In check_controller(), use the next code that uses last Maple functions:
Code:
void check_controller() {
static int up_moved = 0, down_moved = 0, a_pressed = 0, y_pressed = 0, x_pressed = 0;
static maple_device_t *mcont;
static cont_state_t *cond;
if (!mcont) {
mcont = maple_enum_type(0, MAPLE_FUNC_CONTROLLER);
if (!mcont) { return; }
}
cond = (cont_state_t *)maple_dev_status(mcont);
if (!cond) return;
if (cond->buttons & CONT_DPAD_UP) {
if ((framecnt - up_moved) > 10) {
if (selected > 0) {
selected--;
if (selected < top) {
top = selected;
}
}
up_moved = framecnt;
}
}
if (cond->buttons & CONT_DPAD_DOWN) {
if ((framecnt - down_moved) > 10) {
if (selected < (num_entries - 1)) {
selected++;
if (selected >= (top+10)) {
top++;
}
}
down_moved = framecnt;
}
}
if (cond->ltrig > 0) {
if ((framecnt - up_moved) > 10) {
selected -= 10;
if (selected < 0) selected = 0;
if (selected < top) top = selected;
up_moved = framecnt;
}
}
if (cond->rtrig > 0) {
if ((framecnt - down_moved) > 10) {
selected += 10;
if (selected > (num_entries - 1))
selected = num_entries - 1;
if (selected >= (top+10))
top = selected;
down_moved = framecnt;
}
}
if (cond->buttons & CONT_Y) {
if ((framecnt - y_pressed) > 10)
{
strcat(workstring,curdir);
strcat(workstring,"/");
strcat(workstring,entries[selected].fn);
strcpy(lst_entries[lst_size].fn,workstring);
lst_entries[lst_size].size = entries[selected].size;
printf("DEBUG: Entry %d : %s\r\n",lst_size,lst_entries[lst_size].fn);
workstring[0]=0;
lst_size++;
}
y_pressed=framecnt;
}
if ((cond->buttons & CONT_A) && !load_queued) {
if ((framecnt - a_pressed) > 10)
{
if (!strcmp(entries[selected].fn, "Error!"))
{
num_entries = 0;
}
else if (lst_size > 0)
{
printf("DEBUG: Playing playlist...\r\n");
lst_playing=0;
stop();
for (lst_playing=0;lst_playing < lst_size; lst_playing++)
{
if (lst_entries[lst_playing].size > 0)
start(lst_entries[lst_playing].fn, curdir);
thd_sleep(100);
}
lst_size = lst_playing = 0;
y_pressed=framecnt; /* We do this because in-movie, 'Y' is stop. */
x_pressed=framecnt;
}
else if (entries[selected].size >= 0)
{
char *ext;
stop();
strcpy(playdir,curdir);
strcat(loadme,curdir);
strcat(loadme,"/");
strcat(loadme,entries[selected].fn);
ext = (char *)(strchr(entries[selected].fn, '.')+1);
start(loadme, curdir);
loadme[0]=0;
iplaying=selected;
y_pressed=framecnt; /* We do this because in-movie, 'Y' is stop. */
x_pressed=framecnt;
}
else
{
if (!strcmp(entries[selected].fn, "<..>"))
{
int i;
for (i=strlen(curdir); i>0; i--)
{
if (curdir[i] == '/')
{
curdir[i] = 0;
break;
}
else
{
curdir[i] = 0;
}
}
}
else
{
if (strcmp(curdir, "/"))
strcat(curdir, "/");
strcat(curdir, entries[selected].fn);
}
mutex_lock(mut);
selected = top = num_entries = 0;
mutex_unlock(mut);
printf("current directory is now '%s'\n", curdir);
}
/* Submit polygons to the PVR ***********************/
draw_listing();
}
a_pressed = framecnt;
}
}
- When compiling libmpg123, MinGW does not have "sys/select.h" file (Cygwin yes). That header defines a POSIX interface that does not exist on native Windows.
I think that is not necessary, so I commented HAVE_SYS_SELECT_H in config.h
- When compiling libfaad, GCC complains about these undefined references (libfaad/player/mp4dec.c):
mp4ff_meta_get_num_items
mp4ff_meta_get_by_index
I haven't found them in all the code, so I commented the "#ifdef PRINT_MP4_METADATA" section in mp4dec.c
- You forgot a .svn folder inside Tremor folder.
- I would include in the README files the folders where one should call "make" to compile each of the libraries (it's not so trivial to found them!).
One question: How to compile snd_stream.c with the CVSID line? At the moment, I commented it.
----------------------------------
Update: I got lots of luck and I found why did it crash:
Code:
OPTFLAGS=-O3 -m4-single-only
Using -O2 in the Makefile everything works perfectly, but -O3 creates a crash even before starting the main() function. As far as I know, there is no real optimization using -O3 in Dreamcast, so I suggest to change back to -O2
