Previous 199869 Revisions Next

r34421 Friday 16th January, 2015 at 17:17:05 UTC by Osso
tia_video_device: added save_state support (nw)
bus/vcs/dcp.c: added save_state support (nw)
a2600.c and tourtabl.c; added save state support (nw)
[src/emu/bus/vcs]dpc.c
[src/mame/drivers]tourtabl.c
[src/mame/video]tia.c tia.h
[src/mess/drivers]a2600.c

trunk/src/emu/bus/vcs/dpc.c
r242932r242933
2626{
2727   m_oscillator = timer_alloc(TIMER_OSC);
2828   m_oscillator->reset();
29
30   for (int i = 0; i < 8; i++)
31   {
32      save_item(NAME(m_df[i].top), i);
33      save_item(NAME(m_df[i].bottom), i);
34      save_item(NAME(m_df[i].low), i);
35      save_item(NAME(m_df[i].high), i);
36      save_item(NAME(m_df[i].flag), i);
37      save_item(NAME(m_df[i].music_mode), i);
38      save_item(NAME(m_df[i].osc_clk), i);
39   }
40   
41   save_item(NAME(m_movamt));
42   save_item(NAME(m_latch_62));
43   save_item(NAME(m_latch_64));
44   save_item(NAME(m_dlc));
45   save_item(NAME(m_shift_reg));
2946}
3047
3148void dpc_device::device_reset()
trunk/src/mame/drivers/tourtabl.c
r242932r242933
2020      : driver_device(mconfig, type, tag),
2121      m_maincpu(*this, "maincpu") { }
2222
23   required_device<cpu_device> m_maincpu;
24   
2325   DECLARE_WRITE8_MEMBER(tourtabl_led_w);
2426   DECLARE_READ16_MEMBER(tourtabl_read_input_port);
2527   DECLARE_READ8_MEMBER(tourtabl_get_databus_contents);
2628   DECLARE_WRITE8_MEMBER(watchdog_w);
27   required_device<cpu_device> m_maincpu;
2829};
2930
3031
r242932r242933
201202ROM_END
202203
203204
204GAME( 1978, tourtabl, 0,        tourtabl, tourtabl, driver_device, 0, ROT0, "Atari", "Tournament Table (set 1)", 0 )
205GAME( 1978, tourtab2, tourtabl, tourtabl, tourtabl, driver_device, 0, ROT0, "Atari", "Tournament Table (set 2)", 0 )
205GAME( 1978, tourtabl, 0,        tourtabl, tourtabl, driver_device, 0, ROT0, "Atari", "Tournament Table (set 1)", GAME_SUPPORTS_SAVE )
206GAME( 1978, tourtab2, tourtabl, tourtabl, tourtabl, driver_device, 0, ROT0, "Atari", "Tournament Table (set 2)", GAME_SUPPORTS_SAVE )
trunk/src/mame/video/tia.c
r242932r242933
430430   helper[0] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT);
431431   helper[1] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT);
432432   helper[2] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT);
433   
434   register_save_state();
433435}
434436
435437
r242932r242933
665667
666668int tia_video_device::current_x()
667669{
668   return 3 * ((machine().firstcpu->total_cycles() - frame_cycles) % 76) - 68;
670   return 3 * ((machine().device<cpu_device>("maincpu")->total_cycles() - frame_cycles) % 76) - 68;
669671}
670672
671673
672674int tia_video_device::current_y()
673675{
674   return (machine().firstcpu->total_cycles() - frame_cycles) / 76;
676   return (machine().device<cpu_device>("maincpu")->total_cycles() - frame_cycles) / 76;
675677}
676678
677679
r242932r242933
10101012
10111013WRITE8_MEMBER( tia_video_device::WSYNC_w )
10121014{
1013   int cycles = machine().firstcpu->total_cycles() - frame_cycles;
1015   int cycles = machine().device<cpu_device>("maincpu")->total_cycles() - frame_cycles;
10141016
10151017   if (cycles % 76)
10161018   {
r242932r242933
10511053{
10521054   if (data & 0x80)
10531055   {
1054      paddle_start = machine().firstcpu->total_cycles();
1056      paddle_start = machine().device<cpu_device>("maincpu")->total_cycles();
10551057   }
10561058   if ( ! ( VBLANK & 0x40 ) ) {
10571059      INPT4 = 0x80;
r242932r242933
18041806
18051807READ8_MEMBER( tia_video_device::INPT_r )
18061808{
1807   UINT64 elapsed = machine().firstcpu->total_cycles() - paddle_start;
1809   UINT64 elapsed = machine().device<cpu_device>("maincpu")->total_cycles() - paddle_start;
18081810   UINT16 input = TIA_INPUT_PORT_ALWAYS_ON;
18091811   if ( !m_read_input_port_cb.isnull() )
18101812   {
r242932r242933
21772179   COLUBK = 0;
21782180   COLUPF = 0;
21792181}
2182
2183
2184void tia_video_device::register_save_state()
2185{
2186   save_item(NAME(p0gfx.start_pixel));
2187   save_item(NAME(p0gfx.start_drawing));
2188   save_item(NAME(p0gfx.size));
2189   save_item(NAME(p0gfx.skipclip));
2190   save_item(NAME(p1gfx.start_pixel));
2191   save_item(NAME(p1gfx.start_drawing));
2192   save_item(NAME(p1gfx.size));
2193   save_item(NAME(p1gfx.skipclip));
2194   save_item(NAME(frame_cycles));
2195   save_item(NAME(paddle_start));
2196   save_item(NAME(horzP0));
2197   save_item(NAME(horzP1));
2198   save_item(NAME(horzM0));
2199   save_item(NAME(horzM1));
2200   save_item(NAME(horzBL));
2201   save_item(NAME(motclkP0));
2202   save_item(NAME(motclkP1));
2203   save_item(NAME(motclkM0));
2204   save_item(NAME(motclkM1));
2205   save_item(NAME(motclkBL));
2206   save_item(NAME(startP0));
2207   save_item(NAME(startP1));
2208   save_item(NAME(startM0));
2209   save_item(NAME(startM1));
2210   save_item(NAME(skipclipP0));
2211   save_item(NAME(skipclipP1));
2212   save_item(NAME(skipM0delay));
2213   save_item(NAME(skipM1delay));
2214   save_item(NAME(current_bitmap));
2215   save_item(NAME(prev_x));
2216   save_item(NAME(prev_y));
2217   save_item(NAME(VSYNC));
2218   save_item(NAME(VBLANK));
2219   save_item(NAME(COLUP0));
2220   save_item(NAME(COLUP1));
2221   save_item(NAME(COLUBK));
2222   save_item(NAME(COLUPF));
2223   save_item(NAME(CTRLPF));
2224   save_item(NAME(GRP0));
2225   save_item(NAME(GRP1));
2226   save_item(NAME(REFP0));
2227   save_item(NAME(REFP1));
2228   save_item(NAME(HMP0));
2229   save_item(NAME(HMP1));
2230   save_item(NAME(HMM0));
2231   save_item(NAME(HMM1));
2232   save_item(NAME(HMBL));
2233   save_item(NAME(VDELP0));
2234   save_item(NAME(VDELP1));
2235   save_item(NAME(VDELBL));
2236   save_item(NAME(NUSIZ0));
2237   save_item(NAME(NUSIZ1));
2238   save_item(NAME(ENAM0));
2239   save_item(NAME(ENAM1));
2240   save_item(NAME(ENABL));
2241   save_item(NAME(CXM0P));
2242   save_item(NAME(CXM1P));
2243   save_item(NAME(CXP0FB));
2244   save_item(NAME(CXP1FB));
2245   save_item(NAME(CXM0FB));
2246   save_item(NAME(CXM1FB));
2247   save_item(NAME(CXBLPF));
2248   save_item(NAME(CXPPMM));
2249   save_item(NAME(RESMP0));
2250   save_item(NAME(RESMP1));
2251   save_item(NAME(PF0));
2252   save_item(NAME(PF1));
2253   save_item(NAME(PF2));
2254   save_item(NAME(INPT4));
2255   save_item(NAME(INPT5));
2256   save_item(NAME(prevGRP0));
2257   save_item(NAME(prevGRP1));
2258   save_item(NAME(prevENABL));
2259   save_item(NAME(HMOVE_started));
2260   save_item(NAME(HMOVE_started_previous));
2261   save_item(NAME(HMP0_latch));
2262   save_item(NAME(HMP1_latch));
2263   save_item(NAME(HMM0_latch));
2264   save_item(NAME(HMM1_latch));
2265   save_item(NAME(HMBL_latch));
2266   save_item(NAME(REFLECT));
2267   save_item(NAME(NUSIZx_changed));
2268}
trunk/src/mame/video/tia.h
r242932r242933
199199   bitmap_ind16 *helper[3];
200200
201201   UINT16 screen_height;
202   
203   void register_save_state();
202204};
203205
204206class tia_pal_video_device : public tia_video_device
trunk/src/mess/drivers/a2600.c
r242932r242933
209209         if ( supported_screen_heights[i] != m_current_screen_height )
210210         {
211211            m_current_screen_height = supported_screen_heights[i];
212//              machine.first_screen()->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_NTSC ) * 228 * m_current_screen_height );
212//              m_screen->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_NTSC ) * 228 * m_current_screen_height );
213213         }
214214      }
215215   }
r242932r242933
226226         if ( supported_screen_heights[i] != m_current_screen_height )
227227         {
228228            m_current_screen_height = supported_screen_heights[i];
229//              machine.first_screen()->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_PAL ) * 228 * m_current_screen_height );
229//              m_screen->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_PAL ) * 228 * m_current_screen_height );
230230         }
231231      }
232232   }
r242932r242933
316316
317317   /* Banks may have changed, reset the cpu so it uses the correct reset vector */
318318   m_maincpu->reset();
319   
320   save_item(NAME(m_current_screen_height));
319321}
320322
321323
r242932r242933
541543#define rom_a2600p rom_a2600
542544
543545/*    YEAR  NAME    PARENT  COMPAT  MACHINE INPUT   INIT    COMPANY     FULLNAME */
544CONS( 1977, a2600,  0,      0,      a2600,  a2600, driver_device,   0,      "Atari",    "Atari 2600 (NTSC)" , 0)
545CONS( 1978, a2600p, a2600,  0,      a2600p, a2600, driver_device,   0,      "Atari",    "Atari 2600 (PAL)",   0)
546CONS( 1977, a2600,  0,      0,      a2600,  a2600, driver_device,   0,      "Atari",    "Atari 2600 (NTSC)" , GAME_SUPPORTS_SAVE )
547CONS( 1978, a2600p, a2600,  0,      a2600p, a2600, driver_device,   0,      "Atari",    "Atari 2600 (PAL)",   GAME_SUPPORTS_SAVE )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team