Previous 199869 Revisions Next

r41833 Monday 23rd November, 2015 at 10:45:18 UTC by Andrew Gardner
Revert AVG/DVG device scheduler changes.  A bit more research needs to be done
before it can be considered 100% stable.
[src/mame/drivers]asteroid.cpp bwidow.cpp bzone.cpp mhavoc.cpp omegrace.cpp quantum.cpp starwars.cpp tempest.cpp tomcat.cpp
[src/mame/machine]asteroid.cpp
[src/mame/video]avgdvg.cpp avgdvg.h

trunk/src/mame/drivers/asteroid.cpp
r250344r250345
655655   MCFG_SCREEN_VISIBLE_AREA(522, 1566, 394, 1182)
656656   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
657657
658   MCFG_DEVICE_ADD("dvg", DVG, MASTER_CLOCK)
658   MCFG_DEVICE_ADD("dvg", DVG, 0)
659659   MCFG_AVGDVG_VECTOR("vector")
660660
661661   /* sound hardware */
r250344r250345
10191019 *
10201020 *************************************/
10211021
1022GAME( 1979, asteroid,  0,         asteroid,  asteroid,  driver_device,  0,         ROT0, "Atari",                  "Asteroids (rev 4)", MACHINE_SUPPORTS_SAVE )
1023GAME( 1979, asteroid2, asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "Atari",                  "Asteroids (rev 2)", MACHINE_SUPPORTS_SAVE )
1024GAME( 1979, asteroid1, asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "Atari",                  "Asteroids (rev 1)", MACHINE_SUPPORTS_SAVE )
1025GAME( 1979, asteroidb, asteroid,  asteroid,  asteroidb, asteroid_state, asteroidb, ROT0, "bootleg",                "Asteroids (bootleg on Lunar Lander hardware)",  MACHINE_SUPPORTS_SAVE )
1026GAME( 1980, aerolitos, asteroid,  asteroid,  aerolitos, driver_device,  0,         ROT0, "bootleg (Rodmar Elec.)", "Aerolitos (Spanish bootleg of Asteroids)",  MACHINE_SUPPORTS_SAVE ) // 'Aerolitos' appears on the cabinet, this was distributed in Spain, the Spanish text is different to that contained in the original version (corrected)
1027GAME( 1979, asterock,  asteroid,  asterock,  asterock,  asteroid_state, asterock,  ROT0, "bootleg (Sidam)",        "Asterock (Sidam bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE )
1028GAME( 1979, asterockv, asteroid,  asterock,  asterock,  asteroid_state, asterock,  ROT0, "bootleg (Videotron)",    "Asterock (Videotron bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE )
1029GAME( 1979, meteorts,  asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "bootleg (VGG)",          "Meteorites (bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE )
1030GAME( 1979, meteorho,  asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "bootleg (Hoei)",         "Meteor (bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE )
1031GAME( 1979, hyperspc,  asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "bootleg (Rumiano)",      "Hyperspace (bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE )
1022GAME( 1979, asteroid,  0,         asteroid,  asteroid,  driver_device,  0,         ROT0, "Atari",   "Asteroids (rev 4)",        MACHINE_SUPPORTS_SAVE )
1023GAME( 1979, asteroid2, asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "Atari",   "Asteroids (rev 2)",        MACHINE_SUPPORTS_SAVE )
1024GAME( 1979, asteroid1, asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "Atari",   "Asteroids (rev 1)",        MACHINE_SUPPORTS_SAVE )
1025GAME( 1979, asteroidb, asteroid,  asteroid,  asteroidb, asteroid_state, asteroidb, ROT0, "bootleg", "Asteroids (bootleg on Lunar Lander hardware)",  MACHINE_SUPPORTS_SAVE )
1026GAME( 1980, aerolitos, asteroid,  asteroid,  aerolitos, driver_device,  0,         ROT0, "bootleg (Rodmar Elec.)","Aerolitos (Spanish bootleg of Asteroids)",        MACHINE_SUPPORTS_SAVE ) // 'Aerolitos' appears on the cabinet, this was distributed in Spain, the Spanish text is different to that contained in the original version (corrected)
1027GAME( 1979, asterock,  asteroid,  asterock,  asterock,  asteroid_state, asterock,  ROT0, "bootleg (Sidam)",       "Asterock (Sidam bootleg of Asteroids)",     MACHINE_SUPPORTS_SAVE )
1028GAME( 1979, asterockv, asteroid,  asterock,  asterock,  asteroid_state, asterock,  ROT0, "bootleg (Videotron)",   "Asterock (Videotron bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE )
1029GAME( 1979, meteorts,  asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "bootleg (VGG)",         "Meteorites (bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE )
1030GAME( 1979, meteorho,  asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "bootleg (Hoei)",        "Meteor (bootleg of Asteroids)",     MACHINE_SUPPORTS_SAVE )
1031GAME( 1979, hyperspc,  asteroid,  asteroid,  asteroid,  driver_device,  0,         ROT0, "bootleg (Rumiano)",     "Hyperspace (bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE )
10321032
1033GAMEL(1980, astdelux,  0,         astdelux,  astdelux,  driver_device,  0,         ROT0, "Atari", "Asteroids Deluxe (rev 3)", MACHINE_SUPPORTS_SAVE, layout_astdelux )
1034GAMEL(1980, astdelux2, astdelux,  astdelux,  astdelux,  driver_device,  0,         ROT0, "Atari", "Asteroids Deluxe (rev 2)", MACHINE_SUPPORTS_SAVE, layout_astdelux )
1035GAMEL(1980, astdelux1, astdelux,  astdelux,  astdelux,  driver_device,  0,         ROT0, "Atari", "Asteroids Deluxe (rev 1)", MACHINE_SUPPORTS_SAVE, layout_astdelux )
1033GAMEL(1980, astdelux,  0,         astdelux,  astdelux,  driver_device,  0,         ROT0, "Atari",   "Asteroids Deluxe (rev 3)", MACHINE_SUPPORTS_SAVE, layout_astdelux )
1034GAMEL(1980, astdelux2, astdelux,  astdelux,  astdelux,  driver_device,  0,         ROT0, "Atari",   "Asteroids Deluxe (rev 2)", MACHINE_SUPPORTS_SAVE, layout_astdelux )
1035GAMEL(1980, astdelux1, astdelux,  astdelux,  astdelux,  driver_device,  0,         ROT0, "Atari",   "Asteroids Deluxe (rev 1)", MACHINE_SUPPORTS_SAVE, layout_astdelux )
10361036
1037GAME( 1979, llander,   0,         llander,   llander,   driver_device,  0,         ROT0, "Atari", "Lunar Lander (rev 2)", MACHINE_SUPPORTS_SAVE )
1038GAME( 1979, llander1,  llander,   llander,   llander1,  driver_device,  0,         ROT0, "Atari", "Lunar Lander (rev 1)", MACHINE_SUPPORTS_SAVE )
1039GAME( 1979, llandert,  llander,   llander,   llandert,  driver_device,  0,         ROT0, "Atari", "Lunar Lander (screen test)", MACHINE_SUPPORTS_SAVE ) // no copyright shown, assume it's an in-house diagnostics romset (PCB came from a seller that has had Atari prototypes in his possession before)
1037GAME( 1979, llander,   0,         llander,   llander,   driver_device,  0,         ROT0, "Atari",   "Lunar Lander (rev 2)",     MACHINE_SUPPORTS_SAVE )
1038GAME( 1979, llander1,  llander,   llander,   llander1,  driver_device,  0,         ROT0, "Atari",   "Lunar Lander (rev 1)",     MACHINE_SUPPORTS_SAVE )
1039GAME( 1979, llandert,  llander,   llander,   llandert,  driver_device,  0,         ROT0, "Atari",   "Lunar Lander (screen test)", MACHINE_SUPPORTS_SAVE ) // no copyright shown, assume it's an in-house diagnostics romset (PCB came from a seller that has had Atari prototypes in his possession before)
trunk/src/mame/drivers/bwidow.cpp
r250344r250345
745745   MCFG_SCREEN_VISIBLE_AREA(0, 480, 0, 440)
746746   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
747747
748   MCFG_DEVICE_ADD("avg", AVG, MASTER_CLOCK)
748   MCFG_DEVICE_ADD("avg", AVG, 0)
749749   MCFG_AVGDVG_VECTOR("vector")
750750
751751   /* sound hardware */
r250344r250345
10621062GAME( 1980, spacduel, 0,        spacduel, spacduel, driver_device, 0, ROT0, "Atari", "Space Duel (version 2)", MACHINE_SUPPORTS_SAVE )
10631063GAME( 1980, spacduel1,spacduel, spacduel, spacduel, driver_device, 0, ROT0, "Atari", "Space Duel (version 1)", MACHINE_SUPPORTS_SAVE )
10641064GAME( 1980, spacduel0,spacduel, spacduel, spacduel, driver_device, 0, ROT0, "Atari", "Space Duel (prototype)", MACHINE_SUPPORTS_SAVE )
1065GAME( 1982, bwidow,   0,        bwidow,   bwidow,   driver_device, 0, ROT0, "Atari", "Black Widow", MACHINE_SUPPORTS_SAVE )
1066GAME( 1982, bwidowp,  bwidow,   bwidowp,  bwidow,   driver_device, 0, ROT0, "Atari", "Black Widow (prototype)", MACHINE_NOT_WORKING )
1065GAME( 1982, bwidow,   0,        bwidow,   bwidow, driver_device,   0, ROT0, "Atari", "Black Widow", MACHINE_SUPPORTS_SAVE )
1066GAME( 1982, bwidowp,  bwidow,   bwidowp,  bwidow, driver_device,   0, ROT0, "Atari", "Black Widow (prototype)", MACHINE_NOT_WORKING )
10671067GAME( 1982, gravitar, 0,        gravitar, gravitar, driver_device, 0, ROT0, "Atari", "Gravitar (version 3)", MACHINE_SUPPORTS_SAVE )
10681068GAME( 1982, gravitar2,gravitar, gravitar, gravitar, driver_device, 0, ROT0, "Atari", "Gravitar (version 2)", MACHINE_SUPPORTS_SAVE )
10691069GAME( 1982, gravitar1,gravitar, gravitar, gravitar, driver_device, 0, ROT0, "Atari", "Gravitar (version 1)", MACHINE_SUPPORTS_SAVE )
trunk/src/mame/drivers/bzone.cpp
r250344r250345
546546   MCFG_SCREEN_VISIBLE_AREA(0, 580, 0, 400)
547547   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
548548
549   MCFG_DEVICE_ADD("avg", AVG_BZONE, XTAL_12_096MHz)
549   MCFG_DEVICE_ADD("avg", AVG_BZONE, 0)
550550   MCFG_AVGDVG_VECTOR("vector")
551551
552552   /* Drivers */
r250344r250345
875875 *
876876 *************************************/
877877
878GAMEL( 1980, bzone,     0,        bzone,    bzone,    driver_device, 0,       ROT0, "Atari", "Battle Zone (rev 2)", MACHINE_SUPPORTS_SAVE, layout_bzone )
879GAMEL( 1980, bzonea,    bzone,    bzone,    bzone,    driver_device, 0,       ROT0, "Atari", "Battle Zone (rev 1)", MACHINE_SUPPORTS_SAVE, layout_bzone )
880GAMEL( 1980, bzonec,    bzone,    bzone,    bzone,    driver_device, 0,       ROT0, "Atari", "Battle Zone (cocktail)", MACHINE_SUPPORTS_SAVE|MACHINE_NO_COCKTAIL, layout_bzone )
881GAME ( 1980, bradley,   0,        bzone,    bradley,  bzone_state,   bradley, ROT0, "Atari", "Bradley Trainer", MACHINE_SUPPORTS_SAVE )
882GAMEL( 1980, redbaron,  0,        redbaron, redbaron, driver_device, 0,       ROT0, "Atari", "Red Baron (Revised Hardware)", MACHINE_SUPPORTS_SAVE, layout_redbaron )
883GAMEL( 1980, redbarona, redbaron, redbaron, redbaron, driver_device, 0,       ROT0, "Atari", "Red Baron", MACHINE_SUPPORTS_SAVE, layout_redbaron )
878GAMEL(1980, bzone,     0,        bzone,    bzone, driver_device,    0,       ROT0, "Atari", "Battle Zone (rev 2)", MACHINE_SUPPORTS_SAVE, layout_bzone )
879GAMEL(1980, bzonea,    bzone,    bzone,    bzone, driver_device,    0,       ROT0, "Atari", "Battle Zone (rev 1)", MACHINE_SUPPORTS_SAVE, layout_bzone )
880GAMEL(1980, bzonec,    bzone,    bzone,    bzone, driver_device,    0,       ROT0, "Atari", "Battle Zone (cocktail)", MACHINE_SUPPORTS_SAVE|MACHINE_NO_COCKTAIL, layout_bzone )
881GAME( 1980, bradley,   0,        bzone,    bradley, bzone_state,  bradley, ROT0, "Atari", "Bradley Trainer", MACHINE_SUPPORTS_SAVE )
882GAMEL(1980, redbaron,  0,        redbaron, redbaron, driver_device, 0,       ROT0, "Atari", "Red Baron (Revised Hardware)", MACHINE_SUPPORTS_SAVE, layout_redbaron )
883GAMEL(1980, redbarona, redbaron, redbaron, redbaron, driver_device, 0,       ROT0, "Atari", "Red Baron", MACHINE_SUPPORTS_SAVE, layout_redbaron )
trunk/src/mame/drivers/mhavoc.cpp
r250344r250345
505505   MCFG_SCREEN_VISIBLE_AREA(0, 300, 0, 260)
506506   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
507507
508   MCFG_DEVICE_ADD("avg", AVG_MHAVOC, XTAL_12_096MHz)
508   MCFG_DEVICE_ADD("avg", AVG_MHAVOC, 0)
509509   MCFG_AVGDVG_VECTOR("vector")
510510
511511   /* sound hardware */
r250344r250345
763763 *
764764 *************************************/
765765
766GAME( 1983, mhavoc,   0,      mhavoc,   mhavoc,   driver_device, 0,        ROT0, "Atari",       "Major Havoc (rev 3)", MACHINE_SUPPORTS_SAVE )
767GAME( 1983, mhavoc2,  mhavoc, mhavoc,   mhavoc,   driver_device, 0,        ROT0, "Atari",       "Major Havoc (rev 2)", MACHINE_SUPPORTS_SAVE )
768GAME( 1983, mhavocrv, mhavoc, mhavocrv, mhavocrv, mhavoc_state,  mhavocrv, ROT0, "Atari / JMA", "Major Havoc (Return to Vax)", MACHINE_SUPPORTS_SAVE )
769GAME( 1983, mhavocp,  mhavoc, mhavoc,   mhavocp,  driver_device, 0,        ROT0, "Atari",       "Major Havoc (prototype)", MACHINE_SUPPORTS_SAVE )
770GAME( 1983, alphaone, mhavoc, alphaone, alphaone, driver_device, 0,        ROT0, "Atari",       "Alpha One (prototype, 3 lives)", MACHINE_SUPPORTS_SAVE )
771GAME( 1983, alphaonea,mhavoc, alphaone, alphaone, driver_device, 0,        ROT0, "Atari",       "Alpha One (prototype, 5 lives)", MACHINE_SUPPORTS_SAVE )
766GAME( 1983, mhavoc,   0,      mhavoc,   mhavoc, driver_device,   0,        ROT0, "Atari",         "Major Havoc (rev 3)", MACHINE_SUPPORTS_SAVE )
767GAME( 1983, mhavoc2,  mhavoc, mhavoc,   mhavoc, driver_device,   0,        ROT0, "Atari",         "Major Havoc (rev 2)", MACHINE_SUPPORTS_SAVE )
768GAME( 1983, mhavocrv, mhavoc, mhavocrv, mhavocrv, mhavoc_state, mhavocrv, ROT0, "Atari / JMA",   "Major Havoc (Return to Vax)", MACHINE_SUPPORTS_SAVE )
769GAME( 1983, mhavocp,  mhavoc, mhavoc,   mhavocp, driver_device,  0,        ROT0, "Atari",         "Major Havoc (prototype)", MACHINE_SUPPORTS_SAVE )
770GAME( 1983, alphaone, mhavoc, alphaone, alphaone, driver_device, 0,        ROT0, "Atari",         "Alpha One (prototype, 3 lives)", MACHINE_SUPPORTS_SAVE )
771GAME( 1983, alphaonea,mhavoc, alphaone, alphaone, driver_device, 0,        ROT0, "Atari",         "Alpha One (prototype, 5 lives)", MACHINE_SUPPORTS_SAVE )
trunk/src/mame/drivers/omegrace.cpp
r250344r250345
521521   MCFG_SCREEN_VISIBLE_AREA(522, 1566, 522, 1566)
522522   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
523523
524   MCFG_DEVICE_ADD("dvg", DVG, XTAL_12MHz)
524   MCFG_DEVICE_ADD("dvg", DVG, 0)
525525   MCFG_AVGDVG_VECTOR("vector")
526526
527527   /* sound hardware */
trunk/src/mame/drivers/quantum.cpp
r250344r250345
278278   MCFG_SCREEN_VISIBLE_AREA(0, 900, 0, 600)
279279   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
280280
281   MCFG_DEVICE_ADD("avg", AVG_QUANTUM, MASTER_CLOCK)
281   MCFG_DEVICE_ADD("avg", AVG_QUANTUM, 0)
282282   MCFG_AVGDVG_VECTOR("vector")
283283
284284   /* sound hardware */
trunk/src/mame/drivers/starwars.cpp
r250344r250345
355355   MCFG_SCREEN_VISIBLE_AREA(0, 250, 0, 280)
356356   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
357357
358   MCFG_DEVICE_ADD("avg", AVG_STARWARS, MASTER_CLOCK)
358   MCFG_DEVICE_ADD("avg", AVG_STARWARS, 0)
359359   MCFG_AVGDVG_VECTOR("vector")
360360
361361   /* sound hardware */
trunk/src/mame/drivers/tempest.cpp
r250344r250345
603603   MCFG_SCREEN_VISIBLE_AREA(0, 580, 0, 570)
604604   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
605605
606   MCFG_DEVICE_ADD("avg", AVG_TEMPEST, MASTER_CLOCK)
606   MCFG_DEVICE_ADD("avg", AVG_TEMPEST, 0)
607607   MCFG_AVGDVG_VECTOR("vector")
608608
609609   /* Drivers */
trunk/src/mame/drivers/tomcat.cpp
r250344r250345
426426   MCFG_SCREEN_VISIBLE_AREA(0, 280, 0, 250)
427427   MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
428428
429   MCFG_DEVICE_ADD("avg", AVG_TOMCAT, XTAL_12MHz)
429   MCFG_DEVICE_ADD("avg", AVG_TOMCAT, 0)
430430   MCFG_AVGDVG_VECTOR("vector")
431431
432432   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r250344r250345
454454   ROM_LOAD( "136021-105.1l",   0x0000, 0x0100, CRC(82fc3eb2) SHA1(184231c7baef598294860a7d2b8a23798c5c7da6) ) /* AVG PROM */
455455ROM_END
456456
457GAME( 1985, tomcat, 0, tomcat, tomcat, driver_device, 0, ROT0, "Atari", "TomCat (prototype)", MACHINE_SUPPORTS_SAVE )
457GAME( 1985, tomcat, 0,        tomcat, tomcat, driver_device, 0, ROT0, "Atari", "TomCat (prototype)", MACHINE_SUPPORTS_SAVE )
trunk/src/mame/machine/asteroid.cpp
r250344r250345
44
55  machine.c
66
7  Functions to emulate general aspects of the machine
8  (RAM, ROM, interrupts, I/O ports)
7  Functions to emulate general aspects of the machine (RAM, ROM, interrupts,
8  I/O ports)
99
1010***************************************************************************/
1111
1212#include "emu.h"
1313#include "machine/atari_vg.h"
14#include "video/avgdvg.h"
1415#include "includes/asteroid.h"
1516
1617
trunk/src/mame/video/avgdvg.cpp
r250344r250345
2222 *
2323 *************************************/
2424
25#define MASTER_CLOCK (12096000)
26#define VGSLICE      (10000)
2527#define VGVECTOR 0
2628#define VGCLIP 1
2729
r250344r250345
4143
4244void avgdvg_device::set_flip_x(int flip)
4345{
44   m_flipx = flip;
46   flip_x = flip;
4547}
4648
4749void avgdvg_device::set_flip_y(int flip)
4850{
49   m_flipy = flip;
51   flip_y = flip;
5052}
5153
5254void avgdvg_device::apply_flipping(int *x, int *y)
5355{
54   if (m_flipx)
55      *x += (m_xcenter - *x) << 1;
56   if (m_flipy)
57      *y += (m_ycenter - *y) << 1;
56   if (flip_x)
57      *x += (xcenter - *x) << 1;
58   if (flip_y)
59      *y += (ycenter - *y) << 1;
5860}
5961
6062
r250344r250345
7274      i++;
7375   m_vector->add_point(vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, 0);
7476
75   for (i = 0; i < m_nvect; i++)
77   for (i = 0; i < nvect; i++)
7678   {
7779      if (vectbuf[i].status == VGVECTOR)
7880         m_vector->add_point(vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, vectbuf[i].intensity);
r250344r250345
8183         m_vector->add_clip(vectbuf[i].x, vectbuf[i].y, vectbuf[i].arg1, vectbuf[i].arg2);
8284   }
8385
84   m_nvect=0;
86   nvect=0;
8587}
8688
8789void avgdvg_device::vg_add_point_buf(int x, int y, rgb_t color, int intensity)
8890{
89   if (m_nvect < MAXVECT)
91   if (nvect < MAXVECT)
9092   {
91      vectbuf[m_nvect].status = VGVECTOR;
92      vectbuf[m_nvect].x = x;
93      vectbuf[m_nvect].y = y;
94      vectbuf[m_nvect].color = color;
95      vectbuf[m_nvect].intensity = intensity;
96      m_nvect++;
93      vectbuf[nvect].status = VGVECTOR;
94      vectbuf[nvect].x = x;
95      vectbuf[nvect].y = y;
96      vectbuf[nvect].color = color;
97      vectbuf[nvect].intensity = intensity;
98      nvect++;
9799   }
98100}
99101
100void avgdvg_device::vg_add_clip(int xmin, int ymin, int xmax, int ymax)
102void avgdvg_device::vg_add_clip (int xmin, int ymin, int xmax, int ymax)
101103{
102   if (m_nvect < MAXVECT)
104   if (nvect < MAXVECT)
103105   {
104      vectbuf[m_nvect].status = VGCLIP;
105      vectbuf[m_nvect].x = xmin;
106      vectbuf[m_nvect].y = ymin;
107      vectbuf[m_nvect].arg1 = xmax;
108      vectbuf[m_nvect].arg2 = ymax;
109      m_nvect++;
106      vectbuf[nvect].status = VGCLIP;
107      vectbuf[nvect].x = xmin;
108      vectbuf[nvect].y = ymin;
109      vectbuf[nvect].arg1 = xmax;
110      vectbuf[nvect].arg2 = ymax;
111      nvect++;
110112   }
111113}
112114
r250344r250345
119121
120122void dvg_device::update_databus() // dvg_data
121123{
122   // DVG uses low bit of state for address
124   /*
125    * DVG uses low bit of state for address
126    */
123127   m_data = avgdvg_vectorram[(m_pc << 1) | (m_state_latch & 1)];
124128}
125129
r250344r250345
163167void dvg_device::dvg_draw_to(int x, int y, int intensity)
164168{
165169   if (((x | y) & 0x400) == 0)
166      vg_add_point_buf((m_xmin + x - 512) << 16,
167                     (m_ymin + 512 - y) << 16,
170      vg_add_point_buf((xmin + x - 512) << 16,
171                     (ymin + 512 - y) << 16,
168172                     VECTOR_COLOR111(7), intensity << 4);
169173}
170174
r250344r250345
590594   {
591595      cycles = 0x8000 - m_timer;
592596      m_timer = 0;
593      m_xpos = m_xcenter;
594      m_ypos = m_ycenter;
597      m_xpos = xcenter;
598      m_ypos = ycenter;
595599      vg_add_point_buf(m_xpos, m_ypos, 0, 0);
596600   }
597601
r250344r250345
623627{
624628   if ((OP2 == 0) && (m_dvy12 == 0))
625629   {
626      /* Contrary to previous documentation in MAME, Tempest does not have the m_enspkl bit. */
630      /* Contrary to previous documentation in MAME,
631      Tempest does not have the m_enspkl bit. */
627632      if (m_dvy & 0x800)
628633         m_color = m_dvy & 0xf;
629634      else
r250344r250345
657662
658663      apply_flipping(&x, &y);
659664
660      vg_add_point_buf(y - m_ycenter + m_xcenter,
661                     x - m_xcenter + m_ycenter, rgb_t(r, g, b),
665      vg_add_point_buf(y - ycenter + xcenter,
666                     x - xcenter + ycenter, rgb_t(r, g, b),
662667                     (((m_int_latch >> 1) == 1)? m_intensity: m_int_latch & 0xe) << 4);
663668   }
664669
r250344r250345
676681    * avg_common_strobe2). If we don't discard all vectors in the
677682    * current buffer at this point, the screen starts flickering.
678683    */
679   m_nvect = 0;
684   nvect = 0;
680685}
681686#endif
682687
r250344r250345
694699
695700   if (m_lst == 0)
696701   {
697      vg_add_clip(0, m_ypos, m_xmax << 16, m_ymax << 16);
702      vg_add_clip(0, m_ypos, xmax << 16, ymax << 16);
698703   }
699704   m_lst = 1;
700705
r250344r250345
817822   {
818823      cycles = 0x8000 - m_timer;
819824      m_timer = 0;
820      m_xpos = m_xcenter;
821      m_ypos = m_ycenter;
825      m_xpos = xcenter;
826      m_ypos = ycenter;
822827      vg_add_point_buf(m_xpos, m_ypos, 0, 0);
823828   }
824829
r250344r250345
905910    * avg_common_strobe2). If we don't discard all vectors in the
906911    * current buffer at this point, the screen starts flickering.
907912    */
908   m_nvect = 0;
913   nvect = 0;
909914}
910915
911916int avg_quantum_device::handler_0() // quantum_st2st3
r250344r250345
10351040
10361041      apply_flipping(&x, &y);
10371042
1038      vg_add_point_buf(y - m_ycenter + m_xcenter, x - m_xcenter + m_ycenter,
1039                         rgb_t(r, g, b),
1040                   ((m_int_latch == 2)? m_intensity: m_int_latch) << 4);
1043      vg_add_point_buf(y - ycenter + xcenter,
1044                     x - xcenter + ycenter, rgb_t(r, g, b),
1045                     ((m_int_latch == 2)? m_intensity: m_int_latch) << 4);
10411046   }
10421047   if (OP2)
10431048   {
10441049      cycles = 0x4000 - m_timer;
10451050      m_timer = 0;
1046      m_xpos = m_xcenter;
1047      m_ypos = m_ycenter;
1051      m_xpos = xcenter;
1052      m_ypos = ycenter;
10481053      vg_add_point_buf(m_xpos, m_ypos, 0, 0);
10491054   }
10501055
r250344r250345
11601165
11611166/*************************************
11621167 *
1163 *  halt function
1168 *  halt functions
11641169 *
11651170 *************************************/
11661171
r250344r250345
11701175   m_sync_halt = dummy;
11711176}
11721177
1178TIMER_CALLBACK_MEMBER( avgdvg_device::vg_set_halt_callback )
1179{
1180   vg_set_halt(param);
1181}
11731182
1183
11741184/********************************************************************
11751185 *
11761186 * State Machine
r250344r250345
11841194 *
11851195 *******************************************************************/
11861196
1187void avgdvg_device::execute_run()
1197TIMER_CALLBACK_MEMBER( avgdvg_device::run_state_machine )
11881198{
1189    if (m_halt)
1190    {
1191        m_icount = 0;
1192        return;
1193    }
1194   
1199   int cycles = 0;
11951200   UINT8 *state_prom = machine().root_device().memregion("user1")->base();
11961201
1197   while (m_icount > 0)
1202   while (cycles < VGSLICE)
11981203   {
11991204      /* Get next state */
12001205      m_state_latch = (m_state_latch & 0x10)
r250344r250345
12071212
12081213         /* Decode state and call the corresponding handler */
12091214         switch(m_state_latch & 7) {
1210            case 0 : m_icount -= handler_0(); break;
1211            case 1 : m_icount -= handler_1(); break;
1212            case 2 : m_icount -= handler_2(); break;
1213            case 3 : m_icount -= handler_3(); break;
1214            case 4 : m_icount -= handler_4(); break;
1215            case 5 : m_icount -= handler_5(); break;
1216            case 6 : m_icount -= handler_6(); break;
1217            case 7 : m_icount -= handler_7(); break;
1215            case 0 : cycles += handler_0(); break;
1216            case 1 : cycles += handler_1(); break;
1217            case 2 : cycles += handler_2(); break;
1218            case 3 : cycles += handler_3(); break;
1219            case 4 : cycles += handler_4(); break;
1220            case 5 : cycles += handler_5(); break;
1221            case 6 : cycles += handler_6(); break;
1222            case 7 : cycles += handler_7(); break;
12181223         }
12191224      }
12201225
1221      // Halt if flag was set
1222        if (m_halt && !(m_state_latch & 0x10))
1223        {
1224            vg_set_halt(1);
1225        }
1226      /* If halt flag was set, let CPU catch up before we make halt visible */
1227      if (m_halt && !(m_state_latch & 0x10))
1228         vg_halt_timer->adjust(attotime::from_hz(MASTER_CLOCK) * cycles, 1);
12261229
12271230      m_state_latch = (m_halt << 4) | (m_state_latch & 0xf);
1228      m_icount -= 8;
1231      cycles += 8;
12291232   }
1233
1234   vg_run_timer->adjust(attotime::from_hz(MASTER_CLOCK) * cycles);
12301235}
12311236
12321237
r250344r250345
12451250{
12461251   vggo();
12471252
1248   if (m_sync_halt && (m_nvect > 10))
1253   if (m_sync_halt && (nvect > 10))
12491254   {
12501255      /*
12511256       * This is a good time to start a new frame. Major Havoc
r250344r250345
12571262   vg_flush();
12581263
12591264   vg_set_halt(0);
1265   vg_run_timer->adjust(attotime::zero);
12601266}
12611267
12621268WRITE16_MEMBER( avgdvg_device::go_word_w )
r250344r250345
12791285
12801286WRITE16_MEMBER( avgdvg_device::reset_word_w )
12811287{
1282   reset_w(space,0,0);
1288   reset_w (space,0,0);
12831289}
12841290
12851291/*************************************
r250344r250345
13221328   save_item(NAME(m_clipx_max));
13231329   save_item(NAME(m_clipy_max));
13241330
1325   save_item(NAME(m_flipx));
1326   save_item(NAME(m_flipy));
1331   save_item(NAME(flip_x));
1332   save_item(NAME(flip_y));
13271333   save_pointer(NAME(avgdvg_vectorram), avgdvg_vectorram_size);
13281334}
13291335
r250344r250345
13391345
13401346   avgdvg_colorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("colorram")->ptr());
13411347
1342   m_xmin = visarea.min_x;
1343   m_ymin = visarea.min_y;
1344   m_xmax = visarea.max_x;
1345   m_ymax = visarea.max_y;
1348   xmin = visarea.min_x;
1349   ymin = visarea.min_y;
1350   xmax = visarea.max_x;
1351   ymax = visarea.max_y;
13461352
1347   m_xcenter = ((m_xmax - m_xmin) / 2) << 16;
1348   m_ycenter = ((m_ymax - m_ymin) / 2) << 16;
1353   xcenter = ((xmax - xmin) / 2) << 16;
1354   ycenter = ((ymax - ymin) / 2) << 16;
13491355
1350   m_flipx = m_flipy = 0;
1356   flip_x = flip_y = 0;
13511357
1358   vg_halt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(avgdvg_device::vg_set_halt_callback),this));
1359   vg_run_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(avgdvg_device::run_state_machine),this));
1360
13521361   /*
13531362    * The x and y DACs use 10 bit of the counter values which are in
13541363    * two's complement representation. The DAC input is xored with
r250344r250345
13571366   m_xdac_xor = 0x200;
13581367   m_ydac_xor = 0x200;
13591368
1360    m_icountptr = &m_icount;
1361   
13621369   register_state();
13631370}
13641371
r250344r250345
13741381
13751382   avgdvg_colorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("colorram")->ptr());
13761383
1377   m_xmin = visarea.min_x;
1378   m_ymin = visarea.min_y;
1384   xmin = visarea.min_x;
1385   ymin = visarea.min_y;
13791386
1380    m_icountptr = &m_icount;
1381   
1387   vg_halt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(avgdvg_device::vg_set_halt_callback),this));
1388   vg_run_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(avgdvg_device::run_state_machine),this));
1389
13821390   register_state();
13831391}
13841392
r250344r250345
13871395   downcast<avgdvg_device &>(device).m_vector.set_tag(tag);
13881396}
13891397
1390avgdvg_device::avgdvg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
1391    : device_t(mconfig, type, name, tag, owner, clock, shortname, source)
1392    , device_execute_interface(mconfig, *this)
1393   , m_vector(*this)
1398avgdvg_device::avgdvg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
1399      device_t(mconfig, type, name, tag, owner, clock, shortname, source),
1400      m_vector(*this)
13941401{
13951402   m_pc = 0;
13961403   m_sp = 0;
r250344r250345
14331440   m_clipx_max = 0;
14341441   m_clipy_max = 0;
14351442
1436   m_xmin = 0;
1437   m_xmax = 0;
1438   m_ymin = 0;
1439   m_ymax = 0;
1440   m_xcenter = 0;
1441   m_ycenter = 0;
1442   m_flipx = 0;
1443   m_flipy = 0;
1444   m_nvect = 0;
1443   xmin = 0;
1444   xmax = 0;
1445   ymin = 0;
1446   ymax = 0;
1447   xcenter = 0;
1448   ycenter = 0;
1449   flip_x = 0;
1450   flip_y = 0;
1451   nvect = 0;
14451452}
14461453
14471454dvg_device::dvg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
trunk/src/mame/video/avgdvg.h
r250344r250345
2121
2222// ======================> avgdvg_device
2323
24class avgdvg_device : public device_t,
25                      public device_execute_interface
24class avgdvg_device : public device_t
2625{
2726public:
2827   // construction/destruction
r250344r250345
4140   void set_flip_x(int flip);
4241   void set_flip_y(int flip);
4342
43   TIMER_CALLBACK_MEMBER(vg_set_halt_callback);
44   TIMER_CALLBACK_MEMBER(run_state_machine);
4445protected:
4546   void apply_flipping(int *x, int *y);
4647   void vg_set_halt(int dummy);
r250344r250345
5152
5253   void register_state();
5354
54    virtual void execute_run();
55    int m_icount;
56   
5755   UINT8 *avgdvg_vectorram;
5856   size_t avgdvg_vectorram_size;
5957
60    UINT8 *avgdvg_colorram;
58   UINT8 *avgdvg_colorram;
6159
62   int m_xmin, m_xmax, m_ymin, m_ymax;
63   int m_xcenter, m_ycenter;
64   int m_flipx, m_flipy;
6560
66   int m_nvect;
61   int xmin, xmax, ymin, ymax;
62   int xcenter, ycenter;
63   emu_timer *vg_run_timer, *vg_halt_timer;
64
65   int flip_x, flip_y;
66
67   int nvect;
6768   vgvector vectbuf[MAXVECT];
6869
70
6971   UINT16 m_pc;
7072   UINT8 m_sp;
7173   UINT16 m_dvx;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team