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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
#ifndef MAME_VIDEO_LADYBUG_H
#define MAME_VIDEO_LADYBUG_H
#pragma once
#include "screen.h"
#include "tilemap.h"
// used by ladybug and sraider
class ladybug_video_device : public device_t
{
public:
ladybug_video_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
template <typename T> void set_gfxdecode_tag(T &&tag) { m_gfxdecode.set_tag(std::forward<T>(tag)); }
uint8_t spr_r(offs_t offset) { return m_spr_ram[offset & 0x03ff]; }
void spr_w(offs_t offset, uint8_t data) { m_spr_ram[offset & 0x03ff] = data; }
uint8_t bg_r(offs_t offset) { return m_bg_ram[offset & 0x07ff]; }
void bg_w(offs_t offset, uint8_t data);
void draw(screen_device &screen, bitmap_ind16 &bitmap, rectangle const &cliprect, bool flip);
protected:
virtual void device_start() override;
TILE_GET_INFO_MEMBER(get_bg_tile_info);
private:
required_device<gfxdecode_device> m_gfxdecode;
std::unique_ptr<u8 []> m_spr_ram;
std::unique_ptr<u8 []> m_bg_ram;
tilemap_t *m_bg_tilemap;
};
// used by zerohour, redclash and sraider
class zerohour_stars_device : public device_t
{
public:
zerohour_stars_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
void set_enable(bool on);
void update_state();
void set_speed(u8 speed, u8 mask);
void draw(bitmap_ind16 &bitmap, rectangle const &cliprect, u8 pal_offs, bool has_va, u8 firstx, u8 lastx);
protected:
virtual void device_start() override;
virtual void device_reset() override;
private:
u8 m_enable;
u8 m_speed;
u32 m_state = 0;
u16 m_offset;
u8 m_count;
};
DECLARE_DEVICE_TYPE(LADYBUG_VIDEO, ladybug_video_device)
DECLARE_DEVICE_TYPE(ZEROHOUR_STARS, zerohour_stars_device)
#endif // MAME_VIDEO_LADYBUG_H
|