Previous 15994 Revisions Next

r12930 Sunday 25th September, 2011 at 05:28:34 UTC by Robbbert
P2000 - modernised. SAA5050 - commented out a bug which broke p2000t & poly1.
[src/emu/video]saa5050.c
[src/mess/drivers]p2000t.c
[src/mess/includes]p2000t.h
[src/mess/machine]p2000t.c
[src/mess/video]p2000m.c

src/emu/video/saa5050.c
r12929r12930
232232         {
233233            switch (code)
234234            {
235            case 0x00:
236               blank = 1;  // code 0x00 should not display anything, unless HOLDGR is set
235            case 0x00:  // commented out line below - it breaks p2000t and poly1
236               //blank = 1;  // code 0x00 should not display anything, unless HOLDGR is set
237237               break;
238238            case 0x01: case 0x02: case 0x03: case 0x04:
239239            case 0x05: case 0x06: case 0x07:
src/mess/machine/p2000t.c
r12929r12930
77
88**********************************************************************/
99
10#include "emu.h"
11#include "cpu/z80/z80.h"
1210#include "includes/p2000t.h"
13#include "sound/speaker.h"
1411
1512#define P2000M_101F_CASDAT   0x01
1613#define P2000M_101F_CASCMD   0x02
r12929r12930
4239    If the keyboard interrupt is disabled, reading one of these ports
4340    will read the corresponding keyboard matrix row
4441*/
45READ8_HANDLER (   p2000t_port_000f_r )
42READ8_MEMBER( p2000t_state::p2000t_port_000f_r )
4643{
47   p2000t_state *state = space->machine().driver_data<p2000t_state>();
4844   static const char *const keynames[] = {
4945      "KEY0", "KEY1", "KEY2", "KEY3", "KEY4",
5046      "KEY5", "KEY6", "KEY7", "KEY8", "KEY9"
5147   };
5248
53   if (state->m_port_101f & P2000M_101F_KEYINT)
49   if (m_port_101f & P2000M_101F_KEYINT)
5450   {
55      return (input_port_read(space->machine(), "KEY0") & input_port_read(space->machine(), "KEY1") &
56      input_port_read(space->machine(), "KEY2") & input_port_read(space->machine(), "KEY3") &
57      input_port_read(space->machine(), "KEY4") & input_port_read(space->machine(), "KEY5") &
58      input_port_read(space->machine(), "KEY6") & input_port_read(space->machine(), "KEY7") &
59      input_port_read(space->machine(), "KEY8") & input_port_read(space->machine(), "KEY9"));
51      return (
52      input_port_read(machine(), "KEY0") & input_port_read(machine(), "KEY1") &
53      input_port_read(machine(), "KEY2") & input_port_read(machine(), "KEY3") &
54      input_port_read(machine(), "KEY4") & input_port_read(machine(), "KEY5") &
55      input_port_read(machine(), "KEY6") & input_port_read(machine(), "KEY7") &
56      input_port_read(machine(), "KEY8") & input_port_read(machine(), "KEY9"));
6057   }
61   else if (offset < 10)
58   else
59   if (offset < 10)
6260   {
63      return (input_port_read(space->machine(), keynames[offset]));
61      return (input_port_read(machine(), keynames[offset]));
6462   }
65   return (0xff);
63   else
64      return 0xff;
6665}
6766
6867
r12929r12930
7877    bit 6 - Cassette read clock
7978    bit 7 - Cassette read data
8079*/
81READ8_HANDLER (   p2000t_port_202f_r )
80READ8_MEMBER( p2000t_state::p2000t_port_202f_r )
8281{
8382   return (0xff);
8483}
r12929r12930
9695    bit 6 - Keyboard interrupt enable
9796    bit 7 - Printer output
9897*/
99WRITE8_HANDLER ( p2000t_port_101f_w )
98WRITE8_MEMBER( p2000t_state::p2000t_port_101f_w )
10099{
101   p2000t_state *state = space->machine().driver_data<p2000t_state>();
102   state->m_port_101f = data;
100   m_port_101f = data;
103101}
104102
105103/*
r12929r12930
114112    bit 6 - \
115113    bit 7 - Video disable (0 = enabled)
116114*/
117WRITE8_HANDLER ( p2000t_port_303f_w )
115WRITE8_MEMBER( p2000t_state::p2000t_port_303f_w )
118116{
119   p2000t_state *state = space->machine().driver_data<p2000t_state>();
120   state->m_port_303f = data;
117   m_port_303f = data;
121118}
122119
123120/*
r12929r12930
132129    bit 6 - Unused
133130    bit 7 - Unused
134131*/
135WRITE8_HANDLER ( p2000t_port_505f_w )
132WRITE8_MEMBER( p2000t_state::p2000t_port_505f_w )
136133{
137   device_t *speaker = space->machine().device(SPEAKER_TAG);
138   speaker_level_w(speaker, BIT(data,0));
134   speaker_level_w(m_speaker, BIT(data,0));
139135}
140136
141137/*
r12929r12930
154150    video refresh is disabled when the CPU accesses video memory
155151
156152*/
157WRITE8_HANDLER ( p2000t_port_707f_w )
153WRITE8_MEMBER( p2000t_state::p2000t_port_707f_w )
158154{
159   p2000t_state *state = space->machine().driver_data<p2000t_state>();
160   state->m_port_707f = data;
155   m_port_707f = data;
161156}
162157
163WRITE8_HANDLER ( p2000t_port_888b_w ) {}
164WRITE8_HANDLER ( p2000t_port_8c90_w ) {}
165WRITE8_HANDLER ( p2000t_port_9494_w ) {}
166
158WRITE8_MEMBER( p2000t_state::p2000t_port_888b_w ) {}
159WRITE8_MEMBER( p2000t_state::p2000t_port_8c90_w ) {}
160WRITE8_MEMBER( p2000t_state::p2000t_port_9494_w ) {}
src/mess/video/p2000m.c
r12929r12930
66
77**********************************************************************/
88
9#include "emu.h"
109#include "includes/p2000t.h"
1110
1211
r12929r12930
2221SCREEN_UPDATE( p2000m )
2322{
2423   p2000t_state *state = screen->machine().driver_data<p2000t_state>();
25   UINT8 *videoram = state->m_videoram;
24   UINT8 *videoram = state->m_p_videoram;
2625   int offs, sx, sy, code, loop;
2726
2827   for (offs = 0; offs < 80 * 24; offs++)
src/mess/includes/p2000t.h
r12929r12930
77#ifndef P2000T_H_
88#define P2000T_H_
99
10#include "emu.h"
11#include "cpu/z80/z80.h"
12#include "sound/speaker.h"
13#include "video/saa5050.h"
1014
15
1116class p2000t_state : public driver_device
1217{
1318public:
1419   p2000t_state(const machine_config &mconfig, device_type type, const char *tag)
15      : driver_device(mconfig, type, tag) { }
20      : driver_device(mconfig, type, tag),
21   m_maincpu(*this, "maincpu"),
22   m_speaker(*this, SPEAKER_TAG)
23   { }
1624
17   UINT8 *m_videoram;
25   required_device<cpu_device> m_maincpu;
26   required_device<device_t> m_speaker;
27   DECLARE_READ8_MEMBER(p2000t_port_000f_r);
28   DECLARE_READ8_MEMBER(p2000t_port_202f_r);
29   DECLARE_WRITE8_MEMBER(p2000t_port_101f_w);
30   DECLARE_WRITE8_MEMBER(p2000t_port_303f_w);
31   DECLARE_WRITE8_MEMBER(p2000t_port_505f_w);
32   DECLARE_WRITE8_MEMBER(p2000t_port_707f_w);
33   DECLARE_WRITE8_MEMBER(p2000t_port_888b_w);
34   DECLARE_WRITE8_MEMBER(p2000t_port_8c90_w);
35   DECLARE_WRITE8_MEMBER(p2000t_port_9494_w);
36   UINT8 *m_p_videoram;
1837   UINT8 m_port_101f;
1938   UINT8 m_port_202f;
2039   UINT8 m_port_303f;
r12929r12930
2544
2645/*----------- defined in machine/p2000t.c -----------*/
2746
28extern  READ8_HANDLER( p2000t_port_000f_r );
29extern  READ8_HANDLER( p2000t_port_202f_r );
30extern WRITE8_HANDLER( p2000t_port_101f_w );
31extern WRITE8_HANDLER( p2000t_port_303f_w );
32extern WRITE8_HANDLER( p2000t_port_505f_w );
33extern WRITE8_HANDLER( p2000t_port_707f_w );
34extern WRITE8_HANDLER( p2000t_port_888b_w );
35extern WRITE8_HANDLER( p2000t_port_8c90_w );
36extern WRITE8_HANDLER( p2000t_port_9494_w );
3747
3848
49
3950/*----------- defined in video/p2000m.c -----------*/
4051
4152extern VIDEO_START( p2000m );
src/mess/drivers/p2000t.c
r12929r12930
2525    Display: SAA5050
2626
2727************************************************************************/
28#define ADDRESS_MAP_MODERN
2829
29#include "emu.h"
3030#include "includes/p2000t.h"
31#include "cpu/z80/z80.h"
32#include "sound/speaker.h"
33#include "video/saa5050.h"
3431
3532
3633/* port i/o functions */
37static ADDRESS_MAP_START( p2000t_io , AS_IO, 8)
34static ADDRESS_MAP_START( p2000t_io, AS_IO, 8, p2000t_state )
3835   ADDRESS_MAP_GLOBAL_MASK(0xff)
3936   AM_RANGE(0x00, 0x0f) AM_READ(p2000t_port_000f_r)
4037   AM_RANGE(0x10, 0x1f) AM_WRITE(p2000t_port_101f_w)
r12929r12930
4845ADDRESS_MAP_END
4946
5047/* Memory w/r functions */
51static ADDRESS_MAP_START( p2000t_mem , AS_PROGRAM, 8)
48static ADDRESS_MAP_START( p2000t_mem, AS_PROGRAM, 8, p2000t_state )
5249   AM_RANGE(0x0000, 0x0fff) AM_ROM
5350   AM_RANGE(0x1000, 0x4fff) AM_ROM
54   AM_RANGE(0x5000, 0x57ff) AM_DEVREADWRITE("saa5050", saa5050_videoram_r, saa5050_videoram_w)
51   AM_RANGE(0x5000, 0x57ff) AM_DEVREADWRITE_LEGACY("saa5050", saa5050_videoram_r, saa5050_videoram_w)
5552   AM_RANGE(0x5800, 0x9fff) AM_RAM
5653   AM_RANGE(0xa000, 0xffff) AM_NOP
5754ADDRESS_MAP_END
5855
59static ADDRESS_MAP_START( p2000m_mem , AS_PROGRAM, 8)
56static ADDRESS_MAP_START( p2000m_mem, AS_PROGRAM, 8, p2000t_state )
6057   AM_RANGE(0x0000, 0x0fff) AM_ROM
6158   AM_RANGE(0x1000, 0x4fff) AM_ROM
62   AM_RANGE(0x5000, 0x5fff) AM_RAM AM_BASE_MEMBER(p2000t_state, m_videoram)
59   AM_RANGE(0x5000, 0x5fff) AM_RAM AM_BASE(m_p_videoram)
6360   AM_RANGE(0x6000, 0x9fff) AM_RAM
6461   AM_RANGE(0xa000, 0xffff) AM_NOP
6562ADDRESS_MAP_END
r12929r12930
225222   "screen",
226223   0,   /* starting gfxnum */
227224   40, 24 - 1, 80,  /* x, y, size */
228      0    /* rev y order */
225   0    /* rev y order */
229226};
230227
231228/* Machine definition */
r12929r12930
240237   MCFG_SCREEN_ADD("screen", RASTER)
241238   MCFG_SCREEN_REFRESH_RATE(50)
242239   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(SAA5050_VBLANK))
243   MCFG_QUANTUM_TIME(attotime::from_hz(60))
244
245240   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
246241   MCFG_SCREEN_SIZE(40 * 12, 24 * 20)
247242   MCFG_SCREEN_VISIBLE_AREA(0, 40 * 12 - 1, 0, 24 * 20 - 1)
248243   MCFG_SCREEN_UPDATE(p2000t)
249
250244   MCFG_GFXDECODE(saa5050)
251245   MCFG_PALETTE_LENGTH(128)
252246   MCFG_PALETTE_INIT(saa5050)
r12929r12930
276270   MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
277271   MCFG_SCREEN_SIZE(80 * 12, 24 * 20)
278272   MCFG_SCREEN_VISIBLE_AREA(0, 80 * 12 - 1, 0, 24 * 20 - 1)
273   MCFG_VIDEO_START(p2000m)
279274   MCFG_SCREEN_UPDATE(p2000m)
280
281275   MCFG_GFXDECODE( p2000m )
282276   MCFG_PALETTE_LENGTH(4)
283277   MCFG_PALETTE_INIT(p2000m)
284278
285   MCFG_VIDEO_START(p2000m)
286
287279   /* sound hardware */
288280   MCFG_SPEAKER_STANDARD_MONO("mono")
289281   MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0)
r12929r12930
308300ROM_END
309301
310302/*      YEAR    NAME    PARENT  COMPAT  MACHINE     INPUT       INIT      COMPANY     FULLNAME */
311COMP (   1980,   p2000t,   0,   0,   p2000t,   p2000t,      0,      "Philips",   "Philips P2000T" , 0)
312COMP (   1980,   p2000m,   p2000t,   0,   p2000m,   p2000t,      0,      "Philips",   "Philips P2000M" , 0)
313
303COMP ( 1980,    p2000t, 0,      0,      p2000t,     p2000t,     0,       "Philips", "Philips P2000T", 0)
304COMP ( 1980,    p2000m, p2000t, 0,      p2000m,     p2000t,     0,       "Philips", "Philips P2000M", 0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team