Previous 199869 Revisions Next

r33850 Friday 12th December, 2014 at 18:30:48 UTC by Osso
e132xs.c: added missing save states, fixes save states in at least pasha2, f2mosaic and gstream (nw)
[src/emu/cpu/e132xs]e132xs.c e132xs.h
[src/mame/drivers]f-32.c

trunk/src/emu/cpu/e132xs/e132xs.c
r242361r242362
583583UINT32 hyperstone_device::compute_tr()
584584{
585585   UINT64 cycles_since_base = total_cycles() - m_tr_base_cycles;
586   UINT64 clocks_since_base = cycles_since_base >> m_clock_scale;
586   UINT64 clocks_since_base = cycles_since_base >> m_clck_scale;
587587   return m_tr_base_value + (clocks_since_base / m_tr_clocks_per_tick);
588588}
589589
r242361r242362
591591{
592592   UINT32 prevtr = compute_tr();
593593   TPR &= ~0x80000000;
594   m_clock_scale = (TPR >> 26) & m_clock_scale_mask;
595   m_clock_cycles_1 = 1 << m_clock_scale;
596   m_clock_cycles_2 = 2 << m_clock_scale;
597   m_clock_cycles_4 = 4 << m_clock_scale;
598   m_clock_cycles_6 = 6 << m_clock_scale;
594   m_clck_scale = (TPR >> 26) & m_clock_scale_mask;
595   m_clock_cycles_1 = 1 << m_clck_scale;
596   m_clock_cycles_2 = 2 << m_clck_scale;
597   m_clock_cycles_4 = 4 << m_clck_scale;
598   m_clock_cycles_6 = 6 << m_clck_scale;
599599   m_tr_clocks_per_tick = ((TPR >> 16) & 0xff) + 2;
600600   m_tr_base_value = prevtr;
601601   m_tr_base_cycles = total_cycles();
r242361r242362
604604void hyperstone_device::adjust_timer_interrupt()
605605{
606606   UINT64 cycles_since_base = total_cycles() - m_tr_base_cycles;
607   UINT64 clocks_since_base = cycles_since_base >> m_clock_scale;
608   UINT64 cycles_until_next_clock = cycles_since_base - (clocks_since_base << m_clock_scale);
607   UINT64 clocks_since_base = cycles_since_base >> m_clck_scale;
608   UINT64 cycles_until_next_clock = cycles_since_base - (clocks_since_base << m_clck_scale);
609609
610610   if (cycles_until_next_clock == 0)
611      cycles_until_next_clock = (UINT64)(1 << m_clock_scale);
611      cycles_until_next_clock = (UINT64)(1 << m_clck_scale);
612612
613613   /* special case: if we have a change pending, set a timer to fire then */
614614   if (TPR & 0x80000000)
615615   {
616616      UINT64 clocks_until_int = m_tr_clocks_per_tick - (clocks_since_base % m_tr_clocks_per_tick);
617      UINT64 cycles_until_int = (clocks_until_int << m_clock_scale) + cycles_until_next_clock;
617      UINT64 cycles_until_int = (clocks_until_int << m_clck_scale) + cycles_until_next_clock;
618618      m_timer->adjust(cycles_to_attotime(cycles_until_int + 1), 1);
619619   }
620620
r242361r242362
631631      else
632632      {
633633         UINT64 clocks_until_int = mulu_32x32(delta, m_tr_clocks_per_tick);
634         UINT64 cycles_until_int = (clocks_until_int << m_clock_scale) + cycles_until_next_clock;
634         UINT64 cycles_until_int = (clocks_until_int << m_clck_scale) + cycles_until_next_clock;
635635         m_timer->adjust(cycles_to_attotime(cycles_until_int));
636636      }
637637   }
r242361r242362
15361536   m_op = 0;
15371537   m_trap_entry = 0;
15381538   m_clock_scale_mask = 0;
1539   m_clock_scale = 0;
1539   m_clck_scale = 0;
15401540   m_clock_cycles_1 = 0;
15411541   m_clock_cycles_2 = 0;
15421542   m_clock_cycles_4 = 0;
r242361r242362
16851685   save_item(NAME(m_intblock));
16861686   save_item(NAME(m_delay.delay_cmd));
16871687   save_item(NAME(m_tr_clocks_per_tick));
1688   save_item(NAME(m_tr_base_value));
1689   save_item(NAME(m_tr_base_cycles));
1690   save_item(NAME(m_timer_int_pending));
1691   save_item(NAME(m_clck_scale));
1692   save_item(NAME(m_clock_scale_mask));
1693   save_item(NAME(m_clock_cycles_1));
1694   save_item(NAME(m_clock_cycles_2));
1695   save_item(NAME(m_clock_cycles_4));
1696   save_item(NAME(m_clock_cycles_6));
16881697
16891698   // set our instruction counter
16901699   m_icountptr = &m_icount;
r242361r242362
20522061      }
20532062   }
20542063
2055   m_icount -= 36 << m_clock_scale;
2064   m_icount -= 36 << m_clck_scale;
20562065}
20572066
20582067void hyperstone_device::hyperstone_divs(struct hyperstone_device::regs_decode *decode)
r242361r242362
21012110      }
21022111   }
21032112
2104   m_icount -= 36 << m_clock_scale;
2113   m_icount -= 36 << m_clck_scale;
21052114}
21062115
21072116void hyperstone_device::hyperstone_xm(struct hyperstone_device::regs_decode *decode)
r242361r242362
41094118   }
41104119
41114120   if((SREG >= 0xffff8000 && SREG <= 0x7fff) && (DREG >= 0xffff8000 && DREG <= 0x7fff))
4112      m_icount -= 3 << m_clock_scale;
4121      m_icount -= 3 << m_clck_scale;
41134122   else
4114      m_icount -= 5 << m_clock_scale;
4123      m_icount -= 5 << m_clck_scale;
41154124}
41164125
41174126void hyperstone_device::hyperstone_fadd(struct hyperstone_device::regs_decode *decode)
trunk/src/emu/cpu/e132xs/e132xs.h
r242361r242362
267267   UINT32  m_trap_entry;   // entry point to get trap address
268268
269269   UINT8   m_clock_scale_mask;
270   UINT8   m_clock_scale;
270   UINT8   m_clck_scale;
271271   UINT8   m_clock_cycles_1;
272272   UINT8   m_clock_cycles_2;
273273   UINT8   m_clock_cycles_4;
trunk/src/mame/drivers/f-32.c
r242361r242362
2222public:
2323   mosaicf2_state(const machine_config &mconfig, device_type type, const char *tag)
2424      : driver_device(mconfig, type, tag),
25         m_maincpu(*this, "maincpu") ,
25      m_maincpu(*this, "maincpu") ,
2626      m_videoram(*this, "videoram"){ }
2727
28   /* devices */
29   required_device<e132xn_device>  m_maincpu;
30   
2831   /* memory pointers */
29   required_device<e132xn_device>  m_maincpu;
3032   required_shared_ptr<UINT32> m_videoram;
33   
3134   DECLARE_READ32_MEMBER(f32_input_port_1_r);
3235   UINT32 screen_update_mosaicf2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3336};


Previous 199869 Revisions Next


© 1997-2024 The MAME Team