|
From: <ba...@us...> - 2006-09-18 00:05:56
|
Revision: 366
http://svn.sourceforge.net/cadcdev/?rev=366&view=rev
Author: bardtx
Date: 2006-09-17 17:05:50 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: Still yet more joy of example fixes
Modified Paths:
--------------
kos/examples/dreamcast/2ndmix/Makefile
kos/examples/dreamcast/sound/ghettoplay-vorbis/Makefile
kos/examples/dreamcast/sound/ghettoplay-vorbis/ghettoplay.c
kos/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c
kos/examples/dreamcast/tsunami/genmenu/Makefile
Modified: kos/examples/dreamcast/2ndmix/Makefile
===================================================================
--- kos/examples/dreamcast/2ndmix/Makefile 2006-09-18 00:05:11 UTC (rev 365)
+++ kos/examples/dreamcast/2ndmix/Makefile 2006-09-18 00:05:50 UTC (rev 366)
@@ -20,7 +20,7 @@
rm -f romdisk.img
2ndmix.elf: $(OBJS)
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o 2ndmix.elf $(KOS_START) $(OBJS) $(KOS_LIBS)
+ kos-cc -o 2ndmix.elf $(OBJS)
run: 2ndmix.elf
$(KOS_LOADER) 2ndmix.elf
Modified: kos/examples/dreamcast/sound/ghettoplay-vorbis/Makefile
===================================================================
--- kos/examples/dreamcast/sound/ghettoplay-vorbis/Makefile 2006-09-18 00:05:11 UTC (rev 365)
+++ kos/examples/dreamcast/sound/ghettoplay-vorbis/Makefile 2006-09-18 00:05:50 UTC (rev 366)
@@ -11,8 +11,7 @@
-rm -f $(OBJS)
$(TARGET): $(OBJS)
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
- $(OBJS) $(DATAOBJS) $(OBJEXTRA) -loggvorbisplay -lm $(KOS_LIBS)
+ kos-cc -o $(TARGET) $(OBJS) -loggvorbisplay -lm
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
Modified: kos/examples/dreamcast/sound/ghettoplay-vorbis/ghettoplay.c
===================================================================
--- kos/examples/dreamcast/sound/ghettoplay-vorbis/ghettoplay.c 2006-09-18 00:05:11 UTC (rev 365)
+++ kos/examples/dreamcast/sound/ghettoplay-vorbis/ghettoplay.c 2006-09-18 00:05:50 UTC (rev 366)
@@ -113,6 +113,7 @@
pvr_init_defaults();
/* Initialize oggvorbis player thread */
+ snd_stream_init();
sndoggvorbis_init();
/* Setup the mouse/font texture */
Modified: kos/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c
===================================================================
--- kos/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c 2006-09-18 00:05:11 UTC (rev 365)
+++ kos/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c 2006-09-18 00:05:50 UTC (rev 366)
@@ -52,7 +52,7 @@
static int curpos = 0;
static int filtinitted = 0;
-static void snd_hook(void * obj, int freq, int chn, void ** buf, int *req) {
+static void snd_hook(int strm, void * obj, int freq, int chn, void ** buf, int *req) {
int actual;
uint64 t;
@@ -395,7 +395,7 @@
hookmut = mutex_create();
}
if (!filtinitted) {
- snd_stream_filter_add(snd_hook, NULL);
+ snd_stream_filter_add(0, snd_hook, NULL);
filtinitted = 1;
}
Modified: kos/examples/dreamcast/tsunami/genmenu/Makefile
===================================================================
--- kos/examples/dreamcast/tsunami/genmenu/Makefile 2006-09-18 00:05:11 UTC (rev 365)
+++ kos/examples/dreamcast/tsunami/genmenu/Makefile 2006-09-18 00:05:50 UTC (rev 366)
@@ -17,8 +17,7 @@
-rm -f $(TARGET) romdisk.*
$(TARGET): $(OBJS) romdisk.o
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
- $(OBJS) romdisk.o $(OBJEXTRA) -ltsunami -lk++ -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm $(KOS_LIBS)
+ kos-c++ -o $(TARGET) $(OBJS) romdisk.o -ltsunami -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 00:15:11
|
Revision: 367
http://svn.sourceforge.net/cadcdev/?rev=367&view=rev
Author: bardtx
Date: 2006-09-17 17:14:59 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: More example fixes, some by me, some from here:
https://sourceforge.net/mailarchive/forum.php?thread_id=10927199&forum_id=2046
Modified Paths:
--------------
kos/examples/dreamcast/basic/exec/Makefile
kos/examples/dreamcast/basic/exec/exec.c
kos/examples/dreamcast/kgl/basic/vfzclip/vfzclip.c
kos/examples/dreamcast/kgl/demos/tunnel/menu.cpp
kos/examples/dreamcast/lua/basic/lua.c
kos/examples/dreamcast/sound/hello-mp3/Makefile
kos/examples/dreamcast/sound/hello-ogg/Makefile
Modified: kos/examples/dreamcast/basic/exec/Makefile
===================================================================
--- kos/examples/dreamcast/basic/exec/Makefile 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/basic/exec/Makefile 2006-09-18 00:14:59 UTC (rev 367)
@@ -26,7 +26,7 @@
$(SUBTARGET): $(SUBOBJS)
$(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o sub.elf $(KOS_START) \
$(SUBOBJS) $(OBJEXTRA) $(KOS_LIBS)
- $(KOS_OBJCOPY) -O binary sub.elf $(SUBTARGET)
+ $(KOS_OBJCOPY) -O binary -R .stack sub.elf $(SUBTARGET)
# You can safely remove the next two targets if you don't use a ROMDISK
romdisk.img: $(SUBTARGET)
Modified: kos/examples/dreamcast/basic/exec/exec.c
===================================================================
--- kos/examples/dreamcast/basic/exec/exec.c 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/basic/exec/exec.c 2006-09-18 00:14:59 UTC (rev 367)
@@ -10,6 +10,8 @@
extern uint8 romdisk[];
KOS_INIT_ROMDISK(romdisk);
+#define false (1 == 0)
+
int main(int argc, char **argv) {
file_t f;
void *subelf;
Modified: kos/examples/dreamcast/kgl/basic/vfzclip/vfzclip.c
===================================================================
--- kos/examples/dreamcast/kgl/basic/vfzclip/vfzclip.c 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/kgl/basic/vfzclip/vfzclip.c 2006-09-18 00:14:59 UTC (rev 367)
@@ -11,6 +11,9 @@
#define SDIFF 0.001f
+#define true (1 == 1)
+#define false (1 == 0)
+
CVSID("$Id");
/*
Modified: kos/examples/dreamcast/kgl/demos/tunnel/menu.cpp
===================================================================
--- kos/examples/dreamcast/kgl/demos/tunnel/menu.cpp 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/kgl/demos/tunnel/menu.cpp 2006-09-18 00:14:59 UTC (rev 367)
@@ -38,6 +38,13 @@
memcpy(madd->pformat, pformat, strlen(pformat)+1);
printf("[i**]menu->add = %d\n", strlen(pformat)+1);
}
+
+// lvalue cast fix for C++, as proposed by Jim Ursetto
+// http://sourceforge.net/mailarchive/message.php?msg_id=9293303
+template <typename T, typename X> inline T& lvalue_cast(X& x) {
+ return *( reinterpret_cast<T*>(&x) ); // *((T *)& x)
+}
+
void Menu::add(float min, float max, float amt, float* pval, char *pformat) {
Menuitem_t* madd;
if (mlist == NULL) {
@@ -56,7 +63,7 @@
uf2i.f = min; madd->min = uf2i.i;
uf2i.f = max; madd->max = uf2i.i;
uf2i.f = amt; madd->amt = uf2i.i;
- (float *)madd->pvalue = (float *)pval;
+ lvalue_cast<float *>(madd->pvalue) = pval;
madd->pformat = (char*) malloc(strlen(pformat)+1);
memcpy(madd->pformat, pformat, strlen(pformat)+1);
printf("[f**]menu->add = %d\n", strlen(pformat)+1);
Modified: kos/examples/dreamcast/lua/basic/lua.c
===================================================================
--- kos/examples/dreamcast/lua/basic/lua.c 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/lua/basic/lua.c 2006-09-18 00:14:59 UTC (rev 367)
@@ -34,9 +34,6 @@
static lua_Hook old_linehook = NULL;
static lua_Hook old_callhook = NULL;
-int errno = 0;
-int _impure_ptr = 0;
-
static void userinit (void) {
lua_baselibopen(L);
lua_iolibopen(L);
Modified: kos/examples/dreamcast/sound/hello-mp3/Makefile
===================================================================
--- kos/examples/dreamcast/sound/hello-mp3/Makefile 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/sound/hello-mp3/Makefile 2006-09-18 00:14:59 UTC (rev 367)
@@ -11,8 +11,7 @@
-rm -f romdisk.o romdisk.img
$(TARGET): $(OBJS)
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
- $(OBJS) $(DATAOBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lmp3 -lm -lkallisti -lgcc
+ kos-cc -o $(TARGET) $(OBJS) $(DATAOBJS) $(OBJEXTRA) -lmp3 -lm
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
Modified: kos/examples/dreamcast/sound/hello-ogg/Makefile
===================================================================
--- kos/examples/dreamcast/sound/hello-ogg/Makefile 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/sound/hello-ogg/Makefile 2006-09-18 00:14:59 UTC (rev 367)
@@ -18,9 +18,8 @@
# You can choose a decoder to test below. Tremor is the integer-only
# version, and oggvorbisplay is the full FP version.
$(TARGET): $(OBJS)
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
- $(OBJS) $(DATAOBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -ltremor -lm -lkallisti -lgcc
-# $(OBJS) $(DATAOBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -loggvorbisplay -lm -lkallisti -lgcc
+ kos-cc -o $(TARGET) $(OBJS) $(DATAOBJS) $(OBJEXTRA) -ltremor -lm
+# kos-cc -o $(TARGET) $(OBJS) $(DATAOBJS) $(OBJEXTRA) -loggvorbisplay -lm
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|