Previous 15994 Revisions Next

r857 Tuesday 21st August, 2007 at 07:27:05 UTC by Curt Coder
[ATARIST] Cleanups
[docs]messnew.txt
[src/mess/drivers]atarist.c

src/mess/drivers/atarist.c
r856r857
2323
2424   - proper UK TOS roms
2525   - save state support
26   - serial communications for the HD63701 cpu
27   - US keyboard layout for the special keys
26   - rewrite HD6301 cpu core for serial I/O
27   - UK keyboard layout for the special keys
2828   - accurate screen timing
2929   - memory shadow for boot memory check
30   - STe DMA sound and LMC1992/Microwire mixer
30   - floppy DMA transfer timer
31   - STe DMA sound and LMC1992 Microwire mixer
3132   - Mega STe 8/16 MHz switch
3233   - Mega STe MC68881 FPU
3334   - Mega STe SCC8530 interface
r856r857
5152
5253#define ATARIST_FLOPPY_BYTES_PER_SECTOR         512
5354
54struct FDC
55static struct FDC
5556{
5657   UINT32 dmabase;
5758   UINT16 status, mode;
r856r857
236237
237238/* IKBD */
238239
239static UINT8 acia_ikbd_rx, acia_ikbd_tx;
240static UINT8 ikbd_keylatch;
241static UINT8 ikbd_mouse_x0, ikbd_mouse_y0;
242static UINT8 ikbd_mouse_x_phase, ikbd_mouse_y_phase, ikbd_mouse_phase_counter;
240static struct IKBD
241{
242   UINT8 keylatch;
243   UINT8 mouse_x, mouse_y;
244   UINT8 mouse_px, mouse_py, mouse_pc;
245   UINT8 rx, tx;
246} ikbd;
243247
244248static const int IKBD_MOUSE_XYA[3][4] = { { 0, 0, 0, 0 }, { 1, 1, 0, 0 }, { 0, 1, 1, 0 } };
245249static const int IKBD_MOUSE_XYB[3][4] = { { 0, 0, 0, 0 }, { 0, 1, 1, 0 }, { 1, 1, 0, 0 } };
r856r857
253257
254258static READ8_HANDLER( ikbd_port1_r )
255259{
256   return ikbd_keylatch;
260   /*
261     
262      bit      description
263     
264      0      Keyboard column input
265      1      Keyboard column input
266      2      Keyboard column input
267      3      Keyboard column input
268      4      Keyboard column input
269      5      Keyboard column input
270      6      Keyboard column input
271      7      Keyboard column input
272
273   */
274
275   return ikbd.keylatch;
257276}
258277
259278static READ8_HANDLER( ikbd_port2_r )
r856r857
270289
271290   */
272291
273   return (acia_ikbd_tx << 3) | (readinputportbytag("JOY1") & 0x06);
292   return (ikbd.tx << 3) | (readinputportbytag_safe("IKBD_JOY1", 0xff) & 0x06);
274293}
275294
276295static WRITE8_HANDLER( ikbd_port2_w )
r856r857
287306
288307   */
289308
290   acia_ikbd_rx = (data & 0x10) >> 4;
309   ikbd.rx = (data & 0x10) >> 4;
291310}
292311
293312static WRITE8_HANDLER( ikbd_port3_w )
r856r857
309328
310329   set_led_status(1, data & 0x01);
311330
312   if (~data & 0x02) ikbd_keylatch = readinputportbytag("P31");
313   if (~data & 0x04) ikbd_keylatch = readinputportbytag("P32");
314   if (~data & 0x08) ikbd_keylatch = readinputportbytag("P33");
315   if (~data & 0x10) ikbd_keylatch = readinputportbytag("P34");
316   if (~data & 0x20) ikbd_keylatch = readinputportbytag("P35");
317   if (~data & 0x40) ikbd_keylatch = readinputportbytag("P36");
318   if (~data & 0x80) ikbd_keylatch = readinputportbytag("P37");
331   if (~data & 0x02) ikbd.keylatch = readinputportbytag("P31");
332   if (~data & 0x04) ikbd.keylatch = readinputportbytag("P32");
333   if (~data & 0x08) ikbd.keylatch = readinputportbytag("P33");
334   if (~data & 0x10) ikbd.keylatch = readinputportbytag("P34");
335   if (~data & 0x20) ikbd.keylatch = readinputportbytag("P35");
336   if (~data & 0x40) ikbd.keylatch = readinputportbytag("P36");
337   if (~data & 0x80) ikbd.keylatch = readinputportbytag("P37");
319338}
320339
321340static READ8_HANDLER( ikbd_port4_r )
322341{
342   /*
343     
344      bit      description
345     
346      0      JOY 0-1 or mouse XB
347      1      JOY 0-2 or mouse XA
348      2      JOY 0-3 or mouse YA
349      3      JOY 0-4 or mouse YB
350      4      JOY 1-1
351      5      JOY 1-2
352      6      JOY 1-3
353      7      JOY 1-4
354
355   */
356
323357   if (readinputportbytag("config") & 0x01)
324358   {
325359      /*
r856r857
331365
332366      */
333367
334      UINT8 data = readinputportbytag("JOY0") & 0xf0;
335      UINT8 x = readinputportbytag("MOUSEX");
336      UINT8 y = readinputportbytag("MOUSEY");
368      UINT8 data = readinputportbytag_safe("IKBD_JOY0", 0xff) & 0xf0;
369      UINT8 x = readinputportbytag_safe("IKBD_MOUSEX", 0x00);
370      UINT8 y = readinputportbytag_safe("IKBD_MOUSEY", 0x00);
337371
338      if (x == ikbd_mouse_x0)
372      if (x == ikbd.mouse_x)
339373      {
340         ikbd_mouse_x_phase = IKBD_MOUSE_PHASE_STATIC;
374         ikbd.mouse_px = IKBD_MOUSE_PHASE_STATIC;
341375      }
342      else if (x > ikbd_mouse_x0)
376      else if (x > ikbd.mouse_x)
343377      {
344         ikbd_mouse_x_phase = IKBD_MOUSE_PHASE_POSITIVE;
378         ikbd.mouse_px = IKBD_MOUSE_PHASE_POSITIVE;
345379      }
346      else if (x < ikbd_mouse_x0)
380      else if (x < ikbd.mouse_x)
347381      {
348         ikbd_mouse_x_phase = IKBD_MOUSE_PHASE_NEGATIVE;
382         ikbd.mouse_px = IKBD_MOUSE_PHASE_NEGATIVE;
349383      }
350384     
351      if (y == ikbd_mouse_y0)
385      if (y == ikbd.mouse_y)
352386      {
353         ikbd_mouse_y_phase = IKBD_MOUSE_PHASE_STATIC;
387         ikbd.mouse_py = IKBD_MOUSE_PHASE_STATIC;
354388      }
355      else if (y > ikbd_mouse_y0)
389      else if (y > ikbd.mouse_y)
356390      {
357         ikbd_mouse_y_phase = IKBD_MOUSE_PHASE_POSITIVE;
391         ikbd.mouse_py = IKBD_MOUSE_PHASE_POSITIVE;
358392      }
359      else if (y < ikbd_mouse_y0)
393      else if (y < ikbd.mouse_y)
360394      {
361         ikbd_mouse_y_phase = IKBD_MOUSE_PHASE_NEGATIVE;
395         ikbd.mouse_py = IKBD_MOUSE_PHASE_NEGATIVE;
362396      }
363397
364      data |= IKBD_MOUSE_XYB[ikbd_mouse_x_phase][ikbd_mouse_phase_counter]; // XB
365      data |= IKBD_MOUSE_XYA[ikbd_mouse_x_phase][ikbd_mouse_phase_counter] << 1; // XA
366      data |= IKBD_MOUSE_XYA[ikbd_mouse_y_phase][ikbd_mouse_phase_counter] << 2; // YA
367      data |= IKBD_MOUSE_XYB[ikbd_mouse_y_phase][ikbd_mouse_phase_counter] << 3; // YB
398      data |= IKBD_MOUSE_XYB[ikbd.mouse_px][ikbd.mouse_pc];      // XB
399      data |= IKBD_MOUSE_XYA[ikbd.mouse_px][ikbd.mouse_pc] << 1; // XA
400      data |= IKBD_MOUSE_XYA[ikbd.mouse_py][ikbd.mouse_pc] << 2; // YA
401      data |= IKBD_MOUSE_XYB[ikbd.mouse_py][ikbd.mouse_pc] << 3; // YB
368402
369      ikbd_mouse_phase_counter++;
403      ikbd.mouse_pc++;
370404
371      if (ikbd_mouse_phase_counter == 4)
405      if (ikbd.mouse_pc == 4)
372406      {
373         ikbd_mouse_phase_counter = 0;
407         ikbd.mouse_pc = 0;
374408      }
375409
376      ikbd_mouse_x0 = x;
377      ikbd_mouse_y0 = y;
410      ikbd.mouse_x = x;
411      ikbd.mouse_y = y;
378412
379413      return data;
380414   }
381415   else
382416   {
383      return readinputportbytag("JOY0");
417      return readinputportbytag_safe("IKBD_JOY0", 0xff);
384418   }
385419}
386420
r856r857
390424     
391425      bit      description
392426     
393      0      JOY 0-1 or mouse XB or keyboard row input
394      1      JOY 0-2 or mouse XA or keyboard row input
395      2      JOY 0-3 or mouse YA or keyboard row input
396      3      JOY 0-4 or mouse YB or keyboard row input
397      4      JOY 1-1 or keyboard row input
398      5      JOY 1-2 or keyboard row input
399      6      JOY 1-3 or keyboard row input
400      7      JOY 1-4 or keyboard row input
427      0      Keyboard row select
428      1      Keyboard row select
429      2      Keyboard row select
430      3      Keyboard row select
431      4      Keyboard row select
432      5      Keyboard row select
433      6      Keyboard row select
434      7      Keyboard row select
401435
402436   */
403437
404   if (~data & 0x01) ikbd_keylatch = readinputportbytag("P40");
405   if (~data & 0x02) ikbd_keylatch = readinputportbytag("P41");
406   if (~data & 0x04) ikbd_keylatch = readinputportbytag("P42");
407   if (~data & 0x08) ikbd_keylatch = readinputportbytag("P43");
408   if (~data & 0x10) ikbd_keylatch = readinputportbytag("P44");
409   if (~data & 0x20) ikbd_keylatch = readinputportbytag("P45");
410   if (~data & 0x40) ikbd_keylatch = readinputportbytag("P46");
411   if (~data & 0x80) ikbd_keylatch = readinputportbytag("P47");
438   if (~data & 0x01) ikbd.keylatch = readinputportbytag("P40");
439   if (~data & 0x02) ikbd.keylatch = readinputportbytag("P41");
440   if (~data & 0x04) ikbd.keylatch = readinputportbytag("P42");
441   if (~data & 0x08) ikbd.keylatch = readinputportbytag("P43");
442   if (~data & 0x10) ikbd.keylatch = readinputportbytag("P44");
443   if (~data & 0x20) ikbd.keylatch = readinputportbytag("P45");
444   if (~data & 0x40) ikbd.keylatch = readinputportbytag("P46");
445   if (~data & 0x80) ikbd.keylatch = readinputportbytag("P47");
412446}
413447
414448/* Memory Maps */
r856r857
691725   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad +") PORT_CODE(KEYCODE_PLUS_PAD)
692726   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 3") PORT_CODE(KEYCODE_3_PAD)
693727   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad Enter") PORT_CODE(KEYCODE_ENTER_PAD)
728INPUT_PORTS_END
694729
695   PORT_START_TAG("JOY0")
730INPUT_PORTS_START( atarist )
731   PORT_START_TAG("config")
732   PORT_CONFNAME( 0x01, 0x00, "Input Port 0 Device")
733   PORT_CONFSETTING( 0x00, "Mouse" )
734   PORT_CONFSETTING( 0x01, DEF_STR( Joystick ) )
735   PORT_CONFNAME( 0x80, 0x80, "Monitor")
736   PORT_CONFSETTING( 0x00, "Monochrome" )
737   PORT_CONFSETTING( 0x80, "Color" )
738
739   PORT_INCLUDE( ikbd )
740
741   PORT_START_TAG("IKBD_JOY0")
696742   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )    PORT_PLAYER(1) PORT_8WAY // XB
697743   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )  PORT_PLAYER(1) PORT_8WAY // XA
698744   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_PLAYER(1) PORT_8WAY // YA
r856r857
702748   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )  PORT_PLAYER(2) PORT_8WAY
703749   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY
704750
705   PORT_START_TAG("JOY1")
751   PORT_START_TAG("IKBD_JOY1")
706752   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
707753   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
708754   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
709755
710   PORT_START_TAG("MOUSEX")
756   PORT_START_TAG("IKBD_MOUSEX")
711757   PORT_BIT( 0xff, 0x00, IPT_MOUSE_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1)   
712758
713   PORT_START_TAG("MOUSEY")
759   PORT_START_TAG("IKBD_MOUSEY")
714760   PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(5) PORT_MINMAX(0, 255) PORT_PLAYER(1)   
715761INPUT_PORTS_END
716762
717INPUT_PORTS_START( atarist )
763INPUT_PORTS_START( atariste )
718764   PORT_START_TAG("config")
719765   PORT_CONFNAME( 0x01, 0x00, "Input Port 0 Device")
720766   PORT_CONFSETTING( 0x00, "Mouse" )
r856r857
724770   PORT_CONFSETTING( 0x80, "Color" )
725771
726772   PORT_INCLUDE( ikbd )
727INPUT_PORTS_END
728773
729INPUT_PORTS_START( atariste )
730   PORT_INCLUDE( atarist )
731
732774   PORT_START_TAG("JOY0E")
733775   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
734776   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
r856r857
824866{
825867   500000,
826868   500000,
827   &acia_ikbd_rx,
828   &acia_ikbd_tx,
869   &ikbd.rx,
870   &ikbd.tx,
829871   acia_interrupt
830872};
831873
r856r857
10071049MACHINE_DRIVER_END
10081050
10091051static MACHINE_DRIVER_START( atariste )
1010   MDRV_IMPORT_FROM(atarist)
1011
1012   MDRV_CPU_MODIFY("main")
1052   // basic machine hardware
1053   MDRV_CPU_ADD_TAG("main", M68000, Y2/4)
10131054   MDRV_CPU_PROGRAM_MAP(ste_map, 0)
10141055
1056   MDRV_CPU_ADD(HD63701, 1000000) // HD6301, really clocked at 4MHz but CPU core doesn't divide it properly
1057   MDRV_CPU_PROGRAM_MAP(ikbd_map, 0)
1058   MDRV_CPU_IO_MAP(ikbd_io_map, 0)
1059
1060   MDRV_MACHINE_START(atariste)
1061
1062   // video hardware
1063   MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
1064   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
10151065   MDRV_PALETTE_LENGTH(512)
1016   // stereo sound
1066   MDRV_VIDEO_START( atarist )
1067   MDRV_VIDEO_UPDATE( atarist )
10171068
1018   MDRV_MACHINE_START(atariste)
1069   MDRV_SCREEN_ADD("main", 0)
1070   MDRV_SCREEN_RAW_PARAMS(Y2/4, ATARIST_HTOT_PAL, ATARIST_HBEND_PAL, ATARIST_HBSTART_PAL, ATARIST_VTOT_PAL, ATARIST_VBEND_PAL, ATARIST_VBSTART_PAL)
1071
1072   // sound hardware
1073   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
1074
1075   MDRV_SOUND_ADD(YM2149, Y2/16)
1076   MDRV_SOUND_CONFIG(ym2149_interface)
1077   MDRV_SOUND_ROUTE(0, "left", 0.50)
1078   MDRV_SOUND_ROUTE(0, "right", 0.50)
1079/*
1080   MDRV_SOUND_ADD(CUSTOM, 0) // DAC
1081   MDRV_SOUND_ROUTE(0, "right", 0.50)
1082   MDRV_SOUND_ROUTE(1, "left", 0.50)
1083*/
10191084MACHINE_DRIVER_END
10201085
10211086static MACHINE_DRIVER_START( megaste )
docs/messnew.txt
r856r857
33New System Drivers Supported (in no particular order):
44------------------------------------------------------
55- Cybiko [Tim Schuerewegen]
6- Atari STe (not working) [Curt Coder]
7- Atari Mega STe (not working) [Curt Coder]
68
79
810

Previous 15994 Revisions Next


© 1998-2018 The MESS Team