mirror of
https://github.com/holub/mame
synced 2025-05-28 16:43:04 +03:00
Major toaplan2.c updates [Alex Jackson]
- Some sets reparented and renamed as well as a cleanup of source comments: grindstm (parent), vfive (clone) kingdmgp (parent), shippumd (clone) The set formerly known as "sstrikera" is now "sstriker" and is now the parent of mahoudai (clone). Reverted batrid to batrider and bkraid to bbakraid. - Put common init code into MACHINE_START, leaving DRIVER_INITs only for games that actually need unique initialization. - Dead code cleanup: Removed old hacks and some no-longer-used used member variables from the driver class. - ROM banking cleanup: Added a device address map for the OKI in fixeightbl. Stopped misusing the bank system for memory that isn't actually bankswitched (fixeightbl again) Simplified the Z80 ROM banking (and loading) in the Raizing games. - Address map cleanup: Unified 8-bit shared RAM handling between the Z80-based and the V25-based games. Replaced lots of pointless READ_HANDLERs with AM_RAM_WRITE. Moved fixeight EEPROM handling into the input ports instead of using READ/WRITE_HANDLERs. Incidentally, this makes toaplan2.c the very first MAME driver to use the AM_READWRITE_PORT macro. - Removed IPT_VBLANK input ports (no longer used since the video rewrite) - Removed Truxton 2 player 2 "button 4" (after confirming that the game never reads it) and changed player 1 "button 4" to an IPT_OTHER not bound to any key by default, since it's clearly some kind of test/debug input not meant to be hooked up in a regular cabinet (for one thing, it works whether you're actually playing or in attract mode) - Added button 3 to Batsugun Special Version. It's a full auto fire button like Cave games have. The service mode input test doesn't show it, presumably because Toaplan didn't bother to update the service mode code from the original version of the game. - Fixed region jumpers and dipswitches in many sets, based on analysis of the program code and strings in the ROMs. - Added a #define to optionally make Truxton 2 stereo (commented out by default). See the comments at the top of the driver and in the MACHINE_CONFIG. - Corrected kbash ROM names, thanks to information from Charles MacDonald. Also fixed inconsistent ROM naming between some of the batrider clones. - Loaded bbakraid default EEPROM as a ROM rather than hardcoding the contents into the driver. - Completely removed audio/toaplan2.c, which isn't needed any more now that all the V25s are decrypted and hooked up.
This commit is contained in:
parent
7341a57120
commit
8acf0fa5d3
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1455,7 +1455,6 @@ src/mame/audio/targ.c svneol=native#text/plain
|
||||
src/mame/audio/tiamc1.c svneol=native#text/plain
|
||||
src/mame/audio/timeplt.c svneol=native#text/plain
|
||||
src/mame/audio/timeplt.h svneol=native#text/plain
|
||||
src/mame/audio/toaplan2.c svneol=native#text/plain
|
||||
src/mame/audio/trackfld.c svneol=native#text/plain
|
||||
src/mame/audio/trackfld.h svneol=native#text/plain
|
||||
src/mame/audio/triplhnt.c svneol=native#text/plain
|
||||
|
@ -1,79 +0,0 @@
|
||||
#include "emu.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "includes/toaplan2.h"
|
||||
|
||||
/****************************************************************************
|
||||
The Toaplan 2 hardware with V25 secondary CPU controls the sound through
|
||||
to a YM2151 and OKI M6295 on some boards. Here we just interpret some of
|
||||
commands sent to the V25, directly onto the OKI M6295
|
||||
|
||||
These tables convert commands sent from the main CPU, into sample numbers
|
||||
played back by the sound processor.
|
||||
The ADPCM ROMs contain intrument samples which are sequenced by the
|
||||
sound processor to create some of the backing tracks. This is beyond the
|
||||
scope of this playback file. Time would be better spent elsewhere.
|
||||
****************************************************************************/
|
||||
|
||||
static const UINT8 fixeight_cmd_snd[128] =
|
||||
{
|
||||
/* Some sound commands are mixed with tones produced by the FM chip */
|
||||
/* Probably 96(60H), 82(52H), 80(50H) and 70(46H) and maybe others */
|
||||
/*00*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/*08*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/*10*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/*18*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/*20*/ 0x18, 0x3e, 0x37, 0x48, 0x38, 0x49, 0x4a, 0x4b,
|
||||
/*28*/ 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x53, 0x54, 0x51,
|
||||
/*30*/ 0x52, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
|
||||
/*38*/ 0x07, 0x08, 0x00, 0x1b, 0x00, 0x43, 0x00, 0x00,
|
||||
/*40*/ 0x00, 0x47, 0x00, 0x3a, 0x44, 0x0a, 0x0a, 0x06,
|
||||
/*48*/ 0x3c, 0x46, 0x3f, 0x45, 0x00, 0x02, 0x04, 0x10,
|
||||
/*50*/ 0x0f, 0x11, 0x09, 0x0d, 0x0c, 0x0b, 0x00, 0x00,
|
||||
/*58*/ 0x00, 0x15, 0x3d, 0x3f, 0x1e, 0x1c, 0x19, 0x13,
|
||||
/*60*/ 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/*68*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/*70*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
/*78*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
static void play_oki_sound(okim6295_device *oki, int game_sound, int data)
|
||||
{
|
||||
int status = oki->read_status();
|
||||
|
||||
logerror("Playing sample %02x from command %02x\n",game_sound,data);
|
||||
|
||||
if (game_sound != 0)
|
||||
{
|
||||
if ((status & 0x01) == 0) {
|
||||
oki->write_command(0x80 | game_sound);
|
||||
oki->write_command(0x11);
|
||||
}
|
||||
else if ((status & 0x02) == 0) {
|
||||
oki->write_command(0x80 | game_sound);
|
||||
oki->write_command(0x21);
|
||||
}
|
||||
else if ((status & 0x04) == 0) {
|
||||
oki->write_command(0x80 | game_sound);
|
||||
oki->write_command(0x41);
|
||||
}
|
||||
else if ((status & 0x08) == 0) {
|
||||
oki->write_command(0x80 | game_sound);
|
||||
oki->write_command(0x81);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void fixeight_okisnd_w(device_t *device, int data)
|
||||
{
|
||||
// popmessage("Writing %04x to Sound CPU",data);
|
||||
|
||||
okim6295_device *oki = downcast<okim6295_device *>(device);
|
||||
if (data == 0)
|
||||
{
|
||||
oki->write_command(0x78); /* Stop playing effects */
|
||||
}
|
||||
else if ((data > 0) && (data < 128))
|
||||
{
|
||||
play_oki_sound(oki, fixeight_cmd_snd[data], data);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,21 +1,14 @@
|
||||
/**************** Machine stuff ******************/
|
||||
//#define USE_HD64x180 /* Define if CPU support is available */
|
||||
#define USE_ENCRYPTED_V25S /* Define to enable V25 even on games where it is encrypted */
|
||||
//#define TRUXTON2_STEREO /* Uncomment to hear truxton2 music in stereo */
|
||||
|
||||
/* sub cpu */
|
||||
#define CPU_2_NONE 0x00
|
||||
#define CPU_2_Z80 0x5a
|
||||
#define CPU_2_HD647180 0xa5
|
||||
#define CPU_2_V25 0xff
|
||||
|
||||
// we encode priority with colour in the tilemaps, so need a larger palette
|
||||
// We encode priority with colour in the tilemaps, so need a larger palette
|
||||
#define T2PALETTE_LENGTH 0x10000
|
||||
|
||||
/* vdp related */
|
||||
|
||||
// VDP related
|
||||
#include "video/gp9001.h"
|
||||
|
||||
// cache the vdps for faster access
|
||||
// Cache the CPUs and VDPs for faster access
|
||||
class toaplan2_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -29,58 +22,44 @@ public:
|
||||
gp9001vdp_device* vdp0;
|
||||
gp9001vdp_device* vdp1;
|
||||
|
||||
UINT8 *z80_shared_ram;
|
||||
UINT16 *shared_ram16; /* Really 8bit RAM connected to Z180 */
|
||||
UINT8 *shared_ram; /* 8 bit RAM shared between 68K and sound CPU */
|
||||
UINT16 *shared_ram16; /* Really 8 bit RAM connected to Z180 */
|
||||
|
||||
#ifndef USE_ENCRYPTED_V25S
|
||||
UINT16 *V25_shared_ram; /* Really 8bit RAM connected to Z180 */
|
||||
#endif
|
||||
UINT8* batsugun_share;
|
||||
|
||||
|
||||
int sub_cpu_type;
|
||||
device_t *main_cpu;
|
||||
device_t *sub_cpu;
|
||||
|
||||
UINT16 mcu_data;
|
||||
UINT16 video_status;
|
||||
INT8 old_p1_paddle_h; /* For Ghox */
|
||||
INT8 old_p1_paddle_h; /* For Ghox */
|
||||
INT8 old_p2_paddle_h;
|
||||
UINT8 v25_reset_line; /* 0x20 for dogyuun/batsugun, 0x10 for vfive, 0x08 for fixeight */
|
||||
INT8 current_bank; /* Z80 bank used in Battle Garegga and Batrider */
|
||||
int sndirq_line; /* IRQ4 for batrider, IRQ2 for bbakraid */
|
||||
UINT16 z80_busreq;
|
||||
int unlimited_ver;
|
||||
UINT8 v25_reset_line; /* 0x20 for dogyuun/batsugun, 0x10 for vfive, 0x08 for fixeight */
|
||||
UINT8 sndirq_line; /* IRQ4 for batrider, IRQ2 for bbakraid */
|
||||
UINT8 z80_busreq;
|
||||
|
||||
UINT16 *txvideoram16;
|
||||
UINT16 *txvideoram16_offs;
|
||||
UINT16 *txscrollram16;
|
||||
UINT16 *tx_gfxram16;
|
||||
UINT16 *mainram16;
|
||||
|
||||
size_t tx_vram_size;
|
||||
size_t tx_offs_vram_size;
|
||||
size_t tx_scroll_vram_size;
|
||||
size_t paletteram16_size;
|
||||
size_t paletteram_size;
|
||||
size_t mainram_overlap_size;
|
||||
|
||||
bitmap_t* custom_priority_bitmap;
|
||||
bitmap_t* secondary_render_bitmap;
|
||||
|
||||
tilemap_t *tx_tilemap; /* Tilemap for extra-text-layer */
|
||||
UINT8 tx_flip;
|
||||
int display_tx;
|
||||
int displog;
|
||||
};
|
||||
|
||||
|
||||
/*----------- defined in audio/toaplan2.c -----------*/
|
||||
|
||||
void fixeight_okisnd_w(device_t *device, int data);
|
||||
|
||||
/*----------- defined in video/toaplan2.c -----------*/
|
||||
|
||||
SCREEN_EOF( toaplan2 );
|
||||
VIDEO_START( toaplan2 );
|
||||
VIDEO_START( truxton2 );
|
||||
VIDEO_START( fixeighb );
|
||||
VIDEO_START( fixeightbl );
|
||||
VIDEO_START( bgaregga );
|
||||
VIDEO_START( batrider );
|
||||
|
||||
@ -90,18 +69,14 @@ SCREEN_UPDATE( batrider );
|
||||
SCREEN_UPDATE( dogyuun );
|
||||
SCREEN_UPDATE( batsugun );
|
||||
|
||||
SCREEN_EOF( toaplan2 );
|
||||
|
||||
/* non-vdp text layer */
|
||||
READ16_HANDLER ( toaplan2_txvideoram16_r );
|
||||
WRITE16_HANDLER( toaplan2_txvideoram16_w );
|
||||
READ16_HANDLER ( toaplan2_txvideoram16_offs_r );
|
||||
WRITE16_HANDLER( toaplan2_txvideoram16_offs_w );
|
||||
READ16_HANDLER ( toaplan2_txscrollram16_r );
|
||||
WRITE16_HANDLER( toaplan2_txscrollram16_w );
|
||||
READ16_HANDLER ( toaplan2_tx_gfxram16_r );
|
||||
WRITE16_HANDLER( toaplan2_tx_gfxram16_w );
|
||||
READ16_HANDLER ( raizing_tx_gfxram16_r );
|
||||
WRITE16_HANDLER( raizing_tx_gfxram16_w );
|
||||
|
||||
WRITE16_HANDLER( batrider_textdata_dma_w );
|
||||
WRITE16_HANDLER( batrider_unknown_dma_w );
|
||||
WRITE16_HANDLER( batrider_objectbank_w );
|
||||
WRITE16_HANDLER( batrider_textdata_decode );
|
||||
|
||||
|
@ -1424,7 +1424,7 @@ $(MAMEOBJ)/toaplan.a: \
|
||||
$(DRIVERS)/slapfght.o $(MACHINE)/slapfght.o $(VIDEO)/slapfght.o \
|
||||
$(DRIVERS)/snowbros.o $(VIDEO)/kan_pand.o $(VIDEO)/kan_panb.o \
|
||||
$(DRIVERS)/toaplan1.o $(MACHINE)/toaplan1.o $(VIDEO)/toaplan1.o \
|
||||
$(DRIVERS)/toaplan2.o $(AUDIO)/toaplan2.o $(VIDEO)/toaplan2.o $(VIDEO)/gp9001.o \
|
||||
$(DRIVERS)/toaplan2.o $(VIDEO)/toaplan2.o $(VIDEO)/gp9001.o \
|
||||
$(DRIVERS)/twincobr.o $(MACHINE)/twincobr.o $(VIDEO)/twincobr.o \
|
||||
$(DRIVERS)/wardner.o \
|
||||
|
||||
|
@ -2383,7 +2383,7 @@ const game_driver * const drivers[] =
|
||||
DRIVER( ghox ) /* TP-021 (c) 1991 Toaplan */
|
||||
DRIVER( ghoxj ) /* TP-021 (c) 1991 Toaplan */
|
||||
DRIVER( dogyuun ) /* TP-022 (c) 1992 Toaplan */
|
||||
DRIVER( dogyuunk ) /* TP-022 (c) 1992 Toaplan */
|
||||
DRIVER( dogyuuna ) /* TP-022 (c) 1992 Toaplan */
|
||||
DRIVER( dogyuunt ) /* TP-022 (c) 1992 Toaplan */
|
||||
DRIVER( kbash ) /* TP-023 (c) 1993 Toaplan */
|
||||
DRIVER( kbash2 ) /* bootleg */
|
||||
@ -2407,9 +2407,9 @@ const game_driver * const drivers[] =
|
||||
DRIVER( fixeightj )
|
||||
DRIVER( fixeightjt )
|
||||
DRIVER( fixeightbl ) /* bootleg */
|
||||
DRIVER( vfive ) /* TP-027 (c) 1993 Toaplan (Japan) */
|
||||
DRIVER( grindstm ) /* TP-027 (c) 1993 Toaplan + Unite Trading license (Korea) */
|
||||
DRIVER( grindstma ) /* TP-027 (c) 1993 Toaplan + Unite Trading license (Korea) */
|
||||
DRIVER( vfive ) /* TP-027 (c) 1993 Toaplan (Japan) */
|
||||
DRIVER( batsugun ) /* TP-030 (c) 1993 Toaplan */
|
||||
DRIVER( batsuguna ) /* TP-030 (c) 1993 Toaplan */
|
||||
DRIVER( batsugunsp )/* TP-??? (c) 1993 Toaplan */
|
||||
@ -2417,24 +2417,24 @@ const game_driver * const drivers[] =
|
||||
DRIVER( sstriker ) /* (c) 1993 Raizing */
|
||||
DRIVER( sstrikera ) /* (c) 1993 Raizing */
|
||||
DRIVER( mahoudai ) /* (c) 1993 Raizing + Able license */
|
||||
DRIVER( kingdmgp ) /* (c) 1994 Raizing/8ing */
|
||||
DRIVER( shippumd ) /* (c) 1994 Raizing/8ing */
|
||||
DRIVER( kingdmgp ) /* (c) 1994 Raizing/8ing (hack?) */
|
||||
DRIVER( bgaregga ) /* (c) 1996 Raizing/8ing */
|
||||
DRIVER( bgareggahk ) /* (c) 1996 Raizing/8ing */
|
||||
DRIVER( bgareggatw ) /* (c) 1996 Raizing/8ing */
|
||||
DRIVER( bgaregganv ) /* (c) 1996 Raizing/8ing */
|
||||
DRIVER( bgareggat2 ) /* (c) 1996 Raizing/8ing */
|
||||
DRIVER( bgareggacn ) /* (c) 1996 Raizing/8ing */
|
||||
DRIVER( batrid ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batridu ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batridc ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batridj ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batridk ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batridja ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batridta ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( bkraidu ) /* (c) 1999 8ing */
|
||||
DRIVER( bkraiduj ) /* (c) 1999 8ing */
|
||||
DRIVER( bkraidj ) /* (c) 1999 8ing */
|
||||
DRIVER( batrider ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batrideru ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batriderc ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batriderj ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batriderk ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batriderja ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( batridert ) /* (c) 1998 Raizing/8ing */
|
||||
DRIVER( bbakraid ) /* (c) 1999 8ing */
|
||||
DRIVER( bbakraidj ) /* (c) 1999 8ing */
|
||||
DRIVER( bbakraidja ) /* (c) 1999 8ing */
|
||||
|
||||
/*
|
||||
Toa Plan's board list
|
||||
|
@ -21,9 +21,6 @@
|
||||
|
||||
|
||||
To Do / Unknowns
|
||||
- Hack is needed to reset sound CPU and sound chip when machine
|
||||
is 'tilted' in Pipi & Bibis. Otherwise sound CPU interferes
|
||||
with the main CPU test of shared RAM. You get a 'Sub CPU RAM Error'
|
||||
- What do Scroll registers 0Eh and 0Fh really do ????
|
||||
- Snow Bros 2 sets bit 6 of the sprite X info word during weather
|
||||
world map, and bits 4, 5 and 6 of the sprite X info word during
|
||||
@ -589,19 +586,6 @@ static void gp9001_scroll_reg_data_w(gp9001vdp_device *vdp, offs_t offset, UINT1
|
||||
|
||||
|
||||
case 0x0e: /******* Initialise video controller register ? *******/
|
||||
#if 0 // do we know this works on real hw?
|
||||
if ((gp9001_sub_cpu == CPU_2_Z80) && (data == 3))
|
||||
{
|
||||
/* HACK! When tilted, sound CPU needs to be reset. */
|
||||
device_t *ym = vdp->machine->device("ymsnd");
|
||||
|
||||
if (ym && ym->type() == YM3812)
|
||||
{
|
||||
cputag_set_input_line(vdp->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
|
||||
devtag_reset(vdp->machine, "ymsnd");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
case 0x0f: break;
|
||||
|
||||
|
@ -22,8 +22,6 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "sound/3812intf.h"
|
||||
#include "includes/toaplan2.h"
|
||||
|
||||
#define RAIZING_TX_GFXRAM_SIZE 0x8000 /* GFX data decode RAM size */
|
||||
@ -75,6 +73,11 @@ static void register_state_save(running_machine *machine)
|
||||
state->save_item(NAME(state->tx_flip));
|
||||
}
|
||||
|
||||
static STATE_POSTLOAD( truxton2_postload )
|
||||
{
|
||||
for (int i = 0; i < 1024; i++)
|
||||
gfx_element_mark_dirty(machine->gfx[2], i);
|
||||
}
|
||||
|
||||
VIDEO_START( toaplan2 )
|
||||
{
|
||||
@ -101,8 +104,6 @@ VIDEO_START( toaplan2 )
|
||||
state->vdp1->custom_priority_bitmap = state->custom_priority_bitmap;
|
||||
}
|
||||
|
||||
state->display_tx = 1;
|
||||
|
||||
register_state_save(machine);
|
||||
}
|
||||
|
||||
@ -113,17 +114,21 @@ VIDEO_START( truxton2 )
|
||||
VIDEO_START_CALL( toaplan2 );
|
||||
|
||||
/* Create the Text tilemap for this game */
|
||||
gfx_element_set_source(machine->gfx[2], (UINT8 *)state->tx_gfxram16);
|
||||
machine->state().register_postload(truxton2_postload, NULL);
|
||||
|
||||
truxton2_create_tx_tilemap(machine);
|
||||
if (machine->gfx[2]->srcdata == NULL)
|
||||
gfx_element_set_source(machine->gfx[2], (UINT8 *)state->tx_gfxram16);
|
||||
tilemap_set_scrolldx(state->tx_tilemap, 0x1d4 +1, 0x2a);
|
||||
}
|
||||
|
||||
VIDEO_START( fixeighb )
|
||||
VIDEO_START( fixeightbl )
|
||||
{
|
||||
toaplan2_state *state = machine->driver_data<toaplan2_state>();
|
||||
|
||||
VIDEO_START_CALL( truxton2 );
|
||||
VIDEO_START_CALL( toaplan2 );
|
||||
|
||||
/* Create the Text tilemap for this game */
|
||||
truxton2_create_tx_tilemap(machine);
|
||||
|
||||
/* This bootleg has additional layer offsets on the VDP */
|
||||
state->vdp0->bg.extra_xoffset.normal = -0x1d6 -26;
|
||||
@ -165,6 +170,8 @@ VIDEO_START( batrider )
|
||||
state->tx_gfxram16 = auto_alloc_array_clear(machine, UINT16, RAIZING_TX_GFXRAM_SIZE/2);
|
||||
state->save_pointer(NAME(state->tx_gfxram16), RAIZING_TX_GFXRAM_SIZE/2);
|
||||
gfx_element_set_source(machine->gfx[2], (UINT8 *)state->tx_gfxram16);
|
||||
machine->state().register_postload(truxton2_postload, NULL);
|
||||
|
||||
truxton2_create_tx_tilemap(machine);
|
||||
tilemap_set_scrolldx(state->tx_tilemap, 0x1d4, 0x2a);
|
||||
|
||||
@ -172,13 +179,6 @@ VIDEO_START( batrider )
|
||||
state->vdp0->gp9001_gfxrom_is_banked = 1;
|
||||
}
|
||||
|
||||
READ16_HANDLER( toaplan2_txvideoram16_r )
|
||||
{
|
||||
toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
|
||||
|
||||
return state->txvideoram16[offset];
|
||||
}
|
||||
|
||||
WRITE16_HANDLER( toaplan2_txvideoram16_w )
|
||||
{
|
||||
toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
|
||||
@ -188,19 +188,10 @@ WRITE16_HANDLER( toaplan2_txvideoram16_w )
|
||||
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
|
||||
}
|
||||
|
||||
READ16_HANDLER( toaplan2_txvideoram16_offs_r )
|
||||
{
|
||||
toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
|
||||
|
||||
return state->txvideoram16_offs[offset];
|
||||
}
|
||||
|
||||
WRITE16_HANDLER( toaplan2_txvideoram16_offs_w )
|
||||
{
|
||||
/* Besides containing flip, function of this RAM is still unknown */
|
||||
/* This is however line related as per line-scroll RAM below */
|
||||
/* Maybe specifies which line to draw text info (line number data is */
|
||||
/* opposite when flip bits are on) */
|
||||
// FIXME: implement line select and per-line flipping for all games
|
||||
// see SCREEN_UPDATE( batrider )
|
||||
|
||||
toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
|
||||
UINT16 oldword = state->txvideoram16_offs[offset];
|
||||
@ -227,13 +218,6 @@ WRITE16_HANDLER( toaplan2_txvideoram16_offs_w )
|
||||
// logerror("Writing %04x to text offs RAM offset %04x\n",data,offset);
|
||||
}
|
||||
|
||||
READ16_HANDLER( toaplan2_txscrollram16_r )
|
||||
{
|
||||
toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
|
||||
|
||||
return state->txscrollram16[offset];
|
||||
}
|
||||
|
||||
WRITE16_HANDLER( toaplan2_txscrollram16_w )
|
||||
{
|
||||
/*** Line-Scroll RAM for Text Layer ***/
|
||||
@ -247,13 +231,6 @@ WRITE16_HANDLER( toaplan2_txscrollram16_w )
|
||||
COMBINE_DATA(&state->txscrollram16[offset]);
|
||||
}
|
||||
|
||||
READ16_HANDLER( toaplan2_tx_gfxram16_r )
|
||||
{
|
||||
toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
|
||||
|
||||
return state->tx_gfxram16[offset];
|
||||
}
|
||||
|
||||
WRITE16_HANDLER( toaplan2_tx_gfxram16_w )
|
||||
{
|
||||
/*** Dynamic GFX decoding for Truxton 2 / FixEight ***/
|
||||
@ -269,49 +246,33 @@ WRITE16_HANDLER( toaplan2_tx_gfxram16_w )
|
||||
}
|
||||
}
|
||||
|
||||
READ16_HANDLER( raizing_tx_gfxram16_r )
|
||||
{
|
||||
toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
|
||||
|
||||
offset += 0x3400/2;
|
||||
return state->tx_gfxram16[offset];
|
||||
}
|
||||
|
||||
WRITE16_HANDLER( raizing_tx_gfxram16_w )
|
||||
{
|
||||
/*** Dynamic Text GFX decoding for Batrider ***/
|
||||
|
||||
toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
|
||||
UINT16 oldword;
|
||||
|
||||
offset += 0x3400/2;
|
||||
oldword = state->tx_gfxram16[offset];
|
||||
if (oldword != data)
|
||||
{
|
||||
COMBINE_DATA(&state->tx_gfxram16[offset]);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE16_HANDLER( batrider_textdata_decode )
|
||||
WRITE16_HANDLER( batrider_textdata_dma_w )
|
||||
{
|
||||
/*** Dynamic Text GFX decoding for Batrider ***/
|
||||
/*** Only done once during start-up ***/
|
||||
|
||||
toaplan2_state *state = space->machine->driver_data<toaplan2_state>();
|
||||
int code;
|
||||
UINT16 *dest = (UINT16 *)state->tx_gfxram16;
|
||||
UINT16 *dest = state->tx_gfxram16;
|
||||
|
||||
memcpy(dest, state->txvideoram16, state->tx_vram_size);
|
||||
dest += (state->tx_vram_size/2);
|
||||
memcpy(dest, space->machine->generic.paletteram.u16, state->paletteram16_size);
|
||||
dest += (state->paletteram16_size/2);
|
||||
memcpy(dest, space->machine->generic.paletteram.u16, state->paletteram_size);
|
||||
dest += (state->paletteram_size/2);
|
||||
memcpy(dest, state->txvideoram16_offs, state->tx_offs_vram_size);
|
||||
dest += (state->tx_offs_vram_size/2);
|
||||
memcpy(dest, state->txscrollram16, state->tx_scroll_vram_size);
|
||||
dest += (state->tx_scroll_vram_size/2);
|
||||
memcpy(dest, state->mainram16, state->mainram_overlap_size);
|
||||
|
||||
/* Decode text characters; force them to update immediately */
|
||||
for (code = 0; code < 1024; code++)
|
||||
gfx_element_decode(space->machine->gfx[2], code);
|
||||
for (int i = 0; i < 1024; i++)
|
||||
gfx_element_mark_dirty(space->machine->gfx[2], i);
|
||||
}
|
||||
|
||||
WRITE16_HANDLER( batrider_unknown_dma_w )
|
||||
{
|
||||
// FIXME: In batrider and bbakraid, the text layer and palette RAM
|
||||
// are probably DMA'd from main RAM by writing here at every vblank,
|
||||
// rather than being directly accessible to the 68K like the other games
|
||||
}
|
||||
|
||||
WRITE16_HANDLER( batrider_objectbank_w )
|
||||
|
Loading…
Reference in New Issue
Block a user