Guest User

Untitled

a guest
Aug 2nd, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. src/mame/video/avgdvg.c | 33 ++++++++++++++++++++++-----------
  2. 1 file changed, 22 insertions(+), 11 deletions(-)
  3.  
  4. diff --git a/src/mame/video/avgdvg.c b/src/mame/video/avgdvg.c
  5. index b29ab55..9c520f6 100644
  6. --- a/src/mame/video/avgdvg.c
  7. +++ b/src/mame/video/avgdvg.c
  8. @@ -173,7 +173,11 @@ static void avg_apply_flipping(int *x, int *y)
  9.  
  10. static void vg_flush (running_machine *machine)
  11. {
  12. - int i;
  13. + int i = 0;
  14. +
  15. + while (vectbuf[i].status == VGCLIP)
  16. + i++;
  17. + vector_add_point(machine, vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, 0);
  18.  
  19. for (i = 0; i < nvect; i++)
  20. {
  21. @@ -1131,6 +1135,19 @@ static void avg_vggo(vgdata *vg)
  22. vg->sp = 0;
  23. }
  24.  
  25. +static void tempest_vggo(vgdata *vg)
  26. +{
  27. + vg->pc = 0;
  28. + vg->sp = 0;
  29. + /*
  30. + * Tempest and Quantum trigger VGGO from time to time even though
  31. + * the VG runs in an endless loop for these games (see
  32. + * avg_common_strobe2). If we don't discard all vectors in the
  33. + * current buffer at this point, the screen starts flickering.
  34. + */
  35. + nvect = 0;
  36. +}
  37. +
  38. static void dvg_vggo(vgdata *vg)
  39. {
  40. vg->dvy = 0;
  41. @@ -1221,13 +1238,6 @@ static TIMER_CALLBACK( run_state_machine )
  42. *
  43. ************************************/
  44.  
  45. -#ifdef UNUSED_FUNCTION
  46. -int avgdvg_done(void)
  47. -{
  48. - return vg->sync_halt;
  49. -}
  50. -#endif
  51. -
  52. CUSTOM_INPUT( avgdvg_done_r )
  53. {
  54. return vg->sync_halt ? 0x01 : 0x00;
  55. @@ -1235,6 +1245,8 @@ CUSTOM_INPUT( avgdvg_done_r )
  56.  
  57. WRITE8_HANDLER( avgdvg_go_w )
  58. {
  59. + vgc->vggo(vg);
  60. +
  61. if (vg->sync_halt && (nvect > 10))
  62. {
  63. /*
  64. @@ -1246,7 +1258,6 @@ WRITE8_HANDLER( avgdvg_go_w )
  65. }
  66. vg_flush(space->machine);
  67.  
  68. - vgc->vggo(vg);
  69. vg_set_halt(0);
  70. timer_adjust_oneshot(vg_run_timer, attotime_zero, 0);
  71. }
  72. @@ -1372,7 +1383,7 @@ static const vgconf avg_tempest =
  73. },
  74. avg_state_addr,
  75. avg_data,
  76. - avg_vggo,
  77. + tempest_vggo,
  78. avg_vgrst
  79. };
  80.  
  81. @@ -1408,7 +1419,7 @@ static const vgconf avg_quantum =
  82. },
  83. avg_state_addr,
  84. quantum_data,
  85. - avg_vggo,
  86. + tempest_vggo,
  87. avg_vgrst
  88. };
Advertisement
Add Comment
Please, Sign In to add comment