Browse Source

32x, fix poll detection regression (mars check)
core, improve pad compatibility (6btn, mcd32x)
linux+psp, improve sw upscaling

root 2 years ago
parent
commit
23a289019c
4 changed files with 17 additions and 13 deletions
  1. 2 2
      pico/32x/memory.c
  2. 3 3
      pico/memory.c
  3. 11 7
      platform/linux/emu.c
  4. 1 1
      platform/psp/emu.c

+ 2 - 2
pico/32x/memory.c

@@ -1461,7 +1461,7 @@ static u32 REGPARM(2) sh2_read8_cs0(u32 a, SH2 *sh2)
 
   if ((a & 0x3fff0) == 0x4100) {
     d = p32x_vdp_read16(a);
-    p32x_sh2_poll_detect(a, sh2, SH2_STATE_VPOLL, 7);
+    p32x_sh2_poll_detect(a, sh2, SH2_STATE_VPOLL, 9);
     goto out_16to8;
   }
 
@@ -1524,7 +1524,7 @@ static u32 REGPARM(2) sh2_read16_cs0(u32 a, SH2 *sh2)
 
   if ((a & 0x3fff0) == 0x4100) {
     d = p32x_vdp_read16(a);
-    p32x_sh2_poll_detect(a, sh2, SH2_STATE_VPOLL, 7);
+    p32x_sh2_poll_detect(a, sh2, SH2_STATE_VPOLL, 9);
     goto out;
   }
 

+ 3 - 3
pico/memory.c

@@ -240,9 +240,9 @@ static u32 read_pad_6btn(int i, u32 out_bits)
   }
   else if(phase == 3) {
     if (out_bits & 0x40)
-      return (pad & 0x30) | ((pad >> 8) & 0xf);  // ?1CB MXYZ
+      value = (pad & 0x30) | ((pad >> 8) & 0xf); // ?1CB MXYZ
     else
-      return ((pad & 0xc0) >> 2) | 0x0f;         // ?0SA 1111
+      value = ((pad & 0xc0) >> 2) | 0x0f;        // ?0SA 1111
     goto out;
   }
 
@@ -281,7 +281,7 @@ static NOINLINE u32 port_read(int i)
   // disables output before doing TH-low read, so don't emulate it for TH.
   // Decap Attack reportedly doesn't work on Nomad but works on must
   // other MD revisions (different pull-up strength?).
-  if (PicoIn.AHW & PAHW_32X) // don't do it on 32X, it breaks WWF Raw
+  if (PicoIn.AHW & (PAHW_32X|PAHW_MCD)) // don't do it on 32X, it breaks WWF Raw
     out |= 0x7f & ~ctrl_reg;
   else
     out |= 0x3f & ~ctrl_reg;

+ 11 - 7
platform/linux/emu.c

@@ -175,14 +175,18 @@ void pemu_finalize_frame(const char *fps, const char *notice)
 		u16 *ps = ghost_buf;
 		int y, h = currentConfig.vscaling == EOPT_SCALE_SW ? 240:out_h;
 		int w = currentConfig.scaling == EOPT_SCALE_SW ? 320:out_w;
-		for (y = 0; y < h; y++) {
-			if (currentConfig.ghosting == 1)
+		if (currentConfig.ghosting == 1)
+			for (y = 0; y < h; y++) {
 				v_blend((u32 *)pd, (u32 *)ps, w/2, p_075_round);
-			else
+				pd += g_screen_ppitch;
+				ps += w;
+			}
+		else
+			for (y = 0; y < h; y++) {
 				v_blend((u32 *)pd, (u32 *)ps, w/2, p_05_round);
-			pd += g_screen_ppitch;
-			ps += w;
-		}
+				pd += g_screen_ppitch;
+				ps += w;
+			}
 	}
 
 //#define FUNKEY_AUTHORIZE_TEXT_OVERLAY
@@ -394,7 +398,7 @@ void emu_video_mode_change(int start_line, int line_count, int start_col, int co
 			PicoDrawSetCallbacks(cb_vscaling_begin,cb_vscaling_nop);
 		break;
 	case EOPT_SCALE_SW:
-		screen_y = (screen_h - 240)/2 + (out_h > 144);
+		screen_y = (screen_h - 240)/2 + (out_h < 240 && out_h > 144);
 		// NTSC always has 224 visible lines, anything smaller has bars
 		if (out_h < 224 && out_h > 144)
 			screen_y += (224 - out_h)/2;

+ 1 - 1
platform/psp/emu.c

@@ -104,7 +104,7 @@ static void change_renderer(int diff)
 
 static void apply_renderer(void)
 {
-	PicoIn.opt &= ~POPT_ALT_RENDERER;
+	PicoIn.opt &= ~(POPT_ALT_RENDERER|POPT_EN_SOFTSCALE);
 
 	switch (get_renderer()) {
 	case RT_16BIT: