mirror of
https://github.com/holub/mame
synced 2025-10-07 01:16:22 +03:00
More migrating allocated buffers to arrays in the driver data.
This commit is contained in:
parent
dd5ea079cd
commit
1a6944bb42
@ -52,8 +52,6 @@ public:
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * bgram;
|
||||
UINT8 * atram;
|
||||
UINT8 * spram;
|
||||
// UINT8 * paletteram; // currently this uses generic palette handling
|
||||
|
||||
@ -67,6 +65,10 @@ public:
|
||||
|
||||
/* devices */
|
||||
device_t *audiocpu;
|
||||
|
||||
/* memory */
|
||||
UINT8 bgram[0x1000];
|
||||
UINT8 atram[0x1000];
|
||||
};
|
||||
|
||||
|
||||
@ -168,11 +170,9 @@ static VIDEO_START(egghunt)
|
||||
egghunt_state *state = machine->driver_data<egghunt_state>();
|
||||
|
||||
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
|
||||
state->bgram = auto_alloc_array(machine, UINT8, 0x1000);
|
||||
state->spram = auto_alloc_array(machine, UINT8, 0x1000);
|
||||
|
||||
state->save_pointer(NAME(state->bgram), 0x1000);
|
||||
state->save_pointer(NAME(state->spram), 0x1000);
|
||||
state->save_item(NAME(state->bgram));
|
||||
state->save_item(NAME(state->spram));
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE(egghunt)
|
||||
|
@ -207,8 +207,7 @@ static MACHINE_START( funybubl )
|
||||
|
||||
state->audiocpu = machine->device("audiocpu");
|
||||
|
||||
state->banked_vram = auto_alloc_array(machine, UINT8, 0x2000);
|
||||
state->save_pointer(NAME(state->banked_vram), 0x2000);
|
||||
state->save_item(NAME(state->banked_vram));
|
||||
|
||||
memory_configure_bank(machine, "bank1", 0, 2, &state->banked_vram[0x0000], 0x1000);
|
||||
memory_configure_bank(machine, "bank2", 0, 0x10, &ROM[0x10000], 0x4000);
|
||||
|
@ -53,11 +53,13 @@ public:
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * vram;
|
||||
UINT8 * pal;
|
||||
|
||||
/* misc */
|
||||
int port0;
|
||||
int port4;
|
||||
|
||||
/* memory */
|
||||
UINT8 pal[0x10000];
|
||||
};
|
||||
|
||||
|
||||
@ -133,8 +135,7 @@ ADDRESS_MAP_END
|
||||
static VIDEO_START(hotblock)
|
||||
{
|
||||
hotblock_state *state = machine->driver_data<hotblock_state>();
|
||||
state->pal = auto_alloc_array(machine, UINT8, 0x10000);
|
||||
state->save_pointer(NAME(state->pal), 0x10000);
|
||||
state->save_item(NAME(state->pal));
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE(hotblock)
|
||||
|
@ -102,12 +102,14 @@ public:
|
||||
UINT8 control;
|
||||
UINT8 scroll;
|
||||
UINT8 steerlatch;
|
||||
UINT8 *videoram[3];
|
||||
int draw_mode;
|
||||
int oldsteer;
|
||||
|
||||
/* devices */
|
||||
device_t *slavecpu;
|
||||
|
||||
/* memory */
|
||||
UINT8 videoram[3][0x4000];
|
||||
};
|
||||
|
||||
|
||||
@ -185,16 +187,9 @@ static void initialize_colors( running_machine *machine )
|
||||
static VIDEO_START( imolagp )
|
||||
{
|
||||
imolagp_state *state = machine->driver_data<imolagp_state>();
|
||||
int i;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
state->videoram[i] = auto_alloc_array(machine, UINT8, 0x4000);
|
||||
memset(state->videoram[i], 0x00, 0x4000);
|
||||
}
|
||||
|
||||
state->save_pointer(NAME(state->videoram[0]), 0x4000);
|
||||
state->save_pointer(NAME(state->videoram[1]), 0x4000);
|
||||
state->save_pointer(NAME(state->videoram[2]), 0x4000);
|
||||
|
||||
memset(state->videoram, 0, sizeof(state->videoram));
|
||||
state->save_item(NAME(state->videoram));
|
||||
|
||||
initialize_colors(machine);
|
||||
}
|
||||
|
@ -40,11 +40,6 @@ public:
|
||||
jangou_state(running_machine &machine, const driver_device_config_base &config)
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* video-related */
|
||||
UINT8 *blit_buffer;
|
||||
UINT8 pen_data[0x10];
|
||||
UINT8 blit_data[6];
|
||||
|
||||
/* sound-related */
|
||||
// Jangou CVSD Sound
|
||||
emu_timer *cvsd_bit_timer;
|
||||
@ -63,6 +58,11 @@ public:
|
||||
device_t *cpu_1;
|
||||
device_t *cvsd;
|
||||
device_t *nsc;
|
||||
|
||||
/* video-related */
|
||||
UINT8 pen_data[0x10];
|
||||
UINT8 blit_data[6];
|
||||
UINT8 blit_buffer[256 * 256];
|
||||
};
|
||||
|
||||
|
||||
@ -116,8 +116,7 @@ static VIDEO_START( jangou )
|
||||
{
|
||||
jangou_state *state = machine->driver_data<jangou_state>();
|
||||
|
||||
state->blit_buffer = auto_alloc_array(machine, UINT8, 256 * 256);
|
||||
state->save_pointer(NAME(state->blit_buffer), 256 * 256);
|
||||
state->save_item(NAME(state->blit_buffer));
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE( jangou )
|
||||
|
@ -103,11 +103,6 @@ public:
|
||||
jantotsu_state(running_machine &machine, const driver_device_config_base &config)
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* video-related */
|
||||
UINT8 *bitmap;
|
||||
UINT8 vram_bank, col_bank;
|
||||
UINT8 display_on;
|
||||
|
||||
/* sound-related */
|
||||
UINT32 adpcm_pos;
|
||||
UINT8 adpcm_idle;
|
||||
@ -116,6 +111,11 @@ public:
|
||||
|
||||
/* misc */
|
||||
UINT8 mux_data;
|
||||
|
||||
/* video-related */
|
||||
UINT8 vram_bank, col_bank;
|
||||
UINT8 display_on;
|
||||
UINT8 bitmap[0x8000];
|
||||
};
|
||||
|
||||
|
||||
@ -129,8 +129,7 @@ static VIDEO_START(jantotsu)
|
||||
{
|
||||
jantotsu_state *state = machine->driver_data<jantotsu_state>();
|
||||
|
||||
state->bitmap = auto_alloc_array(machine, UINT8, 0x8000);
|
||||
state->save_pointer(NAME(state->bitmap), 0x8000);
|
||||
state->save_item(NAME(state->bitmap));
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE(jantotsu)
|
||||
|
@ -38,13 +38,13 @@ public:
|
||||
jongkyo_state(running_machine &machine, const driver_device_config_base &config)
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * videoram;
|
||||
UINT8 * videoram2;
|
||||
|
||||
/* misc */
|
||||
UINT8 rom_bank;
|
||||
UINT8 mux_data;
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * videoram;
|
||||
UINT8 videoram2[0x4000];
|
||||
};
|
||||
|
||||
|
||||
@ -468,9 +468,7 @@ static MACHINE_START( jongkyo )
|
||||
{
|
||||
jongkyo_state *state = machine->driver_data<jongkyo_state>();
|
||||
|
||||
state->videoram2 = auto_alloc_array(machine, UINT8, 0x4000);
|
||||
state->save_pointer(NAME(state->videoram2), 0x4000);
|
||||
|
||||
state->save_item(NAME(state->videoram2));
|
||||
state->save_item(NAME(state->rom_bank));
|
||||
state->save_item(NAME(state->mux_data));
|
||||
}
|
||||
|
@ -353,6 +353,35 @@ G: gun mania only, drives air soft gun (this game uses real BB bullet)
|
||||
|
||||
#define VERBOSE_LEVEL ( 0 )
|
||||
|
||||
#define ATAPI_CYCLES_PER_SECTOR (5000) // plenty of time to allow DMA setup etc. BIOS requires this be at least 2000, individual games may vary.
|
||||
|
||||
#define ATAPI_STAT_BSY 0x80
|
||||
#define ATAPI_STAT_DRDY 0x40
|
||||
#define ATAPI_STAT_DMARDDF 0x20
|
||||
#define ATAPI_STAT_SERVDSC 0x10
|
||||
#define ATAPI_STAT_DRQ 0x08
|
||||
#define ATAPI_STAT_CORR 0x04
|
||||
#define ATAPI_STAT_CHECK 0x01
|
||||
|
||||
#define ATAPI_INTREASON_COMMAND 0x01
|
||||
#define ATAPI_INTREASON_IO 0x02
|
||||
#define ATAPI_INTREASON_RELEASE 0x04
|
||||
|
||||
#define ATAPI_REG_DATA 0
|
||||
#define ATAPI_REG_ERRFEAT 1
|
||||
#define ATAPI_REG_INTREASON 2
|
||||
#define ATAPI_REG_SAMTAG 3
|
||||
#define ATAPI_REG_COUNTLOW 4
|
||||
#define ATAPI_REG_COUNTHIGH 5
|
||||
#define ATAPI_REG_DRIVESEL 6
|
||||
#define ATAPI_REG_CMDSTATUS 7
|
||||
#define ATAPI_REG_MAX 16
|
||||
|
||||
#define ATAPI_DATA_SIZE ( 64 * 1024 )
|
||||
|
||||
#define MAX_TRANSFER_SIZE ( 63488 )
|
||||
|
||||
|
||||
class ksys573_state : public psx_state
|
||||
{
|
||||
public:
|
||||
@ -371,11 +400,9 @@ public:
|
||||
|
||||
UINT32 control;
|
||||
|
||||
UINT8 *atapi_regs;
|
||||
emu_timer *atapi_timer;
|
||||
SCSIInstance *inserted_cdrom;
|
||||
SCSIInstance *available_cdroms[ 2 ];
|
||||
UINT8 *atapi_data;
|
||||
int atapi_data_ptr;
|
||||
int atapi_data_len;
|
||||
int atapi_xferlen;
|
||||
@ -419,6 +446,10 @@ public:
|
||||
|
||||
int hyperbbc_lamp_strobe1;
|
||||
int hyperbbc_lamp_strobe2;
|
||||
|
||||
/* memory */
|
||||
UINT8 atapi_regs[ATAPI_REG_MAX];
|
||||
UINT8 atapi_data[ATAPI_DATA_SIZE];
|
||||
};
|
||||
|
||||
INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ... )
|
||||
@ -563,34 +594,6 @@ static WRITE32_HANDLER( control_w )
|
||||
}
|
||||
}
|
||||
|
||||
#define ATAPI_CYCLES_PER_SECTOR (5000) // plenty of time to allow DMA setup etc. BIOS requires this be at least 2000, individual games may vary.
|
||||
|
||||
#define ATAPI_STAT_BSY 0x80
|
||||
#define ATAPI_STAT_DRDY 0x40
|
||||
#define ATAPI_STAT_DMARDDF 0x20
|
||||
#define ATAPI_STAT_SERVDSC 0x10
|
||||
#define ATAPI_STAT_DRQ 0x08
|
||||
#define ATAPI_STAT_CORR 0x04
|
||||
#define ATAPI_STAT_CHECK 0x01
|
||||
|
||||
#define ATAPI_INTREASON_COMMAND 0x01
|
||||
#define ATAPI_INTREASON_IO 0x02
|
||||
#define ATAPI_INTREASON_RELEASE 0x04
|
||||
|
||||
#define ATAPI_REG_DATA 0
|
||||
#define ATAPI_REG_ERRFEAT 1
|
||||
#define ATAPI_REG_INTREASON 2
|
||||
#define ATAPI_REG_SAMTAG 3
|
||||
#define ATAPI_REG_COUNTLOW 4
|
||||
#define ATAPI_REG_COUNTHIGH 5
|
||||
#define ATAPI_REG_DRIVESEL 6
|
||||
#define ATAPI_REG_CMDSTATUS 7
|
||||
#define ATAPI_REG_MAX 16
|
||||
|
||||
#define ATAPI_DATA_SIZE ( 64 * 1024 )
|
||||
|
||||
#define MAX_TRANSFER_SIZE ( 63488 )
|
||||
|
||||
static TIMER_CALLBACK( atapi_xfer_end )
|
||||
{
|
||||
ksys573_state *state = machine->driver_data<ksys573_state>();
|
||||
@ -1037,15 +1040,12 @@ static void atapi_exit(running_machine& machine)
|
||||
static void atapi_init(running_machine *machine)
|
||||
{
|
||||
ksys573_state *state = machine->driver_data<ksys573_state>();
|
||||
UINT8 *atapi_regs;
|
||||
int i;
|
||||
|
||||
atapi_regs = state->atapi_regs = auto_alloc_array( machine, UINT8, ATAPI_REG_MAX );
|
||||
|
||||
atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
|
||||
atapi_regs[ATAPI_REG_ERRFEAT] = 1;
|
||||
atapi_regs[ATAPI_REG_COUNTLOW] = 0x14;
|
||||
atapi_regs[ATAPI_REG_COUNTHIGH] = 0xeb;
|
||||
state->atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
|
||||
state->atapi_regs[ATAPI_REG_ERRFEAT] = 1;
|
||||
state->atapi_regs[ATAPI_REG_COUNTLOW] = 0x14;
|
||||
state->atapi_regs[ATAPI_REG_COUNTHIGH] = 0xeb;
|
||||
|
||||
state->atapi_data_ptr = 0;
|
||||
state->atapi_data_len = 0;
|
||||
@ -1067,10 +1067,9 @@ static void atapi_init(running_machine *machine)
|
||||
}
|
||||
machine->add_notifier(MACHINE_NOTIFY_EXIT, atapi_exit);
|
||||
|
||||
state->atapi_data = auto_alloc_array( machine, UINT8, ATAPI_DATA_SIZE );
|
||||
|
||||
state->save_pointer( NAME(state->atapi_regs), ATAPI_REG_MAX );
|
||||
state->save_pointer( NAME(state->atapi_data), ATAPI_DATA_SIZE / 2 );
|
||||
state->save_item( NAME(state->atapi_regs) );
|
||||
state->save_item( NAME(state->atapi_data) );
|
||||
state->save_item( NAME(state->atapi_data_ptr) );
|
||||
state->save_item( NAME(state->atapi_data_len) );
|
||||
state->save_item( NAME(state->atapi_xferlen) );
|
||||
|
@ -26,13 +26,13 @@ public:
|
||||
laserbas_state(running_machine &machine, const driver_device_config_base &config)
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* video-related */
|
||||
UINT8 *vram1;
|
||||
UINT8 *vram2;
|
||||
int vrambank;
|
||||
|
||||
/* misc */
|
||||
int count;
|
||||
|
||||
/* video-related */
|
||||
int vrambank;
|
||||
UINT8 vram1[0x8000];
|
||||
UINT8 vram2[0x8000];
|
||||
};
|
||||
|
||||
|
||||
@ -40,11 +40,8 @@ static VIDEO_START(laserbas)
|
||||
{
|
||||
laserbas_state *state = machine->driver_data<laserbas_state>();
|
||||
|
||||
state->vram1 = auto_alloc_array(machine, UINT8, 0x8000);
|
||||
state->vram2 = auto_alloc_array(machine, UINT8, 0x8000);
|
||||
|
||||
state->save_pointer(NAME(state->vram1), 0x8000);
|
||||
state->save_pointer(NAME(state->vram2), 0x8000);
|
||||
state->save_item(NAME(state->vram1));
|
||||
state->save_item(NAME(state->vram2));
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE(laserbas)
|
||||
|
@ -499,11 +499,8 @@ static VIDEO_START( laserbat )
|
||||
|
||||
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
|
||||
|
||||
state->videoram = auto_alloc_array(machine, UINT8, 0x400);
|
||||
state->colorram = auto_alloc_array(machine, UINT8, 0x400);
|
||||
|
||||
state->save_pointer(NAME(state->videoram), 0x400);
|
||||
state->save_pointer(NAME(state->colorram), 0x400);
|
||||
state->save_item(NAME(state->videoram));
|
||||
state->save_item(NAME(state->colorram));
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE( laserbat )
|
||||
|
@ -73,10 +73,6 @@ public:
|
||||
lastfght_state(running_machine &machine, const driver_device_config_base &config)
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * colorram;
|
||||
// UINT8 * nvram; // currently this uses generic nvram handling
|
||||
|
||||
/* video-related */
|
||||
bitmap_t *bitmap[2];
|
||||
int clr_offset;
|
||||
@ -89,6 +85,9 @@ public:
|
||||
|
||||
/* devices */
|
||||
device_t *maincpu;
|
||||
|
||||
/* memory */
|
||||
UINT8 colorram[256 * 3];
|
||||
};
|
||||
|
||||
|
||||
@ -103,11 +102,9 @@ static VIDEO_START( lastfght )
|
||||
for (i = 0; i < 2; i++)
|
||||
state->bitmap[i] = machine->primary_screen->alloc_compatible_bitmap();
|
||||
|
||||
state->colorram = auto_alloc_array(machine, UINT8, 256 * 3);
|
||||
|
||||
state->save_item(NAME(*state->bitmap[0]));
|
||||
state->save_item(NAME(*state->bitmap[1]));
|
||||
state->save_pointer(NAME(state->colorram), 256 * 3);
|
||||
state->save_item(NAME(state->colorram));
|
||||
}
|
||||
|
||||
|
||||
|
@ -21,9 +21,6 @@ public:
|
||||
mjsister_state(running_machine &machine, const driver_device_config_base &config)
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * videoram0, *videoram1;
|
||||
|
||||
/* video-related */
|
||||
bitmap_t *tmpbitmap0, *tmpbitmap1;
|
||||
int flip_screen;
|
||||
@ -43,6 +40,10 @@ public:
|
||||
/* devices */
|
||||
device_t *maincpu;
|
||||
device_t *dac;
|
||||
|
||||
/* memory */
|
||||
UINT8 videoram0[0x8000];
|
||||
UINT8 videoram1[0x8000];
|
||||
};
|
||||
|
||||
|
||||
@ -57,11 +58,9 @@ static VIDEO_START( mjsister )
|
||||
mjsister_state *state = machine->driver_data<mjsister_state>();
|
||||
state->tmpbitmap0 = auto_bitmap_alloc(machine, 256, 256, machine->primary_screen->format());
|
||||
state->tmpbitmap1 = auto_bitmap_alloc(machine, 256, 256, machine->primary_screen->format());
|
||||
state->videoram0 = auto_alloc_array(machine, UINT8, 0x8000);
|
||||
state->videoram1 = auto_alloc_array(machine, UINT8, 0x8000);
|
||||
|
||||
state->save_pointer(NAME(state->videoram0), 0x8000);
|
||||
state->save_pointer(NAME(state->videoram1), 0x8000);
|
||||
state->save_item(NAME(state->videoram0));
|
||||
state->save_item(NAME(state->videoram1));
|
||||
}
|
||||
|
||||
static void mjsister_plot0( running_machine *machine, int offset, UINT8 data )
|
||||
|
@ -59,12 +59,12 @@ public:
|
||||
mole_state(running_machine &machine, const driver_device_config_base &config)
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT16 * tileram;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *bg_tilemap;
|
||||
int tile_bank;
|
||||
|
||||
/* memory */
|
||||
UINT16 tileram[0x400];
|
||||
};
|
||||
|
||||
|
||||
@ -93,10 +93,10 @@ static TILE_GET_INFO( get_bg_tile_info )
|
||||
static VIDEO_START( mole )
|
||||
{
|
||||
mole_state *state = machine->driver_data<mole_state>();
|
||||
state->tileram = auto_alloc_array_clear(machine, UINT16, 0x400);
|
||||
memset(state->tileram, 0, sizeof(state->tileram));
|
||||
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 40, 25);
|
||||
|
||||
state->save_pointer(NAME(state->tileram), 0x400);
|
||||
state->save_item(NAME(state->tileram));
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( mole_videoram_w )
|
||||
|
@ -182,8 +182,6 @@ public:
|
||||
|
||||
/* Video related */
|
||||
|
||||
UINT8* vid;
|
||||
|
||||
int disp_enable;
|
||||
int xor_paltype;
|
||||
int xor_palette;
|
||||
@ -198,6 +196,7 @@ public:
|
||||
UINT8 hopper_motor;
|
||||
UINT8 hopper;
|
||||
|
||||
UINT8 vid[multfish_VIDRAM_SIZE];
|
||||
};
|
||||
|
||||
static TILE_GET_INFO( get_multfish_tile_info )
|
||||
@ -231,9 +230,8 @@ static VIDEO_START(multfish)
|
||||
{
|
||||
multfish_state *state = machine->driver_data<multfish_state>();
|
||||
|
||||
state->vid = auto_alloc_array(machine, UINT8, multfish_VIDRAM_SIZE);
|
||||
memset(state->vid,0x00,multfish_VIDRAM_SIZE);
|
||||
state->save_pointer(NAME(state->vid), multfish_VIDRAM_SIZE);
|
||||
memset(state->vid,0x00,sizeof(state->vid));
|
||||
state->save_item(NAME(state->vid));
|
||||
|
||||
state->tilemap = tilemap_create(machine,get_multfish_tile_info,tilemap_scan_rows,16,16, 64, 32);
|
||||
tilemap_set_transparent_pen(state->tilemap,255);
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT16 *bg_videoram, *mlow_videoram, *mhigh_videoram, *tx_videoram, *sprites_buffer;
|
||||
UINT16 *bg_videoram, *mlow_videoram, *mhigh_videoram, *tx_videoram;
|
||||
UINT16 *bg_scrollram, *mlow_scrollram, *mhigh_scrollram, *vidattrram;
|
||||
UINT16 *spriteram;
|
||||
// UINT16 *paletteram; // currently this uses generic palette handling
|
||||
@ -64,6 +64,8 @@ public:
|
||||
|
||||
/* misc */
|
||||
int which;
|
||||
|
||||
UINT16 sprites_buffer[0x800];
|
||||
};
|
||||
|
||||
|
||||
@ -373,8 +375,6 @@ static VIDEO_START( mwarr )
|
||||
state->mhigh_tilemap = tilemap_create(machine, get_mhigh_tile_info, tilemap_scan_cols, 16, 16, 64, 16);
|
||||
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
|
||||
|
||||
state->sprites_buffer = auto_alloc_array(machine, UINT16, 0x800);
|
||||
|
||||
tilemap_set_transparent_pen(state->mlow_tilemap, 0);
|
||||
tilemap_set_transparent_pen(state->mhigh_tilemap, 0);
|
||||
tilemap_set_transparent_pen(state->tx_tilemap, 0);
|
||||
@ -383,7 +383,7 @@ static VIDEO_START( mwarr )
|
||||
tilemap_set_scroll_rows(state->mlow_tilemap, 256);
|
||||
tilemap_set_scroll_rows(state->mhigh_tilemap, 256);
|
||||
|
||||
state->save_pointer(NAME(state->sprites_buffer), 0x800);
|
||||
state->save_item(NAME(state->sprites_buffer));
|
||||
}
|
||||
|
||||
static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
|
||||
|
@ -33,9 +33,6 @@ public:
|
||||
nightgal_state(running_machine &machine, const driver_device_config_base &config)
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * blit_buffer;
|
||||
|
||||
/* video-related */
|
||||
UINT8 blit_raw_data[3];
|
||||
UINT8 true_blit[7];
|
||||
@ -51,6 +48,9 @@ public:
|
||||
/* devices */
|
||||
device_t *maincpu;
|
||||
device_t *subcpu;
|
||||
|
||||
/* memory */
|
||||
UINT8 blit_buffer[256*256];
|
||||
};
|
||||
|
||||
|
||||
@ -63,9 +63,8 @@ static READ8_HANDLER( blitter_status_r )
|
||||
static VIDEO_START( nightgal )
|
||||
{
|
||||
nightgal_state *state = machine->driver_data<nightgal_state>();
|
||||
state->blit_buffer = auto_alloc_array(machine, UINT8, 256*256);
|
||||
|
||||
state->save_pointer(NAME(state->blit_buffer), 256*256);
|
||||
state->save_item(NAME(state->blit_buffer));
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE( nightgal )
|
||||
|
@ -83,14 +83,16 @@ public:
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT16 * bitmap0;
|
||||
UINT16 * bitmap1;
|
||||
UINT16 * paletteram;
|
||||
UINT16 * wram;
|
||||
|
||||
/* video-related */
|
||||
int vbuffer;
|
||||
int old_bank;
|
||||
|
||||
/* memory */
|
||||
UINT16 bitmap0[0x40000/2];
|
||||
UINT16 bitmap1[0x40000/2];
|
||||
};
|
||||
|
||||
|
||||
@ -325,11 +327,9 @@ INPUT_PORTS_END
|
||||
static VIDEO_START( pasha2 )
|
||||
{
|
||||
pasha2_state *state = machine->driver_data<pasha2_state>();
|
||||
state->bitmap0 = auto_alloc_array(machine, UINT16, 0x40000/2);
|
||||
state->bitmap1 = auto_alloc_array(machine, UINT16, 0x40000/2);
|
||||
|
||||
state->save_pointer(NAME(state->bitmap0), 0x40000/2);
|
||||
state->save_pointer(NAME(state->bitmap1), 0x40000/2);
|
||||
state->save_item(NAME(state->bitmap0));
|
||||
state->save_item(NAME(state->bitmap1));
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE( pasha2 )
|
||||
|
@ -90,12 +90,6 @@
|
||||
|
||||
enum { BANK_GROUP_A, BANK_GROUP_B, INVALID_BANK_GROUP };
|
||||
|
||||
static const UINT16 dsp56k_bank00_size = 0x1000;
|
||||
static const UINT16 dsp56k_bank01_size = 0x1000;
|
||||
static const UINT16 dsp56k_bank02_size = 0x4000;
|
||||
static const UINT16 dsp56k_shared_ram_16_size = 0x2000;
|
||||
static const UINT16 dsp56k_bank04_size = 0x1fc0;
|
||||
|
||||
static const eeprom_interface eeprom_intf =
|
||||
{
|
||||
7, /* address bits */
|
||||
@ -755,24 +749,22 @@ static DRIVER_INIT(polygonet)
|
||||
reset_sound_region(machine);
|
||||
|
||||
/* Allocate space for the dsp56k banking */
|
||||
state->dsp56k_bank00_ram = auto_alloc_array_clear(machine, UINT16, 2 * 8 * dsp56k_bank00_size); /* 2 bank sets, 8 potential banks each */
|
||||
state->dsp56k_bank01_ram = auto_alloc_array_clear(machine, UINT16, 2 * 8 * dsp56k_bank01_size);
|
||||
state->dsp56k_bank02_ram = auto_alloc_array_clear(machine, UINT16, 2 * 8 * dsp56k_bank02_size);
|
||||
state->dsp56k_shared_ram_16 = auto_alloc_array_clear(machine, UINT16, 2 * 8 * dsp56k_shared_ram_16_size);
|
||||
state->dsp56k_bank04_ram = auto_alloc_array_clear(machine, UINT16, 2 * 8 * dsp56k_bank04_size);
|
||||
memset(state->dsp56k_bank00_ram, 0, sizeof(state->dsp56k_bank00_ram));
|
||||
memset(state->dsp56k_bank01_ram, 0, sizeof(state->dsp56k_bank01_ram));
|
||||
memset(state->dsp56k_bank02_ram, 0, sizeof(state->dsp56k_bank02_ram));
|
||||
memset(state->dsp56k_shared_ram_16, 0, sizeof(state->dsp56k_shared_ram_16));
|
||||
memset(state->dsp56k_bank04_ram, 0, sizeof(state->dsp56k_bank04_ram));
|
||||
|
||||
/* The dsp56k occasionally executes out of mapped memory */
|
||||
address_space *space = machine->device<dsp56k_device>("dsp")->space(AS_PROGRAM);
|
||||
state->dsp56k_update_handler = space->set_direct_update_handler(direct_update_delegate_create_static(plygonet_dsp56k_direct_handler, *machine));
|
||||
|
||||
/* save states */
|
||||
state->save_pointer(NAME(state->dsp56k_p_mirror), 2 * 0x1000);
|
||||
state->save_pointer(NAME(state->dsp56k_p_8000), 2 * 0x800);
|
||||
state->save_pointer(NAME(state->dsp56k_bank00_ram), 2 * 8 * dsp56k_bank00_size);
|
||||
state->save_pointer(NAME(state->dsp56k_bank01_ram), 2 * 8 * dsp56k_bank01_size);
|
||||
state->save_pointer(NAME(state->dsp56k_bank02_ram), 2 * 8 * dsp56k_bank02_size);
|
||||
state->save_pointer(NAME(state->dsp56k_shared_ram_16), 2 * 8 * dsp56k_shared_ram_16_size);
|
||||
state->save_pointer(NAME(state->dsp56k_bank04_ram), 2 * 8 * dsp56k_bank04_size);
|
||||
state->save_item(NAME(state->dsp56k_bank00_ram));
|
||||
state->save_item(NAME(state->dsp56k_bank01_ram));
|
||||
state->save_item(NAME(state->dsp56k_bank02_ram));
|
||||
state->save_item(NAME(state->dsp56k_shared_ram_16));
|
||||
state->save_item(NAME(state->dsp56k_bank04_ram));
|
||||
state->save_item(NAME(state->cur_sound_region));
|
||||
}
|
||||
|
||||
|
@ -514,7 +514,7 @@ static MACHINE_START( spy )
|
||||
memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x2000);
|
||||
|
||||
machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
|
||||
state->pmcram = auto_alloc_array_clear(machine, UINT8, 0x800);
|
||||
memset(state->pmcram, 0, sizeof(state->pmcram));
|
||||
|
||||
state->maincpu = machine->device("maincpu");
|
||||
state->audiocpu = machine->device("audiocpu");
|
||||
@ -527,8 +527,8 @@ static MACHINE_START( spy )
|
||||
state->save_item(NAME(state->pmcbank));
|
||||
state->save_item(NAME(state->video_enable));
|
||||
state->save_item(NAME(state->old_3f90));
|
||||
state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x800);
|
||||
state->save_pointer(NAME(state->pmcram), 0x800);
|
||||
state->save_pointer(NAME(machine->generic.paletteram.u8), 0x800);
|
||||
state->save_item(NAME(state->pmcram));
|
||||
}
|
||||
|
||||
static MACHINE_RESET( spy )
|
||||
|
@ -156,8 +156,8 @@ public:
|
||||
ssingles_state(running_machine &machine, const driver_device_config_base &config)
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
UINT8 *videoram;
|
||||
UINT8 *colorram;
|
||||
UINT8 videoram[VMEM_SIZE];
|
||||
UINT8 colorram[VMEM_SIZE];
|
||||
UINT8 prot_data;
|
||||
pen_t pens[NUM_PENS];
|
||||
};
|
||||
@ -549,10 +549,8 @@ static DRIVER_INIT(ssingles)
|
||||
{
|
||||
ssingles_state *state = machine->driver_data<ssingles_state>();
|
||||
|
||||
state->videoram=auto_alloc_array_clear(machine, UINT8, VMEM_SIZE);
|
||||
state->colorram=auto_alloc_array_clear(machine, UINT8, VMEM_SIZE);
|
||||
state->save_pointer(NAME(state->videoram), VMEM_SIZE);
|
||||
state->save_pointer(NAME(state->colorram), VMEM_SIZE);
|
||||
state->save_item(NAME(state->videoram));
|
||||
state->save_item(NAME(state->colorram));
|
||||
}
|
||||
|
||||
GAME( 1983, ssingles, 0, ssingles, ssingles, ssingles, ROT90, "Ent. Ent. Ltd", "Swinging Singles", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
|
||||
|
@ -146,13 +146,9 @@ static MACHINE_START( taito_l )
|
||||
state->maincpu = machine->device("maincpu");
|
||||
state->audiocpu = machine->device("audiocpu");
|
||||
|
||||
state->rambanks = auto_alloc_array(machine, UINT8, 0x1000 * 12);
|
||||
state->palette_ram = auto_alloc_array(machine, UINT8, 0x1000);
|
||||
state->empty_ram = auto_alloc_array(machine, UINT8, 0x1000);
|
||||
|
||||
state->save_pointer(NAME(state->rambanks), 0x1000 * 12);
|
||||
state->save_pointer(NAME(state->palette_ram), 0x1000);
|
||||
state->save_pointer(NAME(state->empty_ram), 0x1000);
|
||||
state->save_item(NAME(state->rambanks));
|
||||
state->save_item(NAME(state->palette_ram));
|
||||
state->save_item(NAME(state->empty_ram));
|
||||
|
||||
state_register(machine);
|
||||
}
|
||||
|
@ -654,11 +654,11 @@ static MACHINE_START( thunderx )
|
||||
memory_configure_bank(machine, "bank1", 12, 4, &ROM[0x08000], 0x2000);
|
||||
memory_set_bank(machine, "bank1", 0);
|
||||
|
||||
state->pmcram = auto_alloc_array_clear(machine, UINT8, 0x800);
|
||||
memset(state->pmcram, 0, sizeof(state->pmcram));
|
||||
|
||||
MACHINE_START_CALL(scontra);
|
||||
|
||||
state->save_pointer(NAME(state->pmcram), 0x800);
|
||||
state->save_item(NAME(state->pmcram));
|
||||
}
|
||||
|
||||
static MACHINE_RESET( scontra )
|
||||
|
@ -301,8 +301,7 @@ static SAMPLES_START( tmnt_decode_sample )
|
||||
int i;
|
||||
UINT8 *source = machine->region("title")->base();
|
||||
|
||||
state->sampledata = auto_alloc_array(machine, INT16, 0x40000);
|
||||
state->save_pointer(NAME(state->sampledata), 0x40000);
|
||||
state->save_item(NAME(state->sampledata));
|
||||
|
||||
/* Sound sample for TMNT.D05 is stored in the following mode (ym3012 format):
|
||||
*
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
|
||||
int control_num;
|
||||
UINT16 *shared_ram;
|
||||
UINT8 *nvram;
|
||||
UINT8 nvram[0x800];
|
||||
int dsp_BIO;
|
||||
int dsp_idle;
|
||||
};
|
||||
@ -354,10 +354,9 @@ static MACHINE_START(tomcat)
|
||||
((UINT16*)state->shared_ram)[0x0002] = 0xf600;
|
||||
((UINT16*)state->shared_ram)[0x0003] = 0x0000;
|
||||
|
||||
state->nvram = auto_alloc_array(machine, UINT8, 0x800);
|
||||
machine->device<nvram_device>("nvram")->set_base(state->nvram, 0x800);
|
||||
|
||||
state->save_pointer(NAME(state->nvram), 0x800);
|
||||
state->save_item(NAME(state->nvram));
|
||||
state->save_item(NAME(state->control_num));
|
||||
state->save_item(NAME(state->dsp_BIO));
|
||||
state->save_item(NAME(state->dsp_idle));
|
||||
|
@ -471,7 +471,6 @@ static MACHINE_START( yunsung8 )
|
||||
UINT8 *MAIN = machine->region("maincpu")->base();
|
||||
UINT8 *AUDIO = machine->region("audiocpu")->base();
|
||||
|
||||
state->videoram = auto_alloc_array(machine, UINT8, 0x4000);
|
||||
state->videoram_0 = state->videoram + 0x0000; // Ram is banked
|
||||
state->videoram_1 = state->videoram + 0x2000;
|
||||
|
||||
@ -482,7 +481,7 @@ static MACHINE_START( yunsung8 )
|
||||
|
||||
state->audiocpu = machine->device("audiocpu");
|
||||
|
||||
state->save_pointer(NAME(state->videoram), 0x4000);
|
||||
state->save_item(NAME(state->videoram));
|
||||
state->save_item(NAME(state->layers_ctrl));
|
||||
state->save_item(NAME(state->videobank));
|
||||
state->save_item(NAME(state->adpcm));
|
||||
|
@ -7,11 +7,13 @@ public:
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * banked_vram;
|
||||
UINT8 * paletteram;
|
||||
|
||||
/* devices */
|
||||
device_t *audiocpu;
|
||||
|
||||
/* memory */
|
||||
UINT8 banked_vram[0x2000];
|
||||
};
|
||||
|
||||
|
||||
|
@ -12,8 +12,6 @@ public:
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *bg_tilemap;
|
||||
UINT8 *videoram;
|
||||
UINT8 *colorram;
|
||||
int video_page;
|
||||
|
||||
/* misc */
|
||||
@ -44,6 +42,10 @@ public:
|
||||
device_t *tms2;
|
||||
device_t *ay1;
|
||||
device_t *ay2;
|
||||
|
||||
// memory
|
||||
UINT8 videoram[0x400];
|
||||
UINT8 colorram[0x400];
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
static const UINT16 dsp56k_bank00_size = 0x1000;
|
||||
static const UINT16 dsp56k_bank01_size = 0x1000;
|
||||
static const UINT16 dsp56k_bank02_size = 0x4000;
|
||||
static const UINT16 dsp56k_shared_ram_16_size = 0x2000;
|
||||
static const UINT16 dsp56k_bank04_size = 0x1fc0;
|
||||
|
||||
class polygonet_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -9,11 +15,6 @@ public:
|
||||
|
||||
UINT16* dsp56k_p_mirror;
|
||||
UINT16* dsp56k_p_8000;
|
||||
UINT16* dsp56k_bank00_ram;
|
||||
UINT16* dsp56k_bank01_ram;
|
||||
UINT16* dsp56k_bank02_ram;
|
||||
UINT16* dsp56k_shared_ram_16;
|
||||
UINT16* dsp56k_bank04_ram;
|
||||
int cur_sound_region;
|
||||
|
||||
direct_update_delegate dsp56k_update_handler;
|
||||
@ -24,6 +25,13 @@ public:
|
||||
tilemap_t *roz_tilemap;
|
||||
UINT16 ttl_vram[0x800];
|
||||
UINT16 roz_vram[0x800];
|
||||
|
||||
/* memory buffers */
|
||||
UINT16 dsp56k_bank00_ram[2 * 8 * dsp56k_bank00_size]; /* 2 bank sets, 8 potential banks each */
|
||||
UINT16 dsp56k_bank01_ram[2 * 8 * dsp56k_bank01_size];
|
||||
UINT16 dsp56k_bank02_ram[2 * 8 * dsp56k_bank02_size];
|
||||
UINT16 dsp56k_shared_ram_16[2 * 8 * dsp56k_shared_ram_16_size];
|
||||
UINT16 dsp56k_bank04_ram[2 * 8 * dsp56k_bank04_size];
|
||||
};
|
||||
|
||||
/*----------- defined in video/plygonet.c -----------*/
|
||||
|
@ -12,7 +12,7 @@ public:
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * ram;
|
||||
UINT8 * pmcram;
|
||||
UINT8 pmcram[0x800];
|
||||
// UINT8 * paletteram; // currently this uses generic palette handling
|
||||
|
||||
/* video-related */
|
||||
|
@ -8,9 +8,6 @@ public:
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * rambanks;
|
||||
UINT8 * palette_ram;
|
||||
UINT8 * empty_ram;
|
||||
UINT8 * shared_ram;
|
||||
|
||||
/* video-related */
|
||||
@ -50,6 +47,11 @@ public:
|
||||
/* devices */
|
||||
device_t *maincpu;
|
||||
device_t *audiocpu;
|
||||
|
||||
/* memory buffers */
|
||||
UINT8 rambanks[0x1000 * 12];
|
||||
UINT8 palette_ram[0x1000];
|
||||
UINT8 empty_ram[0x1000];
|
||||
};
|
||||
|
||||
/*----------- defined in video/taito_l.c -----------*/
|
||||
|
@ -12,7 +12,7 @@ public:
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * ram;
|
||||
UINT8 * pmcram;
|
||||
UINT8 pmcram[0x800];
|
||||
// UINT8 * paletteram; // currently this uses generic palette handling
|
||||
|
||||
/* video-related */
|
||||
|
@ -6,7 +6,6 @@ public:
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
INT16 * sampledata;
|
||||
UINT16 * tmnt2_1c0800;
|
||||
UINT16 * sunset_104000;
|
||||
UINT16 * tmnt2_rom;
|
||||
@ -47,6 +46,9 @@ public:
|
||||
device_t *k054000;
|
||||
device_t *upd;
|
||||
device_t *samples;
|
||||
|
||||
/* memory buffers */
|
||||
INT16 sampledata[0x40000];
|
||||
};
|
||||
|
||||
|
||||
|
@ -10,9 +10,6 @@ public:
|
||||
yunsung8_state(running_machine &machine, const driver_device_config_base &config)
|
||||
: driver_device(machine, config) { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT8 * videoram;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *tilemap_0, *tilemap_1;
|
||||
UINT8 *videoram_0, *videoram_1;
|
||||
@ -25,6 +22,9 @@ public:
|
||||
|
||||
/* devices */
|
||||
device_t *audiocpu;
|
||||
|
||||
/* memory */
|
||||
UINT8 videoram[0x4000];
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user