diff options
author | notaz | 2012-11-13 19:19:36 +0200 |
---|---|---|
committer | notaz | 2012-11-18 01:40:00 +0200 |
commit | e4c83ca67cf7ad13db3995909605ce01ff915824 (patch) | |
tree | 58f361fada24be7fa23f402b7eedb012326b90a3 /plugins | |
parent | c65553d0cafc353daad3fdcc0aab63bb8427a809 (diff) | |
download | pcsx_rearmed-e4c83ca67cf7ad13db3995909605ce01ff915824.tar.gz pcsx_rearmed-e4c83ca67cf7ad13db3995909605ce01ff915824.tar.bz2 pcsx_rearmed-e4c83ca67cf7ad13db3995909605ce01ff915824.zip |
fix gun handling in enhancement mode
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/dfinput/externals.h | 14 | ||||
-rw-r--r-- | plugins/dfinput/guncon.c | 6 | ||||
-rw-r--r-- | plugins/dfinput/main.h | 14 | ||||
-rw-r--r-- | plugins/dfxvideo/draw_pl.c | 2 | ||||
-rw-r--r-- | plugins/gpu_unai/gpu.cpp | 2 | ||||
-rw-r--r-- | plugins/gpulib/vout_pl.c | 8 |
6 files changed, 25 insertions, 21 deletions
diff --git a/plugins/dfinput/externals.h b/plugins/dfinput/externals.h new file mode 100644 index 0000000..5419977 --- /dev/null +++ b/plugins/dfinput/externals.h @@ -0,0 +1,14 @@ + +void dfinput_activate(void); + +/* get gunstate from emu frontend, + * xn, yn - layer position normalized to 0..1023 */ +#define GUNIN_TRIGGER (1<<0) +#define GUNIN_BTNA (1<<1) +#define GUNIN_BTNB (1<<2) +#define GUNIN_TRIGGER2 (1<<3) /* offscreen trigger */ +extern void pl_update_gun(int *xn, int *yn, int *xres, int *yres, int *in); + +/* vibration trigger to frontend */ +extern int in_enable_vibration; +extern void plat_trigger_vibrate(int is_strong); diff --git a/plugins/dfinput/guncon.c b/plugins/dfinput/guncon.c index b4f103c..981a757 100644 --- a/plugins/dfinput/guncon.c +++ b/plugins/dfinput/guncon.c @@ -29,17 +29,17 @@ unsigned char PADpoll_guncon(unsigned char value) unsigned char PADstartPoll_guncon(int pad) { - int x, xn = 0, y = 0, in = 0, xres = 256; + int x, y, xn = 0, yn = 0, in = 0, xres = 256, yres = 240; CurByte = 0; buf[2] = buf[3] = 0xff; - pl_update_gun(&xn, &xres, &y, &in); + pl_update_gun(&xn, &yn, &xres, &yres, &in); // while y = const + line counter, what is x? // for 256 mode, hw dumped offsets x, y: 0x5a, 0x20 //x = 0x5a + (356 * xn >> 10); x = 0x5a - (xres - 256) / 3 + (((xres - 256) / 3 + 356) * xn >> 10); - y = 0x20 + y; + y = 0x20 + (yres * yn >> 10); if (in & GUNIN_TRIGGER) buf[3] &= ~0x20; diff --git a/plugins/dfinput/main.h b/plugins/dfinput/main.h index 8e2d5ae..15d05e7 100644 --- a/plugins/dfinput/main.h +++ b/plugins/dfinput/main.h @@ -1,4 +1,5 @@ #include "../../libpcsxcore/psemu_plugin_defs.h" +#include "externals.h" extern unsigned char CurPad, CurByte, CurCmd, CmdLen; @@ -12,19 +13,6 @@ unsigned char PADpoll_guncon(unsigned char value); unsigned char PADstartPoll_guncon(int pad); void guncon_init(void); -void dfinput_activate(void); - /* get button state and pad type from main emu */ extern long (*PAD1_readPort1)(PadDataS *pad); extern long (*PAD2_readPort2)(PadDataS *pad); - -/* get gunstate from emu frontend, x range 0-1023 */ -#define GUNIN_TRIGGER (1<<0) -#define GUNIN_BTNA (1<<1) -#define GUNIN_BTNB (1<<2) -#define GUNIN_TRIGGER2 (1<<3) /* offscreen trigger */ -extern void pl_update_gun(int *xn, int *xres, int *y, int *in); - -/* vibration trigger to frontend */ -extern int in_enable_vibration; -extern void plat_trigger_vibrate(int is_strong); diff --git a/plugins/dfxvideo/draw_pl.c b/plugins/dfxvideo/draw_pl.c index 06a635d..ed07e75 100644 --- a/plugins/dfxvideo/draw_pl.c +++ b/plugins/dfxvideo/draw_pl.c @@ -50,7 +50,7 @@ void DoBufferSwap(void) fbw = PreviousPSXDisplay.DisplayMode.x; fbh = PreviousPSXDisplay.DisplayMode.y; fb24bpp = PSXDisplay.RGB24; - rcbs->pl_vout_set_mode(fbw, fbh, fb24bpp ? 24 : 16); + rcbs->pl_vout_set_mode(fbw, fbh, fbw, fbh, fb24bpp ? 24 : 16); } pcnt_start(PCNT_BLIT); diff --git a/plugins/gpu_unai/gpu.cpp b/plugins/gpu_unai/gpu.cpp index c111d78..df5e0cf 100644 --- a/plugins/gpu_unai/gpu.cpp +++ b/plugins/gpu_unai/gpu.cpp @@ -850,7 +850,7 @@ static void blit(void) old_res_horz = w0; old_res_vert = h1; old_rgb24 = (s16)isRGB24; - cbs->pl_vout_set_mode(w0, h1, isRGB24 ? 24 : 16); + cbs->pl_vout_set_mode(w0, h1, w0, h1, isRGB24 ? 24 : 16); } cbs->pl_vout_flip(base, 1024, isRGB24, w0, h1); diff --git a/plugins/gpulib/vout_pl.c b/plugins/gpulib/vout_pl.c index 7b229db..a49371a 100644 --- a/plugins/gpulib/vout_pl.c +++ b/plugins/gpulib/vout_pl.c @@ -32,14 +32,16 @@ static void check_mode_change(int force) static int old_h; int w = gpu.screen.hres; int h = gpu.screen.h; + int w_out = w; + int h_out = h; gpu.state.enhancement_active = gpu.get_enhancement_bufer != NULL && gpu.state.enhancement_enable && w <= 512 && h <= 256 && !gpu.status.rgb24; if (gpu.state.enhancement_active) { - w *= 2; - h *= 2; + w_out *= 2; + h_out *= 2; } // width|rgb24 change? @@ -48,7 +50,7 @@ static void check_mode_change(int force) old_status = gpu.status.reg; old_h = h; - cbs->pl_vout_set_mode(w, h, + cbs->pl_vout_set_mode(w_out, h_out, w, h, (gpu.status.rgb24 && !cbs->only_16bpp) ? 24 : 16); } } |