diff options
Diffstat (limited to 'src/mame/includes/bbc.h')
-rw-r--r-- | src/mame/includes/bbc.h | 476 |
1 files changed, 240 insertions, 236 deletions
diff --git a/src/mame/includes/bbc.h b/src/mame/includes/bbc.h index 63a07b670fd..1cf42088ada 100644 --- a/src/mame/includes/bbc.h +++ b/src/mame/includes/bbc.h @@ -2,9 +2,7 @@ // copyright-holders:Gordon Jefferyes, Nigel Barnes /***************************************************************************** * - * includes/bbc.h - * - * BBC Model B + * BBC Model B/B+/Master/Compact * * Driver by Gordon Jefferyes <mess_bbc@romvault.com> * @@ -14,7 +12,9 @@ #pragma once -#include "bus/rs232/rs232.h" +#include "cpu/m6502/m6502.h" +#include "cpu/m6502/m65sc02.h" +#include "machine/74259.h" #include "machine/6522via.h" #include "machine/6850acia.h" #include "machine/clock.h" @@ -24,6 +24,8 @@ #include "machine/wd_fdc.h" #include "machine/upd7002.h" #include "machine/mc146818.h" +#include "machine/i2cmem.h" +#include "machine/bankdev.h" #include "machine/input_merger.h" #include "video/mc6845.h" #include "video/saa5050.h" @@ -32,11 +34,16 @@ #include "sound/samples.h" #include "imagedev/cassette.h" +#include "bus/rs232/rs232.h" +#include "bus/centronics/ctronics.h" +#include "bus/econet/econet.h" #include "bus/bbc/fdc/fdc.h" #include "bus/bbc/analogue/analogue.h" #include "bus/bbc/1mhzbus/1mhzbus.h" +//#include "bus/bbc/internal/internal.h" #include "bus/bbc/tube/tube.h" #include "bus/bbc/userport/userport.h" +//#include "bus/bbc/exp/exp.h" #include "bus/bbc/joyport/joyport.h" #include "bus/generic/slot.h" @@ -45,71 +52,61 @@ #include "emupal.h" #include "screen.h" -#define RS232_TAG "rs232" class bbc_state : public driver_device { public: - bbc_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_ram(*this, RAM_TAG), - m_hd6845(*this, "hd6845"), - m_screen(*this, "screen"), - m_adlc(*this, "mc6854"), - m_sn(*this, "sn76489"), - m_samples(*this, "samples"), - m_keyboard(*this, "COL%u", 0), - m_trom(*this, "saa5050"), - m_tms(*this, "tms5220"), - m_cassette(*this, "cassette"), - m_acia(*this, "acia6850"), - m_acia_clock(*this, "acia_clock"), - m_rs232(*this, RS232_TAG), - m_via6522_0(*this, "via6522_0"), - m_via6522_1(*this, "via6522_1"), - m_upd7002(*this, "upd7002"), - m_analog(*this, "analogue"), - m_joyport(*this, "joyport"), - m_tube(*this, "tube"), - m_intube(*this, "intube"), - m_extube(*this, "extube"), - m_1mhzbus(*this, "1mhzbus"), - m_userport(*this, "userport"), - m_rtc(*this, "rtc"), - m_fdc(*this, "fdc"), - m_i8271(*this, "i8271"), - m_wd1770(*this, "wd1770"), - m_wd1772(*this, "wd1772"), - m_exp1(*this, "exp_rom1"), - m_exp2(*this, "exp_rom2"), - m_exp3(*this, "exp_rom3"), - m_exp4(*this, "exp_rom4"), - m_region_maincpu(*this, "maincpu"), - m_region_os(*this, "os"), - m_region_opt(*this, "option"), - m_bank1(*this, "bank1"), - m_bank2(*this, "bank2"), - m_bank3(*this, "bank3"), - m_bank4(*this, "bank4"), - m_bank5(*this, "bank5"), - m_bank6(*this, "bank6"), - m_bank7(*this, "bank7"), - m_bank8(*this, "bank8"), - m_irqs(*this, "irqs"), - m_palette(*this, "palette"), - m_bbcconfig(*this, "BBCCONFIG") + bbc_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_ram(*this, RAM_TAG) + , m_hd6845(*this, "hd6845") + , m_screen(*this, "screen") + , m_irqs(*this, "irqs") + , m_palette(*this, "palette") + , m_adlc(*this, "mc6854") + , m_sn(*this, "sn76489") + , m_samples(*this, "samples") + , m_keyboard(*this, "COL%u", 0) + , m_trom(*this, "saa5050") + , m_tms(*this, "tms5220") + , m_cassette(*this, "cassette") + , m_acia(*this, "acia6850") + , m_acia_clock(*this, "acia_clock") + , m_latch(*this, "latch") + , m_rs232(*this, "rs232") + , m_via6522_0(*this, "via6522_0") + , m_via6522_1(*this, "via6522_1") + , m_upd7002(*this, "upd7002") + , m_analog(*this, "analogue") + , m_joyport(*this, "joyport") + , m_tube(*this, "tube") + , m_intube(*this, "intube") + , m_extube(*this, "extube") + , m_1mhzbus(*this, "1mhzbus") + , m_userport(*this, "userport") +// , m_internal(*this, "internal") +// , m_exp(*this, "exp") + , m_rtc(*this, "rtc") + , m_i2cmem(*this, "i2cmem") + , m_fdc(*this, "fdc") + , m_i8271(*this, "i8271") + , m_wd1770(*this, "wd1770") + , m_wd1772(*this, "wd1772") + , m_rom(*this, "romslot%u", 0U) + , m_cart(*this, "cartslot%u", 1U) + , m_region_mos(*this, "mos") + , m_region_swr(*this, "swr") + , m_bank1(*this, "bank1") + , m_bank2(*this, "bank2") + , m_bank3(*this, "bank3") + , m_bank4(*this, "bank4") + , m_bank5(*this, "bank5") + , m_bank6(*this, "bank6") + , m_bankdev(*this, "bankdev") + , m_bbcconfig(*this, "BBCCONFIG") { } - enum machine_type_t - { - MODELA, - MODELB, - BPLUS, - MASTER, - COMPACT - }; - enum monitor_type_t { COLOUR = 0, @@ -118,150 +115,149 @@ public: AMBER = 3 }; - DECLARE_FLOPPY_FORMATS(floppy_formats_bbc); + DECLARE_FLOPPY_FORMATS(floppy_formats); - DECLARE_WRITE8_MEMBER(page_selecta_w); - DECLARE_WRITE8_MEMBER(page_selectb_w); - DECLARE_WRITE8_MEMBER(bbc_memoryb4_w); + DECLARE_WRITE8_MEMBER(bbc_romsel_w); + DECLARE_WRITE8_MEMBER(bbc_bank4_w); DECLARE_READ8_MEMBER(bbcbp_fetch_r); - DECLARE_WRITE8_MEMBER(page_selectbp_w); - DECLARE_WRITE8_MEMBER(page_selectbp128_w); - DECLARE_WRITE8_MEMBER(bbc_memorybp4_w); - DECLARE_WRITE8_MEMBER(bbc_memorybp6_w); + DECLARE_WRITE8_MEMBER(bbcbp_romsel_w); + DECLARE_WRITE8_MEMBER(bbcbp_bank4_w); + DECLARE_WRITE8_MEMBER(bbcbp_bank5_w); DECLARE_READ8_MEMBER(bbcm_fetch_r); DECLARE_READ8_MEMBER(bbcm_acccon_r); DECLARE_WRITE8_MEMBER(bbcm_acccon_w); - DECLARE_WRITE8_MEMBER(page_selectbm_w); - DECLARE_WRITE8_MEMBER(bbc_memorybm4_w); - DECLARE_WRITE8_MEMBER(bbc_memorybm5_w); - DECLARE_WRITE8_MEMBER(bbc_memorybm7_w); - DECLARE_READ8_MEMBER(bbcm_r); - DECLARE_WRITE8_MEMBER(bbcm_w); - DECLARE_WRITE8_MEMBER(bbc_SerialULA_w); - - DECLARE_WRITE8_MEMBER(bbc_wd1770_status_w); - DECLARE_READ8_MEMBER(bbcm_wd177xl_read); - DECLARE_WRITE8_MEMBER(bbcm_wd1770l_write); - DECLARE_WRITE8_MEMBER(bbcm_wd1772l_write); - DECLARE_WRITE8_MEMBER(bbc_videoULA_w); - DECLARE_READ8_MEMBER(bbc_fe_r); + DECLARE_WRITE8_MEMBER(bbcm_romsel_w); + DECLARE_WRITE8_MEMBER(bbcm_bank4_w); + DECLARE_WRITE8_MEMBER(bbcm_bank5_w); + DECLARE_WRITE8_MEMBER(bbcm_bank6_w); + DECLARE_READ8_MEMBER(bbcm_tube_r); + DECLARE_WRITE8_MEMBER(bbcm_tube_w); + DECLARE_WRITE8_MEMBER(bbcbp_drive_control_w); + DECLARE_WRITE8_MEMBER(bbcm_drive_control_w); + DECLARE_WRITE8_MEMBER(bbcmc_drive_control_w); + DECLARE_WRITE8_MEMBER(serial_ula_w); + DECLARE_WRITE8_MEMBER(video_ula_w); + DECLARE_READ8_MEMBER(bbc_fe_r) { return 0xfe; }; - void init_bbc(); DECLARE_VIDEO_START(bbc); - DECLARE_MACHINE_START(bbca); - DECLARE_MACHINE_RESET(bbca); - DECLARE_MACHINE_START(bbcb); - DECLARE_MACHINE_RESET(bbcb); - DECLARE_MACHINE_RESET(torch); - DECLARE_MACHINE_START(bbcbp); - DECLARE_MACHINE_RESET(bbcbp); - DECLARE_MACHINE_START(bbcm); - DECLARE_MACHINE_RESET(bbcm); - DECLARE_MACHINE_START(bbcmc); - DECLARE_MACHINE_RESET(bbcmc); - DECLARE_MACHINE_RESET(ltmpbp); - DECLARE_MACHINE_RESET(ltmpm); - DECLARE_MACHINE_START(cfa3000); - DECLARE_PALETTE_INIT(bbc); INTERRUPT_GEN_MEMBER(bbcb_keyscan); - TIMER_CALLBACK_MEMBER(bbc_tape_timer_cb); + TIMER_CALLBACK_MEMBER(tape_timer_cb); + TIMER_CALLBACK_MEMBER(reset_timer_cb); DECLARE_WRITE_LINE_MEMBER(write_acia_clock); DECLARE_WRITE_LINE_MEMBER(adlc_irq_w); DECLARE_WRITE_LINE_MEMBER(bus_nmi_w); - DECLARE_WRITE8_MEMBER(bbcb_via_system_write_porta); - DECLARE_WRITE8_MEMBER(bbcb_via_system_write_portb); - DECLARE_READ8_MEMBER(bbcb_via_system_read_porta); - DECLARE_READ8_MEMBER(bbcb_via_system_read_portb); + DECLARE_WRITE_LINE_MEMBER(snd_enable_w); + DECLARE_WRITE_LINE_MEMBER(speech_rsq_w); + DECLARE_WRITE_LINE_MEMBER(speech_wsq_w); + DECLARE_WRITE_LINE_MEMBER(kbd_enable_w); + DECLARE_WRITE_LINE_MEMBER(capslock_led_w); + DECLARE_WRITE_LINE_MEMBER(shiftlock_led_w); + DECLARE_READ8_MEMBER(via_system_porta_r); + DECLARE_WRITE8_MEMBER(via_system_porta_w); + DECLARE_READ8_MEMBER(via_system_portb_r); + DECLARE_WRITE8_MEMBER(via_system_portb_w); DECLARE_WRITE_LINE_MEMBER(lpstb_w); DECLARE_WRITE_LINE_MEMBER(bbc_hsync_changed); DECLARE_WRITE_LINE_MEMBER(bbc_vsync_changed); DECLARE_WRITE_LINE_MEMBER(bbc_de_changed); DECLARE_INPUT_CHANGED_MEMBER(monitor_changed); + void update_acia_rxd(); void update_acia_dcd(); void update_acia_cts(); - DECLARE_WRITE_LINE_MEMBER(bbc_rts_w); - DECLARE_WRITE_LINE_MEMBER(bbc_txd_w); - DECLARE_WRITE_LINE_MEMBER(write_rxd_serial); - DECLARE_WRITE_LINE_MEMBER(write_dcd_serial); - DECLARE_WRITE_LINE_MEMBER(write_cts_serial); + DECLARE_WRITE_LINE_MEMBER(write_rts); + DECLARE_WRITE_LINE_MEMBER(write_txd); + DECLARE_WRITE_LINE_MEMBER(write_rxd); + DECLARE_WRITE_LINE_MEMBER(write_dcd); + DECLARE_WRITE_LINE_MEMBER(write_cts); + DECLARE_INPUT_CHANGED_MEMBER(trigger_reset); DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w); DECLARE_WRITE_LINE_MEMBER(fdc_drq_w); DECLARE_WRITE_LINE_MEMBER(motor_w); DECLARE_WRITE_LINE_MEMBER(side_w); - int BBC_get_analogue_input(int channel_number); - void BBC_uPD7002_EOC(int data); - - void bbc_setup_banks(memory_bank *membank, int banks, uint32_t shift, uint32_t size); - void bbcm_setup_banks(memory_bank *membank, int banks, uint32_t shift, uint32_t size); - - image_init_result bbc_load_rom(device_image_interface &image, generic_slot_device *slot); - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp1_load) { return bbc_load_rom(image, m_exp1); } - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp2_load) { return bbc_load_rom(image, m_exp2); } - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp3_load) { return bbc_load_rom(image, m_exp3); } - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(exp4_load) { return bbc_load_rom(image, m_exp4); } - - image_init_result bbcm_load_cart(device_image_interface &image, generic_slot_device *slot); - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(bbcm_cart1_load) { return bbcm_load_cart(image, m_exp1); } - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(bbcm_cart2_load) { return bbcm_load_cart(image, m_exp2); } + int get_analogue_input(int channel_number); + void upd7002_eoc(int data); + + void setup_banks(memory_bank *membank, uint32_t shift); + + image_init_result load_rom16(device_image_interface &image, generic_slot_device *slot); + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom0) { return load_rom16(image, m_rom[0]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom1) { return load_rom16(image, m_rom[1]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom2) { return load_rom16(image, m_rom[2]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom3) { return load_rom16(image, m_rom[3]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom4) { return load_rom16(image, m_rom[4]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom5) { return load_rom16(image, m_rom[5]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom6) { return load_rom16(image, m_rom[6]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom7) { return load_rom16(image, m_rom[7]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom8) { return load_rom16(image, m_rom[8]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom9) { return load_rom16(image, m_rom[9]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(roma) { return load_rom16(image, m_rom[10]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(romb) { return load_rom16(image, m_rom[11]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(romc) { return load_rom16(image, m_rom[12]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(romd) { return load_rom16(image, m_rom[13]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rome) { return load_rom16(image, m_rom[14]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(romf) { return load_rom16(image, m_rom[15]); } + + image_init_result load_rom32(device_image_interface &image, generic_slot_device *slot); + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom01) { return load_rom32(image, m_rom[0]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom23) { return load_rom32(image, m_rom[2]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom45) { return load_rom32(image, m_rom[4]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom67) { return load_rom32(image, m_rom[6]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom89) { return load_rom32(image, m_rom[8]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(romab) { return load_rom32(image, m_rom[10]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(romcd) { return load_rom32(image, m_rom[12]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(romef) { return load_rom32(image, m_rom[14]); } + + image_init_result load_cart(device_image_interface &image, generic_slot_device *slot); + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart1) { return load_cart(image, m_cart[0]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart2) { return load_cart(image, m_cart[1]); } MC6845_UPDATE_ROW(crtc_update_row); - void bbc_eprom_sockets(machine_config &config); - void discmon(machine_config &config); - void discmate(machine_config &config); - void reutapm(machine_config &config); - void bbcbp(machine_config &config); - void abc310(machine_config &config); - void bbcmc(machine_config &config); - void bbcmt(machine_config &config); - void bbcm(machine_config &config); - void ltmpm(machine_config &config); - void bbcmet(machine_config &config); - void cfa3000(machine_config &config); - void bbcbp128(machine_config &config); - void pro128s(machine_config &config); - void bbcm512(machine_config &config); - void bbcmarm(machine_config &config); - void abc110(machine_config &config); - void ltmpbp(machine_config &config); - void bbcb_de(machine_config &config); - void bbcb(machine_config &config); - void bbcmaiv(machine_config &config); void bbca(machine_config &config); + void bbcb(machine_config &config); + void bbcb_de(machine_config &config); void bbcb_us(machine_config &config); - void econx25(machine_config &config); - void acw443(machine_config &config); - void bbc_base(address_map &map); + void torchf(machine_config &config); + void torchh21(machine_config &config); + void torchh10(machine_config &config); + void bbca_mem(address_map &map); + void bbc_base(address_map &map); void bbcb_mem(address_map &map); void bbcb_nofdc_mem(address_map &map); - void bbcbp128_mem(address_map &map); - void bbcbp_mem(address_map &map); - void bbcbp_fetch(address_map &map); - void bbcm_mem(address_map &map); - void bbcm_fetch(address_map &map); - void reutapm_mem(address_map &map); -private: + void init_bbc(); + void init_bbcm(); + void init_ltmp(); + void init_cfa(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + virtual void video_start() override; + required_device<cpu_device> m_maincpu; required_device<ram_device> m_ram; required_device<hd6845_device> m_hd6845; required_device<screen_device> m_screen; + required_device<input_merger_device> m_irqs; + required_device<palette_device> m_palette; optional_device<mc6854_device> m_adlc; - optional_device<sn76489_device> m_sn; + optional_device<sn76489a_device> m_sn; optional_device<samples_device> m_samples; required_ioport_array<13> m_keyboard; -public: // HACK FOR MC6845 optional_device<saa5050_device> m_trom; optional_device<tms5220_device> m_tms; optional_device<cassette_image_device> m_cassette; optional_device<acia6850_device> m_acia; optional_device<clock_device> m_acia_clock; + required_device<ls259_device> m_latch; optional_device<rs232_port_device> m_rs232; required_device<via6522_device> m_via6522_0; optional_device<via6522_device> m_via6522_1; @@ -273,33 +269,28 @@ public: // HACK FOR MC6845 optional_device<bbc_tube_slot_device> m_extube; optional_device<bbc_1mhzbus_slot_device> m_1mhzbus; optional_device<bbc_userport_slot_device> m_userport; + //optional_device<bbc_internal_slot_device> m_internal; + //optional_device<bbc_exp_slot_device> m_exp; optional_device<mc146818_device> m_rtc; + optional_device<i2cmem_device> m_i2cmem; optional_device<bbc_fdc_slot_device> m_fdc; optional_device<i8271_device> m_i8271; optional_device<wd1770_device> m_wd1770; optional_device<wd1772_device> m_wd1772; - optional_device<generic_slot_device> m_exp1; - optional_device<generic_slot_device> m_exp2; - optional_device<generic_slot_device> m_exp3; - optional_device<generic_slot_device> m_exp4; - - required_memory_region m_region_maincpu; - required_memory_region m_region_os; - required_memory_region m_region_opt; + optional_device_array<generic_slot_device, 16> m_rom; + optional_device_array<generic_slot_device, 2> m_cart; + + required_memory_region m_region_mos; + required_memory_region m_region_swr; required_memory_bank m_bank1; // bbca bbcb bbcbp bbcbp128 bbcm optional_memory_bank m_bank2; // bbcbp bbcbp128 bbcm optional_memory_bank m_bank3; // bbca bbcb required_memory_bank m_bank4; // bbca bbcb bbcbp bbcbp128 bbcm - optional_memory_bank m_bank5; // bbcm - optional_memory_bank m_bank6; // bbcbp bbcbp128 - required_memory_bank m_bank7; // bbca bbcb bbcbp bbcbp128 bbcm - optional_memory_bank m_bank8; // bbcm - - required_device<input_merger_device> m_irqs; - - machine_type_t m_machinetype; + optional_memory_bank m_bank5; // bbcbp bbcbp128 bbcm + required_memory_bank m_bank6; // bbca bbcb bbcbp bbcbp128 bbcm + optional_device<address_map_bank_device> m_bankdev; // bbcm + optional_ioport m_bbcconfig; - bool m_os01; // flag indicating whether OS 0.1 is being used int m_monitortype; // monitor type (colour, green, amber) int m_swramtype; // this stores the setting for the SWRAM type being used @@ -341,44 +332,9 @@ public: // HACK FOR MC6845 int m_acccon_e; int m_acccon_d; - - /* - The addressable latch - This 8 bit addressable latch is operated from port B lines 0-3. - PB0-PB2 are set to the required address of the output bit to be set. - PB3 is set to the value which should be programmed at that bit. - The function of the 8 output bits from this latch are:- - - B0 - Write Enable to the sound generator IC - B1 - READ select on the speech processor (B and B+) - R/nW control on CMOS RAM (Master only) - B2 - WRITE select on the speech processor - DS control on CMOS RAM (Master only) - B3 - Keyboard write enable - B4,B5 - these two outputs define the number to be added to the - start of screen address in hardware to control hardware scrolling:- - Mode Size Start of screen Size No.to add B5 B4 - 0,1,2 20K &3000 12K 1 1 - 3 16K &4000 16K 0 0 - 4,5 10K &5800 (or &1800) 22K 1 0 - 6 8K &6000 (or &2000) 24K 0 1 - B6 - Operates the CAPS lock LED (Pin 17 keyboard connector) - B7 - Operates the SHIFT lock LED (Pin 16 keyboard connector) - */ - - int m_b0_sound; - int m_b1_speech_read; - int m_b2_speech_write; - int m_b3_keyboard; - int m_b4_video0; - int m_b5_video1; - int m_b6_caps_lock_led; - int m_b7_shift_lock_led; - - int m_MC146818_WR; // FE30 bit 1 replaces b1_speech_read - int m_MC146818_DS; // FE30 bit 2 replaces b2_speech_write - int m_MC146818_AS; // 6522 port b bit 7 - int m_MC146818_CE; // 6522 port b bit 6 + void mc146818_set(address_space &space); + int m_mc146818_as; // 6522 port b bit 7 + int m_mc146818_ce; // 6522 port b bit 6 int m_via_system_porta; @@ -388,10 +344,9 @@ public: // HACK FOR MC6845 int m_column; // this is a counter in the keyboard circuit - - /*************************************** - BBC 2C199 Serial Interface Cassette - ****************************************/ + /*************************************** + BBC 2C199 Serial Interface Cassette + ****************************************/ double m_last_dev_val; int m_wav_len; @@ -399,7 +354,6 @@ public: // HACK FOR MC6845 int m_len1; int m_len2; int m_len3; - int m_mc6850_clock; uint8_t m_serproc_data; int m_rxd_serial; int m_dcd_serial; @@ -415,17 +369,16 @@ public: // HACK FOR MC6845 emu_timer *m_tape_timer; - /************************************** - WD1770 disc control - ***************************************/ + /************************************** + WD1770 disc control + ***************************************/ - int m_drive_control; int m_fdc_irq; int m_fdc_drq; - /************************************** - Video Code - ***************************************/ + /************************************** + Video Code + ***************************************/ // this is the real location of the start of the BBC's ram in the emulation // it can be changed if shadow ram is being used to point at the upper 32K of RAM @@ -459,15 +412,15 @@ public: // HACK FOR MC6845 void setvideoshadow(int vdusel); void set_pixel_lookup(); - int bbc_keyboard(address_space &space, int data); - void bbcb_IC32_initialise(bbc_state *state); - void MC146818_set(address_space &space); - void MC6850_Receive_Clock(int new_clock); + int bbc_keyboard(int data); + + void mc6850_receive_clock(int new_clock); void cassette_motor(bool state); - void bbc_update_nmi(); + void update_nmi(); uint16_t calculate_video_address(uint16_t ma, uint8_t ra); - required_device<palette_device> m_palette; - optional_ioport m_bbcconfig; + +private: + emu_timer *m_reset_timer; }; @@ -476,9 +429,60 @@ class torch_state : public bbc_state public: using bbc_state::bbc_state; static constexpr feature_type imperfect_features() { return feature::KEYBOARD; } - void torchf(machine_config &config); - void torchh21(machine_config &config); - void torchh10(machine_config &config); }; + +class bbcbp_state : public bbc_state +{ +public: + using bbc_state::bbc_state; + + void bbcbp(machine_config &config); + void bbcbp128(machine_config &config); + void abc110(machine_config &config); + void acw443(machine_config &config); + void abc310(machine_config &config); + void econx25(machine_config &config); + void reutapm(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + void bbcbp_mem(address_map &map); + void reutapm_mem(address_map &map); + void bbcbp_fetch(address_map &map); +}; + + +class bbcm_state : public bbc_state +{ +public: + using bbc_state::bbc_state; + + void bbcm(machine_config &config); + void bbcmt(machine_config &config); + void bbcmet(machine_config &config); + void bbcmaiv(machine_config &config); + void bbcm512(machine_config &config); + void bbcmarm(machine_config &config); + void cfa3000(machine_config &config); + void discmon(machine_config &config); + void discmate(machine_config &config); + void bbcmc(machine_config &config); + void pro128s(machine_config &config); + void autoc15(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + + void bbcm_mem(address_map &map); + void bbcm_bankdev(address_map &map); + void bbcmet_bankdev(address_map &map); + void bbcmc_bankdev(address_map &map); + void bbcm_fetch(address_map &map); +}; + + #endif // MAME_INCLUDES_BBC_H |