2018-03-09 13:01:08 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
2018-03-10 15:05:10 -05:00
|
|
|
#include "i8259.h"
|
2018-03-09 13:01:08 -05:00
|
|
|
|
|
|
|
namespace openxbox {
|
|
|
|
|
|
|
|
#define PORT_PIT_DATA_0 0x40
|
|
|
|
#define PORT_PIT_DATA_1 0x41
|
|
|
|
#define PORT_PIT_DATA_2 0x42
|
|
|
|
#define PORT_PIT_COMMAND 0x43
|
|
|
|
|
|
|
|
class i8254
|
|
|
|
{
|
|
|
|
public:
|
2018-03-10 15:05:10 -05:00
|
|
|
i8254(i8259 *pic, float tickRate = 1000.0f);
|
2018-03-09 13:01:08 -05:00
|
|
|
void Reset();
|
|
|
|
|
|
|
|
void Run();
|
|
|
|
|
|
|
|
void IORead(uint32_t addr, uint32_t *value, uint16_t size);
|
|
|
|
void IOWrite(uint32_t addr, uint32_t value, uint16_t size);
|
|
|
|
private:
|
2018-03-10 15:05:10 -05:00
|
|
|
i8259 *m_pic;
|
2018-03-09 13:01:08 -05:00
|
|
|
float m_tickRate;
|
|
|
|
bool m_running;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|