src/mess/machine/p2000t.c
| r12929 | r12930 | |
| 7 | 7 | |
| 8 | 8 | **********************************************************************/ |
| 9 | 9 | |
| 10 | | #include "emu.h" |
| 11 | | #include "cpu/z80/z80.h" |
| 12 | 10 | #include "includes/p2000t.h" |
| 13 | | #include "sound/speaker.h" |
| 14 | 11 | |
| 15 | 12 | #define P2000M_101F_CASDAT 0x01 |
| 16 | 13 | #define P2000M_101F_CASCMD 0x02 |
| r12929 | r12930 | |
| 42 | 39 | If the keyboard interrupt is disabled, reading one of these ports |
| 43 | 40 | will read the corresponding keyboard matrix row |
| 44 | 41 | */ |
| 45 | | READ8_HANDLER ( p2000t_port_000f_r ) |
| 42 | READ8_MEMBER( p2000t_state::p2000t_port_000f_r ) |
| 46 | 43 | { |
| 47 | | p2000t_state *state = space->machine().driver_data<p2000t_state>(); |
| 48 | 44 | static const char *const keynames[] = { |
| 49 | 45 | "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", |
| 50 | 46 | "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" |
| 51 | 47 | }; |
| 52 | 48 | |
| 53 | | if (state->m_port_101f & P2000M_101F_KEYINT) |
| 49 | if (m_port_101f & P2000M_101F_KEYINT) |
| 54 | 50 | { |
| 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")); |
| 60 | 57 | } |
| 61 | | else if (offset < 10) |
| 58 | else |
| 59 | if (offset < 10) |
| 62 | 60 | { |
| 63 | | return (input_port_read(space->machine(), keynames[offset])); |
| 61 | return (input_port_read(machine(), keynames[offset])); |
| 64 | 62 | } |
| 65 | | return (0xff); |
| 63 | else |
| 64 | return 0xff; |
| 66 | 65 | } |
| 67 | 66 | |
| 68 | 67 | |
| r12929 | r12930 | |
| 78 | 77 | bit 6 - Cassette read clock |
| 79 | 78 | bit 7 - Cassette read data |
| 80 | 79 | */ |
| 81 | | READ8_HANDLER ( p2000t_port_202f_r ) |
| 80 | READ8_MEMBER( p2000t_state::p2000t_port_202f_r ) |
| 82 | 81 | { |
| 83 | 82 | return (0xff); |
| 84 | 83 | } |
| r12929 | r12930 | |
| 96 | 95 | bit 6 - Keyboard interrupt enable |
| 97 | 96 | bit 7 - Printer output |
| 98 | 97 | */ |
| 99 | | WRITE8_HANDLER ( p2000t_port_101f_w ) |
| 98 | WRITE8_MEMBER( p2000t_state::p2000t_port_101f_w ) |
| 100 | 99 | { |
| 101 | | p2000t_state *state = space->machine().driver_data<p2000t_state>(); |
| 102 | | state->m_port_101f = data; |
| 100 | m_port_101f = data; |
| 103 | 101 | } |
| 104 | 102 | |
| 105 | 103 | /* |
| r12929 | r12930 | |
| 114 | 112 | bit 6 - \ |
| 115 | 113 | bit 7 - Video disable (0 = enabled) |
| 116 | 114 | */ |
| 117 | | WRITE8_HANDLER ( p2000t_port_303f_w ) |
| 115 | WRITE8_MEMBER( p2000t_state::p2000t_port_303f_w ) |
| 118 | 116 | { |
| 119 | | p2000t_state *state = space->machine().driver_data<p2000t_state>(); |
| 120 | | state->m_port_303f = data; |
| 117 | m_port_303f = data; |
| 121 | 118 | } |
| 122 | 119 | |
| 123 | 120 | /* |
| r12929 | r12930 | |
| 132 | 129 | bit 6 - Unused |
| 133 | 130 | bit 7 - Unused |
| 134 | 131 | */ |
| 135 | | WRITE8_HANDLER ( p2000t_port_505f_w ) |
| 132 | WRITE8_MEMBER( p2000t_state::p2000t_port_505f_w ) |
| 136 | 133 | { |
| 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)); |
| 139 | 135 | } |
| 140 | 136 | |
| 141 | 137 | /* |
| r12929 | r12930 | |
| 154 | 150 | video refresh is disabled when the CPU accesses video memory |
| 155 | 151 | |
| 156 | 152 | */ |
| 157 | | WRITE8_HANDLER ( p2000t_port_707f_w ) |
| 153 | WRITE8_MEMBER( p2000t_state::p2000t_port_707f_w ) |
| 158 | 154 | { |
| 159 | | p2000t_state *state = space->machine().driver_data<p2000t_state>(); |
| 160 | | state->m_port_707f = data; |
| 155 | m_port_707f = data; |
| 161 | 156 | } |
| 162 | 157 | |
| 163 | | WRITE8_HANDLER ( p2000t_port_888b_w ) {} |
| 164 | | WRITE8_HANDLER ( p2000t_port_8c90_w ) {} |
| 165 | | WRITE8_HANDLER ( p2000t_port_9494_w ) {} |
| 166 | | |
| 158 | WRITE8_MEMBER( p2000t_state::p2000t_port_888b_w ) {} |
| 159 | WRITE8_MEMBER( p2000t_state::p2000t_port_8c90_w ) {} |
| 160 | WRITE8_MEMBER( p2000t_state::p2000t_port_9494_w ) {} |
src/mess/includes/p2000t.h
| r12929 | r12930 | |
| 7 | 7 | #ifndef P2000T_H_ |
| 8 | 8 | #define P2000T_H_ |
| 9 | 9 | |
| 10 | #include "emu.h" |
| 11 | #include "cpu/z80/z80.h" |
| 12 | #include "sound/speaker.h" |
| 13 | #include "video/saa5050.h" |
| 10 | 14 | |
| 15 | |
| 11 | 16 | class p2000t_state : public driver_device |
| 12 | 17 | { |
| 13 | 18 | public: |
| 14 | 19 | 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 | { } |
| 16 | 24 | |
| 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; |
| 18 | 37 | UINT8 m_port_101f; |
| 19 | 38 | UINT8 m_port_202f; |
| 20 | 39 | UINT8 m_port_303f; |
| r12929 | r12930 | |
| 25 | 44 | |
| 26 | 45 | /*----------- defined in machine/p2000t.c -----------*/ |
| 27 | 46 | |
| 28 | | extern READ8_HANDLER( p2000t_port_000f_r ); |
| 29 | | extern READ8_HANDLER( p2000t_port_202f_r ); |
| 30 | | extern WRITE8_HANDLER( p2000t_port_101f_w ); |
| 31 | | extern WRITE8_HANDLER( p2000t_port_303f_w ); |
| 32 | | extern WRITE8_HANDLER( p2000t_port_505f_w ); |
| 33 | | extern WRITE8_HANDLER( p2000t_port_707f_w ); |
| 34 | | extern WRITE8_HANDLER( p2000t_port_888b_w ); |
| 35 | | extern WRITE8_HANDLER( p2000t_port_8c90_w ); |
| 36 | | extern WRITE8_HANDLER( p2000t_port_9494_w ); |
| 37 | 47 | |
| 38 | 48 | |
| 49 | |
| 39 | 50 | /*----------- defined in video/p2000m.c -----------*/ |
| 40 | 51 | |
| 41 | 52 | extern VIDEO_START( p2000m ); |
src/mess/drivers/p2000t.c
| r12929 | r12930 | |
| 25 | 25 | Display: SAA5050 |
| 26 | 26 | |
| 27 | 27 | ************************************************************************/ |
| 28 | #define ADDRESS_MAP_MODERN |
| 28 | 29 | |
| 29 | | #include "emu.h" |
| 30 | 30 | #include "includes/p2000t.h" |
| 31 | | #include "cpu/z80/z80.h" |
| 32 | | #include "sound/speaker.h" |
| 33 | | #include "video/saa5050.h" |
| 34 | 31 | |
| 35 | 32 | |
| 36 | 33 | /* port i/o functions */ |
| 37 | | static ADDRESS_MAP_START( p2000t_io , AS_IO, 8) |
| 34 | static ADDRESS_MAP_START( p2000t_io, AS_IO, 8, p2000t_state ) |
| 38 | 35 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 39 | 36 | AM_RANGE(0x00, 0x0f) AM_READ(p2000t_port_000f_r) |
| 40 | 37 | AM_RANGE(0x10, 0x1f) AM_WRITE(p2000t_port_101f_w) |
| r12929 | r12930 | |
| 48 | 45 | ADDRESS_MAP_END |
| 49 | 46 | |
| 50 | 47 | /* Memory w/r functions */ |
| 51 | | static ADDRESS_MAP_START( p2000t_mem , AS_PROGRAM, 8) |
| 48 | static ADDRESS_MAP_START( p2000t_mem, AS_PROGRAM, 8, p2000t_state ) |
| 52 | 49 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 53 | 50 | 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) |
| 55 | 52 | AM_RANGE(0x5800, 0x9fff) AM_RAM |
| 56 | 53 | AM_RANGE(0xa000, 0xffff) AM_NOP |
| 57 | 54 | ADDRESS_MAP_END |
| 58 | 55 | |
| 59 | | static ADDRESS_MAP_START( p2000m_mem , AS_PROGRAM, 8) |
| 56 | static ADDRESS_MAP_START( p2000m_mem, AS_PROGRAM, 8, p2000t_state ) |
| 60 | 57 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 61 | 58 | 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) |
| 63 | 60 | AM_RANGE(0x6000, 0x9fff) AM_RAM |
| 64 | 61 | AM_RANGE(0xa000, 0xffff) AM_NOP |
| 65 | 62 | ADDRESS_MAP_END |
| r12929 | r12930 | |
| 225 | 222 | "screen", |
| 226 | 223 | 0, /* starting gfxnum */ |
| 227 | 224 | 40, 24 - 1, 80, /* x, y, size */ |
| 228 | | 0 /* rev y order */ |
| 225 | 0 /* rev y order */ |
| 229 | 226 | }; |
| 230 | 227 | |
| 231 | 228 | /* Machine definition */ |
| r12929 | r12930 | |
| 240 | 237 | MCFG_SCREEN_ADD("screen", RASTER) |
| 241 | 238 | MCFG_SCREEN_REFRESH_RATE(50) |
| 242 | 239 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(SAA5050_VBLANK)) |
| 243 | | MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
| 244 | | |
| 245 | 240 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 246 | 241 | MCFG_SCREEN_SIZE(40 * 12, 24 * 20) |
| 247 | 242 | MCFG_SCREEN_VISIBLE_AREA(0, 40 * 12 - 1, 0, 24 * 20 - 1) |
| 248 | 243 | MCFG_SCREEN_UPDATE(p2000t) |
| 249 | | |
| 250 | 244 | MCFG_GFXDECODE(saa5050) |
| 251 | 245 | MCFG_PALETTE_LENGTH(128) |
| 252 | 246 | MCFG_PALETTE_INIT(saa5050) |
| r12929 | r12930 | |
| 276 | 270 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 277 | 271 | MCFG_SCREEN_SIZE(80 * 12, 24 * 20) |
| 278 | 272 | MCFG_SCREEN_VISIBLE_AREA(0, 80 * 12 - 1, 0, 24 * 20 - 1) |
| 273 | MCFG_VIDEO_START(p2000m) |
| 279 | 274 | MCFG_SCREEN_UPDATE(p2000m) |
| 280 | | |
| 281 | 275 | MCFG_GFXDECODE( p2000m ) |
| 282 | 276 | MCFG_PALETTE_LENGTH(4) |
| 283 | 277 | MCFG_PALETTE_INIT(p2000m) |
| 284 | 278 | |
| 285 | | MCFG_VIDEO_START(p2000m) |
| 286 | | |
| 287 | 279 | /* sound hardware */ |
| 288 | 280 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 289 | 281 | MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) |
| r12929 | r12930 | |
| 308 | 300 | ROM_END |
| 309 | 301 | |
| 310 | 302 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ |
| 311 | | COMP ( 1980, p2000t, 0, 0, p2000t, p2000t, 0, "Philips", "Philips P2000T" , 0) |
| 312 | | COMP ( 1980, p2000m, p2000t, 0, p2000m, p2000t, 0, "Philips", "Philips P2000M" , 0) |
| 313 | | |
| 303 | COMP ( 1980, p2000t, 0, 0, p2000t, p2000t, 0, "Philips", "Philips P2000T", 0) |
| 304 | COMP ( 1980, p2000m, p2000t, 0, p2000m, p2000t, 0, "Philips", "Philips P2000M", 0) |