mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
Merged othldrby.c with toaplan2.c driver [Angelo Salese]
This commit is contained in:
parent
b53148d8ea
commit
4409550581
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -4187,7 +4187,6 @@ src/mame/drivers/onetwo.c svneol=native#text/plain
|
||||
src/mame/drivers/opwolf.c svneol=native#text/plain
|
||||
src/mame/drivers/orbit.c svneol=native#text/plain
|
||||
src/mame/drivers/othello.c svneol=native#text/plain
|
||||
src/mame/drivers/othldrby.c svneol=native#text/plain
|
||||
src/mame/drivers/othunder.c svneol=native#text/plain
|
||||
src/mame/drivers/overdriv.c svneol=native#text/plain
|
||||
src/mame/drivers/pachifev.c svneol=native#text/plain
|
||||
@ -5098,7 +5097,6 @@ src/mame/includes/ojankohs.h svneol=native#text/plain
|
||||
src/mame/includes/oneshot.h svneol=native#text/plain
|
||||
src/mame/includes/opwolf.h svneol=native#text/plain
|
||||
src/mame/includes/orbit.h svneol=native#text/plain
|
||||
src/mame/includes/othldrby.h svneol=native#text/plain
|
||||
src/mame/includes/othunder.h svneol=native#text/plain
|
||||
src/mame/includes/overdriv.h svneol=native#text/plain
|
||||
src/mame/includes/pacland.h svneol=native#text/plain
|
||||
@ -6425,7 +6423,6 @@ src/mame/video/ojankohs.c svneol=native#text/plain
|
||||
src/mame/video/oneshot.c svneol=native#text/plain
|
||||
src/mame/video/opwolf.c svneol=native#text/plain
|
||||
src/mame/video/orbit.c svneol=native#text/plain
|
||||
src/mame/video/othldrby.c svneol=native#text/plain
|
||||
src/mame/video/othunder.c svneol=native#text/plain
|
||||
src/mame/video/overdriv.c svneol=native#text/plain
|
||||
src/mame/video/pacland.c svneol=native#text/plain
|
||||
|
@ -1,285 +0,0 @@
|
||||
/***************************************************************************
|
||||
|
||||
Othello Derby
|
||||
|
||||
driver by Nicola Salmoria
|
||||
|
||||
Video IC is S951060-VGP
|
||||
|
||||
TODO:
|
||||
- a PCB pic is needed in order to identify the RTC used by this.
|
||||
|
||||
Notes:
|
||||
- Sprite/tile priorities are NOT orthogonal to sprite/sprite priorities:
|
||||
sprites with a higher priority appear over sprites with a lower priority,
|
||||
regardless of their order in the sprite list. Therefore, the current
|
||||
implementation is correct.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "includes/othldrby.h"
|
||||
|
||||
|
||||
/* Guess: reads when doing r/w to video device */
|
||||
READ16_MEMBER(othldrby_state::othldrby_scanline_r)
|
||||
{
|
||||
return m_screen->vpos();
|
||||
}
|
||||
|
||||
|
||||
WRITE16_MEMBER(othldrby_state::oki_bankswitch_w)
|
||||
{
|
||||
if (ACCESSING_BITS_0_7)
|
||||
m_oki->set_bank_base((data & 1) * 0x40000);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(othldrby_state::coinctrl_w)
|
||||
{
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
coin_counter_w(machine(), 0, data & 1);
|
||||
coin_counter_w(machine(), 1, data & 2);
|
||||
coin_lockout_w(machine(), 0, ~data & 4);
|
||||
coin_lockout_w(machine(), 1, ~data & 8);
|
||||
}
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(othldrby_state::calendar_w)
|
||||
{
|
||||
}
|
||||
|
||||
READ16_MEMBER(othldrby_state::calendar_r)
|
||||
{
|
||||
system_time systime;
|
||||
|
||||
machine().base_datetime(systime);
|
||||
|
||||
switch (offset)
|
||||
{
|
||||
case 0:
|
||||
return ((systime.local_time.second/10)<<4) + (systime.local_time.second%10);
|
||||
case 1:
|
||||
return ((systime.local_time.minute/10)<<4) + (systime.local_time.minute%10);
|
||||
case 2:
|
||||
return ((systime.local_time.hour/10)<<4) + (systime.local_time.hour%10);
|
||||
case 3:
|
||||
return systime.local_time.weekday;
|
||||
case 4:
|
||||
return ((systime.local_time.mday/10)<<4) + (systime.local_time.mday%10);
|
||||
case 5:
|
||||
return (systime.local_time.month + 1);
|
||||
case 6:
|
||||
return (((systime.local_time.year%100)/10)<<4) + (systime.local_time.year%10);
|
||||
case 7:
|
||||
default:
|
||||
return 0; /* status? the other registers are read only when bit 0 is clear */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( othldrby_map, AS_PROGRAM, 16, othldrby_state )
|
||||
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x10ffff) AM_RAM
|
||||
AM_RANGE(0x200000, 0x20000f) AM_READWRITE(calendar_r, calendar_w)
|
||||
AM_RANGE(0x300000, 0x300001) AM_WRITE(othldrby_videoram_addr_w)
|
||||
AM_RANGE(0x300004, 0x300007) AM_READWRITE(othldrby_videoram_r, othldrby_videoram_w)
|
||||
AM_RANGE(0x300008, 0x300009) AM_WRITE(othldrby_vreg_addr_w)
|
||||
AM_RANGE(0x30000c, 0x30000d) AM_READ_PORT("VBLANK")
|
||||
AM_RANGE(0x30000c, 0x30000f) AM_WRITE(othldrby_vreg_w)
|
||||
AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
|
||||
AM_RANGE(0x600000, 0x600001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x700000, 0x700001) AM_READ(othldrby_scanline_r)
|
||||
AM_RANGE(0x700004, 0x700005) AM_READ_PORT("DSW1")
|
||||
AM_RANGE(0x700008, 0x700009) AM_READ_PORT("DSW2")
|
||||
AM_RANGE(0x70000c, 0x70000d) AM_READ_PORT("P1")
|
||||
AM_RANGE(0x700010, 0x700011) AM_READ_PORT("P2")
|
||||
AM_RANGE(0x70001c, 0x70001d) AM_READ_PORT("SYSTEM")
|
||||
AM_RANGE(0x700030, 0x700031) AM_WRITE(oki_bankswitch_w)
|
||||
AM_RANGE(0x700034, 0x700035) AM_WRITE(coinctrl_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
static INPUT_PORTS_START( othldrby )
|
||||
PORT_START("VBLANK")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
|
||||
|
||||
PORT_START("DSW1")
|
||||
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
|
||||
PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
|
||||
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Allow_Continue ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( No ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
|
||||
PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
|
||||
PORT_DIPSETTING( 0x30, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
|
||||
PORT_DIPSETTING( 0xc0, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
|
||||
|
||||
PORT_START("DSW2")
|
||||
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( Easy ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( Hard ) )
|
||||
PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) )
|
||||
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
|
||||
|
||||
PORT_START("P1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("P2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
|
||||
|
||||
PORT_START("SYSTEM")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE2 ) /* TEST */
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
|
||||
static const gfx_layout spritelayout =
|
||||
{
|
||||
8,8,
|
||||
RGN_FRAC(1,2),
|
||||
4,
|
||||
{ RGN_FRAC(1,2)+8, RGN_FRAC(1,2)+0, RGN_FRAC(0,2)+8, RGN_FRAC(0,2)+0 },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7 },
|
||||
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
|
||||
16*8
|
||||
};
|
||||
|
||||
static const gfx_layout tilelayout =
|
||||
{
|
||||
16,16,
|
||||
RGN_FRAC(1,2),
|
||||
4,
|
||||
{ RGN_FRAC(1,2)+8, RGN_FRAC(1,2)+0, RGN_FRAC(0,2)+8, RGN_FRAC(0,2)+0 },
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7,
|
||||
16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 },
|
||||
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
|
||||
16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16 },
|
||||
16*32
|
||||
};
|
||||
|
||||
static GFXDECODE_START( othldrby )
|
||||
GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 0x80 )
|
||||
GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 0x80 )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
|
||||
void othldrby_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_toggle));
|
||||
save_item(NAME(m_vram_addr));
|
||||
save_item(NAME(m_vreg_addr));
|
||||
save_item(NAME(m_vreg));
|
||||
}
|
||||
|
||||
void othldrby_state::machine_reset()
|
||||
{
|
||||
m_toggle = 0xff;
|
||||
m_vram_addr = 0;
|
||||
m_vreg_addr = 0;
|
||||
|
||||
memset(m_vreg, 0, sizeof(m_vreg));
|
||||
}
|
||||
|
||||
static MACHINE_CONFIG_START( othldrby, othldrby_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", M68000, 16000000)
|
||||
MCFG_CPU_PROGRAM_MAP(othldrby_map)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", othldrby_state, irq4_line_hold)
|
||||
|
||||
|
||||
/* video hardware */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
|
||||
MCFG_SCREEN_SIZE(64*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 1*8, 31*8-1 )
|
||||
MCFG_SCREEN_UPDATE_DRIVER(othldrby_state, screen_update_othldrby)
|
||||
MCFG_SCREEN_VBLANK_DRIVER(othldrby_state, screen_eof_othldrby)
|
||||
|
||||
MCFG_GFXDECODE(othldrby)
|
||||
MCFG_PALETTE_LENGTH(0x800)
|
||||
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_OKIM6295_ADD("oki", 1584000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Game driver(s)
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
ROM_START( othldrby )
|
||||
ROM_REGION( 0x080000, "maincpu", 0 )
|
||||
ROM_LOAD16_WORD_SWAP( "db0.1", 0x00000, 0x80000, CRC(6b4008d3) SHA1(4cf838c47563ba482be8364b2e115569a4a06c83) )
|
||||
|
||||
ROM_REGION( 0x400000, "gfx1", 0 )
|
||||
ROM_LOAD( "db0-r2", 0x000000, 0x200000, CRC(4efff265) SHA1(4cd239ff42f532495946cb52bd1fee412f84e192) )
|
||||
ROM_LOAD( "db0-r3", 0x200000, 0x200000, CRC(5c142b38) SHA1(5466a8b061a0f2545493de0f96fd4387beea276a) )
|
||||
|
||||
ROM_REGION( 0x080000, "oki", 0 ) /* OKIM6295 samples */
|
||||
ROM_LOAD( "db0.4", 0x00000, 0x80000, CRC(a9701868) SHA1(9ee89556666d358e8d3915622573b3ba660048b8) )
|
||||
ROM_END
|
||||
|
||||
GAME( 1995, othldrby, 0, othldrby, othldrby, driver_device, 0, ROT0, "Sunwise", "Othello Derby (Japan)", GAME_SUPPORTS_SAVE )
|
@ -4,6 +4,7 @@
|
||||
Raizing/8ing game hardware from 1993 onwards
|
||||
-------------------------------------------------
|
||||
Driver by: Quench and Yochizo
|
||||
Original othldrby.c by Nicola Salmoria
|
||||
|
||||
Raizing games and Truxton 2 are heavily dependent on the Raine source -
|
||||
many thanks to Richard Bush and the Raine team. [Yochizo]
|
||||
@ -35,7 +36,6 @@ Supported games:
|
||||
batsugun TP-030 Toaplan Batsugun
|
||||
batsuguna TP-030 Toaplan Batsugun (older)
|
||||
batsugunsp TP-030 Toaplan Batsugun (Special Version)
|
||||
pwrkick ?????? Sunwise Power Kick
|
||||
snowbro2 ?????? Hanafram Snow Bros. 2 - With New Elves
|
||||
|
||||
* This version of Whoopee!! is on a board labeled TP-020
|
||||
@ -343,7 +343,7 @@ To Do / Unknowns:
|
||||
- Need to sort out the video status register.
|
||||
- Find out how exactly how sound CPU communication really works in bgaregga/batrider/bbakraid
|
||||
current emulation seems to work (plays all sounds), but there are still some unknown reads/writes
|
||||
|
||||
- Write a RTC core for uPD4992, needed by Othello Derby and Power Kick
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
@ -1205,14 +1205,48 @@ static ADDRESS_MAP_START( batsugun_68k_mem, AS_PROGRAM, 16, toaplan2_state )
|
||||
AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/* TODO: write in a proper core */
|
||||
WRITE8_MEMBER(toaplan2_state::upd4992_calendar_w)
|
||||
{
|
||||
}
|
||||
|
||||
READ8_MEMBER(toaplan2_state::upd4992_calendar_r)
|
||||
{
|
||||
system_time systime;
|
||||
|
||||
machine().base_datetime(systime);
|
||||
|
||||
switch (offset)
|
||||
{
|
||||
case 0:
|
||||
return ((systime.local_time.second/10)<<4) + (systime.local_time.second%10);
|
||||
case 1:
|
||||
return ((systime.local_time.minute/10)<<4) + (systime.local_time.minute%10);
|
||||
case 2:
|
||||
return ((systime.local_time.hour/10)<<4) + (systime.local_time.hour%10);
|
||||
case 3:
|
||||
return systime.local_time.weekday;
|
||||
case 4:
|
||||
return ((systime.local_time.mday/10)<<4) + (systime.local_time.mday%10);
|
||||
case 5:
|
||||
return (systime.local_time.month + 1);
|
||||
case 6:
|
||||
return (((systime.local_time.year%100)/10)<<4) + (systime.local_time.year%10);
|
||||
case 7:
|
||||
default:
|
||||
return 0; /* status? the other registers are read only when bit 0 is clear */
|
||||
}
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( pwrkick_68k_mem, AS_PROGRAM, 16, toaplan2_state )
|
||||
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x10ffff) AM_RAM
|
||||
AM_RANGE(0x200000, 0x20000f) AM_RAM // uPD4992 RTC
|
||||
AM_RANGE(0x200000, 0x20000f) AM_READWRITE8(upd4992_calendar_r,upd4992_calendar_w,0x00ff)
|
||||
AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE("gp9001vdp0", gp9001vdp_device, gp9001_vdp_r, gp9001_vdp_w)
|
||||
AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
|
||||
AM_RANGE(0x600000, 0x600001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
|
||||
AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r) // check me
|
||||
|
||||
AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r)
|
||||
AM_RANGE(0x700004, 0x700005) AM_READ_PORT("DSWA")
|
||||
AM_RANGE(0x700008, 0x700009) AM_READ_PORT("DSWB")
|
||||
AM_RANGE(0x70000c, 0x70000d) AM_READ_PORT("IN1")
|
||||
@ -1224,6 +1258,25 @@ static ADDRESS_MAP_START( pwrkick_68k_mem, AS_PROGRAM, 16, toaplan2_state )
|
||||
AM_RANGE(0x700038, 0x700039) AM_WRITENOP // lamps?
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( othldrby_68k_mem, AS_PROGRAM, 16, toaplan2_state )
|
||||
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x10ffff) AM_RAM
|
||||
AM_RANGE(0x200000, 0x20000f) AM_READWRITE8(upd4992_calendar_r,upd4992_calendar_w,0x00ff)
|
||||
AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE("gp9001vdp0", gp9001vdp_device, gp9001_vdp_r, gp9001_vdp_w)
|
||||
AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
|
||||
AM_RANGE(0x600000, 0x600001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
|
||||
|
||||
AM_RANGE(0x700000, 0x700001) AM_READ(video_count_r)
|
||||
AM_RANGE(0x700004, 0x700005) AM_READ_PORT("DSWA")
|
||||
AM_RANGE(0x700008, 0x700009) AM_READ_PORT("DSWB")
|
||||
AM_RANGE(0x70000c, 0x70000d) AM_READ_PORT("IN1")
|
||||
AM_RANGE(0x700010, 0x700011) AM_READ_PORT("IN2")
|
||||
AM_RANGE(0x70001c, 0x70001d) AM_READ_PORT("SYS")
|
||||
AM_RANGE(0x700030, 0x700031) AM_WRITE(oki_bankswitch_w)
|
||||
AM_RANGE(0x700034, 0x700035) AM_WRITE(toaplan2_coin_word_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( snowbro2_68k_mem, AS_PROGRAM, 16, toaplan2_state )
|
||||
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
||||
@ -2444,6 +2497,61 @@ static INPUT_PORTS_START( pwrkick )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( othldrby )
|
||||
PORT_INCLUDE( toaplan2_3b )
|
||||
|
||||
PORT_MODIFY("SYS")
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(1)
|
||||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(1)
|
||||
|
||||
PORT_MODIFY("DSWA")
|
||||
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
|
||||
PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
|
||||
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Allow_Continue ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( No ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
|
||||
PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
|
||||
PORT_DIPSETTING( 0x30, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
|
||||
PORT_DIPSETTING( 0xc0, DEF_STR( 3C_1C ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) )
|
||||
|
||||
PORT_MODIFY("DSWB")
|
||||
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( Easy ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( Hard ) )
|
||||
PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) )
|
||||
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( snowbro2 )
|
||||
PORT_INCLUDE( toaplan2_2b )
|
||||
|
||||
@ -3619,10 +3727,11 @@ static MACHINE_CONFIG_START( batsugun, toaplan2_state )
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/* TODO: clocks */
|
||||
static MACHINE_CONFIG_START( pwrkick, toaplan2_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz) /* 16MHz , 16MHz Oscillator */
|
||||
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)
|
||||
MCFG_CPU_PROGRAM_MAP(pwrkick_68k_mem)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", toaplan2_state, toaplan2_vblank_irq4)
|
||||
|
||||
@ -3647,11 +3756,40 @@ static MACHINE_CONFIG_START( pwrkick, toaplan2_state )
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_YM2151_ADD("ymsnd", XTAL_27MHz/8)
|
||||
/* empty YM2151 socket*/
|
||||
MCFG_OKIM6295_ADD("oki", XTAL_27MHz/8, OKIM6295_PIN7_HIGH)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MCFG_OKIM6295_ADD("oki", XTAL_16MHz/4, OKIM6295_PIN7_LOW)
|
||||
static MACHINE_CONFIG_START( othldrby, toaplan2_state )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)
|
||||
MCFG_CPU_PROGRAM_MAP(othldrby_68k_mem)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", toaplan2_state, toaplan2_vblank_irq4)
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(toaplan2_state,toaplan2)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
|
||||
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
MCFG_SCREEN_REFRESH_RATE(60)
|
||||
MCFG_SCREEN_SIZE(432, 262)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(toaplan2_state, screen_update_toaplan2)
|
||||
MCFG_SCREEN_VBLANK_DRIVER(toaplan2_state, screen_eof_toaplan2)
|
||||
|
||||
MCFG_GFXDECODE(toaplan2)
|
||||
MCFG_PALETTE_LENGTH(T2PALETTE_LENGTH)
|
||||
|
||||
MCFG_DEVICE_ADD_VDP0
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(toaplan2_state,toaplan2)
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_OKIM6295_ADD("oki", XTAL_27MHz/8, OKIM6295_PIN7_HIGH)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
@ -4484,6 +4622,17 @@ ROM_START( pwrkick )
|
||||
ROM_LOAD( "4.u33", 0x000000, 0x080000, CRC(3ab742f1) SHA1(ce8ca02ca57fd77872e421ce601afd017d3518a0) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( othldrby )
|
||||
ROM_REGION( 0x080000, "maincpu", 0 )
|
||||
ROM_LOAD16_WORD_SWAP( "db0.1", 0x00000, 0x80000, CRC(6b4008d3) SHA1(4cf838c47563ba482be8364b2e115569a4a06c83) )
|
||||
|
||||
ROM_REGION( 0x400000, "gfx1", 0 )
|
||||
ROM_LOAD( "db0-r2", 0x000000, 0x200000, CRC(4efff265) SHA1(4cd239ff42f532495946cb52bd1fee412f84e192) )
|
||||
ROM_LOAD( "db0-r3", 0x200000, 0x200000, CRC(5c142b38) SHA1(5466a8b061a0f2545493de0f96fd4387beea276a) )
|
||||
|
||||
ROM_REGION( 0x080000, "oki", 0 ) /* OKIM6295 samples */
|
||||
ROM_LOAD( "db0.4", 0x00000, 0x80000, CRC(a9701868) SHA1(9ee89556666d358e8d3915622573b3ba660048b8) )
|
||||
ROM_END
|
||||
|
||||
ROM_START( snowbro2 )
|
||||
ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */
|
||||
@ -5193,6 +5342,7 @@ GAME( 1993, batsuguna, batsugun, batsugun, batsugun, toaplan2_state, dogyuun,
|
||||
GAME( 1993, batsugunsp, batsugun, batsugun, batsugun, toaplan2_state, dogyuun, ROT270, "Toaplan", "Batsugun - Special Version", GAME_SUPPORTS_SAVE )
|
||||
|
||||
GAME( 1994, pwrkick, 0, pwrkick, pwrkick, driver_device, 0, ROT0, "Sunwise", "Power Kick (Japan)", 0 )
|
||||
GAME( 1995, othldrby, 0, othldrby, othldrby,driver_device, 0, ROT0, "Sunwise", "Othello Derby (Japan)", 0 )
|
||||
|
||||
GAME( 1994, snowbro2, 0, snowbro2, snowbro2, driver_device, 0, ROT0, "Hanafram", "Snow Bros. 2 - With New Elves / Otenki Paradise", GAME_SUPPORTS_SAVE )
|
||||
|
||||
|
@ -1,53 +0,0 @@
|
||||
/*************************************************************************
|
||||
|
||||
Othello Derby
|
||||
|
||||
*************************************************************************/
|
||||
#include "sound/okim6295.h"
|
||||
|
||||
#define OTHLDRBY_VREG_SIZE 18
|
||||
|
||||
class othldrby_state : public driver_device
|
||||
{
|
||||
public:
|
||||
othldrby_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag) ,
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_oki(*this, "oki") { }
|
||||
|
||||
/* memory pointers */
|
||||
UINT16 * m_vram;
|
||||
UINT16 * m_buf_spriteram;
|
||||
UINT16 * m_buf_spriteram2;
|
||||
|
||||
/* video-related */
|
||||
tilemap_t *m_bg_tilemap[3];
|
||||
UINT16 m_vreg[OTHLDRBY_VREG_SIZE];
|
||||
UINT32 m_vram_addr;
|
||||
UINT32 m_vreg_addr;
|
||||
|
||||
/* misc */
|
||||
int m_toggle;
|
||||
DECLARE_READ16_MEMBER(othldrby_scanline_r);
|
||||
DECLARE_WRITE16_MEMBER(coinctrl_w);
|
||||
DECLARE_WRITE16_MEMBER(calendar_w);
|
||||
DECLARE_READ16_MEMBER(calendar_r);
|
||||
DECLARE_WRITE16_MEMBER(othldrby_videoram_addr_w);
|
||||
DECLARE_READ16_MEMBER(othldrby_videoram_r);
|
||||
DECLARE_WRITE16_MEMBER(othldrby_videoram_w);
|
||||
DECLARE_WRITE16_MEMBER(othldrby_vreg_addr_w);
|
||||
DECLARE_WRITE16_MEMBER(othldrby_vreg_w);
|
||||
DECLARE_WRITE16_MEMBER(oki_bankswitch_w);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info0);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info1);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info2);
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
virtual void video_start();
|
||||
UINT32 screen_update_othldrby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void screen_eof_othldrby(screen_device &screen, bool state);
|
||||
inline void get_tile_info( tile_data &tileinfo, int tile_index, int plane );
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority );
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<okim6295_device> m_oki;
|
||||
};
|
@ -159,6 +159,8 @@ public:
|
||||
UINT8 m_pwrkick_hopper;
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(pwrkick_hopper_status_r);
|
||||
DECLARE_WRITE8_MEMBER(pwrkick_coin_w);
|
||||
DECLARE_READ8_MEMBER(upd4992_calendar_r);
|
||||
DECLARE_WRITE8_MEMBER(upd4992_calendar_w);
|
||||
|
||||
protected:
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
@ -2174,7 +2174,6 @@ $(MAMEOBJ)/misc.a: \
|
||||
$(DRIVERS)/oneshot.o $(VIDEO)/oneshot.o \
|
||||
$(DRIVERS)/onetwo.o \
|
||||
$(DRIVERS)/othello.o \
|
||||
$(DRIVERS)/othldrby.o $(VIDEO)/othldrby.o \
|
||||
$(DRIVERS)/pachifev.o \
|
||||
$(DRIVERS)/pasha2.o \
|
||||
$(DRIVERS)/pass.o $(VIDEO)/pass.o \
|
||||
|
@ -1,223 +0,0 @@
|
||||
#include "emu.h"
|
||||
#include "includes/othldrby.h"
|
||||
|
||||
|
||||
#define VIDEORAM_SIZE 0x1c00
|
||||
#define SPRITERAM_START 0x1800
|
||||
#define SPRITERAM_SIZE (VIDEORAM_SIZE - SPRITERAM_START)
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Callbacks for the TileMap code
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
inline void othldrby_state::get_tile_info( tile_data &tileinfo, int tile_index, int plane )
|
||||
{
|
||||
UINT16 attr;
|
||||
|
||||
tile_index = 2 * tile_index + 0x800 * plane;
|
||||
attr = m_vram[tile_index];
|
||||
SET_TILE_INFO_MEMBER(
|
||||
1,
|
||||
m_vram[tile_index + 1],
|
||||
attr & 0x7f,
|
||||
0);
|
||||
tileinfo.category = (attr & 0x0600) >> 9;
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(othldrby_state::get_tile_info0)
|
||||
{
|
||||
get_tile_info(tileinfo, tile_index, 0);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(othldrby_state::get_tile_info1)
|
||||
{
|
||||
get_tile_info(tileinfo, tile_index, 1);
|
||||
}
|
||||
|
||||
TILE_GET_INFO_MEMBER(othldrby_state::get_tile_info2)
|
||||
{
|
||||
get_tile_info(tileinfo, tile_index, 2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Start the video hardware emulation.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
void othldrby_state::video_start()
|
||||
{
|
||||
m_bg_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(othldrby_state::get_tile_info0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_bg_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(othldrby_state::get_tile_info1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
m_bg_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(othldrby_state::get_tile_info2),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
|
||||
|
||||
m_vram = auto_alloc_array(machine(), UINT16, VIDEORAM_SIZE);
|
||||
m_buf_spriteram = auto_alloc_array(machine(), UINT16, 2 * SPRITERAM_SIZE);
|
||||
m_buf_spriteram2 = m_buf_spriteram + SPRITERAM_SIZE;
|
||||
|
||||
m_bg_tilemap[0]->set_transparent_pen(0);
|
||||
m_bg_tilemap[1]->set_transparent_pen(0);
|
||||
m_bg_tilemap[2]->set_transparent_pen(0);
|
||||
|
||||
save_pointer(NAME(m_vram), VIDEORAM_SIZE);
|
||||
save_pointer(NAME(m_buf_spriteram), 2 * SPRITERAM_SIZE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Memory handlers
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
WRITE16_MEMBER(othldrby_state::othldrby_videoram_addr_w)
|
||||
{
|
||||
m_vram_addr = data;
|
||||
}
|
||||
|
||||
READ16_MEMBER(othldrby_state::othldrby_videoram_r)
|
||||
{
|
||||
if (m_vram_addr < VIDEORAM_SIZE)
|
||||
return m_vram[m_vram_addr++];
|
||||
else
|
||||
{
|
||||
popmessage("GFXRAM OUT OF BOUNDS %04x", m_vram_addr);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(othldrby_state::othldrby_videoram_w)
|
||||
{
|
||||
if (m_vram_addr < VIDEORAM_SIZE)
|
||||
{
|
||||
if (m_vram_addr < SPRITERAM_START)
|
||||
m_bg_tilemap[m_vram_addr / 0x800]->mark_tile_dirty((m_vram_addr & 0x7ff) / 2);
|
||||
m_vram[m_vram_addr++] = data;
|
||||
}
|
||||
else
|
||||
popmessage("GFXRAM OUT OF BOUNDS %04x", m_vram_addr);
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(othldrby_state::othldrby_vreg_addr_w)
|
||||
{
|
||||
m_vreg_addr = data & 0x7f; /* bit 7 is set when screen is flipped */
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(othldrby_state::othldrby_vreg_w)
|
||||
{
|
||||
if (m_vreg_addr < OTHLDRBY_VREG_SIZE)
|
||||
m_vreg[m_vreg_addr++] = data;
|
||||
else
|
||||
popmessage("%06x: VREG OUT OF BOUNDS %04x", space.device().safe_pc(), m_vreg_addr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
Display refresh
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
void othldrby_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority )
|
||||
{
|
||||
int offs;
|
||||
|
||||
for (offs = 0; offs < SPRITERAM_SIZE; offs += 4)
|
||||
{
|
||||
int x, y, color, code, sx, sy, flipx, flipy, sizex, sizey, pri;
|
||||
|
||||
pri = (m_buf_spriteram[offs] & 0x0600) >> 9;
|
||||
if (pri != priority)
|
||||
continue;
|
||||
|
||||
flipx = m_buf_spriteram[offs] & 0x1000;
|
||||
flipy = 0;
|
||||
color = (m_buf_spriteram[offs] & 0x01fc) >> 2;
|
||||
code = m_buf_spriteram[offs + 1] | ((m_buf_spriteram[offs] & 0x0003) << 16);
|
||||
sx = (m_buf_spriteram[offs + 2] >> 7);
|
||||
sy = (m_buf_spriteram[offs + 3] >> 7);
|
||||
sizex = (m_buf_spriteram[offs + 2] & 0x000f) + 1;
|
||||
sizey = (m_buf_spriteram[offs + 3] & 0x000f) + 1;
|
||||
|
||||
if (flip_screen())
|
||||
{
|
||||
flipx = !flipx;
|
||||
flipy = !flipy;
|
||||
sx = 246 - sx;
|
||||
sy = 16 - sy;
|
||||
}
|
||||
|
||||
for (y = 0; y < sizey; y++)
|
||||
{
|
||||
for (x = 0; x < sizex; x++)
|
||||
{
|
||||
drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
|
||||
code + x + sizex * y,
|
||||
color,
|
||||
flipx,flipy,
|
||||
(sx + (flipx ? (-8*(x+1)+1) : 8*x) - m_vreg[6]+44) & 0x1ff,(sy + (flipy ? (-8*(y+1)+1) : 8*y) - m_vreg[7]-9) & 0x1ff,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UINT32 othldrby_state::screen_update_othldrby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int layer;
|
||||
|
||||
flip_screen_set(m_vreg[0x0f] & 0x80);
|
||||
|
||||
for (layer = 0; layer < 3; layer++)
|
||||
{
|
||||
if (flip_screen())
|
||||
{
|
||||
m_bg_tilemap[layer]->set_scrollx(0, m_vreg[2 * layer] + 59);
|
||||
m_bg_tilemap[layer]->set_scrolly(0, m_vreg[2 * layer + 1] + 248);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bg_tilemap[layer]->set_scrollx(0, m_vreg[2 * layer] - 58);
|
||||
m_bg_tilemap[layer]->set_scrolly(0, m_vreg[2 * layer+1] + 9);
|
||||
}
|
||||
}
|
||||
|
||||
screen.priority().fill(0, cliprect);
|
||||
|
||||
bitmap.fill(0, cliprect);
|
||||
|
||||
for (layer = 0; layer < 3; layer++)
|
||||
m_bg_tilemap[layer]->draw(screen, bitmap, cliprect, 0, 0);
|
||||
draw_sprites(bitmap, cliprect, 0);
|
||||
|
||||
for (layer = 0; layer < 3; layer++)
|
||||
m_bg_tilemap[layer]->draw(screen, bitmap, cliprect, 1, 0);
|
||||
draw_sprites(bitmap, cliprect, 1);
|
||||
|
||||
for (layer = 0; layer < 3; layer++)
|
||||
m_bg_tilemap[layer]->draw(screen, bitmap, cliprect, 2, 0);
|
||||
draw_sprites(bitmap, cliprect, 2);
|
||||
|
||||
for (layer = 0; layer < 3; layer++)
|
||||
m_bg_tilemap[layer]->draw(screen, bitmap, cliprect, 3, 0);
|
||||
draw_sprites(bitmap, cliprect, 3);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void othldrby_state::screen_eof_othldrby(screen_device &screen, bool state)
|
||||
{
|
||||
// rising edge
|
||||
if (state)
|
||||
{
|
||||
/* sprites need to be delayed two frames */
|
||||
memcpy(m_buf_spriteram, m_buf_spriteram2, SPRITERAM_SIZE * sizeof(m_buf_spriteram[0]));
|
||||
memcpy(m_buf_spriteram2, &m_vram[SPRITERAM_START], SPRITERAM_SIZE * sizeof(m_buf_spriteram[0]));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user