Previous 199869 Revisions Next

r41792 Thursday 19th November, 2015 at 15:05:09 UTC by Andrew Gardner
The AVG/DVG vector device now inherits device_execute_interface, and is
executed and scheduled by the default machine scheduler.
[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
r250303r250304
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, 0)
658   MCFG_DEVICE_ADD("dvg", DVG, MASTER_CLOCK)
659659   MCFG_AVGDVG_VECTOR("vector")
660660
661661   /* sound hardware */
r250303r250304
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
r250303r250304
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, 0)
748   MCFG_DEVICE_ADD("avg", AVG, MASTER_CLOCK)
749749   MCFG_AVGDVG_VECTOR("vector")
750750
751751   /* sound hardware */
r250303r250304
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
r250303r250304
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, 0)
549   MCFG_DEVICE_ADD("avg", AVG_BZONE, XTAL_12_096MHz)
550550   MCFG_AVGDVG_VECTOR("vector")
551551
552552   /* Drivers */
r250303r250304
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
r250303r250304
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, 0)
508   MCFG_DEVICE_ADD("avg", AVG_MHAVOC, XTAL_12_096MHz)
509509   MCFG_AVGDVG_VECTOR("vector")
510510
511511   /* sound hardware */
r250303r250304
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
r250303r250304
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, 0)
524   MCFG_DEVICE_ADD("dvg", DVG, XTAL_12MHz)
525525   MCFG_AVGDVG_VECTOR("vector")
526526
527527   /* sound hardware */
trunk/src/mame/drivers/quantum.cpp
r250303r250304
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, 0)
281   MCFG_DEVICE_ADD("avg", AVG_QUANTUM, MASTER_CLOCK)
282282   MCFG_AVGDVG_VECTOR("vector")
283283
284284   /* sound hardware */
trunk/src/mame/drivers/starwars.cpp
r250303r250304
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, 0)
358   MCFG_DEVICE_ADD("avg", AVG_STARWARS, MASTER_CLOCK)
359359   MCFG_AVGDVG_VECTOR("vector")
360360
361361   /* sound hardware */
trunk/src/mame/drivers/tempest.cpp
r250303r250304
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, 0)
606   MCFG_DEVICE_ADD("avg", AVG_TEMPEST, MASTER_CLOCK)
607607   MCFG_AVGDVG_VECTOR("vector")
608608
609609   /* Drivers */
trunk/src/mame/drivers/tomcat.cpp
r250303r250304
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, 0)
429   MCFG_DEVICE_ADD("avg", AVG_TOMCAT, XTAL_12MHz)
430430   MCFG_AVGDVG_VECTOR("vector")
431431
432432   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r250303r250304
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
r250303r250304
44
55  machine.c
66
7  Functions to emulate general aspects of the machine (RAM, ROM, interrupts,
8  I/O ports)
7  Functions to emulate general aspects of the machine
8  (RAM, ROM, interrupts, I/O ports)
99
1010***************************************************************************/
1111
1212#include "emu.h"
1313#include "machine/atari_vg.h"
14#include "video/avgdvg.h"
1514#include "includes/asteroid.h"
1615
1716
trunk/src/mame/video/avgdvg.cpp
r250303r250304
2222 *
2323 *************************************/
2424
25#define MASTER_CLOCK (12096000)
26#define VGSLICE      (10000)
2725#define VGVECTOR 0
2826#define VGCLIP 1
2927
r250303r250304
4341
4442void avgdvg_device::set_flip_x(int flip)
4543{
46   flip_x = flip;
44   m_flipx = flip;
4745}
4846
4947void avgdvg_device::set_flip_y(int flip)
5048{
51   flip_y = flip;
49   m_flipy = flip;
5250}
5351
5452void avgdvg_device::apply_flipping(int *x, int *y)
5553{
56   if (flip_x)
57      *x += (xcenter - *x) << 1;
58   if (flip_y)
59      *y += (ycenter - *y) << 1;
54   if (m_flipx)
55      *x += (m_xcenter - *x) << 1;
56   if (m_flipy)
57      *y += (m_ycenter - *y) << 1;
6058}
6159
6260
r250303r250304
7472      i++;
7573   m_vector->add_point(vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, 0);
7674
77   for (i = 0; i < nvect; i++)
75   for (i = 0; i < m_nvect; i++)
7876   {
7977      if (vectbuf[i].status == VGVECTOR)
8078         m_vector->add_point(vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, vectbuf[i].intensity);
r250303r250304
8381         m_vector->add_clip(vectbuf[i].x, vectbuf[i].y, vectbuf[i].arg1, vectbuf[i].arg2);
8482   }
8583
86   nvect=0;
84   m_nvect=0;
8785}
8886
8987void avgdvg_device::vg_add_point_buf(int x, int y, rgb_t color, int intensity)
9088{
91   if (nvect < MAXVECT)
89   if (m_nvect < MAXVECT)
9290   {
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++;
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++;
9997   }
10098}
10199
102void avgdvg_device::vg_add_clip (int xmin, int ymin, int xmax, int ymax)
100void avgdvg_device::vg_add_clip(int xmin, int ymin, int xmax, int ymax)
103101{
104   if (nvect < MAXVECT)
102   if (m_nvect < MAXVECT)
105103   {
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++;
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++;
112110   }
113111}
114112
r250303r250304
121119
122120void dvg_device::update_databus() // dvg_data
123121{
124   /*
125    * DVG uses low bit of state for address
126    */
122   // DVG uses low bit of state for address
127123   m_data = avgdvg_vectorram[(m_pc << 1) | (m_state_latch & 1)];
128124}
129125
r250303r250304
167163void dvg_device::dvg_draw_to(int x, int y, int intensity)
168164{
169165   if (((x | y) & 0x400) == 0)
170      vg_add_point_buf((xmin + x - 512) << 16,
171                     (ymin + 512 - y) << 16,
166      vg_add_point_buf((m_xmin + x - 512) << 16,
167                     (m_ymin + 512 - y) << 16,
172168                     VECTOR_COLOR111(7), intensity << 4);
173169}
174170
r250303r250304
594590   {
595591      cycles = 0x8000 - m_timer;
596592      m_timer = 0;
597      m_xpos = xcenter;
598      m_ypos = ycenter;
593      m_xpos = m_xcenter;
594      m_ypos = m_ycenter;
599595      vg_add_point_buf(m_xpos, m_ypos, 0, 0);
600596   }
601597
r250303r250304
627623{
628624   if ((OP2 == 0) && (m_dvy12 == 0))
629625   {
630      /* Contrary to previous documentation in MAME,
631      Tempest does not have the m_enspkl bit. */
626      /* Contrary to previous documentation in MAME, Tempest does not have the m_enspkl bit. */
632627      if (m_dvy & 0x800)
633628         m_color = m_dvy & 0xf;
634629      else
r250303r250304
662657
663658      apply_flipping(&x, &y);
664659
665      vg_add_point_buf(y - ycenter + xcenter,
666                     x - xcenter + ycenter, rgb_t(r, g, b),
660      vg_add_point_buf(y - m_ycenter + m_xcenter,
661                     x - m_xcenter + m_ycenter, rgb_t(r, g, b),
667662                     (((m_int_latch >> 1) == 1)? m_intensity: m_int_latch & 0xe) << 4);
668663   }
669664
r250303r250304
681676    * avg_common_strobe2). If we don't discard all vectors in the
682677    * current buffer at this point, the screen starts flickering.
683678    */
684   nvect = 0;
679   m_nvect = 0;
685680}
686681#endif
687682
r250303r250304
699694
700695   if (m_lst == 0)
701696   {
702      vg_add_clip(0, m_ypos, xmax << 16, ymax << 16);
697      vg_add_clip(0, m_ypos, m_xmax << 16, m_ymax << 16);
703698   }
704699   m_lst = 1;
705700
r250303r250304
822817   {
823818      cycles = 0x8000 - m_timer;
824819      m_timer = 0;
825      m_xpos = xcenter;
826      m_ypos = ycenter;
820      m_xpos = m_xcenter;
821      m_ypos = m_ycenter;
827822      vg_add_point_buf(m_xpos, m_ypos, 0, 0);
828823   }
829824
r250303r250304
910905    * avg_common_strobe2). If we don't discard all vectors in the
911906    * current buffer at this point, the screen starts flickering.
912907    */
913   nvect = 0;
908   m_nvect = 0;
914909}
915910
916911int avg_quantum_device::handler_0() // quantum_st2st3
r250303r250304
10401035
10411036      apply_flipping(&x, &y);
10421037
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);
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);
10461041   }
10471042   if (OP2)
10481043   {
10491044      cycles = 0x4000 - m_timer;
10501045      m_timer = 0;
1051      m_xpos = xcenter;
1052      m_ypos = ycenter;
1046      m_xpos = m_xcenter;
1047      m_ypos = m_ycenter;
10531048      vg_add_point_buf(m_xpos, m_ypos, 0, 0);
10541049   }
10551050
r250303r250304
11651160
11661161/*************************************
11671162 *
1168 *  halt functions
1163 *  halt function
11691164 *
11701165 *************************************/
11711166
r250303r250304
11751170   m_sync_halt = dummy;
11761171}
11771172
1178TIMER_CALLBACK_MEMBER( avgdvg_device::vg_set_halt_callback )
1179{
1180   vg_set_halt(param);
1181}
11821173
1183
11841174/********************************************************************
11851175 *
11861176 * State Machine
r250303r250304
11941184 *
11951185 *******************************************************************/
11961186
1197TIMER_CALLBACK_MEMBER( avgdvg_device::run_state_machine )
1187void avgdvg_device::execute_run()
11981188{
1199   int cycles = 0;
1189    if (m_halt)
1190    {
1191        m_icount = 0;
1192        return;
1193    }
1194   
12001195   UINT8 *state_prom = machine().root_device().memregion("user1")->base();
12011196
1202   while (cycles < VGSLICE)
1197   while (m_icount > 0)
12031198   {
12041199      /* Get next state */
12051200      m_state_latch = (m_state_latch & 0x10)
r250303r250304
12121207
12131208         /* Decode state and call the corresponding handler */
12141209         switch(m_state_latch & 7) {
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;
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;
12231218         }
12241219      }
12251220
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);
1221      // Halt if flag was set
1222        if (m_halt && !(m_state_latch & 0x10))
1223        {
1224            vg_set_halt(1);
1225        }
12291226
12301227      m_state_latch = (m_halt << 4) | (m_state_latch & 0xf);
1231      cycles += 8;
1228      m_icount -= 8;
12321229   }
1233
1234   vg_run_timer->adjust(attotime::from_hz(MASTER_CLOCK) * cycles);
12351230}
12361231
12371232
r250303r250304
12501245{
12511246   vggo();
12521247
1253   if (m_sync_halt && (nvect > 10))
1248   if (m_sync_halt && (m_nvect > 10))
12541249   {
12551250      /*
12561251       * This is a good time to start a new frame. Major Havoc
r250303r250304
12621257   vg_flush();
12631258
12641259   vg_set_halt(0);
1265   vg_run_timer->adjust(attotime::zero);
12661260}
12671261
12681262WRITE16_MEMBER( avgdvg_device::go_word_w )
r250303r250304
12851279
12861280WRITE16_MEMBER( avgdvg_device::reset_word_w )
12871281{
1288   reset_w (space,0,0);
1282   reset_w(space,0,0);
12891283}
12901284
12911285/*************************************
r250303r250304
13281322   save_item(NAME(m_clipx_max));
13291323   save_item(NAME(m_clipy_max));
13301324
1331   save_item(NAME(flip_x));
1332   save_item(NAME(flip_y));
1325   save_item(NAME(m_flipx));
1326   save_item(NAME(m_flipy));
13331327   save_pointer(NAME(avgdvg_vectorram), avgdvg_vectorram_size);
13341328}
13351329
r250303r250304
13451339
13461340   avgdvg_colorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("colorram")->ptr());
13471341
1348   xmin = visarea.min_x;
1349   ymin = visarea.min_y;
1350   xmax = visarea.max_x;
1351   ymax = visarea.max_y;
1342   m_xmin = visarea.min_x;
1343   m_ymin = visarea.min_y;
1344   m_xmax = visarea.max_x;
1345   m_ymax = visarea.max_y;
13521346
1353   xcenter = ((xmax - xmin) / 2) << 16;
1354   ycenter = ((ymax - ymin) / 2) << 16;
1347   m_xcenter = ((m_xmax - m_xmin) / 2) << 16;
1348   m_ycenter = ((m_ymax - m_ymin) / 2) << 16;
13551349
1356   flip_x = flip_y = 0;
1350   m_flipx = m_flipy = 0;
13571351
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
13611352   /*
13621353    * The x and y DACs use 10 bit of the counter values which are in
13631354    * two's complement representation. The DAC input is xored with
r250303r250304
13661357   m_xdac_xor = 0x200;
13671358   m_ydac_xor = 0x200;
13681359
1360    m_icountptr = &m_icount;
1361   
13691362   register_state();
13701363}
13711364
r250303r250304
13811374
13821375   avgdvg_colorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("colorram")->ptr());
13831376
1384   xmin = visarea.min_x;
1385   ymin = visarea.min_y;
1377   m_xmin = visarea.min_x;
1378   m_ymin = visarea.min_y;
13861379
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
1380    m_icountptr = &m_icount;
1381   
13901382   register_state();
13911383}
13921384
r250303r250304
13951387   downcast<avgdvg_device &>(device).m_vector.set_tag(tag);
13961388}
13971389
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)
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)
14011394{
14021395   m_pc = 0;
14031396   m_sp = 0;
r250303r250304
14401433   m_clipx_max = 0;
14411434   m_clipy_max = 0;
14421435
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;
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;
14521445}
14531446
14541447dvg_device::dvg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
trunk/src/mame/video/avgdvg.h
r250303r250304
2121
2222// ======================> avgdvg_device
2323
24class avgdvg_device : public device_t
24class avgdvg_device : public device_t,
25                      public device_execute_interface
2526{
2627public:
2728   // construction/destruction
r250303r250304
4041   void set_flip_x(int flip);
4142   void set_flip_y(int flip);
4243
43   TIMER_CALLBACK_MEMBER(vg_set_halt_callback);
44   TIMER_CALLBACK_MEMBER(run_state_machine);
4544protected:
4645   void apply_flipping(int *x, int *y);
4746   void vg_set_halt(int dummy);
r250303r250304
5251
5352   void register_state();
5453
54    virtual void execute_run();
55    int m_icount;
56   
5557   UINT8 *avgdvg_vectorram;
5658   size_t avgdvg_vectorram_size;
5759
58   UINT8 *avgdvg_colorram;
60    UINT8 *avgdvg_colorram;
5961
62   int m_xmin, m_xmax, m_ymin, m_ymax;
63   int m_xcenter, m_ycenter;
64   int m_flipx, m_flipy;
6065
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;
66   int m_nvect;
6867   vgvector vectbuf[MAXVECT];
6968
70
7169   UINT16 m_pc;
7270   UINT8 m_sp;
7371   UINT16 m_dvx;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team