Previous 15994 Revisions Next

r15094 Friday 4th May, 2012 at 18:25:13 UTC by Michael Zapf
ti99: Changes due to ioport modernization (Michael Zapf) (nw)
[src/mess/drivers]ti99_4x.c
[src/mess/machine/ti99]datamux.c datamux.h mecmouse.c mecmouse.h

src/mess/machine/ti99/datamux.c
r15093r15094
254254   m_space = m_cpu->memory().space(AS_PROGRAM);
255255
256256   m_devices.reset(); // clear the list
257   m_use32k = (ioport("RAM")->read()==1)? TRUE : FALSE;
257   m_use32k = (ioport("RAM")->read()==1);
258258
259259   // better use a region?
260260   if (m_ram16b==NULL) m_ram16b = (UINT16*)malloc(32768);
r15093r15094
305305   LOG("Datamux device count = %d\n", m_devices.count());
306306}
307307
308INPUT_PORTS_START( datamux )
309   PORT_START( "RAM" )   /* config */
310   PORT_CONFNAME( 0x01, 0x01, "Console 32 KiB RAM upgrade (16 bit)" )
311      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
312      PORT_CONFSETTING(    0x01, DEF_STR( On ) )
313
314   PORT_START( "GROMENA" )
315   PORT_CONFNAME( 0x01, 0x01, "Console GROMs" )
316      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
317      PORT_CONFSETTING(    0x01, DEF_STR( On ) )
318
319INPUT_PORTS_END
320
321ioport_constructor ti99_datamux_device::device_input_ports() const
322{
323   return INPUT_PORTS_NAME(datamux);
324}
325
308326const device_type DATAMUX = &device_creator<ti99_datamux_device>;
src/mess/machine/ti99/datamux.h
r15093r15094
6767   virtual void device_start(void);
6868   virtual void device_stop(void);
6969   virtual void device_reset(void);
70   ioport_constructor device_input_ports() const;
7071
7172private:
7273   /* All devices that are attached to the 8-bit bus. */
r15093r15094
8687   UINT16 *m_ram16b;
8788
8889   /* Use the memory expansion? */
89   int m_use32k;
90   bool m_use32k;
9091
9192   /* Reference to the CPU; avoid lookups. */
9293   device_t *m_cpu;
src/mess/machine/ti99/mecmouse.c
r15093r15094
205205   m_last_my = 0;
206206}
207207
208INPUT_PORTS_START( mecmouse )
209   /* 3 ports for mouse */
210   PORT_START("MOUSEX") /* Mouse - X AXIS */
211      PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
212
213   PORT_START("MOUSEY") /* Mouse - Y AXIS */
214      PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
215
216   PORT_START("MOUSE0") /* Mouse - buttons */
217      PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button 1") PORT_PLAYER(1)
218      PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Mouse Button 2") PORT_PLAYER(1)
219INPUT_PORTS_END
220
221ioport_constructor mecmouse_device::device_input_ports() const
222{
223   return INPUT_PORTS_NAME( mecmouse );
224}
225
208226const device_type MECMOUSE = &device_creator<mecmouse_device>;
src/mess/machine/ti99/mecmouse.h
r15093r15094
2727protected:
2828   void device_start(void);
2929   void device_reset(void);
30   ioport_constructor device_input_ports() const;
3031
3132private:
3233   void poll(void);
src/mess/drivers/ti99_4x.c
r15093r15094
163163/* TI99/4a: 48-key keyboard, plus two optional joysticks (2 shift keys) */
164164static INPUT_PORTS_START(ti99_4a)
165165
166   PORT_START( "RAM" )   /* config */
167   PORT_CONFNAME( 0x01, 0x09, "Console 32 KiB RAM upgrade (16 bit)" )
168      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
169      PORT_CONFSETTING(    0x01, DEF_STR( On ) )
170
171   PORT_START( "GROMENA" )
172   PORT_CONFNAME( 0x01, 0x01, "Console GROMs" )
173      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
174      PORT_CONFSETTING(    0x01, DEF_STR( On ) )
175
176166   PORT_START( "MECMOUSE" )
177167   PORT_CONFNAME( 0x01, 0x00, "Mechatronics Mouse" )
178168      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
179169      PORT_CONFSETTING(    0x01, DEF_STR( On ) )
180/*
181    // We do not want to show this setting; makes only sense for Geneve
182    PORT_START( "MODE" )
183    PORT_CONFNAME( 0x01, 0x00, "Ext. cards modification" ) PORT_CONDITION( "HFDCDIP", 0x0f, EQUALS, GM_NEVER )
184        PORT_CONFSETTING(    0x00, "Standard" )
185        PORT_CONFSETTING(    GENMOD, "GenMod" )
186*/
187170
188   /* 3 ports for mouse */
189   PORT_START("MOUSEX") /* Mouse - X AXIS */
190      PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
191
192   PORT_START("MOUSEY") /* Mouse - Y AXIS */
193      PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
194
195   PORT_START("MOUSE0") /* Mouse - buttons */
196      PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button 1") PORT_PLAYER(1)
197      PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Mouse Button 2") PORT_PLAYER(1)
198
199
200171   /* 4 ports for keyboard and joystick */
201172   PORT_START("KEY0")   /* col 0 */
202173      PORT_BIT(0x0088, IP_ACTIVE_LOW, IPT_UNUSED)
r15093r15094
284255
285256static INPUT_PORTS_START(ti99_4)
286257
287   PORT_START( "RAM" )   /* config */
288   PORT_CONFNAME( 0x01, 0x09, "Console 32 KiB RAM upgrade (16 bit)" )
289      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
290      PORT_CONFSETTING(    0x01, DEF_STR( On ) )
291
292   PORT_START( "GROMENA" )
293   PORT_CONFNAME( 0x01, 0x01, "Console GROMs" )
294      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
295      PORT_CONFSETTING(    0x01, DEF_STR( On ) )
296
297258   PORT_START( "MECMOUSE" )
298259   PORT_CONFNAME( 0x01, 0x00, "Mechatronics Mouse" )
299260      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
r15093r15094
304265      PORT_CONFSETTING(    0x00, DEF_STR( Off ) )
305266      PORT_CONFSETTING(    0x01, DEF_STR( On ) )
306267
307   /* 3 ports for mouse */
308   PORT_START("MOUSEX") /* Mouse - X AXIS */
309      PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
310
311   PORT_START("MOUSEY") /* Mouse - Y AXIS */
312      PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
313
314   PORT_START("MOUSE0") /* Mouse - buttons */
315      PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button 1") PORT_PLAYER(1)
316      PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Mouse Button 2") PORT_PLAYER(1)
317
318268   /* 4 ports for keyboard and joystick */
319269   PORT_START("KEY0")   /* col 0 */
320270      PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 !") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')

Previous 15994 Revisions Next


© 1998-2018 The MESS Team