Previous 15994 Revisions Next

r15293 Thursday 24th May, 2012 at 07:35:49 UTC by Robbbert
PHUNSY - added cassette.
[src/mess/drivers]phunsy.c

src/mess/drivers/phunsy.c
r15292r15293
44
55        04/11/2010 Skeleton driver.
66
7        http://www.tubedata.info/phunsy/index.html
8
9        Cassette added 2012-05-24
10        Baud Rate ~ 6000 baud
11        W command to save data, eg 800-8FFW
12        R command to read data, eg 1100R to load the file at 1100,
13               or R to load the file where it came from.
14        Problem is the tape must already be in the leader when you press
15        the Enter key, or it errors immediately.
16
717****************************************************************************/
818
919#include "emu.h"
1020#include "cpu/s2650/s2650.h"
1121#include "machine/keyboard.h"
1222#include "sound/speaker.h"
23#include "imagedev/cassette.h"
24#include "sound/wave.h"
1325
1426#define MACHINE_RESET_MEMBER(name) void name::machine_reset()
1527#define VIDEO_START_MEMBER(name) void name::video_start()
r15292r15293
2335public:
2436   phunsy_state(const machine_config &mconfig, device_type type, const char *tag)
2537      : driver_device(mconfig, type, tag),
26      m_maincpu(*this, "maincpu"),
27      m_speaker(*this, SPEAKER_TAG),
28      m_videoram(*this, "videoram") { }
38   m_maincpu(*this, "maincpu"),
39   m_speaker(*this, SPEAKER_TAG),
40   m_cass(*this, CASSETTE_TAG),
41   m_videoram(*this, "videoram") { }
2942
30   required_device<cpu_device> m_maincpu;
31   required_device<device_t> m_speaker;
3243   DECLARE_READ8_MEMBER( phunsy_data_r );
33   DECLARE_READ8_MEMBER( phunsy_sense_r );
3444   DECLARE_WRITE8_MEMBER( phunsy_1800_w );
3545   DECLARE_WRITE8_MEMBER( phunsy_ctrl_w );
3646   DECLARE_WRITE8_MEMBER( phunsy_data_w );
3747   DECLARE_WRITE8_MEMBER( kbd_put );
38   required_shared_ptr<UINT8> m_videoram;
48   DECLARE_READ8_MEMBER(cass_r);
49   DECLARE_WRITE8_MEMBER(cass_w);
3950   const UINT8   *m_p_chargen;
4051   UINT8      m_data_out;
4152   UINT8      m_keyboard_input;
r15292r15293
4556   virtual void machine_reset();
4657   virtual void video_start();
4758   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
59   required_device<cpu_device> m_maincpu;
60   required_device<device_t> m_speaker;
61   required_device<cassette_image_device> m_cass;
62   required_shared_ptr<UINT8> m_videoram;
4863};
4964
5065
r15292r15293
5469      m_ram_1800[offset] = data;
5570}
5671
72WRITE8_MEMBER( phunsy_state::cass_w )
73{
74   m_cass->output(BIT(data, 0) ? -1.0 : +1.0);
75}
5776
77READ8_MEMBER( phunsy_state::cass_r )
78{
79   return (m_cass->input() > 0.03) ? 0 : 1;
80}
81
5882static ADDRESS_MAP_START(phunsy_mem, AS_PROGRAM, 8, phunsy_state)
5983   ADDRESS_MAP_UNMAP_HIGH
6084   AM_RANGE( 0x0000, 0x07ff) AM_ROM
r15292r15293
148172}
149173
150174
151READ8_MEMBER( phunsy_state::phunsy_sense_r )
152{
153   return 0;
154}
155
156
157175static ADDRESS_MAP_START( phunsy_io, AS_IO, 8, phunsy_state)
158176   ADDRESS_MAP_UNMAP_HIGH
159177   AM_RANGE( S2650_CTRL_PORT, S2650_CTRL_PORT ) AM_WRITE( phunsy_ctrl_w )
160178   AM_RANGE( S2650_DATA_PORT,S2650_DATA_PORT) AM_READWRITE( phunsy_data_r, phunsy_data_w )
161   AM_RANGE( S2650_SENSE_PORT,S2650_SENSE_PORT) AM_READ( phunsy_sense_r)
179   AM_RANGE(S2650_SENSE_PORT, S2650_FO_PORT) AM_READWRITE(cass_r, cass_w)
162180ADDRESS_MAP_END
163181
164182
r15292r15293
295313
296314   /* sound hardware */
297315   MCFG_SPEAKER_STANDARD_MONO("mono")
298   //MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG)
299   //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
316   MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG)
317   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
300318   MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0)
301319   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
302320
303321   /* Devices */
304322   MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
323   MCFG_CASSETTE_ADD( CASSETTE_TAG, default_cassette_interface )
305324MACHINE_CONFIG_END
306325
307326
r15292r15293
325344
326345/* Driver */
327346
328/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY   FULLNAME       FLAGS */
329COMP( 1980, phunsy,  0,       0,     phunsy,    phunsy,   0, "J.F.P. Philipse",   "PHUNSY", GAME_NOT_WORKING )
347/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY        FULLNAME       FLAGS */
348COMP( 1980, phunsy,  0,       0,     phunsy,    phunsy,   0, "J.F.P. Philipse", "PHUNSY", GAME_NOT_WORKING )
330349

Previous 15994 Revisions Next


© 1998-2018 The MESS Team