mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
merged sgladiat.c into snk.c
fixed shadows, visible area, tilemaps, inputs, etc. 00228: sgladiat: Emulation is missing some enemy sprites that are present on the pcb.
This commit is contained in:
parent
dae4b631d7
commit
36c88b32dd
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1922,7 +1922,6 @@ src/mame/drivers/seta2.c svneol=native#text/plain
|
||||
src/mame/drivers/sf.c svneol=native#text/plain
|
||||
src/mame/drivers/sfkick.c svneol=native#text/plain
|
||||
src/mame/drivers/sg1000a.c svneol=native#text/plain
|
||||
src/mame/drivers/sgladiat.c svneol=native#text/plain
|
||||
src/mame/drivers/shadfrce.c svneol=native#text/plain
|
||||
src/mame/drivers/shangha3.c svneol=native#text/plain
|
||||
src/mame/drivers/shanghai.c svneol=native#text/plain
|
||||
@ -3207,7 +3206,6 @@ src/mame/video/senjyo.c svneol=native#text/plain
|
||||
src/mame/video/seta.c svneol=native#text/plain
|
||||
src/mame/video/seta2.c svneol=native#text/plain
|
||||
src/mame/video/sf.c svneol=native#text/plain
|
||||
src/mame/video/sgladiat.c svneol=native#text/plain
|
||||
src/mame/video/shadfrce.c svneol=native#text/plain
|
||||
src/mame/video/shangha3.c svneol=native#text/plain
|
||||
src/mame/video/shangkid.c svneol=native#text/plain
|
||||
|
@ -1,306 +0,0 @@
|
||||
/*
|
||||
"Gladiator"
|
||||
(C) 1984 SNK
|
||||
|
||||
|
||||
known issues:
|
||||
sound/music doesn't sound good (but it might be correct)
|
||||
cocktail support is missing
|
||||
|
||||
Change Log
|
||||
----------
|
||||
|
||||
AT08XX03:
|
||||
- fixed music tempo, shadows and reduced sprite lag
|
||||
|
||||
The chips should be in good sync but quite a bit of lag
|
||||
remains without overclocking CPUB. I guess you can't beat
|
||||
a game with barrel-rolling bad guys in plate armors who
|
||||
can outrun a horse.
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "snk.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
extern VIDEO_START( sgladiat );
|
||||
extern VIDEO_UPDATE( sgladiat );
|
||||
|
||||
static int snk_sound_busy_bit;
|
||||
|
||||
UINT8 *snk_rambase;
|
||||
|
||||
static const gfx_layout tile_layout =
|
||||
{
|
||||
8,8,
|
||||
256,
|
||||
4,
|
||||
{ 0, 1, 2, 3 },
|
||||
{ 4, 0, 12, 8, 20, 16, 28, 24},
|
||||
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
|
||||
256
|
||||
};
|
||||
|
||||
static const gfx_layout sprite_layout =
|
||||
{
|
||||
16,16,
|
||||
256,
|
||||
3,
|
||||
{ 2*0x2000*8,1*0x2000*8,0*0x2000*8},
|
||||
{ 7,6,5,4,3,2,1,0, 15,14,13,12,11,10,9,8 },
|
||||
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
|
||||
8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
|
||||
256
|
||||
};
|
||||
|
||||
static GFXDECODE_START( tnk3 )
|
||||
GFXDECODE_ENTRY( "gfx1", 0x0, tile_layout, 128*3, 8 )
|
||||
GFXDECODE_ENTRY( "gfx2", 0x0, tile_layout, 128*1, 16 )
|
||||
GFXDECODE_ENTRY( "gfx3", 0x0, sprite_layout, 128*0, 16 )
|
||||
GFXDECODE_END
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
static WRITE8_HANDLER( sgladiat_soundlatch_w )
|
||||
{
|
||||
snk_sound_busy_bit = 1;
|
||||
soundlatch_w( machine, offset, data );
|
||||
|
||||
/* trigger NMI on sound CPU */
|
||||
cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, PULSE_LINE); // safer because NMI can be lost in rare occations
|
||||
}
|
||||
|
||||
static READ8_HANDLER( sgladiat_soundlatch_r )
|
||||
{
|
||||
snk_sound_busy_bit = 0;
|
||||
return(soundlatch_r(machine,0));
|
||||
}
|
||||
|
||||
static READ8_HANDLER( sgladiat_sound_nmi_ack_r )
|
||||
{
|
||||
// cpunum_set_input_line(machine, 2, INPUT_LINE_NMI, CLEAR_LINE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
static CUSTOM_INPUT( sound_busy_r )
|
||||
{
|
||||
return snk_sound_busy_bit;
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( sglatiat_flipscreen_w )
|
||||
{
|
||||
/* 0xa006 */
|
||||
/* x------- screen is flipped */
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( sgladiat_cpuA_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x9fff) AM_ROM
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0xa100, 0xa100) AM_READ_PORT("P1")
|
||||
AM_RANGE(0xa200, 0xa200) AM_READ_PORT("P2")
|
||||
AM_RANGE(0xa300, 0xa300) AM_WRITE(sgladiat_soundlatch_w)
|
||||
AM_RANGE(0xa400, 0xa400) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0xa500, 0xa500) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0xa600, 0xa600) AM_WRITE(sglatiat_flipscreen_w)
|
||||
AM_RANGE(0xa700, 0xa700) AM_READWRITE(snk_cpuB_nmi_trigger_r, snk_cpuA_nmi_ack_w)
|
||||
AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE(3) AM_BASE(&snk_rambase)
|
||||
// AM_RANGE(0xd200, 0xd200) AM_WRITE(SMH_RAM) /* ?0x24 */
|
||||
// AM_RANGE(0xd300, 0xd300) AM_WRITE(SMH_RAM) /* ------xx: msb scrollx */
|
||||
// AM_RANGE(0xd400, 0xd400) AM_WRITE(SMH_RAM) /* xscroll (sprite) */
|
||||
// AM_RANGE(0xd500, 0xd500) AM_WRITE(SMH_RAM) /* yscroll (sprite) */
|
||||
// AM_RANGE(0xd600, 0xd600) AM_WRITE(SMH_RAM) /* xscroll (bg) */
|
||||
// AM_RANGE(0xd700, 0xd700) AM_WRITE(SMH_RAM) /* yscroll (bg) */
|
||||
AM_RANGE(0xd800, 0xdfff) AM_RAM AM_BASE(&spriteram) AM_SHARE(1)
|
||||
AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE(&videoram) AM_SHARE(2)
|
||||
AM_RANGE(0xe800, 0xefff) AM_RAM
|
||||
AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE(4)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sgladiat_cpuB_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x9fff) AM_ROM
|
||||
AM_RANGE(0xa000, 0xa000) AM_READWRITE(snk_cpuA_nmi_trigger_r, snk_cpuB_nmi_ack_w)
|
||||
AM_RANGE(0xa600, 0xa600) AM_WRITE(sglatiat_flipscreen_w)
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_BASE(&spriteram) AM_SHARE(1)
|
||||
AM_RANGE(0xc800, 0xcfff) AM_RAM AM_BASE(&videoram) AM_SHARE(2)
|
||||
AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE(3)
|
||||
AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE(4)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sgladiat_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0x87ff) AM_RAM
|
||||
AM_RANGE(0xa000, 0xa000) AM_READ(sgladiat_soundlatch_r)
|
||||
AM_RANGE(0xc000, 0xc000) AM_READ(sgladiat_sound_nmi_ack_r)
|
||||
AM_RANGE(0xe000, 0xe000) AM_WRITE(ay8910_control_port_0_w)
|
||||
AM_RANGE(0xe001, 0xe001) AM_WRITE(ay8910_write_port_0_w)
|
||||
AM_RANGE(0xe002, 0xe003) AM_WRITE(SMH_NOP) // leftover wave generator ports?
|
||||
AM_RANGE(0xe004, 0xe004) AM_WRITE(ay8910_control_port_1_w)
|
||||
AM_RANGE(0xe005, 0xe005) AM_WRITE(ay8910_write_port_1_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sgladiat_sound_portmap, ADDRESS_SPACE_IO, 8 )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x00) AM_READNOP
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static MACHINE_DRIVER_START( sgladiat )
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("main", Z80, 4000000)
|
||||
MDRV_CPU_PROGRAM_MAP(sgladiat_cpuA_map,0)
|
||||
MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
|
||||
|
||||
MDRV_CPU_ADD("sub", Z80, 5000000)
|
||||
MDRV_CPU_PROGRAM_MAP(sgladiat_cpuB_map,0)
|
||||
MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
|
||||
|
||||
MDRV_CPU_ADD("audio", Z80, 4000000)
|
||||
MDRV_CPU_PROGRAM_MAP(sgladiat_sound_map,0)
|
||||
MDRV_CPU_IO_MAP(sgladiat_sound_portmap,0)
|
||||
MDRV_CPU_PERIODIC_INT(irq0_line_hold, 244) // Marvin's frequency, sounds ok
|
||||
|
||||
MDRV_INTERLEAVE(300)
|
||||
|
||||
/* video hardware */
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS)
|
||||
|
||||
MDRV_SCREEN_ADD("main", RASTER)
|
||||
MDRV_SCREEN_REFRESH_RATE(60.606060)
|
||||
MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
|
||||
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
||||
MDRV_SCREEN_SIZE(36*8, 28*8)
|
||||
MDRV_SCREEN_VISIBLE_AREA(0*8+16, 36*8-1-16, 1*8, 28*8-1)
|
||||
|
||||
MDRV_GFXDECODE(tnk3)
|
||||
MDRV_PALETTE_LENGTH(1024)
|
||||
|
||||
MDRV_PALETTE_INIT(aso)
|
||||
MDRV_VIDEO_START(sgladiat)
|
||||
MDRV_VIDEO_UPDATE(sgladiat)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MDRV_SOUND_ADD("ay1", AY8910, 2000000)
|
||||
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
|
||||
|
||||
MDRV_SOUND_ADD("ay2", AY8910, 2000000)
|
||||
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
ROM_START( sgladiat )
|
||||
ROM_REGION( 0x10000, "main", 0 ) /* 64k for cpuA code */
|
||||
ROM_LOAD( "glad.005", 0x0000, 0x4000, CRC(4bc60f0b) SHA1(19baf7533b8fc6bab372f1d35603068a6b93627c) )
|
||||
ROM_LOAD( "glad.004", 0x4000, 0x4000, CRC(db557f46) SHA1(dc3565096c95a20d2c64dd4f5d0b465fbd85e041) )
|
||||
ROM_LOAD( "glad.003", 0x8000, 0x2000, CRC(55ce82b4) SHA1(703f017a8501e4dd5166b5717b244aa6b1e7dc0a) )
|
||||
|
||||
ROM_REGION( 0x10000, "sub", 0 ) /* 64k for cpuB code */
|
||||
ROM_LOAD( "glad.002", 0x0000, 0x4000, CRC(8350261c) SHA1(046099128d5d941b3a37dce559ff5f0aa7f61683) )
|
||||
ROM_LOAD( "glad.001", 0x4000, 0x4000, CRC(5ee9d3fb) SHA1(6c8d8db7a966d3d3a2e8c46fd779e12e1f1e3716) )
|
||||
|
||||
ROM_REGION( 0x10000, "audio", 0 ) /* 64k for sound code */
|
||||
ROM_LOAD( "glad.007", 0x0000, 0x2000, CRC(c25b6731) SHA1(519c6844bfec958b9bb65f148b3527b41fe38b99) )
|
||||
ROM_LOAD( "glad.006", 0x2000, 0x2000, CRC(2024d716) SHA1(6ff069fc53524d13c386e8e714ba3056509adc4d) )
|
||||
|
||||
ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
|
||||
ROM_LOAD( "glad.011", 0x0000, 0x2000, CRC(305bb294) SHA1(e148571a581b12ff9502a65ec428e4d19bc757cb) ) /* foreground tiles */
|
||||
|
||||
ROM_REGION( 0x2000, "gfx2", ROMREGION_DISPOSE ) /* background tiles */
|
||||
ROM_LOAD( "glad.012", 0x0000, 0x2000, CRC(b7dd519f) SHA1(7bd760e54712648105d1049e678fa6b9effa600b) )
|
||||
|
||||
ROM_REGION( 0x6000, "gfx3", ROMREGION_DISPOSE ) /* 16x16 sprites */
|
||||
ROM_LOAD( "glad.008", 0x0000, 0x2000, CRC(bcf42587) SHA1(1546fe903fbc6dc0b410c83ab51887c33c91ec2d) )
|
||||
ROM_LOAD( "glad.009", 0x2000, 0x2000, CRC(912a20e0) SHA1(9621b955bc00b7c52ed8363bb441b568efb55863) )
|
||||
ROM_LOAD( "glad.010", 0x4000, 0x2000, CRC(8b1db3a5) SHA1(5ca403d40071ab13deb7fdb04cb0e055e6b30b05) )
|
||||
|
||||
ROM_REGION( 0xc00, "proms", 0 )
|
||||
ROM_LOAD( "82s137.001", 0x000, 0x400, CRC(d9184823) SHA1(455c6a437d54c29673dddb8248ca78d000c7f354) )
|
||||
ROM_LOAD( "82s137.002", 0x400, 0x400, CRC(1a6b0953) SHA1(552ac2897abe507f2fd9ca11c8128a0314af215c) )
|
||||
ROM_LOAD( "82s137.003", 0x800, 0x400, CRC(c0e70308) SHA1(d7dbc500bc9991c2d1b95850f3723a2a224fbfbb) )
|
||||
ROM_END
|
||||
|
||||
static INPUT_PORTS_START( sgladiat )
|
||||
PORT_START("SYSTEM")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(sound_busy_r, NULL) /* sound CPU status */
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("P1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("P2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("DSW1") /* Copied from TNK3! */
|
||||
PORT_DIPNAME( 0x01, 0x01, "Walk everywhere (Cheat)")
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( Cocktail ) )
|
||||
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
|
||||
PORT_DIPSETTING( 0x04, "3" )
|
||||
PORT_DIPSETTING( 0x00, "5" )
|
||||
PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coinage ) )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x18, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x38, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x30, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPSETTING( 0x28, DEF_STR( 1C_3C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
|
||||
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) )
|
||||
PORT_DIPSETTING( 0xc0, "20k 60k" )
|
||||
PORT_DIPSETTING( 0x80, "40k 90k" )
|
||||
PORT_DIPSETTING( 0x40, "50k 120k" )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
|
||||
|
||||
PORT_START("DSW2") /* Copied from TNK3! */
|
||||
PORT_DIPNAME( 0x01, 0x01, "Bonus Occurrence" )
|
||||
PORT_DIPSETTING( 0x01, "1st & every 2nd" )
|
||||
PORT_DIPSETTING( 0x00, "1st & 2nd only" )
|
||||
PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )
|
||||
PORT_DIPSETTING( 0x06, "Easy?" )
|
||||
PORT_DIPSETTING( 0x04, "Normal?" )
|
||||
PORT_DIPSETTING( 0x02, "Hard?" )
|
||||
PORT_DIPSETTING( 0x00, "Hardest?" )
|
||||
PORT_DIPNAME( 0x18, 0x10, "Game Mode" )
|
||||
PORT_DIPSETTING( 0x18, "Demo Sounds Off" )
|
||||
PORT_DIPSETTING( 0x10, "Demo Sounds On" )
|
||||
PORT_DIPSETTING( 0x00, "Freeze" )
|
||||
PORT_DIPSETTING( 0x08, "Infinite Lives (Cheat)")
|
||||
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( No ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
|
||||
GAME( 1984, sgladiat, 0, sgladiat, sgladiat, 0, ROT0, "SNK", "Gladiator 1984", GAME_NO_COCKTAIL )
|
File diff suppressed because it is too large
Load Diff
@ -19,6 +19,7 @@ extern WRITE8_HANDLER( snk_cpuB_nmi_ack_w );
|
||||
|
||||
extern PALETTE_INIT( tnk3 );
|
||||
|
||||
extern VIDEO_START( sgladiat );
|
||||
extern VIDEO_START( tnk3 );
|
||||
extern VIDEO_START( aso );
|
||||
extern VIDEO_START( ikari );
|
||||
@ -37,6 +38,8 @@ extern WRITE8_HANDLER( snk_sp16_scrolly_w );
|
||||
extern WRITE8_HANDLER( snk_sp32_scrollx_w );
|
||||
extern WRITE8_HANDLER( snk_sp32_scrolly_w );
|
||||
|
||||
extern WRITE8_HANDLER( sgladiat_scroll_msb_w );
|
||||
extern WRITE8_HANDLER( sgladiat_flipscreen_w );
|
||||
extern WRITE8_HANDLER( tnk3_videoattrs_w );
|
||||
extern WRITE8_HANDLER( aso_videoattrs_w );
|
||||
extern WRITE8_HANDLER( aso_bg_bank_w );
|
||||
|
@ -1272,7 +1272,6 @@ $(MAMEOBJ)/snk.a: \
|
||||
$(DRIVERS)/munchmo.o $(VIDEO)/munchmo.o \
|
||||
$(DRIVERS)/prehisle.o $(VIDEO)/prehisle.o \
|
||||
$(DRIVERS)/rockola.o $(AUDIO)/rockola.o $(VIDEO)/rockola.o \
|
||||
$(DRIVERS)/sgladiat.o $(VIDEO)/sgladiat.o \
|
||||
$(DRIVERS)/snk.o $(VIDEO)/snk.o \
|
||||
$(DRIVERS)/snk68.o $(VIDEO)/snk68.o \
|
||||
|
||||
|
@ -1,111 +0,0 @@
|
||||
#include "driver.h"
|
||||
#include "snk.h"
|
||||
|
||||
|
||||
VIDEO_START( sgladiat )
|
||||
{
|
||||
tmpbitmap = auto_bitmap_alloc(512, 256, video_screen_get_format(machine->primary_screen));
|
||||
}
|
||||
|
||||
static void sgladiat_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int scrollx, int scrolly )
|
||||
{
|
||||
const gfx_element *gfx = machine->gfx[1];
|
||||
|
||||
int tile_number, color, sx, sy;
|
||||
int offs, x, y;
|
||||
|
||||
for(x = 0; x < 64; x++) for(y = 0; y < 32; y++)
|
||||
{
|
||||
offs = (x<<5)+y;
|
||||
tile_number = videoram[offs];
|
||||
|
||||
color = 0;
|
||||
sx = x << 3;
|
||||
sy = y << 3;
|
||||
|
||||
drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
|
||||
}
|
||||
copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,1,&scrolly,cliprect);
|
||||
}
|
||||
|
||||
|
||||
static void tnk3_draw_text(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank, UINT8 *source )
|
||||
{
|
||||
const gfx_element *gfx = machine->gfx[0];
|
||||
|
||||
int tile_number, color, sx, sy;
|
||||
int x, y;
|
||||
|
||||
for(x=0; x<32; x++) for(y=0; y<32; y++)
|
||||
{
|
||||
tile_number = source[(x<<5)+y];
|
||||
|
||||
if(bank == -1) color = 8;
|
||||
else
|
||||
{
|
||||
color = tile_number >> 5;
|
||||
tile_number |= bank << 8;
|
||||
}
|
||||
sx = (x+2) << 3;
|
||||
sy = (y+1) << 3;
|
||||
|
||||
drawgfx(bitmap,gfx,tile_number,color,0,0,sx,sy,cliprect,TRANSPARENCY_PEN,15);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void tnk3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int xscroll, int yscroll )
|
||||
{
|
||||
const gfx_element *gfx = machine->gfx[2];
|
||||
|
||||
int tile_number, attributes, color, sx, sy;
|
||||
int yflip;
|
||||
int offs;
|
||||
|
||||
for(offs = 0; offs < 50*4; offs+=4)
|
||||
{
|
||||
if(*(UINT32*)(spriteram+offs) == 0 || *(UINT32*)(spriteram+offs) == -1) continue;
|
||||
|
||||
tile_number = spriteram[offs+1];
|
||||
attributes = spriteram[offs+3]; /* YBFX.CCCC */
|
||||
if(attributes & 0x40) tile_number |= 256;
|
||||
|
||||
color = attributes & 0xf;
|
||||
sx = xscroll - spriteram[offs+2];
|
||||
if(!(attributes & 0x80)) sx += 256;
|
||||
sy = -yscroll + spriteram[offs];
|
||||
if(attributes & 0x10) sy += 256;
|
||||
sx &= 0x1ff;
|
||||
sy &= 0x1ff;
|
||||
if (sx > 512-16) sx -= 512;
|
||||
if (sy > 512-16) sy -= 512;
|
||||
yflip = attributes & 0x20;
|
||||
|
||||
drawgfx(bitmap,gfx,tile_number,color,0,yflip,sx,sy,cliprect,TRANSPARENCY_PEN_TABLE,7);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
VIDEO_UPDATE( sgladiat )
|
||||
{
|
||||
UINT8 *ram = snk_rambase - 0xd000;
|
||||
int attributes, scrollx, scrolly;
|
||||
|
||||
attributes = ram[0xd300];
|
||||
|
||||
scrollx = -ram[0xd700] + ((attributes & 2) ? 256:0);
|
||||
scrolly = -ram[0xd600];
|
||||
scrollx += 15;
|
||||
scrolly += 8;
|
||||
sgladiat_draw_background(screen->machine, bitmap, cliprect, scrollx, scrolly );
|
||||
|
||||
scrollx = ram[0xd500] + ((attributes & 1) ? 256:0);
|
||||
scrolly = ram[0xd400];
|
||||
scrollx += 29;
|
||||
scrolly += 9;
|
||||
tnk3_draw_sprites(screen->machine, bitmap, cliprect, scrollx, scrolly );
|
||||
|
||||
tnk3_draw_text(screen->machine, bitmap, cliprect, 0, &ram[0xf000] );
|
||||
return 0;
|
||||
}
|
@ -29,6 +29,7 @@ static tilemap *fg_tilemap;
|
||||
static tilemap *bg_tilemap;
|
||||
static int bg_scrollx, bg_scrolly, sp16_scrollx, sp16_scrolly, sp32_scrollx, sp32_scrolly;
|
||||
static UINT8 sprite_split_point;
|
||||
static int yscroll_mask;
|
||||
|
||||
static UINT8 empty_tile[16*16];
|
||||
|
||||
@ -198,6 +199,23 @@ static VIDEO_START( snk_4bpp_shadow )
|
||||
machine->shadow_table[i] = i + 0x100;
|
||||
}
|
||||
|
||||
|
||||
VIDEO_START( sgladiat )
|
||||
{
|
||||
VIDEO_START_CALL(snk_3bpp_shadow);
|
||||
|
||||
fg_tilemap = tilemap_create(tnk3_get_fg_tile_info, tnk3_fg_scan_cols, 8, 8, 36, 28);
|
||||
bg_tilemap = tilemap_create(aso_get_bg_tile_info, tilemap_scan_cols, 8, 8, 64, 32);
|
||||
|
||||
tilemap_set_transparent_pen(fg_tilemap, 15);
|
||||
tilemap_set_scrolldy(fg_tilemap, 8, 8);
|
||||
|
||||
tilemap_set_scrolldx(bg_tilemap, 15, 24);
|
||||
tilemap_set_scrolldy(bg_tilemap, 8, -32);
|
||||
|
||||
yscroll_mask = 0x0ff;
|
||||
}
|
||||
|
||||
VIDEO_START( aso )
|
||||
{
|
||||
VIDEO_START_CALL(snk_3bpp_shadow);
|
||||
@ -210,6 +228,8 @@ VIDEO_START( aso )
|
||||
|
||||
tilemap_set_scrolldx(bg_tilemap, 15+256, 24+256);
|
||||
tilemap_set_scrolldy(bg_tilemap, 8, -32);
|
||||
|
||||
yscroll_mask = 0x1ff;
|
||||
}
|
||||
|
||||
VIDEO_START( tnk3 )
|
||||
@ -224,6 +244,8 @@ VIDEO_START( tnk3 )
|
||||
|
||||
tilemap_set_scrolldx(bg_tilemap, 15, 24);
|
||||
tilemap_set_scrolldy(bg_tilemap, 8, -32);
|
||||
|
||||
yscroll_mask = 0x1ff;
|
||||
}
|
||||
|
||||
VIDEO_START( ikari )
|
||||
@ -310,26 +332,16 @@ WRITE8_HANDLER( snk_sp32_scrolly_w )
|
||||
sp32_scrolly = (sp32_scrolly & ~0xff) | data;
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( tnk3_videoattrs_w )
|
||||
{
|
||||
/*
|
||||
video attributes:
|
||||
X------- flip screen
|
||||
-X------ character bank (for text layer)
|
||||
--X-----
|
||||
---X---- scrolly MSB (background)
|
||||
----X--- scrolly MSB (sprites)
|
||||
-----X--
|
||||
------X- scrollx MSB (background)
|
||||
-------X scrollx MSB (sprites)
|
||||
*/
|
||||
|
||||
WRITE8_HANDLER( sgladiat_flipscreen_w )
|
||||
{
|
||||
flip_screen_set(data & 0x80);
|
||||
|
||||
tilemap_set_pen_data_offset(fg_tilemap, ((data & 0x40) << 2) * machine->gfx[0]->char_modulo);
|
||||
// other bits unknown
|
||||
}
|
||||
|
||||
bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x10) << 4);
|
||||
sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5);
|
||||
WRITE8_HANDLER( sgladiat_scroll_msb_w )
|
||||
{
|
||||
bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7);
|
||||
sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8);
|
||||
}
|
||||
@ -356,6 +368,30 @@ WRITE8_HANDLER( aso_videoattrs_w )
|
||||
sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( tnk3_videoattrs_w )
|
||||
{
|
||||
/*
|
||||
video attributes:
|
||||
X------- flip screen
|
||||
-X------ character bank (for text layer)
|
||||
--X-----
|
||||
---X---- scrolly MSB (background)
|
||||
----X--- scrolly MSB (sprites)
|
||||
-----X--
|
||||
------X- scrollx MSB (background)
|
||||
-------X scrollx MSB (sprites)
|
||||
*/
|
||||
|
||||
flip_screen_set(data & 0x80);
|
||||
|
||||
tilemap_set_pen_data_offset(fg_tilemap, ((data & 0x40) << 2) * machine->gfx[0]->char_modulo);
|
||||
|
||||
bg_scrolly = (bg_scrolly & 0xff) | ((data & 0x10) << 4);
|
||||
sp16_scrolly = (sp16_scrolly & 0xff) | ((data & 0x08) << 5);
|
||||
bg_scrollx = (bg_scrollx & 0xff) | ((data & 0x02) << 7);
|
||||
sp16_scrollx = (sp16_scrollx & 0xff) | ((data & 0x01) << 8);
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( aso_bg_bank_w )
|
||||
{
|
||||
tilemap_set_palette_offset(bg_tilemap, ((data & 0xf) ^ 8) << 4);
|
||||
@ -484,7 +520,7 @@ static void tnk3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
|
||||
{
|
||||
tile_number |= (attributes & 0x20) << 4;
|
||||
}
|
||||
else // tnk3
|
||||
else // tnk3, sgladiat
|
||||
{
|
||||
yflip = attributes & 0x20;
|
||||
}
|
||||
@ -498,9 +534,9 @@ static void tnk3_draw_sprites(running_machine *machine, bitmap_t *bitmap, const
|
||||
}
|
||||
|
||||
sx &= 0x1ff;
|
||||
sy &= 0x1ff;
|
||||
sy &= yscroll_mask; // sgladiat apparently has only 256 pixels of vertical scrolling range
|
||||
if (sx > 512-size) sx -= 512;
|
||||
if (sy > 512-size) sy -= 512;
|
||||
if (sy > (yscroll_mask+1)-size) sy -= (yscroll_mask+1);
|
||||
|
||||
drawgfx(bitmap,gfx,
|
||||
tile_number,
|
||||
|
Loading…
Reference in New Issue
Block a user