summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/fm7.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/fm7.cpp')
-rw-r--r--src/mame/drivers/fm7.cpp553
1 files changed, 283 insertions, 270 deletions
diff --git a/src/mame/drivers/fm7.cpp b/src/mame/drivers/fm7.cpp
index 9a17d4f6bb3..4a63438c638 100644
--- a/src/mame/drivers/fm7.cpp
+++ b/src/mame/drivers/fm7.cpp
@@ -1427,59 +1427,61 @@ WRITE_LINE_MEMBER(fm7_state::fm77av_fmirq)
FFF0 - FFFF: Interrupt vector table
*/
// The FM-7 has only 64kB RAM, so we'll worry about banking when we do the later models
-ADDRESS_MAP_START(fm7_state::fm7_mem)
- AM_RANGE(0x0000,0x7fff) AM_RAM
- AM_RANGE(0x8000,0xfbff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank2") // also F-BASIC ROM, when enabled
- AM_RANGE(0xfc00,0xfc7f) AM_RAM
- AM_RANGE(0xfc80,0xfcff) AM_READWRITE(fm7_main_shared_r,fm7_main_shared_w)
+void fm7_state::fm7_mem(address_map &map)
+{
+ map(0x0000, 0x7fff).ram();
+ map(0x8000, 0xfbff).bankr("bank1").bankw("bank2"); // also F-BASIC ROM, when enabled
+ map(0xfc00, 0xfc7f).ram();
+ map(0xfc80, 0xfcff).rw(this, FUNC(fm7_state::fm7_main_shared_r), FUNC(fm7_state::fm7_main_shared_w));
// I/O space (FD00-FDFF)
- AM_RANGE(0xfd00,0xfd01) AM_READWRITE(fm7_keyboard_r,fm7_cassette_printer_w)
- AM_RANGE(0xfd02,0xfd02) AM_READWRITE(fm7_cassette_printer_r,fm7_irq_mask_w) // IRQ mask
- AM_RANGE(0xfd03,0xfd03) AM_READWRITE(fm7_irq_cause_r,fm7_beeper_w) // IRQ flags
- AM_RANGE(0xfd04,0xfd04) AM_READ(fm7_fd04_r)
- AM_RANGE(0xfd05,0xfd05) AM_READWRITE(fm7_subintf_r,fm7_subintf_w)
- AM_RANGE(0xfd06,0xfd0c) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd0d,0xfd0d) AM_READWRITE(fm7_psg_select_r,fm7_psg_select_w)
- AM_RANGE(0xfd0e,0xfd0e) AM_READWRITE(fm7_psg_data_r, fm7_psg_data_w)
- AM_RANGE(0xfd0f,0xfd0f) AM_READWRITE(fm7_rom_en_r,fm7_rom_en_w)
- AM_RANGE(0xfd10,0xfd17) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd18,0xfd1f) AM_READWRITE(fm7_fdc_r,fm7_fdc_w)
- AM_RANGE(0xfd20,0xfd23) AM_READWRITE(fm7_kanji_r,fm7_kanji_w)
- AM_RANGE(0xfd24,0xfd36) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd37,0xfd37) AM_WRITE(fm7_multipage_w)
- AM_RANGE(0xfd38,0xfd3f) AM_READWRITE(fm7_palette_r,fm7_palette_w)
- AM_RANGE(0xfd40,0xfdff) AM_READ(fm7_unknown_r)
+ map(0xfd00, 0xfd01).rw(this, FUNC(fm7_state::fm7_keyboard_r), FUNC(fm7_state::fm7_cassette_printer_w));
+ map(0xfd02, 0xfd02).rw(this, FUNC(fm7_state::fm7_cassette_printer_r), FUNC(fm7_state::fm7_irq_mask_w)); // IRQ mask
+ map(0xfd03, 0xfd03).rw(this, FUNC(fm7_state::fm7_irq_cause_r), FUNC(fm7_state::fm7_beeper_w)); // IRQ flags
+ map(0xfd04, 0xfd04).r(this, FUNC(fm7_state::fm7_fd04_r));
+ map(0xfd05, 0xfd05).rw(this, FUNC(fm7_state::fm7_subintf_r), FUNC(fm7_state::fm7_subintf_w));
+ map(0xfd06, 0xfd0c).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd0d, 0xfd0d).rw(this, FUNC(fm7_state::fm7_psg_select_r), FUNC(fm7_state::fm7_psg_select_w));
+ map(0xfd0e, 0xfd0e).rw(this, FUNC(fm7_state::fm7_psg_data_r), FUNC(fm7_state::fm7_psg_data_w));
+ map(0xfd0f, 0xfd0f).rw(this, FUNC(fm7_state::fm7_rom_en_r), FUNC(fm7_state::fm7_rom_en_w));
+ map(0xfd10, 0xfd17).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd18, 0xfd1f).rw(this, FUNC(fm7_state::fm7_fdc_r), FUNC(fm7_state::fm7_fdc_w));
+ map(0xfd20, 0xfd23).rw(this, FUNC(fm7_state::fm7_kanji_r), FUNC(fm7_state::fm7_kanji_w));
+ map(0xfd24, 0xfd36).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd37, 0xfd37).w(this, FUNC(fm7_state::fm7_multipage_w));
+ map(0xfd38, 0xfd3f).rw(this, FUNC(fm7_state::fm7_palette_r), FUNC(fm7_state::fm7_palette_w));
+ map(0xfd40, 0xfdff).r(this, FUNC(fm7_state::fm7_unknown_r));
// Boot ROM
- AM_RANGE(0xfe00,0xffdf) AM_ROMBANK("bank17")
- AM_RANGE(0xffe0,0xffef) AM_RAM
- AM_RANGE(0xfff0,0xffff) AM_READWRITE(vector_r,vector_w)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(fm7_state::fm8_mem)
- AM_RANGE(0x0000,0x7fff) AM_RAM
- AM_RANGE(0x8000,0xfbff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank2") // also F-BASIC ROM, when enabled
- AM_RANGE(0xfc00,0xfc7f) AM_RAM
- AM_RANGE(0xfc80,0xfcff) AM_READWRITE(fm7_main_shared_r,fm7_main_shared_w)
+ map(0xfe00, 0xffdf).bankr("bank17");
+ map(0xffe0, 0xffef).ram();
+ map(0xfff0, 0xffff).rw(this, FUNC(fm7_state::vector_r), FUNC(fm7_state::vector_w));
+}
+
+void fm7_state::fm8_mem(address_map &map)
+{
+ map(0x0000, 0x7fff).ram();
+ map(0x8000, 0xfbff).bankr("bank1").bankw("bank2"); // also F-BASIC ROM, when enabled
+ map(0xfc00, 0xfc7f).ram();
+ map(0xfc80, 0xfcff).rw(this, FUNC(fm7_state::fm7_main_shared_r), FUNC(fm7_state::fm7_main_shared_w));
// I/O space (FD00-FDFF)
- AM_RANGE(0xfd00,0xfd01) AM_READWRITE(fm7_keyboard_r,fm7_cassette_printer_w)
- AM_RANGE(0xfd02,0xfd02) AM_READWRITE(fm7_cassette_printer_r,fm7_irq_mask_w) // IRQ mask
- AM_RANGE(0xfd03,0xfd03) AM_READWRITE(fm7_irq_cause_r,fm7_beeper_w) // IRQ flags
- AM_RANGE(0xfd04,0xfd04) AM_READ(fm7_fd04_r)
- AM_RANGE(0xfd05,0xfd05) AM_READWRITE(fm7_subintf_r,fm7_subintf_w)
- AM_RANGE(0xfd06,0xfd0c) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd0f,0xfd0f) AM_READWRITE(fm7_rom_en_r,fm7_rom_en_w)
- AM_RANGE(0xfd10,0xfd17) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd18,0xfd1f) AM_READWRITE(fm7_fdc_r,fm7_fdc_w)
- AM_RANGE(0xfd20,0xfd23) AM_READWRITE(fm7_kanji_r,fm7_kanji_w)
- AM_RANGE(0xfd24,0xfd36) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd37,0xfd37) AM_WRITE(fm7_multipage_w)
- AM_RANGE(0xfd38,0xfd3f) AM_READWRITE(fm7_palette_r,fm7_palette_w)
- AM_RANGE(0xfd40,0xfdff) AM_READ(fm7_unknown_r)
+ map(0xfd00, 0xfd01).rw(this, FUNC(fm7_state::fm7_keyboard_r), FUNC(fm7_state::fm7_cassette_printer_w));
+ map(0xfd02, 0xfd02).rw(this, FUNC(fm7_state::fm7_cassette_printer_r), FUNC(fm7_state::fm7_irq_mask_w)); // IRQ mask
+ map(0xfd03, 0xfd03).rw(this, FUNC(fm7_state::fm7_irq_cause_r), FUNC(fm7_state::fm7_beeper_w)); // IRQ flags
+ map(0xfd04, 0xfd04).r(this, FUNC(fm7_state::fm7_fd04_r));
+ map(0xfd05, 0xfd05).rw(this, FUNC(fm7_state::fm7_subintf_r), FUNC(fm7_state::fm7_subintf_w));
+ map(0xfd06, 0xfd0c).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd0f, 0xfd0f).rw(this, FUNC(fm7_state::fm7_rom_en_r), FUNC(fm7_state::fm7_rom_en_w));
+ map(0xfd10, 0xfd17).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd18, 0xfd1f).rw(this, FUNC(fm7_state::fm7_fdc_r), FUNC(fm7_state::fm7_fdc_w));
+ map(0xfd20, 0xfd23).rw(this, FUNC(fm7_state::fm7_kanji_r), FUNC(fm7_state::fm7_kanji_w));
+ map(0xfd24, 0xfd36).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd37, 0xfd37).w(this, FUNC(fm7_state::fm7_multipage_w));
+ map(0xfd38, 0xfd3f).rw(this, FUNC(fm7_state::fm7_palette_r), FUNC(fm7_state::fm7_palette_w));
+ map(0xfd40, 0xfdff).r(this, FUNC(fm7_state::fm7_unknown_r));
// Boot ROM
- AM_RANGE(0xfe00,0xffdf) AM_ROMBANK("bank17")
- AM_RANGE(0xffe0,0xffef) AM_RAM
- AM_RANGE(0xfff0,0xffff) AM_READWRITE(vector_r,vector_w)
-ADDRESS_MAP_END
+ map(0xfe00, 0xffdf).bankr("bank17");
+ map(0xffe0, 0xffef).ram();
+ map(0xfff0, 0xffff).rw(this, FUNC(fm7_state::vector_r), FUNC(fm7_state::vector_w));
+}
/*
0000 - 3FFF: Video RAM bank 0 (Blue plane)
@@ -1492,248 +1494,259 @@ ADDRESS_MAP_END
FFF0 - FFFF: Interrupt vector table
*/
-ADDRESS_MAP_START(fm7_state::fm7_sub_mem)
- AM_RANGE(0x0000,0xbfff) AM_READWRITE(fm7_vram_r,fm7_vram_w) // VRAM
- AM_RANGE(0xc000,0xcfff) AM_RAM // Console RAM
- AM_RANGE(0xd000,0xd37f) AM_RAM // Work RAM
- AM_RANGE(0xd380,0xd3ff) AM_RAM AM_SHARE("shared_ram")
+void fm7_state::fm7_sub_mem(address_map &map)
+{
+ map(0x0000, 0xbfff).rw(this, FUNC(fm7_state::fm7_vram_r), FUNC(fm7_state::fm7_vram_w)); // VRAM
+ map(0xc000, 0xcfff).ram(); // Console RAM
+ map(0xd000, 0xd37f).ram(); // Work RAM
+ map(0xd380, 0xd3ff).ram().share("shared_ram");
// I/O space (D400-D4FF)
- AM_RANGE(0xd400,0xd401) AM_READ(fm7_sub_keyboard_r)
- AM_RANGE(0xd402,0xd402) AM_READ(fm7_cancel_ack)
- AM_RANGE(0xd403,0xd403) AM_READ(fm7_sub_beeper_r)
- AM_RANGE(0xd404,0xd404) AM_READ(fm7_attn_irq_r)
- AM_RANGE(0xd408,0xd408) AM_READWRITE(fm7_crt_r,fm7_crt_w)
- AM_RANGE(0xd409,0xd409) AM_READWRITE(fm7_vram_access_r,fm7_vram_access_w)
- AM_RANGE(0xd40a,0xd40a) AM_READWRITE(fm7_sub_busyflag_r,fm7_sub_busyflag_w)
- AM_RANGE(0xd40e,0xd40f) AM_WRITE(fm7_vram_offset_w)
- AM_RANGE(0xd800,0xffff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(fm7_state::fm11_mem)
- AM_RANGE(0x0000,0x0fff) AM_DEVREADWRITE("av_bank1", address_map_bank_device, read8, write8)
- AM_RANGE(0x1000,0x1fff) AM_DEVREADWRITE("av_bank2", address_map_bank_device, read8, write8)
- AM_RANGE(0x2000,0x2fff) AM_DEVREADWRITE("av_bank3", address_map_bank_device, read8, write8)
- AM_RANGE(0x3000,0x3fff) AM_DEVREADWRITE("av_bank4", address_map_bank_device, read8, write8)
- AM_RANGE(0x4000,0x4fff) AM_DEVREADWRITE("av_bank5", address_map_bank_device, read8, write8)
- AM_RANGE(0x5000,0x5fff) AM_DEVREADWRITE("av_bank6", address_map_bank_device, read8, write8)
- AM_RANGE(0x6000,0x6fff) AM_DEVREADWRITE("av_bank7", address_map_bank_device, read8, write8)
- AM_RANGE(0x7000,0x7fff) AM_DEVREADWRITE("av_bank8", address_map_bank_device, read8, write8)
- AM_RANGE(0x8000,0x8fff) AM_DEVREADWRITE("av_bank9", address_map_bank_device, read8, write8)
- AM_RANGE(0x9000,0x9fff) AM_DEVREADWRITE("av_bank10", address_map_bank_device, read8, write8)
- AM_RANGE(0xa000,0xafff) AM_DEVREADWRITE("av_bank11", address_map_bank_device, read8, write8)
- AM_RANGE(0xb000,0xbfff) AM_DEVREADWRITE("av_bank12", address_map_bank_device, read8, write8)
- AM_RANGE(0xc000,0xcfff) AM_DEVREADWRITE("av_bank13", address_map_bank_device, read8, write8)
- AM_RANGE(0xd000,0xdfff) AM_DEVREADWRITE("av_bank14", address_map_bank_device, read8, write8)
- AM_RANGE(0xe000,0xefff) AM_DEVREADWRITE("av_bank15", address_map_bank_device, read8, write8)
- AM_RANGE(0xf000,0xfbff) AM_DEVREADWRITE("av_bank16", address_map_bank_device, read8, write8)
- AM_RANGE(0xfc00,0xfc7f) AM_RAM
- AM_RANGE(0xfc80,0xfcff) AM_READWRITE(fm7_main_shared_r,fm7_main_shared_w)
+ map(0xd400, 0xd401).r(this, FUNC(fm7_state::fm7_sub_keyboard_r));
+ map(0xd402, 0xd402).r(this, FUNC(fm7_state::fm7_cancel_ack));
+ map(0xd403, 0xd403).r(this, FUNC(fm7_state::fm7_sub_beeper_r));
+ map(0xd404, 0xd404).r(this, FUNC(fm7_state::fm7_attn_irq_r));
+ map(0xd408, 0xd408).rw(this, FUNC(fm7_state::fm7_crt_r), FUNC(fm7_state::fm7_crt_w));
+ map(0xd409, 0xd409).rw(this, FUNC(fm7_state::fm7_vram_access_r), FUNC(fm7_state::fm7_vram_access_w));
+ map(0xd40a, 0xd40a).rw(this, FUNC(fm7_state::fm7_sub_busyflag_r), FUNC(fm7_state::fm7_sub_busyflag_w));
+ map(0xd40e, 0xd40f).w(this, FUNC(fm7_state::fm7_vram_offset_w));
+ map(0xd800, 0xffff).rom();
+}
+
+void fm7_state::fm11_mem(address_map &map)
+{
+ map(0x0000, 0x0fff).rw("av_bank1", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x1000, 0x1fff).rw("av_bank2", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x2000, 0x2fff).rw("av_bank3", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x3000, 0x3fff).rw("av_bank4", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x4000, 0x4fff).rw("av_bank5", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x5000, 0x5fff).rw("av_bank6", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x6000, 0x6fff).rw("av_bank7", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x7000, 0x7fff).rw("av_bank8", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x8000, 0x8fff).rw("av_bank9", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x9000, 0x9fff).rw("av_bank10", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xa000, 0xafff).rw("av_bank11", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xb000, 0xbfff).rw("av_bank12", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xc000, 0xcfff).rw("av_bank13", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xd000, 0xdfff).rw("av_bank14", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xe000, 0xefff).rw("av_bank15", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xf000, 0xfbff).rw("av_bank16", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xfc00, 0xfc7f).ram();
+ map(0xfc80, 0xfcff).rw(this, FUNC(fm7_state::fm7_main_shared_r), FUNC(fm7_state::fm7_main_shared_w));
// I/O space (FD00-FDFF)
- AM_RANGE(0xfd00,0xfd01) AM_READWRITE(fm7_keyboard_r,fm7_cassette_printer_w)
- AM_RANGE(0xfd02,0xfd02) AM_READWRITE(fm7_cassette_printer_r,fm7_irq_mask_w) // IRQ mask
- AM_RANGE(0xfd03,0xfd03) AM_READWRITE(fm7_irq_cause_r,fm7_beeper_w) // IRQ flags
- AM_RANGE(0xfd04,0xfd04) AM_READ(fm7_fd04_r)
- AM_RANGE(0xfd05,0xfd05) AM_READWRITE(fm7_subintf_r,fm7_subintf_w)
- AM_RANGE(0xfd06,0xfd0a) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd0b,0xfd0b) AM_READ(fm77av_boot_mode_r)
- AM_RANGE(0xfd0c,0xfd0c) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd0f,0xfd0f) AM_READWRITE(fm7_rom_en_r,fm7_rom_en_w)
- AM_RANGE(0xfd10,0xfd10) AM_WRITE(fm7_init_en_w)
- AM_RANGE(0xfd11,0xfd11) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd12,0xfd12) AM_READWRITE(fm77av_sub_modestatus_r,fm77av_sub_modestatus_w)
- AM_RANGE(0xfd13,0xfd13) AM_WRITE(fm77av_sub_bank_w)
- AM_RANGE(0xfd14,0xfd14) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd17,0xfd17) AM_READ(fm7_fmirq_r)
- AM_RANGE(0xfd18,0xfd1f) AM_READWRITE(fm7_fdc_r,fm7_fdc_w)
- AM_RANGE(0xfd20,0xfd23) AM_READWRITE(fm7_kanji_r,fm7_kanji_w)
- AM_RANGE(0xfd24,0xfd2b) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd30,0xfd34) AM_WRITE(fm77av_analog_palette_w)
- AM_RANGE(0xfd35,0xfd36) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd37,0xfd37) AM_WRITE(fm7_multipage_w)
- AM_RANGE(0xfd38,0xfd3f) AM_READWRITE(fm7_palette_r,fm7_palette_w)
- AM_RANGE(0xfd40,0xfd7f) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd80,0xfd93) AM_READWRITE(fm7_mmr_r,fm7_mmr_w)
- AM_RANGE(0xfd94,0xfdff) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfe00,0xffdf) AM_RAM_WRITE(fm77av_bootram_w) AM_SHARE("boot_ram")
- AM_RANGE(0xffe0,0xffef) AM_RAM
- AM_RANGE(0xfff0,0xffff) AM_READWRITE(vector_r,vector_w)
-ADDRESS_MAP_END
+ map(0xfd00, 0xfd01).rw(this, FUNC(fm7_state::fm7_keyboard_r), FUNC(fm7_state::fm7_cassette_printer_w));
+ map(0xfd02, 0xfd02).rw(this, FUNC(fm7_state::fm7_cassette_printer_r), FUNC(fm7_state::fm7_irq_mask_w)); // IRQ mask
+ map(0xfd03, 0xfd03).rw(this, FUNC(fm7_state::fm7_irq_cause_r), FUNC(fm7_state::fm7_beeper_w)); // IRQ flags
+ map(0xfd04, 0xfd04).r(this, FUNC(fm7_state::fm7_fd04_r));
+ map(0xfd05, 0xfd05).rw(this, FUNC(fm7_state::fm7_subintf_r), FUNC(fm7_state::fm7_subintf_w));
+ map(0xfd06, 0xfd0a).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd0b, 0xfd0b).r(this, FUNC(fm7_state::fm77av_boot_mode_r));
+ map(0xfd0c, 0xfd0c).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd0f, 0xfd0f).rw(this, FUNC(fm7_state::fm7_rom_en_r), FUNC(fm7_state::fm7_rom_en_w));
+ map(0xfd10, 0xfd10).w(this, FUNC(fm7_state::fm7_init_en_w));
+ map(0xfd11, 0xfd11).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd12, 0xfd12).rw(this, FUNC(fm7_state::fm77av_sub_modestatus_r), FUNC(fm7_state::fm77av_sub_modestatus_w));
+ map(0xfd13, 0xfd13).w(this, FUNC(fm7_state::fm77av_sub_bank_w));
+ map(0xfd14, 0xfd14).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd17, 0xfd17).r(this, FUNC(fm7_state::fm7_fmirq_r));
+ map(0xfd18, 0xfd1f).rw(this, FUNC(fm7_state::fm7_fdc_r), FUNC(fm7_state::fm7_fdc_w));
+ map(0xfd20, 0xfd23).rw(this, FUNC(fm7_state::fm7_kanji_r), FUNC(fm7_state::fm7_kanji_w));
+ map(0xfd24, 0xfd2b).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd30, 0xfd34).w(this, FUNC(fm7_state::fm77av_analog_palette_w));
+ map(0xfd35, 0xfd36).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd37, 0xfd37).w(this, FUNC(fm7_state::fm7_multipage_w));
+ map(0xfd38, 0xfd3f).rw(this, FUNC(fm7_state::fm7_palette_r), FUNC(fm7_state::fm7_palette_w));
+ map(0xfd40, 0xfd7f).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd80, 0xfd93).rw(this, FUNC(fm7_state::fm7_mmr_r), FUNC(fm7_state::fm7_mmr_w));
+ map(0xfd94, 0xfdff).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfe00, 0xffdf).ram().w(this, FUNC(fm7_state::fm77av_bootram_w)).share("boot_ram");
+ map(0xffe0, 0xffef).ram();
+ map(0xfff0, 0xffff).rw(this, FUNC(fm7_state::vector_r), FUNC(fm7_state::vector_w));
+}
// Much of this is guesswork at the moment
-ADDRESS_MAP_START(fm7_state::fm11_sub_mem)
- AM_RANGE(0x0000,0x7fff) AM_READWRITE(fm7_vram_r,fm7_vram_w) // VRAM
- AM_RANGE(0x8000,0x8fff) AM_RAM // Console RAM(?)
- AM_RANGE(0x9000,0x9f7f) AM_RAM // Work RAM(?)
- AM_RANGE(0x9f80,0x9fff) AM_RAM AM_SHARE("shared_ram")
- AM_RANGE(0xafe0,0xafe3) AM_RAM
+void fm7_state::fm11_sub_mem(address_map &map)
+{
+ map(0x0000, 0x7fff).rw(this, FUNC(fm7_state::fm7_vram_r), FUNC(fm7_state::fm7_vram_w)); // VRAM
+ map(0x8000, 0x8fff).ram(); // Console RAM(?)
+ map(0x9000, 0x9f7f).ram(); // Work RAM(?)
+ map(0x9f80, 0x9fff).ram().share("shared_ram");
+ map(0xafe0, 0xafe3).ram();
// AM_RANGE(0xafe4,0xafe4) AM_READWRITE(fm7_sub_busyflag_r,fm7_sub_busyflag_w)
- AM_RANGE(0xafe6,0xafe6) AM_READWRITE(fm77av_video_flags_r,fm77av_video_flags_w)
- AM_RANGE(0xaff0,0xaff0) AM_READWRITE(fm7_sub_busyflag_r,fm7_sub_busyflag_w)
- AM_RANGE(0xc000,0xffff) AM_ROM // sybsystem ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(fm7_state::fm11_x86_mem)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x00000,0xfefff) AM_RAM
- AM_RANGE(0xff000,0xfffff) AM_ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(fm7_state::fm11_x86_io)
- AM_RANGE(0xfd00,0xfd01) AM_READWRITE(fm7_keyboard_r,fm7_cassette_printer_w)
- AM_RANGE(0xfd02,0xfd02) AM_READWRITE(fm7_cassette_printer_r,fm7_irq_mask_w) // IRQ mask
- AM_RANGE(0xfd03,0xfd03) AM_READWRITE(fm7_irq_cause_r,fm7_beeper_w) // IRQ flags
- AM_RANGE(0xfd04,0xfd04) AM_READ(fm7_fd04_r)
- AM_RANGE(0xfd05,0xfd05) AM_READWRITE(fm7_subintf_r,fm7_subintf_w)
- AM_RANGE(0xfd06,0xfd0c) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd0f,0xfd0f) AM_READWRITE(fm7_rom_en_r,fm7_rom_en_w)
- AM_RANGE(0xfd10,0xfd17) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd18,0xfd1f) AM_READWRITE(fm7_fdc_r,fm7_fdc_w)
- AM_RANGE(0xfd20,0xfd23) AM_READWRITE(fm7_kanji_r,fm7_kanji_w)
- AM_RANGE(0xfd24,0xfd36) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd37,0xfd37) AM_WRITE(fm7_multipage_w)
- AM_RANGE(0xfd38,0xfd3f) AM_READWRITE(fm7_palette_r,fm7_palette_w)
- AM_RANGE(0xfd40,0xfdff) AM_READ(fm7_unknown_r)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(fm7_state::fm16_mem)
- AM_RANGE(0x00000,0xfbfff) AM_RAM
- AM_RANGE(0xfc000,0xfffff) AM_ROM // IPL
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(fm7_state::fm16_io)
- AM_RANGE(0xfd00,0xfd01) AM_READWRITE8(fm7_keyboard_r,fm7_cassette_printer_w,0xffff)
- AM_RANGE(0xfd02,0xfd03) AM_READWRITE8(fm7_cassette_printer_r,fm7_irq_mask_w,0x00ff) // IRQ mask
- AM_RANGE(0xfd02,0xfd03) AM_READWRITE8(fm7_irq_cause_r,fm7_beeper_w,0xff00) // IRQ flags
- AM_RANGE(0xfd04,0xfd05) AM_READ8(fm7_fd04_r,0x00ff)
- AM_RANGE(0xfd04,0xfd05) AM_READWRITE8(fm7_subintf_r,fm7_subintf_w,0xff00)
+ map(0xafe6, 0xafe6).rw(this, FUNC(fm7_state::fm77av_video_flags_r), FUNC(fm7_state::fm77av_video_flags_w));
+ map(0xaff0, 0xaff0).rw(this, FUNC(fm7_state::fm7_sub_busyflag_r), FUNC(fm7_state::fm7_sub_busyflag_w));
+ map(0xc000, 0xffff).rom(); // sybsystem ROM
+}
+
+void fm7_state::fm11_x86_mem(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x00000, 0xfefff).ram();
+ map(0xff000, 0xfffff).rom();
+}
+
+void fm7_state::fm11_x86_io(address_map &map)
+{
+ map(0xfd00, 0xfd01).rw(this, FUNC(fm7_state::fm7_keyboard_r), FUNC(fm7_state::fm7_cassette_printer_w));
+ map(0xfd02, 0xfd02).rw(this, FUNC(fm7_state::fm7_cassette_printer_r), FUNC(fm7_state::fm7_irq_mask_w)); // IRQ mask
+ map(0xfd03, 0xfd03).rw(this, FUNC(fm7_state::fm7_irq_cause_r), FUNC(fm7_state::fm7_beeper_w)); // IRQ flags
+ map(0xfd04, 0xfd04).r(this, FUNC(fm7_state::fm7_fd04_r));
+ map(0xfd05, 0xfd05).rw(this, FUNC(fm7_state::fm7_subintf_r), FUNC(fm7_state::fm7_subintf_w));
+ map(0xfd06, 0xfd0c).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd0f, 0xfd0f).rw(this, FUNC(fm7_state::fm7_rom_en_r), FUNC(fm7_state::fm7_rom_en_w));
+ map(0xfd10, 0xfd17).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd18, 0xfd1f).rw(this, FUNC(fm7_state::fm7_fdc_r), FUNC(fm7_state::fm7_fdc_w));
+ map(0xfd20, 0xfd23).rw(this, FUNC(fm7_state::fm7_kanji_r), FUNC(fm7_state::fm7_kanji_w));
+ map(0xfd24, 0xfd36).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd37, 0xfd37).w(this, FUNC(fm7_state::fm7_multipage_w));
+ map(0xfd38, 0xfd3f).rw(this, FUNC(fm7_state::fm7_palette_r), FUNC(fm7_state::fm7_palette_w));
+ map(0xfd40, 0xfdff).r(this, FUNC(fm7_state::fm7_unknown_r));
+}
+
+void fm7_state::fm16_mem(address_map &map)
+{
+ map(0x00000, 0xfbfff).ram();
+ map(0xfc000, 0xfffff).rom(); // IPL
+}
+
+void fm7_state::fm16_io(address_map &map)
+{
+ map(0xfd00, 0xfd01).rw(this, FUNC(fm7_state::fm7_keyboard_r), FUNC(fm7_state::fm7_cassette_printer_w));
+ map(0xfd02, 0xfd02).rw(this, FUNC(fm7_state::fm7_cassette_printer_r), FUNC(fm7_state::fm7_irq_mask_w)); // IRQ mask
+ map(0xfd03, 0xfd03).rw(this, FUNC(fm7_state::fm7_irq_cause_r), FUNC(fm7_state::fm7_beeper_w)); // IRQ flags
+ map(0xfd04, 0xfd04).r(this, FUNC(fm7_state::fm7_fd04_r));
+ map(0xfd05, 0xfd05).rw(this, FUNC(fm7_state::fm7_subintf_r), FUNC(fm7_state::fm7_subintf_w));
// AM_RANGE(0xfd06,0xfd0c) AM_READ8(fm7_unknown_r,0xffff)
- AM_RANGE(0xfd0e,0xfd0f) AM_READWRITE8(fm7_rom_en_r,fm7_rom_en_w,0xff00)
+ map(0xfd0f, 0xfd0f).rw(this, FUNC(fm7_state::fm7_rom_en_r), FUNC(fm7_state::fm7_rom_en_w));
// AM_RANGE(0xfd10,0xfd17) AM_READ8(fm7_unknown_r,0xffff)
- AM_RANGE(0xfd18,0xfd1f) AM_READWRITE8(fm7_fdc_r,fm7_fdc_w,0xffff)
- AM_RANGE(0xfd20,0xfd23) AM_READWRITE8(fm7_kanji_r,fm7_kanji_w,0xffff)
+ map(0xfd18, 0xfd1f).rw(this, FUNC(fm7_state::fm7_fdc_r), FUNC(fm7_state::fm7_fdc_w));
+ map(0xfd20, 0xfd23).rw(this, FUNC(fm7_state::fm7_kanji_r), FUNC(fm7_state::fm7_kanji_w));
// AM_RANGE(0xfd24,0xfd36) AM_READ8(fm7_unknown_r,0xffff)
- AM_RANGE(0xfd36,0xfd37) AM_WRITE8(fm7_multipage_w,0xff00)
- AM_RANGE(0xfd38,0xfd3f) AM_READWRITE8(fm7_palette_r,fm7_palette_w,0xffff)
+ map(0xfd37, 0xfd37).w(this, FUNC(fm7_state::fm7_multipage_w));
+ map(0xfd38, 0xfd3f).rw(this, FUNC(fm7_state::fm7_palette_r), FUNC(fm7_state::fm7_palette_w));
// AM_RANGE(0xfd40,0xfdff) AM_READ8(fm7_unknown_r,0xffff)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(fm7_state::fm16_sub_mem)
- AM_RANGE(0x0000,0xafff) AM_READWRITE(fm7_vram_r,fm7_vram_w) // VRAM
- AM_RANGE(0xb000,0xffff) AM_ROM // subsystem ROM
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(fm7_state::fm77av_mem)
- AM_RANGE(0x0000,0x0fff) AM_DEVREADWRITE("av_bank1", address_map_bank_device, read8, write8)
- AM_RANGE(0x1000,0x1fff) AM_DEVREADWRITE("av_bank2", address_map_bank_device, read8, write8)
- AM_RANGE(0x2000,0x2fff) AM_DEVREADWRITE("av_bank3", address_map_bank_device, read8, write8)
- AM_RANGE(0x3000,0x3fff) AM_DEVREADWRITE("av_bank4", address_map_bank_device, read8, write8)
- AM_RANGE(0x4000,0x4fff) AM_DEVREADWRITE("av_bank5", address_map_bank_device, read8, write8)
- AM_RANGE(0x5000,0x5fff) AM_DEVREADWRITE("av_bank6", address_map_bank_device, read8, write8)
- AM_RANGE(0x6000,0x6fff) AM_DEVREADWRITE("av_bank7", address_map_bank_device, read8, write8)
- AM_RANGE(0x7000,0x7fff) AM_DEVREADWRITE("av_bank8", address_map_bank_device, read8, write8)
- AM_RANGE(0x8000,0x8fff) AM_DEVREADWRITE("av_bank9", address_map_bank_device, read8, write8)
- AM_RANGE(0x9000,0x9fff) AM_DEVREADWRITE("av_bank10", address_map_bank_device, read8, write8)
- AM_RANGE(0xa000,0xafff) AM_DEVREADWRITE("av_bank11", address_map_bank_device, read8, write8)
- AM_RANGE(0xb000,0xbfff) AM_DEVREADWRITE("av_bank12", address_map_bank_device, read8, write8)
- AM_RANGE(0xc000,0xcfff) AM_DEVREADWRITE("av_bank13", address_map_bank_device, read8, write8)
- AM_RANGE(0xd000,0xdfff) AM_DEVREADWRITE("av_bank14", address_map_bank_device, read8, write8)
- AM_RANGE(0xe000,0xefff) AM_DEVREADWRITE("av_bank15", address_map_bank_device, read8, write8)
- AM_RANGE(0xf000,0xfbff) AM_DEVREADWRITE("av_bank16", address_map_bank_device, read8, write8)
- AM_RANGE(0xfc00,0xfc7f) AM_RAM
- AM_RANGE(0xfc80,0xfcff) AM_READWRITE(fm7_main_shared_r,fm7_main_shared_w)
+}
+
+void fm7_state::fm16_sub_mem(address_map &map)
+{
+ map(0x0000, 0xafff).rw(this, FUNC(fm7_state::fm7_vram_r), FUNC(fm7_state::fm7_vram_w)); // VRAM
+ map(0xb000, 0xffff).rom(); // subsystem ROM
+}
+
+void fm7_state::fm77av_mem(address_map &map)
+{
+ map(0x0000, 0x0fff).rw("av_bank1", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x1000, 0x1fff).rw("av_bank2", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x2000, 0x2fff).rw("av_bank3", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x3000, 0x3fff).rw("av_bank4", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x4000, 0x4fff).rw("av_bank5", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x5000, 0x5fff).rw("av_bank6", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x6000, 0x6fff).rw("av_bank7", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x7000, 0x7fff).rw("av_bank8", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x8000, 0x8fff).rw("av_bank9", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0x9000, 0x9fff).rw("av_bank10", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xa000, 0xafff).rw("av_bank11", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xb000, 0xbfff).rw("av_bank12", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xc000, 0xcfff).rw("av_bank13", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xd000, 0xdfff).rw("av_bank14", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xe000, 0xefff).rw("av_bank15", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xf000, 0xfbff).rw("av_bank16", FUNC(address_map_bank_device::read8), FUNC(address_map_bank_device::write8));
+ map(0xfc00, 0xfc7f).ram();
+ map(0xfc80, 0xfcff).rw(this, FUNC(fm7_state::fm7_main_shared_r), FUNC(fm7_state::fm7_main_shared_w));
// I/O space (FD00-FDFF)
- AM_RANGE(0xfd00,0xfd01) AM_READWRITE(fm7_keyboard_r,fm7_cassette_printer_w)
- AM_RANGE(0xfd02,0xfd02) AM_READWRITE(fm7_cassette_printer_r,fm7_irq_mask_w) // IRQ mask
- AM_RANGE(0xfd03,0xfd03) AM_READWRITE(fm7_irq_cause_r,fm7_beeper_w) // IRQ flags
- AM_RANGE(0xfd04,0xfd04) AM_READ(fm7_fd04_r)
- AM_RANGE(0xfd05,0xfd05) AM_READWRITE(fm7_subintf_r,fm7_subintf_w)
- AM_RANGE(0xfd06,0xfd0a) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd0b,0xfd0b) AM_READ(fm77av_boot_mode_r)
- AM_RANGE(0xfd0c,0xfd0c) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd0d,0xfd0d) AM_READWRITE(fm7_psg_select_r,fm7_psg_select_w)
- AM_RANGE(0xfd0e,0xfd0e) AM_READWRITE(fm7_psg_data_r, fm7_psg_data_w)
- AM_RANGE(0xfd0f,0xfd0f) AM_READWRITE(fm7_rom_en_r,fm7_rom_en_w)
- AM_RANGE(0xfd10,0xfd10) AM_WRITE(fm7_init_en_w)
- AM_RANGE(0xfd11,0xfd11) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd12,0xfd12) AM_READWRITE(fm77av_sub_modestatus_r,fm77av_sub_modestatus_w)
- AM_RANGE(0xfd13,0xfd13) AM_WRITE(fm77av_sub_bank_w)
- AM_RANGE(0xfd14,0xfd14) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd15,0xfd15) AM_READWRITE(fm7_psg_select_r,fm77av_ym_select_w)
- AM_RANGE(0xfd16,0xfd16) AM_READWRITE(fm7_psg_data_r,fm7_psg_data_w)
- AM_RANGE(0xfd17,0xfd17) AM_READ(fm7_fmirq_r)
- AM_RANGE(0xfd18,0xfd1f) AM_READWRITE(fm7_fdc_r,fm7_fdc_w)
- AM_RANGE(0xfd20,0xfd23) AM_READWRITE(fm7_kanji_r,fm7_kanji_w)
- AM_RANGE(0xfd24,0xfd2b) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd30,0xfd34) AM_WRITE(fm77av_analog_palette_w)
- AM_RANGE(0xfd35,0xfd36) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd37,0xfd37) AM_WRITE(fm7_multipage_w)
- AM_RANGE(0xfd38,0xfd3f) AM_READWRITE(fm7_palette_r,fm7_palette_w)
- AM_RANGE(0xfd40,0xfd7f) AM_READ(fm7_unknown_r)
- AM_RANGE(0xfd80,0xfd93) AM_READWRITE(fm7_mmr_r,fm7_mmr_w)
- AM_RANGE(0xfd94,0xfdff) AM_READ(fm7_unknown_r)
+ map(0xfd00, 0xfd01).rw(this, FUNC(fm7_state::fm7_keyboard_r), FUNC(fm7_state::fm7_cassette_printer_w));
+ map(0xfd02, 0xfd02).rw(this, FUNC(fm7_state::fm7_cassette_printer_r), FUNC(fm7_state::fm7_irq_mask_w)); // IRQ mask
+ map(0xfd03, 0xfd03).rw(this, FUNC(fm7_state::fm7_irq_cause_r), FUNC(fm7_state::fm7_beeper_w)); // IRQ flags
+ map(0xfd04, 0xfd04).r(this, FUNC(fm7_state::fm7_fd04_r));
+ map(0xfd05, 0xfd05).rw(this, FUNC(fm7_state::fm7_subintf_r), FUNC(fm7_state::fm7_subintf_w));
+ map(0xfd06, 0xfd0a).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd0b, 0xfd0b).r(this, FUNC(fm7_state::fm77av_boot_mode_r));
+ map(0xfd0c, 0xfd0c).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd0d, 0xfd0d).rw(this, FUNC(fm7_state::fm7_psg_select_r), FUNC(fm7_state::fm7_psg_select_w));
+ map(0xfd0e, 0xfd0e).rw(this, FUNC(fm7_state::fm7_psg_data_r), FUNC(fm7_state::fm7_psg_data_w));
+ map(0xfd0f, 0xfd0f).rw(this, FUNC(fm7_state::fm7_rom_en_r), FUNC(fm7_state::fm7_rom_en_w));
+ map(0xfd10, 0xfd10).w(this, FUNC(fm7_state::fm7_init_en_w));
+ map(0xfd11, 0xfd11).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd12, 0xfd12).rw(this, FUNC(fm7_state::fm77av_sub_modestatus_r), FUNC(fm7_state::fm77av_sub_modestatus_w));
+ map(0xfd13, 0xfd13).w(this, FUNC(fm7_state::fm77av_sub_bank_w));
+ map(0xfd14, 0xfd14).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd15, 0xfd15).rw(this, FUNC(fm7_state::fm7_psg_select_r), FUNC(fm7_state::fm77av_ym_select_w));
+ map(0xfd16, 0xfd16).rw(this, FUNC(fm7_state::fm7_psg_data_r), FUNC(fm7_state::fm7_psg_data_w));
+ map(0xfd17, 0xfd17).r(this, FUNC(fm7_state::fm7_fmirq_r));
+ map(0xfd18, 0xfd1f).rw(this, FUNC(fm7_state::fm7_fdc_r), FUNC(fm7_state::fm7_fdc_w));
+ map(0xfd20, 0xfd23).rw(this, FUNC(fm7_state::fm7_kanji_r), FUNC(fm7_state::fm7_kanji_w));
+ map(0xfd24, 0xfd2b).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd30, 0xfd34).w(this, FUNC(fm7_state::fm77av_analog_palette_w));
+ map(0xfd35, 0xfd36).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd37, 0xfd37).w(this, FUNC(fm7_state::fm7_multipage_w));
+ map(0xfd38, 0xfd3f).rw(this, FUNC(fm7_state::fm7_palette_r), FUNC(fm7_state::fm7_palette_w));
+ map(0xfd40, 0xfd7f).r(this, FUNC(fm7_state::fm7_unknown_r));
+ map(0xfd80, 0xfd93).rw(this, FUNC(fm7_state::fm7_mmr_r), FUNC(fm7_state::fm7_mmr_w));
+ map(0xfd94, 0xfdff).r(this, FUNC(fm7_state::fm7_unknown_r));
// Boot ROM (RAM on FM77AV and later)
- AM_RANGE(0xfe00,0xffdf) AM_RAM_WRITE(fm77av_bootram_w) AM_SHARE("boot_ram")
- AM_RANGE(0xffe0,0xffef) AM_RAM
- AM_RANGE(0xfff0,0xffff) AM_READWRITE(vector_r,vector_w)
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(fm7_state::fm77av_sub_mem)
- AM_RANGE(0x0000,0xbfff) AM_READWRITE(fm7_vram_r,fm7_vram_w) // VRAM
- AM_RANGE(0xc000,0xcfff) AM_RAM AM_REGION("maincpu",0x1c000) // Console RAM
- AM_RANGE(0xd000,0xd37f) AM_RAM AM_REGION("maincpu",0x1d000) // Work RAM
- AM_RANGE(0xd380,0xd3ff) AM_RAM AM_SHARE("shared_ram")
+ map(0xfe00, 0xffdf).ram().w(this, FUNC(fm7_state::fm77av_bootram_w)).share("boot_ram");
+ map(0xffe0, 0xffef).ram();
+ map(0xfff0, 0xffff).rw(this, FUNC(fm7_state::vector_r), FUNC(fm7_state::vector_w));
+}
+
+void fm7_state::fm77av_sub_mem(address_map &map)
+{
+ map(0x0000, 0xbfff).rw(this, FUNC(fm7_state::fm7_vram_r), FUNC(fm7_state::fm7_vram_w)); // VRAM
+ map(0xc000, 0xcfff).ram().region("maincpu", 0x1c000); // Console RAM
+ map(0xd000, 0xd37f).ram().region("maincpu", 0x1d000); // Work RAM
+ map(0xd380, 0xd3ff).ram().share("shared_ram");
// I/O space (D400-D4FF)
- AM_RANGE(0xd400,0xd401) AM_READ(fm7_sub_keyboard_r)
- AM_RANGE(0xd402,0xd402) AM_READ(fm7_cancel_ack)
- AM_RANGE(0xd403,0xd403) AM_READ(fm7_sub_beeper_r)
- AM_RANGE(0xd404,0xd404) AM_READ(fm7_attn_irq_r)
- AM_RANGE(0xd408,0xd408) AM_READWRITE(fm7_crt_r,fm7_crt_w)
- AM_RANGE(0xd409,0xd409) AM_READWRITE(fm7_vram_access_r,fm7_vram_access_w)
- AM_RANGE(0xd40a,0xd40a) AM_READWRITE(fm7_sub_busyflag_r,fm7_sub_busyflag_w)
- AM_RANGE(0xd40e,0xd40f) AM_WRITE(fm7_vram_offset_w)
- AM_RANGE(0xd410,0xd42b) AM_READWRITE(fm77av_alu_r, fm77av_alu_w)
- AM_RANGE(0xd430,0xd430) AM_READWRITE(fm77av_video_flags_r,fm77av_video_flags_w)
- AM_RANGE(0xd431,0xd432) AM_READWRITE(fm77av_key_encoder_r,fm77av_key_encoder_w)
- AM_RANGE(0xd500,0xd7ff) AM_RAM AM_REGION("maincpu",0x1d500) // Work RAM
- AM_RANGE(0xd800,0xdfff) AM_ROMBANK("bank20")
- AM_RANGE(0xe000,0xffff) AM_ROMBANK("bank21")
-ADDRESS_MAP_END
-
-ADDRESS_MAP_START(fm7_state::fm7_banked_mem)
+ map(0xd400, 0xd401).r(this, FUNC(fm7_state::fm7_sub_keyboard_r));
+ map(0xd402, 0xd402).r(this, FUNC(fm7_state::fm7_cancel_ack));
+ map(0xd403, 0xd403).r(this, FUNC(fm7_state::fm7_sub_beeper_r));
+ map(0xd404, 0xd404).r(this, FUNC(fm7_state::fm7_attn_irq_r));
+ map(0xd408, 0xd408).rw(this, FUNC(fm7_state::fm7_crt_r), FUNC(fm7_state::fm7_crt_w));
+ map(0xd409, 0xd409).rw(this, FUNC(fm7_state::fm7_vram_access_r), FUNC(fm7_state::fm7_vram_access_w));
+ map(0xd40a, 0xd40a).rw(this, FUNC(fm7_state::fm7_sub_busyflag_r), FUNC(fm7_state::fm7_sub_busyflag_w));
+ map(0xd40e, 0xd40f).w(this, FUNC(fm7_state::fm7_vram_offset_w));
+ map(0xd410, 0xd42b).rw(this, FUNC(fm7_state::fm77av_alu_r), FUNC(fm7_state::fm77av_alu_w));
+ map(0xd430, 0xd430).rw(this, FUNC(fm7_state::fm77av_video_flags_r), FUNC(fm7_state::fm77av_video_flags_w));
+ map(0xd431, 0xd432).rw(this, FUNC(fm7_state::fm77av_key_encoder_r), FUNC(fm7_state::fm77av_key_encoder_w));
+ map(0xd500, 0xd7ff).ram().region("maincpu", 0x1d500); // Work RAM
+ map(0xd800, 0xdfff).bankr("bank20");
+ map(0xe000, 0xffff).bankr("bank21");
+}
+
+void fm7_state::fm7_banked_mem(address_map &map)
+{
// Extended RAM
- AM_RANGE(0x00000,0x0ffff) AM_RAM AM_REGION("maincpu",0x00000)
+ map(0x00000, 0x0ffff).ram().region("maincpu", 0x00000);
// Sub CPU space
- AM_RANGE(0x10000,0x1bfff) AM_READWRITE(fm7_vram_r,fm7_vram_w) // VRAM
- AM_RANGE(0x1c000,0x1cfff) AM_RAM AM_REGION("maincpu",0x1c000) // Console RAM
- AM_RANGE(0x1d000,0x1d37f) AM_RAM AM_REGION("maincpu",0x1d000) // Work RAM
- AM_RANGE(0x1d380,0x1d3ff) AM_RAM AM_SHARE("shared_ram")
+ map(0x10000, 0x1bfff).rw(this, FUNC(fm7_state::fm7_vram_r), FUNC(fm7_state::fm7_vram_w)); // VRAM
+ map(0x1c000, 0x1cfff).ram().region("maincpu", 0x1c000); // Console RAM
+ map(0x1d000, 0x1d37f).ram().region("maincpu", 0x1d000); // Work RAM
+ map(0x1d380, 0x1d3ff).ram().share("shared_ram");
// I/O space (D400-D4FF)
- AM_RANGE(0x1d400,0x1d401) AM_READ(fm7_sub_keyboard_r)
- AM_RANGE(0x1d402,0x1d402) AM_READ(fm7_cancel_ack)
- AM_RANGE(0x1d403,0x1d403) AM_READ(fm7_sub_beeper_r)
- AM_RANGE(0x1d404,0x1d404) AM_READ(fm7_attn_irq_r)
- AM_RANGE(0x1d408,0x1d408) AM_READWRITE(fm7_crt_r,fm7_crt_w)
- AM_RANGE(0x1d409,0x1d409) AM_READWRITE(fm7_vram_access_r,fm7_vram_access_w)
- AM_RANGE(0x1d40a,0x1d40a) AM_READWRITE(fm7_sub_busyflag_r,fm7_sub_busyflag_w)
- AM_RANGE(0x1d40e,0x1d40f) AM_WRITE(fm7_vram_offset_w)
- AM_RANGE(0x1d410,0x1d42b) AM_READWRITE(fm77av_alu_r, fm77av_alu_w)
- AM_RANGE(0x1d430,0x1d430) AM_READWRITE(fm77av_video_flags_r,fm77av_video_flags_w)
- AM_RANGE(0x1d431,0x1d432) AM_READWRITE(fm77av_key_encoder_r,fm77av_key_encoder_w)
- AM_RANGE(0x1d500,0x1d7ff) AM_RAM AM_REGION("maincpu",0x1d500) // Work RAM
- AM_RANGE(0x1d800,0x1dfff) AM_ROMBANK("bank20")
- AM_RANGE(0x1e000,0x1ffff) AM_ROMBANK("bank21")
+ map(0x1d400, 0x1d401).r(this, FUNC(fm7_state::fm7_sub_keyboard_r));
+ map(0x1d402, 0x1d402).r(this, FUNC(fm7_state::fm7_cancel_ack));
+ map(0x1d403, 0x1d403).r(this, FUNC(fm7_state::fm7_sub_beeper_r));
+ map(0x1d404, 0x1d404).r(this, FUNC(fm7_state::fm7_attn_irq_r));
+ map(0x1d408, 0x1d408).rw(this, FUNC(fm7_state::fm7_crt_r), FUNC(fm7_state::fm7_crt_w));
+ map(0x1d409, 0x1d409).rw(this, FUNC(fm7_state::fm7_vram_access_r), FUNC(fm7_state::fm7_vram_access_w));
+ map(0x1d40a, 0x1d40a).rw(this, FUNC(fm7_state::fm7_sub_busyflag_r), FUNC(fm7_state::fm7_sub_busyflag_w));
+ map(0x1d40e, 0x1d40f).w(this, FUNC(fm7_state::fm7_vram_offset_w));
+ map(0x1d410, 0x1d42b).rw(this, FUNC(fm7_state::fm77av_alu_r), FUNC(fm7_state::fm77av_alu_w));
+ map(0x1d430, 0x1d430).rw(this, FUNC(fm7_state::fm77av_video_flags_r), FUNC(fm7_state::fm77av_video_flags_w));
+ map(0x1d431, 0x1d432).rw(this, FUNC(fm7_state::fm77av_key_encoder_r), FUNC(fm7_state::fm77av_key_encoder_w));
+ map(0x1d500, 0x1d7ff).ram().region("maincpu", 0x1d500); // Work RAM
+ map(0x1d800, 0x1dfff).bankr("bank20");
+ map(0x1e000, 0x1ffff).bankr("bank21");
// more RAM?
- AM_RANGE(0x20000,0x2ffff) AM_RAM AM_REGION("maincpu",0x20000)
+ map(0x20000, 0x2ffff).ram().region("maincpu", 0x20000);
// Main CPU space
- AM_RANGE(0x30000,0x35fff) AM_RAM AM_REGION("maincpu",0x30000)
- AM_RANGE(0x36000,0x37fff) AM_READ_BANK("init_bank_r") AM_WRITE_BANK("init_bank_w")
- AM_RANGE(0x38000,0x3fbff) AM_READ_BANK("fbasic_bank_r") AM_WRITE_BANK("fbasic_bank_w")
- AM_RANGE(0x3fc00,0x3ffff) AM_RAM AM_REGION("maincpu",0x3fc00)
+ map(0x30000, 0x35fff).ram().region("maincpu", 0x30000);
+ map(0x36000, 0x37fff).bankr("init_bank_r").bankw("init_bank_w");
+ map(0x38000, 0x3fbff).bankr("fbasic_bank_r").bankw("fbasic_bank_w");
+ map(0x3fc00, 0x3ffff).ram().region("maincpu", 0x3fc00);
-ADDRESS_MAP_END
+}
/* Input ports */
INPUT_PORTS_START( fm7_keyboard )