psr540: Start adding the floppy

This commit is contained in:
Olivier Galibert 2024-05-13 23:43:59 +02:00
parent ad925b8564
commit 7501d0cb09
4 changed files with 35 additions and 12 deletions

View file

@ -317,13 +317,14 @@ u8 sh_mtu_channel_device::tier_r()
void sh_mtu_channel_device::tier_w(u8 data)
{
m_tier = data;
logerror("irq %c%c%c%c%c%c\n",
m_tier & IRQ_A ? 'a' : '.',
m_tier & IRQ_B ? 'b' : '.',
m_tier & IRQ_C ? 'c' : '.',
m_tier & IRQ_D ? 'd' : '.',
m_tier & IRQ_V ? 'v' : '.',
m_tier & IRQ_U ? 'u' : '.');
if(0)
logerror("irq %c%c%c%c%c%c\n",
m_tier & IRQ_A ? 'a' : '.',
m_tier & IRQ_B ? 'b' : '.',
m_tier & IRQ_C ? 'c' : '.',
m_tier & IRQ_D ? 'd' : '.',
m_tier & IRQ_V ? 'v' : '.',
m_tier & IRQ_U ? 'u' : '.');
recalc_event();
}
@ -343,7 +344,7 @@ u16 sh_mtu_channel_device::tcnt_r()
{
if(!machine().side_effects_disabled())
update_counter();
// Nedd to implement phase counting for the rotary controller on the psr540
// Need to implement phase counting for the rotary controller on the psr540
if(m_tmdr & 0xf)
return 0;
return m_tcnt;

View file

@ -3431,7 +3431,6 @@ void hd63266f_device::motor_control(int fid, bool start_motor)
if(selected_drive != fid)
return;
logerror("motor_on_counter %d\n", motor_on_counter);
// decrement motor on counter
if(motor_on_counter)
motor_on_counter--;

View file

@ -6,7 +6,9 @@
#include "bus/midi/midiinport.h"
#include "bus/midi/midioutport.h"
#include "cpu/sh/sh7042.h"
#include "imagedev/floppy.h"
#include "machine/nvram.h"
#include "machine/upd765.h"
#include "sound/swx00.h"
#include "video/hd44780.h"
@ -21,6 +23,8 @@ public:
m_maincpu(*this, "maincpu"),
m_swx00(*this, "swx00"),
m_lcdc(*this, "ks0066"),
m_floppy(*this, "fdc:0"),
m_fdc(*this, "fdc"),
m_nvram(*this, "ram"),
m_inputs(*this, "B%u", 1U),
m_outputs(*this, "%02d.%x.%x", 0U, 0U, 0U),
@ -34,6 +38,8 @@ private:
required_device<sh7042_device> m_maincpu;
required_device<swx00_sound_device> m_swx00;
required_device<hd44780_device> m_lcdc;
required_device<floppy_connector> m_floppy;
required_device<hd63266f_device> m_fdc;
required_device<nvram_device> m_nvram;
required_ioport_array<8> m_inputs;
output_finder<80, 8, 5> m_outputs;
@ -83,6 +89,8 @@ void psr540_state::machine_start()
m_pe = 0;
m_led = 0;
m_scan = 0;
m_fdc->set_floppy(m_floppy->get_device());
}
u16 psr540_state::adc_sustain_r()
@ -100,6 +108,11 @@ u16 psr540_state::adc_battery_r()
return 0x3ff;
}
static void psr540_floppies(device_slot_interface &device)
{
device.option_add("35hd", FLOPPY_35_HD);
}
void psr540_state::psr540(machine_config &config)
{
SH7042A(config, m_maincpu, 7_MHz_XTAL*4); // // md=a, on-chip rom, 32-bit space, pll 4x -- XW25610 6437042F14F 9M1 A
@ -122,6 +135,15 @@ void psr540_state::psr540(machine_config &config)
m_lcdc->set_default_bios_tag("f00");
m_lcdc->set_lcd_size(2, 40);
HD63266F(config, m_fdc, 16_MHz_XTAL);
// m_fdc->drq_wr_callback().set([this](int state){ fdc_drq = state; maincpu->set_input_line(Z180_INPUT_LINE_DREQ0, state); });
m_fdc->set_ready_line_connected(false);
m_fdc->set_select_lines_connected(false);
m_fdc->inp_rd_callback().set([this](){ return m_floppy->get_device()->dskchg_r(); });
m_fdc->intrq_wr_callback().set_inputline(m_maincpu, 0);
FLOPPY_CONNECTOR(config, m_floppy, psr540_floppies, "35hd", floppy_image_device::default_pc_floppy_formats, true);
NVRAM(config, m_nvram, nvram_device::DEFAULT_NONE);
/* video hardware */
@ -172,9 +194,10 @@ u8 psr540_state::pf_r()
void psr540_state::pe_w(u16 data)
{
m_pe = data;
logerror("pe lcd_rs=%x lcd_en=%x ldcic=%d fdcic=%d (%s)\n", BIT(m_pe, 11), BIT(m_pe, 9), BIT(m_pe, 4), BIT(m_pe, 3), machine().describe_context());
// logerror("pe lcd_rs=%x lcd_en=%x rdens=%d ldcic=%d fdcic=%d (%s)\n", BIT(m_pe, 11), BIT(m_pe, 9), BIT(m_pe, 8), BIT(m_pe, 4), BIT(m_pe, 3), machine().describe_context());
m_lcdc->rs_w(BIT(m_pe, 11));
m_lcdc->e_w(BIT(m_pe, 9));
m_fdc->rate_w(!BIT(m_pe, 8));
if(BIT(m_pe, 4))
m_scan = m_led & 7;
@ -198,7 +221,7 @@ void psr540_state::map(address_map &map)
// 200000-3fffff: cs0 space, 8bits, 1 cycle between accesses, cs assert extension, 6 wait states
// 200000 fdc
map(0x00200000, 0x00200000).lr8(NAME([]() -> u8 { return 0x80; }));
map(0x00200000, 0x00200003).m(m_fdc, FUNC(hd63266f_device::map));
// 280000 sram (battery-backed)
map(0x00280000, 0x0029ffff).ram().share("ram");
// 2c0000 leds/scanning

View file

@ -196,7 +196,7 @@ void qs300_state::qs300(machine_config &config)
m_subcpu->read_adc<0>().set_constant(0); // Aftertouch
m_subcpu->read_adc<1>().set_constant(0); // Pitch bend
m_subcpu->read_adc<2>().set_constant(0); // Modulation wheel
m_subcpu->read_adc<3>().set_constant(0x3ff); // CC ? Wired to +5V
m_subcpu->read_adc<3>().set_constant(0x3ff); // Generic continuous controller, wired to +5V
m_subcpu->read_adc<4>().set_constant(0); // Foot control
m_subcpu->read_adc<5>().set_constant(0); // Foot volume
m_subcpu->read_adc<6>().set_constant(0x3ff); // Unconnected