Previous 15994 Revisions Next

r15436 Sunday 10th June, 2012 at 08:37:23 UTC by Miodrag Milanović
Sync with MAME r16588 (nw)
[src/emu/machine]am9517a.c
[src/emu/video]pc_cga.c
[src/mame]mame.lst
[src/mame/drivers]bzone.c dec0.c deshoros.c galaxold.c lucky74.c model2.c model3.c naomi.c nemesis.c pcxt.c segas32.c superchs.c taito_z.c
[src/mame/includes]dec0.h galaxold.h
[src/mame/machine]galaxold.c maple-dc.c mapledev.c mapledev.h mie.c mie.h
[src/mame/video]dec0.c konicdev.c

src/mame/mame.lst
r15435r15436
260260hexpool         // (c) 1986 Shinkia (Senko Kit)
261261hexpoola      // (c) 1986 Shinkia (Senko Kit)
262262trvchlng      // [1985] Joyland (Senko license)
263bullsdrtg      // 1985 Senko
263264luctoday      // 1980 Sigma
264265chewing         // ?? unknown
265266catacomb      // 1982 MTM Games
r15435r15436
46044605dyndeka2b      // 1998.05 Dynamite Deka 2 (Japan)
46054606dynamcopb      // 1998.09 Dynamite Cop (Export)
46064607pltkids         // 1999.03 Pilot Kids (Revision A)
4608overrevb      // 1997.09 Over Rev (Revision B)
46074609
46084610// Model 2C-CRX (TGPx4, SCSP sound board)
46094611skisuprg      // 1996.12 Sega Ski Super G
r15435r15436
53035305tomahawk1      // (c) 1980 Data East, Inc.
53045306progolf         // (c) 1981
53055307progolfa      // (c) 1981
5306deshoros      // (c) 1983
5308destiny         // (c) 1983
53075309prosoccr      // (c) 1983
53085310prosport      // (c) 1983
53095311prosporta      // (c) 1983
r15435r15436
63246326astdelux2      // 0351xx           (c) 1980
63256327astdelux1      // 0351xx           (c) 1980
63266328bzone         // 0364xx           (c) 1980
6327bzone2         // 0364xx           (c) 1980
6329bzonea         // 0364xx           (c) 1980
63286330bzonec         // 0364xx           (c) 1980
63296331bradley         //     ??           (c) 1980
63306332redbaron      // 036995-037007    (c) 1980
6333redbarona      // 036995-037007    (c) 1980
63316334tempest         // 136002           (c) 1980
63326335tempest3      // 136002           (c) 1980
63336336tempest2      // 136002           (c) 1980
src/mame/machine/mie.c
r15435r15436
361361   return 0x8c | (jvs->get_address_set_line() ? 2 : 0) | (jvs->get_presence_line() ? 0 : 1);
362362}
363363
364
364void mie_device::maple_reset()
365{
366}
src/mame/machine/mie.h
r15435r15436
6969   static IRQ_CALLBACK(irq_callback_1);
7070
7171   void maple_w(const UINT32 *data, UINT32 in_size);
72   virtual void maple_reset();
7273
7374protected:
7475   const char *gpio_name[8];
src/mame/machine/mapledev.c
r15435r15436
2929   save_item(NAME(reply_partial));
3030}
3131
32void maple_device::maple_reset()
33{
34   device_reset();
35}
36
3237void maple_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
3338{
3439   if(id != TIMER_ID)
src/mame/machine/mapledev.h
r15435r15436
1313   static void static_set_host(device_t &device, const char *_host_tag, int _host_port);
1414   virtual void maple_w(const UINT32 *data, UINT32 in_size) = 0;
1515   void maple_r(UINT32 *data, UINT32 &out_size, bool &partial);
16   virtual void maple_reset();
1617
1718protected:
1819   enum { TIMER_ID = 1000 };
src/mame/machine/galaxold.c
r15435r15436
425425   /* Doesn't actually use the bank, but it mustn't have a coin lock! */
426426   machine.device("maincpu")->memory().space(AS_PROGRAM)->install_write_handler(0x6002, 0x6002, write8_delegate(FUNC(galaxold_state::galaxold_gfxbank_w),state));
427427}
428
429DRIVER_INIT( bullsdrtg )
430{
431   int i;
432
433   // patch char supposed to be space
434   UINT8 *gfxrom = machine.root_device().memregion("gfx1")->base();
435   for (i = 0; i < 8; i++)
436   {
437      gfxrom[i] = 0;
438   }
439
440   // patch gfx for charset (seems to be 1bpp with bitplane data in correct rom)
441   for (i = 0*8; i < 27*8; i++)
442   {
443      gfxrom[0x1000 + i] = 0;
444   }
445
446   // patch gfx for digits (seems to be 1bpp with bitplane data in correct rom)
447   for (i = 48*8; i < (48+10)*8; i++ )
448   {
449      gfxrom[0x1000 + i] = 0;
450   }
451}
src/mame/machine/maple-dc.c
r15435r15436
157157            break;
158158         case 3: // reset
159159            if(devices[dma_port])
160               devices[dma_port]->reset();
160               devices[dma_port]->maple_reset();
161161            break;
162162         case 4: // sdckb occupy cancel
163163            logerror("MAPLE: sdckb occupy cancel\n");
src/mame/includes/galaxold.h
r15435r15436
9393   DECLARE_READ8_MEMBER(scramb2_port2_r);
9494   DECLARE_WRITE8_MEMBER(harem_nmi_mask_w);
9595   DECLARE_READ8_MEMBER(hexpoola_data_port_r);
96   DECLARE_READ8_MEMBER(bullsdrtg_data_port_r);
9697   DECLARE_WRITE8_MEMBER(galaxold_nmi_enable_w);
9798   DECLARE_WRITE8_MEMBER(galaxold_coin_lockout_w);
9899   DECLARE_WRITE8_MEMBER(galaxold_coin_counter_w);
r15435r15436
193194
194195DRIVER_INIT( 4in1 );
195196DRIVER_INIT( ladybugg );
197DRIVER_INIT( bullsdrtg );
196198
197
198199MACHINE_RESET( galaxold );
199200MACHINE_RESET( devilfsg );
200201MACHINE_RESET( hunchbkg );
src/mame/includes/dec0.h
r15435r15436
1#include "video/decbac06.h"
2#include "video/decmxc06.h"
3
14class dec0_state : public driver_device
25{
36public:
r15435r15436
58      : driver_device(mconfig, type, tag) ,
69      m_ram(*this, "ram"),
710      m_spriteram(*this, "spriteram"),
8      m_robocop_shared_ram(*this, "robocop_shared"){ }
11      m_robocop_shared_ram(*this, "robocop_shared"),
12      m_tilegen1(*this, "tilegen1"),
13      m_tilegen2(*this, "tilegen2"),
14      m_tilegen3(*this, "tilegen3"),
15      m_spritegen(*this, "spritegen")
16   { }
917
1018   required_shared_ptr<UINT16> m_ram;
1119   required_shared_ptr<UINT16> m_spriteram;
1220   optional_shared_ptr<UINT8> m_robocop_shared_ram;
1321
22   optional_device<deco_bac06_device> m_tilegen1;
23   optional_device<deco_bac06_device> m_tilegen2;
24   optional_device<deco_bac06_device> m_tilegen3;
25   optional_device<deco_mxc06_device> m_spritegen;
26
27
1428   int m_GAME;
1529   int m_i8751_return;
1630   int m_i8751_command;
r15435r15436
5165};
5266
5367
54class automat_state : public dec0_state
68class dec0_automat_state : public dec0_state
5569{
5670public:
57   automat_state(const machine_config &mconfig, device_type type, const char *tag)
71   dec0_automat_state(const machine_config &mconfig, device_type type, const char *tag)
5872      : dec0_state(mconfig, type, tag) {
5973
6074   }
r15435r15436
6377   int m_automat_msm5205_vclk_toggle;
6478   DECLARE_WRITE16_MEMBER(automat_control_w);
6579   DECLARE_WRITE8_MEMBER(automat_adpcm_w);
80   DECLARE_READ16_MEMBER( automat_palette_r );
81   DECLARE_WRITE16_MEMBER( automat_palette_w );
82   DECLARE_WRITE16_MEMBER( automat_scroll_w )
83   {
84      COMBINE_DATA(&m_automat_scroll_regs[offset]);
85   }
86   UINT16 m_automat_scroll_regs[4];
6687
88
6789};
6890
6991
src/mame/video/dec0.c
r15435r15436
66
77#include "emu.h"
88#include "includes/dec0.h"
9#include "video/decbac06.h"
10#include "video/decmxc06.h"
119
10
1211/******************************************************************************/
1312
1413WRITE16_MEMBER(dec0_state::dec0_update_sprites_w)
r15435r15436
4948{
5049   dec0_state *state = screen.machine().driver_data<dec0_state>();
5150
52   state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
51   state->flip_screen_set(state->m_tilegen1->get_flip_state());
5352
54   screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
55   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x08, 0x0f);
56   screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
53   state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
54   state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x08, 0x0f);
55   state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
5756
5857   /* HB always keeps pf2 on top of pf3, no need explicitly support priority register */
5958
60   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x00, 0x0f);
61   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
59   state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, 0x00, 0x0f);
60   state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
6261   return 0;
6362}
6463
r15435r15436
6766SCREEN_UPDATE_IND16( baddudes )
6867{
6968   dec0_state *state = screen.machine().driver_data<dec0_state>();
70   state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
69   state->flip_screen_set(state->m_tilegen1->get_flip_state());
7170
7271   /* WARNING: inverted wrt Midnight Resistance */
7372   if ((state->m_pri & 0x01) == 0)
7473   {
75      screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
76      screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
74      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
75      state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
7776
7877      if (state->m_pri & 2)
79         screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
78         state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
8079
81      screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
80      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
8281
8382      if (state->m_pri & 4)
84         screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
83         state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
8584   }
8685   else
8786   {
88      screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
89      screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
87      state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
88      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
9089
9190      if (state->m_pri & 2)
92         screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
91         state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
9392
94      screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
93      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
9594
9695      if (state->m_pri & 4)
97         screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
96         state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */
9897   }
9998
100   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
99   state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
101100   return 0;
102101}
103102
r15435r15436
108107   dec0_state *state = screen.machine().driver_data<dec0_state>();
109108   int trans;
110109
111   state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
110   state->flip_screen_set(state->m_tilegen1->get_flip_state());
112111
113112   if (state->m_pri & 0x04)
114113      trans = 0x08;
r15435r15436
121120      /* Robocop uses it only for the title screen, so this might be just */
122121      /* completely wrong. The top 8 bits of the register might mean */
123122      /* something (they are 0x80 in midres, 0x00 here) */
124      screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
123      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
125124
126125      if (state->m_pri & 0x02)
127         screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f);
126         state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f);
128127
129      screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
128      state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
130129   }
131130   else
132131   {
133      screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
132      state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
134133
135134      if (state->m_pri & 0x02)
136         screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f);
135         state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f);
137136
138      screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
137      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
139138   }
140139
141140   if (state->m_pri & 0x02)
142      screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans^0x08, 0x0f);
141      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans^0x08, 0x0f);
143142   else
144      screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
143      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
145144
146   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
145   state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
147146   return 0;
148147}
149148
150149
151150SCREEN_UPDATE_IND16( automat )
152151{
152   dec0_automat_state *state = screen.machine().driver_data<dec0_automat_state>();
153   int trans;
154
155   // layer enables seem different... where are they?
156
157   // the bootleg doesn't write these registers, I think they're hardcoded?, so fake them for compatibility with our implementation..
158   deco_bac06_pf_control_0_w(state->m_tilegen1,0,0x0003, 0x00ff); // 8x8
159   deco_bac06_pf_control_0_w(state->m_tilegen1,1,0x0003, 0x00ff);
160   deco_bac06_pf_control_0_w(state->m_tilegen1,2,0x0000, 0x00ff);
161   deco_bac06_pf_control_0_w(state->m_tilegen1,3,0x0001, 0x00ff); // dimensions
162
163   deco_bac06_pf_control_0_w(state->m_tilegen2,0,0x0082, 0x00ff); // 16x16
164   deco_bac06_pf_control_0_w(state->m_tilegen2,1,0x0000, 0x00ff);
165   deco_bac06_pf_control_0_w(state->m_tilegen2,2,0x0000, 0x00ff);
166   deco_bac06_pf_control_0_w(state->m_tilegen2,3,0x0001, 0x00ff); // dimensions
167
168   deco_bac06_pf_control_0_w(state->m_tilegen3,0,0x0082, 0x00ff); // 16x16
169   deco_bac06_pf_control_0_w(state->m_tilegen3,1,0x0003, 0x00ff);
170   deco_bac06_pf_control_0_w(state->m_tilegen3,2,0x0000, 0x00ff);
171   deco_bac06_pf_control_0_w(state->m_tilegen3,3,0x0001, 0x00ff); // dimensions
172
173   // scroll registers got written elsewhere, copy them across
174   deco_bac06_pf_control_1_w(state->m_tilegen1,0,0x0000, 0xffff); // no scroll?
175   deco_bac06_pf_control_1_w(state->m_tilegen1,1,0x0000, 0xffff); // no scroll?
176
177   deco_bac06_pf_control_1_w(state->m_tilegen2,0,state->m_automat_scroll_regs[3] - 0x010a, 0xffff);
178   deco_bac06_pf_control_1_w(state->m_tilegen2,1,state->m_automat_scroll_regs[2], 0xffff);
179
180   deco_bac06_pf_control_1_w(state->m_tilegen3,0,state->m_automat_scroll_regs[1] - 0x0108, 0xffff);
181   deco_bac06_pf_control_1_w(state->m_tilegen3,1,state->m_automat_scroll_regs[0], 0xffff);
182
183   // sprites seem very different, probably need new functions
184   
185   state->flip_screen_set(state->m_tilegen1->get_flip_state());
186
187   if (state->m_pri & 0x04)
188      trans = 0x08;
189   else
190      trans = 0x00;
191
192   if (state->m_pri & 0x01)
193   {
194      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
195
196      if (state->m_pri & 0x02)
197         state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f);
198
199      state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
200   }
201   else
202   {
203      state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
204
205      if (state->m_pri & 0x02)
206         state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f);
207
208      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
209   }
210
211//   if (state->m_pri & 0x02)
212//      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans^0x08, 0x0f);
213//   else
214//      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
215
216   state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
153217   return 0;
154218}
155219
r15435r15436
159223{
160224   dec0_state *state = screen.machine().driver_data<dec0_state>();
161225
162   state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
226   state->flip_screen_set(state->m_tilegen1->get_flip_state());
163227
164228   /* This game doesn't have the extra playfield chip on the game board, but
165229    the palette does show through. */
166230   bitmap.fill(screen.machine().pens[768], cliprect);
167   screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
168   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
169   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
231   state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
232   state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
233   state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
170234   return 0;
171235}
172236
r15435r15436
175239SCREEN_UPDATE_IND16( hippodrm )
176240{
177241   dec0_state *state = screen.machine().driver_data<dec0_state>();
178   state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
242   state->flip_screen_set(state->m_tilegen1->get_flip_state());
179243
180244   if (state->m_pri & 0x01)
181245   {
182      screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
183      screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
246      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
247      state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
184248   }
185249   else
186250   {
187      screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
188      screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
251      state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
252      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
189253   }
190254
191   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
192   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
255   state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
256   state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
193257   return 0;
194258}
195259
r15435r15436
198262SCREEN_UPDATE_IND16( slyspy )
199263{
200264   dec0_state *state = screen.machine().driver_data<dec0_state>();
201   state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
265   state->flip_screen_set(state->m_tilegen1->get_flip_state());
202266
203   screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
204   screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
267   state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
268   state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
205269
206   screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
270   state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
207271
208272   /* Redraw top 8 pens of top 8 palettes over sprites */
209273   if (state->m_pri&0x80)
210      screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
274      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles
211275
212   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
276   state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
213277   return 0;
214278}
215279
r15435r15436
220284   dec0_state *state = screen.machine().driver_data<dec0_state>();
221285   int trans;
222286
223   state->flip_screen_set(screen.machine().device<deco_bac06_device>("tilegen1")->get_flip_state());
287   state->flip_screen_set(state->m_tilegen1->get_flip_state());
224288
225289   if (state->m_pri & 0x04)
226290      trans = 0x00;
r15435r15436
228292
229293   if (state->m_pri & 0x01)
230294   {
231      screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
295      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
232296
233297      if (state->m_pri & 0x02)
234         screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f);
298         state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f);
235299
236      screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
300      state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
237301   }
238302   else
239303   {
240      screen.machine().device<deco_bac06_device>("tilegen3")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
304      state->m_tilegen3->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00);
241305
242306      if (state->m_pri & 0x02)
243         screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f);
307         state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans, 0x0f);
244308
245      screen.machine().device<deco_bac06_device>("tilegen2")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
309      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
246310   }
247311
248312   if (state->m_pri & 0x02)
249      screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans ^ 0x08, 0x0f);
313      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans ^ 0x08, 0x0f);
250314   else
251      screen.machine().device<deco_mxc06_device>("spritegen")->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
315      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
252316
253   screen.machine().device<deco_bac06_device>("tilegen1")->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
317   state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
254318   return 0;
255319}
256320
src/mame/video/konicdev.c
r15435r15436
36843684      {
36853685         int sx, sy, zw, zh;
36863686
3687         sy = oy + ((zoomy * y + (1 << 11)) >> 12) - 1;
3687         sy = oy + ((zoomy * y + (1 << 11)) >> 12);
36883688         zh = (oy + ((zoomy * (y + 1) + (1 << 11)) >> 12)) - sy;
36893689
36903690         for (x = 0; x < w; x++)
36913691         {
36923692            int c, fx, fy;
36933693
3694            sx = ox + ((zoomx * x + (1 << 11)) >> 12) - 1;
3694            sx = ox + ((zoomx * x + (1 << 11)) >> 12);
36953695            zw = (ox + ((zoomx * (x+1) + (1 << 11)) >> 12)) - sx;
36963696            c = code;
36973697            if (mirrorx)
src/mame/drivers/model2.c
r15435r15436
41174117   ROM_LOAD("mpr-20253.35",  0x0600000, 0x200000, CRC(ca6aa17c) SHA1(f6df2483ca75573449ba36638dbbed4be7843a44) )
41184118ROM_END
41194119
4120/* Over Rev: There is known to be an undumped Model 2B version with EPR-19992B & EPR-19993B program roms */
41214120ROM_START( overrev ) /* Over Rev Revision A, Model 2C */
41224121   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
41234122   ROM_LOAD32_WORD( "epr-20124a.15", 0x000000, 0x080000, CRC(74beb8d7) SHA1(c65c641138ecd7312c4930702d1498b8a346175a) )
r15435r15436
41474146   ROM_LOAD( "mpr-20004.34", 0x400000, 0x400000, CRC(0b9c5410) SHA1(e5bb30702fc853ccc03316be07a334269d3ebb4a) )
41484147ROM_END
41494148
4149ROM_START( overrevb ) /* Over Rev Revision B, Model 2B, rom board stickered as 836-13275 */
4150   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
4151   ROM_LOAD32_WORD( "epr-19992b.15", 0x000000, 0x080000, CRC(6d3e78d5) SHA1(40d18ee284ea2e038f7e3d04db56e793ab3e3dd5) ) /* sum16 492A printed on label */
4152   ROM_LOAD32_WORD( "epr-19993b.16", 0x000002, 0x080000, CRC(765dc9ce) SHA1(a718c32ca27ec1fb5ed2d7d3797ea7e906510a04) ) /* sum16 B955 printed on label */
4153
4154   ROM_REGION32_LE( 0x2000000, "user1", 0 ) // Data
4155   ROM_LOAD32_WORD( "mpr-19996.11",  0x000000, 0x400000, CRC(21928a00) SHA1(6b439fd2b113b64df9378ef8180a17aa6fa975c5) )
4156   ROM_LOAD32_WORD( "mpr-19997.12",  0x000002, 0x400000, CRC(2a169cab) SHA1(dbf9af938afd0599d345c42c1df242e575c14de9) )
4157   ROM_LOAD32_WORD( "mpr-19994.9",   0x800000, 0x400000, CRC(e691fbd5) SHA1(b99c2f3f2a682966d792917dfcb8ed8e53bc0b7a) )
4158   ROM_LOAD32_WORD( "mpr-19995.10",  0x800002, 0x400000, CRC(82a7828e) SHA1(4336a12a07a67f94091b4a9b491bab02c375dd15) )
4159
4160   ROM_REGION( 0x800000, "cpu2", ROMREGION_ERASE00 ) // TGPx4 program (COPRO sockets)
4161
4162   ROM_REGION( 0x800000, "user2", 0 ) // Models (TGP sockets)
4163   ROM_LOAD32_WORD( "mpr-19998.17",  0x000000, 0x200000, CRC(6a834574) SHA1(8be19bf42dbb157d6acde62a2018ef4c0d41aab4) )
4164   ROM_LOAD32_WORD( "mpr-19999.21",  0x000002, 0x200000, CRC(ff590a2d) SHA1(ad29e4270b4a2f82189fbab83358eb1200f43777) )
4165
4166   ROM_REGION( 0x400000, "user3", 0 ) // Textures (TEXTURE sockets)
4167   ROM_LOAD32_WORD( "mpr-20001.27",  0x000000, 0x200000, CRC(6ca236aa) SHA1(b3cb89fadb42afed13be4f229d7158dee487978a) )
4168   ROM_LOAD32_WORD( "mpr-20000.25",  0x000002, 0x200000, CRC(894d8ded) SHA1(9bf7c754a29eef47fa49b5567980601895127306) )
4169
4170   ROM_REGION( 0x100000, "audiocpu", 0 ) // Sound program
4171   ROM_LOAD16_WORD_SWAP( "epr-20002.31", 0x000000, 0x080000, CRC(7efb069e) SHA1(30b1bbaf348d6a6b9ee2fdf82a0749baa025e0bf) )
4172
4173   ROM_REGION( 0x800000, "scsp", 0 ) // Samples
4174   ROM_LOAD( "mpr-20003.32", 0x000000, 0x400000, CRC(149ac22b) SHA1(c890bbaebbbb07b62bcb8a3a8edded9fa0ec9a1e) )
4175   ROM_LOAD( "mpr-20004.34", 0x400000, 0x400000, CRC(0b9c5410) SHA1(e5bb30702fc853ccc03316be07a334269d3ebb4a) )
4176ROM_END
4177
41504178ROM_START( topskatr ) /* Top Skater Revision A (Export), Model 2C */
41514179   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
41524180   ROM_LOAD32_WORD("epr-19755a.15", 0x000000, 0x080000, CRC(b80633b9) SHA1(5396da414beeb918e6f38f25a43dd76345a0c8ed) )
r15435r15436
52675295GAME( 1996, lastbrnxu,lastbrnx, model2b, model2, 0,       ROT0, "Sega", "Last Bronx (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52685296GAME( 1996, lastbrnxj,lastbrnx, model2b, model2, 0,       ROT0, "Sega", "Last Bronx (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52695297GAME( 1996, doa,             0, model2b, model2, doa,     ROT0, "Sega", "Dead or Alive (Model 2B, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5270GAME( 1996, sgt24h,          0, model2b, srallyc, sgt24h, ROT0, "Jaleco", "Super GT 24h", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5298GAME( 1996, sgt24h,          0, model2b, srallyc,sgt24h, ROT0, "Jaleco", "Super GT 24h", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52715299GAME( 1996, von,             0, model2b, model2, 0,       ROT0, "Sega", "Cyber Troopers Virtual-On (USA, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52725300GAME( 1996, vonj,          von, model2b, model2, 0,       ROT0, "Sega", "Cyber Troopers Virtual-On (Japan, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52735301GAME( 1996, dynabb,          0, model2b, model2, 0,       ROT0, "Sega", "Dynamite Baseball", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52745302GAME( 1997, dynabb97,        0, model2b, model2, 0,       ROT0, "Sega", "Dynamite Baseball 97 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5303GAME( 1997, overrevb,  overrev, model2b, srallyc,overrev, ROT0, "Jaleco", "Over Rev (Model 2B, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52755304GAME( 1997, zerogun,         0, model2b, model2, zerogun, ROT0, "Psikyo", "Zero Gunner (Export, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52765305GAME( 1997, zerogunj,  zerogun, model2b, model2, zerogun, ROT0, "Psikyo", "Zero Gunner (Japan, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52775306GAME( 1998, dynamcopb,dynamcop, model2b, model2, genprot, ROT0, "Sega", "Dynamite Cop (Export, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
r15435r15436
52805309GAME( 1995, rchase2,         0, model2b, rchase2,rchase2, ROT0, "Sega", "Rail Chase 2 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52815310
52825311// Model 2C-CRX (TGPx4, SCSP sound board)
5283GAME( 1996, skisuprg,        0, model2c, model2, 0, ROT0, "Sega", "Sega Ski Super G", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5284GAME( 1996, stcc,            0, model2c, model2, 0, ROT0, "Sega", "Sega Touring Car Championship", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5285GAME( 1996, stcca,        stcc, model2c, model2, 0, ROT0, "Sega", "Sega Touring Car Championship (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5286GAME( 1996, stccb,        stcc, model2c, model2, 0, ROT0, "Sega", "Sega Touring Car Championship (Unknown Revision)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5287GAME( 1996, waverunr,        0, model2c, model2, 0, ROT0, "Sega", "Wave Runner (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5288GAME( 1997, hotd,            0, model2c, model2, 0, ROT0, "Sega", "House of the Dead", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5289GAME( 1997, overrev,         0, model2c, srallyc, overrev, ROT0, "Jaleco", "Over Rev (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5290GAME( 1997, segawski,        0, model2c, model2, 0, ROT0, "Sega", "Sega Water Ski (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5291GAME( 1997, topskatr,        0, model2c, model2, 0, ROT0, "Sega", "Top Skater (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5292GAME( 1997, topskatru,topskatr, model2c, model2, 0, ROT0, "Sega", "Top Skater (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5293GAME( 1997, topskatrj,topskatr, model2c, model2, 0, ROT0, "Sega", "Top Skater (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5294GAME( 1998, bel,             0, model2c, bel,    0, ROT0, "Sega / EPL Productions", "Behind Enemy Lines", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5295GAME( 1998, dynamcopc,dynamcop, model2c, model2, 0, ROT0, "Sega", "Dynamite Cop (USA, Model 2C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5312GAME( 1996, skisuprg,        0, model2c, model2, 0,       ROT0, "Sega", "Sega Ski Super G", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5313GAME( 1996, stcc,            0, model2c, model2, 0,       ROT0, "Sega", "Sega Touring Car Championship", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5314GAME( 1996, stcca,        stcc, model2c, model2, 0,       ROT0, "Sega", "Sega Touring Car Championship (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5315GAME( 1996, stccb,        stcc, model2c, model2, 0,       ROT0, "Sega", "Sega Touring Car Championship (Unknown Revision)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5316GAME( 1996, waverunr,        0, model2c, model2, 0,       ROT0, "Sega", "Wave Runner (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5317GAME( 1997, hotd,            0, model2c, model2, 0,       ROT0, "Sega", "House of the Dead", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5318GAME( 1997, overrev,         0, model2c, srallyc,overrev, ROT0, "Jaleco", "Over Rev (Model, 2C Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5319GAME( 1997, segawski,        0, model2c, model2, 0,       ROT0, "Sega", "Sega Water Ski (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5320GAME( 1997, topskatr,        0, model2c, model2, 0,       ROT0, "Sega", "Top Skater (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5321GAME( 1997, topskatru,topskatr, model2c, model2, 0,       ROT0, "Sega", "Top Skater (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5322GAME( 1997, topskatrj,topskatr, model2c, model2, 0,       ROT0, "Sega", "Top Skater (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5323GAME( 1998, bel,             0, model2c, bel,    0,       ROT0, "Sega / EPL Productions", "Behind Enemy Lines", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5324GAME( 1998, dynamcopc,dynamcop, model2c, model2, 0,       ROT0, "Sega", "Dynamite Cop (USA, Model 2C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52965325
src/mame/drivers/pcxt.c
r15435r15436
721721
722722   state->m_pc_spkrdata = 0;
723723   state->m_pc_input = 0;
724
724   state->m_wss2_data = 0;
725725   speaker_level_w( speaker, 0 );
726726}
727727
src/mame/drivers/naomi.c
r15435r15436
2121
2222TODO (general):
2323    - all games that uses YUV just updates one frame then dies, why?
24    - SH to ARM sound streaming doesn't work (used by ADX compression system)
24    - Some SH to ARM sound streaming doesn't work (used by ADX compression system)
2525    - ngdup23a, ngdup23c: missing DIMM emulation, hence they can't possibly work, emulate the DIMM means to add an extra SH-4 ...
26
27    - Following games doesn't boot, any attempt makes it to return to the system test mode (almost likely to be JVS related):
28    * Death Crimson OX
29    * La Keyboard
30    * Lupin the Third
31    * Moeru Casinyo
32    * Puyo Puyo DA!
33    * Puyo Puyo Fever
34    * Samba de Amigo
35    * Samba de Amigo Ver. 2000
36    * Shootout Pool
26    - games using "m4" decryption have never successfully worked, may be
27      an issue there.
28 
29    - Following games doesn't boot, any attempt makes it to return to the system test mode (note these are also "m4" type games)
30    * Illvelo
31    * Akatsuki Blitzkampf Ausf Achse
32 
33    - Doesn't boot
34    * Shootout Pool (all 3 Shootout Pool games show an animated loading screen and then lock up)
3735    * Shootout Pool Medal
3836    * Shootout Pool Prize
37 
38    - Boots and accepts coin, but won't accept start button
3939    * Usagi Yamashiro Hen
40    * Virtual On
41    * WWF Royal Rumble
42
40 
4341    - missing inputs (needs rotary channels):
4442    * Crakin' DJ
4543    * Dynamic Golf
r15435r15436
5149    * Sega Marine Fishing
5250    * Wave Runner GP
5351
54    - doesn't boot consistently (JVS checksum error?):
55    * Cannon Spike;
56    * Heavy Metal GeoMatrix;
57    * Moeru Justice Gakuen;
58    * Power Stone 2;
59    * Spawn;
60
52    - "com error occured between Naomi BD and I/O BD"
53    * Samba de Amigo
54    * Samba de Amigo Ver. 2000
55 
56    - other issues:
57    * Death Crimson OX (boots now, but dies in YUV-mode movie; coining up before it appears to freeze the game)
58    * La Keyboard (boots fine & attract mode looks OK, but no keyboard)
59 
6160TODO (game-specific):
6261    - 18th Wheeler Deluxe: "MOTOR NETWORK ERR IN 01 OUT FF" msg pops up during gameplay;
6362    - Airline Pilots Deluxe: returns error 03
r15435r15436
18501849INPUT_PORTS_END
18511850
18521851static INPUT_PORTS_START( naomi_mie )
1853   PORT_START("MIE:3")
1852   PORT_START("MIE.3")
18541853   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("mie_eeprom", eeprom_device, write_bit)
18551854   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("mie_eeprom", eeprom_device, set_cs_line)
18561855   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("mie_eeprom", eeprom_device, set_clock_line)
18571856
1858   PORT_START("MIE:5")
1857   PORT_START("MIE.5")
18591858   PORT_DIPNAME( 0x01, 0x00, "Monitor" ) PORT_DIPLOCATION("SW1:1")
18601859   PORT_DIPSETTING(    0x01, "31 kHz" )
18611860   PORT_DIPSETTING(    0x00, "15 kHz" )
r15435r15436
24092408
24102409// 2 joysticks variant
24112410static INPUT_PORTS_START( aw2c )
2412   PORT_START("P1:0")
2411   PORT_START("P1.0")
24132412   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
24142413   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
24152414   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r15435r15436
24182417   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
24192418   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
24202419   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
2421   PORT_START("P1:1")
2420   PORT_START("P1.1")
24222421   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
24232422   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
24242423   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )
r15435r15436
24282427   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
24292428   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
24302429
2431   PORT_START("P2:0")
2430   PORT_START("P2.0")
24322431   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
24332432   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
24342433   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
r15435r15436
24372436   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
24382437   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
24392438   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
2440   PORT_START("P2:1")
2439   PORT_START("P2.1")
24412440   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
24422441   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
24432442   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 )
r15435r15436
24562455
24572456// Single-player wheel variant
24582457static INPUT_PORTS_START( aw1w )
2459   PORT_START("P1:0")
2458   PORT_START("P1.0")
24602459   PORT_BIT( 0xf1, IP_ACTIVE_LOW, IPT_UNUSED )
24612460   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
24622461   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
24632462   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
24642463
2465   PORT_START("P1:1")
2464   PORT_START("P1.1")
24662465   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
24672466   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )
24682467   PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
24692468
2470   PORT_START("P2:A0") /* steering */
2469   PORT_START("P2.A0") /* steering */
24712470   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
24722471
2473   PORT_START("P2:A1")   /* gas pedal */
2472   PORT_START("P2.A1")   /* gas pedal */
24742473   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20)
24752474
2476   PORT_START("P2:A2")   /* brake */
2475   PORT_START("P2.A2")   /* brake */
24772476   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40)
24782477
2479   PORT_START("P2:A3") /* steering */
2478   PORT_START("P2.A3") /* steering */
24802479   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4)
24812480
2482   PORT_START("P2:A4")   /* gas pedal */
2481   PORT_START("P2.A4")   /* gas pedal */
24832482   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20)
24842483
2485   PORT_START("P2:A5")   /* brake */
2484   PORT_START("P2.A5")   /* brake */
24862485   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(40)
24872486
24882487   PORT_START("COINS")
r15435r15436
25422541MACHINE_CONFIG_END
25432542
25442543static MACHINE_CONFIG_DERIVED( naomi_base, naomi_aw_base )
2545   MCFG_MIE_ADD("mie", 4000000, "maple_dc", 0, 0, 0, 0, "MIE:3", 0, "MIE:5", 0, 0) // Actual frequency unknown
2546   MCFG_SEGA_837_13551_DEVICE_ADD("837_13551", "mie", "TILT", "P1", "P2", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "OUTPUT")
2544   MCFG_MIE_ADD("mie", 4000000, "maple_dc", 0, 0, 0, 0, ":MIE.3", 0, ":MIE.5", 0, 0) // Actual frequency unknown
2545   MCFG_SEGA_837_13551_DEVICE_ADD("837_13551", "mie", ":TILT", ":P1", ":P2", ":A0", ":A1", ":A2", ":A3", ":A4", ":A5", ":A6", ":A7", ":OUTPUT")
25472546   MCFG_EEPROM_93C46_8BIT_ADD("mie_eeprom")
25482547
25492548   MCFG_X76F100_ADD("naomibd_eeprom")
r15435r15436
26372636MACHINE_CONFIG_END
26382637
26392638static MACHINE_CONFIG_DERIVED( aw1c, aw_base )
2640   MCFG_DC_CONTROLLER_ADD("dcctrl0", "maple_dc", 0, "P1:0", "P1:1", "P1:A0", "P1:A1", "P1:A2", "P1:A3", "P1:A4", "P1:A5")
2641   MCFG_DC_CONTROLLER_ADD("dcctrl1", "maple_dc", 1, "P2:0", "P2:1", "P2:A0", "P2:A1", "P2:A2", "P2:A3", "P2:A4", "P2:A5")
2639   MCFG_DC_CONTROLLER_ADD("dcctrl0", "maple_dc", 0, ":P1.0", ":P1.1", ":P1.A0", ":P1.A1", ":P1.A2", ":P1.A3", ":P1.A4", ":P1.A5")
2640   MCFG_DC_CONTROLLER_ADD("dcctrl1", "maple_dc", 1, ":P2.0", ":P2.1", ":P2.A0", ":P2.A1", ":P2.A2", ":P2.A3", ":P2.A4", ":P2.A5")
26422641MACHINE_CONFIG_END
26432642
26442643static MACHINE_CONFIG_DERIVED( aw2c, aw_base )
2645   MCFG_DC_CONTROLLER_ADD("dcctrl0", "maple_dc", 0, "P1:0", "P1:1", "P1:A0", "P1:A1", "P1:A2", "P1:A3", "P1:A4", "P1:A5")
2646   MCFG_DC_CONTROLLER_ADD("dcctrl1", "maple_dc", 1, "P2:0", "P2:1", "P2:A0", "P2:A1", "P2:A2", "P2:A3", "P2:A4", "P2:A5")
2644   MCFG_DC_CONTROLLER_ADD("dcctrl0", "maple_dc", 0, ":P1.0", ":P1.1", ":P1.A0", ":P1.A1", ":P1.A2", ":P1.A3", ":P1.A4", ":P1.A5")
2645   MCFG_DC_CONTROLLER_ADD("dcctrl1", "maple_dc", 1, ":P2.0", ":P2.1", ":P2.A0", ":P2.A1", ":P2.A2", ":P2.A3", ":P2.A4", ":P2.A5")
26472646MACHINE_CONFIG_END
26482647
26492648#define ROM_LOAD16_WORD_SWAP_BIOS(bios,name,offset,length,hash) \
src/mame/drivers/superchs.c
r15435r15436
168168
169169READ32_MEMBER(superchs_state::superchs_stick_r)
170170{
171   /* Todo: Verify brake - and figure out other input */
172   return (ioport("WHEEL")->read() << 24) | (ioport("ACCEL")->read() << 16) | (ioport("SOUND")->read() << 8) | ioport("UNKNOWN")->read();
171   UINT8 b0 = ioport("UNKNOWN")->read();
172   UINT8 b1 = ((ioport("SOUND")->read() * 255) / 100) ^ 0xff; // 00 = full, ff = silent
173   UINT8 b2 = ioport("ACCEL")->read() ^ 0xff;
174   UINT8 b3 = ioport("WHEEL")->read();
175
176   return b3 << 24 | b2 << 16 | b1 << 8 | b0;
173177}
174178
175179WRITE32_MEMBER(superchs_state::superchs_stick_w)
r15435r15436
247251   PORT_BIT( 0x40000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
248252   PORT_BIT( 0x80000000, IP_ACTIVE_LOW,  IPT_UNKNOWN )
249253
250   PORT_START("WHEEL")      /* steering wheel */
254   // 4 analog ports
255   PORT_START("WHEEL")
251256   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(4) PORT_REVERSE PORT_NAME("Steering Wheel")
252257
253   PORT_START("ACCEL")      /* accel */
254   PORT_BIT( 0xff, 0x00, IPT_PEDAL )  PORT_SENSITIVITY(100) PORT_KEYDELTA(30) PORT_REVERSE PORT_NAME("Gas Pedal")
258   PORT_START("ACCEL")
259   PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_NAME("Gas Pedal")   /* in upright cab, it is a digital (1 bit) switch instead */
255260
256   PORT_START("SOUND")      /* sound volume */
257   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_X ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2)
261   PORT_START("SOUND")
262   PORT_ADJUSTER( 75, "PCB - Sound Volume" )
258263
259   PORT_START("UNKNOWN")   /* unknown */
260   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(20) PORT_KEYDELTA(10) PORT_PLAYER(2)
264   PORT_START("UNKNOWN") // unused?
265   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
261266INPUT_PORTS_END
262267
263268/***********************************************************
r15435r15436
385390   ROM_REGION16_BE( 0x1000000, "ensoniq.0" , ROMREGION_ERASE00 )
386391   ROM_LOAD16_BYTE( "d46-10.ic2", 0xc00000, 0x200000, CRC(306256be) SHA1(e6e5d4a4c0b98470f2aff2e94624dd19af73ec5d) )
387392   ROM_LOAD16_BYTE( "d46-12.ic4", 0x000000, 0x200000, CRC(a24a53a8) SHA1(5d5fb87a94ceabda89360064d7d9b6d23c4c606b) )
388   ROM_RELOAD     (             0x400000, 0x200000 )
393   ROM_RELOAD     (               0x400000, 0x200000 )
389394   ROM_LOAD16_BYTE( "d46-11.ic5", 0x800000, 0x200000, CRC(d4ea0f56) SHA1(dc8d2ed3c11d0b6f9ebdfde805188884320235e6) )
390395
391396   ROM_REGION16_BE( 0x80, "eeprom", 0 )
r15435r15436
423428   ROM_REGION16_BE( 0x1000000, "ensoniq.0" , ROMREGION_ERASE00 )
424429   ROM_LOAD16_BYTE( "d46-10.ic2", 0xc00000, 0x200000, CRC(306256be) SHA1(e6e5d4a4c0b98470f2aff2e94624dd19af73ec5d) )
425430   ROM_LOAD16_BYTE( "d46-09.ic4", 0x000000, 0x200000, CRC(0acb8bc7) SHA1(62d66925f0eee4cee282c4e0972e08d12acf331c) )
426   ROM_RELOAD     (             0x400000, 0x200000 )
431   ROM_RELOAD     (               0x400000, 0x200000 )
427432   ROM_LOAD16_BYTE( "d46-08.ic5", 0x800000, 0x200000, CRC(4677e820) SHA1(d6427844b08438e45af4c671589a270e46e6dead) )
428433
429434   ROM_REGION16_BE( 0x80, "eeprom", 0 )
src/mame/drivers/lucky74.c
r15435r15436
11761176
11771177
11781178static INPUT_PORTS_START( excitbj )
1179
1179   PORT_INCLUDE( lucky74 )
11801180INPUT_PORTS_END
11811181
11821182
src/mame/drivers/deshoros.c
r15435r15436
11/***************************************************************************
22
3Destiny Horoscope (c) 1983 Data East Corporation
3Destiny (c) 1983 Data East Corporation
44
55driver by Angelo Salese
66
77A fortune-teller machine with 24 characters LED-array and a printer.
8M6809 CPU, 2KB RAM
89
10Rough cpanel sketch:
11
12    [LED-array dispay]          CLEAR ENTER
13                                7  8  9  0
14                                4  5  6  F
15                                1  2  3  M
16
17To control system buttons (SYSTEM, lower nibble), hold one down and then
18push the main service button F2.
19
20
921TODO:
10-Emulate the graphics with genuine artwork display;
11-Printer emulation;
22- Emulate the graphics with genuine artwork display;
23- Printer emulation;
24- Exact sound & irq frequency;
1225
1326***************************************************************************/
1427
1528#include "emu.h"
1629#include "cpu/m6809/m6809.h"
30#include "sound/beep.h"
1731
18
19class deshoros_state : public driver_device
32class destiny_state : public driver_device
2033{
2134public:
22   deshoros_state(const machine_config &mconfig, device_type type, const char *tag)
23      : driver_device(mconfig, type, tag) ,
24      m_io_ram(*this, "io_ram"){ }
35   destiny_state(const machine_config &mconfig, device_type type, const char *tag)
36      : driver_device(mconfig, type, tag),
37      m_maincpu(*this, "maincpu")
38   { }
2539
26   required_shared_ptr<UINT8> m_io_ram;
40   required_device<cpu_device> m_maincpu;
41
2742   char m_led_array[21];
28   UINT8 m_bank;
29   DECLARE_READ8_MEMBER(io_r);
30   DECLARE_WRITE8_MEMBER(io_w);
31   void update_led_array(UINT8 new_data);
43
44   DECLARE_WRITE8_MEMBER(firq_ack_w);
45   DECLARE_WRITE8_MEMBER(nmi_ack_w);
46   DECLARE_READ8_MEMBER(printer_status_r);
47   DECLARE_READ8_MEMBER(display_ready_r);
48   DECLARE_WRITE8_MEMBER(display_w);
49   DECLARE_WRITE8_MEMBER(out_w);
50   DECLARE_WRITE8_MEMBER(bank_select_w);
51   DECLARE_WRITE8_MEMBER(sound_on_w);
52   DECLARE_WRITE8_MEMBER(sound_off_w);
53
54   DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
55
56protected:
57   // driver_device overrides
58   virtual void machine_start();
59   virtual void machine_reset();
3260};
3361
3462
3563/*Temporary,to show something on screen...*/
3664
37static VIDEO_START( deshoros )
65static VIDEO_START( destiny )
3866{
39   deshoros_state *state = machine.driver_data<deshoros_state>();
67   destiny_state *state = machine.driver_data<destiny_state>();
4068   UINT8 i;
4169   for(i=0;i<20;i++)
4270      state->m_led_array[i] = 0x20;
4371   state->m_led_array[20] = 0;
4472}
4573
46static SCREEN_UPDATE_IND16( deshoros )
74static SCREEN_UPDATE_IND16( destiny )
4775{
48   deshoros_state *state = screen.machine().driver_data<deshoros_state>();
76   destiny_state *state = screen.machine().driver_data<destiny_state>();
4977   popmessage("%s",state->m_led_array);
5078   return 0;
5179}
5280
53/*I don't know it this is 100% correct,might be different...*/
54void deshoros_state::update_led_array(UINT8 new_data)
81
82
83/***************************************************************************
84
85  I/O
86
87***************************************************************************/
88
89WRITE8_MEMBER(destiny_state::firq_ack_w)
5590{
56   UINT8 i;
57   /*scroll the data*/
58   for(i=0;i<19;i++)
59      m_led_array[i] = m_led_array[i+1];
60   /*update the data*/
61   m_led_array[19] = new_data;
91   device_set_input_line(m_maincpu, M6809_FIRQ_LINE, CLEAR_LINE);
6292}
6393
94WRITE8_MEMBER(destiny_state::nmi_ack_w)
95{
96   device_set_input_line(m_maincpu, INPUT_LINE_NMI, CLEAR_LINE);
97}
6498
65static void answer_bankswitch(running_machine &machine,UINT8 new_bank)
99READ8_MEMBER(destiny_state::printer_status_r)
66100{
67   deshoros_state *state = machine.driver_data<deshoros_state>();
68   if(state->m_bank!=new_bank)
69   {
70      UINT8 *ROM = state->memregion("data")->base();
71      UINT32 bankaddress;
101   // d2: mark sensor
102   // d3: motor stop
103   // d4: status
104   // d5: /L-SW
105   // d6: paper
106   // d7: /R-SW
107   return 0xff;
108}
72109
73      state->m_bank = new_bank;
74      bankaddress = 0 + 0x6000 * state->m_bank;
75      state->membank("bank1")->set_base(&ROM[bankaddress]);
76   }
110READ8_MEMBER(destiny_state::display_ready_r)
111{
112   // d7: /display ready
113   // other bits: N/C
114   return 0;
77115}
78116
79READ8_MEMBER(deshoros_state::io_r)
117WRITE8_MEMBER(destiny_state::display_w)
80118{
81   switch(offset)
82   {
83      case 0x00: return 0xff; //printer read
84      case 0x03: return ioport("KEY0" )->read();
85      case 0x04: return ioport("KEY1" )->read();
86      case 0x05: return ioport("SYSTEM" )->read();
87      case 0x0a: return m_io_ram[offset]; //"buzzer" 0 read
88      case 0x0b: return m_io_ram[offset]; //"buzzer" 1 read
89   }
90//  printf("R -> [%02x]\n",offset);
119   /* this is preliminary, just fills a string and doesn't support control codes etc. */
91120
92   return m_io_ram[offset];
121   // scroll the data
122   for (int i = 0; i < 19; i++)
123      m_led_array[i] = m_led_array[i+1];
124
125   // update
126   m_led_array[19] = data;
93127}
94128
95WRITE8_MEMBER(deshoros_state::io_w)
129WRITE8_MEMBER(destiny_state::out_w)
96130{
97   switch(offset)
98   {
99      case 0x00: /*Printer data*/                  return;
100      case 0x02: update_led_array(data);              return;
101      case 0x05: coin_lockout_w(machine(), 0,m_io_ram[offset] & 1);return;
102      case 0x06: /*Printer IRQ enable*/             return;
103//      case 0x0a: "buzzer" 0 write
104//      case 0x0b: "buzzer" 1 write
105      case 0x0c: answer_bankswitch(machine(),data&0x03); return; //data & 0x10 enabled too,dunno if it is worth to shift the data...
106   }
107   m_io_ram[offset] = data;
108//  printf("%02x -> [%02x]\n",data,offset);
131   // d0: coin blocker
132   coin_lockout_w(machine(), 0, ~data & 1);
133
134   // d1: paper cutter 1
135   // d2: paper cutter 2
136   // other bits: N/C?
109137}
110138
111static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, deshoros_state )
139WRITE8_MEMBER(destiny_state::bank_select_w)
140{
141   // d0-d2 and d4: bank (but only up to 4 banks supported)
142   membank("bank1")->set_base(memregion("answers")->base() + 0x6000 * (data & 3));
143}
144
145INPUT_CHANGED_MEMBER(destiny_state::coin_inserted)
146{
147   // NMI on Coin SW or Service SW
148   if (oldval)
149      device_set_input_line(m_maincpu, INPUT_LINE_NMI, ASSERT_LINE);
150
151   // coincounter on coin insert
152   if (((int)(FPTR)param) == 0)
153      coin_counter_w(machine(), 0, newval);
154}
155
156WRITE8_MEMBER(destiny_state::sound_on_w)
157{
158   beep_set_state(machine().device(BEEPER_TAG),1);
159}
160
161WRITE8_MEMBER(destiny_state::sound_off_w)
162{
163   beep_set_state(machine().device(BEEPER_TAG),0);
164}
165
166static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, destiny_state )
112167   AM_RANGE(0x0000, 0x5fff) AM_ROMBANK("bank1")
113168   AM_RANGE(0x8000, 0x87ff) AM_RAM
114   AM_RANGE(0x9000, 0x900f) AM_READWRITE(io_r,io_w) AM_SHARE("io_ram") //i/o area
169   AM_RANGE(0x9000, 0x9000) AM_READWRITE(printer_status_r, firq_ack_w)
170   AM_RANGE(0x9001, 0x9001) AM_READ_PORT("SYSTEM") AM_WRITE(nmi_ack_w)
171   AM_RANGE(0x9002, 0x9002) AM_READWRITE(display_ready_r, display_w)
172   AM_RANGE(0x9003, 0x9003) AM_READ_PORT("KEY1")
173   AM_RANGE(0x9004, 0x9004) AM_READ_PORT("KEY2")
174   AM_RANGE(0x9005, 0x9005) AM_READ_PORT("DIPSW") AM_WRITE(out_w)
175//   AM_RANGE(0x9006, 0x9006) AM_NOP // printer motor on
176//   AM_RANGE(0x9007, 0x9007) AM_NOP // printer data
177   AM_RANGE(0x900a, 0x900a) AM_WRITE(sound_on_w)
178   AM_RANGE(0x900b, 0x900b) AM_WRITE(sound_off_w)
179   AM_RANGE(0x900c, 0x900c) AM_WRITE(bank_select_w)
180//   AM_RANGE(0x900d, 0x900d) AM_NOP // printer motor off
181//   AM_RANGE(0x900e, 0x900e) AM_NOP // printer motor jam reset
115182   AM_RANGE(0xc000, 0xffff) AM_ROM
116183ADDRESS_MAP_END
117184
118185
119static INPUT_PORTS_START( deshoros )
120   PORT_START("KEY0")
121   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("Key Male") PORT_CODE(KEYCODE_SLASH_PAD)
122   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 )  PORT_NAME("Key 3")  PORT_CODE(KEYCODE_3_PAD)
123   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 )  PORT_NAME("Key 2")  PORT_CODE(KEYCODE_2_PAD)
124   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )  PORT_NAME("Key 1")  PORT_CODE(KEYCODE_1_PAD)
125   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("Key Female") PORT_CODE(KEYCODE_ASTERISK)
126   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON6 )  PORT_NAME("Key 6")  PORT_CODE(KEYCODE_6_PAD)
127   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON5 )  PORT_NAME("Key 5")  PORT_CODE(KEYCODE_5_PAD)
128   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 )  PORT_NAME("Key 4")  PORT_CODE(KEYCODE_4_PAD)
186
187/***************************************************************************
188
189  Inputs
190
191***************************************************************************/
192
193static INPUT_PORTS_START( destiny )
129194   PORT_START("KEY1")
130   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Key 0") PORT_CODE(KEYCODE_0_PAD)
131   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON9 )  PORT_NAME("Key 9") PORT_CODE(KEYCODE_9_PAD)
132   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON8 )  PORT_NAME("Key 8") PORT_CODE(KEYCODE_8_PAD)
133   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON7 )  PORT_NAME("Key 7") PORT_CODE(KEYCODE_7_PAD)
134   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("Key Enter") PORT_CODE(KEYCODE_ENTER_PAD)
135   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
136   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("Key Cancel") PORT_CODE(KEYCODE_PLUS_PAD)
137   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
195   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key Male") PORT_CODE(KEYCODE_SLASH_PAD)
196   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 3") PORT_CODE(KEYCODE_3_PAD)
197   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 2") PORT_CODE(KEYCODE_2_PAD)
198   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 1") PORT_CODE(KEYCODE_1_PAD)
199   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key Female") PORT_CODE(KEYCODE_ASTERISK)
200   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 6") PORT_CODE(KEYCODE_6_PAD)
201   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 5") PORT_CODE(KEYCODE_5_PAD)
202   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 4") PORT_CODE(KEYCODE_4_PAD)
138203
139   PORT_START("SYSTEM")
140   PORT_DIPNAME( 0x01,   0x00, DEF_STR( Unknown ) )
204   PORT_START("KEY2")
205   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 0") PORT_CODE(KEYCODE_0_PAD)
206   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 9") PORT_CODE(KEYCODE_9_PAD)
207   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 8") PORT_CODE(KEYCODE_8_PAD)
208   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key 7") PORT_CODE(KEYCODE_7_PAD)
209   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key Enter") PORT_CODE(KEYCODE_ENTER_PAD)
210   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Key Clear") PORT_CODE(KEYCODE_PLUS_PAD)
211
212   PORT_START("DIPSW")
213   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:1")
214   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
215   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
216   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x00, "SW1:2" )
217   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW1:3" )
218   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x00, "SW1:4" )
219   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x00, "SW1:5" )
220   PORT_DIPNAME( 0x20,   0x00, "Force Start" )         PORT_DIPLOCATION("SW1:6")
141221   PORT_DIPSETTING(      0x00, DEF_STR( Off ) )
142   PORT_DIPSETTING(      0x01, DEF_STR( On ) )
143   PORT_DIPNAME( 0x02,   0x00, DEF_STR( Unknown ) )
144   PORT_DIPSETTING(      0x00, DEF_STR( Off ) )
145   PORT_DIPSETTING(      0x02, DEF_STR( On ) )
146   PORT_DIPNAME( 0x04,   0x00, DEF_STR( Unknown ) )
147   PORT_DIPSETTING(      0x00, DEF_STR( Off ) )
148   PORT_DIPSETTING(      0x04, DEF_STR( On ) )
149   PORT_DIPNAME( 0x08,   0x00, DEF_STR( Unknown ) )
150   PORT_DIPSETTING(      0x00, DEF_STR( Off ) )
151   PORT_DIPSETTING(      0x08, DEF_STR( On ) )
152   PORT_DIPNAME( 0x10,   0x00, DEF_STR( Unknown ) )
153   PORT_DIPSETTING(      0x00, DEF_STR( Off ) )
154   PORT_DIPSETTING(      0x10, DEF_STR( On ) )
155   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 )
156   PORT_DIPNAME( 0xc0,   0x00, "Operation Mode" )
222   PORT_DIPSETTING(      0x20, DEF_STR( On ) )
223   PORT_DIPNAME( 0xc0,   0x00, "Operation Mode" )      PORT_DIPLOCATION("SW1:7,8")
157224   PORT_DIPSETTING(      0x00, "Normal Mode" )
225//   PORT_DIPSETTING(      0x40, "Normal Mode" ) // dupe
158226   PORT_DIPSETTING(      0x80, "Test Mode" )
159227   PORT_DIPSETTING(      0xc0, "I/O Test" )
160   //                    0x40, Normal Mode again
228
229   PORT_START("SYSTEM")
230   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE4 ) PORT_NAME("Paper Cutter Reset")
231   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE3 ) PORT_NAME("Paper Cutter Set")
232   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("Paper Cutter Point")
233   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Spear") // starts game
234   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
235   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
236   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
237   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, destiny_state, coin_inserted, (void *)0)
238
239   PORT_START("SERVICE")
240   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CHANGED_MEMBER(DEVICE_SELF, destiny_state, coin_inserted, (void *)1)
161241INPUT_PORTS_END
162242
163/*Is it there an IRQ mask?*/
164static INTERRUPT_GEN( deshoros_irq )
243
244
245/***************************************************************************
246
247  Machine Config(s)
248
249***************************************************************************/
250
251void destiny_state::machine_start()
165252{
166   cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, HOLD_LINE);
253   beep_set_frequency(machine().device(BEEPER_TAG),800); // TODO: determine exact frequency thru schematics
254   beep_set_state(machine().device(BEEPER_TAG),0);
167255}
168256
169static MACHINE_RESET( deshoros )
257void destiny_state::machine_reset()
170258{
171   deshoros_state *state = machine.driver_data<deshoros_state>();
172   state->m_bank = -1;
259   bank_select_w(*m_maincpu->memory().space(AS_PROGRAM), 0, 0);
173260}
174261
175static MACHINE_CONFIG_START( deshoros, deshoros_state )
262static MACHINE_CONFIG_START( destiny, destiny_state )
176263
177264   /* basic machine hardware */
178   MCFG_CPU_ADD("maincpu",M6809,2000000)
265   MCFG_CPU_ADD("maincpu", M6809, XTAL_4MHz/2)
179266   MCFG_CPU_PROGRAM_MAP(main_map)
180   MCFG_CPU_VBLANK_INT("screen",deshoros_irq)
267   MCFG_CPU_PERIODIC_INT(irq0_line_hold, 60) // timer irq controls update speed, frequency needs to be determined yet (2MHz through three 74LS390)
181268
182   MCFG_MACHINE_RESET(deshoros)
183
184   /* video hardware */
269   /* video hardware (dummy) */
185270   MCFG_SCREEN_ADD("screen", RASTER)
186271   MCFG_SCREEN_REFRESH_RATE(60)
187272   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
188273   MCFG_SCREEN_SIZE(48*8, 16*8)
189274   MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0*8, 16*8-1)
190   MCFG_SCREEN_UPDATE_STATIC(deshoros)
275   MCFG_SCREEN_UPDATE_STATIC(destiny)
191276   MCFG_PALETTE_LENGTH(16)
192277
193   MCFG_VIDEO_START(deshoros)
278   MCFG_VIDEO_START(destiny)
194279
195280   /* sound hardware */
196281   MCFG_SPEAKER_STANDARD_MONO("mono")
197
282   MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0)
283   MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50)
198284MACHINE_CONFIG_END
199285
286
287
200288/***************************************************************************
201289
202290  Game driver(s)
203291
204292***************************************************************************/
205293
206ROM_START( deshoros )
294ROM_START( destiny )
207295   ROM_REGION( 0x10000, "maincpu", 0 )
208   ROM_LOAD( "ag12-4",   0xc000, 0x2000, CRC(03b2c850) SHA1(4e2c49a8d80bc559d0f406caddddb85bc107aac0) )
209   ROM_LOAD( "ag13-4",   0xe000, 0x2000, CRC(36959ef6) SHA1(9b3ed44416fcda6a8e89d11ad6e713abd4f63d83) )
296   ROM_LOAD( "ag12-4.16c", 0xc000, 0x2000, CRC(03b2c850) SHA1(4e2c49a8d80bc559d0f406caddddb85bc107aac0) )
297   ROM_LOAD( "ag13-4.17c", 0xe000, 0x2000, CRC(36959ef6) SHA1(9b3ed44416fcda6a8e89d11ad6e713abd4f63d83) )
210298
211   ROM_REGION( 0x18000, "data", 0 ) //answers data
212   ROM_LOAD( "ag00",   0x00000, 0x2000, CRC(77f5bce0) SHA1(20b5257710c5e848893fec107f0d87a473a4ba24) )
213   ROM_LOAD( "ag01",   0x02000, 0x2000, CRC(c08e6a74) SHA1(88679ed8bd2b6b8698258baddf8433c0f60a1b64) )
214   ROM_LOAD( "ag02",   0x04000, 0x2000, CRC(687c72b5) SHA1(3f2768c9b6247e96d11b4159f6f5c0dfeb2c5075) )
215   ROM_LOAD( "ag03",   0x06000, 0x2000, CRC(535dbe83) SHA1(29336539c57d1fa7d42a0ce01884b29e1707e9ad) )
216   ROM_LOAD( "ag04",   0x08000, 0x2000, CRC(e6ae8eb7) SHA1(d0e20e438dcfeac9d844d1fd98701a443ea5e4f7) )
217   ROM_LOAD( "ag05",   0x0a000, 0x2000, CRC(c2485e40) SHA1(03f6d7c63a45d430a7965e28aaf07e053ecac7a1) )
218   ROM_LOAD( "ag06",   0x0c000, 0x2000, CRC(e6e0bbd1) SHA1(fe693d038b05ae18a3c0cfb25a4649dbb10ab2c7) )
219   ROM_LOAD( "ag07",   0x0e000, 0x2000, CRC(a62d879d) SHA1(94d07e774df4c9e4e34ae386714372b53b255530) )
220   ROM_LOAD( "ag08",   0x10000, 0x2000, CRC(f5822738) SHA1(afe53e875057317033cdd5f4b7614c96cd11193b) )
221   ROM_LOAD( "ag09",   0x12000, 0x2000, CRC(ad3c9f2c) SHA1(f665efb65c072a3d3d2e19844ebe0b352c0251d3) )
222   ROM_LOAD( "ag10",   0x14000, 0x2000, CRC(c498754a) SHA1(90e215e8e41d32237d1f4b074d93e20eade92e4e) )
223   ROM_LOAD( "ag11",   0x16000, 0x2000, CRC(5f7bf9f9) SHA1(281f89c0bccfcc2bdc1d4d0a5b9cc9a8ab2e7869) )
299   ROM_REGION( 0x18000, "answers", 0 )
300   ROM_LOAD( "ag00.1a",   0x00000, 0x2000, CRC(77f5bce0) SHA1(20b5257710c5e848893fec107f0d87a473a4ba24) )
301   ROM_LOAD( "ag01.3a",   0x02000, 0x2000, CRC(c08e6a74) SHA1(88679ed8bd2b6b8698258baddf8433c0f60a1b64) )
302   ROM_LOAD( "ag02.4a",   0x04000, 0x2000, CRC(687c72b5) SHA1(3f2768c9b6247e96d11b4159f6f5c0dfeb2c5075) )
303   ROM_LOAD( "ag03.6a",   0x06000, 0x2000, CRC(535dbe83) SHA1(29336539c57d1fa7d42a0ce01884b29e1707e9ad) )
304   ROM_LOAD( "ag04.7a",   0x08000, 0x2000, CRC(e6ae8eb7) SHA1(d0e20e438dcfeac9d844d1fd98701a443ea5e4f7) )
305   ROM_LOAD( "ag05.9a",   0x0a000, 0x2000, CRC(c2485e40) SHA1(03f6d7c63a45d430a7965e28aaf07e053ecac7a1) )
306   ROM_LOAD( "ag06.10a",  0x0c000, 0x2000, CRC(e6e0bbd1) SHA1(fe693d038b05ae18a3c0cfb25a4649dbb10ab2c7) )
307   ROM_LOAD( "ag07.12a",  0x0e000, 0x2000, CRC(a62d879d) SHA1(94d07e774df4c9e4e34ae386714372b53b255530) )
308   ROM_LOAD( "ag08.13a",  0x10000, 0x2000, CRC(f5822738) SHA1(afe53e875057317033cdd5f4b7614c96cd11193b) )
309   ROM_LOAD( "ag09.15a",  0x12000, 0x2000, CRC(ad3c9f2c) SHA1(f665efb65c072a3d3d2e19844ebe0b352c0251d3) )
310   ROM_LOAD( "ag10.16a",  0x14000, 0x2000, CRC(c498754a) SHA1(90e215e8e41d32237d1f4b074d93e20eade92e4e) )
311   ROM_LOAD( "ag11.18a",  0x16000, 0x2000, CRC(5f7bf9f9) SHA1(281f89c0bccfcc2bdc1d4d0a5b9cc9a8ab2e7869) )
224312ROM_END
225313
226GAME( 1983, deshoros,  0,       deshoros,  deshoros,  0, ROT0, "Data East Corporation", "Destiny Horoscope", GAME_NO_SOUND | GAME_NOT_WORKING )
314GAME( 1983, destiny,  0,       destiny,  destiny,  0, ROT0, "Data East Corporation", "Destiny - The Fortuneteller (USA)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
src/mame/drivers/segas32.c
r15435r15436
23292329 **************************************************************************************************************************
23302330 **************************************************************************************************************************
23312331    Air Rescue
2332    Sega Game ID codes:
2333       Game BD: 833-8508-01 AIR RESCUE (US)
2334                833-8508-02 AIR RESCUE (Export)
2335                833-8508-03 AIR RESCUE (Japan)
2336    Rom PCB No: 834-8526-01 (US)
2337                834-8526-02 (Export)
2338                834-8526-03 (Japan)
2339
2340Japan set not dumped, but program roms are EPR-14515.ic13 & EPR-14514.ic6
2341
23322342    requires 2 linked system32 pcbs
23332343    requires additional math DSP to be emulated
23342344*/
r15435r15436
26112621       are suspicious, the changes are very similar but the part numbers haven't changed.  We really
26122622       need a 3rd board to verify */
26132623   ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
2614   ROM_LOAD16_BYTE( "mpr-14599f.ic14", 0x000000, 0x200000, CRC(1de17e83) SHA1(04ee14b863f93b42a5bd1b6da71cff54ef11d4b7) )
2615   ROM_LOAD16_BYTE( "mpr-14598f.ic5",  0x000001, 0x200000, CRC(cafb0de9) SHA1(94c6bfc7a4081dee373e9466a7b6f80889696087) )
2624   ROM_LOAD16_BYTE( "mpr-14599f.ic14", 0x000000, 0x200000, CRC(1de17e83) SHA1(04ee14b863f93b42a5bd1b6da71cff54ef11d4b7) ) /* Rom # matches tile rom # from Arabian Fight ??? */
2625   ROM_LOAD16_BYTE( "mpr-14598f.ic5",  0x000001, 0x200000, CRC(cafb0de9) SHA1(94c6bfc7a4081dee373e9466a7b6f80889696087) ) /* Rom # matchrs tile rom # from Arabian Fight ??? */
26162626
26172627   ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
26182628   ROMX_LOAD( "brivalj_mp15637.32", 0x000000, 0x200000, CRC(f39844c0) SHA1(c48dc8cccdd9d3756cf99a983c6a89ed43fcda22) , ROM_SKIP(6)|ROM_GROUPWORD )
r15435r15436
27272737    to display the title screen this will require 2 linked system32 boards to be emulated
27282738
27292739    Sega Game ID codes:
2730     GAME BD NO. 833-8389-01 (USA)
2731                 833-8389-02 (World)
2732                 833-8389-03 (Japan)
2740     GAME BD NO. 833-8389-01 EXHAUST NOTE (USA)
2741                 833-8389-02 EXHAUST NOTE (World)
2742                 833-8389-03 EXHAUST NOTE (Japan)
27332743         ROM BD. 834-8439-01 (USA)
27342744                 834-8439-02 (World)
27352745                 834-8439-03 (Japan)
r15435r15436
32213231    not protected
32223232
32233233    Sega Game ID codes:
3224    GAME BD NO. 833-7738-01 (USA)
3225                833-7738-02 (Export)
3234    GAME BD NO. 833-7738-01 RAD MOBILE (USA)
3235                833-7738-02 RAD MOBILE (Export)
3236                833-7738-03 RAD MOBILE (Japan)
32263237        ROM BD. 834-7739-01 (USA)
32273238                834-7739-02 (Export)
3239                834-7739-03 (Japan)
32283240      MAIN BD. 837-7428
32293241    A/D BD NO. 837-7536
32303242
r15435r15436
32373249        EPR-13694.ic37 (not dumped)
32383250        EPR-13695.ic38 (not dumped)
32393251
3240    Japanese version is undumped. There is likely a Japanese specific sound rom at IC20
3252    Japanese version is undumped. There is likely a Japanese specific sound rom at IC20 (EPR-13524.ic20 ??)
32413253*/
32423254ROM_START( radm )
32433255   ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
r15435r15436
38393851    Title Fight (Multi-32)
38403852    not protected
38413853
3842    GAME BOARD NO. 834-9324-02
3843     1. ROM BD NO. 834-9413-02
3844     2. MAIN BD NO. 837-8676 (SYSTEM MULTI 32)
3854    Sega Game ID codes:
3855     Game: 834-9324-01 TITLE FIGHT (USA)
3856           834-9324-02 TITLE FIGHT (Export)
3857           834-9324-03 TITLE FIGHT (Japan)
3858Rom board: 834-9413-01 (USA)
3859           834-9413-02 (Export)
3860           834-9413-03 (Japan)
3861  Main BD: 837-8676 (SYSTEM MULTI 32)
3862
38453863*/
38463864ROM_START( titlef )
38473865   ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
r15435r15436
38723890/**************************************************************************************************************************
38733891    Title Fight (US)
38743892    not protected
3875
3876    GAME BOARD NO. 834-9324-01
3877     1. ROM BD NO. 834-9413-01
3878     2. MAIN BD NO. 837-8676 (SYSTEM MULTI 32)
38793893*/
38803894ROM_START( titlefu )
38813895   ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
src/mame/drivers/bzone.c
r15435r15436
2020    0c00      IN2
2121
2222    1200      Vector generator start (write)
23    1400
23    1400      Watchdog Clear
2424    1600      Vector generator reset (write)
2525
2626    1800      Mathbox Status register
r15435r15436
3030    1828      Control inputs
3131    1860-187f Mathbox RAM
3232
33    2000-2fff Vector generator RAM
34    3000-37ff Vector Generator ROM
35    5000-7fff ROM
33    2000-27ff Vector generator RAM (2K)
34    2800-2fff Vector generator RAM / Vector ROM (2K)
35    3000-37ff Vector Generator ROM (4K)
36    5000-5fff Program ROM (4K)
37    6000-7fff Program ROM (8K)
3638
3739    Battlezone settings:
3840
r15435r15436
9092
9193    Red Baron memory map (preliminary)
9294
93    0000-04ff RAM
95    0000-03ff RAM (1K)
9496    0800      COIN_IN
9597    0a00      IN1
9698    0c00      IN2
9799
100    1000      Coin Counter
98101    1200      Vector generator start (write)
99    1400
102    1400      Watchdog Clear
100103    1600      Vector generator reset (write)
101104
102105    1800      Mathbox Status register
r15435r15436
108111    1818      Joystick inputs
109112    1860-187f Mathbox RAM
110113
111    2000-2fff Vector generator RAM
112    3000-37ff Vector generator ROM
113    5000-7fff ROM
114    2000-27ff Vector generator RAM (2K)
115    2800-2fff Vector generator RAM / Vector ROM (2K)
116    3000-37ff Vector generator ROM (4K)
117    4800-7fff Program ROM (14K)
114118
115119    RED BARON DIP SWITCH SETTINGS
116120    Donated by Dana Colbert
r15435r15436
189193                                                        _____________________
190194    All 3 mechs same denomination                       | On | On |    |    |
191195    Left and Center same, right different denomination  | On |Off |    |    |
192    Right and Center same, left differnnt denomination  |Off | On |    |    |
196    Right and Center same, left different denomination  |Off | On |    |    |
193197    All different denominations                         |Off |Off |    |    |
194198                                                        ---------------------
195199
r15435r15436
321325   AM_RANGE(0x0800, 0x0800) AM_READ_PORT("IN0")
322326   AM_RANGE(0x0a00, 0x0a00) AM_READ_PORT("DSW0")
323327   AM_RANGE(0x0c00, 0x0c00) AM_READ_PORT("DSW1")
324   AM_RANGE(0x1000, 0x1000) AM_WRITENOP      /* coin out */
328   AM_RANGE(0x1000, 0x1000) AM_WRITENOP      /* coin out - Manual states this is "Coin Counter" */
325329   AM_RANGE(0x1200, 0x1200) AM_WRITE_LEGACY(avgdvg_go_w)
326330   AM_RANGE(0x1400, 0x1400) AM_WRITE(watchdog_reset_w)
327331   AM_RANGE(0x1600, 0x1600) AM_WRITE_LEGACY(avgdvg_reset_w)
r15435r15436
616620 *
617621 *************************************/
618622
619ROM_START( bzone )
623/* Battle Zone
624
625For the Analog Vec Gen A035742 PCB:
626
627The -01 revision uses PROMs, -02 uses ROMs
628
629Rom Component Equivalents & Locations:
630
631-01 P.C. Boards     -02 P.C. Boards
632---------------------------------------
633036415-01 (A3)
634                    036421-01 (A3)
635036418-01 (E3)
636
637
638036416-01 (B/C3)
639                    036422-01 (B/C3)
640036419-01 (F/H3)
641
642*/
643
644ROM_START( bzone ) /* Analog Vec Gen A035742-02 */
620645   ROM_REGION( 0x8000, "maincpu", 0 )
621   ROM_LOAD( "036414-01.e1",  0x5000, 0x0800, CRC(efbc3fa0) SHA1(6d284fab34b09dde8aa0df7088711d4723f07970) )
646   ROM_LOAD( "036414-02.e1",  0x5000, 0x0800, CRC(13de36d5) SHA1(40e356ddc5c042bc1ce0b71f51e8b6de72daf1e4) )
622647   ROM_LOAD( "036413-01.h1",  0x5800, 0x0800, CRC(5d9d9111) SHA1(42638cff53a9791a0f18d316f62a0ea8eea4e194) )
623648   ROM_LOAD( "036412-01.j1",  0x6000, 0x0800, CRC(ab55cbd2) SHA1(6bbb8316d9f8588ea0893932f9174788292b8edc) )
624649   ROM_LOAD( "036411-01.k1",  0x6800, 0x0800, CRC(ad281297) SHA1(54c5e06b2e69eb731a6c9b1704e4340f493e7ea5) )
r15435r15436
646671ROM_END
647672
648673
649ROM_START( bzone2 )
674ROM_START( bzonea ) /* Analog Vec Gen A035742-02 */
650675   ROM_REGION( 0x8000, "maincpu", 0 )
651   ROM_LOAD( "036414-02.e1", 0x5000, 0x0800, CRC(13de36d5) SHA1(40e356ddc5c042bc1ce0b71f51e8b6de72daf1e4) )
676   ROM_LOAD( "036414-01.e1", 0x5000, 0x0800, CRC(efbc3fa0) SHA1(6d284fab34b09dde8aa0df7088711d4723f07970) )
652677   ROM_LOAD( "036413-01.h1",  0x5800, 0x0800, CRC(5d9d9111) SHA1(42638cff53a9791a0f18d316f62a0ea8eea4e194) )
653678   ROM_LOAD( "036412-01.j1",  0x6000, 0x0800, CRC(ab55cbd2) SHA1(6bbb8316d9f8588ea0893932f9174788292b8edc) )
654679   ROM_LOAD( "036411-01.k1",  0x6800, 0x0800, CRC(ad281297) SHA1(54c5e06b2e69eb731a6c9b1704e4340f493e7ea5) )
r15435r15436
739764ROM_END
740765
741766
742ROM_START( redbaron )
767/* Red Barron
768
769For the Analog Vec Gen A035742 PCB:
770
771The -01 revision uses PROMs, -02 uses ROMs
772
773Rom Component Equivalents & Locations:
774
775-01 P.C. Boards     -02 P.C. Boards
776---------------------------------------
777037005-01 (A3)
778                    037007-01 (A3)
779037003-01 (E3)
780
781
782037004-01 (B/C3)
783                    037006-01 (B/C3)
784037002-01 (F/H3)
785
786Program rom locations as same as redbarona listed below
787*/
788         
789
790ROM_START( redbaron ) /* Analog Vec Gen A035742-02 Rev. C+ */
743791   ROM_REGION( 0x8000, "maincpu", 0 )
744   ROM_LOAD( "037587.01",  0x4800, 0x0800, CRC(60f23983) SHA1(7a9e5380bf49bf50a2d8ab0e0bd1ba3ac8efde24) )
745   ROM_CONTINUE(           0x5800, 0x0800 )
746   ROM_LOAD( "037000.01e", 0x5000, 0x0800, CRC(69bed808) SHA1(27d99efc74113cdcbbf021734b8a5a5fdb78c04c) )
747   ROM_LOAD( "036998.01e", 0x6000, 0x0800, CRC(d1104dd7) SHA1(0eab47cb45ede9dcc4dd7498dcf3a8d8194460b4) )
748   ROM_LOAD( "036997.01e", 0x6800, 0x0800, CRC(7434acb4) SHA1(c950c4c12ab556b5051ad356ab4a0ed6b779ba1f) )
749   ROM_LOAD( "036996.01e", 0x7000, 0x0800, CRC(c0e7589e) SHA1(c1aedc95966afffd860d7e0009d5a43e8b292036) )
750   ROM_LOAD( "036995.01e", 0x7800, 0x0800, CRC(ad81d1da) SHA1(8bd66e5f34fc1c75f31eb6b168607e52aa3aa4df) )
792   ROM_LOAD( "037587-01.fh1", 0x4800, 0x0800, CRC(60f23983) SHA1(7a9e5380bf49bf50a2d8ab0e0bd1ba3ac8efde24) ) /* == 037001-1E + 036999-1E */
793   ROM_CONTINUE(              0x5800, 0x0800 )
794   ROM_LOAD( "037000-01.e1",  0x5000, 0x0800, CRC(69bed808) SHA1(27d99efc74113cdcbbf021734b8a5a5fdb78c04c) )
795   ROM_LOAD( "036998-01.j1",  0x6000, 0x0800, CRC(d1104dd7) SHA1(0eab47cb45ede9dcc4dd7498dcf3a8d8194460b4) )
796   ROM_LOAD( "036997-01.k1",  0x6800, 0x0800, CRC(7434acb4) SHA1(c950c4c12ab556b5051ad356ab4a0ed6b779ba1f) )
797   ROM_LOAD( "036996-01.lm1", 0x7000, 0x0800, CRC(c0e7589e) SHA1(c1aedc95966afffd860d7e0009d5a43e8b292036) )
798   ROM_LOAD( "036995-01.n1",  0x7800, 0x0800, CRC(ad81d1da) SHA1(8bd66e5f34fc1c75f31eb6b168607e52aa3aa4df) )
751799   /* Vector Generator ROMs */
752   ROM_LOAD( "037006.01e", 0x3000, 0x0800, CRC(9fcffea0) SHA1(69b76655ee75742fcaa0f39a4a1cf3aa58088343) )
753   ROM_LOAD( "037007.01e", 0x3800, 0x0800, CRC(60250ede) SHA1(9c48952bd69863bee0c6dce09f3613149e0151ef) )
800   ROM_LOAD( "037006-01.bc3", 0x3000, 0x0800, CRC(9fcffea0) SHA1(69b76655ee75742fcaa0f39a4a1cf3aa58088343) )
801   ROM_LOAD( "037007-01.a3",  0x3800, 0x0800, CRC(60250ede) SHA1(9c48952bd69863bee0c6dce09f3613149e0151ef) )
754802
755803   /* AVG PROM */
756804   ROM_REGION( 0x100, "user1", 0 )
757   ROM_LOAD( "036408-01.k7",   0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) ) /* 74S287N or compatible bprom */
805   ROM_LOAD( "036408-01.k7", 0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) ) /* 74S287N or compatible bprom like the 82S129 */
758806
759807   /* Mathbox PROMs */
760808   ROM_REGION( 0x20, "user2", 0 )
761   ROM_LOAD( "036174.01",    0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) )
809   ROM_LOAD( "036174-01.a1", 0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) ) /* 74S288 or compatible bprom like the 82S123 */
762810
763811   ROM_REGION32_BE( 0x400, "user3", 0 )
764   ROMX_LOAD( "036175.01", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
765   ROMX_LOAD( "036176.01", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
766   ROMX_LOAD( "036177.01", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
767   ROMX_LOAD( "036178.01", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
768   ROMX_LOAD( "036179.01", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
769   ROMX_LOAD( "036180.01", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
812   ROMX_LOAD( "036175-01.e1", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
813   ROMX_LOAD( "036176-01.f1", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
814   ROMX_LOAD( "036177-01.h1", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
815   ROMX_LOAD( "036178-01.j1", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
816   ROMX_LOAD( "036179-01.k1", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
817   ROMX_LOAD( "036180-01.l1", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
818
819   /* Address decoding PROM (located on the AUX PCB) - currently not used */
820   ROM_REGION( 0x20, "prom", 0 )
821   ROM_LOAD( "036464-01.a5", 0x0000, 0x0020, CRC(42875b18) SHA1(10ba29f3c8c8e581eb275a85574c746272ebb865) ) /* 74S288 or compatible bprom like the 82S123 */
770822ROM_END
771823
824ROM_START( redbarona ) /* Analog Vec Gen A035742-02 */
825   ROM_REGION( 0x8000, "maincpu", 0 )
826   ROM_LOAD( "037001-01e.e1",  0x4800, 0x0800, CRC(b9486a6a) SHA1(76cf42569c4ef0a2ad7171e3c766c1a815a62a0e) )
827   ROM_LOAD( "037000-01e.fh1", 0x5000, 0x0800, CRC(69bed808) SHA1(27d99efc74113cdcbbf021734b8a5a5fdb78c04c) )
828   ROM_LOAD( "036999-01e.j1",  0x5800, 0x0800, CRC(48d49819) SHA1(caf1521ae7bbf3afa91069dae62201748b482a50) )
829   ROM_LOAD( "036998-01e.k1",  0x6000, 0x0800, CRC(d1104dd7) SHA1(0eab47cb45ede9dcc4dd7498dcf3a8d8194460b4) )
830   ROM_LOAD( "036997-01e.lm1", 0x6800, 0x0800, CRC(7434acb4) SHA1(c950c4c12ab556b5051ad356ab4a0ed6b779ba1f) )
831   ROM_LOAD( "036996-01e.n1",  0x7000, 0x0800, CRC(c0e7589e) SHA1(c1aedc95966afffd860d7e0009d5a43e8b292036) )
832   ROM_LOAD( "036995-01e.p1",  0x7800, 0x0800, CRC(ad81d1da) SHA1(8bd66e5f34fc1c75f31eb6b168607e52aa3aa4df) )
833   /* Vector Generator ROMs */
834   ROM_LOAD( "037006-01e.bc3", 0x3000, 0x0800, CRC(9fcffea0) SHA1(69b76655ee75742fcaa0f39a4a1cf3aa58088343) )
835   ROM_LOAD( "037007-01e.a3",  0x3800, 0x0800, CRC(60250ede) SHA1(9c48952bd69863bee0c6dce09f3613149e0151ef) )
772836
837   /* AVG PROM */
838   ROM_REGION( 0x100, "user1", 0 )
839   ROM_LOAD( "036408-01.k7", 0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) ) /* 74S287N or compatible bprom like the 82S129 */
773840
841   /* Mathbox PROMs */
842   ROM_REGION( 0x20, "user2", 0 )
843   ROM_LOAD( "036174-01.a1", 0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) ) /* 74S288 or compatible bprom like the 82S123 */
844
845   ROM_REGION32_BE( 0x400, "user3", 0 )
846   ROMX_LOAD( "036175-01.e1", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
847   ROMX_LOAD( "036176-01.f1", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
848   ROMX_LOAD( "036177-01.h1", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
849   ROMX_LOAD( "036178-01.j1", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
850   ROMX_LOAD( "036179-01.k1", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
851   ROMX_LOAD( "036180-01.l1", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
852
853   /* Address decoding PROM (located on the AUX PCB) - currently not used */
854   ROM_REGION( 0x20, "prom", 0 )
855   ROM_LOAD( "036464-01.a5", 0x0000, 0x0020, CRC(42875b18) SHA1(10ba29f3c8c8e581eb275a85574c746272ebb865) ) /* 74S288 or compatible bprom like the 82S123 */
856ROM_END
857
858
859
774860/*************************************
775861 *
776862 *  Driver initialization
r15435r15436
811897 *
812898 *************************************/
813899
814GAMEL(1980, bzone,    0,     bzone,    bzone,    0,       ROT0, "Atari", "Battle Zone (set 1)", GAME_SUPPORTS_SAVE, layout_bzone )
815GAMEL(1980, bzone2,   bzone, bzone,    bzone,    0,       ROT0, "Atari", "Battle Zone (set 2)", GAME_SUPPORTS_SAVE, layout_bzone )
816GAMEL(1980, bzonec,   bzone, bzone,    bzone,    0,       ROT0, "Atari", "Battle Zone (cocktail)", GAME_SUPPORTS_SAVE|GAME_NO_COCKTAIL, layout_bzone )
817GAME( 1980, bradley,  0,     bzone,    bradley,  bradley, ROT0, "Atari", "Bradley Trainer", GAME_SUPPORTS_SAVE )
818GAMEL(1980, redbaron, 0,     redbaron, redbaron, 0,       ROT0, "Atari", "Red Baron", GAME_SUPPORTS_SAVE, layout_ho88ffff )
900GAMEL(1980, bzone,     0,        bzone,    bzone,    0,       ROT0, "Atari", "Battle Zone (rev 2)", GAME_SUPPORTS_SAVE, layout_bzone )
901GAMEL(1980, bzonea,    bzone,    bzone,    bzone,    0,       ROT0, "Atari", "Battle Zone (rev 1)", GAME_SUPPORTS_SAVE, layout_bzone )
902GAMEL(1980, bzonec,    bzone,    bzone,    bzone,    0,       ROT0, "Atari", "Battle Zone (cocktail)", GAME_SUPPORTS_SAVE|GAME_NO_COCKTAIL, layout_bzone )
903GAME( 1980, bradley,   0,        bzone,    bradley,  bradley, ROT0, "Atari", "Bradley Trainer", GAME_SUPPORTS_SAVE )
904GAMEL(1980, redbaron,  0,        redbaron, redbaron, 0,       ROT0, "Atari", "Red Baron (Revised Hardware)", GAME_SUPPORTS_SAVE, layout_ho88ffff )
905GAMEL(1980, redbarona, redbaron, redbaron, redbaron, 0,       ROT0, "Atari", "Red Baron", GAME_SUPPORTS_SAVE, layout_ho88ffff )
src/mame/drivers/model3.c
r15435r15436
25992599   ROM_FILL( 0x000000, 0x80000, 0 )
26002600ROM_END
26012601
2602ROM_START( vf3a )   /* step 1.0 */
2602ROM_START( vf3a )   /* step 1.0, Sega game ID# is 833-12712, ROM board ID# 834-12821 */
26032603   ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
26042604   // CROM
26052605   ROM_LOAD64_WORD_SWAP( "epr19227a.17",  0x600006, 0x080000, CRC(7139931a) SHA1(57eec80361726143017b1adbfaafbeef0bc4109d) )
r15435r15436
42014201   ROM_LOAD( "epr-20985.bin", 0x000000, 0x010000, CRC(b139481d) SHA1(05fca7db7c8b084c53bd157ba3e8296f1a961a99) )
42024202ROM_END
42034203
4204ROM_START( dayto2pe )   /* Step 2.1, ROM board ID# 834-13609, Security board ID# 837-13507-COM */
4204ROM_START( dayto2pe )   /* Step 2.1, Sega game ID# is 833-13610 DAYTONA USA2 SP, ROM board ID# 834-13609 DAYTONA USA2 SP, Security board ID# 837-13645-COM */
42054205   ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
42064206   // CROM
42074207   ROM_LOAD64_WORD_SWAP( "epr-21178.17", 0x000006, 0x200000, CRC(230bf8ac) SHA1(bc64c4f8a794ca59b5c488a34d1b5a2b67af8fec) )
src/mame/drivers/galaxold.c
r15435r15436
914914   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE")
915915ADDRESS_MAP_END
916916
917READ8_MEMBER(galaxold_state::bullsdrtg_data_port_r)
918{
919   switch (cpu_get_pc(&space.device()))
920   {
921      case 0x0083:
922      case 0x008c:
923      case 0x0092:
924      case 0x6b54:
925         return 0;
917926
927      case 0x009b:
928      case 0x6b58:
929         return 1;
930      default:
931         logerror("Reading data port at PC=%04X\n", cpu_get_pc(&space.device()));
932         break;
933   }
934
935    return 0;
936}
937
938static ADDRESS_MAP_START( bullsdrtg_io_map, AS_IO, 8, galaxold_state )
939   AM_RANGE(0x00, 0x00) AM_READNOP
940   AM_RANGE(0x20, 0x3f) AM_WRITE(racknrol_tiles_bank_w) AM_SHARE("racknrol_tbank")
941   AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READ(bullsdrtg_data_port_r) AM_DEVWRITE_LEGACY("snsnd", sn76496_w)
942   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE")
943ADDRESS_MAP_END
944
918945/* Lives Dips are spread across two input ports */
919946CUSTOM_INPUT_MEMBER(galaxold_state::vpool_lives_r)
920947{
r15435r15436
24612488   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
24622489MACHINE_CONFIG_END
24632490
2491static MACHINE_CONFIG_DERIVED( bullsdrtg, hexpoola )
2492   MCFG_CPU_MODIFY("maincpu")
2493   MCFG_CPU_IO_MAP(bullsdrtg_io_map)
2494
2495MACHINE_CONFIG_END
24642496/***************************************************************************
24652497
24662498  Game driver(s)
r15435r15436
31113143   ROM_LOAD( "senko1.bin",   0x0000, 0x0020, CRC(1434c7ff) SHA1(0ee5f5351dd84fbf8d3d8eaafbdbe86dd29960f8) )
31123144ROM_END
31133145
3146
3147/*
3148Bulls Eye Darts conversion by Senko Industries Ltd (1984)
3149
3150The base board for the conversion dates from 1981.
3151
3152Base Board
3153----------
3154There are 2 x Toshiba 2114, 2 x Mitsubushi 2101 and 5 x Intel 2115 making up
3155the video RAM. There are 6 ROM sockets for the video ROM but the daughter card
3156only connects to two of them. I believe that this is a version of
3157Scramble/Galaxians video hardware.
3158
3159There are 4 x Toshiba 2114 that make up the CPU RAM. There are 8 ROM sockets
3160for the CPU ROM. Tha daughter board does not connect to any of them but instead
3161connects into the CPU socket (I'm guessing originally a Z80).
3162
3163Sound is provided at least by an AY-3-8910.
3164
3165Daughter Board
3166--------------
3167The daughter board houses a 2650A CPU and another 40-pin cermet coated uncased
3168device with the number scratched off. There is an 82S153 and an 82S147 hooked
3169into the 2650. Amongst the TTL near the video ROMS is a single 2114.
3170
3171
3172Now the bad news...
3173
3174There are three EPROMS and one PROM on the board. Alas, one of the graphics
3175EPROMS does not verify consistently so I have provided three reads. A quick
3176compare suggest one data line is random :-(
3177*/
3178
3179ROM_START( bullsdrtg )
3180   ROM_REGION( 0x8000, "maincpu", 0 )
3181   ROM_LOAD( "cpu.bin",   0x0000, 0x1000, CRC(db34f130) SHA1(691f8a69a7157df49460f5927728ba52660eeede) )
3182   ROM_CONTINUE(           0x2000, 0x1000 )
3183   ROM_CONTINUE(           0x4000, 0x1000 )
3184   ROM_CONTINUE(           0x6000, 0x1000 )
3185
3186   ROM_REGION( 0x8000, "gfx1", 0 )
3187   ROM_LOAD( "vid_j1.bin",   0x0000, 0x4000, BAD_DUMP CRC(c2ad5c84) SHA1(8e3048607693afc40a775000f45790910e4d9312) )
3188   ROM_LOAD( "vid_p.bin",    0x4000, 0x4000, CRC(535be505) SHA1(c20c7ac4e74e29e8954c443cca9dcc0df453a512) )
3189
3190   ROM_REGION( 0x0020, "proms", 0 )
3191   ROM_LOAD( "prom.bin",   0x0000, 0x0020, CRC(16b19bfa) SHA1(a0e9217f9bc5b06212d5f22dcc3dc4b2838788ba) )
3192ROM_END
3193
31143194/* Z80 games */
31153195GAME( 1980, vpool,    hustler,  mooncrst, vpool,    0,        ROT90,  "bootleg", "Video Pool (bootleg on Moon Cresta hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
31163196GAME( 1981, rockclim, 0,        rockclim, rockclim, 0,         ROT180, "Taito", "Rock Climber", GAME_SUPPORTS_SAVE )
r15435r15436
31383218GAME( 1986, hexpool,  racknrol, racknrol, racknrol, 0,         ROT90,  "Senko Industries (Shinkai Inc. license)", "Hex Pool (Shinkai)", GAME_SUPPORTS_SAVE ) // still has Senko logo in gfx rom
31393219GAME( 1985, hexpoola, racknrol, hexpoola, racknrol, 0,         ROT90,  "Senko Industries", "Hex Pool (Senko)", GAME_SUPPORTS_SAVE )
31403220GAME( 1985, trvchlng, 0,        racknrol, trvchlng, 0,         ROT90,  "Joyland (Senko license)", "Trivia Challenge", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
3221GAME( 1985, bullsdrtg,bullsdrt, bullsdrtg,racknrol, bullsdrtg,ROT90,  "Senko Industries", "Bulls Eye Darts (Galaxian conversion)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS )
src/mame/drivers/dec0.c
r15435r15436
167167#include "sound/3812intf.h"
168168#include "sound/okim6295.h"
169169#include "sound/msm5205.h"
170#include "video/decbac06.h"
171#include "video/decmxc06.h"
172170
173171
174172/******************************************************************************/
r15435r15436
220218}
221219
222220
223WRITE16_MEMBER(automat_state::automat_control_w)
221WRITE16_MEMBER(dec0_automat_state::automat_control_w)
224222{
225223   switch (offset << 1)
226224   {
r15435r15436
426424   dec0_state *state = machine.driver_data<dec0_state>();
427425   address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
428426
429   deco_bac06_device *tilegen1 = (deco_bac06_device*)space->machine().device<deco_bac06_device>("tilegen1");
430   deco_bac06_device *tilegen2 = (deco_bac06_device*)space->machine().device<deco_bac06_device>("tilegen2");
427   deco_bac06_device *tilegen1 = (deco_bac06_device*)state->m_tilegen1;
428   deco_bac06_device *tilegen2 = (deco_bac06_device*)state->m_tilegen2;
431429
432430   space->install_write_handler( 0x240000, 0x24ffff, write16_delegate(FUNC(dec0_state::unmapped_w),state));
433431
r15435r15436
610608   AM_RANGE(0xb08000, 0xb087ff) AM_RAM AM_SHARE("spriteram") /* Sprites */
611609ADDRESS_MAP_END
612610
611/* swizzle the palette writes around so we can use the same gfx plane ordering as the originals */
612READ16_MEMBER( dec0_automat_state::automat_palette_r )
613{
614   offset ^=0xf;
615   return m_generic_paletteram_16[offset];
616}
613617
614static ADDRESS_MAP_START( automat_map, AS_PROGRAM, 16, automat_state )
618WRITE16_MEMBER( dec0_automat_state::automat_palette_w )
619{
620   offset ^=0xf;
621   paletteram_xxxxBBBBGGGGRRRR_word_w(space, offset, data, mem_mask);
622}
623
624
625
626static ADDRESS_MAP_START( automat_map, AS_PROGRAM, 16, dec0_automat_state )
615627   AM_RANGE(0x000000, 0x05ffff) AM_ROM
616628
617629   AM_RANGE(0x240000, 0x240007) AM_RAM         /* text layer */
r15435r15436
619631   AM_RANGE(0x242000, 0x24207f) AM_RAM
620632   AM_RANGE(0x242400, 0x2427ff) AM_RAM
621633   AM_RANGE(0x242800, 0x243fff) AM_RAM
622   AM_RANGE(0x244000, 0x245fff) AM_RAM
634   AM_RANGE(0x244000, 0x245fff) AM_RAM AM_DEVREADWRITE_LEGACY("tilegen1", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
623635
624636   AM_RANGE(0x246000, 0x246007) AM_RAM         /* first tile layer */
625637   AM_RANGE(0x246010, 0x246017) AM_RAM
626638   AM_RANGE(0x248000, 0x24807f) AM_RAM
627639   AM_RANGE(0x248400, 0x2487ff) AM_RAM
628   AM_RANGE(0x24a000, 0x24a7ff) AM_RAM
640   AM_RANGE(0x24a000, 0x24a7ff) AM_RAM AM_DEVREADWRITE_LEGACY("tilegen2", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
629641
630642   AM_RANGE(0x24c000, 0x24c007) AM_RAM         /* second tile layer */
631643   AM_RANGE(0x24c010, 0x24c017) AM_RAM
632644   AM_RANGE(0x24c800, 0x24c87f) AM_RAM
633645   AM_RANGE(0x24cc00, 0x24cfff) AM_RAM
634   AM_RANGE(0x24d000, 0x24d7ff) AM_RAM
646   AM_RANGE(0x24d000, 0x24d7ff) AM_RAM AM_DEVREADWRITE_LEGACY("tilegen3", deco_bac06_pf_data_r, deco_bac06_pf_data_w)
635647
636648   AM_RANGE(0x300000, 0x30001f) AM_READ(dec0_rotary_r)
637649   AM_RANGE(0x30c000, 0x30c00b) AM_READ(dec0_controls_r)
638650   AM_RANGE(0x30c000, 0x30c01f) AM_WRITE(automat_control_w)         /* Priority, sound, etc. */
639   AM_RANGE(0x310000, 0x3107ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_word_w) AM_SHARE("paletteram")
651   AM_RANGE(0x310000, 0x3107ff) AM_READWRITE(automat_palette_r, automat_palette_w) AM_SHARE("paletteram")
640652   AM_RANGE(0x314000, 0x3147ff) AM_RAM
641   AM_RANGE(0x400008, 0x400009) AM_WRITE(dec0_priority_w)            // NEW
653
654   // video regs are moved to here..
655   AM_RANGE(0x400000, 0x400007) AM_WRITE(automat_scroll_w)
656   AM_RANGE(0x400008, 0x400009) AM_WRITE(dec0_priority_w)
657
642658   AM_RANGE(0xff8000, 0xffbfff) AM_RAM AM_SHARE("ram")            /* Main ram */
643659   AM_RANGE(0xffc000, 0xffc7ff) AM_RAM AM_SHARE("spriteram")         /* Sprites */
644660ADDRESS_MAP_END
645661
646WRITE8_MEMBER(automat_state::automat_adpcm_w)
662WRITE8_MEMBER(dec0_automat_state::automat_adpcm_w)
647663{
648664   m_automat_adpcm_byte = data;
649665}
650666
651static ADDRESS_MAP_START( automat_s_map, AS_PROGRAM, 8, automat_state )
667static ADDRESS_MAP_START( automat_s_map, AS_PROGRAM, 8, dec0_automat_state )
652668   AM_RANGE(0xc000, 0xc7ff) AM_RAM
653//  AM_RANGE(0xc800, 0xc800) AM_WRITE_LEGACY(ym2203_control_port_0_w)
654//  AM_RANGE(0xc801, 0xc801) AM_WRITE_LEGACY(ym2203_write_port_0_w)
655   AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r)
656//  AM_RANGE(0xd000, 0xd000) AM_WRITE_LEGACY(ym2203_control_port_1_w)
657//  AM_RANGE(0xd001, 0xd001) AM_WRITE_LEGACY(ym2203_write_port_1_w)
669   AM_RANGE(0xc800, 0xc801) AM_DEVWRITE_LEGACY("2203a", ym2203_w)
670   AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r)   
671   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE_LEGACY("2203b", ym2203_w)
658672   AM_RANGE(0xf000, 0xf000) AM_WRITE(automat_adpcm_w)
659673   AM_RANGE(0x0000, 0xffff) AM_ROM
660674ADDRESS_MAP_END
r15435r15436
11981212   16*16
11991213};
12001214
1201static const gfx_layout automat_tilelayout =
1215static const gfx_layout automat_spritelayout =
12021216{
12031217   16,16,
12041218   RGN_FRAC(1,4),
r15435r15436
12441258   GFXDECODE_ENTRY( "gfx1", 0, charlayout,   0, 16 )   /* Characters 8x8 */
12451259   GFXDECODE_ENTRY( "gfx2", 0, automat_tilelayout3, 512, 16 )   /* Tiles 16x16 */
12461260   GFXDECODE_ENTRY( "gfx3", 0, automat_tilelayout2, 768, 16 )   /* Tiles 16x16 */
1247   GFXDECODE_ENTRY( "gfx4", 0, automat_tilelayout, 256, 16 )   /* Sprites 16x16 */
1261   GFXDECODE_ENTRY( "gfx4", 0, automat_spritelayout, 256, 16 )   /* Sprites 16x16 */
12481262GFXDECODE_END
12491263
12501264static GFXDECODE_START( midres )
r15435r15436
14011415
14021416static void automat_vclk_cb(device_t *device)
14031417{
1404   automat_state *state = device->machine().driver_data<automat_state>();
1418   dec0_automat_state *state = device->machine().driver_data<dec0_automat_state>();
14051419   if (state->m_automat_msm5205_vclk_toggle == 0)
14061420   {
14071421      msm5205_data_w(device, state->m_automat_adpcm_byte & 0xf);
r15435r15436
14221436};
14231437
14241438
1425static MACHINE_CONFIG_START( automat, automat_state )
1439static MACHINE_CONFIG_START( automat, dec0_automat_state )
14261440
14271441   /* basic machine hardware */
14281442   MCFG_CPU_ADD("maincpu", M68000, 10000000)
r15435r15436
14391453   MCFG_SCREEN_RAW_PARAMS(DEC0_PIXEL_CLOCK,DEC0_HTOTAL,DEC0_HBEND,DEC0_HBSTART,DEC0_VTOTAL,DEC0_VBEND,DEC0_VBSTART)
14401454   MCFG_SCREEN_UPDATE_STATIC(automat)
14411455
1456   MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
1457   deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
1458   MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
1459   deco_bac06_device::set_gfx_region_wide(*device, 0,1,0);
1460   MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0)
1461   deco_bac06_device::set_gfx_region_wide(*device, 0,2,0);
1462
1463
14421464   MCFG_PALETTE_LENGTH(1024)
14431465   MCFG_GFXDECODE(automat)
14441466
14451467   /* sound hardware */
14461468   MCFG_SPEAKER_STANDARD_MONO("mono")
14471469
1448   MCFG_SOUND_ADD("ym1", YM2203, 1500000)
1470   MCFG_SOUND_ADD("2203a", YM2203, 1500000)
14491471   MCFG_SOUND_ROUTE(0, "mono", 0.90)
14501472   MCFG_SOUND_ROUTE(1, "mono", 0.90)
14511473   MCFG_SOUND_ROUTE(2, "mono", 0.90)
14521474   MCFG_SOUND_ROUTE(3, "mono", 0.35)
14531475
1454   MCFG_SOUND_ADD("ym2", YM2203, 1500000)
1476   MCFG_SOUND_ADD("2203b", YM2203, 1500000)
14551477   MCFG_SOUND_ROUTE(0, "mono", 0.90)
14561478   MCFG_SOUND_ROUTE(1, "mono", 0.90)
14571479   MCFG_SOUND_ROUTE(2, "mono", 0.90)
r15435r15436
22972319   ROM_LOAD( "12.bin", 0x30000, 0x10000, CRC(00cd0990) SHA1(3fc498fcee2110001e376f5ee38d7dd361bd3ee3) ) // y
22982320
22992321   /* copy out the chars */
2300   ROM_REGION( 0x20000, "gfx1", 0 ) /* chars */
2322   ROM_REGION( 0x20000, "gfx1", ROMREGION_INVERT ) /* chars */
23012323   ROM_COPY( "gfxload1", 0x00000, 0x00000, 0x8000 )
23022324   ROM_COPY( "gfxload1", 0x10000, 0x08000, 0x8000 )
23032325   ROM_COPY( "gfxload1", 0x20000, 0x10000, 0x8000 )
23042326   ROM_COPY( "gfxload1", 0x30000, 0x18000, 0x8000 )
23052327
2306   ROM_REGION( 0x20000, "gfx3", 0 ) /* tiles */
2328   ROM_REGION( 0x20000, "gfx3", ROMREGION_INVERT ) /* tiles */
23072329   ROM_COPY( "gfxload1", 0x08000, 0x00000, 0x8000 )
23082330   ROM_COPY( "gfxload1", 0x18000, 0x08000, 0x8000 )
23092331   ROM_COPY( "gfxload1", 0x28000, 0x10000, 0x8000 )
23102332   ROM_COPY( "gfxload1", 0x38000, 0x18000, 0x8000 )
23112333
23122334   // we have to rearrange this with ROM_CONTINUE due to the way gfxdecode works */
2313   ROM_REGION( 0x40000, "gfx2", 0 ) /* tiles */
2335   ROM_REGION( 0x40000, "gfx2", ROMREGION_INVERT ) /* tiles */
23142336   ROM_LOAD( "9.bin",  0x00000, 0x2000, CRC(ccf91ce0) SHA1(c976eddcea48da6e7fbd28a4d5c48706d61cabfb) )
23152337   ROM_CONTINUE(       0x04000, 0x2000 )
23162338   ROM_CONTINUE(       0x08000, 0x2000 )
r15435r15436
23462368
23472369   // the sprite data is the same as robocop, but with the bits in each byte reversed
23482370   // 21.bin was repaired with this knowledge as the chip was faulty
2349   ROM_REGION( 0x80000, "gfx4", ROMREGION_INVERT) /* sprites */
2371   ROM_REGION( 0x80000, "gfx4", 0) /* sprites */
23502372   ROM_LOAD( "16.bin", 0x00000, 0x10000, CRC(e42e8675) SHA1(5b964477de8278ea330ffc2366e5fc7e10122ef8) )
23512373   ROM_LOAD( "17.bin", 0x10000, 0x08000, CRC(9a414c56) SHA1(017eb5a238e24cd6de50afd029c239993fc61a21) )
23522374   ROM_LOAD( "20.bin", 0x20000, 0x10000, CRC(7c62a2a1) SHA1(43a40355cdcbb17506f9634e8f12673287e79bd7) )
r15435r15436
30213043   ROM_LOAD( "ta-16.21k",          0x0000, 0x0100, CRC(ad26e8d4) SHA1(827337aeb8904429a1c050279240ae38aa6ce064) )   /* Priority (not used) */
30223044ROM_END
30233045
3024// helper function
3025#if 0
3026static void dump_to_file(running_machine& machine, UINT8* ROM, int offset, int size)
3027{
3028   {
3029      FILE *fp;
3030      char filename[256];
3031      sprintf(filename,"%s_%08x_%08x", machine.system().name, offset, size);
3032      fp=fopen(filename, "w+b");
3033      if (fp)
3034      {
3035         fwrite(ROM+offset, size, 1, fp);
3036         fclose(fp);
3037      }
3038   }
3039}
30403046
3041
3042static DRIVER_INIT( convert_robocop_gfx4_to_automat )
3043{
3044   UINT8* R = machine.root_device().memregion("gfx4")->base();
3045   int i;
3046
3047   for (i=0;i<0x80000;i++)
3048   {
3049      R[i] = BITSWAP8(R[i],0,1,2,3,4,5,6,7);
3050   }
3051
3052   dump_to_file(machine,R, 0x00000, 0x10000);
3053   dump_to_file(machine,R, 0x10000, 0x08000);
3054   dump_to_file(machine,R, 0x20000, 0x10000);
3055   dump_to_file(machine,R, 0x30000, 0x08000);
3056   dump_to_file(machine,R, 0x40000, 0x10000);
3057   dump_to_file(machine,R, 0x50000, 0x08000);
3058   dump_to_file(machine,R, 0x60000, 0x10000);
3059   dump_to_file(machine,R, 0x70000, 0x08000);
3060}
3061#endif
3062
30633047static DRIVER_INIT( midresb )
30643048{
30653049   dec0_state *state = machine.driver_data<dec0_state>();
src/mame/drivers/nemesis.c
r15435r15436
262603/27/2009
2727 spthx to Unagi,rassy,hina,nori,Tobikage,Tommy,Crimson,yasuken,cupmen,zoo
2828
29modified by hap
3006/09/2012
31 Special thx 2 Neusneus, Audrey Tautou, my water bottle, chair, sleepyness
32
2933Notes:
3034- blkpnthr:
3135There are sprite priority problems in upper part of the screen ,
r15435r15436
6064      device_set_input_line(device, 1, HOLD_LINE);
6165}
6266
63static TIMER_DEVICE_CALLBACK( konamigt_interrupt )
67static INTERRUPT_GEN( blkpnthr_interrupt )
6468{
65   nemesis_state *state = timer.machine().driver_data<nemesis_state>();
66   int scanline = param;
69   nemesis_state *state = device->machine().driver_data<nemesis_state>();
6770
68   if(scanline == 240)
69   {
70      if ((state->m_irq_on) && ((timer.machine().primary_screen->frame_number() & 1) == 0))
71         device_set_input_line(state->m_maincpu, 1, HOLD_LINE);
72   }
73   else if(scanline == 0)
74   {
75      if (state->m_irq2_on)
76         device_set_input_line(state->m_maincpu, 2, HOLD_LINE);
77   }
71   if (state->m_irq_on)
72      device_set_input_line(device, 2, HOLD_LINE);
7873}
7974
80static TIMER_DEVICE_CALLBACK( gx400_interrupt )
75static TIMER_DEVICE_CALLBACK( konamigt_interrupt )
8176{
8277   nemesis_state *state = timer.machine().driver_data<nemesis_state>();
8378   int scanline = param;
8479
85   if(scanline == 240)
86   {
87      if ((state->m_irq_on) && ((timer.machine().primary_screen->frame_number() & 1) == 0))
88         device_set_input_line(state->m_maincpu, 1, HOLD_LINE);
89   }
80   if (scanline == 240 && state->m_irq_on && (timer.machine().primary_screen->frame_number() & 1) == 0)
81      device_set_input_line(state->m_maincpu, 1, HOLD_LINE);
9082
91   if(scanline == 0)
92   {
93      if (state->m_irq2_on)
94         device_set_input_line(state->m_maincpu, 2, HOLD_LINE);
95   }
96
97   if(scanline == 120)
98   {
99      if (state->m_irq4_on)
100         device_set_input_line(state->m_maincpu, 4, HOLD_LINE);
101   }
83   if (scanline == 0 && state->m_irq2_on)
84      device_set_input_line(state->m_maincpu, 2, HOLD_LINE);
10285}
10386
104static INTERRUPT_GEN( salamand_interrupt )
87static TIMER_DEVICE_CALLBACK( gx400_interrupt )
10588{
106   nemesis_state *state = device->machine().driver_data<nemesis_state>();
89   nemesis_state *state = timer.machine().driver_data<nemesis_state>();
90   int scanline = param;
10791
108   if (state->m_irq_on)
109      device_set_input_line(device, 1, HOLD_LINE);
110}
92   if (scanline == 240 && state->m_irq1_on && (timer.machine().primary_screen->frame_number() & 1) == 0)
93      device_set_input_line(state->m_maincpu, 1, HOLD_LINE);
11194
112static INTERRUPT_GEN( blkpnthr_interrupt )
113{
114   nemesis_state *state = device->machine().driver_data<nemesis_state>();
95   if (scanline == 0 && state->m_irq2_on)
96      device_set_input_line(state->m_maincpu, 2, HOLD_LINE);
11597
116   if (state->m_irq_on)
117      device_set_input_line(device, 2, HOLD_LINE);
98   if (scanline == 120 && state->m_irq4_on)
99      device_set_input_line(state->m_maincpu, 4, HOLD_LINE);
118100}
119101
120102
121103WRITE16_MEMBER(nemesis_state::gx400_irq1_enable_word_w)
122104{
123
124105   if (ACCESSING_BITS_0_7)
125106      m_irq1_on = data & 0x0001;
126107
r15435r15436
130111
131112WRITE16_MEMBER(nemesis_state::gx400_irq2_enable_word_w)
132113{
133
134114   if (ACCESSING_BITS_0_7)
135115      m_irq2_on = data & 0x0001;
136116
r15435r15436
140120
141121WRITE16_MEMBER(nemesis_state::gx400_irq4_enable_word_w)
142122{
143
144123   if (ACCESSING_BITS_8_15)
145124      m_irq4_on = data & 0x0100;
146125}
147126
148127WRITE16_MEMBER(nemesis_state::nemesis_irq_enable_word_w)
149128{
150
151129   if (ACCESSING_BITS_0_7)
152130      m_irq_on = data & 0xff;
153131
r15435r15436
157135
158136WRITE16_MEMBER(nemesis_state::konamigt_irq_enable_word_w)
159137{
160
161138   if (ACCESSING_BITS_0_7)
162139      m_irq_on = data & 0xff;
163140
r15435r15436
167144
168145WRITE16_MEMBER(nemesis_state::konamigt_irq2_enable_word_w)
169146{
170
171147   if (ACCESSING_BITS_0_7)
172148      m_irq2_on = data & 0xff;
173149
r15435r15436
183159
184160WRITE16_MEMBER(nemesis_state::gx400_sharedram_word_w)
185161{
186
187162   if (ACCESSING_BITS_0_7)
188163      m_gx400_shared_ram[offset] = data;
189164}
r15435r15436
218193
219194WRITE16_MEMBER(nemesis_state::selected_ip_word_w)
220195{
221
222196   if (ACCESSING_BITS_0_7)
223197      m_selected_ip = data & 0xff;   // latch the value
224198}
225199
226200READ16_MEMBER(nemesis_state::selected_ip_word_r)
227201{
228
229202   switch (m_selected_ip & 0xf)
230203   {                                    // From WEC Le Mans Schems:
231204      case 0xc:  return ioport("ACCEL")->read();   // Accel - Schems: Accelevr
r15435r15436
17661739   /* basic machine hardware */
17671740   MCFG_CPU_ADD("maincpu", M68000,18432000/2)       /* 9.216MHz */
17681741   MCFG_CPU_PROGRAM_MAP(salamand_map)
1769   MCFG_CPU_VBLANK_INT("screen", salamand_interrupt)
1742   MCFG_CPU_VBLANK_INT("screen", nemesis_interrupt)
17701743
17711744   MCFG_CPU_ADD("audiocpu", Z80, 3579545)         /* 3.579545 MHz */
17721745   MCFG_CPU_PROGRAM_MAP(sal_sound_map)
r15435r15436
18601833   /* basic machine hardware */
18611834   MCFG_CPU_ADD("maincpu", M68000,18432000/2)         /* 9.216 MHz? */
18621835   MCFG_CPU_PROGRAM_MAP(citybomb_map)
1863   MCFG_CPU_VBLANK_INT("screen", salamand_interrupt)
1836   MCFG_CPU_VBLANK_INT("screen", nemesis_interrupt)
18641837
18651838   MCFG_CPU_ADD("audiocpu", Z80, 3579545)        /* 3.579545 MHz */
18661839   MCFG_CPU_PROGRAM_MAP(city_sound_map)
r15435r15436
19091882   /* basic machine hardware */
19101883   MCFG_CPU_ADD("maincpu", M68000,18432000/2)         /* 9.216 MHz? */
19111884   MCFG_CPU_PROGRAM_MAP(nyanpani_map)
1912   MCFG_CPU_VBLANK_INT("screen", salamand_interrupt)
1885   MCFG_CPU_VBLANK_INT("screen", nemesis_interrupt)
19131886
19141887   MCFG_CPU_ADD("audiocpu", Z80, 3579545)        /* 3.579545 MHz */
19151888   MCFG_CPU_PROGRAM_MAP(city_sound_map)
src/mame/drivers/taito_z.c
r15435r15436
951951
952952Graphics problems:
953953- tearing in the main road (tile layer 3 offset?)
954  likely cause is mame/video/taitoic.c in tc0480scp_bg23_draw:
955      ** flawed calc ?? **
956      x_index -= (tc0480scp->x_offs - 0x1f + layer * 4) * ((row_zoom & 0xff) << 8);
954957- car sprites palette flickering
955- some missing sprites (random?) ie. motor block sprite after inserting coin
958- layer missing sometimes (random?) ie. motor block sprite after inserting coin
956959
957960LAN board is unemulated
958961
src/emu/video/pc_cga.c
r15435r15436
350350      default:
351351         fatalerror("CGA: Bus width %d not supported", buswidth);
352352         break;
353   }   
353   }
354354   spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_cga8_r), FUNC(pc_cga8_w), mask );
355355   internal_pc_cga_video_start(machine);
356356   cga.videoram_size = 0x4000;
r15435r15436
392392      default:
393393         fatalerror("CGA: Bus width %d not supported", buswidth);
394394         break;
395   }   
395   }
396396   spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_cga8_r), FUNC(pc_cga8_w), mask );
397397
398398   internal_pc_cga_video_start(machine);
r15435r15436
12191219            default:
12201220               fatalerror("CGA: Bus width %d not supported", buswidth);
12211221               break;
1222         }     
1222         }
12231223         space_prg->install_legacy_readwrite_handler(0xb8000, 0xb87ff, FUNC(char_ram_r),FUNC(char_ram_w), mask );
12241224      } else {
12251225         if (cga.videoram_size== 0x4000) {
src/emu/machine/am9517a.c
r15435r15436
1/***************************************************************************
2
3    AMD AM9517A/8237A Multimode DMA Controller emulation
4
5    Copyright the MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8***************************************************************************/
9
10/*
11
12   TODO:
13
14   - memory-to-memory transfer
15   - external EOP
16
17*/
18
19#include "am9517a.h"
20
21
22
23//**************************************************************************
24//  DEVICE DEFINITIONS
25//**************************************************************************
26
27const device_type AM9517A = &device_creator<am9517a_device>;
28
29
30
31//**************************************************************************
32//  MACROS / CONSTANTS
33//**************************************************************************
34
35#define LOG 0
36
37
38enum
39{
40   REGISTER_ADDRESS = 0,
41   REGISTER_WORD_COUNT,
42   REGISTER_STATUS = 8,
43   REGISTER_COMMAND = REGISTER_STATUS,
44   REGISTER_REQUEST,
45   REGISTER_SINGLE_MASK,
46   REGISTER_MODE,
47   REGISTER_BYTE_POINTER,
48   REGISTER_TEMPORARY,
49   REGISTER_MASTER_CLEAR = REGISTER_TEMPORARY,
50   REGISTER_CLEAR_MASK,
51   REGISTER_MASK
52};
53
54
55#define COMMAND_MEM_TO_MEM         BIT(m_command, 0)
56#define COMMAND_CH0_ADDRESS_HOLD   BIT(m_command, 1)
57#define COMMAND_DISABLE            BIT(m_command, 2)
58#define COMMAND_COMPRESSED_TIMING   BIT(m_command, 3)
59#define COMMAND_ROTATING_PRIORITY   BIT(m_command, 4)
60#define COMMAND_EXTENDED_WRITE      BIT(m_command, 5)
61#define COMMAND_DREQ_ACTIVE_LOW      BIT(m_command, 6)
62#define COMMAND_DACK_ACTIVE_HIGH   BIT(m_command, 7)
63
64
65#define MODE_TRANSFER_MASK         (m_channel[m_current_channel].m_mode & 0x0c)
66#define MODE_TRANSFER_VERIFY      0x00
67#define MODE_TRANSFER_WRITE         0x04
68#define MODE_TRANSFER_READ         0x08
69#define MODE_TRANSFER_ILLEGAL      0x0c
70#define MODE_AUTOINITIALIZE         BIT(m_channel[m_current_channel].m_mode, 4)
71#define MODE_ADDRESS_DECREMENT      BIT(m_channel[m_current_channel].m_mode, 5)
72#define MODE_MASK               (m_channel[m_current_channel].m_mode & 0xc0)
73#define MODE_DEMAND               0x00
74#define MODE_SINGLE               0x40
75#define MODE_BLOCK               0x80
76#define MODE_CASCADE            0xc0
77
78
79enum
80{
81   STATE_SI,
82   STATE_S0,
83   STATE_SC,
84   STATE_S1,
85   STATE_S2,
86   STATE_S3,
87   STATE_SW,
88   STATE_S4,
89   STATE_S11,
90   STATE_S12,
91   STATE_S13,
92   STATE_S14,
93   STATE_S21,
94   STATE_S22,
95   STATE_S23,
96   STATE_S24
97};
98
99
100
101//**************************************************************************
102//  INLINE HELPERS
103//**************************************************************************
104
105//-------------------------------------------------
106//  dma_request -
107//-------------------------------------------------
108
109inline void am9517a_device::dma_request(int channel, int state)
110{
111   if (LOG) logerror("AM9517A '%s' Channel %u DMA Request: %u\n", tag(), channel, state);
112
113   if (state ^ COMMAND_DREQ_ACTIVE_LOW)
114   {
115      m_status |= (1 << (channel + 4));
116   }
117   else
118   {
119      m_status &= ~(1 << (channel + 4));
120   }
121}
122
123
124//-------------------------------------------------
125//  is_request_active -
126//-------------------------------------------------
127
128inline bool am9517a_device::is_request_active(int channel)
129{
130   return (BIT(m_status, channel + 4) & !BIT(m_mask, channel)) ? true : false;
131}
132
133
134//-------------------------------------------------
135//  is_software_request_active -
136//-------------------------------------------------
137
138inline bool am9517a_device::is_software_request_active(int channel)
139{
140   return BIT(m_request, channel) && ((m_channel[channel].m_mode & 0xc0) == MODE_BLOCK);
141}
142
143
144//-------------------------------------------------
145//  set_hreq -
146//-------------------------------------------------
147
148inline void am9517a_device::set_hreq(int state)
149{
150   if (m_hreq != state)
151   {
152      m_out_hreq_func(state);
153
154      m_hreq = state;
155   }
156}
157
158
159//-------------------------------------------------
160//  set_dack -
161//-------------------------------------------------
162
163inline void am9517a_device::set_dack()
164{
165   for (int channel = 0; channel < 4; channel++)
166   {
167      if ((channel == m_current_channel) && !COMMAND_MEM_TO_MEM)
168      {
169         m_channel[channel].m_out_dack_func(COMMAND_DACK_ACTIVE_HIGH);
170      }
171      else
172      {
173         m_channel[channel].m_out_dack_func(!COMMAND_DACK_ACTIVE_HIGH);
174      }
175   }
176}
177
178
179//-------------------------------------------------
180//  set_eop -
181//-------------------------------------------------
182
183inline void am9517a_device::set_eop(int state)
184{
185   if (m_eop != state)
186   {
187      m_out_eop_func(state);
188
189      m_eop = state;
190   }
191}
192
193
194//-------------------------------------------------
195//  dma_read -
196//-------------------------------------------------
197
198inline int am9517a_device::get_state1(bool msb_changed)
199{
200   if (COMMAND_MEM_TO_MEM)
201   {
202      return msb_changed ? STATE_S11 : STATE_S12;
203   }
204   else
205   {
206      return msb_changed ? STATE_S1 : STATE_S2;
207   }
208}
209
210
211//-------------------------------------------------
212//  dma_read -
213//-------------------------------------------------
214
215inline void am9517a_device::dma_read()
216{
217   offs_t offset = m_channel[m_current_channel].m_address;
218
219   switch (MODE_TRANSFER_MASK)
220   {
221   case MODE_TRANSFER_VERIFY:
222      break;
223
224   case MODE_TRANSFER_WRITE:
225      m_temp = m_channel[m_current_channel].m_in_ior_func(offset);
226      break;
227
228   case MODE_TRANSFER_READ:
229      m_temp = m_in_memr_func(offset);
230      break;
231   }
232}
233
234
235//-------------------------------------------------
236//  dma_write -
237//-------------------------------------------------
238
239inline void am9517a_device::dma_write()
240{
241   offs_t offset = m_channel[m_current_channel].m_address;
242
243   switch (MODE_TRANSFER_MASK)
244   {
245   case MODE_TRANSFER_VERIFY:
246      break;
247
248   case MODE_TRANSFER_WRITE:
249      m_out_memw_func(offset, m_temp);
250      break;
251
252   case MODE_TRANSFER_READ:
253      m_channel[m_current_channel].m_out_iow_func(offset, m_temp);
254      break;
255   }
256}
257
258
259//-------------------------------------------------
260//  dma_advance -
261//-------------------------------------------------
262
263inline void am9517a_device::dma_advance()
264{
265   bool msb_changed = false;
266
267   m_channel[m_current_channel].m_count--;
268
269   if (m_current_channel || !COMMAND_MEM_TO_MEM || !COMMAND_CH0_ADDRESS_HOLD)
270   {
271      if (MODE_ADDRESS_DECREMENT)
272      {
273         m_channel[m_current_channel].m_address--;
274         
275         if ((m_channel[m_current_channel].m_address & 0xff) == 0xff)
276         {
277            msb_changed = true;
278         }
279      }
280      else
281      {
282         m_channel[m_current_channel].m_address++;
283         
284         if ((m_channel[m_current_channel].m_address & 0xff) == 0x00)
285         {
286            msb_changed = true;
287         }
288      }
289   }
290
291   if (m_channel[m_current_channel].m_count == 0xffff)
292   {
293      end_of_process();
294   }
295   else
296   {
297      switch (MODE_MASK)
298      {
299      case MODE_DEMAND:
300         if (!is_request_active(m_current_channel))
301         {
302            set_hreq(0);
303            set_dack();
304            m_state = STATE_SI;
305         }
306         else
307         {
308            m_state = get_state1(msb_changed);
309         }
310         break;
311
312      case MODE_SINGLE:
313         set_hreq(0);
314         set_dack();
315         m_state = STATE_SI;
316         break;
317         
318      case MODE_BLOCK:
319         m_state = get_state1(msb_changed);
320         break;
321         
322      case MODE_CASCADE:
323         break;
324      }
325   }
326}
327
328
329//-------------------------------------------------
330//  end_of_process -
331//-------------------------------------------------
332
333inline void am9517a_device::end_of_process()
334{
335   // terminal count
336   m_status |= 1 << m_current_channel;
337   m_request &= ~(1 << m_current_channel);
338
339   if (MODE_AUTOINITIALIZE)
340   {
341      // autoinitialize
342      m_channel[m_current_channel].m_address = m_channel[m_current_channel].m_base_address;
343      m_channel[m_current_channel].m_count = m_channel[m_current_channel].m_base_count;
344   }
345   else
346   {
347      // mask out channel
348      m_mask |= 1 << m_current_channel;
349   }
350
351   // signal end of process
352   set_eop(0);
353   set_hreq(0);
354
355   m_current_channel = -1;
356   set_dack();
357
358   m_state = STATE_SI;
359}
360
361
362
363//**************************************************************************
364//  LIVE DEVICE
365//**************************************************************************
366
367//-------------------------------------------------
368//  am9517a_device - constructor
369//-------------------------------------------------
370
371am9517a_device::am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
372    : device_t(mconfig, AM9517A, "AM9517A", tag, owner, clock),
373     device_execute_interface(mconfig, *this),
374     m_icount(0),
375      m_hack(0),
376      m_ready(1)
377{
378}
379
380
381//-------------------------------------------------
382//  device_config_complete - perform any
383//  operations now that the configuration is
384//  complete
385//-------------------------------------------------
386
387void am9517a_device::device_config_complete()
388{
389   // inherit a copy of the static data
390   const am9517a_interface *intf = reinterpret_cast<const am9517a_interface *>(static_config());
391   if (intf != NULL)
392      *static_cast<am9517a_interface *>(this) = *intf;
393
394   // or initialize to defaults if none provided
395   else
396   {
397       memset(&m_out_hreq_cb, 0, sizeof(m_out_hreq_cb));
398       memset(&m_out_eop_cb, 0, sizeof(m_out_eop_cb));
399       memset(&m_in_memr_cb, 0, sizeof(m_in_memr_cb));
400       memset(&m_out_memw_cb, 0, sizeof(m_out_memw_cb));
401
402      for (int i = 0; i < 4; i++)
403      {
404          memset(&m_in_ior_cb[i], 0, sizeof(m_in_ior_cb[i]));
405          memset(&m_out_iow_cb[i], 0, sizeof(m_out_iow_cb[i]));
406          memset(&m_out_dack_cb[i], 0, sizeof(m_out_dack_cb[i]));
407       }
408   }
409}
410
411
412//-------------------------------------------------
413//  device_start - device-specific startup
414//-------------------------------------------------
415
416void am9517a_device::device_start()
417{
418   // set our instruction counter
419   m_icountptr = &m_icount;
420
421   // resolve callbacks
422   m_out_hreq_func.resolve(m_out_hreq_cb, *this);
423   m_out_eop_func.resolve(m_out_eop_cb, *this);
424   m_in_memr_func.resolve(m_in_memr_cb, *this);
425   m_out_memw_func.resolve(m_out_memw_cb, *this);
426
427   for (int i = 0; i < 4; i++)
428   {
429      m_channel[i].m_in_ior_func.resolve(m_in_ior_cb[i], *this);
430      m_channel[i].m_out_iow_func.resolve(m_out_iow_cb[i], *this);
431      m_channel[i].m_out_dack_func.resolve(m_out_dack_cb[i], *this);
432   }
433
434   // state saving
435   save_item(NAME(m_state));
436}
437
438
439//-------------------------------------------------
440//  device_reset - device-specific reset
441//-------------------------------------------------
442
443void am9517a_device::device_reset()
444{
445   m_state = STATE_SI;
446   m_command = 0;
447   m_status = 0;
448   m_request = 0;
449   m_mask = 0x0f;
450   m_temp = 0;
451   m_msb = 0;
452   m_current_channel = -1;
453   m_last_channel = 3;
454
455   set_hreq(0);
456   set_eop(1);
457
458   set_dack();
459}
460
461
462//-------------------------------------------------
463//  execute_run -
464//-------------------------------------------------
465
466void am9517a_device::execute_run()
467{
468   do
469   {
470      switch (m_state)
471      {
472      case STATE_SI:
473         set_eop(1);
474
475         if (!COMMAND_DISABLE)
476         {
477            int priority[] = { 0, 1, 2, 3 };
478
479            if (COMMAND_ROTATING_PRIORITY)
480            {
481               int last_channel = m_last_channel;
482
483               for (int channel = 3; channel >= 0; channel--)
484               {
485                  priority[channel] = last_channel;
486                  last_channel--;
487                  if (last_channel < 0) last_channel = 3;
488               }
489            }
490
491            for (int channel = 0; channel < 4; channel++)
492            {
493               if (is_request_active(priority[channel]) || is_software_request_active(priority[channel]))
494               {
495                  m_current_channel = m_last_channel = priority[channel];
496                  m_state = STATE_S0;
497                  break;
498               }
499            }
500         }
501         break;
502
503      case STATE_S0:
504         set_hreq(1);
505
506         if (m_hack)
507         {
508            m_state = (MODE_MASK == MODE_CASCADE) ? STATE_SC : get_state1(true);
509         }
510         break;
511
512      case STATE_SC:
513         if (!is_request_active(m_current_channel))
514         {
515            m_current_channel = -1;
516            m_state = STATE_SI;
517         }
518
519         set_dack();
520         break;
521
522      case STATE_S1:
523         m_state = STATE_S2;
524         break;
525
526      case STATE_S2:
527         set_dack();
528         m_state = COMMAND_COMPRESSED_TIMING ? STATE_S4 : STATE_S3;
529         break;
530         
531      case STATE_S3:
532         dma_read();
533
534         if (COMMAND_EXTENDED_WRITE)
535         {
536            dma_write();         
537         }
538
539         m_state = m_ready ? STATE_S4 : STATE_SW;
540         break;
541
542      case STATE_SW:
543         m_state = m_ready ? STATE_S4 : STATE_SW;
544         break;
545         
546      case STATE_S4:
547         if (COMMAND_COMPRESSED_TIMING)
548         {
549            dma_read();
550            dma_write();
551         }
552         else if (!COMMAND_EXTENDED_WRITE)
553         {
554            dma_write();
555         }
556
557         dma_advance();
558         break;
559         
560      case STATE_S11:
561         m_current_channel = 0;
562
563         m_state = STATE_S12;
564         break;
565
566      case STATE_S12:
567         m_state = STATE_S13;
568         break;
569
570      case STATE_S13:
571         m_state = STATE_S14;
572         break;
573         
574      case STATE_S14:
575         dma_read();
576
577         m_state = STATE_S21;
578         break;
579         
580      case STATE_S21:
581         m_current_channel = 1;
582
583         m_state = STATE_S22;
584         break;
585         
586      case STATE_S22:
587         m_state = STATE_S23;
588         break;
589         
590      case STATE_S23:
591         m_state = STATE_S24;
592         break;
593         
594      case STATE_S24:
595         dma_write();
596         dma_advance();
597         break;
598      }
599
600      m_icount--;
601   } while (m_icount > 0);
602}
603
604
605//-------------------------------------------------
606//  read -
607//-------------------------------------------------
608
609READ8_MEMBER( am9517a_device::read )
610{
611   UINT8 data = 0;
612
613   if (!BIT(offset, 3))
614   {
615      int channel = (offset >> 1) & 0x03;
616
617      switch (offset & 0x01)
618      {
619      case REGISTER_ADDRESS:
620         if (m_msb)
621         {
622            data = m_channel[channel].m_address >> 8;
623         }
624         else
625         {
626            data = m_channel[channel].m_address & 0xff;
627         }
628         break;
629
630      case REGISTER_WORD_COUNT:
631         if (m_msb)
632         {
633            data = m_channel[channel].m_count >> 8;
634         }
635         else
636         {
637            data = m_channel[channel].m_count & 0xff;
638         }
639         break;
640      }
641
642      m_msb = !m_msb;
643   }
644   else
645   {
646      switch (offset & 0x0f)
647      {
648      case REGISTER_STATUS:
649         data = m_status;
650
651         // clear TC bits
652         m_status &= 0x0f;
653         break;
654
655      case REGISTER_TEMPORARY:
656         data = m_temp;
657         break;
658     
659      case REGISTER_MASK:
660         data = m_mask;
661         break;
662      }
663   }
664
665   return data;
666}
667
668
669//-------------------------------------------------
670//  write -
671//-------------------------------------------------
672
673WRITE8_MEMBER( am9517a_device::write )
674{
675   if (!BIT(offset, 3))
676   {
677      int channel = (offset >> 1) & 0x03;
678     
679      switch (offset & 0x01)
680      {
681      case REGISTER_ADDRESS:
682         if (m_msb)
683         {
684            m_channel[channel].m_base_address = (data << 8) | (m_channel[channel].m_base_address & 0xff);
685            m_channel[channel].m_address = (data << 8) | (m_channel[channel].m_address & 0xff);
686         }
687         else
688         {
689            m_channel[channel].m_base_address = (m_channel[channel].m_base_address & 0xff00) | data;
690            m_channel[channel].m_address = (m_channel[channel].m_address & 0xff00) | data;
691         }
692
693         if (LOG) logerror("AM9517A '%s' Channel %u Base Address: %04x\n", tag(), channel, m_channel[channel].m_base_address);
694         break;
695
696      case REGISTER_WORD_COUNT:
697         if (m_msb)
698         {
699            m_channel[channel].m_base_count = (data << 8) | (m_channel[channel].m_base_count & 0xff);
700            m_channel[channel].m_count = (data << 8) | (m_channel[channel].m_count & 0xff);
701         }
702         else
703         {
704            m_channel[channel].m_base_count = (m_channel[channel].m_base_count & 0xff00) | data;
705            m_channel[channel].m_count = (m_channel[channel].m_count & 0xff00) | data;
706         }
707
708         if (LOG) logerror("AM9517A '%s' Channel %u Base Word Count: %04x\n", tag(), channel, m_channel[channel].m_base_count);
709         break;
710      }
711
712      m_msb = !m_msb;
713   }
714   else
715   {
716      switch (offset & 0x0f)
717      {
718      case REGISTER_COMMAND:
719         m_command = data;
720
721         if (LOG) logerror("AM9517A '%s' Command Register: %02x\n", tag(), m_command);
722         break;
723
724      case REGISTER_REQUEST:
725         {
726            int channel = data & 0x03;
727
728            if (BIT(data, 2))
729            {
730               m_request |= (1 << (channel + 4));
731            }
732            else
733            {
734               m_request &= ~(1 << (channel + 4));
735            }
736
737            if (LOG) logerror("AM9517A '%s' Request Register: %01x\n", tag(), m_request);
738         }
739         break;
740         
741      case REGISTER_SINGLE_MASK:
742         {
743            int channel = data & 0x03;
744
745            if (BIT(data, 2))
746            {
747               m_mask |= (1 << channel);
748            }
749            else
750            {
751               m_mask &= ~(1 << channel);
752            }
753
754            if (LOG) logerror("AM9517A '%s' Mask Register: %01x\n", tag(), m_mask);
755         }
756         break;
757         
758      case REGISTER_MODE:
759         {
760            int channel = data & 0x03;
761
762            m_channel[channel].m_mode = data & 0xfc;
763
764            // clear terminal count
765            m_status &= ~(1 << channel);
766
767            if (LOG) logerror("AM9517A '%s' Channel %u Mode: %02x\n", tag(), channel, data & 0xfc);
768         }
769         break;
770         
771      case REGISTER_BYTE_POINTER:
772         if (LOG) logerror("AM9517A '%s' Clear Byte Pointer Flip-Flop\n", tag());
773
774         m_msb = 0;
775         break;
776         
777      case REGISTER_MASTER_CLEAR:
778         if (LOG) logerror("AM9517A '%s' Master Clear\n", tag());
779         
780         device_reset();
781         break;
782         
783      case REGISTER_CLEAR_MASK:
784         if (LOG) logerror("AM9517A '%s' Clear Mask Register\n", tag());
785
786         m_mask = 0;
787         break;
788         
789      case REGISTER_MASK:
790         m_mask = data & 0x0f;
791
792         if (LOG) logerror("AM9517A '%s' Mask Register: %01x\n", tag(), m_mask);
793         break;
794      }
795   }
796}
797
798
799//-------------------------------------------------
800//  hack_w - hold acknowledge
801//-------------------------------------------------
802
803WRITE_LINE_MEMBER( am9517a_device::hack_w )
804{
805   if (LOG) logerror("AM9517A '%s' Hold Acknowledge: %u\n", tag(), state);
806
807   m_hack = state;
808}
809
810
811//-------------------------------------------------
812//  ready_w - ready
813//-------------------------------------------------
814
815WRITE_LINE_MEMBER( am9517a_device::ready_w )
816{
817   if (LOG) logerror("AM9517A '%s' Ready: %u\n", tag(), state);
818
819   m_ready = state;
820}
821
822
823//-------------------------------------------------
824//  eop_w - end of process
825//-------------------------------------------------
826
827WRITE_LINE_MEMBER( am9517a_device::eop_w )
828{
829   if (LOG) logerror("AM9517A '%s' End of Process: %u\n", tag(), state);
830}
831
832
833//-------------------------------------------------
834//  dreq0_w - DMA request for channel 0
835//-------------------------------------------------
836
837WRITE_LINE_MEMBER( am9517a_device::dreq0_w )
838{
839   dma_request(0, state);
840}
841
842
843//-------------------------------------------------
844//  dreq0_w - DMA request for channel 1
845//-------------------------------------------------
846
847WRITE_LINE_MEMBER( am9517a_device::dreq1_w )
848{
849   dma_request(1, state);
850}
851
852
853//-------------------------------------------------
854//  dreq1_w - DMA request for channel 2
855//-------------------------------------------------
856
857WRITE_LINE_MEMBER( am9517a_device::dreq2_w )
858{
859   dma_request(2, state);
860}
861
862
863//-------------------------------------------------
864//  dreq3_w - DMA request for channel 3
865//-------------------------------------------------
866
867WRITE_LINE_MEMBER( am9517a_device::dreq3_w )
868{
869   dma_request(3, state);
870}
1/***************************************************************************
2 
3    AMD AM9517A/8237A Multimode DMA Controller emulation
4 
5    Copyright the MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8***************************************************************************/
9 
10/*
11 
12   TODO:
13 
14   - memory-to-memory transfer
15   - external EOP
16 
17*/
18 
19#include "am9517a.h"
20 
21 
22 
23//**************************************************************************
24//  DEVICE DEFINITIONS
25//**************************************************************************
26 
27const device_type AM9517A = &device_creator<am9517a_device>;
28 
29 
30 
31//**************************************************************************
32//  MACROS / CONSTANTS
33//**************************************************************************
34 
35#define LOG 0
36 
37 
38enum
39{
40   REGISTER_ADDRESS = 0,
41   REGISTER_WORD_COUNT,
42   REGISTER_STATUS = 8,
43   REGISTER_COMMAND = REGISTER_STATUS,
44   REGISTER_REQUEST,
45   REGISTER_SINGLE_MASK,
46   REGISTER_MODE,
47   REGISTER_BYTE_POINTER,
48   REGISTER_TEMPORARY,
49   REGISTER_MASTER_CLEAR = REGISTER_TEMPORARY,
50   REGISTER_CLEAR_MASK,
51   REGISTER_MASK
52};
53 
54 
55#define COMMAND_MEM_TO_MEM         BIT(m_command, 0)
56#define COMMAND_CH0_ADDRESS_HOLD   BIT(m_command, 1)
57#define COMMAND_DISABLE            BIT(m_command, 2)
58#define COMMAND_COMPRESSED_TIMING   BIT(m_command, 3)
59#define COMMAND_ROTATING_PRIORITY   BIT(m_command, 4)
60#define COMMAND_EXTENDED_WRITE      BIT(m_command, 5)
61#define COMMAND_DREQ_ACTIVE_LOW      BIT(m_command, 6)
62#define COMMAND_DACK_ACTIVE_HIGH   BIT(m_command, 7)
63 
64 
65#define MODE_TRANSFER_MASK         (m_channel[m_current_channel].m_mode & 0x0c)
66#define MODE_TRANSFER_VERIFY      0x00
67#define MODE_TRANSFER_WRITE         0x04
68#define MODE_TRANSFER_READ         0x08
69#define MODE_TRANSFER_ILLEGAL      0x0c
70#define MODE_AUTOINITIALIZE         BIT(m_channel[m_current_channel].m_mode, 4)
71#define MODE_ADDRESS_DECREMENT      BIT(m_channel[m_current_channel].m_mode, 5)
72#define MODE_MASK               (m_channel[m_current_channel].m_mode & 0xc0)
73#define MODE_DEMAND               0x00
74#define MODE_SINGLE               0x40
75#define MODE_BLOCK               0x80
76#define MODE_CASCADE            0xc0
77 
78 
79enum
80{
81   STATE_SI,
82   STATE_S0,
83   STATE_SC,
84   STATE_S1,
85   STATE_S2,
86   STATE_S3,
87   STATE_SW,
88   STATE_S4,
89   STATE_S11,
90   STATE_S12,
91   STATE_S13,
92   STATE_S14,
93   STATE_S21,
94   STATE_S22,
95   STATE_S23,
96   STATE_S24
97};
98 
99 
100 
101//**************************************************************************
102//  INLINE HELPERS
103//**************************************************************************
104 
105//-------------------------------------------------
106//  dma_request -
107//-------------------------------------------------
108 
109inline void am9517a_device::dma_request(int channel, int state)
110{
111   if (LOG) logerror("AM9517A '%s' Channel %u DMA Request: %u\n", tag(), channel, state);
112 
113   if (state ^ COMMAND_DREQ_ACTIVE_LOW)
114   {
115      m_status |= (1 << (channel + 4));
116   }
117   else
118   {
119      m_status &= ~(1 << (channel + 4));
120   }
121}
122 
123 
124//-------------------------------------------------
125//  is_request_active -
126//-------------------------------------------------
127 
128inline bool am9517a_device::is_request_active(int channel)
129{
130   return (BIT(m_status, channel + 4) & !BIT(m_mask, channel)) ? true : false;
131}
132 
133 
134//-------------------------------------------------
135//  is_software_request_active -
136//-------------------------------------------------
137 
138inline bool am9517a_device::is_software_request_active(int channel)
139{
140   return BIT(m_request, channel) && ((m_channel[channel].m_mode & 0xc0) == MODE_BLOCK);
141}
142 
143 
144//-------------------------------------------------
145//  set_hreq -
146//-------------------------------------------------
147 
148inline void am9517a_device::set_hreq(int state)
149{
150   if (m_hreq != state)
151   {
152      m_out_hreq_func(state);
153 
154      m_hreq = state;
155   }
156}
157 
158 
159//-------------------------------------------------
160//  set_dack -
161//-------------------------------------------------
162 
163inline void am9517a_device::set_dack()
164{
165   for (int channel = 0; channel < 4; channel++)
166   {
167      if ((channel == m_current_channel) && !COMMAND_MEM_TO_MEM)
168      {
169         m_channel[channel].m_out_dack_func(COMMAND_DACK_ACTIVE_HIGH);
170      }
171      else
172      {
173         m_channel[channel].m_out_dack_func(!COMMAND_DACK_ACTIVE_HIGH);
174      }
175   }
176}
177 
178 
179//-------------------------------------------------
180//  set_eop -
181//-------------------------------------------------
182 
183inline void am9517a_device::set_eop(int state)
184{
185   if (m_eop != state)
186   {
187      m_out_eop_func(state);
188 
189      m_eop = state;
190   }
191}
192 
193 
194//-------------------------------------------------
195//  dma_read -
196//-------------------------------------------------
197 
198inline int am9517a_device::get_state1(bool msb_changed)
199{
200   if (COMMAND_MEM_TO_MEM)
201   {
202      return msb_changed ? STATE_S11 : STATE_S12;
203   }
204   else
205   {
206      return msb_changed ? STATE_S1 : STATE_S2;
207   }
208}
209 
210 
211//-------------------------------------------------
212//  dma_read -
213//-------------------------------------------------
214 
215inline void am9517a_device::dma_read()
216{
217   offs_t offset = m_channel[m_current_channel].m_address;
218 
219   switch (MODE_TRANSFER_MASK)
220   {
221   case MODE_TRANSFER_VERIFY:
222      break;
223 
224   case MODE_TRANSFER_WRITE:
225      m_temp = m_channel[m_current_channel].m_in_ior_func(offset);
226      break;
227 
228   case MODE_TRANSFER_READ:
229      m_temp = m_in_memr_func(offset);
230      break;
231   }
232}
233 
234 
235//-------------------------------------------------
236//  dma_write -
237//-------------------------------------------------
238 
239inline void am9517a_device::dma_write()
240{
241   offs_t offset = m_channel[m_current_channel].m_address;
242 
243   switch (MODE_TRANSFER_MASK)
244   {
245   case MODE_TRANSFER_VERIFY:
246      break;
247 
248   case MODE_TRANSFER_WRITE:
249      m_out_memw_func(offset, m_temp);
250      break;
251 
252   case MODE_TRANSFER_READ:
253      m_channel[m_current_channel].m_out_iow_func(offset, m_temp);
254      break;
255   }
256}
257 
258 
259//-------------------------------------------------
260//  dma_advance -
261//-------------------------------------------------
262 
263inline void am9517a_device::dma_advance()
264{
265   bool msb_changed = false;
266 
267   m_channel[m_current_channel].m_count--;
268 
269   if (m_current_channel || !COMMAND_MEM_TO_MEM || !COMMAND_CH0_ADDRESS_HOLD)
270   {
271      if (MODE_ADDRESS_DECREMENT)
272      {
273         m_channel[m_current_channel].m_address--;
274         
275         if ((m_channel[m_current_channel].m_address & 0xff) == 0xff)
276         {
277            msb_changed = true;
278         }
279      }
280      else
281      {
282         m_channel[m_current_channel].m_address++;
283         
284         if ((m_channel[m_current_channel].m_address & 0xff) == 0x00)
285         {
286            msb_changed = true;
287         }
288      }
289   }
290 
291   if (m_channel[m_current_channel].m_count == 0xffff)
292   {
293      end_of_process();
294   }
295   else
296   {
297      switch (MODE_MASK)
298      {
299      case MODE_DEMAND:
300         if (!is_request_active(m_current_channel))
301         {
302            set_hreq(0);
303            set_dack();
304            m_state = STATE_SI;
305         }
306         else
307         {
308            m_state = get_state1(msb_changed);
309         }
310         break;
311 
312      case MODE_SINGLE:
313         set_hreq(0);
314         set_dack();
315         m_state = STATE_SI;
316         break;
317         
318      case MODE_BLOCK:
319         m_state = get_state1(msb_changed);
320         break;
321         
322      case MODE_CASCADE:
323         break;
324      }
325   }
326}
327 
328 
329//-------------------------------------------------
330//  end_of_process -
331//-------------------------------------------------
332 
333inline void am9517a_device::end_of_process()
334{
335   // terminal count
336   m_status |= 1 << m_current_channel;
337   m_request &= ~(1 << m_current_channel);
338 
339   if (MODE_AUTOINITIALIZE)
340   {
341      // autoinitialize
342      m_channel[m_current_channel].m_address = m_channel[m_current_channel].m_base_address;
343      m_channel[m_current_channel].m_count = m_channel[m_current_channel].m_base_count;
344   }
345   else
346   {
347      // mask out channel
348      m_mask |= 1 << m_current_channel;
349   }
350 
351   // signal end of process
352   set_eop(0);
353   set_hreq(0);
354 
355   m_current_channel = -1;
356   set_dack();
357 
358   m_state = STATE_SI;
359}
360 
361 
362 
363//**************************************************************************
364//  LIVE DEVICE
365//**************************************************************************
366 
367//-------------------------------------------------
368//  am9517a_device - constructor
369//-------------------------------------------------
370 
371am9517a_device::am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
372    : device_t(mconfig, AM9517A, "AM9517A", tag, owner, clock),
373     device_execute_interface(mconfig, *this),
374     m_icount(0),
375      m_hack(0),
376      m_ready(1)
377{
378}
379 
380 
381//-------------------------------------------------
382//  device_config_complete - perform any
383//  operations now that the configuration is
384//  complete
385//-------------------------------------------------
386 
387void am9517a_device::device_config_complete()
388{
389   // inherit a copy of the static data
390   const am9517a_interface *intf = reinterpret_cast<const am9517a_interface *>(static_config());
391   if (intf != NULL)
392      *static_cast<am9517a_interface *>(this) = *intf;
393 
394   // or initialize to defaults if none provided
395   else
396   {
397       memset(&m_out_hreq_cb, 0, sizeof(m_out_hreq_cb));
398       memset(&m_out_eop_cb, 0, sizeof(m_out_eop_cb));
399       memset(&m_in_memr_cb, 0, sizeof(m_in_memr_cb));
400       memset(&m_out_memw_cb, 0, sizeof(m_out_memw_cb));
401 
402      for (int i = 0; i < 4; i++)
403      {
404          memset(&m_in_ior_cb[i], 0, sizeof(m_in_ior_cb[i]));
405          memset(&m_out_iow_cb[i], 0, sizeof(m_out_iow_cb[i]));
406          memset(&m_out_dack_cb[i], 0, sizeof(m_out_dack_cb[i]));
407       }
408   }
409}
410 
411 
412//-------------------------------------------------
413//  device_start - device-specific startup
414//-------------------------------------------------
415 
416void am9517a_device::device_start()
417{
418   // set our instruction counter
419   m_icountptr = &m_icount;
420 
421   // resolve callbacks
422   m_out_hreq_func.resolve(m_out_hreq_cb, *this);
423   m_out_eop_func.resolve(m_out_eop_cb, *this);
424   m_in_memr_func.resolve(m_in_memr_cb, *this);
425   m_out_memw_func.resolve(m_out_memw_cb, *this);
426 
427   for (int i = 0; i < 4; i++)
428   {
429      m_channel[i].m_in_ior_func.resolve(m_in_ior_cb[i], *this);
430      m_channel[i].m_out_iow_func.resolve(m_out_iow_cb[i], *this);
431      m_channel[i].m_out_dack_func.resolve(m_out_dack_cb[i], *this);
432   }
433 
434   // state saving
435   save_item(NAME(m_state));
436}
437 
438 
439//-------------------------------------------------
440//  device_reset - device-specific reset
441//-------------------------------------------------
442 
443void am9517a_device::device_reset()
444{
445   m_state = STATE_SI;
446   m_command = 0;
447   m_status = 0;
448   m_request = 0;
449   m_mask = 0x0f;
450   m_temp = 0;
451   m_msb = 0;
452   m_current_channel = -1;
453   m_last_channel = 3;
454 
455   set_hreq(0);
456   set_eop(1);
457 
458   set_dack();
459}
460 
461 
462//-------------------------------------------------
463//  execute_run -
464//-------------------------------------------------
465 
466void am9517a_device::execute_run()
467{
468   do
469   {
470      switch (m_state)
471      {
472      case STATE_SI:
473         set_eop(1);
474 
475         if (!COMMAND_DISABLE)
476         {
477            int priority[] = { 0, 1, 2, 3 };
478 
479            if (COMMAND_ROTATING_PRIORITY)
480            {
481               int last_channel = m_last_channel;
482 
483               for (int channel = 3; channel >= 0; channel--)
484               {
485                  priority[channel] = last_channel;
486                  last_channel--;
487                  if (last_channel < 0) last_channel = 3;
488               }
489            }
490 
491            for (int channel = 0; channel < 4; channel++)
492            {
493               if (is_request_active(priority[channel]) || is_software_request_active(priority[channel]))
494               {
495                  m_current_channel = m_last_channel = priority[channel];
496                  m_state = STATE_S0;
497                  break;
498               }
499            }
500         }
501         break;
502 
503      case STATE_S0:
504         set_hreq(1);
505 
506         if (m_hack)
507         {
508            m_state = (MODE_MASK == MODE_CASCADE) ? STATE_SC : get_state1(true);
509         }
510         break;
511 
512      case STATE_SC:
513         if (!is_request_active(m_current_channel))
514         {
515            m_current_channel = -1;
516            m_state = STATE_SI;
517         } 
518 
519         set_dack();
520         break;
521 
522      case STATE_S1:
523         m_state = STATE_S2;
524         break;
525 
526      case STATE_S2:
527         set_dack();
528         m_state = COMMAND_COMPRESSED_TIMING ? STATE_S4 : STATE_S3;
529         break;
530         
531      case STATE_S3:
532         dma_read();
533 
534         if (COMMAND_EXTENDED_WRITE)
535         {
536            dma_write();         
537         }
538 
539         m_state = m_ready ? STATE_S4 : STATE_SW;
540         break;
541 
542      case STATE_SW:
543         m_state = m_ready ? STATE_S4 : STATE_SW;
544         break;
545         
546      case STATE_S4:
547         if (COMMAND_COMPRESSED_TIMING)
548         {
549            dma_read();
550            dma_write();
551         }
552         else if (!COMMAND_EXTENDED_WRITE)
553         {
554            dma_write();
555         }
556 
557         dma_advance();
558         break;
559         
560      case STATE_S11:
561         m_current_channel = 0;
562 
563         m_state = STATE_S12;
564         break;
565 
566      case STATE_S12:
567         m_state = STATE_S13;
568         break;
569 
570      case STATE_S13:
571         m_state = STATE_S14;
572         break;
573         
574      case STATE_S14:
575         dma_read();
576 
577         m_state = STATE_S21;
578         break;
579         
580      case STATE_S21:
581         m_current_channel = 1;
582 
583         m_state = STATE_S22;
584         break;
585         
586      case STATE_S22:
587         m_state = STATE_S23;
588         break;
589         
590      case STATE_S23:
591         m_state = STATE_S24;
592         break;
593         
594      case STATE_S24:
595         dma_write();
596         dma_advance();
597         break;
598      }
599 
600      m_icount--;
601   } while (m_icount > 0);
602}
603 
604 
605//-------------------------------------------------
606//  read - 
607//-------------------------------------------------
608 
609READ8_MEMBER( am9517a_device::read )
610{
611   UINT8 data = 0;
612 
613   if (!BIT(offset, 3))
614   {
615      int channel = (offset >> 1) & 0x03;
616 
617      switch (offset & 0x01)
618      {
619      case REGISTER_ADDRESS:
620         if (m_msb)
621         {
622            data = m_channel[channel].m_address >> 8;
623         }
624         else
625         {
626            data = m_channel[channel].m_address & 0xff;
627         }
628         break;
629 
630      case REGISTER_WORD_COUNT:
631         if (m_msb)
632         {
633            data = m_channel[channel].m_count >> 8;
634         }
635         else
636         {
637            data = m_channel[channel].m_count & 0xff;
638         }
639         break;
640      }
641 
642      m_msb = !m_msb;
643   }
644   else
645   {
646      switch (offset & 0x0f)
647      {
648      case REGISTER_STATUS:
649         data = m_status;
650 
651         // clear TC bits
652         m_status &= 0x0f;
653         break;
654 
655      case REGISTER_TEMPORARY:
656         data = m_temp;
657         break;
658       
659      case REGISTER_MASK:
660         data = m_mask;
661         break;
662      }
663   }
664 
665   return data;
666}
667 
668 
669//-------------------------------------------------
670//  write - 
671//-------------------------------------------------
672 
673WRITE8_MEMBER( am9517a_device::write )
674{
675   if (!BIT(offset, 3))
676   {
677      int channel = (offset >> 1) & 0x03;
678       
679      switch (offset & 0x01)
680      {
681      case REGISTER_ADDRESS:
682         if (m_msb)
683         {
684            m_channel[channel].m_base_address = (data << 8) | (m_channel[channel].m_base_address & 0xff);
685            m_channel[channel].m_address = (data << 8) | (m_channel[channel].m_address & 0xff);
686         }
687         else
688         {
689            m_channel[channel].m_base_address = (m_channel[channel].m_base_address & 0xff00) | data;
690            m_channel[channel].m_address = (m_channel[channel].m_address & 0xff00) | data;
691         }
692 
693         if (LOG) logerror("AM9517A '%s' Channel %u Base Address: %04x\n", tag(), channel, m_channel[channel].m_base_address);
694         break;
695 
696      case REGISTER_WORD_COUNT:
697         if (m_msb)
698         {
699            m_channel[channel].m_base_count = (data << 8) | (m_channel[channel].m_base_count & 0xff);
700            m_channel[channel].m_count = (data << 8) | (m_channel[channel].m_count & 0xff);
701         }
702         else
703         {
704            m_channel[channel].m_base_count = (m_channel[channel].m_base_count & 0xff00) | data;
705            m_channel[channel].m_count = (m_channel[channel].m_count & 0xff00) | data;
706         }
707 
708         if (LOG) logerror("AM9517A '%s' Channel %u Base Word Count: %04x\n", tag(), channel, m_channel[channel].m_base_count);
709         break;
710      }
711 
712      m_msb = !m_msb;
713   }
714   else
715   {
716      switch (offset & 0x0f)
717      {
718      case REGISTER_COMMAND:
719         m_command = data;
720 
721         if (LOG) logerror("AM9517A '%s' Command Register: %02x\n", tag(), m_command);
722         break;
723 
724      case REGISTER_REQUEST:
725         {
726            int channel = data & 0x03;
727 
728            if (BIT(data, 2))
729            {
730               m_request |= (1 << (channel + 4));
731            }
732            else
733            {
734               m_request &= ~(1 << (channel + 4));
735            }
736 
737            if (LOG) logerror("AM9517A '%s' Request Register: %01x\n", tag(), m_request);
738         }
739         break;
740         
741      case REGISTER_SINGLE_MASK:
742         {
743            int channel = data & 0x03;
744 
745            if (BIT(data, 2))
746            {
747               m_mask |= (1 << channel);
748            }
749            else
750            {
751               m_mask &= ~(1 << channel);
752            }
753 
754            if (LOG) logerror("AM9517A '%s' Mask Register: %01x\n", tag(), m_mask);
755         }
756         break;
757         
758      case REGISTER_MODE:
759         {
760            int channel = data & 0x03;
761 
762            m_channel[channel].m_mode = data & 0xfc;
763 
764            // clear terminal count
765            m_status &= ~(1 << channel);
766 
767            if (LOG) logerror("AM9517A '%s' Channel %u Mode: %02x\n", tag(), channel, data & 0xfc);
768         }
769         break;
770         
771      case REGISTER_BYTE_POINTER:
772         if (LOG) logerror("AM9517A '%s' Clear Byte Pointer Flip-Flop\n", tag());
773 
774         m_msb = 0;
775         break;
776         
777      case REGISTER_MASTER_CLEAR:
778         if (LOG) logerror("AM9517A '%s' Master Clear\n", tag());
779         
780         device_reset();
781         break;
782         
783      case REGISTER_CLEAR_MASK:
784         if (LOG) logerror("AM9517A '%s' Clear Mask Register\n", tag());
785 
786         m_mask = 0;
787         break;
788         
789      case REGISTER_MASK:
790         m_mask = data & 0x0f;
791 
792         if (LOG) logerror("AM9517A '%s' Mask Register: %01x\n", tag(), m_mask);
793         break;
794      }
795   }
796}
797 
798 
799//-------------------------------------------------
800//  hack_w - hold acknowledge
801//-------------------------------------------------
802 
803WRITE_LINE_MEMBER( am9517a_device::hack_w )
804{
805   if (LOG) logerror("AM9517A '%s' Hold Acknowledge: %u\n", tag(), state);
806 
807   m_hack = state;
808}
809 
810 
811//-------------------------------------------------
812//  ready_w - ready
813//-------------------------------------------------
814 
815WRITE_LINE_MEMBER( am9517a_device::ready_w )
816{
817   if (LOG) logerror("AM9517A '%s' Ready: %u\n", tag(), state);
818 
819   m_ready = state;
820}
821 
822 
823//-------------------------------------------------
824//  eop_w - end of process
825//-------------------------------------------------
826 
827WRITE_LINE_MEMBER( am9517a_device::eop_w )
828{
829   if (LOG) logerror("AM9517A '%s' End of Process: %u\n", tag(), state);
830}
831 
832 
833//-------------------------------------------------
834//  dreq0_w - DMA request for channel 0
835//-------------------------------------------------
836 
837WRITE_LINE_MEMBER( am9517a_device::dreq0_w )
838{
839   dma_request(0, state);
840}
841 
842 
843//-------------------------------------------------
844//  dreq0_w - DMA request for channel 1
845//-------------------------------------------------
846 
847WRITE_LINE_MEMBER( am9517a_device::dreq1_w )
848{
849   dma_request(1, state);
850}
851 
852 
853//-------------------------------------------------
854//  dreq1_w - DMA request for channel 2
855//-------------------------------------------------
856 
857WRITE_LINE_MEMBER( am9517a_device::dreq2_w )
858{
859   dma_request(2, state);
860}
861 
862 
863//-------------------------------------------------
864//  dreq3_w - DMA request for channel 3
865//-------------------------------------------------
866 
867WRITE_LINE_MEMBER( am9517a_device::dreq3_w )
868{
869   dma_request(3, state);
870}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team