Files
px68k-libretro/fmgen/fmtimer.h
T
libretroadmin 3bb967da25 [PATCH] Add savestate handling
Some notes to consider:
- consider this wip. some vars might not be necessary.
- only for C68K cpu core
- minimally tested. it works on HD files, and multi-disks but have not
  tested on anything that switches to another disk yet or drive letter.
- M3U/CMD platlist format is necessary to keep track of what content the
  state is for (filename for .statex tracking for example). Switching
  disk or switching to another game through ingame menu will break
  currently loaded state.
- in core is use to run in content-less mode, the savestate will be
  universal or system state (PX68K.state) and will not be based on what
  content is loaded.
- MIDI: Loading patchsets and other midi params from a state file is not
  implemented. It may take a while to refresh instruments sets until
  next time MIDI sends new data. Its also required that only load a
  state after selecting the correct MIDI device from the ingame menu.
- requires new px68k_libretro.info file, with savestate support enabled
2024-09-09 04:11:18 +02:00

52 lines
1.0 KiB
C++

// ---------------------------------------------------------------------------
// FM sound generator common timer module
// Copyright (C) cisc 1998, 2000.
// ---------------------------------------------------------------------------
// $fmgen-Id: fmtimer.h,v 1.2 2003/04/22 13:12:53 cisc Exp $
#ifndef FM_TIMER_H
#define FM_TIMER_H
#include <stdint.h>
namespace FM
{
class Timer
{
public:
void Reset();
bool Count(int32_t us);
int StateAction(StateMem *st, int load, int data_only);
protected:
virtual void SetStatus(uint32_t bit) = 0;
virtual void ResetStatus(uint32_t bit) = 0;
void SetTimerBase(uint32_t clock);
void SetTimerA(uint32_t addr, uint32_t data);
void SetTimerB(uint32_t data);
void SetTimerControl(uint32_t data);
uint8_t status;
uint8_t regtc;
private:
virtual void TimerA() {}
uint8_t regta[2];
int32_t timera, timera_count;
int32_t timerb, timerb_count;
int32_t timer_step;
};
inline void Timer::Reset()
{
timera_count = 0;
timerb_count = 0;
}
} // namespace FM
#endif // FM_TIMER_H