Previous 199869 Revisions Next

r19142 Sunday 25th November, 2012 at 22:53:23 UTC by R. Belmont
esq5505: More documentation and trying to figure out the panel buttons (nw)
[src/mess/drivers]esq5505.c

trunk/src/mess/drivers/esq5505.c
r19141r19142
2727    68681 uses custom vector 0x40 (address 0x100)
2828    5505 interrupts are on normal autovector IRQ 1
2929
30    68681 GPIO lines (from VFX schematics):
31    I0: CARTIN (if cartridge is present)
32 
33    O0: "AN0"
34    O1: "AN1"
35    O2: "AN2" (disk side select on EPS/EPS-16)
36    O6: To ESPHALT pin on ES5510
37    O7: "SACK"
38 
3930    VFX / VFX-SD / SD-1 / SD-1 32 panel button codes:
4031   2 = PROG-CNTL
4132   3 = WRITE EDIT PROGRAM
r19141r19142
5647    19 = ?
5748    20 = MASTER
5849    21 = STORAGE
59    22 = ?
60    23 = ?
50    22 = ERROR 129 (VFX-SD w/Seq. loaded)
51    23 = ERROR 129 (VFX-SD w/Seq. loaded)
6152   24 = MIDI
62   25 = INT9
53   25 = BUTTON 9
6354   26 = PSEL
6455   27 = STAT
6556   28 = EFFECT
66   29 = INT9
57   29 =
6758   30 = TRAX
6859    31 = TRAX (page 2)
6960    32 = ERROR 20 (VFX) / CLICK-REC
7061    33 = ERROR 20 (VFX) / LOCATE
71   34 = INT8
72   35 = INT7
73   36 = VOL
62   34 = BUTTON 8
63   35 = BUTTON 7
64   36 = VOLUME
7465   37 = PAN
75   38 = TIMB
76   39 = ZONE
77   40 = XPOS
78    41 = RELS
66   38 = TIMBRE
67   39 = KEY ZONE
68   40 = TRANSPOSE
69    41 = RELEASE
7970    42 = SOFT TOP CENTER
8071    43 = SOFT TOP RIGHT
8172    44 = SOFT BOTTOM CENTER
8273    45 = SOFT BOTTOM RIGHT
83    46 = INT3
84    47 = INT4
85    48 = INT5
86    49 = INT6
74    46 = BUTTON 3
75    47 = BUTTON 4
76    48 = BUTTON 5
77    49 = BUTTON 6
8778    50 = SOFT BOTTOM LEFT
88    51 = ERROR 20 (VFX) / SEQ0 $SONG-00
89    52 = BANK? (toggles INTx, RM0x, RM1x)
90    53 = INT0
91    54 = PSET
92    55 = RM10
93    56 = RM11
94    57 = RM12
79    51 = ERROR 202 (VFX) / SEQ0 $SONG-00
80    52 = CART
81    53 = SOUNDS
82    54 = PRESETS
83    55 = BUTTON 0
84    56 = BUTTON 1
85    57 = BUTTON 2
9586    58 = SOFT TOP LEFT
9687    59 = ERROR 20 (VFX) / EDIT SEQUENCE
97    60 = ERROR 20 (VFX) / SONG NOT SELECTED
88    60 = ERROR 20 (VFX) / EDIT SONG
9889    61 = ERROR 20 (VFX) / EDIT TRACK
9990    62 = DATA INCREMENT
10091    63 = DATA DECREMENT
r19141r19142
119110#define SQ1     (2)
120111
121112#define KEYBOARD_HACK (1)   // turn on to play the SQ-1, SD-1, and SD-1 32-voice: Z and X are program up/down, A/S/D/F/G/H/J/K/L and Q/W/E/R/T/Y/U play notes
122#define HACK_VIA_MIDI   (1)
113#define HACK_VIA_MIDI   (0)
123114
124115#if KEYBOARD_HACK
125116#if HACK_VIA_MIDI
126117static int program = 0;
118#else
119static int shift = 32;
127120#endif
128121#endif
129122
r19141r19142
396389
397390static UINT8 duart_input(device_t *device)
398391{
399    esq5505_state *state = device->machine().driver_data<esq5505_state>();
392   floppy_connector *con = device->machine().device<floppy_connector>("wd1772:0");
393   floppy_image_device *floppy = con ? con->get_device() : 0;
394   UINT8 result = 0;   // DUART input lines are separate from the output lines
400395
401    return state->m_duart_io;
396   // on VFX, bit 0 is 1 for 'cartridge present'.
397   // on VFX-SD and later, bit 0 is 1 for floppy present, bit 1 is 1 for cartridge present
398   if (mame_stricmp(device->machine().system().name, "vfx") == 0)
399   {
400      // todo: handle VFX cart-in when we support cartridges
401   }
402   else
403   {
404      if (floppy)
405      {
406         // ready_r returns true if the drive is *not* ready, false if it is
407//         if (!floppy->ready_r())
408         {
409            result |= 1;
410         }
411      }
412   }
413
414    return result;
402415}
403416
404417static void duart_output(device_t *device, UINT8 data)
r19141r19142
410423    state->m_duart_io = data;
411424
412425   /*
413      ESP:
426       EPS:
427       bit 2 = SSEL
414428   
415429       VFX:
416430       bits 0/1/2 = analog sel
417431       bit 6 = ESPHALT
418432       bit 7 = SACK (?)
419433   
420       SD-1 32:
434       VFX-SD & SD-1 (32):
421435       bits 0/1/2 = analog sel
422436       bit 3 = SSEL (disk side)
423437       bit 4 = DSEL (drive select?)
r19141r19142
582596    }
583597    #else
584598   int val = (UINT8)(FPTR)param;
585   val += 32;
586   if (oldval == 0 && newval == 1)
587    {
588        printf("key pressed %d\n", val&0x7f);
589        duart68681_rx_data(m_duart, 1, val);
590        duart68681_rx_data(m_duart, 1, 0x00);
591    }
592    else if (oldval == 1 && newval == 0)
593    {
594//        printf("key off %x\n", (UINT8)(FPTR)param);
595        duart68681_rx_data(m_duart, 1, val&0x7f);
596        duart68681_rx_data(m_duart, 1, 0x00);
597    }
599
600   if (val < 0x60)
601   {
602      if (oldval == 0 && newval == 1)
603      {
604         if (val == 0 && shift > 0)
605         {
606            shift -= 32;
607            printf("New shift %d\n", shift);
608         }
609         else if (val == 1 && shift < 32)
610         {
611            shift += 32;
612            printf("New shift %d\n", shift);
613         }
614      }
615   }
616   else
617   {
618      val += shift;
619      if (oldval == 0 && newval == 1)
620      {
621         printf("key pressed %d\n", val-0x60);
622         duart68681_rx_data(m_duart, 1, val);
623         duart68681_rx_data(m_duart, 1, 0x00);
624      }
625      else if (oldval == 1 && newval == 0)
626      {
627   //        printf("key off %x\n", (UINT8)(FPTR)param);
628         duart68681_rx_data(m_duart, 1, val-0x60);
629         duart68681_rx_data(m_duart, 1, 0x00);
630      }
631   }
598632    #endif
599633}
600634#endif
r19141r19142
738772    PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 0x9d)
739773    PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 0x9e)
740774    PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 0x9f)
775
776    PORT_START("KEY2")
777    PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 0)
778    PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHANGED_MEMBER(DEVICE_SELF, esq5505_state, key_stroke, 1)
741779#endif
742780#endif
743781INPUT_PORTS_END

Previous 199869 Revisions Next


© 1997-2024 The MAME Team