changeset 22:dc3b1d4fe835

64bit version fix.
author tkaito
date Mon, 13 Dec 2010 18:18:06 +0900
parents b7654db65a34
children 6a8cb917e0ad
files Makefile Makefile.fifo64 sgoex.c sound.c sys.c
diffstat 5 files changed, 44 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Dec 10 19:04:17 2010 +0900
+++ b/Makefile	Mon Dec 13 18:18:06 2010 +0900
@@ -4,7 +4,7 @@
 srcdir  = .
 ABI = -m32
 
-CFLAGS  += -g $(ABI) -O2 -Wall `sdl-config --cflags` `xml2-config --cflags` $(INCLUDE)
+CFLAGS  += -g $(ABI) -Wall `sdl-config --cflags` `xml2-config --cflags` $(INCLUDE)
 LIBS	+=  `sdl-config --libs`,-framework,OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs`
 LIBS += -lCerium -lFifoManager
 
@@ -23,7 +23,7 @@
 	$(CC) $(ABI) -o $@ $(OBJS) Dandy.o $(LIBS)
 
 clean:
-	rm -f $(TARGET) $(OBJS)
+	rm -f $(TARGET) $(OBJS) main.o sgoex.o
 
 .c.o:
 	$(CC) $(CFLAGS) $(INCLUDES) -c $<
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.fifo64	Mon Dec 13 18:18:06 2010 +0900
@@ -0,0 +1,34 @@
+# Makefile to build the SDL tests
+include ./Makefile.def
+
+srcdir  = .
+ABI = -m64
+
+CFLAGS  += -g $(ABI) -Wall `sdl-config --cflags` `xml2-config --cflags` $(INCLUDE)
+LIBS	+=  `sdl-config --libs`,-framework,OpenGL -lSDL_mixer -lSDL_image `xml2-config --libs`
+LIBS += -lCerium -lFifoManager
+
+TARGET = demo dandy
+OBJS    =  Character.o Bom.o tokuten.o collision.o count2.o Character_state.o schedule3.o tama2.o syokika.o Ss.o sound.o  profile.o debug.o trace.o LoadSprite.o xml.o b64_de.o tree_controll.o object.o sys.o 
+
+all: $(TARGET)
+
+test: $(TARGET)
+	./demo  -test
+
+demo: $(OBJS) sgoex.o main.o
+	$(CC) $(ABI) -o $@ main.o sgoex.o $(OBJS) $(LIBS)
+
+dandy: $(OBJS) Dandy.o
+	$(CC) $(ABI) -o $@ $(OBJS) Dandy.o $(LIBS)
+
+clean:
+	rm -f $(TARGET) $(OBJS)
+
+.c.o:
+	$(CC) $(CFLAGS) $(INCLUDES) -c $<
+
+.cc.o:
+	$(CC) $(CFLAGS) $(INCLUDES) -c $<
+
+debug.o:debug.h
--- a/sgoex.c	Fri Dec 10 19:04:17 2010 +0900
+++ b/sgoex.c	Mon Dec 13 18:18:06 2010 +0900
@@ -149,7 +149,7 @@
 
 void PutSprite(int zorder, short x, short y, int number)
 {
-    glBindTexture(GL_TEXTURE_2D, (GLuint)sptable[number].texture);
+  glBindTexture(GL_TEXTURE_2D, (GLuint&)sptable[number].texture);
     glEnable(GL_BLEND);
     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     glBegin(GL_QUADS);
@@ -171,7 +171,7 @@
     glEnable(GL_TEXTURE_2D);
     glEnable(GL_BLEND);
     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-    glBindTexture(GL_TEXTURE_2D, (GLuint)sptable[number].texture);
+    glBindTexture(GL_TEXTURE_2D, (GLuint&)sptable[number].texture);
     glTranslatef(x + m->w/2, y + m->h/2, 0.0);
     glRotatef(angle, 0.0, 0.0, 1.0);
     glScalef(scalex, scaley, 1.0);
--- a/sound.c	Fri Dec 10 19:04:17 2010 +0900
+++ b/sound.c	Mon Dec 13 18:18:06 2010 +0900
@@ -18,8 +18,8 @@
 static char buf0[] = "pBAV";
 
 int vh_addr[10] =
-{ (int) buf0, (int) buf0, (int) buf0, (int) buf0, (int) buf0,
-  (int) buf0 };
+{ (long) buf0, (long) buf0, (long) buf0, (long) buf0, (long) buf0,
+  (long) buf0 };
 
 int vb_addr[10] =
 { 0x80140d00, 0x80142700, 0x80143d00, 0x80145100, 0x80148f00,
--- a/sys.c	Fri Dec 10 19:04:17 2010 +0900
+++ b/sys.c	Mon Dec 13 18:18:06 2010 +0900
@@ -20,11 +20,11 @@
       return(-1);
     }
 
-  *f = *a = (unsigned int)index;
-  if (((unsigned int)index % ALIGN_16BYTE) != 0)
+  *f = *a = (unsigned long)index;
+  if (((unsigned long)index % ALIGN_16BYTE) != 0)
     {
-      index += ALIGN_16BYTE - ((unsigned int)index % ALIGN_16BYTE);
-      *a = (unsigned int)index;
+      index += ALIGN_16BYTE - ((unsigned long)index % ALIGN_16BYTE);
+      *a = (unsigned long)index;
     }
   return(0);
 }