Previous 199869 Revisions Next

r19788 Tuesday 25th December, 2012 at 00:45:38 UTC by Robbbert
(MESS) Pencil2 : added some cassette code, but not working (nw)
[src/mess/drivers]pencil2.c

trunk/src/mess/drivers/pencil2.c
r19787r19788
6363
6464ToDo:
6565- Keys missing (Shift, Ctrl, F1 to F6, Esc)
66- Printer (out 00)
67- Cassette
66- Cassette isn't working
6867- Joysticks
6968- Cart slot
7069- Screen size is wrong in BASIC. Should be 24 lines of text with a wide
r19787r19788
7877#include "sound/sn76496.h"
7978#include "machine/ctronics.h"
8079//#include "imagedev/cartslot.h"
81//#include "imagedev/cassette.h"
82//#include "sound/wave.h"
80#include "imagedev/cassette.h"
81#include "sound/wave.h"
8382
8483
8584class pencil2_state : public driver_device
r19787r19788
8887   pencil2_state(const machine_config &mconfig, device_type type, const char *tag)
8988      : driver_device(mconfig, type, tag),
9089   m_maincpu(*this, "maincpu"),
91   m_printer(*this, "centronics")
90   m_printer(*this, "centronics"),
91   m_cass(*this, CASSETTE_TAG)
9292   { }
9393
9494   DECLARE_WRITE8_MEMBER(port10_w);
95   DECLARE_WRITE8_MEMBER(port30_w);
9596   DECLARE_WRITE8_MEMBER(port80_w);
9697   DECLARE_WRITE8_MEMBER(portc0_w);
9798   DECLARE_READ8_MEMBER(porte0_r);
r19787r19788
100101   virtual void machine_reset();
101102   required_device<cpu_device> m_maincpu;
102103   required_device<centronics_device> m_printer;
104   required_device<cassette_image_device> m_cass;
103105};
104106
105107static ADDRESS_MAP_START(pencil2_mem, AS_PROGRAM, 8, pencil2_state)
r19787r19788
115117   ADDRESS_MAP_GLOBAL_MASK(0xff)
116118   AM_RANGE(0x00, 0x0f) AM_DEVWRITE("centronics", centronics_device, write)
117119   AM_RANGE(0x10, 0x1f) AM_WRITE(port10_w)
118   //AM_RANGE(0x30, 0x3f) AM_WRITE(port30_w) cass out
120   AM_RANGE(0x30, 0x3f) AM_WRITE(port30_w)
119121   AM_RANGE(0x80, 0x9f) AM_WRITE(port80_w)
120122   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x1e) AM_DEVREADWRITE("tms9928a", tms9928a_device, vram_read, vram_write)
121123   AM_RANGE(0xa1, 0xa1) AM_MIRROR(0x1e) AM_DEVREADWRITE("tms9928a", tms9928a_device, register_read, register_write)
r19787r19788
125127
126128READ8_MEMBER( pencil2_state::porte0_r)
127129{
128   char kbdrow[6];
129   sprintf(kbdrow,"X%X",offset);
130   return ioport( kbdrow )->read();
130   if (offset==2)
131      return (m_cass->input() > 0.1);
132   else
133   {
134      char kbdrow[6];
135      sprintf(kbdrow,"X%X",offset);
136      //printf("%X ",offset);
137      return ioport( kbdrow )->read();
138   }
131139}
132140
133141WRITE8_MEMBER( pencil2_state::port10_w )
r19787r19788
135143   m_printer->strobe_w(BIT(data, 0));
136144}
137145
146WRITE8_MEMBER( pencil2_state::port30_w )
147{
148   m_cass->output( BIT(data, 0) ? -1.0 : +1.0);
149}
150
138151WRITE8_MEMBER( pencil2_state::port80_w )
139152{
140153}
r19787r19788
281294   MCFG_SOUND_ADD("sn76489a", SN76489A, XTAL_10_738635MHz/3) // guess
282295   MCFG_SOUND_CONFIG(psg_intf)
283296   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
284//   MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG)
285//   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
297   MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG)
298   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
286299
287300   /* cassette */
288//   MCFG_CASSETTE_ADD( CASSETTE_TAG, pencil2_cassette_interface )
301   MCFG_CASSETTE_ADD( CASSETTE_TAG, default_cassette_interface )
289302
290303   /* cartridge */
291304//   MCFG_CARTSLOT_ADD("cart")

Previous 199869 Revisions Next


© 1997-2024 The MAME Team