1 // license:BSD-3-Clause 2 // copyright-holders:Miodrag Milanovic 3 /***************************************************************************** 4 * 5 * includes/b2m.h 6 * 7 ****************************************************************************/ 8 9 #ifndef MAME_INCLUDES_B2M_H 10 #define MAME_INCLUDES_B2M_H 11 12 #pragma once 13 14 #include "imagedev/floppy.h" 15 #include "machine/i8255.h" 16 #include "machine/pic8259.h" 17 #include "machine/pit8253.h" 18 #include "machine/ram.h" 19 #include "machine/wd_fdc.h" 20 #include "sound/spkrdev.h" 21 #include "emupal.h" 22 23 class b2m_state : public driver_device 24 { 25 public: b2m_state(const machine_config & mconfig,device_type type,const char * tag)26 b2m_state(const machine_config &mconfig, device_type type, const char *tag) 27 : driver_device(mconfig, type, tag) 28 , m_maincpu(*this, "maincpu") 29 , m_speaker(*this, "speaker") 30 , m_pit(*this, "pit") 31 , m_ram(*this, RAM_TAG) 32 , m_palette(*this, "palette") 33 , m_fdc(*this, "fdc") 34 , m_fd(*this, "fdc:%u", 0U) 35 , m_pic(*this, "pic") 36 { } 37 38 void b2mrom(machine_config &config); 39 void b2m(machine_config &config); 40 41 private: 42 uint8_t keyboard_r(offs_t offset); 43 void palette_w(offs_t offset, uint8_t data); 44 uint8_t palette_r(offs_t offset); 45 void localmachine_w(uint8_t data); 46 uint8_t localmachine_r(); 47 48 void b2m_palette(palette_device &palette) const; 49 uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); 50 INTERRUPT_GEN_MEMBER(vblank_interrupt); 51 DECLARE_WRITE_LINE_MEMBER(pit_out1); 52 void ppi1_porta_w(uint8_t data); 53 void ppi1_portb_w(uint8_t data); 54 void ppi1_portc_w(uint8_t data); 55 uint8_t ppi1_portb_r(); 56 void ppi2_portc_w(uint8_t data); 57 uint8_t romdisk_porta_r(); 58 void romdisk_portb_w(uint8_t data); 59 void romdisk_portc_w(uint8_t data); 60 DECLARE_WRITE_LINE_MEMBER(fdc_drq); 61 DECLARE_FLOPPY_FORMATS( b2m_floppy_formats ); 62 63 void b2m_io(address_map &map); 64 void b2m_mem(address_map &map); 65 void b2m_rom_io(address_map &map); 66 void machine_start() override; 67 void machine_reset() override; 68 69 void postload(); 70 void set_bank(int bank); 71 72 uint8_t m_porta; 73 uint8_t m_video_scroll; 74 uint8_t m_portc; 75 76 uint8_t m_video_page; 77 78 uint8_t m_romdisk_lsb; 79 uint8_t m_romdisk_msb; 80 81 uint8_t m_color[4]; 82 uint8_t m_localmachine; 83 uint8_t m_vblank_state; 84 required_device<cpu_device> m_maincpu; 85 required_device<speaker_sound_device> m_speaker; 86 required_device<pit8253_device> m_pit; 87 required_device<ram_device> m_ram; 88 required_device<palette_device> m_palette; 89 90 /* devices */ 91 optional_device<fd1793_device> m_fdc; 92 optional_device_array<floppy_connector, 2> m_fd; 93 optional_device<pic8259_device> m_pic; 94 }; 95 96 #endif // MAME_INCLUDES_B2M_H 97