Skip to content

Commit bd7ec7c

Browse files
committed
philips/p2000t.cpp: hookup cart slot, kickoff SW list, pre-emptively demote to MNW
1 parent 9f5a27a commit bd7ec7c

2 files changed

Lines changed: 65 additions & 32 deletions

File tree

hash/p2000_cart.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
3+
<!--
4+
license:CC0-1.0
5+
6+
TODO:
7+
- Check RAM requirements for each SW;
8+
- Check if p2000m can really run everything here or it warrants a sharedfeat;
9+
10+
-->
11+
<softwarelist name="p2000_cart" description="Philips P2000T/P2000M cartridges">
12+
13+
<software name="basicnl">
14+
<description>Cassette Basic (v1.1, Netherlands)</description>
15+
<year>198?</year>
16+
<publisher>Philips</publisher>
17+
<part name="cart" interface="p2000_cart">
18+
<dataarea name="rom" size="0x4000">
19+
<rom name="basic.rom" size="0x4000" crc="9d9d38f9" sha1="fb5100436c99634a2592a10dff867f85bcff7aec"/>
20+
</dataarea>
21+
</part>
22+
</software>
23+
24+
</softwarelist>

src/mame/philips/p2000t.cpp

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Philips P2000 1 Memory map
55
66
CPU: Z80
77
0000-0fff ROM
8-
1000-4fff ROM (appl)
8+
1000-4fff ROM (cartslot)
99
5000-57ff RAM (Screen T ver)
1010
5000-5fff RAM (Screen M ver)
1111
6000-9fff RAM (system)
@@ -30,6 +30,8 @@ Philips P2000 1 Memory map
3030

3131
#include "emu.h"
3232

33+
#include "bus/generic/carts.h"
34+
#include "bus/generic/slot.h"
3335
#include "cpu/z80/z80.h"
3436
#include "machine/mdcr.h"
3537
#include "machine/ram.h"
@@ -38,6 +40,7 @@ Philips P2000 1 Memory map
3840

3941
#include "emupal.h"
4042
#include "screen.h"
43+
#include "softlist_dev.h"
4144
#include "speaker.h"
4245

4346
namespace {
@@ -109,7 +112,6 @@ class p2000t_state : public driver_device
109112
private:
110113
required_ioport_array<10> m_keyboard;
111114
uint8_t m_port_101f;
112-
uint8_t m_port_202f;
113115
uint8_t m_port_303f;
114116
uint8_t m_port_707f;
115117
};
@@ -326,26 +328,10 @@ void p2000t_state::p2000t_port_9494_w(uint8_t data) {
326328
m_bank->set_entry(data);
327329
}
328330

329-
/* port i/o functions */
330-
void p2000t_state::p2000t_io(address_map &map)
331-
{
332-
map.global_mask(0xff);
333-
map(0x00, 0x0f).r(FUNC(p2000t_state::p2000t_port_000f_r));
334-
map(0x10, 0x1f).w(FUNC(p2000t_state::p2000t_port_101f_w));
335-
map(0x20, 0x2f).r(FUNC(p2000t_state::p2000t_port_202f_r));
336-
map(0x30, 0x3f).w(FUNC(p2000t_state::p2000t_port_303f_w));
337-
map(0x50, 0x5f).w(FUNC(p2000t_state::p2000t_port_505f_w));
338-
map(0x70, 0x7f).w(FUNC(p2000t_state::p2000t_port_707f_w));
339-
map(0x88, 0x8b).w(FUNC(p2000t_state::p2000t_port_888b_w));
340-
map(0x8c, 0x90).w(FUNC(p2000t_state::p2000t_port_8c90_w));
341-
map(0x94, 0x94).w(FUNC(p2000t_state::p2000t_port_9494_w));
342-
}
343-
344-
/* Memory w/r functions */
345331
void p2000t_state::p2000t_mem(address_map &map)
346332
{
347333
map(0x0000, 0x0fff).rom();
348-
map(0x1000, 0x4fff).rom();
334+
map(0x1000, 0x4fff).r("cartslot", FUNC(generic_slot_device::read_rom));
349335
map(0x5000, 0x57ff).ram().share("videoram");
350336
map(0x5800, 0xdfff).ram();
351337
map(0xe000, 0xffff).bankrw(m_bank);
@@ -354,12 +340,27 @@ void p2000t_state::p2000t_mem(address_map &map)
354340
void p2000m_state::p2000m_mem(address_map &map)
355341
{
356342
map(0x0000, 0x0fff).rom();
357-
map(0x1000, 0x4fff).rom();
343+
map(0x1000, 0x4fff).r("cartslot", FUNC(generic_slot_device::read_rom));
358344
map(0x5000, 0x5fff).ram().share("videoram");
359345
map(0x6000, 0xdfff).ram();
360346
map(0xe000, 0xffff).bankrw(m_bank);
361347
}
362348

349+
/* port i/o functions */
350+
void p2000t_state::p2000t_io(address_map &map)
351+
{
352+
map.global_mask(0xff);
353+
map(0x00, 0x0f).r(FUNC(p2000t_state::p2000t_port_000f_r));
354+
map(0x10, 0x1f).w(FUNC(p2000t_state::p2000t_port_101f_w));
355+
map(0x20, 0x2f).r(FUNC(p2000t_state::p2000t_port_202f_r));
356+
map(0x30, 0x3f).w(FUNC(p2000t_state::p2000t_port_303f_w));
357+
map(0x50, 0x5f).w(FUNC(p2000t_state::p2000t_port_505f_w));
358+
map(0x70, 0x7f).w(FUNC(p2000t_state::p2000t_port_707f_w));
359+
map(0x88, 0x8b).w(FUNC(p2000t_state::p2000t_port_888b_w));
360+
map(0x8c, 0x90).w(FUNC(p2000t_state::p2000t_port_8c90_w));
361+
map(0x94, 0x94).w(FUNC(p2000t_state::p2000t_port_9494_w));
362+
}
363+
363364
/* graphics output */
364365

365366
static const gfx_layout p2000m_charlayout =
@@ -536,6 +537,7 @@ uint8_t p2000t_state::videoram_r(offs_t offset)
536537

537538

538539
/* Machine definition */
540+
// TODO: merge defs
539541
void p2000t_state::p2000t(machine_config &config)
540542
{
541543
/* basic machine hardware */
@@ -556,15 +558,19 @@ void p2000t_state::p2000t(machine_config &config)
556558
saa5050.d_cb().set(FUNC(p2000t_state::videoram_r));
557559
saa5050.set_screen_size(40, 24, 80);
558560

559-
/* sound hardware */
560-
SPEAKER(config, "mono").front_center();
561-
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
562-
563561
/* the mini cassette driver */
564562
MDCR(config, m_mdcr, 0);
565563

566564
/* internal ram */
567565
RAM(config, m_ram).set_default_size("16K").set_extra_options("16K,32K,48K,64K,80K,102K");
566+
567+
GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "p2000_cart", "bin,rom");
568+
569+
SOFTWARE_LIST(config, "cart_list").set_original("p2000_cart");
570+
571+
/* sound hardware */
572+
SPEAKER(config, "mono").front_center();
573+
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
568574
}
569575

570576

@@ -590,33 +596,36 @@ void p2000m_state::p2000m(machine_config &config)
590596
GFXDECODE(config, m_gfxdecode, m_palette, gfx_p2000m);
591597
PALETTE(config, m_palette, FUNC(p2000m_state::p2000m_palette), 4);
592598

593-
/* sound hardware */
594-
SPEAKER(config, "mono").front_center();
595-
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
596-
597599
/* the mini cassette driver */
598600
MDCR(config, m_mdcr, 0);
601+
599602
/* internal ram */
600603
RAM(config, m_ram).set_default_size("16K").set_extra_options("16K,32K,48K,64K,80K,102K");
604+
605+
GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "p2000_cart", "bin,rom");
606+
607+
SOFTWARE_LIST(config, "cart_list").set_original("p2000_cart");
608+
609+
/* sound hardware */
610+
SPEAKER(config, "mono").front_center();
611+
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25);
601612
}
602613

603614
} // anonymous namespace
604615

605616
ROM_START(p2000t)
606617
ROM_REGION(0x10000, "maincpu",0)
607618
ROM_LOAD("p2000.rom", 0x0000, 0x1000, CRC(650784a3) SHA1(4dbb28adad30587f2ea536ba116898d459faccac))
608-
ROM_LOAD("basic.rom", 0x1000, 0x4000, CRC(9d9d38f9) SHA1(fb5100436c99634a2592a10dff867f85bcff7aec))
609619
ROM_END
610620

611621
ROM_START(p2000m)
612622
ROM_REGION(0x10000, "maincpu",0)
613623
ROM_LOAD("p2000.rom", 0x0000, 0x1000, CRC(650784a3) SHA1(4dbb28adad30587f2ea536ba116898d459faccac))
614-
ROM_LOAD("basic.rom", 0x1000, 0x4000, CRC(9d9d38f9) SHA1(fb5100436c99634a2592a10dff867f85bcff7aec))
615624

616625
ROM_REGION(0x01000, "gfx1",0)
617626
ROM_LOAD("p2000.chr", 0x0140, 0x08c0, BAD_DUMP CRC(78c17e3e) SHA1(4e1c59dc484505de1dc0b1ba7e5f70a54b0d4ccc))
618627
ROM_END
619628

620629
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
621-
COMP( 1980, p2000t, 0, 0, p2000t, p2000t, p2000t_state, empty_init, "Philips", "P2000T", 0 )
622-
COMP( 1980, p2000m, p2000t, 0, p2000m, p2000t, p2000m_state, empty_init, "Philips", "P2000M", 0 )
630+
COMP( 1980, p2000t, 0, 0, p2000t, p2000t, p2000t_state, empty_init, "Philips", "P2000T", MACHINE_NOT_WORKING )
631+
COMP( 1980, p2000m, p2000t, 0, p2000m, p2000t, p2000m_state, empty_init, "Philips", "P2000M", MACHINE_NOT_WORKING )

0 commit comments

Comments
 (0)