Here's another MAME tidy patch. This one adds missing const/statics,

adds/removes entries in header files, and fixes a few potential
multisession issues by explicitly adding initializers.  asic65.c has
significant changes to accomodate using a struct instead of 16
variables, otherwise the changes in this patch are modest and obvious.

[Atari Ace]
This commit is contained in:
Aaron Giles 2008-11-02 02:40:46 +00:00
parent d08215d8ee
commit 4e80367366
53 changed files with 266 additions and 249 deletions

View File

@ -229,8 +229,6 @@ void mips3com_reset(mips3_state *mips);
offs_t mips3com_dasm(mips3_state *mips, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); offs_t mips3com_dasm(mips3_state *mips, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
void mips3com_update_cycle_counting(mips3_state *mips); void mips3com_update_cycle_counting(mips3_state *mips);
void mips3com_map_tlb_entry(mips3_state *mips, int tlbindex);
void mips3com_map_tlb_entries(mips3_state *mips);
void mips3com_asid_changed(mips3_state *mips); void mips3com_asid_changed(mips3_state *mips);
int mips3com_translate_address(mips3_state *mips, int space, int intention, offs_t *address); int mips3com_translate_address(mips3_state *mips, int space, int intention, offs_t *address);
void mips3com_tlbr(mips3_state *mips); void mips3com_tlbr(mips3_state *mips);

View File

@ -575,7 +575,6 @@ void ppccom_exit(powerpc_state *ppc);
void ppccom_reset(powerpc_state *ppc); void ppccom_reset(powerpc_state *ppc);
offs_t ppccom_dasm(powerpc_state *ppc, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); offs_t ppccom_dasm(powerpc_state *ppc, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
void ppccom_update_cycle_counting(powerpc_state *ppc);
int ppccom_translate_address(powerpc_state *ppc, int space, int intention, offs_t *address); int ppccom_translate_address(powerpc_state *ppc, int space, int intention, offs_t *address);

View File

@ -232,6 +232,8 @@ static struct
int offset1; int offset1;
} kbdc8042; } kbdc8042;
static int poll_delay;
static void at_8042_check_keyboard(void); static void at_8042_check_keyboard(void);
@ -266,6 +268,7 @@ static TIMER_CALLBACK( kbdc8042_time )
void kbdc8042_init(const struct kbdc8042_interface *intf) void kbdc8042_init(const struct kbdc8042_interface *intf)
{ {
poll_delay = 10;
memset(&kbdc8042, 0, sizeof(kbdc8042)); memset(&kbdc8042, 0, sizeof(kbdc8042));
kbdc8042.type = intf->type; kbdc8042.type = intf->type;
kbdc8042.set_gate_a20 = intf->set_gate_a20; kbdc8042.set_gate_a20 = intf->set_gate_a20;
@ -347,7 +350,6 @@ static void at_8042_clear_keyboard_received(void)
READ8_HANDLER(kbdc8042_8_r) READ8_HANDLER(kbdc8042_8_r)
{ {
static int poll_delay = 10;
UINT8 data = 0; UINT8 data = 0;
switch (offset) { switch (offset) {

View File

@ -156,7 +156,7 @@ static void configuration_save(running_machine *machine, int config_type, xml_da
GLOBAL VARIABLES GLOBAL VARIABLES
***************************************************************************/ ***************************************************************************/
static const ldplayer_interface *player_interfaces[] = static const ldplayer_interface *const player_interfaces[] =
{ {
// &pr7820_interface, // &pr7820_interface,
&pr8210_interface, &pr8210_interface,

View File

@ -36,7 +36,7 @@
/* Set the data in the chip to Monday 09/09/73 00:00:00 */ /* Set the data in the chip to Monday 09/09/73 00:00:00 */
/* If you ever read this Leejanne, you know what I mean :-) */ /* If you ever read this Leejanne, you know what I mean :-) */
struct pd4990a_s pd4990a = static const struct pd4990a_s pd4990a_initval =
{ {
0x00, /* seconds BCD */ 0x00, /* seconds BCD */
0x00, /* minutes BCD */ 0x00, /* minutes BCD */
@ -47,11 +47,13 @@ struct pd4990a_s pd4990a =
1 /* weekday BCD */ 1 /* weekday BCD */
}; };
struct pd4990a_s pd4990a;
static UINT32 shiftlo,shifthi; static UINT32 shiftlo,shifthi;
static int retraces = 0; /* Assumes 60 retraces a second */ static int retraces = 0; /* Assumes 60 retraces a second */
static int testwaits= 0; static int testwaits= 0;
static int maxwaits= 1; /*switch test every frame*/ static int maxwaits= 0; /*switch test every frame*/
static int testbit = 0; /* Pulses a bit in order to simulate */ static int testbit = 0; /* Pulses a bit in order to simulate */
/* test output */ /* test output */
static int outputbit=0; static int outputbit=0;
@ -326,6 +328,20 @@ WRITE16_HANDLER( pd4990a_control_16_w )
void pd4990a_init(void) void pd4990a_init(void)
{ {
pd4990a = pd4990a_initval;
shiftlo = 0;
shifthi = 0;
retraces = 0;
testwaits = 0;
maxwaits = 1;
testbit = 0;
outputbit = 0;
bitno = 0;
reading = 0;
writting = 0;
clock_line = 0;
command_line =0;
state_save_register_item("pd4990a", 0, pd4990a.seconds); state_save_register_item("pd4990a", 0, pd4990a.seconds);
state_save_register_item("pd4990a", 0, pd4990a.minutes); state_save_register_item("pd4990a", 0, pd4990a.minutes);
state_save_register_item("pd4990a", 0, pd4990a.hours); state_save_register_item("pd4990a", 0, pd4990a.hours);

View File

@ -57,7 +57,6 @@ struct _z80ctc_interface
INITIALIZATION/CONFIGURATION INITIALIZATION/CONFIGURATION
***************************************************************************/ ***************************************************************************/
void z80ctc_reset(const device_config *device);
attotime z80ctc_getperiod(const device_config *device, int ch); attotime z80ctc_getperiod(const device_config *device, int ch);

View File

@ -324,9 +324,6 @@ struct _render_container_user_settings
/* allocate base structures for the rendering system */ /* allocate base structures for the rendering system */
void render_init(running_machine *machine); void render_init(running_machine *machine);
/* set a notifier that we call before doing long scaling operations */
void render_set_rescale_notify(running_machine *machine, int (*notifier)(running_machine *, int, int));
/* return a boolean indicating if the screen is live */ /* return a boolean indicating if the screen is live */
int render_is_live_screen(const device_config *screen); int render_is_live_screen(const device_config *screen);
@ -342,9 +339,6 @@ render_target *render_get_ui_target(void);
/* return the aspect ratio for UI fonts */ /* return the aspect ratio for UI fonts */
float render_get_ui_aspect(void); float render_get_ui_aspect(void);
/* performs an input hit test */
int render_input_hit_test(render_target *target, INT32 target_x, INT32 target_y, const char *input_tag, UINT32 input_mask);
/* ----- render target management ----- */ /* ----- render target management ----- */

View File

@ -217,9 +217,9 @@ static render_texture *hilight_texture;
static render_texture *arrow_texture; static render_texture *arrow_texture;
static const char *priortext = "Return to Prior Menu"; static const char priortext[] = "Return to Prior Menu";
static const char *backtext = "Return to " CAPSTARTGAMENOUN; static const char backtext[] = "Return to " CAPSTARTGAMENOUN;
static const char *exittext = "Exit"; static const char exittext[] = "Exit";
static const rgb_t text_fgcolor = MAKE_ARGB(0xff,0xff,0xff,0xff); static const rgb_t text_fgcolor = MAKE_ARGB(0xff,0xff,0xff,0xff);
static const rgb_t text_bgcolor = MAKE_ARGB(0xe0,0x80,0x80,0x80); static const rgb_t text_bgcolor = MAKE_ARGB(0xe0,0x80,0x80,0x80);

View File

@ -973,7 +973,7 @@ DISCRETE_SOUND_END
* *
****************************************************************/ ****************************************************************/
SOUND_START( dkong) static SOUND_START( dkong)
{ {
dkong_state *state = machine->driver_data; dkong_state *state = machine->driver_data;

View File

@ -78,8 +78,6 @@ Versions known to exist but not dumped:
#include "sound/okim6295.h" #include "sound/okim6295.h"
#include "sound/ymz280b.h" #include "sound/ymz280b.h"
extern UINT16 *cave_spriteram16_2;
/*************************************************************************** /***************************************************************************

View File

@ -163,7 +163,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static UINT8 scroll; static UINT8 scroll;
static UINT8 scrollhi; static UINT8 scrollhi;
VIDEO_UPDATE( chanbara ) static VIDEO_UPDATE( chanbara )
{ {
tilemap_set_scrolly(bg2_tilemap,0,scroll | (scrollhi << 8)); tilemap_set_scrolly(bg2_tilemap,0,scroll | (scrollhi << 8));
tilemap_draw(bitmap, cliprect, bg2_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, bg2_tilemap, 0, 0);

View File

@ -998,7 +998,7 @@ static GFXDECODE_START( cosmica )
GFXDECODE_END GFXDECODE_END
static const char *cosmica_sample_names[] = static const char *const cosmica_sample_names[] =
{ {
"*cosmica", "*cosmica",
"backgr.wav", "backgr.wav",

View File

@ -337,14 +337,14 @@ static TIMER_DEVICE_CALLBACK( ddealer_mcu_sim )
WRITE16_HANDLER( back_vram_w ) static WRITE16_HANDLER( back_vram_w )
{ {
COMBINE_DATA(&back_vram[offset]); COMBINE_DATA(&back_vram[offset]);
tilemap_mark_tile_dirty(back_tilemap,offset); tilemap_mark_tile_dirty(back_tilemap,offset);
} }
WRITE16_HANDLER( ddealer_vregs_w ) static WRITE16_HANDLER( ddealer_vregs_w )
{ {
COMBINE_DATA(&ddealer_vregs[offset]); COMBINE_DATA(&ddealer_vregs[offset]);
} }

View File

@ -86,8 +86,8 @@ A ||| |______| |
#include "sound/ay8910.h" #include "sound/ay8910.h"
//should be taken from crt params //should be taken from crt params
static int maxy=25; static const int maxy=25;
static int maxx=80; static const int maxx=80;
static int bank=0; static int bank=0;
static UINT8 *videobuf; static UINT8 *videobuf;

View File

@ -339,7 +339,7 @@ static WRITE16_HANDLER( galsnew_6295_bankswitch_w )
static UINT16 vram_0_bank_num = 0, vram_1_bank_num = 0; static UINT16 vram_0_bank_num = 0, vram_1_bank_num = 0;
WRITE16_HANDLER(galsnew_vram_0_bank_w) static WRITE16_HANDLER(galsnew_vram_0_bank_w)
{ {
int i; int i;
if(vram_0_bank_num != data) if(vram_0_bank_num != data)
@ -355,7 +355,7 @@ WRITE16_HANDLER(galsnew_vram_0_bank_w)
} }
} }
WRITE16_HANDLER(galsnew_vram_1_bank_w) static WRITE16_HANDLER(galsnew_vram_1_bank_w)
{ {
int i; int i;
if(vram_1_bank_num != data) if(vram_1_bank_num != data)
@ -695,7 +695,7 @@ ROM_START( fantasia )
ROM_END ROM_END
DRIVER_INIT(galsnew) static DRIVER_INIT(galsnew)
{ {
UINT32 *src = (UINT32 *)memory_region(machine, "gfx3" ); UINT32 *src = (UINT32 *)memory_region(machine, "gfx3" );
UINT32 *dst = (UINT32 *)memory_region(machine, "gfx2" ); UINT32 *dst = (UINT32 *)memory_region(machine, "gfx2" );

View File

@ -518,7 +518,7 @@ ADDRESS_MAP_END
* *
*************************************/ *************************************/
INPUT_PORTS_START( firefox ) static INPUT_PORTS_START( firefox )
PORT_START("rdin0") PORT_START("rdin0")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )

View File

@ -180,15 +180,15 @@ Frequencies: 68k is XTAL_32MHZ/2
//UINT16 *gs_videoram3; //UINT16 *gs_videoram3;
static UINT16 *gs_mixer_regs; static UINT16 *gs_mixer_regs;
static UINT16 dmmy_8f_ret;
/*** MISC READ / WRITE HANDLERS **********************************************/ /*** MISC READ / WRITE HANDLERS **********************************************/
static READ16_HANDLER(dmmy_8f) static READ16_HANDLER(dmmy_8f)
{ {
static int ret = 0xFFFF; dmmy_8f_ret = ~dmmy_8f_ret;
ret = ~ret; return dmmy_8f_ret;
return ret;
} }
/*** SOUND RELATED ***********************************************************/ /*** SOUND RELATED ***********************************************************/
@ -986,6 +986,10 @@ static WRITE16_HANDLER( vbl_toggle_w )
static void mcu_init( running_machine *machine ) static void mcu_init( running_machine *machine )
{ {
dmmy_8f_ret = 0xFFFF;
pending_command = 0;
mcu_data = 0;
memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20008a, 0x20008b, 0, 0, twrldc94_mcu_w); memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20008a, 0x20008b, 0, 0, twrldc94_mcu_w);
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20008a, 0x20008b, 0, 0, twrldc94_mcu_r); memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20008a, 0x20008b, 0, 0, twrldc94_mcu_r);

View File

@ -124,7 +124,7 @@ static VIDEO_UPDATE(hotblock)
int y,x,count; int y,x,count;
int i; int i;
static int xxx=320,yyy=204; static const int xxx=320,yyy=204;
fillbitmap(bitmap, get_black_pen(screen->machine), 0); fillbitmap(bitmap, get_black_pen(screen->machine), 0);

View File

@ -412,7 +412,7 @@ static VIDEO_UPDATE( jalmah )
return 0; return 0;
} }
VIDEO_UPDATE( urashima ) static VIDEO_UPDATE( urashima )
{ {
/*this game doesn't use the RANGE register at all.*/ /*this game doesn't use the RANGE register at all.*/
tilemap_set_scrollx( sc0_tilemap_0, 0, jm_scrollram[0]); tilemap_set_scrollx( sc0_tilemap_0, 0, jm_scrollram[0]);
@ -525,7 +525,7 @@ static WRITE16_HANDLER( jalmah_scroll_w )
} }
} }
WRITE16_HANDLER( urashima_bank_w ) static WRITE16_HANDLER( urashima_bank_w )
{ {
if (ACCESSING_BITS_0_7) if (ACCESSING_BITS_0_7)
{ {
@ -628,7 +628,7 @@ if((0xffff - input_port_read(machine, tag)) & _bit_) { jm_shared_ram[_offset_] =
/*Funky "DMA" / protection thing*/ /*Funky "DMA" / protection thing*/
/*---- -x-- "DMA" execute.*/ /*---- -x-- "DMA" execute.*/
/*---- ---x used too very often,I don't have any clue of what it is,it might just be the source or the destination address.*/ /*---- ---x used too very often,I don't have any clue of what it is,it might just be the source or the destination address.*/
WRITE16_HANDLER( urashima_dma_w ) static WRITE16_HANDLER( urashima_dma_w )
{ {
if(data & 4) if(data & 4)
{ {

View File

@ -114,12 +114,12 @@ Medium size chip with heat sink on it
#include "cpu/mips/mips3.h" #include "cpu/mips/mips3.h"
VIDEO_START(magictg) static VIDEO_START(magictg)
{ {
} }
VIDEO_UPDATE(magictg) static VIDEO_UPDATE(magictg)
{ {
return 0; return 0;
} }

View File

@ -125,14 +125,14 @@ static int _svp_cpu_number;
static int _genesis_snd_z80_cpu_number; static int _genesis_snd_z80_cpu_number;
int segac2_bg_pal_lookup[4] = { 0x00, 0x10, 0x20, 0x30 }; int segac2_bg_pal_lookup[4];
int segac2_sp_pal_lookup[4] = { 0x00, 0x10, 0x20, 0x30 }; int segac2_sp_pal_lookup[4];
// hacks for C2 // hacks for C2
int genvdp_use_cram = 1; // c2 uses it's own palette ram int genvdp_use_cram = 0; // c2 uses it's own palette ram
int genesis_has_z80; int genesis_has_z80;
int genesis_always_irq6 = 0; // c2 never enables the irq6, different source?? int genesis_always_irq6 = 0; // c2 never enables the irq6, different source??
int genesis_other_hacks = 1; // misc hacks int genesis_other_hacks = 0; // misc hacks
INLINE UINT16 get_hposition(void); INLINE UINT16 get_hposition(void);

View File

@ -1,7 +1,8 @@
extern DRIVER_INIT( megadriv_c2 );
extern DRIVER_INIT( megadrie ); extern DRIVER_INIT( megadrie );
extern DRIVER_INIT( megadriv ); extern DRIVER_INIT( megadriv );
extern DRIVER_INIT( megadrij ); extern DRIVER_INIT( megadrij );
extern DRIVER_INIT( megadsvp ); extern DRIVER_INIT( _32x );
INPUT_PORTS_EXTERN(megadriv); INPUT_PORTS_EXTERN(megadriv);
INPUT_PORTS_EXTERN(aladbl); INPUT_PORTS_EXTERN(aladbl);
@ -9,10 +10,13 @@ INPUT_PORTS_EXTERN(megadri6);
INPUT_PORTS_EXTERN(ssf2ghw); INPUT_PORTS_EXTERN(ssf2ghw);
INPUT_PORTS_EXTERN(megdsvp); INPUT_PORTS_EXTERN(megdsvp);
MACHINE_DRIVER_EXTERN( megdsvppal );
MACHINE_DRIVER_EXTERN(megadriv); MACHINE_DRIVER_EXTERN(megadriv);
MACHINE_DRIVER_EXTERN(megadpal); MACHINE_DRIVER_EXTERN(megadpal);
MACHINE_DRIVER_EXTERN(_32x);
MACHINE_DRIVER_EXTERN(megdsvp); MACHINE_DRIVER_EXTERN(megdsvp);
MACHINE_DRIVER_EXTERN( genesis_32x );
MACHINE_DRIVER_EXTERN( genesis_scd );
MACHINE_DRIVER_EXTERN( genesis_32x_scd );
extern UINT16* megadriv_backupram; extern UINT16* megadriv_backupram;
extern int megadriv_backupram_length; extern int megadriv_backupram_length;
@ -39,3 +43,16 @@ extern UINT8 (*megadrive_io_read_data_port_ptr)(int offset);
extern void (*megadrive_io_write_data_port_ptr)(int offset, UINT16 data); extern void (*megadrive_io_write_data_port_ptr)(int offset, UINT16 data);
extern UINT8 megadrive_io_data_regs[3]; extern UINT8 megadrive_io_data_regs[3];
extern UINT8 megadrive_io_ctrl_regs[3]; extern UINT8 megadrive_io_ctrl_regs[3];
extern UINT16* megadrive_vdp_palette_lookup;
extern UINT16* megadrive_vdp_palette_lookup_sprite; // for C2
extern UINT16* megadrive_vdp_palette_lookup_shadow;
extern UINT16* megadrive_vdp_palette_lookup_highlight;
extern int segac2_bg_pal_lookup[4];
extern int segac2_sp_pal_lookup[4];
extern int genvdp_use_cram;
extern int genesis_has_z80;
extern int genesis_always_irq6;
extern int genesis_other_hacks;

View File

@ -232,13 +232,13 @@ static MC6845_UPDATE_ROW( update_row )
} }
MC6845_ON_HSYNC_CHANGED(hsync_changed) static MC6845_ON_HSYNC_CHANGED(hsync_changed)
{ {
/* update any video up to the current scanline */ /* update any video up to the current scanline */
video_screen_update_now(device->machine->primary_screen); video_screen_update_now(device->machine->primary_screen);
} }
MC6845_ON_VSYNC_CHANGED(vsync_changed) static MC6845_ON_VSYNC_CHANGED(vsync_changed)
{ {
cpunum_set_input_line(device->machine, 0, 0, vsync ? ASSERT_LINE : CLEAR_LINE); cpunum_set_input_line(device->machine, 0, 0, vsync ? ASSERT_LINE : CLEAR_LINE);
} }

View File

@ -318,8 +318,12 @@ static void meritm_vdp1_interrupt(running_machine *machine, int i)
} }
} }
static int layer0_enabled, layer1_enabled;
static VIDEO_START( meritm ) static VIDEO_START( meritm )
{ {
layer0_enabled = layer1_enabled = 1;
vdp0_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen); vdp0_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
v9938_init (machine, 0, machine->primary_screen, vdp0_bitmap, MODEL_V9938, 0x20000, meritm_vdp0_interrupt); v9938_init (machine, 0, machine->primary_screen, vdp0_bitmap, MODEL_V9938, 0x20000, meritm_vdp0_interrupt);
v9938_reset(0); v9938_reset(0);
@ -336,8 +340,6 @@ static VIDEO_START( meritm )
} }
static int layer0_enabled = 1, layer1_enabled = 1;
static VIDEO_UPDATE( meritm ) static VIDEO_UPDATE( meritm )
{ {
if(input_code_pressed_once(KEYCODE_Q)) if(input_code_pressed_once(KEYCODE_Q))

View File

@ -1008,7 +1008,7 @@ static WRITE32_HANDLER( bankoffset_w )
static UINT32 m_n_dmaoffset; static UINT32 m_n_dmaoffset;
static UINT32 m_n_dmabias; static UINT32 m_n_dmabias;
static UINT32 m_n_tektagdmaoffset = 0xffffffff; static UINT32 m_n_tektagdmaoffset;
static WRITE32_HANDLER( dmaoffset_w ) static WRITE32_HANDLER( dmaoffset_w )
{ {
@ -1330,7 +1330,7 @@ static READ8_HANDLER( s12_mcu_rtc_r )
return ret; return ret;
} }
static int s12_lastpB = 0x50, s12_setstate = 0, s12_setnum, s12_settings[8]; static int s12_lastpB, s12_setstate, s12_setnum, s12_settings[8];
static READ8_HANDLER( s12_mcu_portB_r ) static READ8_HANDLER( s12_mcu_portB_r )
{ {
@ -1438,6 +1438,17 @@ static DRIVER_INIT( namcos12 )
psx_dma_install_read_handler( 5, namcos12_rom_read ); psx_dma_install_read_handler( 5, namcos12_rom_read );
memory_configure_bank( 1, 0, memory_region_length( machine, "user2" ) / 0x200000, memory_region( machine, "user2" ), 0x200000 ); memory_configure_bank( 1, 0, memory_region_length( machine, "user2" ) / 0x200000, memory_region( machine, "user2" ), 0x200000 );
s12_porta = 0;
s12_rtcstate = 0;
s12_lastpB = 0x50;
s12_setstate = 0;
s12_setnum = 0;
memset(s12_settings, 0, sizeof(s12_settings));
m_n_tektagdmaoffset = 0xffffffff;
m_n_dmaoffset = 0;
m_n_dmabias = 0;
m_n_bankoffset = 0; m_n_bankoffset = 0;
memory_set_bank( 1, 0 ); memory_set_bank( 1, 0 );

View File

@ -247,12 +247,6 @@ static READ16_HANDLER( palette_r )
return paletteram16[offset + palbank * 0x200]; return paletteram16[offset + palbank * 0x200];
} }
extern UINT16* megadrive_vdp_palette_lookup;
extern UINT16* megadrive_vdp_palette_lookup_sprite; // for C2
extern UINT16* megadrive_vdp_palette_lookup_shadow;
extern UINT16* megadrive_vdp_palette_lookup_highlight;
UINT16* megadrive_vdp_palette_lookup_segac2; UINT16* megadrive_vdp_palette_lookup_segac2;
UINT16* megadrive_vdp_palette_lookup_sprite_segac2; UINT16* megadrive_vdp_palette_lookup_sprite_segac2;
UINT16* megadrive_vdp_palette_lookup_shadow_segac2; UINT16* megadrive_vdp_palette_lookup_shadow_segac2;
@ -326,9 +320,6 @@ static WRITE16_HANDLER( palette_w )
******************************************************************************/ ******************************************************************************/
extern int segac2_bg_pal_lookup[4];
extern int segac2_sp_pal_lookup[4];
static void recompute_palette_tables(void) static void recompute_palette_tables(void)
{ {
int i; int i;
@ -1868,12 +1859,6 @@ it should be, otherwise I don't see how the formula could be computed.
******************************************************************************/ ******************************************************************************/
extern int genvdp_use_cram;
extern int genesis_has_z80;
extern int genesis_always_irq6;
extern int genesis_other_hacks;
extern DRIVER_INIT( megadriv_c2 );
static void segac2_common_init(running_machine* machine, int (*func)(int in)) static void segac2_common_init(running_machine* machine, int (*func)(int in))
{ {
DRIVER_INIT_CALL( megadriv_c2 ); DRIVER_INIT_CALL( megadriv_c2 );

View File

@ -80,7 +80,7 @@ static UINT16 io_reg[IO_SIZE];
static UINT16 fifo[FIFO_SIZE]; static UINT16 fifo[FIFO_SIZE];
static UINT16 fptr; static UINT16 fptr;
static int jpeg_addr=-1; static int jpeg_addr;
static UINT16 jpeg1,jpeg2; static UINT16 jpeg1,jpeg2;
static int jpeg_h=0; static int jpeg_h=0;
static int jpeg_w=0; static int jpeg_w=0;
@ -588,6 +588,7 @@ ROM_END
static DRIVER_INIT(sliver) static DRIVER_INIT(sliver)
{ {
jpeg_addr = -1;
colorram=auto_malloc(256*3); colorram=auto_malloc(256*3);
} }

View File

@ -650,7 +650,7 @@ static const UINT8 address_substitution_high[] =
0x2b,0x25,0x28,0x2f,0x26,0x22,0x23,0x2a,0x2d,0x24,0x2e,0x20,0x27,0x2c,0x21,0x29 0x2b,0x25,0x28,0x2f,0x26,0x22,0x23,0x2a,0x2d,0x24,0x2e,0x20,0x27,0x2c,0x21,0x29
}; };
DRIVER_INIT( sblast2b ) static DRIVER_INIT( sblast2b )
{ {
int i, cipherText, plainText, newAddress; int i, cipherText, plainText, newAddress;
UINT8 *src = memory_region(machine, "user7"); UINT8 *src = memory_region(machine, "user7");

View File

@ -375,8 +375,8 @@ VIDEO_START( snookr10 );
VIDEO_START( apple10 ); VIDEO_START( apple10 );
VIDEO_UPDATE( snookr10 ); VIDEO_UPDATE( snookr10 );
int outportl, outporth; static int outportl, outporth;
int bit0, bit1, bit2, bit3, bit4, bit5; static int bit0, bit1, bit2, bit3, bit4, bit5;
/********************** /**********************
* Read/Write Handlers * * Read/Write Handlers *

View File

@ -3499,7 +3499,7 @@ static INPUT_PORTS_START( mjnquest )
PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END INPUT_PORTS_END
INPUT_PORTS_START( yesnoj ) static INPUT_PORTS_START( yesnoj )
/* 0xb00000 -> 0x20c0e0.b ($40e0,A5) */ /* 0xb00000 -> 0x20c0e0.b ($40e0,A5) */
PORT_START("DSWA") PORT_START("DSWA")
PORT_DIPNAME( 0x01, 0x00, "Print Results" ) PORT_DIPNAME( 0x01, 0x00, "Print Results" )

View File

@ -54,7 +54,7 @@ static VIDEO_UPDATE(ttchamp)
{ {
int y,x,count; int y,x,count;
// int i; // int i;
static int xxx=320,yyy=204; static const int xxx=320,yyy=204;
fillbitmap(bitmap, get_black_pen(screen->machine), 0); fillbitmap(bitmap, get_black_pen(screen->machine), 0);

View File

@ -100,7 +100,7 @@ static VIDEO_UPDATE(twins)
{ {
int y,x,count; int y,x,count;
int i; int i;
static int xxx=320,yyy=204; static const int xxx=320,yyy=204;
fillbitmap(bitmap, get_black_pen(screen->machine), 0); fillbitmap(bitmap, get_black_pen(screen->machine), 0);
@ -205,7 +205,7 @@ static VIDEO_UPDATE(twinsa)
{ {
int y,x,count; int y,x,count;
int i; int i;
static int xxx=320,yyy=204; static const int xxx=320,yyy=204;
fillbitmap(bitmap, get_black_pen(screen->machine), 0); fillbitmap(bitmap, get_black_pen(screen->machine), 0);

View File

@ -288,8 +288,8 @@ static UINT8 dc_40103;
static UINT8 te_40103; static UINT8 te_40103;
static UINT8 ld_40103; static UINT8 ld_40103;
UINT8 ant_jckp, jckp, ant_cio, c_io, hp_1, hp_2, bell, aux3, dvrt; static UINT8 ant_jckp, jckp, ant_cio, c_io, hp_1, hp_2, bell, aux3, dvrt;
unsigned long count0, count1, count2, count3, count4; static unsigned long count0, count1, count2, count3, count4;
/* Baby vars */ /* Baby vars */
static UINT8 sbp0, sbp2, sbp3; static UINT8 sbp0, sbp2, sbp3;
@ -302,7 +302,7 @@ static UINT8 sbp0, sbp2, sbp3;
static tilemap *bg_tilemap; static tilemap *bg_tilemap;
/* BCD to Seven Segment Decoder */ /* BCD to Seven Segment Decoder */
UINT8 dec_7seg(int data) static UINT8 dec_7seg(int data)
{ {
UINT8 segment; UINT8 segment;
switch (data) switch (data)
@ -324,7 +324,7 @@ UINT8 dec_7seg(int data)
} }
/* Display a seven digit counter on layout - Index points to less significant digit*/ /* Display a seven digit counter on layout - Index points to less significant digit*/
void count_7dig(unsigned long data, UINT8 index) static void count_7dig(unsigned long data, UINT8 index)
{ {
UINT8 i; UINT8 i;
char strn[7]; char strn[7];
@ -336,7 +336,7 @@ void count_7dig(unsigned long data, UINT8 index)
} }
} }
PALETTE_INIT( videopkr ) static PALETTE_INIT( videopkr )
{ {
int j; int j;
@ -362,7 +362,7 @@ PALETTE_INIT( videopkr )
} }
} }
PALETTE_INIT( babypkr ) static PALETTE_INIT( babypkr )
{ {
int j; int j;
@ -402,18 +402,18 @@ static TILE_GET_INFO( get_bg_tile_info )
} }
VIDEO_START( videopkr ) static VIDEO_START( videopkr )
{ {
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
} }
VIDEO_START( vidadcba ) static VIDEO_START( vidadcba )
{ {
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 16, 8, 32, 32); bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
} }
VIDEO_UPDATE( videopkr ) static VIDEO_UPDATE( videopkr )
{ {
tilemap_mark_all_tiles_dirty(bg_tilemap); tilemap_mark_all_tiles_dirty(bg_tilemap);
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);

View File

@ -10,7 +10,6 @@
/*----------- defined in drivers/bzone.c -----------*/ /*----------- defined in drivers/bzone.c -----------*/
extern UINT8 rb_input_select; extern UINT8 rb_input_select;
READ8_HANDLER( bzone_IN0_r );
/*----------- defined in audio/bzone.c -----------*/ /*----------- defined in audio/bzone.c -----------*/

View File

@ -6,6 +6,8 @@
/*----------- defined in video/cave.c -----------*/ /*----------- defined in video/cave.c -----------*/
extern UINT16 *cave_spriteram16_2;
extern int cave_spritetype; extern int cave_spritetype;
extern int cave_kludge; extern int cave_kludge;

View File

@ -5,6 +5,7 @@
*************************************************************************/ *************************************************************************/
#include "sound/custom.h" #include "sound/custom.h"
#include "machine/z80ctc.h"
/*----------- defined in machine/cchasm.c -----------*/ /*----------- defined in machine/cchasm.c -----------*/
@ -12,6 +13,8 @@ WRITE16_HANDLER( cchasm_led_w );
/*----------- defined in audio/cchasm.c -----------*/ /*----------- defined in audio/cchasm.c -----------*/
extern z80ctc_interface cchasm_ctc_intf;
READ8_HANDLER( cchasm_snd_io_r ); READ8_HANDLER( cchasm_snd_io_r );
WRITE8_HANDLER( cchasm_snd_io_w ); WRITE8_HANDLER( cchasm_snd_io_w );

View File

@ -14,9 +14,6 @@ WRITE16_HANDLER( cps1_eeprom_port_w );
INTERRUPT_GEN( cps1_qsound_interrupt ); INTERRUPT_GEN( cps1_qsound_interrupt );
READ16_HANDLER( cps1_dsw_r ); READ16_HANDLER( cps1_dsw_r );
READ16_HANDLER( cps1_in1_r );
READ16_HANDLER( cps1_in2_r );
READ16_HANDLER( cps1_in3_r );
WRITE16_HANDLER( cps1_coinctrl_w ); WRITE16_HANDLER( cps1_coinctrl_w );
INTERRUPT_GEN( cps1_interrupt ); INTERRUPT_GEN( cps1_interrupt );

View File

@ -105,16 +105,13 @@ DRIVER_INIT( pisces );
DRIVER_INIT( checkmaj ); DRIVER_INIT( checkmaj );
DRIVER_INIT( dingo ); DRIVER_INIT( dingo );
DRIVER_INIT( dingoe ); DRIVER_INIT( dingoe );
DRIVER_INIT( kingball );
DRIVER_INIT( mooncrsu ); DRIVER_INIT( mooncrsu );
DRIVER_INIT( mooncrst ); DRIVER_INIT( mooncrst );
DRIVER_INIT( mooncrgx ); DRIVER_INIT( mooncrgx );
DRIVER_INIT( moonqsr ); DRIVER_INIT( moonqsr );
DRIVER_INIT( checkman ); DRIVER_INIT( checkman );
DRIVER_INIT( azurian );
DRIVER_INIT( 4in1 ); DRIVER_INIT( 4in1 );
DRIVER_INIT( ladybugg ); DRIVER_INIT( ladybugg );
DRIVER_INIT( gmgalax );
WRITE8_HANDLER( galaxold_nmi_enable_w ); WRITE8_HANDLER( galaxold_nmi_enable_w );
@ -131,17 +128,12 @@ WRITE8_HANDLER( galaxold_leds_w );
READ8_HANDLER( scramblb_protection_1_r ); READ8_HANDLER( scramblb_protection_1_r );
READ8_HANDLER( scramblb_protection_2_r ); READ8_HANDLER( scramblb_protection_2_r );
WRITE8_HANDLER( kingball_speech_dip_w );
WRITE8_HANDLER( kingball_sound1_w );
WRITE8_HANDLER( kingball_sound2_w );
WRITE8_HANDLER( _4in1_bank_w ); WRITE8_HANDLER( _4in1_bank_w );
CUSTOM_INPUT( _4in1_fake_port_r ); CUSTOM_INPUT( _4in1_fake_port_r );
WRITE8_HANDLER( zigzag_sillyprotection_w ); WRITE8_HANDLER( zigzag_sillyprotection_w );
INTERRUPT_GEN( hunchbks_vh_interrupt ); INTERRUPT_GEN( hunchbks_vh_interrupt );
INTERRUPT_GEN( gmgalax_vh_interrupt );
/*----------- defined in machine/scramble.c -----------*/ /*----------- defined in machine/scramble.c -----------*/
@ -175,7 +167,6 @@ DRIVER_INIT( anteater );
DRIVER_INIT( rescue ); DRIVER_INIT( rescue );
DRIVER_INIT( minefld ); DRIVER_INIT( minefld );
DRIVER_INIT( losttomb ); DRIVER_INIT( losttomb );
DRIVER_INIT( superbon );
DRIVER_INIT( hustler ); DRIVER_INIT( hustler );
DRIVER_INIT( billiard ); DRIVER_INIT( billiard );
DRIVER_INIT( mrkougar ); DRIVER_INIT( mrkougar );

View File

@ -29,7 +29,6 @@ INPUT_PORTS_EXTERN( gottlieb2_sound );
extern UINT8 gottlieb_gfxcharlo; extern UINT8 gottlieb_gfxcharlo;
extern UINT8 gottlieb_gfxcharhi; extern UINT8 gottlieb_gfxcharhi;
extern UINT8 *gottlieb_charram; extern UINT8 *gottlieb_charram;
extern UINT8 *gottlieb_riot_regs;
extern WRITE8_HANDLER( gottlieb_videoram_w ); extern WRITE8_HANDLER( gottlieb_videoram_w );
extern WRITE8_HANDLER( gottlieb_charram_w ); extern WRITE8_HANDLER( gottlieb_charram_w );

View File

@ -394,7 +394,6 @@ extern READ8_HANDLER( snes_r_bank6 );
extern READ8_HANDLER( snes_r_bank7 ); extern READ8_HANDLER( snes_r_bank7 );
extern WRITE8_HANDLER( snes_w_bank1 ); extern WRITE8_HANDLER( snes_w_bank1 );
extern WRITE8_HANDLER( snes_w_bank2 ); extern WRITE8_HANDLER( snes_w_bank2 );
extern WRITE8_HANDLER( snes_w_bank3 );
extern WRITE8_HANDLER( snes_w_bank4 ); extern WRITE8_HANDLER( snes_w_bank4 );
extern WRITE8_HANDLER( snes_w_bank5 ); extern WRITE8_HANDLER( snes_w_bank5 );
extern WRITE8_HANDLER( snes_w_bank6 ); extern WRITE8_HANDLER( snes_w_bank6 );

View File

@ -6,8 +6,6 @@
/*----------- defined in drivers/snk.c -----------*/ /*----------- defined in drivers/snk.c -----------*/
extern UINT8 *snk_rambase;
extern READ8_HANDLER ( snk_cpuA_nmi_trigger_r ); extern READ8_HANDLER ( snk_cpuA_nmi_trigger_r );
extern WRITE8_HANDLER( snk_cpuA_nmi_ack_w ); extern WRITE8_HANDLER( snk_cpuA_nmi_ack_w );
@ -20,7 +18,6 @@ extern WRITE8_HANDLER( snk_cpuB_nmi_ack_w );
extern PALETTE_INIT( tnk3 ); extern PALETTE_INIT( tnk3 );
extern VIDEO_START( marvins ); extern VIDEO_START( marvins );
extern VIDEO_START( madcrash );
extern VIDEO_START( jcross ); extern VIDEO_START( jcross );
extern VIDEO_START( sgladiat ); extern VIDEO_START( sgladiat );
extern VIDEO_START( hal21 ); extern VIDEO_START( hal21 );

View File

@ -47,7 +47,4 @@ WRITE8_HANDLER( starwars_main_wr_w );
WRITE8_HANDLER( starwars_soundrst_w ); WRITE8_HANDLER( starwars_soundrst_w );
READ8_HANDLER( starwars_sin_r ); READ8_HANDLER( starwars_sin_r );
READ8_HANDLER( starwars_m6532_r );
WRITE8_HANDLER( starwars_sout_w ); WRITE8_HANDLER( starwars_sout_w );
WRITE8_HANDLER( starwars_m6532_w );

View File

@ -14,10 +14,8 @@ DRIVER_INIT ( stv );
/*----------- defined in drivers/stvinit.c -----------*/ /*----------- defined in drivers/stvinit.c -----------*/
DRIVER_INIT( ic13 );
NVRAM_HANDLER( stv ); NVRAM_HANDLER( stv );
void install_stvbios_speedups(running_machine *machine); void install_stvbios_speedups(running_machine *machine);
DRIVER_INIT(bakubaku);
DRIVER_INIT(mausuke); DRIVER_INIT(mausuke);
DRIVER_INIT(puyosun); DRIVER_INIT(puyosun);
DRIVER_INIT(shienryu); DRIVER_INIT(shienryu);

View File

@ -74,7 +74,6 @@ extern UINT16 *tx1_objram;
extern UINT16 *tx1_rcram; extern UINT16 *tx1_rcram;
extern size_t tx1_objram_size; extern size_t tx1_objram_size;
PALETTE_INIT( tx1 ); PALETTE_INIT( tx1 );
WRITE16_HANDLER( tx1_vram_w );
VIDEO_START( tx1 ); VIDEO_START( tx1 );
VIDEO_UPDATE( tx1 ); VIDEO_UPDATE( tx1 );
VIDEO_EOF( tx1 ); VIDEO_EOF( tx1 );
@ -89,15 +88,12 @@ extern UINT16 *buggyboy_rcram;
extern UINT16 *buggyboy_vram; extern UINT16 *buggyboy_vram;
extern size_t buggyboy_objram_size; extern size_t buggyboy_objram_size;
extern size_t buggyboy_rcram_size; extern size_t buggyboy_rcram_size;
PALETTE_INIT( buggybjr );
PALETTE_INIT( buggyboy ); PALETTE_INIT( buggyboy );
WRITE16_HANDLER( buggyboy_vram_w );
VIDEO_START( buggyboy ); VIDEO_START( buggyboy );
VIDEO_UPDATE( buggyboy ); VIDEO_UPDATE( buggyboy );
VIDEO_EOF( buggyboy ); VIDEO_EOF( buggyboy );
extern UINT16 *buggybjr_vram; extern UINT16 *buggybjr_vram;
WRITE16_HANDLER( buggybjr_vram_w );
VIDEO_START( buggybjr ); VIDEO_START( buggybjr );
VIDEO_UPDATE( buggybjr ); VIDEO_UPDATE( buggybjr );
WRITE16_HANDLER( buggyboy_slincs_w ); WRITE16_HANDLER( buggyboy_slincs_w );

View File

@ -19,25 +19,28 @@
* *
*************************************/ *************************************/
static UINT8 asic65_type; static struct _asic65_t
static int asic65_command; {
static UINT16 asic65_param[32]; UINT8 type;
static UINT16 asic65_yorigin = 0x1800; int command;
static UINT8 asic65_param_index; UINT16 param[32];
static UINT8 asic65_result_index; UINT16 yorigin;
static UINT8 asic65_reset_state; UINT8 param_index;
static UINT8 asic65_last_bank; UINT8 result_index;
UINT8 reset_state;
UINT8 last_bank;
/* ROM-based interface states */ /* ROM-based interface states */
static UINT8 asic65_cpunum; UINT8 cpunum;
static UINT8 asic65_tfull; UINT8 tfull;
static UINT8 asic65_68full; UINT8 _68full;
static UINT8 asic65_cmd; UINT8 cmd;
static UINT8 asic65_xflg; UINT8 xflg;
static UINT16 asic65_68data; UINT16 _68data;
static UINT16 asic65_tdata; UINT16 tdata;
static FILE * asic65_log; FILE * log;
} asic65;
WRITE16_HANDLER( asic65_w ); WRITE16_HANDLER( asic65_w );
WRITE16_HANDLER( asic65_data_w ); WRITE16_HANDLER( asic65_data_w );
@ -125,9 +128,11 @@ static const UINT8 command_map[3][MAX_COMMANDS] =
void asic65_config(running_machine *machine, int asictype) void asic65_config(running_machine *machine, int asictype)
{ {
asic65_type = asictype; memset(&asic65, 0, sizeof(asic65));
if (asic65_type == ASIC65_ROMBASED) asic65.type = asictype;
asic65_cpunum = mame_find_cpu_index(machine, "asic65"); asic65.yorigin = 0x1800;
if (asic65.type == ASIC65_ROMBASED)
asic65.cpunum = mame_find_cpu_index(machine, "asic65");
} }
@ -141,8 +146,8 @@ void asic65_config(running_machine *machine, int asictype)
void asic65_reset(running_machine *machine, int state) void asic65_reset(running_machine *machine, int state)
{ {
/* rom-based means reset and clear states */ /* rom-based means reset and clear states */
if (asic65_type == ASIC65_ROMBASED) if (asic65.type == ASIC65_ROMBASED)
cpunum_set_input_line(machine, asic65_cpunum, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); cpunum_set_input_line(machine, asic65.cpunum, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
/* otherwise, do it manually */ /* otherwise, do it manually */
else else
@ -150,18 +155,18 @@ void asic65_reset(running_machine *machine, int state)
cpunum_suspend(mame_find_cpu_index(machine, "asic65"), SUSPEND_REASON_DISABLE, 1); cpunum_suspend(mame_find_cpu_index(machine, "asic65"), SUSPEND_REASON_DISABLE, 1);
/* if reset is being signalled, clear everything */ /* if reset is being signalled, clear everything */
if (state && !asic65_reset_state) if (state && !asic65.reset_state)
asic65_command = -1; asic65.command = -1;
/* if reset is going high, latch the command */ /* if reset is going high, latch the command */
else if (!state && asic65_reset_state) else if (!state && asic65.reset_state)
{ {
if (asic65_command != -1) if (asic65.command != -1)
asic65_data_w(machine, 1, asic65_command, 0xffff); asic65_data_w(machine, 1, asic65.command, 0xffff);
} }
/* update the state */ /* update the state */
asic65_reset_state = state; asic65.reset_state = state;
} }
} }
@ -175,20 +180,20 @@ void asic65_reset(running_machine *machine, int state)
static TIMER_CALLBACK( m68k_asic65_deferred_w ) static TIMER_CALLBACK( m68k_asic65_deferred_w )
{ {
asic65_tfull = 1; asic65.tfull = 1;
asic65_cmd = param >> 16; asic65.cmd = param >> 16;
asic65_tdata = param; asic65.tdata = param;
cpunum_set_input_line(machine, asic65_cpunum, 0, ASSERT_LINE); cpunum_set_input_line(machine, asic65.cpunum, 0, ASSERT_LINE);
} }
WRITE16_HANDLER( asic65_data_w ) WRITE16_HANDLER( asic65_data_w )
{ {
/* logging */ /* logging */
if (LOG_ASIC && !asic65_log) asic65_log = fopen("asic65.log", "w"); if (LOG_ASIC && !asic65.log) asic65.log = fopen("asic65.log", "w");
/* rom-based use a deferred write mechanism */ /* rom-based use a deferred write mechanism */
if (asic65_type == ASIC65_ROMBASED) if (asic65.type == ASIC65_ROMBASED)
{ {
timer_call_after_resynch(NULL, data | (offset << 16), m68k_asic65_deferred_w); timer_call_after_resynch(NULL, data | (offset << 16), m68k_asic65_deferred_w);
cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(20)); cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(20));
@ -198,51 +203,51 @@ WRITE16_HANDLER( asic65_data_w )
/* parameters go to offset 0 */ /* parameters go to offset 0 */
if (!(offset & 1)) if (!(offset & 1))
{ {
if (asic65_log) fprintf(asic65_log, " W=%04X", data); if (asic65.log) fprintf(asic65.log, " W=%04X", data);
/* add to the parameter list, but don't overflow */ /* add to the parameter list, but don't overflow */
asic65_param[asic65_param_index++] = data; asic65.param[asic65.param_index++] = data;
if (asic65_param_index >= 32) if (asic65.param_index >= 32)
asic65_param_index = 32; asic65.param_index = 32;
} }
/* commands go to offset 2 */ /* commands go to offset 2 */
else else
{ {
int command = (data < MAX_COMMANDS) ? command_map[asic65_type][data] : OP_UNKNOWN; int command = (data < MAX_COMMANDS) ? command_map[asic65.type][data] : OP_UNKNOWN;
if (asic65_log) fprintf(asic65_log, "\n(%06X)%c%04X:", activecpu_get_previouspc(), (command == OP_UNKNOWN) ? '*' : ' ', data); if (asic65.log) fprintf(asic65.log, "\n(%06X)%c%04X:", activecpu_get_previouspc(), (command == OP_UNKNOWN) ? '*' : ' ', data);
/* set the command number and reset the parameter/result indices */ /* set the command number and reset the parameter/result indices */
asic65_command = data; asic65.command = data;
asic65_result_index = asic65_param_index = 0; asic65.result_index = asic65.param_index = 0;
} }
} }
READ16_HANDLER( asic65_r ) READ16_HANDLER( asic65_r )
{ {
int command = (asic65_command < MAX_COMMANDS) ? command_map[asic65_type][asic65_command] : OP_UNKNOWN; int command = (asic65.command < MAX_COMMANDS) ? command_map[asic65.type][asic65.command] : OP_UNKNOWN;
INT64 element, result64 = 0; INT64 element, result64 = 0;
UINT16 result = 0; UINT16 result = 0;
/* rom-based just returns latched data */ /* rom-based just returns latched data */
if (asic65_type == ASIC65_ROMBASED) if (asic65.type == ASIC65_ROMBASED)
{ {
asic65_68full = 0; asic65._68full = 0;
cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(5)); cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(5));
return asic65_68data; return asic65._68data;
} }
/* update results */ /* update results */
switch (command) switch (command)
{ {
case OP_UNKNOWN: /* return bogus data */ case OP_UNKNOWN: /* return bogus data */
popmessage("ASIC65: Unknown cmd %02X", asic65_command); popmessage("ASIC65: Unknown cmd %02X", asic65.command);
break; break;
case OP_REFLECT: /* reflect data */ case OP_REFLECT: /* reflect data */
if (asic65_param_index >= 1) if (asic65.param_index >= 1)
result = asic65_param[--asic65_param_index]; result = asic65.param[--asic65.param_index];
break; break;
case OP_CHECKSUM: /* compute checksum (should be XX27) */ case OP_CHECKSUM: /* compute checksum (should be XX27) */
@ -258,24 +263,24 @@ READ16_HANDLER( asic65_r )
break; break;
case OP_RESET: /* reset */ case OP_RESET: /* reset */
asic65_result_index = asic65_param_index = 0; asic65.result_index = asic65.param_index = 0;
break; break;
case OP_SIN: /* sin */ case OP_SIN: /* sin */
if (asic65_param_index >= 1) if (asic65.param_index >= 1)
result = (int)(16384. * sin(M_PI * (double)(INT16)asic65_param[0] / 32768.)); result = (int)(16384. * sin(M_PI * (double)(INT16)asic65.param[0] / 32768.));
break; break;
case OP_COS: /* cos */ case OP_COS: /* cos */
if (asic65_param_index >= 1) if (asic65.param_index >= 1)
result = (int)(16384. * cos(M_PI * (double)(INT16)asic65_param[0] / 32768.)); result = (int)(16384. * cos(M_PI * (double)(INT16)asic65.param[0] / 32768.));
break; break;
case OP_ATAN: /* vector angle */ case OP_ATAN: /* vector angle */
if (asic65_param_index >= 4) if (asic65.param_index >= 4)
{ {
INT32 xint = (INT32)((asic65_param[0] << 16) | asic65_param[1]); INT32 xint = (INT32)((asic65.param[0] << 16) | asic65.param[1]);
INT32 yint = (INT32)((asic65_param[2] << 16) | asic65_param[3]); INT32 yint = (INT32)((asic65.param[2] << 16) | asic65.param[3]);
double a = atan2((double)yint, (double)xint); double a = atan2((double)yint, (double)xint);
result = (INT16)(a * 32768. / M_PI); result = (INT16)(a * 32768. / M_PI);
} }
@ -284,84 +289,84 @@ READ16_HANDLER( asic65_r )
case OP_TMATRIXMULT: /* matrix multiply by transpose */ case OP_TMATRIXMULT: /* matrix multiply by transpose */
/* if this is wrong, the labels on the car selection screen */ /* if this is wrong, the labels on the car selection screen */
/* in Race Drivin' will be off */ /* in Race Drivin' will be off */
if (asic65_param_index >= 9+6) if (asic65.param_index >= 9+6)
{ {
INT32 v0 = (INT32)((asic65_param[9] << 16) | asic65_param[10]); INT32 v0 = (INT32)((asic65.param[9] << 16) | asic65.param[10]);
INT32 v1 = (INT32)((asic65_param[11] << 16) | asic65_param[12]); INT32 v1 = (INT32)((asic65.param[11] << 16) | asic65.param[12]);
INT32 v2 = (INT32)((asic65_param[13] << 16) | asic65_param[14]); INT32 v2 = (INT32)((asic65.param[13] << 16) | asic65.param[14]);
/* 2 results per element */ /* 2 results per element */
switch (asic65_result_index / 2) switch (asic65.result_index / 2)
{ {
case 0: case 0:
result64 = (INT64)v0 * (INT16)asic65_param[0] + result64 = (INT64)v0 * (INT16)asic65.param[0] +
(INT64)v1 * (INT16)asic65_param[3] + (INT64)v1 * (INT16)asic65.param[3] +
(INT64)v2 * (INT16)asic65_param[6]; (INT64)v2 * (INT16)asic65.param[6];
break; break;
case 1: case 1:
result64 = (INT64)v0 * (INT16)asic65_param[1] + result64 = (INT64)v0 * (INT16)asic65.param[1] +
(INT64)v1 * (INT16)asic65_param[4] + (INT64)v1 * (INT16)asic65.param[4] +
(INT64)v2 * (INT16)asic65_param[7]; (INT64)v2 * (INT16)asic65.param[7];
break; break;
case 2: case 2:
result64 = (INT64)v0 * (INT16)asic65_param[2] + result64 = (INT64)v0 * (INT16)asic65.param[2] +
(INT64)v1 * (INT16)asic65_param[5] + (INT64)v1 * (INT16)asic65.param[5] +
(INT64)v2 * (INT16)asic65_param[8]; (INT64)v2 * (INT16)asic65.param[8];
break; break;
} }
/* remove lower 14 bits and pass back either upper or lower words */ /* remove lower 14 bits and pass back either upper or lower words */
result64 >>= 14; result64 >>= 14;
result = (asic65_result_index & 1) ? (result64 & 0xffff) : ((result64 >> 16) & 0xffff); result = (asic65.result_index & 1) ? (result64 & 0xffff) : ((result64 >> 16) & 0xffff);
asic65_result_index++; asic65.result_index++;
} }
break; break;
case OP_MATRIXMULT: /* matrix multiply???? */ case OP_MATRIXMULT: /* matrix multiply???? */
if (asic65_param_index >= 9+6) if (asic65.param_index >= 9+6)
{ {
INT32 v0 = (INT32)((asic65_param[9] << 16) | asic65_param[10]); INT32 v0 = (INT32)((asic65.param[9] << 16) | asic65.param[10]);
INT32 v1 = (INT32)((asic65_param[11] << 16) | asic65_param[12]); INT32 v1 = (INT32)((asic65.param[11] << 16) | asic65.param[12]);
INT32 v2 = (INT32)((asic65_param[13] << 16) | asic65_param[14]); INT32 v2 = (INT32)((asic65.param[13] << 16) | asic65.param[14]);
/* 2 results per element */ /* 2 results per element */
switch (asic65_result_index / 2) switch (asic65.result_index / 2)
{ {
case 0: case 0:
result64 = (INT64)v0 * (INT16)asic65_param[0] + result64 = (INT64)v0 * (INT16)asic65.param[0] +
(INT64)v1 * (INT16)asic65_param[1] + (INT64)v1 * (INT16)asic65.param[1] +
(INT64)v2 * (INT16)asic65_param[2]; (INT64)v2 * (INT16)asic65.param[2];
break; break;
case 1: case 1:
result64 = (INT64)v0 * (INT16)asic65_param[3] + result64 = (INT64)v0 * (INT16)asic65.param[3] +
(INT64)v1 * (INT16)asic65_param[4] + (INT64)v1 * (INT16)asic65.param[4] +
(INT64)v2 * (INT16)asic65_param[5]; (INT64)v2 * (INT16)asic65.param[5];
break; break;
case 2: case 2:
result64 = (INT64)v0 * (INT16)asic65_param[6] + result64 = (INT64)v0 * (INT16)asic65.param[6] +
(INT64)v1 * (INT16)asic65_param[7] + (INT64)v1 * (INT16)asic65.param[7] +
(INT64)v2 * (INT16)asic65_param[8]; (INT64)v2 * (INT16)asic65.param[8];
break; break;
} }
/* remove lower 14 bits and pass back either upper or lower words */ /* remove lower 14 bits and pass back either upper or lower words */
result64 >>= 14; result64 >>= 14;
result = (asic65_result_index & 1) ? (result64 & 0xffff) : ((result64 >> 16) & 0xffff); result = (asic65.result_index & 1) ? (result64 & 0xffff) : ((result64 >> 16) & 0xffff);
asic65_result_index++; asic65.result_index++;
} }
break; break;
case OP_YORIGIN: case OP_YORIGIN:
if (asic65_param_index >= 1) if (asic65.param_index >= 1)
asic65_yorigin = asic65_param[asic65_param_index - 1]; asic65.yorigin = asic65.param[asic65.param_index - 1];
break; break;
case OP_TRANSFORM: /* 3d transform */ case OP_TRANSFORM: /* 3d transform */
if (asic65_param_index >= 2) if (asic65.param_index >= 2)
{ {
/* param 0 == 1/z */ /* param 0 == 1/z */
/* param 1 == height */ /* param 1 == height */
@ -370,29 +375,29 @@ READ16_HANDLER( asic65_r )
/* return 0 == scale factor for 1/z */ /* return 0 == scale factor for 1/z */
/* return 1 == transformed X */ /* return 1 == transformed X */
/* return 2 == transformed Y, taking height into account */ /* return 2 == transformed Y, taking height into account */
element = (INT16)asic65_param[0]; element = (INT16)asic65.param[0];
if (asic65_param_index == 2) if (asic65.param_index == 2)
{ {
result64 = (element * (INT16)asic65_param[1]) >> 8; result64 = (element * (INT16)asic65.param[1]) >> 8;
result64 -= 1; result64 -= 1;
if (result64 > 0x3fff) result64 = 0; if (result64 > 0x3fff) result64 = 0;
} }
else if (asic65_param_index == 3) else if (asic65.param_index == 3)
{ {
result64 = (element * (INT16)asic65_param[2]) >> 15; result64 = (element * (INT16)asic65.param[2]) >> 15;
result64 += 0xa8; result64 += 0xa8;
} }
else if (asic65_param_index == 4) else if (asic65.param_index == 4)
{ {
result64 = (INT16)((element * (INT16)asic65_param[3]) >> 10); result64 = (INT16)((element * (INT16)asic65.param[3]) >> 10);
result64 = (INT16)asic65_yorigin - result64 - (result64 << 1); result64 = (INT16)asic65.yorigin - result64 - (result64 << 1);
} }
result = result64 & 0xffff; result = result64 & 0xffff;
} }
break; break;
case OP_INITBANKS: /* initialize banking */ case OP_INITBANKS: /* initialize banking */
asic65_last_bank = 0; asic65.last_bank = 0;
break; break;
case OP_SETBANK: /* set a bank */ case OP_SETBANK: /* set a bank */
@ -411,12 +416,12 @@ READ16_HANDLER( asic65_r )
{ 0x77f0,0x77fe,0x77f2,0x77fc,0x77f4,0x77fa,0x77f6,0x77f8 }, { 0x77f0,0x77fe,0x77f2,0x77fc,0x77f4,0x77fa,0x77f6,0x77f8 },
{ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }, { 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 },
}; };
if (asic65_param_index >= 1) if (asic65.param_index >= 1)
{ {
if (asic65_param_index < sizeof(banklist) && banklist[asic65_param[0]] < 4) if (asic65.param_index < sizeof(banklist) && banklist[asic65.param[0]] < 4)
asic65_last_bank = banklist[asic65_param[0]]; asic65.last_bank = banklist[asic65.param[0]];
result = bankaddr[asic65_last_bank][(asic65_result_index < 8) ? asic65_result_index : 7]; result = bankaddr[asic65.last_bank][(asic65.result_index < 8) ? asic65.result_index : 7];
asic65_result_index++; asic65.result_index++;
} }
break; break;
} }
@ -427,13 +432,13 @@ READ16_HANDLER( asic65_r )
{ {
0x0eb2,0x1000,0x171b,0x3d28 0x0eb2,0x1000,0x171b,0x3d28
}; };
result = bankverify[asic65_last_bank]; result = bankverify[asic65.last_bank];
break; break;
} }
} }
if (LOG_ASIC && !asic65_log) asic65_log = fopen("asic65.log", "w"); if (LOG_ASIC && !asic65.log) asic65.log = fopen("asic65.log", "w");
if (asic65_log) fprintf(asic65_log, " (R=%04X)", result); if (asic65.log) fprintf(asic65.log, " (R=%04X)", result);
return result; return result;
} }
@ -441,14 +446,14 @@ READ16_HANDLER( asic65_r )
READ16_HANDLER( asic65_io_r ) READ16_HANDLER( asic65_io_r )
{ {
if (asic65_type == ASIC65_ROMBASED) if (asic65.type == ASIC65_ROMBASED)
{ {
/* bit 15 = TFULL */ /* bit 15 = TFULL */
/* bit 14 = 68FULL */ /* bit 14 = 68FULL */
/* bit 13 = XFLG */ /* bit 13 = XFLG */
/* bit 12 = controlled by jumper */ /* bit 12 = controlled by jumper */
cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(5)); cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(5));
return (asic65_tfull << 15) | (asic65_68full << 14) | (asic65_xflg << 13) | 0x0000; return (asic65.tfull << 15) | (asic65._68full << 14) | (asic65.xflg << 13) | 0x0000;
} }
else else
{ {
@ -467,22 +472,22 @@ READ16_HANDLER( asic65_io_r )
static WRITE16_HANDLER( asic65_68k_w ) static WRITE16_HANDLER( asic65_68k_w )
{ {
asic65_68full = 1; asic65._68full = 1;
asic65_68data = data; asic65._68data = data;
} }
static READ16_HANDLER( asic65_68k_r ) static READ16_HANDLER( asic65_68k_r )
{ {
asic65_tfull = 0; asic65.tfull = 0;
cpunum_set_input_line(machine, asic65_cpunum, 0, CLEAR_LINE); cpunum_set_input_line(machine, asic65.cpunum, 0, CLEAR_LINE);
return asic65_tdata; return asic65.tdata;
} }
static WRITE16_HANDLER( asic65_stat_w ) static WRITE16_HANDLER( asic65_stat_w )
{ {
asic65_xflg = data & 1; asic65.xflg = data & 1;
} }
@ -492,15 +497,15 @@ static READ16_HANDLER( asic65_stat_r )
/* bit 14 = TFULL */ /* bit 14 = TFULL */
/* bit 13 = CMD */ /* bit 13 = CMD */
/* bit 12 = controlled by jumper (0 = test?) */ /* bit 12 = controlled by jumper (0 = test?) */
return (asic65_68full << 15) | (asic65_tfull << 14) | (asic65_cmd << 13) | 0x1000; return (asic65._68full << 15) | (asic65.tfull << 14) | (asic65.cmd << 13) | 0x1000;
} }
static READ16_HANDLER( asci65_get_bio ) static READ16_HANDLER( asci65_get_bio )
{ {
if (!asic65_tfull) if (!asic65.tfull)
cpu_spinuntil_int(); cpu_spinuntil_int();
return asic65_tfull ? CLEAR_LINE : ASSERT_LINE; return asic65.tfull ? CLEAR_LINE : ASSERT_LINE;
} }

View File

@ -19,6 +19,12 @@ extern void namcos21_kickstart(running_machine *, int);
int namcos2_gametype; int namcos2_gametype;
static unsigned mFinalLapProtCount; static unsigned mFinalLapProtCount;
static int namcos2_mcu_analog_ctrl;
static int namcos2_mcu_analog_data;
static int namcos2_mcu_analog_complete;
static UINT8 *namcos2_eeprom;
static int sendval;
READ16_HANDLER( namcos2_flap_prot_r ) READ16_HANDLER( namcos2_flap_prot_r )
{ {
@ -69,7 +75,6 @@ READ16_HANDLER( namcos2_flap_prot_r )
/*************************************************************/ /*************************************************************/
#define namcos2_eeprom_size 0x2000 #define namcos2_eeprom_size 0x2000
static UINT8 *namcos2_eeprom;
static void static void
ResetAllSubCPUs( running_machine *machine, int state ) ResetAllSubCPUs( running_machine *machine, int state )
@ -102,6 +107,10 @@ MACHINE_RESET( namcos2 )
{ {
int loop; int loop;
mFinalLapProtCount = 0; mFinalLapProtCount = 0;
namcos2_mcu_analog_ctrl=0;
namcos2_mcu_analog_data=0xaa;
namcos2_mcu_analog_complete=0;
sendval = 0;
/* Initialise the bank select in the sound CPU */ /* Initialise the bank select in the sound CPU */
namcos2_sound_bankselect_w(machine,0,0); /* Page in bank 0 */ namcos2_sound_bankselect_w(machine,0,0); /* Page in bank 0 */
@ -238,7 +247,7 @@ sws92g 1992 332 $014c
suzuk8h2 1993 suzuk8h2 1993
sws93 1993 334 $014e sws93 1993 334 $014e
*************************************************************/ *************************************************************/
static int sendval = 0;
READ16_HANDLER( namcos2_68k_key_r ) READ16_HANDLER( namcos2_68k_key_r )
{ {
switch (namcos2_gametype) switch (namcos2_gametype)
@ -724,10 +733,6 @@ WRITE8_HANDLER( namcos2_sound_bankselect_w )
/* */ /* */
/**************************************************************/ /**************************************************************/
static int namcos2_mcu_analog_ctrl=0;
static int namcos2_mcu_analog_data=0xaa;
static int namcos2_mcu_analog_complete=0;
WRITE8_HANDLER( namcos2_mcu_analog_ctrl_w ) WRITE8_HANDLER( namcos2_mcu_analog_ctrl_w )
{ {
namcos2_mcu_analog_ctrl = data & 0xff; namcos2_mcu_analog_ctrl = data & 0xff;

View File

@ -850,7 +850,7 @@ static UINT16 generate_cs16(UINT8 *rom, int size)
} }
int m1_address_scramble(int address, UINT16 key) static int m1_address_scramble(int address, UINT16 key)
{ {
int block; int block;
int aux; int aux;

View File

@ -664,7 +664,7 @@ static int gboard_scanline_counter;
static int gboard_scanline_latch; static int gboard_scanline_latch;
static int gboard_banks[2]; static int gboard_banks[2];
static int gboard_4screen; static int gboard_4screen;
static int gboard_last_bank = 0xff; static int gboard_last_bank;
static int gboard_command; static int gboard_command;
static void gboard_scanline_cb( int num, int scanline, int vblank, int blanked ) static void gboard_scanline_cb( int num, int scanline, int vblank, int blanked )
@ -946,6 +946,8 @@ DRIVER_INIT( pchboard )
gboard_banks[1] = 0x1f; gboard_banks[1] = 0x1f;
gboard_scanline_counter = 0; gboard_scanline_counter = 0;
gboard_scanline_latch = 0; gboard_scanline_latch = 0;
gboard_last_bank = 0xff;
gboard_command = 0;
/* common init */ /* common init */
DRIVER_INIT_CALL(playch10); DRIVER_INIT_CALL(playch10);

View File

@ -59,6 +59,7 @@ Note: if MAME_DEBUG is defined, pressing Z or X with:
/* Variables only used here: */ /* Variables only used here: */
static int cischeat_ip_select; static int cischeat_ip_select;
static int shift_ret = 1;
#ifdef MAME_DEBUG #ifdef MAME_DEBUG
static int debugsprites; // For debug purposes static int debugsprites; // For debug purposes
@ -141,6 +142,7 @@ static void prepare_shadows(void)
/* 32 colour codes for the tiles */ /* 32 colour codes for the tiles */
VIDEO_START( cischeat ) VIDEO_START( cischeat )
{ {
shift_ret = 1;
VIDEO_START_CALL(megasys1); VIDEO_START_CALL(megasys1);
megasys1_bits_per_color_code = 5; megasys1_bits_per_color_code = 5;
@ -184,13 +186,12 @@ VIDEO_START( bigrun )
CUSTOM_INPUT( cischeat_shift_r ) CUSTOM_INPUT( cischeat_shift_r )
{ {
static int ret = 1; /* start with low shift */
switch ( (input_port_read(field->port->machine, "FAKE") >> 2) & 3 ) switch ( (input_port_read(field->port->machine, "FAKE") >> 2) & 3 )
{ {
case 1 : ret = 1; break; // low shift: button 3 case 1 : shift_ret = 1; break; // low shift: button 3
case 2 : ret = 0; break; // high shift: button 4 case 2 : shift_ret = 0; break; // high shift: button 4
} }
return ret; return shift_ret;
} }
/* /*

View File

@ -11,15 +11,13 @@
UINT8 *popeye_background_pos; UINT8 *popeye_background_pos;
UINT8 *popeye_palettebank; UINT8 *popeye_palettebank;
static UINT8 *popeye_bitmapram; static UINT8 *popeye_bitmapram;
static size_t popeye_bitmapram_size = 0x2000; static const size_t popeye_bitmapram_size = 0x2000;
static bitmap_t *tmpbitmap2; static bitmap_t *tmpbitmap2;
static int invertmask; static int invertmask;
static int bitmap_type; static int bitmap_type;
enum { TYPE_SKYSKIPR, TYPE_POPEYE }; enum { TYPE_SKYSKIPR, TYPE_POPEYE };
#define BGRAM_SIZE 0x2000
static tilemap *fg_tilemap; static tilemap *fg_tilemap;

View File

@ -25,7 +25,7 @@ static UINT16 spaceod_vcounter;
static UINT8 spaceod_fixed_color; static UINT8 spaceod_fixed_color;
static UINT8 spaceod_bg_control; static UINT8 spaceod_bg_control;
static UINT8 spaceod_bg_detect; static UINT8 spaceod_bg_detect;
static UINT8 spaceod_bg_detect_tile_color = 1; static const UINT8 spaceod_bg_detect_tile_color = 1;
static tilemap *bg_tilemap; static tilemap *bg_tilemap;
static UINT8 bg_enable; static UINT8 bg_enable;

View File

@ -135,8 +135,12 @@ WRITE32_HANDLER( silkroad_fgram3_w )
static int enable1, enable2, enable3;
VIDEO_START(silkroad) VIDEO_START(silkroad)
{ {
enable1 = enable2 = enable3 = 1;
fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,16,16,64, 64); fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,16,16,64, 64);
tilemap_set_transparent_pen(fg_tilemap,0); tilemap_set_transparent_pen(fg_tilemap,0);
@ -147,8 +151,6 @@ VIDEO_START(silkroad)
tilemap_set_transparent_pen(fg3_tilemap,0); tilemap_set_transparent_pen(fg3_tilemap,0);
} }
static int enable1=1,enable2=1,enable3=1;
VIDEO_UPDATE(silkroad) VIDEO_UPDATE(silkroad)
{ {
fillbitmap(bitmap,0x7c0,cliprect); fillbitmap(bitmap,0x7c0,cliprect);

View File

@ -75,7 +75,7 @@ enum
TX1_RDFLAG_TNLF, TX1_RDFLAG_TNLF,
TX1_RDFLAG_STLF, TX1_RDFLAG_STLF,
TX1_RDFLAG_SCCHGF TX1_RDFLAG_SCCHGF
} tx1_roadreg; };
static struct static struct
{ {