OSDN Git Service

clean up. motonesemu-0.1.1
authorastoria-d <astoria-d@mail.goo.ne.jp>
Tue, 26 Mar 2013 02:07:23 +0000 (11:07 +0900)
committerastoria-d <astoria-d@mail.goo.ne.jp>
Tue, 26 Mar 2013 02:07:23 +0000 (11:07 +0900)
emulator/6502core.c
emulator/bus.c
emulator/cpu.c
emulator/ppucore/dummy-driver2.c
emulator/ppucore/vram.c
emulator/ppucore/vscreen.c

index 4e9ecf3..da9f50f 100644 (file)
@@ -2336,7 +2336,7 @@ int reset6502(void) {
 }
 
 int nmi6502(void) {
-    dprint("nmi...\n");
+    //dprint("nmi...\n");
 
     //nmi6502 is always called when current instruction execution is done.
     switch (current_exec_index++) {
index a6af2e7..2c23b8c 100644 (file)
@@ -126,6 +126,9 @@ void set_bus_data(unsigned char data){
         return;
 
     if (addr_bus & ROM_BIT) {
+        extern int critical_error;
+        dprint("invalid write!!!!\n");
+        critical_error = TRUE;
         //no write to ROM
     }
     else if ((addr_bus & IO_APU_BIT) == IO_APU_BIT) {
index ab58b44..732d0cf 100644 (file)
@@ -98,7 +98,6 @@ void store_memory(unsigned short addr, unsigned char data) {
     start_bus();
     end_bus();
 
-    cpu_addr_buffer = addr;
     cpu_data_buffer = data;
 }
 
index 713fd72..16303b1 100644 (file)
@@ -61,6 +61,7 @@ void set_nmi_pin(int val) { }
 void d1_set(int on_off) {}
 void d2_set(int on_off) {}
 void d3_set(int on_off) {}
+void clean_clock(void){}
 
 /*
  * ppu test function
index 35a4348..2c44717 100644 (file)
@@ -140,6 +140,9 @@ void vram_data_set(unsigned short addr, unsigned char data) {
     if (addr < 2 * PATTERN_TBL_SIZE) {
         //dprint("invalid vram write addr:%04x, data:%2x\n", addr, data);
         //do nothing. pattern table is read only.
+        extern int critical_error;
+        dprint("invalid vram write!!!!\n");
+        critical_error = TRUE;
     }
     else if (addr >= PALETTE_START) {
         // bg/sprite palette table.
@@ -552,6 +555,7 @@ void clean_vram(void) {
 
 static void null_write (unsigned short addr, unsigned char data) {}
 static void dump_vram_write (unsigned short addr, unsigned char data) {
+    dprint("                                  ");
     dprint("vram_data_set addr:%04x, data:%2x\n", addr, data);
 }
 
index 7a87646..f95e37b 100644 (file)
@@ -100,6 +100,13 @@ void set_bgtile(int tile_id) {
                 //dprint("%d, %d, colind:%d\n", j, i, pi);
                 set_data->l[i].d[7 - j] = plt.col[pi];
             }
+            else {
+                //TODO
+                //for the time being, transparent bg color is black..
+                set_data->l[i].d[7 - j].r = 0;
+                set_data->l[i].d[7 - j].g = 0;
+                set_data->l[i].d[7 - j].b = 0;
+            }
         }
     }