Updated for Dreamcast KOS June 2005 snapshot:
http://cadcdev.sourceforge.net/svn/snapshots/ http://gamedev.allusion.net/softprj/kos/dcsetup.php --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401465
This commit is contained in:
parent
073a8d79d8
commit
b8ecf02fdf
11 changed files with 59 additions and 62 deletions
27
Makefile.dc
27
Makefile.dc
|
@ -1,20 +1,16 @@
|
||||||
#GL=1
|
#GL=1
|
||||||
|
|
||||||
CC = sh-elf-gcc -ml -m4-single-only
|
CC = sh-elf-gcc
|
||||||
AR = sh-elf-ar
|
AR = sh-elf-ar
|
||||||
KOS_BASE=/prog/kos-1.1.7
|
|
||||||
INCS = -I$(KOS_BASE)/libc/include -I$(KOS_BASE)/include -I$(KOS_BASE)/kernel/arch/dreamcast/include
|
|
||||||
DEFS =-DNO_SIGNAL_H -DENABLE_DC
|
|
||||||
|
|
||||||
ifdef GL
|
ifdef GL
|
||||||
DEFS += -DHAVE_OPENGL
|
DEFS += -DSDL_VIDEO_OPENGL=1
|
||||||
TARGET = libSDL_gl.a
|
TARGET = libSDL_gl.a
|
||||||
else
|
else
|
||||||
TARGET = libSDL.a
|
TARGET = libSDL.a
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OPTFLAGS=-O2 -fomit-frame-pointer
|
CFLAGS=$(KOS_CFLAGS) $(DEFS) -Iinclude
|
||||||
CFLAGS=-D_arch_dreamcast $(DEFS) $(INCS) -Iinclude -Isrc -Isrc/audio -Isrc/cdrom -Isrc/endian -Isrc/events -Isrc/joystick -Isrc/thread/dc -Isrc/thread -Isrc/timer -Isrc/video $(OPTFLAGS)
|
|
||||||
|
|
||||||
SRCS = \
|
SRCS = \
|
||||||
src/audio/dc/SDL_dcaudio.c \
|
src/audio/dc/SDL_dcaudio.c \
|
||||||
|
@ -22,12 +18,10 @@ SRCS = \
|
||||||
src/audio/SDL_audio.c \
|
src/audio/SDL_audio.c \
|
||||||
src/audio/SDL_audiocvt.c \
|
src/audio/SDL_audiocvt.c \
|
||||||
src/audio/SDL_audiodev.c \
|
src/audio/SDL_audiodev.c \
|
||||||
src/audio/SDL_audiomem.c \
|
|
||||||
src/audio/SDL_mixer.c \
|
src/audio/SDL_mixer.c \
|
||||||
src/audio/SDL_wave.c \
|
src/audio/SDL_wave.c \
|
||||||
src/cdrom/dc/SDL_syscdrom.c \
|
src/cdrom/dc/SDL_syscdrom.c \
|
||||||
src/cdrom/SDL_cdrom.c \
|
src/cdrom/SDL_cdrom.c \
|
||||||
src/endian/SDL_endian.c \
|
|
||||||
src/events/SDL_active.c \
|
src/events/SDL_active.c \
|
||||||
src/events/SDL_events.c \
|
src/events/SDL_events.c \
|
||||||
src/events/SDL_expose.c \
|
src/events/SDL_expose.c \
|
||||||
|
@ -38,11 +32,15 @@ SRCS = \
|
||||||
src/file/SDL_rwops.c \
|
src/file/SDL_rwops.c \
|
||||||
src/joystick/dc/SDL_sysjoystick.c \
|
src/joystick/dc/SDL_sysjoystick.c \
|
||||||
src/joystick/SDL_joystick.c \
|
src/joystick/SDL_joystick.c \
|
||||||
|
src/loadso/dummy/SDL_sysloadso.c \
|
||||||
src/SDL.c \
|
src/SDL.c \
|
||||||
src/SDL_error.c \
|
src/SDL_error.c \
|
||||||
src/SDL_fatal.c \
|
src/SDL_fatal.c \
|
||||||
src/SDL_getenv.c \
|
src/stdlib/SDL_getenv.c \
|
||||||
src/SDL_loadso.c \
|
src/stdlib/SDL_malloc.c \
|
||||||
|
src/stdlib/SDL_qsort.c \
|
||||||
|
src/stdlib/SDL_stdlib.c \
|
||||||
|
src/stdlib/SDL_string.c \
|
||||||
src/thread/dc/SDL_syscond.c \
|
src/thread/dc/SDL_syscond.c \
|
||||||
src/thread/dc/SDL_sysmutex.c \
|
src/thread/dc/SDL_sysmutex.c \
|
||||||
src/thread/dc/SDL_syssem.c \
|
src/thread/dc/SDL_syssem.c \
|
||||||
|
@ -97,9 +95,8 @@ TEST = \
|
||||||
test/threadwin.c \
|
test/threadwin.c \
|
||||||
test/torturethread.c \
|
test/torturethread.c \
|
||||||
|
|
||||||
clean:
|
$(TARGET): $(OBJS)
|
||||||
rm $(OBJS)
|
|
||||||
|
|
||||||
$(TARGET) : $(OBJS)
|
|
||||||
$(AR) rcs $(TARGET) $(OBJS)
|
$(AR) rcs $(TARGET) $(OBJS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(OBJS)
|
||||||
|
|
|
@ -106,9 +106,11 @@
|
||||||
#undef HAVE__UITOA
|
#undef HAVE__UITOA
|
||||||
#undef HAVE__ULTOA
|
#undef HAVE__ULTOA
|
||||||
#undef HAVE_STRTOL
|
#undef HAVE_STRTOL
|
||||||
|
#undef HAVE_STRTOUL
|
||||||
#undef HAVE__I64TOA
|
#undef HAVE__I64TOA
|
||||||
#undef HAVE__UI64TOA
|
#undef HAVE__UI64TOA
|
||||||
#undef HAVE_STRTOLL
|
#undef HAVE_STRTOLL
|
||||||
|
#undef HAVE_STRTOULL
|
||||||
#undef HAVE_STRTOD
|
#undef HAVE_STRTOD
|
||||||
#undef HAVE_ATOI
|
#undef HAVE_ATOI
|
||||||
#undef HAVE_ATOF
|
#undef HAVE_ATOF
|
||||||
|
|
|
@ -25,6 +25,15 @@
|
||||||
|
|
||||||
/* This is a set of defines to configure the SDL features */
|
/* This is a set of defines to configure the SDL features */
|
||||||
|
|
||||||
|
typedef signed char int8_t;
|
||||||
|
typedef unsigned char uint8_t;
|
||||||
|
typedef signed short int16_t;
|
||||||
|
typedef unsigned short uint16_t;
|
||||||
|
typedef signed int int32_t;
|
||||||
|
typedef unsigned int uint32_t;
|
||||||
|
typedef signed long long int64_t;
|
||||||
|
typedef unsigned long long uint64_t;
|
||||||
|
typedef unsigned long uintptr_t;
|
||||||
#define SDL_HAS_64BIT_TYPE 1
|
#define SDL_HAS_64BIT_TYPE 1
|
||||||
|
|
||||||
/* Useful headers */
|
/* Useful headers */
|
||||||
|
@ -32,8 +41,7 @@
|
||||||
#define HAVE_STDIO_H 1
|
#define HAVE_STDIO_H 1
|
||||||
#define STDC_HEADERS 1
|
#define STDC_HEADERS 1
|
||||||
#define HAVE_STRING_H 1
|
#define HAVE_STRING_H 1
|
||||||
#define HAVE_INTTYPES_H 1
|
#define HAVE_CTYPE_H 1
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
|
|
||||||
/* C library functions */
|
/* C library functions */
|
||||||
#define HAVE_MALLOC 1
|
#define HAVE_MALLOC 1
|
||||||
|
@ -43,10 +51,31 @@
|
||||||
#define HAVE_ALLOCA 1
|
#define HAVE_ALLOCA 1
|
||||||
#define HAVE_GETENV 1
|
#define HAVE_GETENV 1
|
||||||
#define HAVE_PUTENV 1
|
#define HAVE_PUTENV 1
|
||||||
|
#define HAVE_QSORT 1
|
||||||
|
#define HAVE_ABS 1
|
||||||
|
#define HAVE_BCOPY 1
|
||||||
#define HAVE_MEMSET 1
|
#define HAVE_MEMSET 1
|
||||||
#define HAVE_MEMCPY 1
|
#define HAVE_MEMCPY 1
|
||||||
#define HAVE_MEMMOVE 1
|
#define HAVE_MEMMOVE 1
|
||||||
#define HAVE_MEMCMP 1
|
#define HAVE_MEMCMP 1
|
||||||
|
#define HAVE_STRLEN 1
|
||||||
|
#define HAVE_STRDUP 1
|
||||||
|
#define HAVE_INDEX 1
|
||||||
|
#define HAVE_RINDEX 1
|
||||||
|
#define HAVE_STRCHR 1
|
||||||
|
#define HAVE_STRRCHR 1
|
||||||
|
#define HAVE_STRSTR 1
|
||||||
|
#define HAVE_STRTOL 1
|
||||||
|
#define HAVE_STRTOD 1
|
||||||
|
#define HAVE_ATOI 1
|
||||||
|
#define HAVE_ATOF 1
|
||||||
|
#define HAVE_STRCMP 1
|
||||||
|
#define HAVE_STRNCMP 1
|
||||||
|
#define HAVE_STRICMP 1
|
||||||
|
#define HAVE_STRCASECMP 1
|
||||||
|
#define HAVE_SSCANF 1
|
||||||
|
#define HAVE_SNPRINTF 1
|
||||||
|
#define HAVE_VSNPRINTF 1
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
/* Enable various audio drivers */
|
||||||
#define SDL_AUDIO_DRIVER_DC 1
|
#define SDL_AUDIO_DRIVER_DC 1
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#undef __BSDI__
|
#undef __BSDI__
|
||||||
#define __BSDI__ 1
|
#define __BSDI__ 1
|
||||||
#endif
|
#endif
|
||||||
#if defined(DREAMCAST)
|
#if defined(_arch_dreamcast)
|
||||||
#undef __DREAMCAST__
|
#undef __DREAMCAST__
|
||||||
#define __DREAMCAST__ 1
|
#define __DREAMCAST__ 1
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,13 +24,6 @@
|
||||||
|
|
||||||
/* Output dreamcast aica */
|
/* Output dreamcast aica */
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include "SDL_timer.h"
|
#include "SDL_timer.h"
|
||||||
#include "SDL_audio.h"
|
#include "SDL_audio.h"
|
||||||
#include "../SDL_audiomem.h"
|
#include "../SDL_audiomem.h"
|
||||||
|
|
|
@ -6,6 +6,9 @@
|
||||||
*/
|
*/
|
||||||
#include "aica.h"
|
#include "aica.h"
|
||||||
|
|
||||||
|
#include <arch/irq.h>
|
||||||
|
#include <dc/spu.h>
|
||||||
|
|
||||||
/* #define dc_snd_base ((volatile unsigned char *)0x00800000) */ /* arm side */
|
/* #define dc_snd_base ((volatile unsigned char *)0x00800000) */ /* arm side */
|
||||||
#define dc_snd_base ((volatile unsigned char *)0xa0700000) /* dc side */
|
#define dc_snd_base ((volatile unsigned char *)0xa0700000) /* dc side */
|
||||||
|
|
||||||
|
@ -37,7 +40,7 @@
|
||||||
|
|
||||||
|
|
||||||
void aica_init() {
|
void aica_init() {
|
||||||
int i, j, old;
|
int i, j, old = 0;
|
||||||
|
|
||||||
/* Initialize AICA channels */
|
/* Initialize AICA channels */
|
||||||
G2_LOCK(old);
|
G2_LOCK(old);
|
||||||
|
@ -146,9 +149,10 @@ static inline unsigned AICA_FREQ(unsigned freq) {
|
||||||
This routine (and the similar ones) owe a lot to Marcus' sound example --
|
This routine (and the similar ones) owe a lot to Marcus' sound example --
|
||||||
I hadn't gotten quite this far into dissecting the individual regs yet. */
|
I hadn't gotten quite this far into dissecting the individual regs yet. */
|
||||||
void aica_play(int ch,int mode,unsigned long smpptr,int loopst,int loopend,int freq,int vol,int pan,int loopflag) {
|
void aica_play(int ch,int mode,unsigned long smpptr,int loopst,int loopend,int freq,int vol,int pan,int loopflag) {
|
||||||
int i;
|
/* int i;
|
||||||
|
*/
|
||||||
int val;
|
int val;
|
||||||
int old;
|
int old = 0;
|
||||||
|
|
||||||
/* Stop the channel (if it's already playing) */
|
/* Stop the channel (if it's already playing) */
|
||||||
aica_stop(ch);
|
aica_stop(ch);
|
||||||
|
|
|
@ -86,7 +86,7 @@ static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
|
||||||
cdrom->track[i].id = i+1;
|
cdrom->track[i].id = i+1;
|
||||||
cdrom->track[i].type = (TOC_CTRL(toc.entry[i])==TRACK_CDDA)?SDL_AUDIO_TRACK:SDL_DATA_TRACK;
|
cdrom->track[i].type = (TOC_CTRL(toc.entry[i])==TRACK_CDDA)?SDL_AUDIO_TRACK:SDL_DATA_TRACK;
|
||||||
cdrom->track[i].offset = TOC_LBA(entry)-150;
|
cdrom->track[i].offset = TOC_LBA(entry)-150;
|
||||||
cdrom->track[i].length = TOC_LBA((i+1<toc.last)?toc.entry[i+1]:toc.dunno)-TOC_LBA(entry);
|
cdrom->track[i].length = TOC_LBA((i+1<toc.last)?toc.entry[i+1]:toc.leadout_sector)-TOC_LBA(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -95,7 +95,6 @@ static int SDL_SYS_CDGetTOC(SDL_CD *cdrom)
|
||||||
/* Get CD-ROM status */
|
/* Get CD-ROM status */
|
||||||
static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
|
static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position)
|
||||||
{
|
{
|
||||||
CDstatus status;
|
|
||||||
int ret,dc_status,disc_type;
|
int ret,dc_status,disc_type;
|
||||||
|
|
||||||
ret = cdrom_get_status(&dc_status,&disc_type);
|
ret = cdrom_get_status(&dc_status,&disc_type);
|
||||||
|
|
|
@ -21,8 +21,7 @@
|
||||||
*/
|
*/
|
||||||
#include "SDL_config.h"
|
#include "SDL_config.h"
|
||||||
|
|
||||||
/* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */
|
#include "SDL_events.h"
|
||||||
|
|
||||||
#include "SDL_joystick.h"
|
#include "SDL_joystick.h"
|
||||||
#include "../SDL_sysjoystick.h"
|
#include "../SDL_sysjoystick.h"
|
||||||
#include "../SDL_joystick_c.h"
|
#include "../SDL_joystick_c.h"
|
||||||
|
|
|
@ -24,38 +24,11 @@
|
||||||
/* Thread management routines for SDL */
|
/* Thread management routines for SDL */
|
||||||
|
|
||||||
#include "SDL_thread.h"
|
#include "SDL_thread.h"
|
||||||
|
#include "../SDL_thread_c.h"
|
||||||
#include "../SDL_systhread.h"
|
#include "../SDL_systhread.h"
|
||||||
|
|
||||||
#include <kos/thread.h>
|
#include <kos/thread.h>
|
||||||
|
|
||||||
#if SDL_THREADS_DISABLED
|
|
||||||
int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
|
|
||||||
{
|
|
||||||
SDL_SetError("Threads are not supported on this platform");
|
|
||||||
return(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SDL_SYS_SetupThread(void)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Uint32 SDL_ThreadID(void)
|
|
||||||
{
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SDL_SYS_WaitThread(SDL_Thread *thread)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SDL_SYS_KillThread(SDL_Thread *thread)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
|
int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
|
||||||
{
|
{
|
||||||
thread->handle = thd_create(SDL_RunThread,args);
|
thread->handle = thd_create(SDL_RunThread,args);
|
||||||
|
@ -85,4 +58,3 @@ void SDL_SYS_KillThread(SDL_Thread *thread)
|
||||||
{
|
{
|
||||||
thd_destroy(thread->handle);
|
thd_destroy(thread->handle);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ static void keyboard_update(void)
|
||||||
|
|
||||||
maple_raddr(addr,&port,&unit);
|
maple_raddr(addr,&port,&unit);
|
||||||
|
|
||||||
state = kbd_get_state(port,unit);
|
state = maple_dev_state(port,unit);
|
||||||
if (!state) return;
|
if (!state) return;
|
||||||
|
|
||||||
shiftkeys = state->shift_keys ^ old_state.shift_keys;
|
shiftkeys = state->shift_keys ^ old_state.shift_keys;
|
||||||
|
|
|
@ -53,10 +53,12 @@ static int DC_FlipHWSurface(_THIS, SDL_Surface *surface);
|
||||||
static void DC_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
|
static void DC_UpdateRects(_THIS, int numrects, SDL_Rect *rects);
|
||||||
|
|
||||||
/* OpenGL */
|
/* OpenGL */
|
||||||
|
#if SDL_VIDEO_OPENGL
|
||||||
static void *DC_GL_GetProcAddress(_THIS, const char *proc);
|
static void *DC_GL_GetProcAddress(_THIS, const char *proc);
|
||||||
static int DC_GL_LoadLibrary(_THIS, const char *path);
|
static int DC_GL_LoadLibrary(_THIS, const char *path);
|
||||||
static int DC_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
|
static int DC_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
|
||||||
static void DC_GL_SwapBuffers(_THIS);
|
static void DC_GL_SwapBuffers(_THIS);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* DC driver bootstrap functions */
|
/* DC driver bootstrap functions */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue