Previous 199869 Revisions Next

r21840 Wednesday 13th March, 2013 at 22:47:31 UTC by David Haywood
popobear - change how we handle transpen
[src/mame/drivers]popobear.c

trunk/src/mame/drivers/popobear.c
r21839r21840
66
77    TODO:
88    - auto-animation speed is erratic (way too fast);
9    - tilemap effects (scrolling, colscroll, linescroll);
10     (high score table?)
119    - BGM seems quite off, YM2413 core bug?
10   - IRQ generation;
11      - all possible related to some timers?
12 
13   
1214    - I/Os;
13    - IRQ generation;
1415    - Port 0x620000 is quite a mystery, some silly protection?
1516
1617============================================================================================
r21839r21840
267268         int width = 8 << ((param & 0x30)>>4);
268269         int height = width; // sprites are always square?
269270
270         int color_bank = ((param & 0xc)<<4);
271         int color_bank = ((param & 0xc)>>2);
271272         int x_dir = param & 0x40;
272273         int y_dir = param & 0x80;
273274
r21839r21840
290291               UINT8 pix = (vram[spr_num^1] & 0xff);
291292               int x_draw = (x_dir) ? x+((width-1) - xi) : x+xi;
292293
293               if(cliprect.contains(x_draw, y_draw) && pix)
294                  bitmap.pix16(y_draw, x_draw) = machine().pens[pix+0x100+color_bank];
294               if(cliprect.contains(x_draw, y_draw))
295               {
296                  // this is a bit strange, pix data is basically 8-bit
297                  // but we have to treat 0x00, 0x20, 0x40, 0x60, 0x80, 0xa0, 0xc0 and 0xe0 as transpens?
298                  // see scores when you colect an item
299                  // granularity also means colour bank is applied *0x40
300                  // and we have 2 more possible colour bank bits
301                  if (pix&0x1f)
302                  {
303                     bitmap.pix16(y_draw, x_draw) = machine().pens[((pix+(color_bank*0x40))&0xff)+0x100];
304                  }
305               }
295306
296307               spr_num++;
297308            }
r21839r21840
314325   //popmessage("%04x",m_vregs[0/2]);
315326   UINT16* vreg = m_vregs;
316327
317   popmessage("%04x %04x %04x %04x %04x %04x %04x - %04x - %04x %04x",vreg[0x00],vreg[0x01],vreg[0x02],vreg[0x03],vreg[0x04],vreg[0x05],vreg[0x06], vreg[0x0b],vreg[0x0e],vreg[0x0f]);
328//   popmessage("%04x %04x %04x %04x %04x %04x %04x - %04x - %04x %04x",vreg[0x00],vreg[0x01],vreg[0x02],vreg[0x03],vreg[0x04],vreg[0x05],vreg[0x06], vreg[0x0b],vreg[0x0e],vreg[0x0f]);
318329
330   // vreg[0x00] also looks like it could be some enable registers
331   // 0x82ff - BMC logo
332   // 0x8aff - some attract scenes (no sprites)
333   // 0x8bff - game attract scense etc. (sprites)
319334
335   // vreg[0x01] is always
336   // 0xfefb
320337
338
339
321340   // these are more than just enable, they get written with 0x0d and 0x1f (and 0x00 when a layer is off)
322341   // seems to be related to the linescroll mode at least? maybe sizes?
323342   int enable0 = (m_vregs[0x0c] & 0xff00)>>8;
r21839r21840
327346
328347   if ((enable0 != 0x00) && (enable0 != 0x0d) && (enable0 != 0x1f)) printf("unknown enable0 value %02x\n", enable0);
329348   if ((enable1 != 0x00) && (enable1 != 0x0d) && (enable1 != 0x1f)) printf("unknown enable1 value %02x\n", enable1);
330   if ((enable2 != 0x00) && (enable2 != 0x0d) && (enable2 != 0x1f)) printf("unknown enable2 value %02x\n", enable2);
331   if ((enable3 != 0x00) && (enable3 != 0x0d) && (enable3 != 0x1f)) printf("unknown enable3 value %02x\n", enable3);
349   if ((enable2 != 0x00) && (enable2 != 0x0d)) printf("unknown enable2 value %02x\n", enable2);
350   if ((enable3 != 0x00) && (enable3 != 0x0d)) printf("unknown enable3 value %02x\n", enable3);
332351
333352
334353   // the lower 2 tilemaps use regular scrolling
r21839r21840
574593      m_maincpu->set_input_line(5, ASSERT_LINE);
575594
576595   /* TODO: actually a timer irq, tied with YM2413 sound chip (controls BGM tempo) */
596   /* the YM2413 doesn't have interrupts? */
577597   if(scanline == 64 || scanline == 192)
578598      m_maincpu->set_input_line(2, ASSERT_LINE);
579599}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team