OSDN Git Service

ppucore included into main work.
authorastoria-d <astoria-d@mail.goo.ne.jp>
Wed, 13 Mar 2013 07:14:57 +0000 (16:14 +0900)
committerastoria-d <astoria-d@mail.goo.ne.jp>
Wed, 13 Mar 2013 07:14:57 +0000 (16:14 +0900)
emulator/Makefile
emulator/ppu.c
emulator/ppucore/Makefile

index 8e4cf74..a30019e 100644 (file)
@@ -9,7 +9,7 @@ OBJS=emu-main.o clock.o bus.o cpu.o \
 
 
 #LIBS=-L../libs -pthread -lrt -lncurses
-LIBS=-L../libs -lmotones -pthread -lrt
+LIBS=-L../libs -L./ppucore -lmotones -lppucore -pthread -lrt
 
 INCLUDE=-I../include
 
@@ -17,7 +17,7 @@ CFLAGS=-g $(INCLUDE) -Wall
 
 all:   $(BIN)
 
-$(BIN): $(OBJS) ../libs
+$(BIN): $(OBJS) ../libs ./ppucore
        gcc -o $(BIN) $(OBJS) $(LIBS)
 
 .c.o: 
index 0417638..2eaf2b4 100644 (file)
@@ -51,6 +51,7 @@ static sem_t ppu_sem_id;
  * Resolution                                   256 x 224 
  * CPU speed                                    1.79 MHz 
  *
+ * PPU clock                                    21.48 Mhz
  * */
 
 void set_ppu_addr(unsigned char data) {
@@ -85,6 +86,11 @@ int init_ppu(void) {
     cart_pin.rd = 0;
     cart_pin.wr = 0;
 
+    ret = ppucore_init();
+    if (ret == FALSE) {
+        return FALSE;
+    }
+
     ret = sem_init(&ppu_sem_id, 0, 0);
     if (ret != RT_OK) {
         return FALSE;
index 520ca9f..9e185c2 100644 (file)
@@ -1,13 +1,13 @@
 
-#BIN=ppucore
-BIN=dummy-driver2
+BIN=libppucore.a
+TEST_BIN=dummy-driver2
 
 DUMMY_OBJS=dummy-driver2.o debug.o cartridge.o 
 
 OBJS=ppucore.o vram.o vscreen.o palette.o \
-        vga_xfer.o $(DUMMY_OBJS)
+        vga_xfer.o
         
-LIBS=-L../../libs -lmotones -pthread -lrt
+LIBS=-L../../libs -L./ -lmotones -pthread -lrt -lppucore
 
 INCLUDE=-I../../include
 
@@ -15,16 +15,19 @@ CFLAGS=-g $(INCLUDE) -Wall
 
 LFLAGS=-g $(LIBS) -Wall
 
-all:   $(BIN) $(DRIVER)
+all:   $(BIN) $(TEST_BIN)
+
+$(TEST_BIN): $(BIN) $(DUMMY_OBJS) ../../libs
+       gcc -o $(TEST_BIN) $(DUMMY_OBJS) $(LFLAGS)
 
 $(BIN): $(OBJS) ../../libs
-       gcc -o $(BIN) $(OBJS) $(LFLAGS)
+       ar rcs $(BIN) $(OBJS)
 
 .c.o: 
        gcc $(CFLAGS) -c $<
 
 clean:
-       -rm $(OBJS) $(BIN)
+       -rm $(OBJS) $(DUMMY_OBJS) $(BIN) $(TEST_BIN)
                
 tag:
        cd ../.. && make tag