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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
// license:BSD-3-Clause
// copyright-holders:Carlos A. Lozano, Rob Rosenbrock, Phil Stroffolino
#ifndef MAME_INCLUDES_XAIN_H
#define MAME_INCLUDES_XAIN_H
#pragma once
#include "machine/taito68705interface.h"
#include "machine/gen_latch.h"
#include "machine/timer.h"
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"
class xain_state : public driver_device
{
public:
xain_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
, m_subcpu(*this, "sub")
, m_mcu(*this, "mcu")
, m_gfxdecode(*this, "gfxdecode")
, m_screen(*this, "screen")
, m_palette(*this, "palette")
, m_soundlatch(*this, "soundlatch")
, m_charram(*this, "charram")
, m_bgram(*this, "bgram%u", 0U)
, m_spriteram(*this, "spriteram")
, m_char_tilemap(nullptr)
, m_bg_tilemaps{ nullptr, nullptr }
, m_rom_banks(*this, { "mainbank", "subbank" })
{
}
void xsleena(machine_config &config);
void xsleenab(machine_config &config);
DECLARE_READ_LINE_MEMBER(vblank_r);
DECLARE_CUSTOM_INPUT_MEMBER(mcu_status_r);
protected:
virtual void machine_start() override;
virtual void video_start() override;
private:
void cpuA_bankswitch_w(uint8_t data);
void cpuB_bankswitch_w(uint8_t data);
void main_irq_w(offs_t offset, uint8_t data);
void irqA_assert_w(uint8_t data);
void irqB_clear_w(uint8_t data);
uint8_t mcu_comm_reset_r();
template <unsigned N> void bgram_w(offs_t offset, uint8_t data);
void charram_w(offs_t offset, uint8_t data);
template <unsigned N> void scrollx_w(offs_t offset, uint8_t data);
template <unsigned N> void scrolly_w(offs_t offset, uint8_t data);
void flipscreen_w(uint8_t data);
TILEMAP_MAPPER_MEMBER(back_scan);
template <unsigned N> TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_char_tile_info);
TIMER_DEVICE_CALLBACK_MEMBER(scanline);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void bootleg_map(address_map &map);
void main_map(address_map &map);
void cpu_map_B(address_map &map);
void sound_map(address_map &map);
int scanline_to_vcount(int scanline);
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<cpu_device> m_subcpu;
optional_device<taito68705_mcu_device> m_mcu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<u8> m_charram;
required_shared_ptr_array<u8, 2> m_bgram;
required_shared_ptr<u8> m_spriteram;
tilemap_t *m_char_tilemap = nullptr;
tilemap_t *m_bg_tilemaps[2]{};
required_memory_bank_array<2> m_rom_banks;
int m_vblank = 0;
u8 m_pri = 0;
u8 m_scrollx[2][2]{};
u8 m_scrolly[2][2]{};
};
#endif // MAME_INCLUDES_XAIN_H
|