Skip to content

Commit 7501d0c

Browse files
committed
psr540: Start adding the floppy
1 parent ad925b8 commit 7501d0c

File tree

4 files changed

+35
-12
lines changed

4 files changed

+35
-12
lines changed

src/devices/cpu/sh/sh_mtu.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,14 @@ u8 sh_mtu_channel_device::tier_r()
317317
void sh_mtu_channel_device::tier_w(u8 data)
318318
{
319319
m_tier = data;
320-
logerror("irq %c%c%c%c%c%c\n",
321-
m_tier & IRQ_A ? 'a' : '.',
322-
m_tier & IRQ_B ? 'b' : '.',
323-
m_tier & IRQ_C ? 'c' : '.',
324-
m_tier & IRQ_D ? 'd' : '.',
325-
m_tier & IRQ_V ? 'v' : '.',
326-
m_tier & IRQ_U ? 'u' : '.');
320+
if(0)
321+
logerror("irq %c%c%c%c%c%c\n",
322+
m_tier & IRQ_A ? 'a' : '.',
323+
m_tier & IRQ_B ? 'b' : '.',
324+
m_tier & IRQ_C ? 'c' : '.',
325+
m_tier & IRQ_D ? 'd' : '.',
326+
m_tier & IRQ_V ? 'v' : '.',
327+
m_tier & IRQ_U ? 'u' : '.');
327328
recalc_event();
328329
}
329330

@@ -343,7 +344,7 @@ u16 sh_mtu_channel_device::tcnt_r()
343344
{
344345
if(!machine().side_effects_disabled())
345346
update_counter();
346-
// Nedd to implement phase counting for the rotary controller on the psr540
347+
// Need to implement phase counting for the rotary controller on the psr540
347348
if(m_tmdr & 0xf)
348349
return 0;
349350
return m_tcnt;

src/devices/machine/upd765.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -3431,7 +3431,6 @@ void hd63266f_device::motor_control(int fid, bool start_motor)
34313431
if(selected_drive != fid)
34323432
return;
34333433

3434-
logerror("motor_on_counter %d\n", motor_on_counter);
34353434
// decrement motor on counter
34363435
if(motor_on_counter)
34373436
motor_on_counter--;

src/mame/yamaha/ympsr540.cpp

+25-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
#include "bus/midi/midiinport.h"
77
#include "bus/midi/midioutport.h"
88
#include "cpu/sh/sh7042.h"
9+
#include "imagedev/floppy.h"
910
#include "machine/nvram.h"
11+
#include "machine/upd765.h"
1012
#include "sound/swx00.h"
1113
#include "video/hd44780.h"
1214

@@ -21,6 +23,8 @@ class psr540_state : public driver_device {
2123
m_maincpu(*this, "maincpu"),
2224
m_swx00(*this, "swx00"),
2325
m_lcdc(*this, "ks0066"),
26+
m_floppy(*this, "fdc:0"),
27+
m_fdc(*this, "fdc"),
2428
m_nvram(*this, "ram"),
2529
m_inputs(*this, "B%u", 1U),
2630
m_outputs(*this, "%02d.%x.%x", 0U, 0U, 0U),
@@ -34,6 +38,8 @@ class psr540_state : public driver_device {
3438
required_device<sh7042_device> m_maincpu;
3539
required_device<swx00_sound_device> m_swx00;
3640
required_device<hd44780_device> m_lcdc;
41+
required_device<floppy_connector> m_floppy;
42+
required_device<hd63266f_device> m_fdc;
3743
required_device<nvram_device> m_nvram;
3844
required_ioport_array<8> m_inputs;
3945
output_finder<80, 8, 5> m_outputs;
@@ -83,6 +89,8 @@ void psr540_state::machine_start()
8389
m_pe = 0;
8490
m_led = 0;
8591
m_scan = 0;
92+
93+
m_fdc->set_floppy(m_floppy->get_device());
8694
}
8795

8896
u16 psr540_state::adc_sustain_r()
@@ -100,6 +108,11 @@ u16 psr540_state::adc_battery_r()
100108
return 0x3ff;
101109
}
102110

111+
static void psr540_floppies(device_slot_interface &device)
112+
{
113+
device.option_add("35hd", FLOPPY_35_HD);
114+
}
115+
103116
void psr540_state::psr540(machine_config &config)
104117
{
105118
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)
122135
m_lcdc->set_default_bios_tag("f00");
123136
m_lcdc->set_lcd_size(2, 40);
124137

138+
HD63266F(config, m_fdc, 16_MHz_XTAL);
139+
// m_fdc->drq_wr_callback().set([this](int state){ fdc_drq = state; maincpu->set_input_line(Z180_INPUT_LINE_DREQ0, state); });
140+
m_fdc->set_ready_line_connected(false);
141+
m_fdc->set_select_lines_connected(false);
142+
m_fdc->inp_rd_callback().set([this](){ return m_floppy->get_device()->dskchg_r(); });
143+
m_fdc->intrq_wr_callback().set_inputline(m_maincpu, 0);
144+
145+
FLOPPY_CONNECTOR(config, m_floppy, psr540_floppies, "35hd", floppy_image_device::default_pc_floppy_formats, true);
146+
125147
NVRAM(config, m_nvram, nvram_device::DEFAULT_NONE);
126148

127149
/* video hardware */
@@ -172,9 +194,10 @@ u8 psr540_state::pf_r()
172194
void psr540_state::pe_w(u16 data)
173195
{
174196
m_pe = data;
175-
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());
197+
// 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());
176198
m_lcdc->rs_w(BIT(m_pe, 11));
177199
m_lcdc->e_w(BIT(m_pe, 9));
200+
m_fdc->rate_w(!BIT(m_pe, 8));
178201

179202
if(BIT(m_pe, 4))
180203
m_scan = m_led & 7;
@@ -198,7 +221,7 @@ void psr540_state::map(address_map &map)
198221

199222
// 200000-3fffff: cs0 space, 8bits, 1 cycle between accesses, cs assert extension, 6 wait states
200223
// 200000 fdc
201-
map(0x00200000, 0x00200000).lr8(NAME([]() -> u8 { return 0x80; }));
224+
map(0x00200000, 0x00200003).m(m_fdc, FUNC(hd63266f_device::map));
202225
// 280000 sram (battery-backed)
203226
map(0x00280000, 0x0029ffff).ram().share("ram");
204227
// 2c0000 leds/scanning

src/mame/yamaha/ymqs300.cpp

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

0 commit comments

Comments
 (0)