blob: e7f4186d256ee2aee4f5901012ef58fa8a5032f9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// license:BSD-3-Clause
// copyright-holders:Eric Smith
/*
* mathbox.h: math box simulation (Battlezone/Red Baron/Tempest)
*
* Copyright Eric Smith
*
*/
#ifndef MAME_ATARI_MATHBOX_H
#define MAME_ATARI_MATHBOX_H
#pragma once
/* ----- device interface ----- */
class mathbox_device : public device_t
{
public:
mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void go_w(offs_t offset, uint8_t data);
uint8_t status_r();
uint8_t lo_r();
uint8_t hi_r();
protected:
// device-level overrides
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
private:
// internal state
/* math box scratch registers */
int16_t m_reg[16]{};
/* math box result */
int16_t m_result = 0;
};
DECLARE_DEVICE_TYPE(MATHBOX, mathbox_device)
#endif // MAME_ATARI_MATHBOX_H
|