Previous 199869 Revisions Next

r31614 Monday 11th August, 2014 at 19:19:41 UTC by hap
correct rallyx sprite pos based on old video recording, the "displacement" workaround was wrong
[src/mame/drivers]rallyx.c
[src/mame/includes]rallyx.h
[src/mame/video]rallyx.c

trunk/src/mame/drivers/rallyx.c
r31613r31614
832832
833833INTERRUPT_GEN_MEMBER(rallyx_state::rallyx_vblank_irq)
834834{
835   if(m_main_irq_mask)
835   if (m_main_irq_mask)
836836      device.execute().set_input_line(0, ASSERT_LINE);
837837}
838838
839839INTERRUPT_GEN_MEMBER(rallyx_state::jungler_vblank_irq)
840840{
841   if(m_main_irq_mask)
841   if (m_main_irq_mask)
842842      device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
843843}
844844
r31613r31614
848848   MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6)    /* 3.072 MHz */
849849   MCFG_CPU_PROGRAM_MAP(rallyx_map)
850850   MCFG_CPU_IO_MAP(io_map)
851   MCFG_CPU_VBLANK_INT_DRIVER("screen", rallyx_state, rallyx_vblank_irq)
851   MCFG_CPU_VBLANK_INT_DRIVER("screen", rallyx_state, rallyx_vblank_irq)
852852
853853   MCFG_MACHINE_START_OVERRIDE(rallyx_state,rallyx)
854854   MCFG_MACHINE_RESET_OVERRIDE(rallyx_state,rallyx)
r31613r31614
887887   /* basic machine hardware */
888888   MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6)    /* 3.072 MHz */
889889   MCFG_CPU_PROGRAM_MAP(jungler_map)
890   MCFG_CPU_VBLANK_INT_DRIVER("screen", rallyx_state, jungler_vblank_irq)
890   MCFG_CPU_VBLANK_INT_DRIVER("screen", rallyx_state, jungler_vblank_irq)
891891
892892   MCFG_MACHINE_START_OVERRIDE(rallyx_state,rallyx)
893893   MCFG_MACHINE_RESET_OVERRIDE(rallyx_state,rallyx)
trunk/src/mame/includes/rallyx.h
r31613r31614
8484   void rallyx_video_start_common(  );
8585   void plot_star( bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, int color );
8686   void draw_stars( bitmap_ind16 &bitmap, const rectangle &cliprect );
87   void rallyx_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int displacement );
88   void locomotn_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int displacement );
87   void rallyx_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
88   void locomotn_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
8989   void rallyx_draw_bullets( bitmap_ind16 &bitmap, const rectangle &cliprect, int transpen );
9090   void jungler_draw_bullets( bitmap_ind16 &bitmap, const rectangle &cliprect, int transpen );
9191   void locomotn_draw_bullets( bitmap_ind16 &bitmap, const rectangle &cliprect, int transpen );
trunk/src/mame/video/rallyx.c
r31613r31614
439439}
440440
441441
442void rallyx_state::rallyx_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int displacement )
442void rallyx_state::rallyx_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
443443{
444444   UINT8 *spriteram = m_spriteram;
445445   UINT8 *spriteram_2 = m_spriteram2;
r31613r31614
447447
448448   for (offs = 0x20 - 2; offs >= m_spriteram_base; offs -= 2)
449449   {
450      int sx = spriteram[offs + 1] + ((spriteram_2[offs + 1] & 0x80) << 1) - displacement;
451      int sy = 241 - spriteram_2[offs] - displacement;
450      int sx = spriteram[offs + 1] + ((spriteram_2[offs + 1] & 0x80) << 1);
451      int sy = 241 - spriteram_2[offs];
452452      int color = spriteram_2[offs + 1] & 0x3f;
453453      int flipx = spriteram[offs] & 1;
454454      int flipy = spriteram[offs] & 2;
455      if (flip_screen())
456         sx -= 2 * displacement;
457455
458456      m_gfxdecode->gfx(1)->prio_transmask(bitmap,cliprect,
459457            (spriteram[offs] & 0xfc) >> 2,
r31613r31614
465463   }
466464}
467465
468void rallyx_state::locomotn_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int displacement )
466void rallyx_state::locomotn_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
469467{
470468   UINT8 *spriteram = m_spriteram;
471469   UINT8 *spriteram_2 = m_spriteram2;
r31613r31614
474472   for (offs = 0x20 - 2; offs >= m_spriteram_base; offs -= 2)
475473   {
476474      int sx = spriteram[offs + 1] + ((spriteram_2[offs + 1] & 0x80) << 1);
477      int sy = 241 - spriteram_2[offs] - displacement;
475      int sy = 241 - spriteram_2[offs];
478476      int color = spriteram_2[offs + 1] & 0x3f;
479477      int flip = spriteram[offs] & 2;
480478
r31613r31614
609607   m_fg_tilemap->draw(screen, bitmap, fg_clip, 1, 1);
610608
611609   rallyx_draw_bullets(bitmap, cliprect, TRUE);
612   rallyx_draw_sprites(screen, bitmap, cliprect, 1);
610   rallyx_draw_sprites(screen, bitmap, cliprect);
613611   rallyx_draw_bullets(bitmap, cliprect, FALSE);
614612
615613   return 0;
r31613r31614
643641   m_fg_tilemap->draw(screen, bitmap, fg_clip, 1, 0);
644642
645643   jungler_draw_bullets(bitmap, cliprect, TRUE);
646   rallyx_draw_sprites(screen, bitmap, cliprect, 0);
644   rallyx_draw_sprites(screen, bitmap, cliprect);
647645   jungler_draw_bullets(bitmap, cliprect, FALSE);
648646
649647   if (m_stars_enable)
r31613r31614
688686   m_fg_tilemap->draw(screen, bitmap, fg_clip, 1, 1);
689687
690688   locomotn_draw_bullets(bitmap, cliprect, TRUE);
691   locomotn_draw_sprites(screen, bitmap, cliprect, 0);
689   locomotn_draw_sprites(screen, bitmap, cliprect);
692690   locomotn_draw_bullets(bitmap, cliprect, FALSE);
693691
694692   if (m_stars_enable)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team