src/mess/drivers/phunsy.c
| r15292 | r15293 | |
| 4 | 4 | |
| 5 | 5 | 04/11/2010 Skeleton driver. |
| 6 | 6 | |
| 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 | |
| 7 | 17 | ****************************************************************************/ |
| 8 | 18 | |
| 9 | 19 | #include "emu.h" |
| 10 | 20 | #include "cpu/s2650/s2650.h" |
| 11 | 21 | #include "machine/keyboard.h" |
| 12 | 22 | #include "sound/speaker.h" |
| 23 | #include "imagedev/cassette.h" |
| 24 | #include "sound/wave.h" |
| 13 | 25 | |
| 14 | 26 | #define MACHINE_RESET_MEMBER(name) void name::machine_reset() |
| 15 | 27 | #define VIDEO_START_MEMBER(name) void name::video_start() |
| r15292 | r15293 | |
| 23 | 35 | public: |
| 24 | 36 | phunsy_state(const machine_config &mconfig, device_type type, const char *tag) |
| 25 | 37 | : 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") { } |
| 29 | 42 | |
| 30 | | required_device<cpu_device> m_maincpu; |
| 31 | | required_device<device_t> m_speaker; |
| 32 | 43 | DECLARE_READ8_MEMBER( phunsy_data_r ); |
| 33 | | DECLARE_READ8_MEMBER( phunsy_sense_r ); |
| 34 | 44 | DECLARE_WRITE8_MEMBER( phunsy_1800_w ); |
| 35 | 45 | DECLARE_WRITE8_MEMBER( phunsy_ctrl_w ); |
| 36 | 46 | DECLARE_WRITE8_MEMBER( phunsy_data_w ); |
| 37 | 47 | DECLARE_WRITE8_MEMBER( kbd_put ); |
| 38 | | required_shared_ptr<UINT8> m_videoram; |
| 48 | DECLARE_READ8_MEMBER(cass_r); |
| 49 | DECLARE_WRITE8_MEMBER(cass_w); |
| 39 | 50 | const UINT8 *m_p_chargen; |
| 40 | 51 | UINT8 m_data_out; |
| 41 | 52 | UINT8 m_keyboard_input; |
| r15292 | r15293 | |
| 45 | 56 | virtual void machine_reset(); |
| 46 | 57 | virtual void video_start(); |
| 47 | 58 | 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; |
| 48 | 63 | }; |
| 49 | 64 | |
| 50 | 65 | |
| r15292 | r15293 | |
| 54 | 69 | m_ram_1800[offset] = data; |
| 55 | 70 | } |
| 56 | 71 | |
| 72 | WRITE8_MEMBER( phunsy_state::cass_w ) |
| 73 | { |
| 74 | m_cass->output(BIT(data, 0) ? -1.0 : +1.0); |
| 75 | } |
| 57 | 76 | |
| 77 | READ8_MEMBER( phunsy_state::cass_r ) |
| 78 | { |
| 79 | return (m_cass->input() > 0.03) ? 0 : 1; |
| 80 | } |
| 81 | |
| 58 | 82 | static ADDRESS_MAP_START(phunsy_mem, AS_PROGRAM, 8, phunsy_state) |
| 59 | 83 | ADDRESS_MAP_UNMAP_HIGH |
| 60 | 84 | AM_RANGE( 0x0000, 0x07ff) AM_ROM |
| r15292 | r15293 | |
| 148 | 172 | } |
| 149 | 173 | |
| 150 | 174 | |
| 151 | | READ8_MEMBER( phunsy_state::phunsy_sense_r ) |
| 152 | | { |
| 153 | | return 0; |
| 154 | | } |
| 155 | | |
| 156 | | |
| 157 | 175 | static ADDRESS_MAP_START( phunsy_io, AS_IO, 8, phunsy_state) |
| 158 | 176 | ADDRESS_MAP_UNMAP_HIGH |
| 159 | 177 | AM_RANGE( S2650_CTRL_PORT, S2650_CTRL_PORT ) AM_WRITE( phunsy_ctrl_w ) |
| 160 | 178 | 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) |
| 162 | 180 | ADDRESS_MAP_END |
| 163 | 181 | |
| 164 | 182 | |
| r15292 | r15293 | |
| 295 | 313 | |
| 296 | 314 | /* sound hardware */ |
| 297 | 315 | 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) |
| 300 | 318 | MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) |
| 301 | 319 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 302 | 320 | |
| 303 | 321 | /* Devices */ |
| 304 | 322 | MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf) |
| 323 | MCFG_CASSETTE_ADD( CASSETTE_TAG, default_cassette_interface ) |
| 305 | 324 | MACHINE_CONFIG_END |
| 306 | 325 | |
| 307 | 326 | |
| r15292 | r15293 | |
| 325 | 344 | |
| 326 | 345 | /* Driver */ |
| 327 | 346 | |
| 328 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 329 | | COMP( 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 */ |
| 348 | COMP( 1980, phunsy, 0, 0, phunsy, phunsy, 0, "J.F.P. Philipse", "PHUNSY", GAME_NOT_WORKING ) |
| 330 | 349 | |