Previous 199869 Revisions Next

r21029 Wednesday 13th February, 2013 at 14:00:25 UTC by Miodrag Milanović
Modernization of drivers part 24 (no whatsnew)
[src/mame/drivers]crystal.c cubeqst.c gal3.c looping.c midas.c namcos10.c nwk-tr.c r2dx_v33.c rabbit.c tmmjprd.c witch.c

trunk/src/mame/drivers/r2dx_v33.c
r21028r21029
7272   virtual void video_start();
7373   UINT32 screen_update_rdx_v33(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7474   INTERRUPT_GEN_MEMBER(rdx_v33_interrupt);
75   void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri);
7576};
7677
7778
r21028r21029
116117}
117118
118119/* copied from Legionnaire */
119static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,int pri)
120void r2dx_v33_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri)
120121{
121   r2dx_v33_state *state = machine.driver_data<r2dx_v33_state>();
122   UINT16 *spriteram16 = state->m_spriteram;
122   UINT16 *spriteram16 = m_spriteram;
123123   int offs,fx,fy,x,y,color,sprite;
124124//  int cur_pri;
125125   int dx,dy,ax,ay;
r21028r21029
160160            for (ax=0; ax<dx; ax++)
161161               for (ay=0; ay<dy; ay++)
162162               {
163                  drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
163                  drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
164164                  sprite++,
165165                  color,fx,fy,x+ax*16,y+ay*16,15);
166166               }
r21028r21029
170170            for (ax=0; ax<dx; ax++)
171171               for (ay=0; ay<dy; ay++)
172172               {
173                  drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
173                  drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
174174                  sprite++,
175175                  color,fx,fy,x+ax*16,y+(dy-ay-1)*16,15);
176176               }
r21028r21029
183183            for (ax=0; ax<dx; ax++)
184184               for (ay=0; ay<dy; ay++)
185185               {
186                  drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
186                  drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
187187                  sprite++,
188188                  color,fx,fy,x+(dx-ax-1)*16,y+ay*16,15);
189189               }
r21028r21029
193193            for (ax=0; ax<dx; ax++)
194194               for (ay=0; ay<dy; ay++)
195195               {
196                  drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
196                  drawgfx_transpen(bitmap,cliprect,machine().gfx[0],
197197                  sprite++,
198198                  color,fx,fy,x+(dx-ax-1)*16,y+(dy-ay-1)*16,15);
199199               }
r21028r21029
223223   m_md_tilemap->draw(bitmap, cliprect, 0, 0);
224224   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
225225
226   draw_sprites(machine(),bitmap,cliprect,0);
226   draw_sprites(bitmap,cliprect,0);
227227
228228   m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
229229
trunk/src/mame/drivers/looping.c
r21028r21029
144144   virtual void palette_init();
145145   UINT32 screen_update_looping(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
146146   INTERRUPT_GEN_MEMBER(looping_interrupt);
147   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
147148};
148149
149150
r21028r21029
273274 *
274275 *************************************/
275276
276static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
277void looping_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
277278{
278279   const UINT8 *source;
279   looping_state *state = machine.driver_data<looping_state>();
280280
281   for (source = state->m_spriteram; source < state->m_spriteram + 0x40; source += 4)
281   for (source = m_spriteram; source < m_spriteram + 0x40; source += 4)
282282   {
283283      int sx = source[3];
284284      int sy = 240 - source[0];
r21028r21029
287287      int code  = source[1] & 0x3f;
288288      int color = source[2];
289289
290      if (state->flip_screen_x())
290      if (flip_screen_x())
291291      {
292292         sx = 240 - sx;
293293         flipx = !flipx;
294294      }
295295
296      if (state->flip_screen_y())
296      if (flip_screen_y())
297297      {
298298         sy = 240 - sy;
299299         flipy = !flipy;
300300      }
301301
302      drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, 0);
302      drawgfx_transpen(bitmap, cliprect, machine().gfx[1], code, color, flipx, flipy, sx, sy, 0);
303303   }
304304}
305305
r21028r21029
308308{
309309   m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
310310
311   draw_sprites(machine(), bitmap, cliprect);
311   draw_sprites(bitmap, cliprect);
312312   return 0;
313313}
314314
trunk/src/mame/drivers/nwk-tr.c
r21028r21029
256256   virtual void machine_reset();
257257   UINT32 screen_update_nwktr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
258258   TIMER_CALLBACK_MEMBER(irq_off);
259   void lanc2_init();
259260};
260261
261262
r21028r21029
372373}
373374
374375
375static void lanc2_init(running_machine &machine)
376void nwktr_state::lanc2_init()
376377{
377   nwktr_state *state = machine.driver_data<nwktr_state>();
378   state->m_fpga_uploaded = 0;
379   state->m_lanc2_ram_r = 0;
380   state->m_lanc2_ram_w = 0;
381   state->m_lanc2_ram = auto_alloc_array(machine, UINT8, 0x8000);
378   m_fpga_uploaded = 0;
379   m_lanc2_ram_r = 0;
380   m_lanc2_ram_w = 0;
381   m_lanc2_ram = auto_alloc_array(machine(), UINT8, 0x8000);
382382}
383383
384384READ32_MEMBER(nwktr_state::lanc1_r)
r21028r21029
781781   m_sharc_dataram = auto_alloc_array(machine(), UINT32, 0x100000/4);
782782   m_led_reg0 = m_led_reg1 = 0x7f;
783783
784   lanc2_init(machine());
784   lanc2_init();
785785}
786786
787787/*****************************************************************************/
trunk/src/mame/drivers/cubeqst.c
r21028r21029
5959   UINT32 screen_update_cubeqst(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
6060   INTERRUPT_GEN_MEMBER(vblank);
6161   TIMER_CALLBACK_MEMBER(delayed_bank_swap);
62   void swap_linecpu_banks();
6263};
6364
6465
r21028r21029
266267}
267268
268269
269static void swap_linecpu_banks(running_machine &machine)
270void cubeqst_state::swap_linecpu_banks()
270271{
271   cubeqst_state *state = machine.driver_data<cubeqst_state>();
272272   /* Best sync up before we switch banks around */
273   machine.scheduler().synchronize(timer_expired_delegate(FUNC(cubeqst_state::delayed_bank_swap),state));
273   machine().scheduler().synchronize(timer_expired_delegate(FUNC(cubeqst_state::delayed_bank_swap),this));
274274}
275275
276276
r21028r21029
290290
291291   /* Swap stack and pointer RAM banks on rising edge of display reset */
292292   if (!BIT(m_reset_latch, 0) && BIT(data, 0))
293      swap_linecpu_banks(machine());
293      swap_linecpu_banks();
294294
295295   if (!BIT(data, 2))
296296      m_laserdisc->reset();
trunk/src/mame/drivers/rabbit.c
r21028r21029
140140   UINT32 screen_update_rabbit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
141141   INTERRUPT_GEN_MEMBER(rabbit_vblank_interrupt);
142142   TIMER_CALLBACK_MEMBER(rabbit_blit_done);
143   inline void get_rabbit_tilemap_info(tile_data &tileinfo, int tile_index, int whichtilemap, int tilesize);
144   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
145   void rabbit_clearspritebitmap( bitmap_ind16 &bitmap, const rectangle &cliprect );
146   void draw_sprite_bitmap( bitmap_ind16 &bitmap, const rectangle &cliprect );
147   void rabbit_drawtilemap( bitmap_ind16 &bitmap, const rectangle &cliprect, int whichtilemap );
148   void rabbit_do_blit();
143149};
144150
145151
146152/* call with tilesize = 0 for 8x8 or 1 for 16x16 */
147INLINE void get_rabbit_tilemap_info(running_machine &machine, tile_data &tileinfo, int tile_index, int whichtilemap, int tilesize)
153void rabbit_state::get_rabbit_tilemap_info(tile_data &tileinfo, int tile_index, int whichtilemap, int tilesize)
148154{
149   rabbit_state *state = machine.driver_data<rabbit_state>();
150155   /* fedcba98 76543210 fedcba98 76543210
151156      x                                    color mask? how exactly does it relate to color bits?
152157       xx                                  flip
r21028r21029
155160                   xxxx                    bank
156161                        xxxxxxxx xxxxxxxx  tile
157162   */
158   int depth = (state->m_tilemap_ram[whichtilemap][tile_index]&0x10000000)>>28;
159   int tileno = state->m_tilemap_ram[whichtilemap][tile_index]&0xffff;
160   int bank = (state->m_tilemap_ram[whichtilemap][tile_index]&0x000f0000)>>16;
161   int colour = (state->m_tilemap_ram[whichtilemap][tile_index]>>20)&0xff;
162   int cmask = state->m_tilemap_ram[whichtilemap][tile_index]>>31&1;
163   int flipxy = (state->m_tilemap_ram[whichtilemap][tile_index]>>29)&3;
163   int depth = (m_tilemap_ram[whichtilemap][tile_index]&0x10000000)>>28;
164   int tileno = m_tilemap_ram[whichtilemap][tile_index]&0xffff;
165   int bank = (m_tilemap_ram[whichtilemap][tile_index]&0x000f0000)>>16;
166   int colour = (m_tilemap_ram[whichtilemap][tile_index]>>20)&0xff;
167   int cmask = m_tilemap_ram[whichtilemap][tile_index]>>31&1;
168   int flipxy = (m_tilemap_ram[whichtilemap][tile_index]>>29)&3;
164169
165   if (state->m_banking)
170   if (m_banking)
166171   {
167172      switch (bank)
168173      {
r21028r21029
193198      colour &= 0x0f;
194199      colour += 0x20;
195200      tileinfo.group = 1;
196      SET_TILE_INFO(6+tilesize,tileno,colour,TILE_FLIPXY(flipxy));
201      SET_TILE_INFO_MEMBER(6+tilesize,tileno,colour,TILE_FLIPXY(flipxy));
197202   }
198203   else
199204   {
r21028r21029
201206      if (cmask) colour&=0x3f; // see health bars
202207      colour += 0x200;
203208      tileinfo.group = 0;
204      SET_TILE_INFO(4+tilesize,tileno,colour,TILE_FLIPXY(flipxy));
209      SET_TILE_INFO_MEMBER(4+tilesize,tileno,colour,TILE_FLIPXY(flipxy));
205210   }
206211}
207212
208213TILE_GET_INFO_MEMBER(rabbit_state::get_rabbit_tilemap0_tile_info)
209214{
210   get_rabbit_tilemap_info(machine(),tileinfo,tile_index,0,1);
215   get_rabbit_tilemap_info(tileinfo,tile_index,0,1);
211216}
212217
213218TILE_GET_INFO_MEMBER(rabbit_state::get_rabbit_tilemap1_tile_info)
214219{
215   get_rabbit_tilemap_info(machine(),tileinfo,tile_index,1,1);
220   get_rabbit_tilemap_info(tileinfo,tile_index,1,1);
216221}
217222
218223TILE_GET_INFO_MEMBER(rabbit_state::get_rabbit_tilemap2_tile_info)
219224{
220   get_rabbit_tilemap_info(machine(),tileinfo,tile_index,2,1);
225   get_rabbit_tilemap_info(tileinfo,tile_index,2,1);
221226}
222227
223228TILE_GET_INFO_MEMBER(rabbit_state::get_rabbit_tilemap3_tile_info)
224229{
225   get_rabbit_tilemap_info(machine(),tileinfo,tile_index,3,0);
230   get_rabbit_tilemap_info(tileinfo,tile_index,3,0);
226231}
227232
228233WRITE32_MEMBER(rabbit_state::rabbit_tilemap0_w)
r21028r21029
269274
270275*/
271276
272static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
277void rabbit_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
273278{
274   rabbit_state *state = machine.driver_data<rabbit_state>();
275279   int xpos,ypos,tileno,xflip,yflip, colr;
276   gfx_element *gfx = machine.gfx[1];
277   int todraw = (state->m_spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half?
280   gfx_element *gfx = machine().gfx[1];
281   int todraw = (m_spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half?
278282
279   UINT32 *source = (state->m_spriteram+ (todraw*2))-2;
280   UINT32 *finish = state->m_spriteram;
283   UINT32 *source = (m_spriteram+ (todraw*2))-2;
284   UINT32 *finish = m_spriteram;
281285
282//  state->m_sprite_bitmap->fill(0x0, state->m_sprite_clip); // sloooow
286//  m_sprite_bitmap->fill(0x0, m_sprite_clip); // sloooow
283287
284288   while( source>=finish )
285289   {
r21028r21029
296300
297301      if(xpos&0x800)xpos-=0x1000;
298302
299      drawgfx_transpen(*state->m_sprite_bitmap,state->m_sprite_clip,gfx,tileno,colr,!xflip/*wrongdecode?*/,yflip,xpos+0x20-8/*-(state->m_spriteregs[0]&0x00000fff)*/,ypos-24/*-((state->m_spriteregs[1]&0x0fff0000)>>16)*/,15);
300//      drawgfx_transpen(bitmap,cliprect,gfx,tileno,colr,!xflip/*wrongdecode?*/,yflip,xpos+0xa0-8/*-(state->m_spriteregs[0]&0x00000fff)*/,ypos-24+0x80/*-((state->m_spriteregs[1]&0x0fff0000)>>16)*/,0);
303      drawgfx_transpen(*m_sprite_bitmap,m_sprite_clip,gfx,tileno,colr,!xflip/*wrongdecode?*/,yflip,xpos+0x20-8/*-(m_spriteregs[0]&0x00000fff)*/,ypos-24/*-((m_spriteregs[1]&0x0fff0000)>>16)*/,15);
304//      drawgfx_transpen(bitmap,cliprect,gfx,tileno,colr,!xflip/*wrongdecode?*/,yflip,xpos+0xa0-8/*-(m_spriteregs[0]&0x00000fff)*/,ypos-24+0x80/*-((m_spriteregs[1]&0x0fff0000)>>16)*/,0);
301305
302306
303307      source-=2;
r21028r21029
307311}
308312
309313/* the sprite bitmap can probably be handled better than this ... */
310static void rabbit_clearspritebitmap( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
314void rabbit_state::rabbit_clearspritebitmap( bitmap_ind16 &bitmap, const rectangle &cliprect )
311315{
312   rabbit_state *state = machine.driver_data<rabbit_state>();
313316   int startx, starty;
314317   int y;
315318   int amountx,amounty;
316319   UINT16 *dstline;
317320
318321   /* clears a *sensible* amount of the sprite bitmap */
319   startx = (state->m_spriteregs[0]&0x00000fff);
320   starty = (state->m_spriteregs[1]&0x0fff0000)>>16;
322   startx = (m_spriteregs[0]&0x00000fff);
323   starty = (m_spriteregs[1]&0x0fff0000)>>16;
321324
322325   startx-=200;
323326   starty-=200;
r21028r21029
329332
330333   for (y=0; y<amounty;y++)
331334   {
332      dstline = &state->m_sprite_bitmap->pix16((starty+y)&0xfff);
335      dstline = &m_sprite_bitmap->pix16((starty+y)&0xfff);
333336      memset(dstline+startx,0x00,amountx*2);
334337   }
335338}
336339
337340/* todo: fix zoom, its inaccurate and this code is ugly */
338static void draw_sprite_bitmap( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
341void rabbit_state::draw_sprite_bitmap( bitmap_ind16 &bitmap, const rectangle &cliprect )
339342{
340   rabbit_state *state = machine.driver_data<rabbit_state>();
341343
342344   UINT32 x,y;
343345   UINT16 *srcline;
r21028r21029
348350   UINT32 xstep,ystep;
349351
350352   int startx, starty;
351   startx = ((state->m_spriteregs[0]&0x00000fff));
352   starty = ((state->m_spriteregs[1]&0x0fff0000)>>16);
353   startx = ((m_spriteregs[0]&0x00000fff));
354   starty = ((m_spriteregs[1]&0x0fff0000)>>16);
353355
354356   /* zoom compensation? */
355   startx-=((state->m_spriteregs[1]&0x000001ff)>>1);
356   starty-=((state->m_spriteregs[1]&0x000001ff)>>1);
357   startx-=((m_spriteregs[1]&0x000001ff)>>1);
358   starty-=((m_spriteregs[1]&0x000001ff)>>1);
357359
358360
359   xsize = ((state->m_spriteregs[2]&0x0000ffff));
360   ysize = ((state->m_spriteregs[3]&0x0000ffff));
361   xsize = ((m_spriteregs[2]&0x0000ffff));
362   ysize = ((m_spriteregs[3]&0x0000ffff));
361363   xsize+=0x80;
362364   ysize+=0x80;
363365   xstep = ((320*128)<<16) / xsize;
r21028r21029
370372
371373      if ((ydrawpos >= cliprect.min_y) && (ydrawpos <= cliprect.max_y))
372374      {
373         srcline = &state->m_sprite_bitmap->pix16((starty+(y>>7))&0xfff);
375         srcline = &m_sprite_bitmap->pix16((starty+(y>>7))&0xfff);
374376         dstline = &bitmap.pix16(ydrawpos);
375377
376378         for (x=0;x<xsize;x+=0x80)
r21028r21029
439441
440442*/
441443
442static void rabbit_drawtilemap( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int whichtilemap )
444void rabbit_state::rabbit_drawtilemap( bitmap_ind16 &bitmap, const rectangle &cliprect, int whichtilemap )
443445{
444   rabbit_state *state = machine.driver_data<rabbit_state>();
445446   INT32 startx, starty, incxx, incxy, incyx, incyy, tran;
446447
447   startx=((state->m_tilemap_regs[whichtilemap][1]&0x0000ffff));  // >>4 for nonzoomed pixel scroll value
448   starty=((state->m_tilemap_regs[whichtilemap][1]&0xffff0000)>>16); // >> 20 for nonzoomed pixel scroll value
449   incxx= ((state->m_tilemap_regs[whichtilemap][3]&0x00000fff)); // 0x800 when non-zoomed
450   incyy= ((state->m_tilemap_regs[whichtilemap][4]&0x0fff0000)>>16);
448   startx=((m_tilemap_regs[whichtilemap][1]&0x0000ffff));  // >>4 for nonzoomed pixel scroll value
449   starty=((m_tilemap_regs[whichtilemap][1]&0xffff0000)>>16); // >> 20 for nonzoomed pixel scroll value
450   incxx= ((m_tilemap_regs[whichtilemap][3]&0x00000fff)); // 0x800 when non-zoomed
451   incyy= ((m_tilemap_regs[whichtilemap][4]&0x0fff0000)>>16);
451452
452453   incxy = 0; incyx = 0;
453454   tran = 1;
r21028r21029
457458      startx/starty are also 16.16 scrolling
458459     */
459460
460   state->m_tilemap[whichtilemap]->draw_roz(bitmap, cliprect, startx << 12,starty << 12,
461   m_tilemap[whichtilemap]->draw_roz(bitmap, cliprect, startx << 12,starty << 12,
461462         incxx << 5,incxy << 8,incyx << 8,incyy << 5,
462463         1,  /* wraparound */
463464         tran ? 0 : TILEMAP_DRAW_OPAQUE,0);
r21028r21029
485486   /* prio isnt certain but seems to work.. */
486487   for (prilevel = 0xf; prilevel >0; prilevel--)
487488   {
488      if (prilevel == ((m_tilemap_regs[3][0]&0x0f000000)>>24)) rabbit_drawtilemap(machine(),bitmap,cliprect, 3);
489      if (prilevel == ((m_tilemap_regs[2][0]&0x0f000000)>>24)) rabbit_drawtilemap(machine(),bitmap,cliprect, 2);
490      if (prilevel == ((m_tilemap_regs[1][0]&0x0f000000)>>24)) rabbit_drawtilemap(machine(),bitmap,cliprect, 1);
491      if (prilevel == ((m_tilemap_regs[0][0]&0x0f000000)>>24)) rabbit_drawtilemap(machine(),bitmap,cliprect, 0);
489      if (prilevel == ((m_tilemap_regs[3][0]&0x0f000000)>>24)) rabbit_drawtilemap(bitmap,cliprect, 3);
490      if (prilevel == ((m_tilemap_regs[2][0]&0x0f000000)>>24)) rabbit_drawtilemap(bitmap,cliprect, 2);
491      if (prilevel == ((m_tilemap_regs[1][0]&0x0f000000)>>24)) rabbit_drawtilemap(bitmap,cliprect, 1);
492      if (prilevel == ((m_tilemap_regs[0][0]&0x0f000000)>>24)) rabbit_drawtilemap(bitmap,cliprect, 0);
492493
493494      if (prilevel == 0x09) // should it be selectable?
494495      {
495         rabbit_clearspritebitmap(machine(),bitmap,cliprect);
496         draw_sprites(machine(),bitmap,cliprect);  // render to bitmap
497         draw_sprite_bitmap(machine(),bitmap,cliprect); // copy bitmap to screen
496         rabbit_clearspritebitmap(bitmap,cliprect);
497         draw_sprites(bitmap,cliprect);  // render to bitmap
498         draw_sprite_bitmap(bitmap,cliprect); // copy bitmap to screen
498499      }
499500   }
500501   return 0;
r21028r21029
563564   machine().device("maincpu")->execute().set_input_line(m_bltirqlevel, HOLD_LINE);
564565}
565566
566static void rabbit_do_blit(running_machine &machine)
567void rabbit_state::rabbit_do_blit()
567568{
568   rabbit_state *state = machine.driver_data<rabbit_state>();
569   UINT8 *blt_data = state->memregion("gfx1")->base();
570   int blt_source = (state->m_blitterregs[0]&0x000fffff)>>0;
571   int blt_column = (state->m_blitterregs[1]&0x00ff0000)>>16;
572   int blt_line   = (state->m_blitterregs[1]&0x000000ff);
573   int blt_tilemp = (state->m_blitterregs[2]&0x0000e000)>>13;
574   int blt_oddflg = (state->m_blitterregs[2]&0x00000001)>>0;
569   UINT8 *blt_data = memregion("gfx1")->base();
570   int blt_source = (m_blitterregs[0]&0x000fffff)>>0;
571   int blt_column = (m_blitterregs[1]&0x00ff0000)>>16;
572   int blt_line   = (m_blitterregs[1]&0x000000ff);
573   int blt_tilemp = (m_blitterregs[2]&0x0000e000)>>13;
574   int blt_oddflg = (m_blitterregs[2]&0x00000001)>>0;
575575   int mask,shift;
576576
577577
578   if(BLITCMDLOG) mame_printf_debug("BLIT command %08x %08x %08x\n", state->m_blitterregs[0], state->m_blitterregs[1], state->m_blitterregs[2]);
578   if(BLITCMDLOG) mame_printf_debug("BLIT command %08x %08x %08x\n", m_blitterregs[0], m_blitterregs[1], m_blitterregs[2]);
579579
580580   if (blt_oddflg&1)
581581   {
r21028r21029
608608            if (!blt_amount)
609609            {
610610               if(BLITLOG) mame_printf_debug("end of blit list\n");
611               machine.scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(rabbit_state::rabbit_blit_done),state));
611               machine().scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(rabbit_state::rabbit_blit_done),this));
612612               return;
613613            }
614614
r21028r21029
618618               blt_value = ((blt_data[blt_source+1]<<8)|(blt_data[blt_source+0]));
619619               blt_source+=2;
620620               writeoffs=blt_oddflg+blt_column;
621               state->m_tilemap_ram[blt_tilemp][writeoffs]=(state->m_tilemap_ram[blt_tilemp][writeoffs]&mask)|(blt_value<<shift);
622               state->m_tilemap[blt_tilemp]->mark_tile_dirty(writeoffs);
621               m_tilemap_ram[blt_tilemp][writeoffs]=(m_tilemap_ram[blt_tilemp][writeoffs]&mask)|(blt_value<<shift);
622               m_tilemap[blt_tilemp]->mark_tile_dirty(writeoffs);
623623
624624               blt_column++;
625625               blt_column&=0x7f;
r21028r21029
635635            for (loopcount=0;loopcount<blt_amount;loopcount++)
636636            {
637637               writeoffs=blt_oddflg+blt_column;
638               state->m_tilemap_ram[blt_tilemp][writeoffs]=(state->m_tilemap_ram[blt_tilemp][writeoffs]&mask)|(blt_value<<shift);
639               state->m_tilemap[blt_tilemp]->mark_tile_dirty(writeoffs);
638               m_tilemap_ram[blt_tilemp][writeoffs]=(m_tilemap_ram[blt_tilemp][writeoffs]&mask)|(blt_value<<shift);
639               m_tilemap[blt_tilemp]->mark_tile_dirty(writeoffs);
640640               blt_column++;
641641               blt_column&=0x7f;
642642            }
r21028r21029
645645
646646         case 0x03: /* next line */
647647            if(BLITLOG) mame_printf_debug("blit: move to next line\n");
648            blt_column = (state->m_blitterregs[1]&0x00ff0000)>>16; /* --CC---- */
648            blt_column = (m_blitterregs[1]&0x00ff0000)>>16; /* --CC---- */
649649            blt_oddflg+=128;
650650            break;
651651
r21028r21029
665665
666666   if (offset == 0x0c/4)
667667   {
668      rabbit_do_blit(machine());
668      rabbit_do_blit();
669669   }
670670}
671671
trunk/src/mame/drivers/crystal.c
r21028r21029
196196   TIMER_CALLBACK_MEMBER(Timercb);
197197   IRQ_CALLBACK_MEMBER(icallback);
198198   void crystal_banksw_postload();
199   void IntReq( int num );
200   inline void Timer_w( address_space &space, int which, UINT32 data, UINT32 mem_mask );
201   inline void DMA_w( address_space &space, int which, UINT32 data, UINT32 mem_mask );
202   void PatchReset(  );
203   UINT16 GetVidReg( address_space &space, UINT16 reg );
204   void SetVidReg( address_space &space, UINT16 reg, UINT16 val );
199205};
200206
201static void IntReq( running_machine &machine, int num )
207void crystal_state::IntReq( int num )
202208{
203   crystal_state *state = machine.driver_data<crystal_state>();
204   address_space &space = state->m_maincpu->space(AS_PROGRAM);
209   address_space &space = m_maincpu->space(AS_PROGRAM);
205210   UINT32 IntEn = space.read_dword(0x01800c08);
206211   UINT32 IntPend = space.read_dword(0x01800c0c);
207212   if (IntEn & (1 << num))
208213   {
209214      IntPend |= (1 << num);
210215      space.write_dword(0x01800c0c, IntPend);
211      state->m_maincpu->set_input_line(SE3208_INT, ASSERT_LINE);
216      m_maincpu->set_input_line(SE3208_INT, ASSERT_LINE);
212217   }
213218#ifdef IDLE_LOOP_SPEEDUP
214   state->m_FlipCntRead = 0;
215   state->m_maincpu->resume(SUSPEND_REASON_SPIN);
219   m_FlipCntRead = 0;
220   m_maincpu->resume(SUSPEND_REASON_SPIN);
216221#endif
217222}
218223
r21028r21029
249254   {
250255      UINT8 Port4 = ioport("SYSTEM")->read();
251256      if (!(Port4 & 0x10) && ((m_OldPort4 ^ Port4) & 0x10))   //coin buttons trigger IRQs
252         IntReq(machine(), 12);
257         IntReq(12);
253258      if (!(Port4 & 0x20) && ((m_OldPort4 ^ Port4) & 0x20))
254         IntReq(machine(), 19);
259         IntReq(19);
255260      m_OldPort4 = Port4;
256261      return /*dips*/ioport("DSW")->read() | (Port4 << 16);
257262   }
r21028r21029
306311   if (!(m_Timerctrl[which] & 2))
307312      m_Timerctrl[which] &= ~1;
308313
309   IntReq(machine(), num[which]);
314   IntReq(num[which]);
310315}
311316
312INLINE void Timer_w( address_space &space, int which, UINT32 data, UINT32 mem_mask )
317void crystal_state::Timer_w( address_space &space, int which, UINT32 data, UINT32 mem_mask )
313318{
314   crystal_state *state = space.machine().driver_data<crystal_state>();
315
316   if (((data ^ state->m_Timerctrl[which]) & 1) && (data & 1)) //Timer activate
319   if (((data ^ m_Timerctrl[which]) & 1) && (data & 1)) //Timer activate
317320   {
318321      int PD = (data >> 8) & 0xff;
319322      int TCV = space.read_dword(0x01801404 + which * 8);
320323      attotime period = attotime::from_hz(43000000) * ((PD + 1) * (TCV + 1));
321324
322      if (state->m_Timerctrl[which] & 2)
323         state->m_Timer[which]->adjust(period, 0, period);
325      if (m_Timerctrl[which] & 2)
326         m_Timer[which]->adjust(period, 0, period);
324327      else
325         state->m_Timer[which]->adjust(period);
328         m_Timer[which]->adjust(period);
326329   }
327   COMBINE_DATA(&state->m_Timerctrl[which]);
330   COMBINE_DATA(&m_Timerctrl[which]);
328331}
329332
330333WRITE32_MEMBER(crystal_state::Timer0_w)
r21028r21029
417420   COMBINE_DATA(&m_PIO);
418421}
419422
420INLINE void DMA_w( address_space &space, int which, UINT32 data, UINT32 mem_mask )
423void crystal_state::DMA_w( address_space &space, int which, UINT32 data, UINT32 mem_mask )
421424{
422   crystal_state *state = space.machine().driver_data<crystal_state>();
423
424   if (((data ^ state->m_DMActrl[which]) & (1 << 10)) && (data & (1 << 10)))   //DMAOn
425   if (((data ^ m_DMActrl[which]) & (1 << 10)) && (data & (1 << 10)))   //DMAOn
425426   {
426427      UINT32 CTR = data;
427428      UINT32 SRC = space.read_dword(0x01800804 + which * 0x10);
r21028r21029
455456      }
456457      data &= ~(1 << 10);
457458      space.write_dword(0x0180080C + which * 0x10, 0);
458      IntReq(space.machine(), 7 + which);
459      IntReq(7 + which);
459460   }
460   COMBINE_DATA(&state->m_DMActrl[which]);
461   COMBINE_DATA(&m_DMActrl[which]);
461462}
462463
463464READ32_MEMBER(crystal_state::DMA0_r)
r21028r21029
515516
516517ADDRESS_MAP_END
517518
518static void PatchReset( running_machine &machine )
519void crystal_state::PatchReset(  )
519520{
520521   //The test menu reset routine seems buggy
521522   //it reads the reset vector from 0x02000000 but it should be
r21028r21029
539540    JMP Loop1
540541*/
541542
542   crystal_state *state = machine.driver_data<crystal_state>();
543543
544544#if 1
545545   static const UINT32 Patch[] =
r21028r21029
552552      0xdef4d4fa
553553   };
554554
555   memcpy(state->m_reset_patch, Patch, sizeof(Patch));
555   memcpy(m_reset_patch, Patch, sizeof(Patch));
556556#else
557557   static const UINT8 Patch[] =
558558   {
r21028r21029
561561      0x20,0x3A,0xD0,0xA1,0xFA,0xD4,0xF4,0xDE
562562   };
563563
564   memcpy(state->m_reset_patch, Patch, sizeof(Patch));
564   memcpy(m_reset_patch, Patch, sizeof(Patch));
565565#endif
566566}
567567
r21028r21029
585585   for (i = 0; i < 4; i++)
586586      m_Timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(crystal_state::Timercb),this), (void*)(FPTR)i);
587587
588   PatchReset(machine());
588   PatchReset();
589589
590590#ifdef IDLE_LOOP_SPEEDUP
591591   save_item(NAME(m_FlipCntRead));
r21028r21029
630630   m_FlipCntRead = 0;
631631#endif
632632
633   PatchReset(machine());
633   PatchReset();
634634}
635635
636static UINT16 GetVidReg( address_space &space, UINT16 reg )
636UINT16 crystal_state::GetVidReg( address_space &space, UINT16 reg )
637637{
638638   return space.read_word(0x03000000 + reg);
639639}
640640
641static void SetVidReg( address_space &space, UINT16 reg, UINT16 val )
641void crystal_state::SetVidReg( address_space &space, UINT16 reg, UINT16 val )
642642{
643643   space.write_word(0x03000000 + reg, val);
644644}
r21028r21029
739739
740740INTERRUPT_GEN_MEMBER(crystal_state::crystal_interrupt)
741741{
742   IntReq(machine(), 24);      //VRender0 VBlank
742   IntReq(24);      //VRender0 VBlank
743743}
744744
745745static INPUT_PORTS_START(crystal)
trunk/src/mame/drivers/tmmjprd.c
r21028r21029
7171   UINT32 screen_update_tmmjprd_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7272   TIMER_CALLBACK_MEMBER(tmmjprd_blit_done);
7373   TIMER_DEVICE_CALLBACK_MEMBER(tmmjprd_scanline);
74   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int screen);
75   void ttmjprd_draw_tile(bitmap_ind16 &bitmap, const rectangle &cliprect, int x,int y,int sizex,int sizey, UINT32 tiledata, UINT8* rom);
76   void ttmjprd_draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32*tileram, UINT32*tileregs, UINT8*rom );
77   void tmmjprd_do_blit();
7478};
7579
7680
r21028r21029
96100   COMBINE_DATA(&m_tilemap_ram[3][offset]);
97101}
98102
99static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int screen)
103void tmmjprd_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int screen)
100104{
101   tmmjprd_state *state = machine.driver_data<tmmjprd_state>();
102105   int xpos,ypos,tileno,xflip,yflip, colr;
103   gfx_element *gfx = machine.gfx[0];
106   gfx_element *gfx = machine().gfx[0];
104107   int xoffs;
105   //  int todraw = (state->m_spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half?
108   //  int todraw = (m_spriteregs[5]&0x0fff0000)>>16; // how many sprites to draw (start/end reg..) what is the other half?
106109
107//  UINT32 *source = (state->m_spriteram+ (todraw*2))-2;
108//  UINT32 *finish = state->m_spriteram;
110//  UINT32 *source = (m_spriteram+ (todraw*2))-2;
111//  UINT32 *finish = m_spriteram;
109112
110   UINT32 *source = state->m_spriteram+(0xc000/4)-2;
111   UINT32 *finish = state->m_spriteram;
113   UINT32 *source = m_spriteram+(0xc000/4)-2;
114   UINT32 *finish = m_spriteram;
112115   xoffs = (screen & 1)*320;
113116
114117   for(;source>finish;source-=2)
r21028r21029
173176   }
174177}
175178
176static void ttmjprd_draw_tile(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int x,int y,int sizex,int sizey, UINT32 tiledata, UINT8* rom)
179void tmmjprd_state::ttmjprd_draw_tile(bitmap_ind16 &bitmap, const rectangle &cliprect, int x,int y,int sizex,int sizey, UINT32 tiledata, UINT8* rom)
177180{
178181   /* note, it's tile address _NOT_ tile number, 'sub-tile' access is possible, hence using the custom rendering */
179182   int tileaddr = (tiledata&0x000fffff)>>0;
r21028r21029
252255   }
253256}
254257
255static void ttmjprd_draw_tilemap(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32*tileram, UINT32*tileregs, UINT8*rom )
258void tmmjprd_state::ttmjprd_draw_tilemap(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32*tileram, UINT32*tileregs, UINT8*rom )
256259{
257260   int y,x;
258261   int count;
r21028r21029
286289      {
287290         UINT32 tiledata = tileram[count];
288291         // todo: handle wraparound
289         ttmjprd_draw_tile(machine,bitmap,cliprect,(x*tile_sizex)-scrollx,(y*tile_sizey)-scrolly,tile_sizex,tile_sizey, tiledata, rom);
292         ttmjprd_draw_tile(bitmap,cliprect,(x*tile_sizex)-scrollx,(y*tile_sizey)-scrolly,tile_sizex,tile_sizey, tiledata, rom);
290293         count++;
291294      }
292295   }
r21028r21029
299302
300303   bitmap.fill(get_black_pen(machine()), cliprect);
301304
302   ttmjprd_draw_tilemap( machine(), bitmap, cliprect, m_tilemap_ram[3], m_tilemap_regs[3], gfxroms );
303   draw_sprites(machine(),bitmap,cliprect, 1);
304   ttmjprd_draw_tilemap( machine(), bitmap, cliprect, m_tilemap_ram[2], m_tilemap_regs[2], gfxroms );
305   ttmjprd_draw_tilemap(bitmap, cliprect, m_tilemap_ram[3], m_tilemap_regs[3], gfxroms );
306   draw_sprites(bitmap,cliprect, 1);
307   ttmjprd_draw_tilemap(bitmap, cliprect, m_tilemap_ram[2], m_tilemap_regs[2], gfxroms );
305308
306309   /*
307310   popmessage("%08x %08x %08x %08x %08x %08x",
r21028r21029
333336
334337   bitmap.fill(get_black_pen(machine()), cliprect);
335338
336   ttmjprd_draw_tilemap( machine(), bitmap, cliprect, m_tilemap_ram[1], m_tilemap_regs[1], gfxroms );
337   draw_sprites(machine(),bitmap,cliprect, 0);
338   ttmjprd_draw_tilemap( machine(), bitmap, cliprect, m_tilemap_ram[0], m_tilemap_regs[0], gfxroms );
339   ttmjprd_draw_tilemap(bitmap, cliprect, m_tilemap_ram[1], m_tilemap_regs[1], gfxroms );
340   draw_sprites(bitmap,cliprect, 0);
341   ttmjprd_draw_tilemap(bitmap, cliprect, m_tilemap_ram[0], m_tilemap_regs[0], gfxroms );
339342
340343   return 0;
341344}
r21028r21029
385388   machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
386389}
387390
388static void tmmjprd_do_blit(running_machine &machine)
391void tmmjprd_state::tmmjprd_do_blit()
389392{
390   tmmjprd_state *state = machine.driver_data<tmmjprd_state>();
391   UINT8 *blt_data = state->memregion("gfx1")->base();
393   UINT8 *blt_data = memregion("gfx1")->base();
392394   int blt_source = (tmmjprd_blitterregs[0]&0x000fffff)>>0;
393395   int blt_column = (tmmjprd_blitterregs[1]&0x00ff0000)>>16;
394396   int blt_line   = (tmmjprd_blitterregs[1]&0x000000ff);
r21028r21029
430432            if (!blt_amount)
431433            {
432434               if(BLITLOG) mame_printf_debug("end of blit list\n");
433               machine.scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(tmmjprd_state::tmmjprd_blit_done),this));
435               machine().scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(tmmjprd_state::tmmjprd_blit_done),this));
434436               return;
435437            }
436438
r21028r21029
440442               blt_value = ((blt_data[blt_source+1]<<8)|(blt_data[blt_source+0]));
441443               blt_source+=2;
442444               writeoffs=blt_oddflg+blt_column;
443               state->m_tilemap_ram[blt_tilemp][writeoffs]=(state->m_tilemap_ram[blt_tilemp][writeoffs]&mask)|(blt_value<<shift);
445               m_tilemap_ram[blt_tilemp][writeoffs]=(m_tilemap_ram[blt_tilemp][writeoffs]&mask)|(blt_value<<shift);
444446               tmmjprd_tilemap[blt_tilemp]->mark_tile_dirty(writeoffs);
445447
446448               blt_column++;
r21028r21029
457459            for (loopcount=0;loopcount<blt_amount;loopcount++)
458460            {
459461               writeoffs=blt_oddflg+blt_column;
460               state->m_tilemap_ram[blt_tilemp][writeoffs]=(state->m_tilemap_ram[blt_tilemp][writeoffs]&mask)|(blt_value<<shift);
462               m_tilemap_ram[blt_tilemp][writeoffs]=(m_tilemap_ram[blt_tilemp][writeoffs]&mask)|(blt_value<<shift);
461463               tmmjprd_tilemap[blt_tilemp]->mark_tile_dirty(writeoffs);
462464               blt_column++;
463465               blt_column&=0x7f;
trunk/src/mame/drivers/midas.c
r21028r21029
7979   TILE_GET_INFO_MEMBER(get_tile_info);
8080   virtual void video_start();
8181   UINT32 screen_update_midas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
82   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
8283};
8384
8485
r21028r21029
101102   m_tmap->set_transparent_pen(0);
102103}
103104
104static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
105void midas_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
105106{
106   midas_state *state = machine.driver_data<midas_state>();
107   UINT16 *s       =   state->m_gfxram + 0x8000;
108   UINT16 *codes   =   state->m_gfxram;
107   UINT16 *s       =   m_gfxram + 0x8000;
108   UINT16 *codes   =   m_gfxram;
109109
110110   int sx_old = 0, sy_old = 0, ynum_old = 0, xzoom_old = 0;
111111   int xdim, ydim, xscale, yscale;
r21028r21029
175175         UINT16 code     =   codes[y*2];
176176         UINT16 attr     =   codes[y*2+1];
177177
178         drawgfxzoom_transpen(   bitmap, cliprect, machine.gfx[0],
178         drawgfxzoom_transpen(   bitmap, cliprect, machine().gfx[0],
179179                     code,
180180                     attr >> 8,
181181                     attr & 1, attr & 2,
r21028r21029
201201
202202   bitmap.fill(4095, cliprect);
203203
204   if (layers_ctrl & 2)    draw_sprites(machine(), bitmap,cliprect);
204   if (layers_ctrl & 2)    draw_sprites(bitmap,cliprect);
205205   if (layers_ctrl & 1)    m_tmap->draw(bitmap, cliprect, 0, 0);
206206
207207   return 0;
trunk/src/mame/drivers/witch.c
r21028r21029
270270   UINT32 screen_update_witch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
271271   INTERRUPT_GEN_MEMBER(witch_main_interrupt);
272272   INTERRUPT_GEN_MEMBER(witch_sub_interrupt);
273   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
273274};
274275
275276
r21028r21029
757758   m_gfx1_tilemap->set_palette_offset(0x200);
758759}
759760
760static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
761void witch_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
761762{
762   witch_state *state = machine.driver_data<witch_state>();
763763   int i,sx,sy,tileno,flags,color;
764764   int flipx=0;
765765   int flipy=0;
766766
767767   for(i=0;i<0x800;i+=0x20) {
768      sx     = state->m_sprite_ram[i+1];
768      sx     = m_sprite_ram[i+1];
769769      if(sx!=0xF8) {
770         tileno = (state->m_sprite_ram[i]<<2)  | (( state->m_sprite_ram[i+0x800] & 0x07 ) << 10 );
770         tileno = (m_sprite_ram[i]<<2)  | (( m_sprite_ram[i+0x800] & 0x07 ) << 10 );
771771
772         sy     = state->m_sprite_ram[i+2];
773         flags  = state->m_sprite_ram[i+3];
772         sy     = m_sprite_ram[i+2];
773         flags  = m_sprite_ram[i+3];
774774
775775         flipx  = (flags & 0x10 ) ? 1 : 0;
776776         flipy  = (flags & 0x20 ) ? 1 : 0;
r21028r21029
778778         color  =  flags & 0x0f;
779779
780780
781         drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
781         drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
782782            tileno, color,
783783            flipx, flipy,
784784            sx+8*flipx,sy+8*flipy,0);
785785
786         drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
786         drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
787787            tileno+1, color,
788788            flipx, flipy,
789789            sx+8-8*flipx,sy+8*flipy,0);
790790
791         drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
791         drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
792792            tileno+2, color,
793793            flipx, flipy,
794794            sx+8*flipx,sy+8-8*flipy,0);
795795
796         drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
796         drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
797797            tileno+3, color,
798798            flipx, flipy,
799799            sx+8-8*flipx,sy+8-8*flipy,0);
r21028r21029
812812
813813   m_gfx1_tilemap->draw(bitmap, cliprect, 0,0);
814814   m_gfx0a_tilemap->draw(bitmap, cliprect, 0,0);
815   draw_sprites(machine(), bitmap, cliprect);
815   draw_sprites(bitmap, cliprect);
816816   m_gfx0b_tilemap->draw(bitmap, cliprect, 0,0);
817817   return 0;
818818}
trunk/src/mame/drivers/namcos10.c
r21028r21029
316316   DECLARE_DRIVER_INIT(mrdrilrg);
317317   DECLARE_DRIVER_INIT(chocovdr);
318318   DECLARE_MACHINE_RESET(namcos10);
319   void memn_driver_init(  );
319320};
320321
321322
r21028r21029
498499   AM_IMPORT_FROM(namcos10_map)
499500ADDRESS_MAP_END
500501
501static void memn_driver_init( running_machine &machine )
502void namcos10_state::memn_driver_init(  )
502503{
503   namcos10_state *state = machine.driver_data<namcos10_state>();
504   UINT8 *BIOS = (UINT8 *)state->memregion( "user1" )->base();
505   state->nand_base = (UINT8 *)state->memregion( "user2" )->base();
504   UINT8 *BIOS = (UINT8 *)memregion( "user1" )->base();
505   nand_base = (UINT8 *)memregion( "user2" )->base();
506506
507   state->nand_copy( (UINT32 *)( BIOS + 0x0000000 ), 0x08000, 0x001c000 );
508   state->nand_copy( (UINT32 *)( BIOS + 0x0020000 ), 0x24000, 0x03e0000 );
507   nand_copy( (UINT32 *)( BIOS + 0x0000000 ), 0x08000, 0x001c000 );
508   nand_copy( (UINT32 *)( BIOS + 0x0020000 ), 0x24000, 0x03e0000 );
509509}
510510
511511static void decrypt_bios( running_machine &machine, const char *regionName, int start, int b15, int b14, int b13, int b12, int b11, int b10, int b9, int b8,
r21028r21029
530530DRIVER_INIT_MEMBER(namcos10_state,gjspace)
531531{
532532   decrypt_bios( machine(), "user2", 0x8400, 0x0, 0x2, 0xe, 0xd, 0xf, 0x6, 0xc, 0x7, 0x5, 0x1, 0x9, 0x8, 0xa, 0x3, 0x4, 0xb );
533   memn_driver_init(machine());
533   memn_driver_init();
534534}
535535
536536DRIVER_INIT_MEMBER(namcos10_state,mrdrilrg)
537537{
538538   decrypt_bios( machine(), "user2", 0x8400, 0x6, 0x4, 0x7, 0x5, 0x2, 0x1, 0x0, 0x3, 0xc, 0xd, 0xe, 0xf, 0x8, 0x9, 0xb, 0xa );
539   memn_driver_init(machine());
539   memn_driver_init();
540540}
541541
542542DRIVER_INIT_MEMBER(namcos10_state,knpuzzle)
543543{
544544   decrypt_bios( machine(), "user2", 0x8400, 0x6, 0x7, 0x4, 0x5, 0x2, 0x0, 0x3, 0x1, 0xc, 0xd, 0xe, 0xf, 0x9, 0xb, 0x8, 0xa );
545   memn_driver_init(machine());
545   memn_driver_init();
546546}
547547
548548DRIVER_INIT_MEMBER(namcos10_state,startrgn)
549549{
550550   decrypt_bios( machine(), "user2", 0x8400, 0x6, 0x5, 0x4, 0x7, 0x1, 0x3, 0x0, 0x2, 0xc, 0xd, 0xe, 0xf, 0x8, 0xb, 0xa, 0x9 );
551   memn_driver_init(machine());
551   memn_driver_init();
552552}
553553
554554DRIVER_INIT_MEMBER(namcos10_state,gamshara)
555555{
556556   decrypt_bios( machine(), "user2", 0x8400, 0x5, 0x4, 0x7, 0x6, 0x0, 0x1, 0x3, 0x2, 0xd, 0xf, 0xc, 0xe, 0x8, 0x9, 0xa, 0xb );
557   memn_driver_init(machine());
557   memn_driver_init();
558558}
559559
560560DRIVER_INIT_MEMBER(namcos10_state,gunbalna)
561561{
562562   decrypt_bios( machine(), "user2", 0x8400, 0x5, 0x4, 0x7, 0x6, 0x0, 0x1, 0x3, 0x2, 0xd, 0xf, 0xc, 0xe, 0x9, 0x8, 0xa, 0xb );
563   memn_driver_init(machine());
563   memn_driver_init();
564564}
565565
566566DRIVER_INIT_MEMBER(namcos10_state,chocovdr)
r21028r21029
569569//                                             BAD? 0 or 9                             1 or 8         0 or 9
570570//                         ok!  ok!  ok!  ok!            ok!  ok!  ok!  ok!  ok!  ok!       ok!  ok!
571571   decrypt_bios( machine(), "user2", 0x8400, 0x5, 0x4, 0x6, 0x7, 0x1, 0x0, 0x2, 0x3, 0xc, 0xf, 0xe, 0xd, 0x8, 0xb, 0xa, 0x9 );
572   memn_driver_init(machine());
572   memn_driver_init();
573573}
574574
575575DRIVER_INIT_MEMBER(namcos10_state,panikuru)
576576{
577577   decrypt_bios( machine(), "user2", 0x8400, 0x6, 0x4, 0x7, 0x5, 0x0, 0x1, 0x2, 0x3, 0xc, 0xf, 0xe, 0xd, 0x9, 0x8, 0xb, 0xa );
578   memn_driver_init(machine());
578   memn_driver_init();
579579}
580580
581581DRIVER_INIT_MEMBER(namcos10_state,nflclsfb)
582582{
583583   decrypt_bios( machine(), "user2", 0x8400, 0x6, 0x5, 0x4, 0x7, 0x1, 0x3, 0x0, 0x2, 0xc, 0xd, 0xe, 0xf, 0x8, 0xb, 0xa, 0x9 );
584   memn_driver_init(machine());
584   memn_driver_init();
585585}
586586
587587
trunk/src/mame/drivers/gal3.c
r21028r21029
159159   DECLARE_WRITE32_MEMBER(rso_w);
160160   DECLARE_VIDEO_START(gal3);
161161   UINT32 screen_update_gal3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
162   void update_palette(  );
162163};
163164
164165
r21028r21029
173174
174175}
175176
176static void update_palette( running_machine &machine )
177void gal3_state::update_palette(  )
177178{
178   gal3_state *state = machine.driver_data<gal3_state>();
179179   int i;
180180   INT16 data1,data2;
181181   int r,g,b;
182182
183183   for( i=0; i<NAMCOS21_NUM_COLORS; i++ )
184184   {
185      data1 = state->m_generic_paletteram_16[0x00000/2+i];
186      data2 = state->m_generic_paletteram_16[0x10000/2+i];
185      data1 = m_generic_paletteram_16[0x00000/2+i];
186      data2 = m_generic_paletteram_16[0x10000/2+i];
187187
188188      r = data1>>8;
189189      g = data1&0xff;
190190      b = data2&0xff;
191191
192      palette_set_color( machine,i, MAKE_RGB(r,g,b) );
192      palette_set_color( machine(),i, MAKE_RGB(r,g,b) );
193193   }
194194} /* update_palette */
195195
r21028r21029
200200   static int pivot = 15;
201201   int pri;
202202
203   update_palette(machine());
203   update_palette();
204204
205205   if( machine().input().code_pressed_once(KEYCODE_H)&&(pivot<15) )    pivot+=1;
206206   if( machine().input().code_pressed_once(KEYCODE_J)&&(pivot>0) ) pivot-=1;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team