Previous 199869 Revisions Next

r26922 Friday 3rd January, 2014 at 22:59:20 UTC by hap
Added video raw params. Also tried to hook up crtc but got screen offset glitches.
[src/mame/drivers]docastle.c
[src/mame/includes]docastle.h
[src/mame/video]docastle.c

trunk/src/mame/drivers/docastle.c
r26921r26922
3737c003      IN0
3838          bit 4-7 = joystick player 2
3939          bit 0-3 = joystick player 1
40c004      flipscreen (proper cocktail mode implemented by Chad Hendrickson Aug 1, 1999)
40c004      flipscreen
4141c005      IN1
4242          bit 7 = START 2
4343          bit 6 = unused
r26921r26922
8989e000-e008 data from first CPU
9090c003      bit 0-3 = joystick
9191          bit 4-7 = ?
92c004      flipscreen (proper cocktail mode implemented by Chad Hendrickson Aug 1, 1999)
92c004      flipscreen
9393c005      bit 0 = fire
9494          bit 1 = fire (again?!)
9595          bit 2 = ?
r26921r26922
240240
241241static ADDRESS_MAP_START( docastle_io_map, AS_IO, 8, docastle_state )
242242   ADDRESS_MAP_GLOBAL_MASK(0xff)
243   AM_RANGE(0x00, 0x00) AM_NOP // goes to CRT 46505S
244   AM_RANGE(0x02, 0x02) AM_NOP // goes to CRT 46505S
243   AM_RANGE(0x00, 0x00) AM_WRITENOP //AM_DEVWRITE("crtc", mc6845_device, address_w)
244   AM_RANGE(0x02, 0x02) AM_WRITENOP //AM_DEVWRITE("crtc", mc6845_device, register_w)
245245ADDRESS_MAP_END
246246
247247
r26921r26922
596596   MCFG_CPU_ADD("maincpu", Z80, XTAL_4MHz)
597597   MCFG_CPU_PROGRAM_MAP(docastle_map)
598598   MCFG_CPU_IO_MAP(docastle_io_map)
599   MCFG_CPU_VBLANK_INT_DRIVER("screen", docastle_state, irq0_line_hold)
599   MCFG_CPU_VBLANK_INT_DRIVER("screen", docastle_state, irq0_line_hold)
600600
601601   MCFG_CPU_ADD("slave", Z80, XTAL_4MHz)
602602   MCFG_CPU_PROGRAM_MAP(docastle_map2)
603   MCFG_CPU_PERIODIC_INT_DRIVER(docastle_state, irq0_line_hold, 8*60)
603   MCFG_CPU_PERIODIC_INT_DRIVER(docastle_state, irq0_line_hold, 8*60) // ?
604604
605605   MCFG_CPU_ADD("cpu3", Z80, XTAL_4MHz)
606606   MCFG_CPU_PROGRAM_MAP(docastle_map3)
607   MCFG_CPU_VBLANK_INT_DRIVER("screen", docastle_state, nmi_line_pulse)
607   MCFG_CPU_VBLANK_INT_DRIVER("screen", docastle_state, nmi_line_pulse)
608608
609609   /* video hardware */
610   //MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_9_828MHz / 16, mc6845_intf)
611   
610612   MCFG_SCREEN_ADD("screen", RASTER)
611   MCFG_SCREEN_REFRESH_RATE(59.60) // measured on pcb, real refresh rate should be derived from XTAL_9_828MHz, how?
612   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
613   MCFG_SCREEN_SIZE(32*8, 32*8)
614   MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
613   MCFG_SCREEN_RAW_PARAMS(XTAL_9_828MHz/2, 0x138, 0+8, 0x110-24, 0x108, 0+32, 0xe0) // from crtc
615614   MCFG_SCREEN_UPDATE_DRIVER(docastle_state, screen_update_docastle)
616615
617616   MCFG_GFXDECODE(docastle)
618617   MCFG_PALETTE_LENGTH(512)
619618
620
621
622619   /* sound hardware */
623620   MCFG_SPEAKER_STANDARD_MONO("mono")
624621
r26921r26922
642639static MACHINE_CONFIG_DERIVED( dorunrun, docastle )
643640
644641   /* basic machine hardware */
645
646642   MCFG_CPU_MODIFY("maincpu")
647643   MCFG_CPU_PROGRAM_MAP(dorunrun_map)
648644
r26921r26922
656652static MACHINE_CONFIG_DERIVED( idsoccer, docastle )
657653
658654   /* basic machine hardware */
659
660655   MCFG_CPU_MODIFY("maincpu")
661656   MCFG_CPU_PROGRAM_MAP(idsoccer_map)
662657
trunk/src/mame/includes/docastle.h
r26921r26922
1/***************************************************************************
2
3  Mr. Do's Castle hardware
4
5***************************************************************************/
6
17#include "sound/msm5205.h"
28
39class docastle_state : public driver_device
r26921r26922
511public:
612   docastle_state(const machine_config &mconfig, device_type type, const char *tag)
713      : driver_device(mconfig, type, tag),
14      m_maincpu(*this, "maincpu"),
15      m_slave(*this, "slave"),
16      m_msm(*this, "msm"),
817      m_videoram(*this, "videoram"),
918      m_colorram(*this, "colorram"),
10      m_spriteram(*this, "spriteram"),
11      m_maincpu(*this, "maincpu"),
12      m_slave(*this, "slave"),
13      m_msm(*this, "msm"){ }
19      m_spriteram(*this, "spriteram")
20   { }
1421
22   /* devices */
23   required_device<cpu_device> m_maincpu;
24   required_device<cpu_device> m_slave;
25   optional_device<msm5205_device> m_msm;
26
1527   /* memory pointers */
1628   required_shared_ptr<UINT8> m_videoram;
1729   required_shared_ptr<UINT8> m_colorram;
r26921r26922
2840   UINT8    m_buffer0[9];
2941   UINT8    m_buffer1[9];
3042
31   /* devices */
32   required_device<cpu_device> m_maincpu;
33   required_device<cpu_device> m_slave;
34   optional_device<msm5205_device> m_msm;
35
3643   DECLARE_READ8_MEMBER(docastle_shared0_r);
3744   DECLARE_READ8_MEMBER(docastle_shared1_r);
3845   DECLARE_WRITE8_MEMBER(docastle_shared0_w);
trunk/src/mame/video/docastle.c
r26921r26922
11/***************************************************************************
22
3  video.c
3  Mr. Do's Castle hardware
44
55  Functions to emulate the video hardware of the machine.
66
7  (Cocktail mode implemented by Chad Hendrickson Aug 1, 1999)
8
97***************************************************************************/
108
119#include "emu.h"
r26921r26922
111109
112110void docastle_state::video_start_common( UINT32 tile_transmask )
113111{
114   m_do_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(docastle_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
112   m_do_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(docastle_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
115113   m_do_tilemap->set_transmask(0, tile_transmask, 0x0000);
116114}
117115
r26921r26922
152150          p = palette
153151          t = tile number
154152
155          */
153         */
156154
157155         code = m_spriteram[offs + 3];
158156         color = m_spriteram[offs + 2] & 0x0f;
r26921r26922
178176          p = palette
179177          t = tile number
180178
181          */
179         */
182180
183181         code = m_spriteram[offs + 3];
184182         color = m_spriteram[offs + 2] & 0x1f;
r26921r26922
190188
191189      if (flip_screen())
192190      {
193         sx = 240 - sx;
194         sy = 240 - sy;
191         sx = 296 - sx;
192         sy = 248 - sy;
195193         flipx = !flipx;
196194         flipy = !flipy;
197195      }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team