diff --git a/src/burn/devices/avgdvg.cpp b/src/burn/devices/avgdvg.cpp index 74b7e8132..c70a65962 100644 --- a/src/burn/devices/avgdvg.cpp +++ b/src/burn/devices/avgdvg.cpp @@ -41,20 +41,6 @@ #include "avgdvg.h" #include "vector.h" -#define vector_clear_list vector_reset - -#define AVGDVG_MIN 1 -#define USE_DVG 1 -#define USE_AVG_RBARON 2 -#define USE_AVG_BZONE 3 -#define USE_AVG 4 -#define USE_AVG_TEMPEST 5 -#define USE_AVG_MHAVOC 6 -#define USE_AVG_ALPHAONE 7 -#define USE_AVG_SWARS 8 -#define USE_AVG_QUANTUM 9 -#define AVGDVG_MAX 10 - //#define VG_DEBUG #ifdef VG_DEBUG @@ -130,7 +116,6 @@ static UINT32 sparkle_callback(void) #define INLINE static - #define VGVECTOR 0 #define VGCLIP 1 @@ -233,7 +218,7 @@ static void vg_flush() } } - nvect=0; + nvect = 0; } void vg_vector_add_point(INT32 x, INT32 y, INT32 color, INT32 intensity) @@ -395,7 +380,7 @@ static INT32 dvg_generate_vector_list(void) INT32 deltax, deltay; /* reset the vector list */ - vector_clear_list(); + vector_reset(); /* loop until finished */ while (!done) @@ -741,7 +726,7 @@ static INT32 avg_generate_vector_list(void) return total_length; /* reset the vector list */ - vector_clear_list(); + vector_reset(); /* loop until finished... */ while (!done) @@ -1090,34 +1075,12 @@ void avgdvg_reset() { avgdvg_halt_next = 0; avgdvg_clr_busy(0); + vector_reset(); + + nvect = 0; + has_clip = 0; } -#if 0 -WRITE16_HANDLER( avgdvg_go_word_w ) -{ - avgdvg_go_w(offset, data); -} - - - -/************************************* - * - * AVG reset - * - ************************************/ - -WRITE8_HANDLER( avgdvg_reset_w ) -{ - avgdvg_clr_busy(0); -} - - -WRITE16_HANDLER( avgdvg_reset_word_w ) -{ - avgdvg_clr_busy(0); -} -#endif - /************************************* * @@ -1197,24 +1160,20 @@ INT32 avgdvg_init(INT32 vector_type, INT32 xsizemin, INT32 xsize, INT32 ysizemin return 0; } -void avg_tempest_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()) +void avgdvg_init(INT32 type, UINT8 *vectram, INT32 vramsize, INT32 (*pCPUCyclesCB)(), INT32 w, INT32 h) { vectorram = vectram; - vectorram_size = 0x1000; + vectorram_size = vramsize; - //avgdvg_init(USE_AVG_TEMPEST, 0, 580-68+0x3c, 0, 570-68); - avgdvg_init(USE_AVG_TEMPEST, 0, 580, 0, 570); + vector_init(); + + avgdvg_init(type, 0, w, 0, h); pCPUTotalCycles = pCPUCyclesCB; } -void avg_starwars_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()) +void avgdvg_exit() { - vectorram = vectram; - vectorram_size = 0x1000; - - //avgdvg_init(USE_AVG_TEMPEST, 0, 580-68+0x3c, 0, 570-68); - avgdvg_init(USE_AVG_SWARS, 0, 250, 0, 280); - pCPUTotalCycles = pCPUCyclesCB; + vector_exit(); } void avg_quantum_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()) @@ -1226,24 +1185,6 @@ void avg_quantum_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()) pCPUTotalCycles = pCPUCyclesCB; } -void dvg_asteroids_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()) -{ - vectorram = vectram; - vectorram_size = 0x1000; - - avgdvg_init(USE_DVG, 0, 1044, 0, 788); - pCPUTotalCycles = pCPUCyclesCB; -} - -void dvg_omegrace_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()) -{ - vectorram = vectram; - vectorram_size = 0x1000; - - avgdvg_init(USE_DVG, 0, 1044, 0, 1044); - pCPUTotalCycles = pCPUCyclesCB; -} - void avg_bwidow_start(UINT8 *vectram, INT32 vramsize, INT32 (*pCPUCyclesCB)(), INT32 w, INT32 h) { vectorram = vectram; diff --git a/src/burn/devices/avgdvg.h b/src/burn/devices/avgdvg.h index 42eeaa70e..d62e1fb43 100644 --- a/src/burn/devices/avgdvg.h +++ b/src/burn/devices/avgdvg.h @@ -1,6 +1,21 @@ #ifndef __AVGDVG__ #define __AVGDVG__ +#define AVGDVG_MIN 1 +#define USE_DVG 1 +#define USE_AVG_RBARON 2 +#define USE_AVG_BZONE 3 +#define USE_AVG 4 +#define USE_AVG_TEMPEST 5 +#define USE_AVG_MHAVOC 6 +#define USE_AVG_ALPHAONE 7 +#define USE_AVG_SWARS 8 +#define USE_AVG_QUANTUM 9 +#define AVGDVG_MAX 10 + +void avgdvg_init(INT32 type, UINT8 *vectram, INT32 vramsize, INT32 (*pCPUCyclesCB)(), INT32 w, INT32 h); +void avgdvg_exit(); + INT32 avgdvg_done(void); void avgdvg_go(); @@ -9,10 +24,6 @@ void avgdvg_reset(); void avg_set_flip_x(INT32 flip); void avg_set_flip_y(INT32 flip); -void avg_tempest_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()); -void avg_starwars_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()); -void dvg_asteroids_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()); -void dvg_omegrace_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()); void avg_quantum_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()); void avg_bwidow_start(UINT8 *vectram, INT32 vramsize, INT32 (*pCPUCyclesCB)(), INT32 width, INT32 height); void avg_bzone_start(UINT8 *vectram, INT32 (*pCPUCyclesCB)()); diff --git a/src/burn/drv/pre90s/d_asteroids.cpp b/src/burn/drv/pre90s/d_asteroids.cpp index b4e08761a..eddd5a87d 100644 --- a/src/burn/drv/pre90s/d_asteroids.cpp +++ b/src/burn/drv/pre90s/d_asteroids.cpp @@ -722,7 +722,6 @@ static INT32 DrvDoReset(INT32 clear_mem) M6502Close(); BurnWatchdogReset(); - vector_reset(); avgdvg_reset(); earom_reset(); @@ -806,12 +805,10 @@ static INT32 AsteroidInit() BurnWatchdogInit(DrvDoReset, 180); - vector_init(); + avgdvg_init(USE_DVG, DrvVectorRAM, 0x1000, M6502TotalCycles, 1044, 788); vector_set_scale(1044, 788); vector_set_offsets(11, 119); - dvg_asteroids_start(DrvVectorRAM, M6502TotalCycles); - asteroid_sound_init(); DrvDoReset(1); @@ -843,12 +840,10 @@ static INT32 AstdeluxInit() BurnWatchdogInit(DrvDoReset, 180); - vector_init(); + avgdvg_init(USE_DVG, DrvVectorRAM, 0x1000, M6502TotalCycles, 1044, 788); vector_set_scale(1044, 788); vector_set_offsets(11, 119); - dvg_asteroids_start(DrvVectorRAM, M6502TotalCycles); - asteroid_sound_init(); astdelux = 1; @@ -890,12 +885,10 @@ static INT32 LlanderInit() BurnWatchdogInit(DrvDoReset, 180); - vector_init(); + avgdvg_init(USE_DVG, DrvVectorRAM, 0x1000, M6502TotalCycles, 1044, 788); vector_set_scale(1044, 788); vector_set_offsets(11, 119); - dvg_asteroids_start(DrvVectorRAM, M6502TotalCycles); - llander_sound_init(); llander = 1; @@ -907,7 +900,7 @@ static INT32 LlanderInit() static INT32 DrvExit() { M6502Exit(); - vector_exit(); + avgdvg_exit(); asteroid_sound_exit(); llander_sound_exit(); diff --git a/src/burn/drv/pre90s/d_mhavoc.cpp b/src/burn/drv/pre90s/d_mhavoc.cpp index 56261c6a6..97eeeb0db 100644 --- a/src/burn/drv/pre90s/d_mhavoc.cpp +++ b/src/burn/drv/pre90s/d_mhavoc.cpp @@ -47,7 +47,7 @@ static INT32 nExtraCycles[2]; static UINT8 DrvJoy1[8]; static UINT8 DrvJoy2[8]; static UINT8 DrvJoy3[8]; -static UINT8 DrvDips[2]; +static UINT8 DrvDips[3]; static UINT8 DrvInputs[3]; static UINT8 DrvReset; diff --git a/src/burn/drv/pre90s/d_omegrace.cpp b/src/burn/drv/pre90s/d_omegrace.cpp index 8c0783ceb..175ccd627 100644 --- a/src/burn/drv/pre90s/d_omegrace.cpp +++ b/src/burn/drv/pre90s/d_omegrace.cpp @@ -234,7 +234,6 @@ static INT32 DrvDoReset(INT32 clear_mem) ZetReset(); ZetClose(); - vector_reset(); avgdvg_reset(); BurnWatchdogReset(); @@ -339,13 +338,10 @@ static INT32 DrvInit() AY8910SetAllRoutes(0, 0.25, BURN_SND_ROUTE_BOTH); AY8910SetAllRoutes(1, 0.25, BURN_SND_ROUTE_BOTH); - GenericTilesInit(); - vector_init(); + avgdvg_init(USE_DVG, DrvVectorRAM, 0x1000, ZetTotalCycles, 1044, 1044); vector_set_scale(1044, 1044); vector_set_offsets(11, 0); - dvg_omegrace_start(DrvVectorRAM, ZetTotalCycles); - DrvDoReset(1); return 0; @@ -353,11 +349,10 @@ static INT32 DrvInit() static INT32 DrvExit() { - GenericTilesExit(); ZetExit(); AY8910Exit(0); AY8910Exit(1); - vector_exit(); + avgdvg_exit(); BurnFree(AllMem); diff --git a/src/burn/drv/pre90s/d_starwars.cpp b/src/burn/drv/pre90s/d_starwars.cpp index 7a6ea7726..030f814cf 100644 --- a/src/burn/drv/pre90s/d_starwars.cpp +++ b/src/burn/drv/pre90s/d_starwars.cpp @@ -4,7 +4,6 @@ // todink: // add parent tomcat to d_parent, uncomment BurnDriver for tomcatsw -// fix intensity vectors when in antialias mode (vector.cpp) // #include "tiles_generic.h" @@ -708,7 +707,6 @@ static INT32 DrvDoReset(INT32 clear_mem) BurnRandomSetSeed(0x1321321321ull); - vector_reset(); avgdvg_reset(); control_num = 0; @@ -927,9 +925,8 @@ static INT32 DrvInit(INT32 game_select) BurnWatchdogInit(DrvDoReset, 180 /*NOT REALLY*/); BurnRandomInit(); - vector_init(); + avgdvg_init(USE_AVG_SWARS, DrvVectorRAM, 0x1000, M6809TotalCycles, 250, 280); vector_set_scale(250, 280); - avg_starwars_start(DrvVectorRAM, M6809TotalCycles); PokeyInit(1500000, 4, 0.40, 0); PokeySetTotalCyclesCB(M6809TotalCycles); @@ -948,7 +945,7 @@ static INT32 DrvInit(INT32 game_select) static INT32 DrvExit() { - vector_exit(); + avgdvg_exit(); SlapsticExit(); tms5220_exit(); diff --git a/src/burn/drv/pre90s/d_tempest.cpp b/src/burn/drv/pre90s/d_tempest.cpp index f5c72938e..e94297449 100644 --- a/src/burn/drv/pre90s/d_tempest.cpp +++ b/src/burn/drv/pre90s/d_tempest.cpp @@ -270,7 +270,6 @@ static INT32 DrvDoReset(INT32 clear_mem) BurnWatchdogReset(); mathbox_reset(); - vector_reset(); avgdvg_reset(); earom_reset(); @@ -390,11 +389,9 @@ static INT32 DrvInit() PokeyPotCallback(1, 6, port2_read); PokeyPotCallback(1, 7, port2_read); - vector_init(); + avgdvg_init(USE_AVG_TEMPEST, DrvVecRAM, 0x1000, M6502TotalCycles, 580, 570); vector_set_scale(580, 570); - avg_tempest_start(DrvVecRAM, M6502TotalCycles); - earom_init(); BurnPaddleInit(2, false); @@ -406,7 +403,7 @@ static INT32 DrvInit() static INT32 DrvExit() { - vector_exit(); + avgdvg_exit(); PokeyExit(); M6502Exit();