not worth mention: minor addition to support SNES SuperScope in MESS

This commit is contained in:
Fabio Priuli 2010-03-08 07:03:58 +00:00
parent f84bb3da43
commit d1ebfa9d2e
2 changed files with 31 additions and 22 deletions

View File

@ -369,6 +369,14 @@ struct snes_mouse
int speed; int speed;
}; };
struct snes_superscope
{
INT16 x, y;
UINT8 buttons;
int turbo_lock, pause_lock, fire_lock;
int offscreen;
};
typedef void (*snes_io_read)(running_machine *machine); typedef void (*snes_io_read)(running_machine *machine);
typedef UINT8 (*snes_oldjoy_read)(running_machine *machine); typedef UINT8 (*snes_oldjoy_read)(running_machine *machine);
@ -384,6 +392,7 @@ public:
UINT8 read_idx[2]; UINT8 read_idx[2];
snes_controller_port joypad[4]; snes_controller_port joypad[4];
snes_mouse mouse[2]; snes_mouse mouse[2];
snes_superscope scope[2];
/* input callbacks (to allow MESS to have its own input handlers) */ /* input callbacks (to allow MESS to have its own input handlers) */
snes_io_read io_read; snes_io_read io_read;
@ -474,6 +483,7 @@ extern UINT16 snes_htmult;
extern void snes_gdma(const address_space *space, UINT8 channels); extern void snes_gdma(const address_space *space, UINT8 channels);
extern void snes_hdma_init(void); extern void snes_hdma_init(void);
extern void snes_hdma(const address_space *space); extern void snes_hdma(const address_space *space);
extern void snes_latch_counters(running_machine *machine);
/* (PPU) Video related */ /* (PPU) Video related */
extern UINT8 *snes_vram; /* Video RAM (Should be 16-bit, but it's easier this way) */ extern UINT8 *snes_vram; /* Video RAM (Should be 16-bit, but it's easier this way) */

View File

@ -70,7 +70,7 @@ struct snes_cart_info snes_cart;
*************************************/ *************************************/
// utility function - latches the H/V counters. Used by IRQ, writes to WRIO, etc. // utility function - latches the H/V counters. Used by IRQ, writes to WRIO, etc.
static void snes_latch_counters(running_machine *machine) void snes_latch_counters(running_machine *machine)
{ {
snes_ppu.beam.current_horz = video_screen_get_hpos(machine->primary_screen) / snes_htmult; snes_ppu.beam.current_horz = video_screen_get_hpos(machine->primary_screen) / snes_htmult;
snes_ppu.beam.latch_vert = video_screen_get_vpos(machine->primary_screen); snes_ppu.beam.latch_vert = video_screen_get_vpos(machine->primary_screen);
@ -572,7 +572,6 @@ READ8_HANDLER( snes_r_io )
read_ophct = 0; read_ophct = 0;
read_opvct = 0; read_opvct = 0;
value = snes_ram[offset]; value = snes_ram[offset];
value &= ~0x40; // clear 'latched counters' flag
value |= (snes_ppu.ppu1_open_bus & 0x20); value |= (snes_ppu.ppu1_open_bus & 0x20);
value |= (snes_ppu.ppu2_version & 0x0f); value |= (snes_ppu.ppu2_version & 0x0f);
snes_ram[offset] = value; // not sure if this is needed... snes_ram[offset] = value; // not sure if this is needed...