Added video raw params. Also tried to hook up crtc but got screen offset glitches.

This commit is contained in:
Michaël Banaan Ananas 2014-01-03 22:59:20 +00:00
parent 5a4efd93da
commit 8282f3041d
3 changed files with 32 additions and 32 deletions

View File

@ -37,7 +37,7 @@ c002 DSWA
c003 IN0
bit 4-7 = joystick player 2
bit 0-3 = joystick player 1
c004 flipscreen (proper cocktail mode implemented by Chad Hendrickson Aug 1, 1999)
c004 flipscreen
c005 IN1
bit 7 = START 2
bit 6 = unused
@ -89,7 +89,7 @@ read:
e000-e008 data from first CPU
c003 bit 0-3 = joystick
bit 4-7 = ?
c004 flipscreen (proper cocktail mode implemented by Chad Hendrickson Aug 1, 1999)
c004 flipscreen
c005 bit 0 = fire
bit 1 = fire (again?!)
bit 2 = ?
@ -240,8 +240,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( docastle_io_map, AS_IO, 8, docastle_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_NOP // goes to CRT 46505S
AM_RANGE(0x02, 0x02) AM_NOP // goes to CRT 46505S
AM_RANGE(0x00, 0x00) AM_WRITENOP //AM_DEVWRITE("crtc", mc6845_device, address_w)
AM_RANGE(0x02, 0x02) AM_WRITENOP //AM_DEVWRITE("crtc", mc6845_device, register_w)
ADDRESS_MAP_END
@ -596,29 +596,26 @@ static MACHINE_CONFIG_START( docastle, docastle_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(docastle_map)
MCFG_CPU_IO_MAP(docastle_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", docastle_state, irq0_line_hold)
MCFG_CPU_VBLANK_INT_DRIVER("screen", docastle_state, irq0_line_hold)
MCFG_CPU_ADD("slave", Z80, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(docastle_map2)
MCFG_CPU_PERIODIC_INT_DRIVER(docastle_state, irq0_line_hold, 8*60)
MCFG_CPU_PERIODIC_INT_DRIVER(docastle_state, irq0_line_hold, 8*60) // ?
MCFG_CPU_ADD("cpu3", Z80, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(docastle_map3)
MCFG_CPU_VBLANK_INT_DRIVER("screen", docastle_state, nmi_line_pulse)
MCFG_CPU_VBLANK_INT_DRIVER("screen", docastle_state, nmi_line_pulse)
/* video hardware */
//MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_9_828MHz / 16, mc6845_intf)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(59.60) // measured on pcb, real refresh rate should be derived from XTAL_9_828MHz, how?
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
MCFG_SCREEN_RAW_PARAMS(XTAL_9_828MHz/2, 0x138, 0+8, 0x110-24, 0x108, 0+32, 0xe0) // from crtc
MCFG_SCREEN_UPDATE_DRIVER(docastle_state, screen_update_docastle)
MCFG_GFXDECODE(docastle)
MCFG_PALETTE_LENGTH(512)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@ -642,7 +639,6 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( dorunrun, docastle )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(dorunrun_map)
@ -656,7 +652,6 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( idsoccer, docastle )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(idsoccer_map)

View File

@ -1,3 +1,9 @@
/***************************************************************************
Mr. Do's Castle hardware
***************************************************************************/
#include "sound/msm5205.h"
class docastle_state : public driver_device
@ -5,12 +11,18 @@ class docastle_state : public driver_device
public:
docastle_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
m_spriteram(*this, "spriteram"),
m_maincpu(*this, "maincpu"),
m_slave(*this, "slave"),
m_msm(*this, "msm"){ }
m_msm(*this, "msm"),
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
m_spriteram(*this, "spriteram")
{ }
/* devices */
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_slave;
optional_device<msm5205_device> m_msm;
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@ -28,11 +40,6 @@ public:
UINT8 m_buffer0[9];
UINT8 m_buffer1[9];
/* devices */
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_slave;
optional_device<msm5205_device> m_msm;
DECLARE_READ8_MEMBER(docastle_shared0_r);
DECLARE_READ8_MEMBER(docastle_shared1_r);
DECLARE_WRITE8_MEMBER(docastle_shared0_w);

View File

@ -1,11 +1,9 @@
/***************************************************************************
video.c
Mr. Do's Castle hardware
Functions to emulate the video hardware of the machine.
(Cocktail mode implemented by Chad Hendrickson Aug 1, 1999)
***************************************************************************/
#include "emu.h"
@ -111,7 +109,7 @@ TILE_GET_INFO_MEMBER(docastle_state::get_tile_info)
void docastle_state::video_start_common( UINT32 tile_transmask )
{
m_do_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(docastle_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_do_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(docastle_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_do_tilemap->set_transmask(0, tile_transmask, 0x0000);
}
@ -152,7 +150,7 @@ void docastle_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap,
p = palette
t = tile number
*/
*/
code = m_spriteram[offs + 3];
color = m_spriteram[offs + 2] & 0x0f;
@ -178,7 +176,7 @@ void docastle_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap,
p = palette
t = tile number
*/
*/
code = m_spriteram[offs + 3];
color = m_spriteram[offs + 2] & 0x1f;
@ -190,8 +188,8 @@ void docastle_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap,
if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
sx = 296 - sx;
sy = 248 - sy;
flipx = !flipx;
flipy = !flipy;
}