trunk/src/mame/drivers/pong.c
r32699 | r32700 | |
51 | 51 | #define VBSTART (V_TOTAL) |
52 | 52 | #define VBEND (16) |
53 | 53 | |
54 | | fixedfreq_interface fixedfreq_mode_pongd = { |
55 | | MASTER_CLOCK, |
56 | | H_TOTAL-67,H_TOTAL-52,H_TOTAL-8,H_TOTAL, |
57 | | V_TOTAL-22,V_TOTAL-19,V_TOTAL-12,V_TOTAL, |
58 | | 1, /* non-interlaced */ |
59 | | 0.31 |
60 | | }; |
61 | | |
62 | | fixedfreq_interface fixedfreq_mode_pong = { |
63 | | MASTER_CLOCK, |
64 | | H_TOTAL-67,H_TOTAL-40,H_TOTAL-8,H_TOTAL, |
65 | | V_TOTAL-22,V_TOTAL-19,V_TOTAL-12,V_TOTAL, |
66 | | 1, /* non-interlaced */ |
67 | | 0.31 |
68 | | }; |
69 | | |
| 54 | #if 0 |
70 | 55 | fixedfreq_interface fixedfreq_mode_pongX2 = { |
71 | 56 | MASTER_CLOCK * 2, |
72 | 57 | (H_TOTAL-67) * 2, (H_TOTAL-40) * 2, (H_TOTAL-8) * 2, (H_TOTAL) * 2, |
r32699 | r32700 | |
74 | 59 | 1, /* non-interlaced */ |
75 | 60 | 0.31 |
76 | 61 | }; |
| 62 | #endif |
77 | 63 | |
78 | 64 | enum input_changed_enum |
79 | 65 | { |
r32699 | r32700 | |
252 | 238 | MCFG_NETLIST_ANALOG_OUTPUT("maincpu", "vid0", "videomix", fixedfreq_device, update_vid, "fixfreq") |
253 | 239 | |
254 | 240 | /* video hardware */ |
| 241 | MCFG_FIXFREQ_ADD("fixfreq", "screen") |
| 242 | MCFG_FIXFREQ_MONITOR_CLOCK(MASTER_CLOCK) |
| 243 | MCFG_FIXFREQ_HORZ_PARAMS(H_TOTAL-67,H_TOTAL-40,H_TOTAL-8,H_TOTAL) |
| 244 | MCFG_FIXFREQ_VERT_PARAMS(V_TOTAL-22,V_TOTAL-19,V_TOTAL-12,V_TOTAL) |
| 245 | MCFG_FIXFREQ_FIELDCOUNT(1) |
| 246 | MCFG_FIXFREQ_SYNC_THRESHOLD(0.31) |
255 | 247 | |
256 | | MCFG_FIXFREQ_ADD("fixfreq", "screen", fixedfreq_mode_pong) |
257 | | |
258 | 248 | /* sound hardware */ |
259 | 249 | MCFG_SPEAKER_STANDARD_MONO("mono") |
260 | 250 | MCFG_SOUND_ADD("dac", DAC, 48000) |
r32699 | r32700 | |
298 | 288 | MCFG_NETLIST_ANALOG_OUTPUT("maincpu", "vid0", "videomix", fixedfreq_device, update_vid, "fixfreq") |
299 | 289 | |
300 | 290 | /* video hardware */ |
| 291 | MCFG_FIXFREQ_ADD("fixfreq", "screen") |
| 292 | MCFG_FIXFREQ_MONITOR_CLOCK(MASTER_CLOCK) |
| 293 | MCFG_FIXFREQ_HORZ_PARAMS(H_TOTAL-67,H_TOTAL-52,H_TOTAL-8,H_TOTAL) |
| 294 | MCFG_FIXFREQ_VERT_PARAMS(V_TOTAL-22,V_TOTAL-19,V_TOTAL-12,V_TOTAL) |
| 295 | MCFG_FIXFREQ_FIELDCOUNT(1) |
| 296 | MCFG_FIXFREQ_SYNC_THRESHOLD(0.31) |
301 | 297 | |
302 | | MCFG_FIXFREQ_ADD("fixfreq", "screen", fixedfreq_mode_pongd) |
303 | | |
304 | 298 | /* sound hardware */ |
305 | 299 | MCFG_SPEAKER_STANDARD_MONO("mono") |
306 | 300 | MCFG_SOUND_ADD("dac", DAC, 48000) |
r32699 | r32700 | |
327 | 321 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) |
328 | 322 | ROM_END |
329 | 323 | |
330 | | GAME( 1972, pong, 0, pong, pong, driver_device, 0, ROT0, "Atari", "Pong (Rev E) external [TTL]", GAME_SUPPORTS_SAVE) |
331 | | GAME( 1972, pongf, 0, pongf, pong, driver_device, 0, ROT0, "Atari", "Pong (Rev E) [TTL]", GAME_SUPPORTS_SAVE ) |
| 324 | GAME( 1972, pong, 0, pong, pong, driver_device, 0, ROT0, "Atari", "Pong (Rev E) external [TTL]", GAME_SUPPORTS_SAVE) |
| 325 | GAME( 1972, pongf, 0, pongf, pong, driver_device, 0, ROT0, "Atari", "Pong (Rev E) [TTL]", GAME_SUPPORTS_SAVE ) |
332 | 326 | GAME( 1974, pongd, 0, pongd, pongd, driver_device, 0, ROT0, "Atari", "Pong Doubles [TTL]", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/exidyttl.c
r32699 | r32700 | |
36 | 36 | #define VBEND (16) |
37 | 37 | |
38 | 38 | #define HRES_MULT (1) |
39 | | |
40 | | fixedfreq_interface fixedfreq_mode_attack = { |
41 | | MASTER_CLOCK, |
42 | | H_TOTAL-67,H_TOTAL-40,H_TOTAL-8,H_TOTAL, |
43 | | V_TOTAL-22,V_TOTAL-19,V_TOTAL-12,V_TOTAL, |
44 | | 1, /* non-interlaced */ |
45 | | 0.30 |
46 | | }; |
47 | 39 | // end |
48 | 40 | |
49 | 41 | |
r32699 | r32700 | |
108 | 100 | MCFG_NETLIST_SETUP(attack) |
109 | 101 | |
110 | 102 | /* video hardware */ |
111 | | MCFG_FIXFREQ_ADD("fixfreq", "screen", fixedfreq_mode_attack) |
| 103 | MCFG_FIXFREQ_ADD("fixfreq", "screen") |
| 104 | MCFG_FIXFREQ_MONITOR_CLOCK(MASTER_CLOCK) |
| 105 | MCFG_FIXFREQ_HORZ_PARAMS(H_TOTAL-67,H_TOTAL-40,H_TOTAL-8,H_TOTAL) |
| 106 | MCFG_FIXFREQ_VERT_PARAMS(V_TOTAL-22,V_TOTAL-19,V_TOTAL-12,V_TOTAL) |
| 107 | MCFG_FIXFREQ_FIELDCOUNT(1) |
| 108 | MCFG_FIXFREQ_SYNC_THRESHOLD(0.30) |
112 | 109 | MACHINE_CONFIG_END |
113 | 110 | |
114 | | |
115 | 111 | static MACHINE_CONFIG_START( deathrac, exidyttl_state ) |
116 | 112 | |
117 | 113 | /* basic machine hardware */ |
r32699 | r32700 | |
119 | 115 | MCFG_NETLIST_SETUP(attack) |
120 | 116 | |
121 | 117 | /* video hardware */ |
122 | | MCFG_FIXFREQ_ADD("fixfreq", "screen", fixedfreq_mode_attack) |
| 118 | MCFG_FIXFREQ_ADD("fixfreq", "screen") |
| 119 | MCFG_FIXFREQ_MONITOR_CLOCK(MASTER_CLOCK) |
| 120 | MCFG_FIXFREQ_HORZ_PARAMS(H_TOTAL-67,H_TOTAL-40,H_TOTAL-8,H_TOTAL) |
| 121 | MCFG_FIXFREQ_VERT_PARAMS(V_TOTAL-22,V_TOTAL-19,V_TOTAL-12,V_TOTAL) |
| 122 | MCFG_FIXFREQ_FIELDCOUNT(1) |
| 123 | MCFG_FIXFREQ_SYNC_THRESHOLD(0.30) |
123 | 124 | MACHINE_CONFIG_END |
124 | 125 | |
125 | 126 | |
trunk/src/emu/video/fixfreq.c
r32699 | r32700 | |
25 | 25 | |
26 | 26 | /*************************************************************************** |
27 | 27 | |
28 | | Static declarations |
29 | | |
30 | | ***************************************************************************/ |
31 | | |
32 | | //ModeLine "720x480@30i" 13.5 720 736 799 858 480 486 492 525 interlace -hsync -vsync |
33 | | fixedfreq_interface fixedfreq_mode_ntsc720 = { |
34 | | 13500000, |
35 | | 720,736,799,858, |
36 | | 480,486,492,525, |
37 | | 2, /* interlaced */ |
38 | | 0.3 |
39 | | }; |
40 | | |
41 | | //ModeLine "704x480@30i" 13.5 704 728 791 858 480 486 492 525 |
42 | | fixedfreq_interface fixedfreq_mode_ntsc704 = { |
43 | | 13500000, |
44 | | 704,728,791,858, |
45 | | 480,486,492,525, |
46 | | 2, /* interlaced */ |
47 | | 0.3 |
48 | | }; |
49 | | |
50 | | /*************************************************************************** |
51 | | |
52 | 28 | Fixed frequency monitor |
53 | 29 | |
54 | 30 | ***************************************************************************/ |
r32699 | r32700 | |
57 | 33 | |
58 | 34 | fixedfreq_device::fixedfreq_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) |
59 | 35 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
60 | | device_video_interface(mconfig, *this, false) |
| 36 | device_video_interface(mconfig, *this, false), |
| 37 | // default to NTSC "704x480@30i" |
| 38 | m_monitor_clock(13500000), |
| 39 | m_hvisible(704), |
| 40 | m_hfrontporch(728), |
| 41 | m_hsync(791), |
| 42 | m_hbackporch(858), |
| 43 | m_vvisible(480), |
| 44 | m_vfrontporch(486), |
| 45 | m_vsync(492), |
| 46 | m_vbackporch(525), |
| 47 | m_fieldcount(2), |
| 48 | m_sync_threshold(0.3) |
61 | 49 | { |
62 | 50 | } |
63 | 51 | |
64 | 52 | fixedfreq_device::fixedfreq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
65 | 53 | : device_t(mconfig, FIXFREQ, "Fixed Frequency Monochrome Monitor", tag, owner, clock, "fixfreq", __FILE__), |
66 | | device_video_interface(mconfig, *this, false) |
| 54 | device_video_interface(mconfig, *this, false), |
| 55 | // default to NTSC "704x480@30i" |
| 56 | m_monitor_clock(13500000), |
| 57 | m_hvisible(704), |
| 58 | m_hfrontporch(728), |
| 59 | m_hsync(791), |
| 60 | m_hbackporch(858), |
| 61 | m_vvisible(480), |
| 62 | m_vfrontporch(486), |
| 63 | m_vsync(492), |
| 64 | m_vbackporch(525), |
| 65 | m_fieldcount(2), |
| 66 | m_sync_threshold(0.3) |
67 | 67 | { |
68 | 68 | } |
69 | 69 | |
70 | | void fixedfreq_device::device_config_complete() |
71 | | { |
72 | | const fixedfreq_interface *intf = reinterpret_cast<const fixedfreq_interface *>(static_config()); |
73 | | |
74 | | if ( intf != NULL ) |
75 | | { |
76 | | *static_cast<fixedfreq_interface *>(this) = *intf; |
77 | | } |
78 | | else |
79 | | { |
80 | | *static_cast<fixedfreq_interface *>(this) = fixedfreq_mode_ntsc704; |
81 | | } |
82 | | |
83 | | } |
84 | | |
85 | | |
86 | 70 | void fixedfreq_device::device_start() |
87 | 71 | { |
88 | 72 | m_htotal = 0; |
trunk/src/emu/video/fixfreq.h
r32699 | r32700 | |
18 | 18 | #define FIXFREQ_INTERFACE(name) \ |
19 | 19 | const fixedfreq_interface (name) = |
20 | 20 | |
21 | | #define MCFG_FIXFREQ_ADD(_tag, _screen_tag, _config) \ |
| 21 | #define MCFG_FIXFREQ_ADD(_tag, _screen_tag) \ |
22 | 22 | MCFG_SCREEN_ADD(_screen_tag, RASTER) \ |
23 | 23 | MCFG_SCREEN_RAW_PARAMS(13500000, 858, 0, 858, 525, 0, 525) \ |
24 | 24 | MCFG_SCREEN_UPDATE_DEVICE(_tag, fixedfreq_device, screen_update) \ |
25 | 25 | MCFG_DEVICE_ADD(_tag, FIXFREQ, 0) \ |
26 | | MCFG_VIDEO_SET_SCREEN(_screen_tag) \ |
27 | | MCFG_DEVICE_CONFIG(_config) |
| 26 | MCFG_VIDEO_SET_SCREEN(_screen_tag) |
28 | 27 | |
29 | | struct fixedfreq_interface { |
30 | | UINT32 m_monitor_clock; |
31 | | int m_hvisible; |
32 | | int m_hfrontporch; |
33 | | int m_hsync; |
34 | | int m_hbackporch; |
35 | | int m_vvisible; |
36 | | int m_vfrontporch; |
37 | | int m_vsync; |
38 | | int m_vbackporch; |
39 | | int m_fieldcount; |
40 | | double m_sync_threshold; |
41 | | }; |
| 28 | #define MCFG_FIXFREQ_MONITOR_CLOCK(_clock) \ |
| 29 | fixedfreq_device::set_minitor_clock(*device, _clock); |
42 | 30 | |
43 | | extern fixedfreq_interface fixedfreq_mode_ntsc704; |
44 | | extern fixedfreq_interface fixedfreq_mode_ntsc720; |
| 31 | #define MCFG_FIXFREQ_HORZ_PARAMS(_visible, _frontporch, _sync, _backporch) \ |
| 32 | fixedfreq_device::set_horz_params(*device, _visible, _frontporch, _sync, _backporch); |
45 | 33 | |
| 34 | #define MCFG_FIXFREQ_VERT_PARAMS(_visible, _frontporch, _sync, _backporch) \ |
| 35 | fixedfreq_device::set_vert_params(*device, _visible, _frontporch, _sync, _backporch); |
| 36 | |
| 37 | #define MCFG_FIXFREQ_FIELDCOUNT(_count) \ |
| 38 | fixedfreq_device::set_fieldcount(*device, _count); |
| 39 | |
| 40 | #define MCFG_FIXFREQ_SYNC_THRESHOLD(_threshold) \ |
| 41 | fixedfreq_device::set_threshold(*device, _threshold); |
| 42 | |
| 43 | // pre-defined configurations |
| 44 | |
| 45 | //ModeLine "720x480@30i" 13.5 720 736 799 858 480 486 492 525 interlace -hsync -vsync |
| 46 | #define MCFG_FIXFREQ_MODE_NTSC720 \ |
| 47 | MCFG_FIXFREQ_MONITOR_CLOCK(13500000) \ |
| 48 | MCFG_FIXFREQ_HORZ_PARAMS(720, 736, 799, 858) \ |
| 49 | MCFG_FIXFREQ_VERT_PARAMS(480, 486, 492, 525) \ |
| 50 | MCFG_FIXFREQ_FIELDCOUNT(2) \ |
| 51 | MCFG_FIXFREQ_SYNC_THRESHOLD(0.3) |
| 52 | |
| 53 | //ModeLine "704x480@30i" 13.5 704 728 791 858 480 486 492 525 |
| 54 | #define MCFG_FIXFREQ_MODE_NTSC704 \ |
| 55 | MCFG_FIXFREQ_MONITOR_CLOCK(13500000) \ |
| 56 | MCFG_FIXFREQ_HORZ_PARAMS(704, 728, 791, 858) \ |
| 57 | MCFG_FIXFREQ_VERT_PARAMS(480, 486, 492, 525) \ |
| 58 | MCFG_FIXFREQ_FIELDCOUNT(2) \ |
| 59 | MCFG_FIXFREQ_SYNC_THRESHOLD(0.3) |
| 60 | |
| 61 | |
46 | 62 | // ======================> vga_device |
47 | 63 | |
48 | 64 | class fixedfreq_device : public device_t, |
49 | | public device_video_interface, |
50 | | public fixedfreq_interface |
| 65 | public device_video_interface |
51 | 66 | { |
52 | 67 | public: |
53 | 68 | // construction/destruction |
54 | 69 | fixedfreq_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
55 | 70 | fixedfreq_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); |
56 | 71 | |
| 72 | // inline configuration helpers |
| 73 | static void set_minitor_clock(device_t &device, UINT32 clock) { downcast<fixedfreq_device &>(device).m_monitor_clock = clock; } |
| 74 | static void set_fieldcount(device_t &device, int count) { downcast<fixedfreq_device &>(device).m_fieldcount = count; } |
| 75 | static void set_threshold(device_t &device, double threshold) { downcast<fixedfreq_device &>(device).m_sync_threshold = threshold; } |
| 76 | static void set_horz_params(device_t &device, int visible, int frontporch, int sync, int backporch) |
| 77 | { |
| 78 | fixedfreq_device &dev = downcast<fixedfreq_device &>(device); |
| 79 | dev.m_hvisible = visible; |
| 80 | dev.m_hfrontporch = frontporch; |
| 81 | dev.m_hsync = sync; |
| 82 | dev.m_hbackporch = backporch; |
| 83 | } |
| 84 | static void set_vert_params(device_t &device, int visible, int frontporch, int sync, int backporch) |
| 85 | { |
| 86 | fixedfreq_device &dev = downcast<fixedfreq_device &>(device); |
| 87 | dev.m_vvisible = visible; |
| 88 | dev.m_vfrontporch = frontporch; |
| 89 | dev.m_vsync = sync; |
| 90 | dev.m_vbackporch = backporch; |
| 91 | } |
57 | 92 | |
58 | 93 | virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
59 | 94 | |
r32699 | r32700 | |
61 | 96 | |
62 | 97 | protected: |
63 | 98 | // device-level overrides |
64 | | virtual void device_config_complete(); |
65 | 99 | virtual void device_start(); |
66 | 100 | virtual void device_reset(); |
67 | 101 | virtual void device_post_load(); |
r32699 | r32700 | |
89 | 123 | bitmap_rgb32 *m_bitmap[2]; |
90 | 124 | int m_cur_bm; |
91 | 125 | |
| 126 | /* adjustable by drivers */ |
| 127 | UINT32 m_monitor_clock; |
| 128 | int m_hvisible; |
| 129 | int m_hfrontporch; |
| 130 | int m_hsync; |
| 131 | int m_hbackporch; |
| 132 | int m_vvisible; |
| 133 | int m_vfrontporch; |
| 134 | int m_vsync; |
| 135 | int m_vbackporch; |
| 136 | int m_fieldcount; |
| 137 | double m_sync_threshold; |
| 138 | |
92 | 139 | /* sync separator */ |
93 | 140 | double m_vint; |
94 | 141 | double m_int_trig; |