Previous 199869 Revisions Next

r18312 Saturday 6th October, 2012 at 16:39:12 UTC by Tafoid
Improved the graphic rendering a bit in blackt96, almost where it should be.  Sound still missing and other possible issues related to PIC that is not hooked up - any help there is appreciated.  From Haze (nw)
[src/mame/drivers]blackt96.c

trunk/src/mame/drivers/blackt96.c
r18311r18312
5757each made of 1x32 tile strips, however the game only ever appears to use 3
5858banks of tile strips (96 sprites)
5959
60Priority isn't understood (other attributes, sort by y pos?)
60In practice it seems like the hardware can probably only draw these 3 banks
61as separate layers with seemingly hardcoded priority levels, despite the odd
62design.
6163
6264Furthermore there are two sets of graphics, background tiles and 'sprite'
6365tiles which are of different bitdepths, but are addressed in the same way.
6466
6567Tilemap hookup is just to make viewing easier, it's not used for rendering
6668
67
6869There is also an additional 8x8 text layer..
6970
71
72Bugs:
73
74Sometimes if you attack an enemy when you're at the top of the screen they'll
75end up landing in an even higher position, and appear over the backgrounds!
76I think this is just a game bug..
77
78The timer doesn't work (PIC?, RAM Mirror?)
79
80There are some unmapped writes past the end of text ram too
81
82
7083*/
7184
7285#include "emu.h"
r18311r18312
110123   DECLARE_READ8_MEMBER(blackt96_soundio_port02_r);
111124   DECLARE_WRITE8_MEMBER(blackt96_soundio_port02_w);
112125
126   DECLARE_READ16_MEMBER( random_r )
127   {
128      return machine().rand();
129   }
130
113131   DECLARE_WRITE16_MEMBER(bg_videoram0_w);
114132   DECLARE_WRITE16_MEMBER(bg_videoram1_w);
115133   DECLARE_WRITE16_MEMBER(bg_videoram2_w);
r18311r18312
121139
122140   UINT16*       m_spriteram[8];
123141   tilemap_t    *m_bg_tilemap[8];
142   UINT8 m_txt_bank;
124143
125144   TILE_GET_INFO_MEMBER(get_bg0_tile_info);
126145   TILE_GET_INFO_MEMBER(get_bg1_tile_info);
r18311r18312
175194
176195   m_spriteram[0] = m_spriteram0;
177196   m_spriteram[1] = m_spriteram1;
178   m_spriteram[2] =   m_spriteram2;
197   m_spriteram[2] = m_spriteram2;
179198   m_spriteram[3] = m_spriteram3;
180199   m_spriteram[4] = m_spriteram4;
181200   m_spriteram[5] = m_spriteram5;
182   m_spriteram[6] =   m_spriteram6;
201   m_spriteram[6] = m_spriteram6;
183202   m_spriteram[7] = m_spriteram7;
184203}
185204
186static void draw_strip(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int page, int column, int bg)
205static void draw_strip(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int page, int column)
187206{
188207   blackt96_state *state = machine.driver_data<blackt96_state>();
189208   /* the very first 'page' in the spriteram contains the x/y positions for each tile strip */
r18311r18312
203222   yy = 0x1ff-yy;
204223   if (yy&0x100) yy-=0x200;
205224
206   yy -= 32;
225   yy -= 15;
207226
208227   UINT16* base2 = state->m_spriteram[page]+column * (0x80/2);
209228
r18311r18312
218237
219238      if (tile&0x2000)
220239      {
221         if (bg) drawgfx_transpen(bitmap,cliprect,gfxbg,tile&0x1fff,colour>>4,flipx,0,xx,yy+y*16,0);
240         drawgfx_transpen(bitmap,cliprect,gfxbg,tile&0x1fff,colour>>4,flipx,0,xx,yy+y*16,0);
222241      }
223242      else
224243      {
225         if (!bg) drawgfx_transpen(bitmap,cliprect,gfxspr,tile&0x1fff,colour,flipx,0,xx,yy+y*16,0);
244         drawgfx_transpen(bitmap,cliprect,gfxspr,tile&0x1fff,colour,flipx,0,xx,yy+y*16,0);
226245      }
227246   }
228247}
229248
249static void draw_page(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int page)
250{
251   for (int strip=0;strip<32;strip++)
252   {
253      draw_strip(machine, bitmap, cliprect, page, strip);
254   }
255}
230256
231257UINT32 blackt96_state::screen_update_blackt96(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
232258{
233   int count;
234   int x,y;
235   gfx_element *gfx = machine().gfx[2];
236
237259   bitmap.fill(get_black_pen(machine()), cliprect);
238260
239   int strip;
240   int page;
261   draw_page(machine(), bitmap, cliprect, 2); // bg
262   draw_page(machine(), bitmap, cliprect, 3); // lower pri sprites
263   draw_page(machine(), bitmap, cliprect, 1); // higher pri sprites
241264
242   for (strip=0;strip<32;strip++)
243   {
244      for (page = 7;page>0;page--)
245      {
246         draw_strip(machine(), bitmap, cliprect, page, strip, 1);
247      }
248   }
249265
250   for (strip=0;strip<32;strip++)
251   {
252      for (page = 7;page>0;page--)
253      {
254         draw_strip(machine(), bitmap, cliprect, page, strip, 0);
255      }
256   }
257
258
259266   /* Text Layer */
260   count = 0;
267   int count = 0;
268   int x,y;
269   gfx_element *gfx = machine().gfx[2];
261270
262271   for (x=0;x<64;x++)
263272   {
264273      for (y=0;y<32;y++)
265274      {
266         UINT16 tile = (m_tilemapram[count*2]&0x7ff)+0x800; // +0xc00 for korean text
275         UINT16 tile = (m_tilemapram[count*2]&0xff);
276         tile += m_txt_bank * 0x100;
267277         drawgfx_transpen(bitmap,cliprect,gfx,tile,0,0,0,x*8,-16+y*8,0);
268278         count++;
269279      }
r18311r18312
273283}
274284
275285
276WRITE16_MEMBER(blackt96_state::blackt96_c0000_w)
286WRITE16_MEMBER(blackt96_state::blackt96_80000_w)
277287{
278   printf("blackt96_c0000_w %04x %04x\n",data,mem_mask);
288   // TO sound MCU?
289   //printf("blackt96_80000_w %04x %04x\n",data,mem_mask);
279290}
280291
281WRITE16_MEMBER(blackt96_state::blackt96_80000_w)
292
293WRITE16_MEMBER(blackt96_state::blackt96_c0000_w)
282294{
283   // TO sound MCU?
284   printf("blackt96_80000_w %04x %04x\n",data,mem_mask);
295   // unknown, also sound mcu?
296   // -bbb --21
297   // 1 - coin counter 1
298   // 2 - coin counter 2
299   // b = text tile bank?
300
301   m_txt_bank = (data & 0xf0)>>4;
302
303   printf("blackt96_c0000_w %04x %04x\n",data & 0xfc,mem_mask);
285304}
286305
287306
r18311r18312
289308   AM_RANGE(0x000000, 0x07ffff) AM_ROM
290309   AM_RANGE(0x080000, 0x080001) AM_READ_PORT("P1_P2") AM_WRITE(blackt96_80000_w)
291310   AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("IN1") AM_WRITE(blackt96_c0000_w) // COIN INPUT
292   AM_RANGE(0x0e0000, 0x0e0001) AM_READ_PORT("IN2")
293   AM_RANGE(0x0e8000, 0x0e8001) AM_READ_PORT("IN3")
311   AM_RANGE(0x0e0000, 0x0e0001) AM_READ( random_r ) // AM_READ_PORT("IN2")  // unk, from sound?
312   AM_RANGE(0x0e8000, 0x0e8001) AM_READ( random_r ) // AM_READ_PORT("IN3")  // unk, from sound?
294313   AM_RANGE(0x0f0000, 0x0f0001) AM_READ_PORT("DSW1")
295314   AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW2")
296315
297316   AM_RANGE(0x100000, 0x100fff) AM_RAM AM_SHARE("tilemapram") // text tilemap
298   AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(bg_videoram0_w) AM_SHARE("spriteram0")
299   AM_RANGE(0x201000, 0x201fff) AM_RAM_WRITE(bg_videoram1_w) AM_SHARE("spriteram1")
300   AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(bg_videoram2_w) AM_SHARE("spriteram2")
301   AM_RANGE(0x203000, 0x203fff) AM_RAM_WRITE(bg_videoram3_w) AM_SHARE("spriteram3")
317   AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(bg_videoram0_w) AM_SHARE("spriteram0") // this is the 'list'
318   AM_RANGE(0x201000, 0x201fff) AM_RAM_WRITE(bg_videoram1_w) AM_SHARE("spriteram1") // sprites layer 0
319   AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(bg_videoram2_w) AM_SHARE("spriteram2") // bg layer?
320   AM_RANGE(0x203000, 0x203fff) AM_RAM_WRITE(bg_videoram3_w) AM_SHARE("spriteram3") // sprites layer 1
321   // the following potentially exist (the ram is cleared, there is room for entries in the 'spriteram0' region
322   // but they never get used..)
302323   AM_RANGE(0x204000, 0x204fff) AM_RAM_WRITE(bg_videoram4_w) AM_SHARE("spriteram4")
303324   AM_RANGE(0x205000, 0x205fff) AM_RAM_WRITE(bg_videoram5_w) AM_SHARE("spriteram5")
304325   AM_RANGE(0x206000, 0x206fff) AM_RAM_WRITE(bg_videoram6_w) AM_SHARE("spriteram6")
r18311r18312
318339   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
319340   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
320341   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
321   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
322   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
323   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
342   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) // kick
343   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) // jump
344   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // punch / pick up
324345   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
325346   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
326347   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
327348   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
328349   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
329   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
330   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
331   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
350   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) // kick
351   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) // jump
352   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // punch / pick up
332353   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
333354
334355   PORT_START("IN1")
335356   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) // Test mode lists this as Service 1, but it appears to be Coin 1 (uses Coin 1 coinage etc.)
336   PORT_DIPNAME( 0x0002, 0x0002, "xx")
337   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
338   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
339   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
340   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
341   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
342   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
343   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
344   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
345   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) // Test mode lists this as Coin 1, but it doesn't work
346   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
347   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
357   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE1 ) // acts as a serive mode mirror
358   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN )
359   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN )
360   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // Test mode lists this as Coin 1, but it doesn't work
348361   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_COIN2 )
349   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
350   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
351   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
352   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
353   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
354   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
355   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
356   PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
357   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
358   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
359   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
360   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
361   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
362   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
363   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
364   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
365   PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
366   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
367   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
368   PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
369   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
370   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
371   PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
372   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
373   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
374   PORT_DIPSETTING(      0x4000, DEF_STR( Off ) )
375   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
376   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
377   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
378   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
379
362   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN )
363   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN )
364   PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNKNOWN )
365   
366#if 0
380367   PORT_START("IN2")
381368   PORT_DIPNAME( 0x0001, 0x0001, "2" )
382369   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
r18311r18312
476463   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
477464   PORT_DIPSETTING(      0x8000, DEF_STR( Off ) )
478465   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
466#endif
479467
480468    /* Dipswitch Port A */
481469   PORT_START("DSW1")
r18311r18312
505493    /* Dipswitch Port B */
506494   PORT_START("DSW2")
507495   PORT_SERVICE( 0x0100, IP_ACTIVE_HIGH ) PORT_DIPLOCATION("SW2:!8")
508   PORT_DIPNAME( 0x0200, 0x0200, "Continue" ) PORT_DIPLOCATION("SW2:!7")
496   PORT_DIPNAME( 0x0200, 0x0000, "Continue" ) PORT_DIPLOCATION("SW2:!7")
509497   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
510498   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
511499   PORT_DIPNAME( 0x0c00, 0x0400, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:!5,!6")
r18311r18312
620608   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
621609   MCFG_SCREEN_SIZE(256, 256)
622610//  MCFG_SCREEN_VISIBLE_AREA(0*8, 16*32-1, 0*8, 16*32-1)
623   MCFG_SCREEN_VISIBLE_AREA(0*8, 256-1, 0*8, 208-1)
611   MCFG_SCREEN_VISIBLE_AREA(0*8, 256-1, 0*8, 224-1)
624612   MCFG_SCREEN_UPDATE_DRIVER(blackt96_state, screen_update_blackt96)
625613
626614   MCFG_PALETTE_LENGTH(0x800)
r18311r18312
664652   ROM_LOAD32_BYTE( "13", 0x00002, 0x40000, CRC(0acceb9d) SHA1(e8a85c7eab45d84613ac37a9b7ffbc45b44eb2e5) )
665653   ROM_LOAD32_BYTE( "14", 0x00003, 0x40000, CRC(b5e3de25) SHA1(33ac5602ab6bcadc8b0d1aa805a3bdce0b67c215) )
666654
667   ROM_REGION( 0x20000, "gfx3", 0 ) // txt tiles
668   ROM_LOAD16_BYTE( "9",  0x00000, 0x10000, CRC(81a4cf4c) SHA1(94b2bbcbc8327d9babbc3b222bd88954c7e7b80e) )
669   ROM_LOAD16_BYTE( "10", 0x00001, 0x10000, CRC(b78232a2) SHA1(36a4f01011faf64e46b73f0082ab04843ac8b0e2) )
655   ROM_REGION( 0x10000, "gfx3", 0 ) // txt tiles
656   ROM_LOAD16_BYTE( "9",  0x00000, 0x08000, CRC(81a4cf4c) SHA1(94b2bbcbc8327d9babbc3b222bd88954c7e7b80e) )
657   ROM_CONTINUE(          0x00000, 0x08000 ) // first half is empty
658   ROM_LOAD16_BYTE( "10", 0x00001, 0x08000, CRC(b78232a2) SHA1(36a4f01011faf64e46b73f0082ab04843ac8b0e2) )
659   ROM_CONTINUE(          0x00001, 0x08000 ) // first half is empty
670660ROM_END
671661
672662GAME( 1996, blackt96,    0,        blackt96,    blackt96, driver_device,    0, ROT0,  "D.G.R.M.", "Black Touch '96", GAME_NOT_WORKING | GAME_NO_SOUND )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team