Previous 199869 Revisions Next

r31471 Wednesday 30th July, 2014 at 13:59:12 UTC by Alex Jackson
k053246: fix 8bpp ROM readback; remove some obsolete trampoline and debug handlers (nw)
[src/mame/drivers]konamigx.c mystwarr.c rungun.c
[src/mame/includes]konamigx.h
[src/mame/video]k053246_k053247_k055673.c k053246_k053247_k055673.h konami_helper.h

trunk/src/mame/includes/konamigx.h
r31470r31471
7979   DECLARE_WRITE32_MEMBER(sound020_w);
8080   DECLARE_READ32_MEMBER(le2_gun_H_r);
8181   DECLARE_READ32_MEMBER(le2_gun_V_r);
82   DECLARE_READ32_MEMBER(gx5bppspr_r);
83   DECLARE_READ32_MEMBER(gx6bppspr_r);
8482   DECLARE_READ32_MEMBER(type1_roz_r1);
8583   DECLARE_READ32_MEMBER(type1_roz_r2);
8684   DECLARE_READ32_MEMBER(type3_sync_r);
trunk/src/mame/video/konami_helper.h
r31470r31471
44#ifndef __KONAMI_HELPER_H__
55#define __KONAMI_HELPER_H__
66
7#define NORMAL_PLANE_ORDER 0x0123
8
97void konami_decode_gfx(running_machine &machine, gfxdecode_device * gfxdecode, palette_device &palette, int gfx_index, UINT8 *data, UINT32 total, const gfx_layout *layout, int bpp);
108
119/* helper function to sort three tile layers by priority order */
trunk/src/mame/video/k053246_k053247_k055673.c
r31470r31471
8888}
8989
9090
91WRITE16_MEMBER( k053247_device::k053247_reg_word_w ) // write-only OBJSET2 registers (see p.43 table 6.1)
91WRITE16_MEMBER( k053247_device::k055673_reg_word_w ) // write-only OBJSET2 registers (see p.43 table 6.1)
9292{
9393   COMBINE_DATA(m_kx47_regs + offset);
9494}
9595
96WRITE32_MEMBER( k053247_device::k053247_reg_long_w )
97{
98   offset <<= 1;
99   COMBINE_DATA(m_kx47_regs + offset + 1);
100   mem_mask >>= 16;
101   data >>= 16;
102   COMBINE_DATA(m_kx47_regs + offset);
103}
104
10596READ16_MEMBER( k053247_device::k053247_word_r )
10697{
10798   return m_ram[offset];
r31470r31471
112103   COMBINE_DATA(m_ram + offset);
113104}
114105
115READ32_MEMBER( k053247_device::k053247_long_r )
116{
117   return m_ram[offset * 2 + 1] | (m_ram[offset * 2] << 16);
118}
119
120WRITE32_MEMBER( k053247_device::k053247_long_w )
121{
122   offset <<= 1;
123   COMBINE_DATA(m_ram + offset + 1);
124   mem_mask >>= 16;
125   data >>= 16;
126   COMBINE_DATA(m_ram + offset);
127}
128
129106READ8_MEMBER( k053247_device::k053247_r )
130107{
131108   int offs = offset >> 1;
r31470r31471
146123      m_ram[offs] = (m_ram[offs] & 0x00ff) | (data << 8);
147124}
148125
149// Mystic Warriors hardware games support a non-objcha based ROM readback
126// The K055673 supports a non-objcha based ROM readback
150127// write the address to the 246 as usual, but there's a completely separate ROM
151128// window that works without needing an objcha line.
152129// in this window, +0 = 32 bits from one set of ROMs, and +8 = 32 bits from another set
153READ16_MEMBER( k053247_device::k055673_rom_word_r ) // 5bpp
130
131// FIXME: rearrange ROM loading so this can be merged with the 4/6/8bpp version
132READ16_MEMBER( k053247_device::k055673_5bpp_rom_word_r ) // 5bpp
154133{
155134   UINT8 *ROM8 = (UINT8 *)space.machine().root_device().memregion(m_memory_region)->base();
156135   UINT16 *ROM = (UINT16 *)space.machine().root_device().memregion(m_memory_region)->base();
r31470r31471
188167   return 0;
189168}
190169
191READ16_MEMBER( k053247_device::k055673_GX6bpp_rom_word_r )
170READ16_MEMBER( k053247_device::k055673_rom_word_r )
192171{
172   if (m_bpp == 5)
173      return k055673_5bpp_rom_word_r(space, offset, mem_mask);
174
193175   UINT16 *ROM = (UINT16 *)space.machine().root_device().memregion(m_memory_region)->base();
194176   int romofs;
195177
196178   romofs = m_kx46_regs[6] << 16 | m_kx46_regs[7] << 8 | m_kx46_regs[4];
197179
198   romofs /= 4;    // romofs increments 4 at a time
199   romofs *= 12 / 2;   // each increment of romofs = 12 new bytes (6 new words)
180   romofs = (romofs >> 2) * m_bpp;
200181
201   switch (offset)
202   {
203      case 0:
204         return ROM[romofs + 3];
205      case 1:
206         return ROM[romofs + 4];
207      case 2:
208      case 3:
209         return ROM[romofs + 5];
210      case 4:
211         return ROM[romofs];
212      case 5:
213         return ROM[romofs + 1];
214      case 6:
215      case 7:
216         return ROM[romofs + 2];
217      default:
218//          LOG(("55673_rom_word_r: Unknown read offset %x (PC=%x)\n", offset, space.device().safe_pc()));
219         break;
220   }
182   if ((offset & 0x4) == 0) romofs += m_bpp >> 1;
221183
222   return 0;
184   return ROM[romofs + (offset & 0x3)];
223185}
224186
225187READ8_MEMBER( k053247_device::k053246_r )
r31470r31471
260222      k053246_w( space, (offset << 1) + 1,data & 0xff);
261223}
262224
263READ32_MEMBER( k053247_device::k053246_long_r )
264{
265   offset <<= 1;
266   return (k053246_word_r( space, offset + 1, 0xffff) | k053246_word_r( space, offset, 0xffff) << 16);
267}
268
269WRITE32_MEMBER( k053247_device::k053246_long_w )
270{
271   offset <<= 1;
272   k053246_word_w( space, offset, data >> 16, mem_mask >> 16);
273   k053246_word_w( space, offset + 1, data, mem_mask);
274}
275
276225void k053247_device::k053246_set_objcha_line( int state )
277226{
278227   m_objcha_line = state;
r31470r31471
992941      16,16,
993942      0,
994943      8,
995      { 8*1,8*0,8*3,8*2,8*5,8*4,8*7,8*6 },
944      { 56, 48, 40, 32, 24, 16, 8, 0 },
996945      {  0,1,2,3,4,5,6,7,64+0,64+1,64+2,64+3,64+4,64+5,64+6,64+7 },
997946      { 128*0, 128*1, 128*2,  128*3,  128*4,  128*5,  128*6,  128*7,
998947         128*8, 128*9, 128*10, 128*11, 128*12, 128*13, 128*14, 128*15 },
999      128*16
948      16*16*8
1000949   };
1001950   static const gfx_layout spritelayout4 = /* System GX 6bpp sprite layout */
1002951   {
r31470r31471
1023972   alt_k055673_rom = (UINT16 *)machine().root_device().memregion(m_memory_region)->base();
1024973
1025974   /* decode the graphics */
1026   switch (m_plane_order)
975   switch (m_bpp)
1027976   {
1028977      case K055673_LAYOUT_GX:
1029978         size4 = (machine().root_device().memregion(m_memory_region)->bytes()/(1024*1024))/5;
r31470r31471
11551104   };
11561105
11571106   /* decode the graphics */
1158   switch (m_plane_order)
1107   switch (m_bpp)
11591108   {
11601109   case NORMAL_PLANE_ORDER:
11611110      total = machine().root_device().memregion(m_memory_region)->bytes() / 128;
r31470r31471
12321181{
12331182   return(m_kx46_regs[offset * 2] << 8 | m_kx46_regs[offset * 2 + 1]);
12341183}   // OBJSET1
1235
1236READ16_MEMBER( k053247_device::k053247_reg_word_r )
1237{
1238   return(m_kx47_regs[offset]);
1239}   // OBJSET2
1240
1241READ32_MEMBER( k053247_device::k053247_reg_long_r )
1242{
1243   offset <<= 1;
1244   return (k053247_reg_word_r( space, offset + 1, 0xffff) | k053247_reg_word_r( space, offset, 0xffff) << 16);
1245}
trunk/src/mame/video/k053246_k053247_k055673.h
r31470r31471
66#ifndef __K05324x_H__
77#define __K05324x_H__
88
9#define NORMAL_PLANE_ORDER 0x0123
9#define NORMAL_PLANE_ORDER 4
1010
1111typedef device_delegate<void (int *code, int *color, int *priority_mask)> k053247_cb_delegate;
1212#define K053246_CB_MEMBER(_name)   void _name(int *code, int *color, int *priority_mask)
r31470r31471
2626
2727
2828/**  Konami 053246 / 053247 / 055673  **/
29#define K055673_LAYOUT_GX  0
30#define K055673_LAYOUT_RNG 1
31#define K055673_LAYOUT_LE2 2
32#define K055673_LAYOUT_GX6 3
29#define K055673_LAYOUT_GX  5
30#define K055673_LAYOUT_RNG 4
31#define K055673_LAYOUT_LE2 8
32#define K055673_LAYOUT_GX6 6
3333
3434
3535/*
r31470r31471
6868   static void static_set_gfxdecode_tag(device_t &device, const char *tag);
6969   static void static_set_palette_tag(device_t &device, const char *tag);
7070   static void set_k053247_callback(device_t &device, k053247_cb_delegate callback) { downcast<k053247_device &>(device).m_k053247_cb = callback; }
71   static void set_config(device_t &device, const char *gfx_reg, int gfx_num, int order, int dx, int dy)
71   static void set_config(device_t &device, const char *gfx_reg, int gfx_num, int bpp, int dx, int dy)
7272   {
7373      k053247_device &dev = downcast<k053247_device &>(device);
7474      dev.m_memory_region = gfx_reg;
7575      dev.m_gfx_num = gfx_num;
76      dev.m_plane_order = order;
76      dev.m_bpp = bpp;
7777      dev.m_dx = dx;
7878      dev.m_dy = dy;
7979   }
r31470r31471
8181   void clear_all();
8282
8383   DECLARE_READ16_MEMBER( k055673_rom_word_r );
84   DECLARE_READ16_MEMBER( k055673_GX6bpp_rom_word_r );
84   DECLARE_READ16_MEMBER( k055673_5bpp_rom_word_r );
8585
8686   DECLARE_READ8_MEMBER( k053247_r );
8787   DECLARE_WRITE8_MEMBER( k053247_w );
8888   DECLARE_READ16_MEMBER( k053247_word_r );
8989   DECLARE_WRITE16_MEMBER( k053247_word_w );
90   DECLARE_READ32_MEMBER( k053247_long_r );
91   DECLARE_WRITE32_MEMBER( k053247_long_w );
92   DECLARE_WRITE16_MEMBER( k053247_reg_word_w ); // "OBJSET2" registers
93   DECLARE_WRITE32_MEMBER( k053247_reg_long_w );
90   DECLARE_WRITE16_MEMBER( k055673_reg_word_w ); // "OBJSET2" registers
9491
9592   void k053247_sprites_draw( bitmap_ind16 &bitmap,const rectangle &cliprect);
9693   void k053247_sprites_draw( bitmap_rgb32 &bitmap,const rectangle &cliprect);
r31470r31471
104101   DECLARE_WRITE8_MEMBER( k053246_w );
105102   DECLARE_READ16_MEMBER( k053246_word_r );
106103   DECLARE_WRITE16_MEMBER( k053246_word_w );
107   DECLARE_READ32_MEMBER( k053246_long_r );
108   DECLARE_WRITE32_MEMBER( k053246_long_w );
109104
110105   void k053246_set_objcha_line( int state);
111106   int k053246_is_irq_enabled(void);
112107   int k053246_read_register( int regnum);
113108
114109   DECLARE_READ16_MEMBER( k053246_reg_word_r );    // OBJSET1
115   DECLARE_READ16_MEMBER( k053247_reg_word_r );    // OBJSET2
116   DECLARE_READ32_MEMBER( k053247_reg_long_r );    // OBJSET2
117110
118111   UINT16    *m_ram;
119112
r31470r31471
130123   //FIXME: device should be updated to use device_gfx_interface to get rid of most of these!
131124   const char *m_memory_region;
132125   int m_gfx_num;
133   int m_plane_order;
126   int m_bpp;
134127   required_device<gfxdecode_device> m_gfxdecode;
135128   required_device<palette_device> m_palette;
136129
trunk/src/mame/drivers/mystwarr.c
r31470r31471
1#define MW_DEBUG     0
2
31/**************************************************************************
42 * Mystic Warrior (c) 1993 Konami
53 * Metamorphic Force (c) 1993 Konami
r31470r31471
298296   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(k053247_scattered_word_r,k053247_scattered_word_w) AM_SHARE("spriteram")
299297   AM_RANGE(0x480000, 0x4800ff) AM_DEVWRITE("k055555", k055555_device, K055555_word_w)
300298   AM_RANGE(0x482000, 0x48200f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)
301   AM_RANGE(0x482010, 0x48201f) AM_DEVWRITE("k055673", k055673_device,k053247_reg_word_w)
299   AM_RANGE(0x482010, 0x48201f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w)
302300   AM_RANGE(0x484000, 0x484007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)
303301   AM_RANGE(0x48a000, 0x48a01f) AM_DEVWRITE("k054338", k054338_device, word_w)
304302   AM_RANGE(0x48c000, 0x48c03f) AM_DEVWRITE("k056832", k056832_device,word_w)
r31470r31471
319317   AM_RANGE(0x602000, 0x603fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM mirror read(essential)
320318   AM_RANGE(0x680000, 0x683fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r)
321319   AM_RANGE(0x700000, 0x701fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
322#if MW_DEBUG
323   AM_RANGE(0x482010, 0x48201f) AM_DEVREAD("k055673", k055673_device, k053247_reg_word_r)
324   AM_RANGE(0x484000, 0x484007) AM_DEVREAD("k055673", k055673_device, k053246_reg_word_r)
325   AM_RANGE(0x48a000, 0x48a01f) AM_DEVREAD("k054338", k054338_device, word_r)
326   AM_RANGE(0x48c000, 0x48c03f) AM_DEVREAD("k056832", k056832_device, word_r)
327#endif
328320ADDRESS_MAP_END
329321
330322/* Metamorphic Force */
r31470r31471
335327   AM_RANGE(0x211000, 0x21ffff) AM_RAM
336328   AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)
337329   AM_RANGE(0x244000, 0x24400f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)
338   AM_RANGE(0x244010, 0x24401f) AM_DEVWRITE("k055673", k055673_device,k053247_reg_word_w)
330   AM_RANGE(0x244010, 0x24401f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w)
339331   AM_RANGE(0x24c000, 0x24ffff) AM_DEVREADWRITE("k053250_1", k053250_device, ram_r, ram_w)
340332   AM_RANGE(0x250000, 0x25000f) AM_DEVREADWRITE("k053250_1", k053250_device, reg_r, reg_w)
341333   AM_RANGE(0x254000, 0x25401f) AM_DEVWRITE("k054338", k054338_device, word_w)
r31470r31471
359351   AM_RANGE(0x310000, 0x311fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r)
360352   AM_RANGE(0x320000, 0x321fff) AM_DEVREAD("k053250_1", k053250_device, rom_r)
361353   AM_RANGE(0x330000, 0x331fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
362#if MW_DEBUG
363   AM_RANGE(0x240000, 0x240007) AM_DEVREAD("k055673", k055673_device, k053246_reg_word_r)
364   AM_RANGE(0x244010, 0x24401f) AM_DEVREAD("k055673", k055673_device, k053247_reg_word_r)
365   AM_RANGE(0x254000, 0x25401f) AM_DEVREAD("k054338", k054338_device, word_r)
366   AM_RANGE(0x26C000, 0x26C007) AM_DEVREAD("k056832", k056832_device, b_word_r)
367   AM_RANGE(0x270000, 0x27003f) AM_DEVREAD("k056832", k056832_device, word_r)
368#endif
369354ADDRESS_MAP_END
370355
371356/* Violent Storm */
r31470r31471
376361   AM_RANGE(0x211000, 0x21ffff) AM_RAM
377362   AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)
378363   AM_RANGE(0x244000, 0x24400f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)
379   AM_RANGE(0x244010, 0x24401f) AM_DEVWRITE("k055673", k055673_device,k053247_reg_word_w)
364   AM_RANGE(0x244010, 0x24401f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w)
380365   AM_RANGE(0x24c000, 0x24ffff) AM_RAM     // K053250 ram
381366   AM_RANGE(0x250000, 0x25000f) AM_RAM     // K053250 reg
382367   AM_RANGE(0x254000, 0x25401f) AM_DEVWRITE("k054338", k054338_device, word_w)
r31470r31471
401386   AM_RANGE(0x304000, 0x3041ff) AM_RAM
402387   AM_RANGE(0x310000, 0x311fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r)
403388   AM_RANGE(0x330000, 0x331fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
404#if MW_DEBUG
405   AM_RANGE(0x240000, 0x240007) AM_DEVREAD("k055673", k055673_device, k053246_reg_word_r)
406   AM_RANGE(0x244010, 0x24401f) AM_DEVREAD("k055673", k055673_device, k053247_reg_word_r)
407   AM_RANGE(0x254000, 0x25401f) AM_DEVREAD("k054338", k054338_device, word_r)
408   AM_RANGE(0x26C000, 0x26C007) AM_DEVREAD("k056832", k056832_device, b_word_r)
409   AM_RANGE(0x270000, 0x27003f) AM_DEVREAD("k056832", k056832_device, word_r)
410#endif
411389ADDRESS_MAP_END
412390
413391// Martial Champion specific interfaces
r31470r31471
467445   AM_RANGE(0x300000, 0x3fffff) AM_ROM                                 // data ROM
468446   AM_RANGE(0x400000, 0x4000ff) AM_DEVWRITE("k055555", k055555_device, K055555_word_w)                // PCU2
469447   AM_RANGE(0x402000, 0x40200f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)         // sprite ROM readback
470   AM_RANGE(0x402010, 0x40201f) AM_DEVWRITE("k055673", k055673_device,k053247_reg_word_w)            // OBJSET2
448   AM_RANGE(0x402010, 0x40201f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w)            // OBJSET2
471449   AM_RANGE(0x404000, 0x404007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)                // OBJSET1
472450   AM_RANGE(0x40a000, 0x40a01f) AM_DEVWRITE("k054338", k054338_device, word_w)                // CLTC
473451   AM_RANGE(0x40c000, 0x40c03f) AM_DEVWRITE("k056832", k056832_device,word_w)                // VACSET
r31470r31471
490468   AM_RANGE(0x680000, 0x681fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM
491469   AM_RANGE(0x682000, 0x683fff) AM_DEVREADWRITE("k056832", k056832_device,ram_word_r,ram_word_w) // tilemap RAM mirror read/write (essential)
492470   AM_RANGE(0x700000, 0x703fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r)          // tile ROM readback
493#if MW_DEBUG
494   AM_RANGE(0x402010, 0x40201f) AM_DEVREAD("k055673", k055673_device, k053247_reg_word_r)
495   AM_RANGE(0x404000, 0x404007) AM_DEVREAD("k055673", k055673_device, k053246_reg_word_r)
496   AM_RANGE(0x40a000, 0x40a01f) AM_DEVREAD("k054338", k054338_device, word_r)
497   AM_RANGE(0x40c000, 0x40c03f) AM_DEVREAD("k056832", k056832_device, word_r)
498   AM_RANGE(0x41e000, 0x41e007) AM_DEVREAD("k056832", k056832_device, b_word_r)
499#endif
500471ADDRESS_MAP_END
501472
502473/* Ultimate Battler Dadandarn */
r31470r31471
509480   AM_RANGE(0x430000, 0x430007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)
510481   AM_RANGE(0x440000, 0x443fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r)
511482   AM_RANGE(0x450000, 0x45000f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)
512   AM_RANGE(0x450010, 0x45001f) AM_DEVWRITE("k055673", k055673_device,k053247_reg_word_w)
483   AM_RANGE(0x450010, 0x45001f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w)
513484   AM_RANGE(0x460000, 0x46001f) AM_WRITEONLY AM_SHARE("k053936_0_ct16")
514485   AM_RANGE(0x470000, 0x470fff) AM_RAM AM_SHARE("k053936_0_li16")
515486   AM_RANGE(0x480000, 0x48003f) AM_DEVWRITE("k056832", k056832_device,word_w)        // VACSET
r31470r31471
533504   AM_RANGE(0xa00000, 0xa7ffff) AM_READ(ddd_053936_tilerom_1_r) // 128k tilemap readback
534505   AM_RANGE(0xc00000, 0xdfffff) AM_READ(ddd_053936_tilerom_2_r)    // tile character readback
535506   AM_RANGE(0xe00000, 0xe00001) AM_WRITENOP    // watchdog
536#if MW_DEBUG
537   AM_RANGE(0x430000, 0x430007) AM_DEVREAD("k055673", k055673_device, k053246_reg_word_r)
538   AM_RANGE(0x450010, 0x45001f) AM_DEVREAD("k055673", k055673_device, k053247_reg_word_r)
539   AM_RANGE(0x480000, 0x48003f) AM_DEVREAD("k056832", k056832_device, word_r)
540   AM_RANGE(0x482000, 0x482007) AM_DEVREAD("k056832", k056832_device, b_word_r)
541   AM_RANGE(0x48c000, 0x48c01f) AM_DEVREAD("k054338", k054338_device, word_r)
542#endif
543507ADDRESS_MAP_END
544508
545509/* Gaiapolis */
r31470r31471
555519   AM_RANGE(0x430000, 0x430007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)
556520   AM_RANGE(0x440000, 0x441fff) AM_DEVREAD("k056832", k056832_device, mw_rom_word_r)
557521   AM_RANGE(0x450000, 0x45000f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)
558   AM_RANGE(0x450010, 0x45001f) AM_DEVWRITE("k055673", k055673_device,k053247_reg_word_w)
522   AM_RANGE(0x450010, 0x45001f) AM_DEVWRITE("k055673", k055673_device,k055673_reg_word_w)
559523   AM_RANGE(0x460000, 0x46001f) AM_WRITEONLY AM_SHARE("k053936_0_ct16")
560524   AM_RANGE(0x470000, 0x470fff) AM_RAM AM_SHARE("k053936_0_li16")
561525   AM_RANGE(0x480000, 0x48003f) AM_DEVWRITE("k056832", k056832_device,word_w)            // VACSET
r31470r31471
579543   AM_RANGE(0xa00000, 0xa7ffff) AM_READ(ddd_053936_tilerom_1_r)    // 128k tilemap readback
580544   AM_RANGE(0xc00000, 0xdfffff) AM_READ(gai_053936_tilerom_2_r)    // tile character readback
581545   AM_RANGE(0xe00000, 0xe00001) AM_WRITENOP    // watchdog
582#if MW_DEBUG
583   AM_RANGE(0x430000, 0x430007) AM_DEVREAD("k055673", k055673_device, k053246_reg_word_r)
584   AM_RANGE(0x450010, 0x45001f) AM_DEVREAD("k055673", k055673_device, k053247_reg_word_r)
585   AM_RANGE(0x480000, 0x48003f) AM_DEVREAD("k056832", k056832_device, word_r)
586   AM_RANGE(0x482000, 0x482007) AM_DEVREAD("k056832", k056832_device, b_word_r)
587   AM_RANGE(0x48c000, 0x48c01f) AM_DEVREAD("k054338", k054338_device, word_r)
588#endif
589546ADDRESS_MAP_END
590547
591548/**********************************************************************************/
r31470r31471
1013970
1014971   MCFG_DEVICE_ADD("k055673", K055673, 0)
1015972   MCFG_K055673_CB(mystwarr_state, mystwarr_sprite_callback)
1016   MCFG_K055673_CONFIG("gfx2", 0, 0, -48, -24)
973   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -48, -24)
1017974   MCFG_K055673_GFXDECODE("gfxdecode")
1018975   MCFG_K055673_PALETTE("palette")
1019976
r31470r31471
10661023
10671024   MCFG_DEVICE_MODIFY("k055673")
10681025   MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback)
1069   MCFG_K055673_CONFIG("gfx2", 0, 1, -62, -23)
1026   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_RNG, -62, -23)
10701027MACHINE_CONFIG_END
10711028
10721029static MACHINE_CONFIG_DERIVED( metamrph, mystwarr )
r31470r31471
10991056
11001057   MCFG_DEVICE_MODIFY("k055673")
11011058   MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback)
1102   MCFG_K055673_CONFIG("gfx2", 0, 1, -51, -24)
1059   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_RNG, -51, -24)
11031060MACHINE_CONFIG_END
11041061
11051062static MACHINE_CONFIG_DERIVED( dadandrn, mystwarr )
r31470r31471
11321089
11331090   MCFG_DEVICE_MODIFY("k055673")
11341091   MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback)
1135   MCFG_K055673_CONFIG("gfx2", 0, 0, -42, -22)
1092   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -42, -22)
11361093MACHINE_CONFIG_END
11371094
11381095static MACHINE_CONFIG_DERIVED( gaiapols, mystwarr )
r31470r31471
11681125
11691126   MCFG_DEVICE_MODIFY("k055673")
11701127   MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback)
1171   MCFG_K055673_CONFIG("gfx2", 0, 1, -61, -22) // stage2 brick walls
1128   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_RNG, -61, -22) // stage2 brick walls
11721129MACHINE_CONFIG_END
11731130
11741131static MACHINE_CONFIG_DERIVED( martchmp, mystwarr )
r31470r31471
12031160
12041161   MCFG_DEVICE_MODIFY("k055673")
12051162   MCFG_K055673_CB(mystwarr_state, martchmp_sprite_callback)
1206   MCFG_K055673_CONFIG("gfx2", 0, 0, -58, -23)
1163   MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -58, -23)
12071164MACHINE_CONFIG_END
12081165
12091166/**********************************************************************************/
trunk/src/mame/drivers/konamigx.c
r31470r31471
104104#include "includes/konamigx.h"
105105#include "rendlay.h"
106106
107#define GX_DEBUG     0
108107
109108
110109
111
112110static int konamigx_cfgport;
113111
114112static int gx_rdport1_3, gx_syncen;
r31470r31471
745743/**********************************************************************************/
746744/* system or game dependent handlers */
747745
748READ32_MEMBER(konamigx_state::gx5bppspr_r)
749{
750   return (m_k055673->k055673_rom_word_r(space, offset*2+1, 0xffff) | m_k055673->k055673_rom_word_r(space, offset*2, 0xffff)<<16);
751}
752
753READ32_MEMBER(konamigx_state::gx6bppspr_r)
754{
755   return (m_k055673->k055673_GX6bpp_rom_word_r(space, offset*2+1, 0xffff) | m_k055673->k055673_GX6bpp_rom_word_r(space, offset*2, 0xffff)<<16);
756}
757
758746READ32_MEMBER(konamigx_state::type1_roz_r1)
759747{
760748   UINT32 *ROM = (UINT32 *)memregion("gfx3")->base();
r31470r31471
993981   AM_RANGE(0x400000, 0x7fffff) AM_ROM // data ROM
994982   AM_RANGE(0xc00000, 0xc1ffff) AM_RAM AM_SHARE("workram")
995983   AM_RANGE(0xd00000, 0xd01fff) AM_DEVREAD("k056832", k056832_device, k_5bpp_rom_long_r)
996   AM_RANGE(0xd20000, 0xd20fff) AM_DEVREADWRITE("k055673", k055673_device, k053247_long_r, k053247_long_w)
984   AM_RANGE(0xd20000, 0xd20fff) AM_DEVREADWRITE16("k055673", k055673_device, k053247_word_r, k053247_word_w, 0xffffffff)
997985   AM_RANGE(0xd21000, 0xd23fff) AM_RAM
998986   AM_RANGE(0xd40000, 0xd4003f) AM_DEVWRITE("k056832", k056832_device, long_w)
999987   AM_RANGE(0xd44000, 0xd4400f) AM_WRITE(konamigx_tilebank_w)
1000   AM_RANGE(0xd48000, 0xd48007) AM_DEVWRITE("k055673", k055673_device, k053246_long_w)
1001   AM_RANGE(0xd4a010, 0xd4a01f) AM_DEVWRITE("k055673", k055673_device, k053247_reg_long_w)
988   AM_RANGE(0xd48000, 0xd48007) AM_DEVWRITE16("k055673", k055673_device, k053246_word_w, 0xffffffff)
989   AM_RANGE(0xd4a000, 0xd4a00f) AM_DEVREAD16("k055673", k055673_device, k055673_rom_word_r, 0xffffffff)
990   AM_RANGE(0xd4a010, 0xd4a01f) AM_DEVWRITE16("k055673", k055673_device, k055673_reg_word_w, 0xffffffff)
1002991   AM_RANGE(0xd4c000, 0xd4c01f) AM_READWRITE(ccu_r, ccu_w)
1003992   AM_RANGE(0xd4e000, 0xd4e01f) AM_WRITENOP
1004993   AM_RANGE(0xd50000, 0xd500ff) AM_DEVWRITE("k055555", k055555_device, K055555_long_w)
r31470r31471
10111000   AM_RANGE(0xd80000, 0xd8001f) AM_DEVWRITE("k054338", k054338_device, long_w)
10121001   AM_RANGE(0xda0000, 0xda1fff) AM_DEVREADWRITE("k056832", k056832_device, ram_long_r, ram_long_w)
10131002   AM_RANGE(0xda2000, 0xda3fff) AM_DEVREADWRITE("k056832", k056832_device, ram_long_r, ram_long_w)
1014#if GX_DEBUG
1015   AM_RANGE(0xd40000, 0xd4003f) AM_DEVREAD("k056832", k056832_device, long_r)
1016   AM_RANGE(0xd4a010, 0xd4a01f) AM_DEVREAD("k055673", k055673_device, k053247_reg_long_r)
1017#endif
10181003ADDRESS_MAP_END
10191004
10201005static ADDRESS_MAP_START( gx_type1_map, AS_PROGRAM, 32, konamigx_state )
1021   AM_RANGE(0xd4a000, 0xd4a01f) AM_READ(gx6bppspr_r)   // sprite ROM readback
10221006   AM_RANGE(0xd90000, 0xd97fff) AM_RAM_WRITE(konamigx_palette_w) AM_SHARE("paletteram")
10231007   AM_RANGE(0xdc0000, 0xdc1fff) AM_RAM         // LAN RAM? (Racin' Force has, Open Golf doesn't)
10241008   AM_RANGE(0xdd0000, 0xdd00ff) AM_READNOP AM_WRITENOP // LAN board
r31470r31471
24432427
24442428   /* sprites */
24452429   ROM_REGION( 0x1000000, "gfx2", ROMREGION_ERASE00 )
2446   ROM_LOAD64_WORD( "705a10.33g",   0x000000, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
2447   ROM_LOAD64_WORD( "705a11.30g",   0x000002, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
2448   ROM_LOAD64_WORD( "705a13.28g",   0x000004, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
2449   ROM_LOAD64_WORD( "705a17.25g",   0x000006, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
2430   ROM_LOAD64_WORD( "705a17.25g",   0x000000, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
2431   ROM_LOAD64_WORD( "705a13.28g",   0x000002, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
2432   ROM_LOAD64_WORD( "705a11.30g",   0x000004, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
2433   ROM_LOAD64_WORD( "705a10.33g",   0x000006, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
24502434
24512435   /* sound data */
24522436   ROM_REGION( 0x400000, "shared", 0 )
r31470r31471
25022486
25032487   /* sprites */
25042488   ROM_REGION( 0x1000000, "gfx2", ROMREGION_ERASE00 )
2505   ROM_LOAD64_WORD( "705a10.33g",   0x000000, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
2506   ROM_LOAD64_WORD( "705a11.30g",   0x000002, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
2507   ROM_LOAD64_WORD( "705a13.28g",   0x000004, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
2508   ROM_LOAD64_WORD( "705a17.25g",   0x000006, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
2489   ROM_LOAD64_WORD( "705a17.25g",   0x000000, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
2490   ROM_LOAD64_WORD( "705a13.28g",   0x000002, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
2491   ROM_LOAD64_WORD( "705a11.30g",   0x000004, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
2492   ROM_LOAD64_WORD( "705a10.33g",   0x000006, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
25092493
25102494   /* sound data */
25112495   ROM_REGION( 0x400000, "shared", 0 )
r31470r31471
32003184
32013185   /* sprites */
32023186   ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
3203   ROM_LOAD64_WORD( "312a08.33g", 0x000000, 2*1024*1024, CRC(29015d56) SHA1(7273270804ecefd8f59469c2c2a8a89fb045a12b) )
3204   ROM_LOAD64_WORD( "312a09.30g", 0x000002, 2*1024*1024, CRC(b2c5d6d5) SHA1(8248612275ca862c6688de5c6f24f37aeb3f9fe5) )
3205   ROM_LOAD64_WORD( "312a10.28g", 0x000004, 2*1024*1024, CRC(3c570d04) SHA1(ebbf7d28726e98c8895c9bf901f8b2dd38018c77) )
3206   ROM_LOAD64_WORD( "312a11.25g", 0x000006, 2*1024*1024, CRC(5f474357) SHA1(1f6d99f1ea69e07a65731ea4eae5917452cfcab6) )
3187   ROM_LOAD64_WORD( "312a11.25g", 0x000000, 2*1024*1024, CRC(5f474357) SHA1(1f6d99f1ea69e07a65731ea4eae5917452cfcab6) )
3188   ROM_LOAD64_WORD( "312a10.28g", 0x000002, 2*1024*1024, CRC(3c570d04) SHA1(ebbf7d28726e98c8895c9bf901f8b2dd38018c77) )
3189   ROM_LOAD64_WORD( "312a09.30g", 0x000004, 2*1024*1024, CRC(b2c5d6d5) SHA1(8248612275ca862c6688de5c6f24f37aeb3f9fe5) )
3190   ROM_LOAD64_WORD( "312a08.33g", 0x000006, 2*1024*1024, CRC(29015d56) SHA1(7273270804ecefd8f59469c2c2a8a89fb045a12b) )
32073191
32083192   /* sound data */
32093193   ROM_REGION( 0x400000, "shared", 0 )
r31470r31471
32383222
32393223   /* sprites */
32403224   ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
3241   ROM_LOAD64_WORD( "312a08.33g", 0x000000, 2*1024*1024, CRC(29015d56) SHA1(7273270804ecefd8f59469c2c2a8a89fb045a12b) )
3242   ROM_LOAD64_WORD( "312a09.30g", 0x000002, 2*1024*1024, CRC(b2c5d6d5) SHA1(8248612275ca862c6688de5c6f24f37aeb3f9fe5) )
3243   ROM_LOAD64_WORD( "312a10.28g", 0x000004, 2*1024*1024, CRC(3c570d04) SHA1(ebbf7d28726e98c8895c9bf901f8b2dd38018c77) )
3244   ROM_LOAD64_WORD( "312a11.25g", 0x000006, 2*1024*1024, CRC(5f474357) SHA1(1f6d99f1ea69e07a65731ea4eae5917452cfcab6) )
3225   ROM_LOAD64_WORD( "312a11.25g", 0x000000, 2*1024*1024, CRC(5f474357) SHA1(1f6d99f1ea69e07a65731ea4eae5917452cfcab6) )
3226   ROM_LOAD64_WORD( "312a10.28g", 0x000002, 2*1024*1024, CRC(3c570d04) SHA1(ebbf7d28726e98c8895c9bf901f8b2dd38018c77) )
3227   ROM_LOAD64_WORD( "312a09.30g", 0x000004, 2*1024*1024, CRC(b2c5d6d5) SHA1(8248612275ca862c6688de5c6f24f37aeb3f9fe5) )
3228   ROM_LOAD64_WORD( "312a08.33g", 0x000006, 2*1024*1024, CRC(29015d56) SHA1(7273270804ecefd8f59469c2c2a8a89fb045a12b) )
32453229
32463230   /* sound data */
32473231   ROM_REGION( 0x400000, "shared", 0 )
r31470r31471
32773261
32783262   /* sprites */
32793263   ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
3280   ROM_LOAD64_WORD( "312a08.33g", 0x000000, 2*1024*1024, CRC(29015d56) SHA1(7273270804ecefd8f59469c2c2a8a89fb045a12b) )
3281   ROM_LOAD64_WORD( "312a09.30g", 0x000002, 2*1024*1024, CRC(b2c5d6d5) SHA1(8248612275ca862c6688de5c6f24f37aeb3f9fe5) )
3282   ROM_LOAD64_WORD( "312a10.28g", 0x000004, 2*1024*1024, CRC(3c570d04) SHA1(ebbf7d28726e98c8895c9bf901f8b2dd38018c77) )
3283   ROM_LOAD64_WORD( "312a11.25g", 0x000006, 2*1024*1024, CRC(5f474357) SHA1(1f6d99f1ea69e07a65731ea4eae5917452cfcab6) )
3264   ROM_LOAD64_WORD( "312a11.25g", 0x000000, 2*1024*1024, CRC(5f474357) SHA1(1f6d99f1ea69e07a65731ea4eae5917452cfcab6) )
3265   ROM_LOAD64_WORD( "312a10.28g", 0x000002, 2*1024*1024, CRC(3c570d04) SHA1(ebbf7d28726e98c8895c9bf901f8b2dd38018c77) )
3266   ROM_LOAD64_WORD( "312a09.30g", 0x000004, 2*1024*1024, CRC(b2c5d6d5) SHA1(8248612275ca862c6688de5c6f24f37aeb3f9fe5) )
3267   ROM_LOAD64_WORD( "312a08.33g", 0x000006, 2*1024*1024, CRC(29015d56) SHA1(7273270804ecefd8f59469c2c2a8a89fb045a12b) )
32843268
32853269   /* sound data */
32863270   ROM_REGION( 0x400000, "shared", 0 )
r31470r31471
37983782      i++;
37993783   }
38003784
3801   switch (readback)
3802   {
3803      case BPP5:
3804         m_maincpu->space(AS_PROGRAM).install_read_handler(0xd4a000, 0xd4a00f, read32_delegate(FUNC(konamigx_state::gx5bppspr_r),this));
3805      break;
3785   if (readback == BPP66)
3786      m_maincpu->space(AS_PROGRAM).install_read_handler(0xd00000, 0xd01fff, read32_delegate(FUNC(konamigx_state::k_6bpp_rom_long_r), this));
38063787
3807      case BPP66:
3808         m_maincpu->space(AS_PROGRAM).install_read_handler(0xd00000, 0xd01fff, read32_delegate(FUNC(konamigx_state::k_6bpp_rom_long_r), this));
3809      // fall through
38103788
3811      case BPP6:
3812         m_maincpu->space(AS_PROGRAM).install_read_handler(0xd4a000, 0xd4a00f, read32_delegate(FUNC(konamigx_state::gx6bppspr_r),this));
3813      break;
3814   }
3815
38163789#undef BPP5
38173790#undef BPP6
38183791#undef BPP66
trunk/src/mame/drivers/rungun.c
r31470r31471
5050#include "includes/konamipt.h"
5151#include "includes/rungun.h"
5252
53#define RNG_DEBUG 0
5453
5554
5655READ16_MEMBER(rungun_state::rng_sysregs_r)
r31470r31471
175174   AM_RANGE(0x580014, 0x580015) AM_READ(sound_status_msb_r)
176175   AM_RANGE(0x580000, 0x58001f) AM_RAM                                         // sound regs read/write fall-through
177176   AM_RANGE(0x5c0000, 0x5c000f) AM_DEVREAD("k055673", k055673_device, k055673_rom_word_r)                       // 246A ROM readback window
178   AM_RANGE(0x5c0010, 0x5c001f) AM_DEVWRITE("k055673", k055673_device, k053247_reg_word_w)
177   AM_RANGE(0x5c0010, 0x5c001f) AM_DEVWRITE("k055673", k055673_device, k055673_reg_word_w)
179178   AM_RANGE(0x600000, 0x600fff) AM_DEVREADWRITE("k055673", k055673_device, k053247_word_r, k053247_word_w)  // OBJ RAM
180179   AM_RANGE(0x601000, 0x601fff) AM_RAM                                         // communication? second monitor buffer?
181180   AM_RANGE(0x640000, 0x640007) AM_DEVWRITE("k055673", k055673_device, k053246_word_w)                      // '246A registers
r31470r31471
184183   AM_RANGE(0x700000, 0x7007ff) AM_DEVREADWRITE("k053936", k053936_device, linectrl_r, linectrl_w)          // PSAC "Line RAM"
185184   AM_RANGE(0x740000, 0x741fff) AM_READWRITE(rng_ttl_ram_r, rng_ttl_ram_w)     // text plane RAM
186185   AM_RANGE(0x7c0000, 0x7c0001) AM_WRITENOP                                    // watchdog
187#if RNG_DEBUG
188   AM_RANGE(0x5c0010, 0x5c001f) AM_DEVREAD("k055673", k055673_device, k053247_reg_word_r)
189   AM_RANGE(0x640000, 0x640007) AM_DEVREAD("k055673", k055673_device, k053246_reg_word_r)
190#endif
191186ADDRESS_MAP_END
192187
193188

Previous 199869 Revisions Next


© 1997-2024 The MAME Team