Skip to content

Commit c6b72ab

Browse files
rm/rm380z.cpp: Split RM480Z out to its own driver with MQ2 floppy drive support (#12576)
1 parent 471b126 commit c6b72ab

11 files changed

+1364
-174
lines changed

src/mame/mame.lst

+4-2
Original file line numberDiff line numberDiff line change
@@ -38796,8 +38796,10 @@ rm380zf // 1978 RM380z with COS 4.0/F firmware
3879638796
rm380zfhrg // 1978 RM380z with COS 4.0/F and HRG
3879738797
rm380z34d // 1978 RM380z with COS 3.4/F firmware and casette
3879838798
rm380z34e // 1978 RM380z with COS 3.4/M firmware and casette
38799-
rm480z // 1981 RM480z
38800-
rm480za // 1981 RM480z
38799+
38800+
@source:rm/rm480z.cpp
38801+
rm480z // 1981 RM480z with ROS 2.2
38802+
rm480za // 1981 RM480z with ROS 1.2
3880138803

3880238804
@source:rm/rmnimbus.cpp
3880338805
nimbus // RM Nimbus 186

src/mame/rm/rm380z.cpp

+10-105
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Driver started on 22/12/2011
1111
Stefano Bodrato, 09/12/2016 - skeleton for cassette support
1212
True tape samples are needed to continue !
1313
14+
Robin Sergeant, 2024 - h/w scrolling, HRG, sound, 8" disk support
15+
and various bug fixes.
16+
1417
===
1518
1619
From the Firmware Manual:
@@ -37,54 +40,30 @@ COS 4.2 A
3740
/M = 5.25 inch single density floppy
3841
Ver 4.2 can have either floppy type
3942
40-
*** RM480Z ***
41-
RML 40-Character LINK 480Z V1.0
42-
RML 80-Character LINK 480Z V1.0
43-
RML 40-Character LINK 480Z V1.1 A
44-
RML 40-Character LINK 480Z V1.1 B
45-
RML 80-Character LINK 480Z V1.1 A
46-
RML 80-Character LINK 480Z V1.1 B
47-
RML 80-Character LINK 480Z V1.2 A
48-
RML 80-Character LINK 480Z V1.2 B
49-
RML 80-Character LINK 480Z V1.2 C
50-
RML 80-Character LINK 480Z V1.2 D
51-
RML 80-Character LINK 480Z V2.2 B
52-
53-
V1.0 refers to ROS 1.0
54-
V1.1 refers to ROS 1.1
55-
V1.2 refers to ROS 1.2
56-
V2.2 refers to ROS 2.2
57-
5843
Monitor commands:
59-
B - Boot CP/M (COS /F, COS /M, ROS 1.2, ROS 2.2)
44+
B - Boot CP/M (COS /F, COS /M)
6045
X - Boot CP/M from another drive (as above)
61-
N - Boot network (ROS)
62-
T - Enter terminal mode (ROS)
63-
L - Load program from cassette (COS /C, ROS)
46+
L - Load program from cassette (COS /C)
6447
D - Dump memory to cassette (as above)
6548
C - Continue program at restart address (as above)
6649
J - Go to address
67-
O - Select printer option (and cassette speed for COS /C, ROS)
50+
O - Select printer option (and cassette speed for COS /C)
6851
M - Enable HRG board as memory (COS 3.4, COS 4.0)
6952
W - Select 40 or 80 characters per line (All 80-column machines)
70-
R - Start ROM BASIC (ROS 1.1, ROS 1.2, ROS 2.2)
71-
Ctrl+Shift+8 - Break and return to current OS (ROS)
72-
Ctrl+Shift+9 - Break and return to front panel (ROS)
7353
Ctrl+F - Enter Front Panel (=the debugger)
7454
Ctrl+T - Enter Typewriter mode
7555
Ctrl+S - Autopaging on
7656
Ctrl+Q - Autopaging off
7757
Ctrl+A - Toggle autopaging
7858
7959
Graphics characters: These are low-res (2x3 TRS80-style) from 80-BF, repeated at C0-FF.
80-
80-BF will be low-intensity, except for a RM480Z if using a colour monitor.
60+
80-BF will be low-intensity.
8161
The characters 00-1F have one set for COS 3.4 and COS 4.0, and a different set for the others.
8262
COS 4.0 and 4.2 allow one to redefine the 80-FF character range, and to have attributes.
8363
ROS 2.2 allows an alternate character set.
8464
8565
Sound:
8666
RM380Z has a connector for a speaker
87-
RM480Z has the speaker fitted
8867
8968
===
9069
@@ -117,8 +96,8 @@ PAGE SEL bit in PORT0 set to 1:
11796
FB00-FBFF - Memory-mapped ports (FBFC-FBFF)
11897
FC00-FFFF - RAM
11998
120-
Video resolution (not confirmed):
121-
80x24 - 6 pixels wide (5 + spacing), 10 pixels high (9 + spacing) = 480x240
99+
Video resolution:
100+
80x24 - 8 pixels wide, 10 pixels high = 640x240
122101
Video input clock is 16MHz
123102
124103
According to the manuals, VDU-1 chargen is Texas 74LS262.
@@ -136,10 +115,7 @@ Notes on COS 4.0 disassembly:
136115
137116
TODO:
138117
139-
- Properly implement dimming and graphic chars (>0x80)
140-
- Understand why any write to disk command fails with "bad sector"
141-
- Understand why ctrl-U (blinking cursor) in COS 4.0 stops keyboard input from working
142-
- Get a reliable ROM dump and charset ROM dump
118+
- Make cassette interface work.
143119
144120
145121
Attempt to register save state entry after state registration is closed!
@@ -190,29 +166,6 @@ void rm380z_state::rm380z_io(address_map &map)
190166
map(0xe8, 0xff).rw(FUNC(rm380z_state::rm380z_porthi_r), FUNC(rm380z_state::rm380z_porthi_w));
191167
}
192168

193-
void rm480z_state::rm480z_mem(address_map &map)
194-
{
195-
map(0x0000, 0xe7ff).ram();
196-
map(0xe800, 0xf7ff).rom().region(RM380Z_MAINCPU_TAG, 0);
197-
map(0xf800, 0xffff).ram();
198-
}
199-
200-
void rm480z_state::rm480z_io(address_map &map)
201-
{
202-
//map(0x00, 0x17).ram(); // videoram
203-
//map(0x18, 0x18).mirror(0xff00); // control port 0
204-
//map(0x19, 0x19).mirror(0xff00); // control port 1
205-
//map(0x1a, 0x1a).mirror(0xff00); // control port 2
206-
//map(0x1b, 0x1b).mirror(0xff00); // control port 3 (DAC) // option
207-
//map(0x1d, 0x1d).mirror(0xff00); // control port 5 (USERIO) // option
208-
//map(0x20, 0x23).mirror(0xff00); // system CTC - 0=SIO4&cassin, 1=SIO2&cassio, 2=keybd int, 3=50Hz int for repeat key
209-
//map(0x24, 0x27).mirror(0xff00); // system SIO - 0=chA network data, 1=chB SIO4 data, 2=ChA control, 3=ChB control
210-
//map(0x28, 0x29).mirror(0xff02); // am9511/am9512 maths chip // option
211-
//map(0x2c, 0x2f).mirror(0xff00); // z80ctc IEEE int, Maths int, RTC, RTC // option
212-
//map(0x30, 0x37).mirror(0xff00); // IEEE chip // option
213-
//map(0x38, 0x3b).mirror(0xff00); // Hi-res graphics option
214-
}
215-
216169
INPUT_PORTS_START( rm380z )
217170

218171
// PORT_START("additional_chars")
@@ -318,30 +271,6 @@ void rm380z_state_cos40_hrg::rm380zhrg(machine_config &config)
318271
m_palette->set_init(FUNC(rm380z_state_cos40_hrg::palette_init)).set_entries(19);
319272
}
320273

321-
void rm480z_state::rm480z(machine_config &config)
322-
{
323-
/* basic machine hardware */
324-
Z80(config, m_maincpu, 16_MHz_XTAL / 4);
325-
m_maincpu->set_addrmap(AS_PROGRAM, &rm480z_state::rm480z_mem);
326-
m_maincpu->set_addrmap(AS_IO, &rm480z_state::rm480z_io);
327-
328-
/* video hardware */
329-
// screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
330-
// screen.set_refresh_hz(50);
331-
// screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
332-
// screen.set_size((RM380Z_SCREENCOLS*(RM380Z_CHDIMX+1)), (RM380Z_SCREENROWS*(RM380Z_CHDIMY+1)));
333-
// screen.set_visarea(0, (RM380Z_SCREENCOLS*(RM380Z_CHDIMX+1))-1, 0, (RM380Z_SCREENROWS*(RM380Z_CHDIMY+1))-1);
334-
// screen.set_screen_update(FUNC(rm380z_state::screen_update_rm480z));
335-
// screen.set_palette("palette");
336-
337-
// PALETTE(config, "palette", palette_device::MONOCHROME);
338-
339-
/* keyboard */
340-
// generic_keyboard_device &keyboard(GENERIC_KEYBOARD(config, "keyboard", 0));
341-
// keyboard.set_keyboard_callback(FUNC(rm380z_state::keyboard_put));
342-
}
343-
344-
345274
/* ROM definitions */
346275

347276
ROM_START( rm380z34d ) // COS 3.4D/F
@@ -390,28 +319,6 @@ ROM_START( rm380zfhrg ) // COS 4.0B/F
390319
ROM_LOAD( "c-gen-22.bin", 0x0000, 0x0800, CRC(1b67127f) SHA1(289a919871d30c5e832d22244bcac1dcfd544baa) )
391320
ROM_END
392321

393-
// RM480Z is quite different, might be better off in its own driver
394-
ROM_START( rm480z )
395-
ROM_REGION( 0x10000, RM380Z_MAINCPU_TAG, 0 )
396-
ROM_LOAD( "fv2.0_0_12099_19.2.86.ic83", 0x0000, 0x4000, CRC(a0f02d8a) SHA1(1c063b842699dc0ad85a5a5f337f2864497f9c0f) )
397-
ROM_LOAD( "fv2.0_1_12100_27.2.86.ic93", 0x4000, 0x4000, CRC(2a93ca6e) SHA1(7fdd772d4251dbf951a687d184ed787cfe21212b) )
398-
ROM_REGION( 0x2000, "chargen", 0 )
399-
ROM_LOAD( "cg06_12098_28.2.86.ic98", 0x0000, 0x2000, CRC(15d40f7e) SHA1(a7266357eb9be849f77a97ff3013b236c0af8289) )
400-
ROM_END
401-
402-
ROM_START( rm480za )
403-
ROM_REGION( 0x10000, RM380Z_MAINCPU_TAG, 0 )
404-
ROM_LOAD( "ros_1.2b.ls", 0x0000, 0x2000, CRC(37e93287) SHA1(c96d4b7eedadb0fb8e3732b6ba3e898e123c393f) )
405-
ROM_LOAD( "bir_5.4b_0.lt", 0x2000, 0x4000, CRC(64759792) SHA1(ffce5e59788cd492937e85b368b71e8a5a2aaa9c) )
406-
ROM_LOAD( "bir_5.4b_1.lu", 0x6000, 0x4000, CRC(adce35df) SHA1(dc20df0fcfefc5e2682b47e7ce454043dc593cd8) )
407-
ROM_LOAD( "bir_5.4b_2.lv", 0xa000, 0x4000, CRC(5a455fc8) SHA1(04c5f17120ee085c013e600b77ca63cbb138aa4d) )
408-
ROM_REGION( 0x10000, "user1", 0 ) // bioses for fdc board versions
409-
ROM_LOAD( "idc3-1i.rom", 0x0000, 0x2000, CRC(39e2cdf0) SHA1(ba523af357b61bbe6192727139850f36597d79f1) )
410-
ROM_LOAD( "idc5-1j.rom", 0x2000, 0x2000, CRC(d2ac27e2) SHA1(12d3966e0096c9bfb98135e15c3ddb37920cce15) )
411-
ROM_REGION( 0x2000, "chargen", 0 )
412-
ROM_LOAD( "cg06.lq", 0x0000, 0x2000, BAD_DUMP CRC(15d40f7e) SHA1(a7266357eb9be849f77a97ff3013b236c0af8289) ) // chip is marked CG05, might not be the same, so marked as bad
413-
ROM_END
414-
415322

416323
/* Driver */
417324
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
@@ -421,5 +328,3 @@ COMP(1978, rm380zf, 0, 0, rm380zf, rm380z, rm380z_state_cos4
421328
COMP(1978, rm380zfhrg, rm380zf, 0, rm380zfhrg, rm380zhrg, rm380z_state_cos40_hrg, driver_device::empty_init, "Research Machines", "RM-380Z, COS 4.0B/F with HRG", 0)
422329
COMP(1978, rm380z34d, rm380z, 0, rm380z34d, rm380z, rm380z_state_cos34, driver_device::empty_init, "Research Machines", "RM-380Z, COS 3.4D/F", MACHINE_NO_SOUND_HW)
423330
COMP(1978, rm380z34e, rm380z, 0, rm380z34e, rm380z, rm380z_state_cos34, driver_device::empty_init, "Research Machines", "RM-380Z, COS 3.4E/M", MACHINE_NO_SOUND_HW)
424-
COMP(1981, rm480z, rm380z, 0, rm480z, rm380z, rm480z_state, driver_device::empty_init, "Research Machines", "LINK RM-480Z (set 1)", MACHINE_IS_SKELETON)
425-
COMP(1981, rm480za, rm380z, 0, rm480za, rm380z, rm480z_state, driver_device::empty_init, "Research Machines", "LINK RM-480Z (set 2)", MACHINE_IS_SKELETON)

src/mame/rm/rm380z.h

+7-29
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ class rm380z_state : public driver_device
9393
uint8_t m_fbfe = 0;
9494

9595
required_device<cpu_device> m_maincpu;
96-
optional_device<screen_device> m_screen;
97-
optional_device<palette_device> m_palette;
98-
optional_device<ram_device> m_messram;
99-
optional_device<fd1771_device> m_fdc;
100-
optional_device<floppy_connector> m_floppy0;
101-
optional_device<floppy_connector> m_floppy1;
96+
required_device<screen_device> m_screen;
97+
required_device<palette_device> m_palette;
98+
required_device<ram_device> m_messram;
99+
required_device<fd1771_device> m_fdc;
100+
required_device<floppy_connector> m_floppy0;
101+
required_device<floppy_connector> m_floppy1;
102102
};
103103

104104
// COS 3.4 machine with cassette and VDU-40 display
@@ -199,7 +199,7 @@ class rm380z_state_cos40 : public rm380z_state
199199
uint8_t m_fbfd = 0;
200200

201201
required_region_ptr<u8> m_chargen;
202-
optional_device<speaker_sound_device> m_speaker;
202+
required_device<speaker_sound_device> m_speaker;
203203

204204
private:
205205
void config_videomode();
@@ -265,26 +265,4 @@ class rm380z_state_cos40_hrg : public rm380z_state_cos40
265265
required_ioport m_io_display_type;
266266
};
267267

268-
// partially implemented non working RM480z
269-
class rm480z_state : public rm380z_state_cos40
270-
{
271-
public:
272-
rm480z_state(const machine_config &mconfig, device_type type, const char *tag) :
273-
rm380z_state_cos40(mconfig, type, tag)
274-
{
275-
}
276-
277-
void rm480z(machine_config &config);
278-
void rm480za(machine_config &config) { rm480z(config); }
279-
280-
protected:
281-
void machine_reset() override ATTR_COLD;
282-
283-
void update_screen(bitmap_ind16 &bitmap) const override;
284-
285-
private:
286-
void rm480z_io(address_map &map) ATTR_COLD;
287-
void rm480z_mem(address_map &map) ATTR_COLD;
288-
};
289-
290268
#endif // MAME_RM_RM380Z_H

src/mame/rm/rm380z_m.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,6 @@ void rm380z_state_cos40_hrg::machine_reset()
371371
memset(m_hrg_scratchpad, 0, sizeof(m_hrg_scratchpad));
372372
}
373373

374-
void rm480z_state::machine_reset()
375-
{
376-
}
377-
378374
void rm380z_state::config_memory_map()
379375
{
380376
address_space &program = m_maincpu->space(AS_PROGRAM);

src/mame/rm/rm380z_v.cpp

-34
Original file line numberDiff line numberDiff line change
@@ -428,37 +428,3 @@ void rm380z_state_cos34::update_screen(bitmap_ind16 &bitmap) const
428428
}
429429
}
430430
}
431-
432-
// only partially implemented and non working
433-
void rm480z_state::update_screen(bitmap_ind16 &bitmap) const
434-
{
435-
uint16_t sy = 0, ma = 0;
436-
437-
for (uint8_t y = 0; y < RM380Z_SCREENROWS; y++)
438-
{
439-
for (uint8_t ra = 0; ra < 11; ra++)
440-
{
441-
uint16_t *p = &bitmap.pix(sy++);
442-
443-
for (uint16_t x = ma; x < ma + 64; x++)
444-
{
445-
uint8_t gfx = 0;
446-
if (ra < 10)
447-
{
448-
const uint8_t chr = m_vram.get_char(y, x);
449-
gfx = m_chargen[(chr << 4) | ra];
450-
}
451-
452-
// Display a scanline of a character
453-
*p++ = BIT(gfx, 7);
454-
*p++ = BIT(gfx, 6);
455-
*p++ = BIT(gfx, 5);
456-
*p++ = BIT(gfx, 4);
457-
*p++ = BIT(gfx, 3);
458-
*p++ = BIT(gfx, 2);
459-
*p++ = BIT(gfx, 1);
460-
*p++ = BIT(gfx, 0);
461-
}
462-
}
463-
}
464-
}

0 commit comments

Comments
 (0)