1 // license:BSD-3-Clause
2 // copyright-holders:Miodrag Milanovic
3 /*****************************************************************************
4  *
5  * includes/partner.h
6  *
7  ****************************************************************************/
8 
9 #ifndef MAME_INCLUDES_PARTNER_H
10 #define MAME_INCLUDES_PARTNER_H
11 
12 #pragma once
13 
14 #include "includes/radio86.h"
15 
16 #include "imagedev/floppy.h"
17 #include "machine/i8255.h"
18 #include "machine/wd_fdc.h"
19 #include "machine/ram.h"
20 
21 class partner_state : public radio86_state
22 {
23 public:
partner_state(const machine_config & mconfig,device_type type,const char * tag)24 	partner_state(const machine_config &mconfig, device_type type, const char *tag)
25 		: radio86_state(mconfig, type, tag)
26 		, m_ram(*this, RAM_TAG)
27 		, m_fdc(*this, "fdc")
28 		, m_bank(*this, "bank%u", 1U)
29 	{ }
30 
31 	void init_partner();
32 	void partner(machine_config &config);
33 
34 private:
35 	u8 floppy_r(offs_t offset);
36 	void floppy_w(offs_t offset, u8 data);
37 	void win_memory_page_w(u8 data);
38 	void mem_page_w(u8 data);
39 
40 	I8275_DRAW_CHARACTER_MEMBER(display_pixels);
41 
42 	DECLARE_FLOPPY_FORMATS( floppy_formats );
43 
44 	void mem_map(address_map &map);
45 
46 	void window_1(uint8_t bank_num, uint16_t offset,uint8_t *rom);
47 	void window_2(uint8_t bank_num, uint16_t offset,uint8_t *rom);
48 	void iomap_bank(uint8_t *rom);
49 	void bank_switch();
50 
51 	u8 m_mem_page;
52 	u8 m_win_mem_page;
53 
54 	required_device<ram_device> m_ram;
55 	required_device<fd1793_device> m_fdc;
56 	required_memory_bank_array<13> m_bank;
57 
58 	void machine_reset() override;
59 	void machine_start() override;
60 };
61 
62 
63 #endif // MAME_INCLUDES_PARTNER_H
64