trunk/src/mame/drivers/asteroid.cpp
| r250344 | r250345 | |
| 655 | 655 | MCFG_SCREEN_VISIBLE_AREA(522, 1566, 394, 1182) |
| 656 | 656 | MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update) |
| 657 | 657 | |
| 658 | | MCFG_DEVICE_ADD("dvg", DVG, MASTER_CLOCK) |
| 658 | MCFG_DEVICE_ADD("dvg", DVG, 0) |
| 659 | 659 | MCFG_AVGDVG_VECTOR("vector") |
| 660 | 660 | |
| 661 | 661 | /* sound hardware */ |
| r250344 | r250345 | |
| 1019 | 1019 | * |
| 1020 | 1020 | *************************************/ |
| 1021 | 1021 | |
| 1022 | | GAME( 1979, asteroid, 0, asteroid, asteroid, driver_device, 0, ROT0, "Atari", "Asteroids (rev 4)", MACHINE_SUPPORTS_SAVE ) |
| 1023 | | GAME( 1979, asteroid2, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "Atari", "Asteroids (rev 2)", MACHINE_SUPPORTS_SAVE ) |
| 1024 | | GAME( 1979, asteroid1, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "Atari", "Asteroids (rev 1)", MACHINE_SUPPORTS_SAVE ) |
| 1025 | | GAME( 1979, asteroidb, asteroid, asteroid, asteroidb, asteroid_state, asteroidb, ROT0, "bootleg", "Asteroids (bootleg on Lunar Lander hardware)", MACHINE_SUPPORTS_SAVE ) |
| 1026 | | GAME( 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) |
| 1027 | | GAME( 1979, asterock, asteroid, asterock, asterock, asteroid_state, asterock, ROT0, "bootleg (Sidam)", "Asterock (Sidam bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE ) |
| 1028 | | GAME( 1979, asterockv, asteroid, asterock, asterock, asteroid_state, asterock, ROT0, "bootleg (Videotron)", "Asterock (Videotron bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE ) |
| 1029 | | GAME( 1979, meteorts, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "bootleg (VGG)", "Meteorites (bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE ) |
| 1030 | | GAME( 1979, meteorho, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "bootleg (Hoei)", "Meteor (bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE ) |
| 1031 | | GAME( 1979, hyperspc, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "bootleg (Rumiano)", "Hyperspace (bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE ) |
| 1022 | GAME( 1979, asteroid, 0, asteroid, asteroid, driver_device, 0, ROT0, "Atari", "Asteroids (rev 4)", MACHINE_SUPPORTS_SAVE ) |
| 1023 | GAME( 1979, asteroid2, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "Atari", "Asteroids (rev 2)", MACHINE_SUPPORTS_SAVE ) |
| 1024 | GAME( 1979, asteroid1, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "Atari", "Asteroids (rev 1)", MACHINE_SUPPORTS_SAVE ) |
| 1025 | GAME( 1979, asteroidb, asteroid, asteroid, asteroidb, asteroid_state, asteroidb, ROT0, "bootleg", "Asteroids (bootleg on Lunar Lander hardware)", MACHINE_SUPPORTS_SAVE ) |
| 1026 | GAME( 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) |
| 1027 | GAME( 1979, asterock, asteroid, asterock, asterock, asteroid_state, asterock, ROT0, "bootleg (Sidam)", "Asterock (Sidam bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE ) |
| 1028 | GAME( 1979, asterockv, asteroid, asterock, asterock, asteroid_state, asterock, ROT0, "bootleg (Videotron)", "Asterock (Videotron bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE ) |
| 1029 | GAME( 1979, meteorts, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "bootleg (VGG)", "Meteorites (bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE ) |
| 1030 | GAME( 1979, meteorho, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "bootleg (Hoei)", "Meteor (bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE ) |
| 1031 | GAME( 1979, hyperspc, asteroid, asteroid, asteroid, driver_device, 0, ROT0, "bootleg (Rumiano)", "Hyperspace (bootleg of Asteroids)", MACHINE_SUPPORTS_SAVE ) |
| 1032 | 1032 | |
| 1033 | | GAMEL(1980, astdelux, 0, astdelux, astdelux, driver_device, 0, ROT0, "Atari", "Asteroids Deluxe (rev 3)", MACHINE_SUPPORTS_SAVE, layout_astdelux ) |
| 1034 | | GAMEL(1980, astdelux2, astdelux, astdelux, astdelux, driver_device, 0, ROT0, "Atari", "Asteroids Deluxe (rev 2)", MACHINE_SUPPORTS_SAVE, layout_astdelux ) |
| 1035 | | GAMEL(1980, astdelux1, astdelux, astdelux, astdelux, driver_device, 0, ROT0, "Atari", "Asteroids Deluxe (rev 1)", MACHINE_SUPPORTS_SAVE, layout_astdelux ) |
| 1033 | GAMEL(1980, astdelux, 0, astdelux, astdelux, driver_device, 0, ROT0, "Atari", "Asteroids Deluxe (rev 3)", MACHINE_SUPPORTS_SAVE, layout_astdelux ) |
| 1034 | GAMEL(1980, astdelux2, astdelux, astdelux, astdelux, driver_device, 0, ROT0, "Atari", "Asteroids Deluxe (rev 2)", MACHINE_SUPPORTS_SAVE, layout_astdelux ) |
| 1035 | GAMEL(1980, astdelux1, astdelux, astdelux, astdelux, driver_device, 0, ROT0, "Atari", "Asteroids Deluxe (rev 1)", MACHINE_SUPPORTS_SAVE, layout_astdelux ) |
| 1036 | 1036 | |
| 1037 | | GAME( 1979, llander, 0, llander, llander, driver_device, 0, ROT0, "Atari", "Lunar Lander (rev 2)", MACHINE_SUPPORTS_SAVE ) |
| 1038 | | GAME( 1979, llander1, llander, llander, llander1, driver_device, 0, ROT0, "Atari", "Lunar Lander (rev 1)", MACHINE_SUPPORTS_SAVE ) |
| 1039 | | GAME( 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) |
| 1037 | GAME( 1979, llander, 0, llander, llander, driver_device, 0, ROT0, "Atari", "Lunar Lander (rev 2)", MACHINE_SUPPORTS_SAVE ) |
| 1038 | GAME( 1979, llander1, llander, llander, llander1, driver_device, 0, ROT0, "Atari", "Lunar Lander (rev 1)", MACHINE_SUPPORTS_SAVE ) |
| 1039 | GAME( 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
| r250344 | r250345 | |
| 745 | 745 | MCFG_SCREEN_VISIBLE_AREA(0, 480, 0, 440) |
| 746 | 746 | MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update) |
| 747 | 747 | |
| 748 | | MCFG_DEVICE_ADD("avg", AVG, MASTER_CLOCK) |
| 748 | MCFG_DEVICE_ADD("avg", AVG, 0) |
| 749 | 749 | MCFG_AVGDVG_VECTOR("vector") |
| 750 | 750 | |
| 751 | 751 | /* sound hardware */ |
| r250344 | r250345 | |
| 1062 | 1062 | GAME( 1980, spacduel, 0, spacduel, spacduel, driver_device, 0, ROT0, "Atari", "Space Duel (version 2)", MACHINE_SUPPORTS_SAVE ) |
| 1063 | 1063 | GAME( 1980, spacduel1,spacduel, spacduel, spacduel, driver_device, 0, ROT0, "Atari", "Space Duel (version 1)", MACHINE_SUPPORTS_SAVE ) |
| 1064 | 1064 | GAME( 1980, spacduel0,spacduel, spacduel, spacduel, driver_device, 0, ROT0, "Atari", "Space Duel (prototype)", MACHINE_SUPPORTS_SAVE ) |
| 1065 | | GAME( 1982, bwidow, 0, bwidow, bwidow, driver_device, 0, ROT0, "Atari", "Black Widow", MACHINE_SUPPORTS_SAVE ) |
| 1066 | | GAME( 1982, bwidowp, bwidow, bwidowp, bwidow, driver_device, 0, ROT0, "Atari", "Black Widow (prototype)", MACHINE_NOT_WORKING ) |
| 1065 | GAME( 1982, bwidow, 0, bwidow, bwidow, driver_device, 0, ROT0, "Atari", "Black Widow", MACHINE_SUPPORTS_SAVE ) |
| 1066 | GAME( 1982, bwidowp, bwidow, bwidowp, bwidow, driver_device, 0, ROT0, "Atari", "Black Widow (prototype)", MACHINE_NOT_WORKING ) |
| 1067 | 1067 | GAME( 1982, gravitar, 0, gravitar, gravitar, driver_device, 0, ROT0, "Atari", "Gravitar (version 3)", MACHINE_SUPPORTS_SAVE ) |
| 1068 | 1068 | GAME( 1982, gravitar2,gravitar, gravitar, gravitar, driver_device, 0, ROT0, "Atari", "Gravitar (version 2)", MACHINE_SUPPORTS_SAVE ) |
| 1069 | 1069 | GAME( 1982, gravitar1,gravitar, gravitar, gravitar, driver_device, 0, ROT0, "Atari", "Gravitar (version 1)", MACHINE_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/bzone.cpp
| r250344 | r250345 | |
| 546 | 546 | MCFG_SCREEN_VISIBLE_AREA(0, 580, 0, 400) |
| 547 | 547 | MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update) |
| 548 | 548 | |
| 549 | | MCFG_DEVICE_ADD("avg", AVG_BZONE, XTAL_12_096MHz) |
| 549 | MCFG_DEVICE_ADD("avg", AVG_BZONE, 0) |
| 550 | 550 | MCFG_AVGDVG_VECTOR("vector") |
| 551 | 551 | |
| 552 | 552 | /* Drivers */ |
| r250344 | r250345 | |
| 875 | 875 | * |
| 876 | 876 | *************************************/ |
| 877 | 877 | |
| 878 | | GAMEL( 1980, bzone, 0, bzone, bzone, driver_device, 0, ROT0, "Atari", "Battle Zone (rev 2)", MACHINE_SUPPORTS_SAVE, layout_bzone ) |
| 879 | | GAMEL( 1980, bzonea, bzone, bzone, bzone, driver_device, 0, ROT0, "Atari", "Battle Zone (rev 1)", MACHINE_SUPPORTS_SAVE, layout_bzone ) |
| 880 | | GAMEL( 1980, bzonec, bzone, bzone, bzone, driver_device, 0, ROT0, "Atari", "Battle Zone (cocktail)", MACHINE_SUPPORTS_SAVE|MACHINE_NO_COCKTAIL, layout_bzone ) |
| 881 | | GAME ( 1980, bradley, 0, bzone, bradley, bzone_state, bradley, ROT0, "Atari", "Bradley Trainer", MACHINE_SUPPORTS_SAVE ) |
| 882 | | GAMEL( 1980, redbaron, 0, redbaron, redbaron, driver_device, 0, ROT0, "Atari", "Red Baron (Revised Hardware)", MACHINE_SUPPORTS_SAVE, layout_redbaron ) |
| 883 | | GAMEL( 1980, redbarona, redbaron, redbaron, redbaron, driver_device, 0, ROT0, "Atari", "Red Baron", MACHINE_SUPPORTS_SAVE, layout_redbaron ) |
| 878 | GAMEL(1980, bzone, 0, bzone, bzone, driver_device, 0, ROT0, "Atari", "Battle Zone (rev 2)", MACHINE_SUPPORTS_SAVE, layout_bzone ) |
| 879 | GAMEL(1980, bzonea, bzone, bzone, bzone, driver_device, 0, ROT0, "Atari", "Battle Zone (rev 1)", MACHINE_SUPPORTS_SAVE, layout_bzone ) |
| 880 | GAMEL(1980, bzonec, bzone, bzone, bzone, driver_device, 0, ROT0, "Atari", "Battle Zone (cocktail)", MACHINE_SUPPORTS_SAVE|MACHINE_NO_COCKTAIL, layout_bzone ) |
| 881 | GAME( 1980, bradley, 0, bzone, bradley, bzone_state, bradley, ROT0, "Atari", "Bradley Trainer", MACHINE_SUPPORTS_SAVE ) |
| 882 | GAMEL(1980, redbaron, 0, redbaron, redbaron, driver_device, 0, ROT0, "Atari", "Red Baron (Revised Hardware)", MACHINE_SUPPORTS_SAVE, layout_redbaron ) |
| 883 | GAMEL(1980, redbarona, redbaron, redbaron, redbaron, driver_device, 0, ROT0, "Atari", "Red Baron", MACHINE_SUPPORTS_SAVE, layout_redbaron ) |
trunk/src/mame/drivers/mhavoc.cpp
| r250344 | r250345 | |
| 505 | 505 | MCFG_SCREEN_VISIBLE_AREA(0, 300, 0, 260) |
| 506 | 506 | MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update) |
| 507 | 507 | |
| 508 | | MCFG_DEVICE_ADD("avg", AVG_MHAVOC, XTAL_12_096MHz) |
| 508 | MCFG_DEVICE_ADD("avg", AVG_MHAVOC, 0) |
| 509 | 509 | MCFG_AVGDVG_VECTOR("vector") |
| 510 | 510 | |
| 511 | 511 | /* sound hardware */ |
| r250344 | r250345 | |
| 763 | 763 | * |
| 764 | 764 | *************************************/ |
| 765 | 765 | |
| 766 | | GAME( 1983, mhavoc, 0, mhavoc, mhavoc, driver_device, 0, ROT0, "Atari", "Major Havoc (rev 3)", MACHINE_SUPPORTS_SAVE ) |
| 767 | | GAME( 1983, mhavoc2, mhavoc, mhavoc, mhavoc, driver_device, 0, ROT0, "Atari", "Major Havoc (rev 2)", MACHINE_SUPPORTS_SAVE ) |
| 768 | | GAME( 1983, mhavocrv, mhavoc, mhavocrv, mhavocrv, mhavoc_state, mhavocrv, ROT0, "Atari / JMA", "Major Havoc (Return to Vax)", MACHINE_SUPPORTS_SAVE ) |
| 769 | | GAME( 1983, mhavocp, mhavoc, mhavoc, mhavocp, driver_device, 0, ROT0, "Atari", "Major Havoc (prototype)", MACHINE_SUPPORTS_SAVE ) |
| 770 | | GAME( 1983, alphaone, mhavoc, alphaone, alphaone, driver_device, 0, ROT0, "Atari", "Alpha One (prototype, 3 lives)", MACHINE_SUPPORTS_SAVE ) |
| 771 | | GAME( 1983, alphaonea,mhavoc, alphaone, alphaone, driver_device, 0, ROT0, "Atari", "Alpha One (prototype, 5 lives)", MACHINE_SUPPORTS_SAVE ) |
| 766 | GAME( 1983, mhavoc, 0, mhavoc, mhavoc, driver_device, 0, ROT0, "Atari", "Major Havoc (rev 3)", MACHINE_SUPPORTS_SAVE ) |
| 767 | GAME( 1983, mhavoc2, mhavoc, mhavoc, mhavoc, driver_device, 0, ROT0, "Atari", "Major Havoc (rev 2)", MACHINE_SUPPORTS_SAVE ) |
| 768 | GAME( 1983, mhavocrv, mhavoc, mhavocrv, mhavocrv, mhavoc_state, mhavocrv, ROT0, "Atari / JMA", "Major Havoc (Return to Vax)", MACHINE_SUPPORTS_SAVE ) |
| 769 | GAME( 1983, mhavocp, mhavoc, mhavoc, mhavocp, driver_device, 0, ROT0, "Atari", "Major Havoc (prototype)", MACHINE_SUPPORTS_SAVE ) |
| 770 | GAME( 1983, alphaone, mhavoc, alphaone, alphaone, driver_device, 0, ROT0, "Atari", "Alpha One (prototype, 3 lives)", MACHINE_SUPPORTS_SAVE ) |
| 771 | GAME( 1983, alphaonea,mhavoc, alphaone, alphaone, driver_device, 0, ROT0, "Atari", "Alpha One (prototype, 5 lives)", MACHINE_SUPPORTS_SAVE ) |
trunk/src/mame/video/avgdvg.cpp
| r250344 | r250345 | |
| 22 | 22 | * |
| 23 | 23 | *************************************/ |
| 24 | 24 | |
| 25 | #define MASTER_CLOCK (12096000) |
| 26 | #define VGSLICE (10000) |
| 25 | 27 | #define VGVECTOR 0 |
| 26 | 28 | #define VGCLIP 1 |
| 27 | 29 | |
| r250344 | r250345 | |
| 41 | 43 | |
| 42 | 44 | void avgdvg_device::set_flip_x(int flip) |
| 43 | 45 | { |
| 44 | | m_flipx = flip; |
| 46 | flip_x = flip; |
| 45 | 47 | } |
| 46 | 48 | |
| 47 | 49 | void avgdvg_device::set_flip_y(int flip) |
| 48 | 50 | { |
| 49 | | m_flipy = flip; |
| 51 | flip_y = flip; |
| 50 | 52 | } |
| 51 | 53 | |
| 52 | 54 | void avgdvg_device::apply_flipping(int *x, int *y) |
| 53 | 55 | { |
| 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; |
| 58 | 60 | } |
| 59 | 61 | |
| 60 | 62 | |
| r250344 | r250345 | |
| 72 | 74 | i++; |
| 73 | 75 | m_vector->add_point(vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, 0); |
| 74 | 76 | |
| 75 | | for (i = 0; i < m_nvect; i++) |
| 77 | for (i = 0; i < nvect; i++) |
| 76 | 78 | { |
| 77 | 79 | if (vectbuf[i].status == VGVECTOR) |
| 78 | 80 | m_vector->add_point(vectbuf[i].x, vectbuf[i].y, vectbuf[i].color, vectbuf[i].intensity); |
| r250344 | r250345 | |
| 81 | 83 | m_vector->add_clip(vectbuf[i].x, vectbuf[i].y, vectbuf[i].arg1, vectbuf[i].arg2); |
| 82 | 84 | } |
| 83 | 85 | |
| 84 | | m_nvect=0; |
| 86 | nvect=0; |
| 85 | 87 | } |
| 86 | 88 | |
| 87 | 89 | void avgdvg_device::vg_add_point_buf(int x, int y, rgb_t color, int intensity) |
| 88 | 90 | { |
| 89 | | if (m_nvect < MAXVECT) |
| 91 | if (nvect < MAXVECT) |
| 90 | 92 | { |
| 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++; |
| 97 | 99 | } |
| 98 | 100 | } |
| 99 | 101 | |
| 100 | | void avgdvg_device::vg_add_clip(int xmin, int ymin, int xmax, int ymax) |
| 102 | void avgdvg_device::vg_add_clip (int xmin, int ymin, int xmax, int ymax) |
| 101 | 103 | { |
| 102 | | if (m_nvect < MAXVECT) |
| 104 | if (nvect < MAXVECT) |
| 103 | 105 | { |
| 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++; |
| 110 | 112 | } |
| 111 | 113 | } |
| 112 | 114 | |
| r250344 | r250345 | |
| 119 | 121 | |
| 120 | 122 | void dvg_device::update_databus() // dvg_data |
| 121 | 123 | { |
| 122 | | // DVG uses low bit of state for address |
| 124 | /* |
| 125 | * DVG uses low bit of state for address |
| 126 | */ |
| 123 | 127 | m_data = avgdvg_vectorram[(m_pc << 1) | (m_state_latch & 1)]; |
| 124 | 128 | } |
| 125 | 129 | |
| r250344 | r250345 | |
| 163 | 167 | void dvg_device::dvg_draw_to(int x, int y, int intensity) |
| 164 | 168 | { |
| 165 | 169 | 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, |
| 168 | 172 | VECTOR_COLOR111(7), intensity << 4); |
| 169 | 173 | } |
| 170 | 174 | |
| r250344 | r250345 | |
| 590 | 594 | { |
| 591 | 595 | cycles = 0x8000 - m_timer; |
| 592 | 596 | m_timer = 0; |
| 593 | | m_xpos = m_xcenter; |
| 594 | | m_ypos = m_ycenter; |
| 597 | m_xpos = xcenter; |
| 598 | m_ypos = ycenter; |
| 595 | 599 | vg_add_point_buf(m_xpos, m_ypos, 0, 0); |
| 596 | 600 | } |
| 597 | 601 | |
| r250344 | r250345 | |
| 623 | 627 | { |
| 624 | 628 | if ((OP2 == 0) && (m_dvy12 == 0)) |
| 625 | 629 | { |
| 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. */ |
| 627 | 632 | if (m_dvy & 0x800) |
| 628 | 633 | m_color = m_dvy & 0xf; |
| 629 | 634 | else |
| r250344 | r250345 | |
| 657 | 662 | |
| 658 | 663 | apply_flipping(&x, &y); |
| 659 | 664 | |
| 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), |
| 662 | 667 | (((m_int_latch >> 1) == 1)? m_intensity: m_int_latch & 0xe) << 4); |
| 663 | 668 | } |
| 664 | 669 | |
| r250344 | r250345 | |
| 676 | 681 | * avg_common_strobe2). If we don't discard all vectors in the |
| 677 | 682 | * current buffer at this point, the screen starts flickering. |
| 678 | 683 | */ |
| 679 | | m_nvect = 0; |
| 684 | nvect = 0; |
| 680 | 685 | } |
| 681 | 686 | #endif |
| 682 | 687 | |
| r250344 | r250345 | |
| 694 | 699 | |
| 695 | 700 | if (m_lst == 0) |
| 696 | 701 | { |
| 697 | | vg_add_clip(0, m_ypos, m_xmax << 16, m_ymax << 16); |
| 702 | vg_add_clip(0, m_ypos, xmax << 16, ymax << 16); |
| 698 | 703 | } |
| 699 | 704 | m_lst = 1; |
| 700 | 705 | |
| r250344 | r250345 | |
| 817 | 822 | { |
| 818 | 823 | cycles = 0x8000 - m_timer; |
| 819 | 824 | m_timer = 0; |
| 820 | | m_xpos = m_xcenter; |
| 821 | | m_ypos = m_ycenter; |
| 825 | m_xpos = xcenter; |
| 826 | m_ypos = ycenter; |
| 822 | 827 | vg_add_point_buf(m_xpos, m_ypos, 0, 0); |
| 823 | 828 | } |
| 824 | 829 | |
| r250344 | r250345 | |
| 905 | 910 | * avg_common_strobe2). If we don't discard all vectors in the |
| 906 | 911 | * current buffer at this point, the screen starts flickering. |
| 907 | 912 | */ |
| 908 | | m_nvect = 0; |
| 913 | nvect = 0; |
| 909 | 914 | } |
| 910 | 915 | |
| 911 | 916 | int avg_quantum_device::handler_0() // quantum_st2st3 |
| r250344 | r250345 | |
| 1035 | 1040 | |
| 1036 | 1041 | apply_flipping(&x, &y); |
| 1037 | 1042 | |
| 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); |
| 1041 | 1046 | } |
| 1042 | 1047 | if (OP2) |
| 1043 | 1048 | { |
| 1044 | 1049 | cycles = 0x4000 - m_timer; |
| 1045 | 1050 | m_timer = 0; |
| 1046 | | m_xpos = m_xcenter; |
| 1047 | | m_ypos = m_ycenter; |
| 1051 | m_xpos = xcenter; |
| 1052 | m_ypos = ycenter; |
| 1048 | 1053 | vg_add_point_buf(m_xpos, m_ypos, 0, 0); |
| 1049 | 1054 | } |
| 1050 | 1055 | |
| r250344 | r250345 | |
| 1160 | 1165 | |
| 1161 | 1166 | /************************************* |
| 1162 | 1167 | * |
| 1163 | | * halt function |
| 1168 | * halt functions |
| 1164 | 1169 | * |
| 1165 | 1170 | *************************************/ |
| 1166 | 1171 | |
| r250344 | r250345 | |
| 1170 | 1175 | m_sync_halt = dummy; |
| 1171 | 1176 | } |
| 1172 | 1177 | |
| 1178 | TIMER_CALLBACK_MEMBER( avgdvg_device::vg_set_halt_callback ) |
| 1179 | { |
| 1180 | vg_set_halt(param); |
| 1181 | } |
| 1173 | 1182 | |
| 1183 | |
| 1174 | 1184 | /******************************************************************** |
| 1175 | 1185 | * |
| 1176 | 1186 | * State Machine |
| r250344 | r250345 | |
| 1184 | 1194 | * |
| 1185 | 1195 | *******************************************************************/ |
| 1186 | 1196 | |
| 1187 | | void avgdvg_device::execute_run() |
| 1197 | TIMER_CALLBACK_MEMBER( avgdvg_device::run_state_machine ) |
| 1188 | 1198 | { |
| 1189 | | if (m_halt) |
| 1190 | | { |
| 1191 | | m_icount = 0; |
| 1192 | | return; |
| 1193 | | } |
| 1194 | | |
| 1199 | int cycles = 0; |
| 1195 | 1200 | UINT8 *state_prom = machine().root_device().memregion("user1")->base(); |
| 1196 | 1201 | |
| 1197 | | while (m_icount > 0) |
| 1202 | while (cycles < VGSLICE) |
| 1198 | 1203 | { |
| 1199 | 1204 | /* Get next state */ |
| 1200 | 1205 | m_state_latch = (m_state_latch & 0x10) |
| r250344 | r250345 | |
| 1207 | 1212 | |
| 1208 | 1213 | /* Decode state and call the corresponding handler */ |
| 1209 | 1214 | 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; |
| 1218 | 1223 | } |
| 1219 | 1224 | } |
| 1220 | 1225 | |
| 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); |
| 1226 | 1229 | |
| 1227 | 1230 | m_state_latch = (m_halt << 4) | (m_state_latch & 0xf); |
| 1228 | | m_icount -= 8; |
| 1231 | cycles += 8; |
| 1229 | 1232 | } |
| 1233 | |
| 1234 | vg_run_timer->adjust(attotime::from_hz(MASTER_CLOCK) * cycles); |
| 1230 | 1235 | } |
| 1231 | 1236 | |
| 1232 | 1237 | |
| r250344 | r250345 | |
| 1245 | 1250 | { |
| 1246 | 1251 | vggo(); |
| 1247 | 1252 | |
| 1248 | | if (m_sync_halt && (m_nvect > 10)) |
| 1253 | if (m_sync_halt && (nvect > 10)) |
| 1249 | 1254 | { |
| 1250 | 1255 | /* |
| 1251 | 1256 | * This is a good time to start a new frame. Major Havoc |
| r250344 | r250345 | |
| 1257 | 1262 | vg_flush(); |
| 1258 | 1263 | |
| 1259 | 1264 | vg_set_halt(0); |
| 1265 | vg_run_timer->adjust(attotime::zero); |
| 1260 | 1266 | } |
| 1261 | 1267 | |
| 1262 | 1268 | WRITE16_MEMBER( avgdvg_device::go_word_w ) |
| r250344 | r250345 | |
| 1279 | 1285 | |
| 1280 | 1286 | WRITE16_MEMBER( avgdvg_device::reset_word_w ) |
| 1281 | 1287 | { |
| 1282 | | reset_w(space,0,0); |
| 1288 | reset_w (space,0,0); |
| 1283 | 1289 | } |
| 1284 | 1290 | |
| 1285 | 1291 | /************************************* |
| r250344 | r250345 | |
| 1322 | 1328 | save_item(NAME(m_clipx_max)); |
| 1323 | 1329 | save_item(NAME(m_clipy_max)); |
| 1324 | 1330 | |
| 1325 | | save_item(NAME(m_flipx)); |
| 1326 | | save_item(NAME(m_flipy)); |
| 1331 | save_item(NAME(flip_x)); |
| 1332 | save_item(NAME(flip_y)); |
| 1327 | 1333 | save_pointer(NAME(avgdvg_vectorram), avgdvg_vectorram_size); |
| 1328 | 1334 | } |
| 1329 | 1335 | |
| r250344 | r250345 | |
| 1339 | 1345 | |
| 1340 | 1346 | avgdvg_colorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("colorram")->ptr()); |
| 1341 | 1347 | |
| 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; |
| 1346 | 1352 | |
| 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; |
| 1349 | 1355 | |
| 1350 | | m_flipx = m_flipy = 0; |
| 1356 | flip_x = flip_y = 0; |
| 1351 | 1357 | |
| 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 | |
| 1352 | 1361 | /* |
| 1353 | 1362 | * The x and y DACs use 10 bit of the counter values which are in |
| 1354 | 1363 | * two's complement representation. The DAC input is xored with |
| r250344 | r250345 | |
| 1357 | 1366 | m_xdac_xor = 0x200; |
| 1358 | 1367 | m_ydac_xor = 0x200; |
| 1359 | 1368 | |
| 1360 | | m_icountptr = &m_icount; |
| 1361 | | |
| 1362 | 1369 | register_state(); |
| 1363 | 1370 | } |
| 1364 | 1371 | |
| r250344 | r250345 | |
| 1374 | 1381 | |
| 1375 | 1382 | avgdvg_colorram = reinterpret_cast<UINT8 *>(machine().root_device().memshare("colorram")->ptr()); |
| 1376 | 1383 | |
| 1377 | | m_xmin = visarea.min_x; |
| 1378 | | m_ymin = visarea.min_y; |
| 1384 | xmin = visarea.min_x; |
| 1385 | ymin = visarea.min_y; |
| 1379 | 1386 | |
| 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 | |
| 1382 | 1390 | register_state(); |
| 1383 | 1391 | } |
| 1384 | 1392 | |
| r250344 | r250345 | |
| 1387 | 1395 | downcast<avgdvg_device &>(device).m_vector.set_tag(tag); |
| 1388 | 1396 | } |
| 1389 | 1397 | |
| 1390 | | avgdvg_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) |
| 1398 | avgdvg_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) |
| 1394 | 1401 | { |
| 1395 | 1402 | m_pc = 0; |
| 1396 | 1403 | m_sp = 0; |
| r250344 | r250345 | |
| 1433 | 1440 | m_clipx_max = 0; |
| 1434 | 1441 | m_clipy_max = 0; |
| 1435 | 1442 | |
| 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; |
| 1445 | 1452 | } |
| 1446 | 1453 | |
| 1447 | 1454 | dvg_device::dvg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |