mbee: removed anonymous timer

This commit is contained in:
Robbbert 2020-10-09 22:09:57 +11:00
parent 981c9023fa
commit d5e8303a90
3 changed files with 8 additions and 27 deletions

View File

@ -820,6 +820,7 @@ void mbee_state::mbee256(machine_config &config)
config.device_remove("fdc:1");
FLOPPY_CONNECTOR(config, m_floppy0, mbee_floppies, "35dd", floppy_image_device::default_floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, m_floppy1, mbee_floppies, "35dd", floppy_image_device::default_floppy_formats).enable_sound(true);
TIMER(config, "newkb_timer").configure_periodic(FUNC(mbee_state::newkb_timer), attotime::from_hz(50));
}
void mbee_state::mbeett(machine_config &config)
@ -829,6 +830,7 @@ void mbee_state::mbeett(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &mbee_state::mbeett_io);
config.device_remove("quickload");
config.device_remove("quickload2");
TIMER(config, "newkb_timer").configure_periodic(FUNC(mbee_state::newkb_timer), attotime::from_hz(50));
SCC8530(config, "scc", 4000000); // clock unknown
}

View File

@ -29,6 +29,7 @@
#include "video/mc6845.h"
#include "machine/timer.h"
#include "emupal.h"
#include "screen.h"
@ -83,11 +84,6 @@ public:
void init_mbee256() { m_features = 0x2d; };
private:
enum
{
TIMER_MBEE_NEWKB
};
void port04_w(uint8_t data);
void port06_w(uint8_t data);
uint8_t port07_r();
@ -118,7 +114,7 @@ private:
void standard_palette(palette_device &palette) const;
void premium_palette(palette_device &palette) const;
uint32_t screen_update_mbee(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(timer_newkb);
TIMER_DEVICE_CALLBACK_MEMBER(newkb_timer);
DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_bee);
DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_bin);
WRITE_LINE_MEMBER(rtc_irq_w);
@ -173,7 +169,6 @@ private:
void setup_banks(uint8_t data, bool first_time, uint8_t b_mask);
void oldkb_scan(uint16_t param);
void oldkb_matrix_r(uint16_t offs);
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
required_device<z80_device> m_maincpu;
required_device<z80pio_device> m_pio;
required_device<cassette_image_device> m_cassette;

View File

@ -16,19 +16,6 @@
#include "machine/z80bin.h"
void mbee_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
switch (id)
{
case TIMER_MBEE_NEWKB:
timer_newkb(ptr, param);
break;
default:
throw emu_fatalerror("Unknown id in mbee_state::device_timer");
}
}
/***********************************************************
PIO
@ -144,7 +131,7 @@ void mbee_state::fdc_motor_w(uint8_t data)
************************************************************/
TIMER_CALLBACK_MEMBER( mbee_state::timer_newkb )
TIMER_DEVICE_CALLBACK_MEMBER( mbee_state::newkb_timer )
{
/* Keyboard scanner is a Mostek M3870 chip. Its speed of operation is determined by a 15k resistor on
pin 2 (XTL2) and is therefore 2MHz. If a key change is detected (up or down), the /strobe
@ -157,6 +144,9 @@ TIMER_CALLBACK_MEMBER( mbee_state::timer_newkb )
It includes up to 4 KB of mask-programmable ROM, 64 bytes of scratchpad RAM and up to 64 bytes
of executable RAM. The MCU also integrates 32-bit I/O and a programmable timer. */
if (!BIT(m_features, 2))
return;
uint8_t i, j, pressed;
// find what has changed
@ -186,8 +176,6 @@ TIMER_CALLBACK_MEMBER( mbee_state::timer_newkb )
if (m_b2)
m_pio->port_b_write(pio_port_b_r());
timer_set(attotime::from_hz(50), TIMER_MBEE_NEWKB);
}
uint8_t mbee_state::port18_r()
@ -489,10 +477,6 @@ void mbee_state::machine_start()
else
m_size = 0x8000;
// new keyboard
if (BIT(m_features, 2))
timer_set(attotime::from_hz(1), TIMER_MBEE_NEWKB); /* kick-start timer for kbd */
// premium
if (BIT(m_features, 3))
{