mirror of
https://github.com/holub/mame
synced 2025-06-07 21:33:45 +03:00
pcw.cpp: Eliminate machine().device (nw)
This commit is contained in:
parent
df821c674d
commit
818f14c86f
@ -409,7 +409,6 @@ WRITE8_MEMBER(pcw_state::pcw_vdu_video_control_register_w)
|
|||||||
|
|
||||||
WRITE8_MEMBER(pcw_state::pcw_system_control_w)
|
WRITE8_MEMBER(pcw_state::pcw_system_control_w)
|
||||||
{
|
{
|
||||||
upd765a_device *fdc = machine().device<upd765a_device>("upd765");
|
|
||||||
LOG(("SYSTEM CONTROL: %d\n",data));
|
LOG(("SYSTEM CONTROL: %d\n",data));
|
||||||
|
|
||||||
switch (data)
|
switch (data)
|
||||||
@ -495,14 +494,14 @@ WRITE8_MEMBER(pcw_state::pcw_system_control_w)
|
|||||||
/* set fdc terminal count */
|
/* set fdc terminal count */
|
||||||
case 5:
|
case 5:
|
||||||
{
|
{
|
||||||
fdc->tc_w(true);
|
m_fdc->tc_w(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* clear fdc terminal count */
|
/* clear fdc terminal count */
|
||||||
case 6:
|
case 6:
|
||||||
{
|
{
|
||||||
fdc->tc_w(false);
|
m_fdc->tc_w(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -522,10 +521,10 @@ WRITE8_MEMBER(pcw_state::pcw_system_control_w)
|
|||||||
case 9:
|
case 9:
|
||||||
{
|
{
|
||||||
floppy_image_device *floppy;
|
floppy_image_device *floppy;
|
||||||
floppy = machine().device<floppy_connector>(":upd765:0")->get_device();
|
floppy = m_floppy[0]->get_device();
|
||||||
if(floppy)
|
if(floppy)
|
||||||
floppy->mon_w(0);
|
floppy->mon_w(0);
|
||||||
floppy = machine().device<floppy_connector>(":upd765:1")->get_device();
|
floppy = m_floppy[1]->get_device();
|
||||||
if(floppy)
|
if(floppy)
|
||||||
floppy->mon_w(0);
|
floppy->mon_w(0);
|
||||||
}
|
}
|
||||||
@ -535,10 +534,10 @@ WRITE8_MEMBER(pcw_state::pcw_system_control_w)
|
|||||||
case 10:
|
case 10:
|
||||||
{
|
{
|
||||||
floppy_image_device *floppy;
|
floppy_image_device *floppy;
|
||||||
floppy = machine().device<floppy_connector>(":upd765:0")->get_device();
|
floppy = m_floppy[0]->get_device();
|
||||||
if(floppy)
|
if(floppy)
|
||||||
floppy->mon_w(1);
|
floppy->mon_w(1);
|
||||||
floppy = machine().device<floppy_connector>(":upd765:1")->get_device();
|
floppy = m_floppy[1]->get_device();
|
||||||
if(floppy)
|
if(floppy)
|
||||||
floppy->mon_w(1);
|
floppy->mon_w(1);
|
||||||
}
|
}
|
||||||
@ -641,20 +640,6 @@ void pcw_state::pcw_printer_fire_pins(uint16_t pins)
|
|||||||
// m_printer_headpos++;
|
// m_printer_headpos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE8_MEMBER(pcw_state::pcw_printer_data_w)
|
|
||||||
{
|
|
||||||
m_printer_data = data;
|
|
||||||
machine().device<upi41_cpu_device>("printer_mcu")->upi41_master_w(space,0,data);
|
|
||||||
logerror("PRN [0xFC]: Sent command %02x\n",data);
|
|
||||||
}
|
|
||||||
|
|
||||||
WRITE8_MEMBER(pcw_state::pcw_printer_command_w)
|
|
||||||
{
|
|
||||||
m_printer_command = data;
|
|
||||||
machine().device<upi41_cpu_device>("printer_mcu")->upi41_master_w(space,1,data);
|
|
||||||
logerror("PRN [0xFD]: Sent command %02x\n",data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// print error type
|
// print error type
|
||||||
// should return 0xF8 if there are no errors
|
// should return 0xF8 if there are no errors
|
||||||
// 0 = underrun
|
// 0 = underrun
|
||||||
@ -662,10 +647,6 @@ WRITE8_MEMBER(pcw_state::pcw_printer_command_w)
|
|||||||
// 3 = bad command
|
// 3 = bad command
|
||||||
// 5 = print error
|
// 5 = print error
|
||||||
// anything else = no printer
|
// anything else = no printer
|
||||||
READ8_MEMBER(pcw_state::pcw_printer_data_r)
|
|
||||||
{
|
|
||||||
return machine().device<upi41_cpu_device>("printer_mcu")->upi41_master_r(space,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// printer status
|
// printer status
|
||||||
// bit 7 - bail bar in
|
// bit 7 - bail bar in
|
||||||
@ -676,10 +657,6 @@ READ8_MEMBER(pcw_state::pcw_printer_data_r)
|
|||||||
// bit 2 - paper is present
|
// bit 2 - paper is present
|
||||||
// bit 1 - busy
|
// bit 1 - busy
|
||||||
// bit 0 - controller fault
|
// bit 0 - controller fault
|
||||||
READ8_MEMBER(pcw_state::pcw_printer_status_r)
|
|
||||||
{
|
|
||||||
return machine().device<upi41_cpu_device>("printer_mcu")->upi41_master_r(space,1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* MCU handlers */
|
/* MCU handlers */
|
||||||
/* I/O ports: (likely to be completely wrong...)
|
/* I/O ports: (likely to be completely wrong...)
|
||||||
@ -960,8 +937,7 @@ void pcw_state::pcw_io(address_map &map)
|
|||||||
map(0x0f6, 0x0f6).w(this, FUNC(pcw_state::pcw_pointer_table_top_scan_w));
|
map(0x0f6, 0x0f6).w(this, FUNC(pcw_state::pcw_pointer_table_top_scan_w));
|
||||||
map(0x0f7, 0x0f7).w(this, FUNC(pcw_state::pcw_vdu_video_control_register_w));
|
map(0x0f7, 0x0f7).w(this, FUNC(pcw_state::pcw_vdu_video_control_register_w));
|
||||||
map(0x0f8, 0x0f8).rw(this, FUNC(pcw_state::pcw_system_status_r), FUNC(pcw_state::pcw_system_control_w));
|
map(0x0f8, 0x0f8).rw(this, FUNC(pcw_state::pcw_system_status_r), FUNC(pcw_state::pcw_system_control_w));
|
||||||
map(0x0fc, 0x0fc).rw(this, FUNC(pcw_state::pcw_printer_data_r), FUNC(pcw_state::pcw_printer_data_w));
|
map(0x0fc, 0x0fd).rw("printer_mcu", FUNC(i8041_device::upi41_master_r), FUNC(i8041_device::upi41_master_w));
|
||||||
map(0x0fd, 0x0fd).rw(this, FUNC(pcw_state::pcw_printer_status_r), FUNC(pcw_state::pcw_printer_command_w));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1020,9 +996,6 @@ void pcw_state::machine_reset()
|
|||||||
/* and hack our way past the MCU side of the boot process */
|
/* and hack our way past the MCU side of the boot process */
|
||||||
code[0x01] = 0x40;
|
code[0x01] = 0x40;
|
||||||
|
|
||||||
m_printer_status = 0xff;
|
|
||||||
m_printer_command = 0xff;
|
|
||||||
m_printer_data = 0x00;
|
|
||||||
m_printer_headpos = 0x00; // bring printer head to left margin
|
m_printer_headpos = 0x00; // bring printer head to left margin
|
||||||
m_printer_shift = 0;
|
m_printer_shift = 0;
|
||||||
m_printer_shift_output = 0;
|
m_printer_shift_output = 0;
|
||||||
|
@ -34,6 +34,7 @@ public:
|
|||||||
: driver_device(mconfig, type, tag),
|
: driver_device(mconfig, type, tag),
|
||||||
m_maincpu(*this, "maincpu"),
|
m_maincpu(*this, "maincpu"),
|
||||||
m_fdc(*this, "upd765"),
|
m_fdc(*this, "upd765"),
|
||||||
|
m_floppy(*this, "upd765:%u", 0U),
|
||||||
m_ram(*this, RAM_TAG),
|
m_ram(*this, RAM_TAG),
|
||||||
m_beeper(*this, "beeper"),
|
m_beeper(*this, "beeper"),
|
||||||
m_screen(*this, "screen"),
|
m_screen(*this, "screen"),
|
||||||
@ -48,9 +49,6 @@ public:
|
|||||||
unsigned char m_bank_force;
|
unsigned char m_bank_force;
|
||||||
uint8_t m_timer_irq_flag;
|
uint8_t m_timer_irq_flag;
|
||||||
uint8_t m_nmi_flag;
|
uint8_t m_nmi_flag;
|
||||||
uint8_t m_printer_command;
|
|
||||||
uint8_t m_printer_data;
|
|
||||||
uint8_t m_printer_status;
|
|
||||||
int16_t m_printer_headpos;
|
int16_t m_printer_headpos;
|
||||||
uint16_t m_kb_scan_row;
|
uint16_t m_kb_scan_row;
|
||||||
uint8_t m_mcu_keyboard_data[16];
|
uint8_t m_mcu_keyboard_data[16];
|
||||||
@ -126,6 +124,7 @@ public:
|
|||||||
DECLARE_WRITE_LINE_MEMBER( pcw_fdc_interrupt );
|
DECLARE_WRITE_LINE_MEMBER( pcw_fdc_interrupt );
|
||||||
required_device<cpu_device> m_maincpu;
|
required_device<cpu_device> m_maincpu;
|
||||||
required_device<upd765a_device> m_fdc;
|
required_device<upd765a_device> m_fdc;
|
||||||
|
required_device_array<floppy_connector, 2> m_floppy;
|
||||||
required_device<ram_device> m_ram;
|
required_device<ram_device> m_ram;
|
||||||
required_device<beep_device> m_beeper;
|
required_device<beep_device> m_beeper;
|
||||||
required_device<screen_device> m_screen;
|
required_device<screen_device> m_screen;
|
||||||
|
Loading…
Reference in New Issue
Block a user