trunk/src/mess/layout/fb01.lay
| r0 | r30948 | |
| 1 | <mamelayout version="2"> |
| 2 | <element name="system"> |
| 3 | <text string="System"> |
| 4 | <color red="1.0" green="1.0" blue="1.0" /> |
| 5 | </text> |
| 6 | </element> |
| 7 | |
| 8 | <element name="setup"> |
| 9 | <text string="Setup"> |
| 10 | <color red="1.0" green="1.0" blue="1.0" /> |
| 11 | </text> |
| 12 | </element> |
| 13 | |
| 14 | <element name="inst"> |
| 15 | <text string="Inst"> |
| 16 | <color red="1.0" green="1.0" blue="1.0" /> |
| 17 | </text> |
| 18 | </element> |
| 19 | |
| 20 | <element name="select"> |
| 21 | <text string="Select"> |
| 22 | <color red="1.0" green="1.0" blue="1.0" /> |
| 23 | </text> |
| 24 | </element> |
| 25 | |
| 26 | <element name="assign"> |
| 27 | <text string="Assign"> |
| 28 | <color red="1.0" green="1.0" blue="1.0" /> |
| 29 | </text> |
| 30 | </element> |
| 31 | |
| 32 | <element name="function"> |
| 33 | <text string="Function"> |
| 34 | <color red="1.0" green="1.0" blue="1.0" /> |
| 35 | </text> |
| 36 | </element> |
| 37 | |
| 38 | <element name="data_entry"> |
| 39 | <text string="Data Entry"> |
| 40 | <color red="1.0" green="1.0" blue="1.0" /> |
| 41 | </text> |
| 42 | </element> |
| 43 | |
| 44 | <element name="voice"> |
| 45 | <text string="Voice"> |
| 46 | <color red="1.0" green="1.0" blue="1.0" /> |
| 47 | </text> |
| 48 | </element> |
| 49 | |
| 50 | <element name="no"> |
| 51 | <text string="-1/No"> |
| 52 | <color red="1.0" green="1.0" blue="1.0" /> |
| 53 | </text> |
| 54 | </element> |
| 55 | |
| 56 | <element name="yes"> |
| 57 | <text string="+1/Yes"> |
| 58 | <color red="1.0" green="1.0" blue="1.0" /> |
| 59 | </text> |
| 60 | </element> |
| 61 | |
| 62 | <element name="button" defstate="0"> |
| 63 | <rect> |
| 64 | <bounds x="2" y="2" width="48" height="48"/> |
| 65 | <color red="0.1" green="0.1" blue="0.1" /> |
| 66 | </rect> |
| 67 | <rect state="0"> |
| 68 | <bounds x="0" y="0" width="48" height="48"/> |
| 69 | <color red="0.25" green="0.25" blue="0.25" /> |
| 70 | </rect> |
| 71 | <rect state="1"> |
| 72 | <bounds x="2" y="2" width="48" height="48"/> |
| 73 | <color red="0.25" green="0.25" blue="0.25" /> |
| 74 | </rect> |
| 75 | </element> |
| 76 | |
| 77 | <!-- |
| 78 | System Inst Data Entry Data Entry |
| 79 | Setup Select -1/No +1/Yes |
| 80 | |
| 81 | Inst Inst Voice Voice |
| 82 | Assign Function Function Select |
| 83 | |
| 84 | --> |
| 85 | |
| 86 | <!-- |
| 87 | <element name="" defstate="0"> |
| 88 | <text string="" state="0" |
| 89 | <text string="" state="1"> |
| 90 | </text> |
| 91 | </element> |
| 92 | --> |
| 93 | |
| 94 | <view name="View"> |
| 95 | <screen index="0"> |
| 96 | <bounds x="30" y="32" width="108" height="8" /> |
| 97 | </screen> |
| 98 | |
| 99 | <bezel name="system_setup_1" element="system"> |
| 100 | <bounds left="200" right="249" top="0" bottom="15" /> |
| 101 | </bezel> |
| 102 | <bezel name="system_setup_2" element="setup"> |
| 103 | <bounds left="200" right="249" top="16" bottom="31" /> |
| 104 | </bezel> |
| 105 | <bezel element="button" inputtag="PANEL" inputmask="0x01"> |
| 106 | <bounds x="203" y="34" width="45" height="28" /> |
| 107 | </bezel> |
| 108 | |
| 109 | <bezel name="inst_select_1" element="inst"> |
| 110 | <bounds left="250" right="299" top="0" bottom="15" /> |
| 111 | </bezel> |
| 112 | <bezel name="inst_select_2" element="select"> |
| 113 | <bounds left="250" right="299" top="16" bottom="31" /> |
| 114 | </bezel> |
| 115 | <bezel element="button" inputtag="PANEL" inputmask="0x02"> |
| 116 | <bounds x="253" y="34" width="45" height="28" /> |
| 117 | </bezel> |
| 118 | |
| 119 | <bezel name="data_entry_no_1" element="data_entry"> |
| 120 | <bounds left="300" right="349" top="0" bottom="15" /> |
| 121 | </bezel> |
| 122 | <bezel name="data_entry_no_2" element="no"> |
| 123 | <bounds left="300" right="349" top="16" bottom="31" /> |
| 124 | </bezel> |
| 125 | <bezel element="button" inputtag="PANEL" inputmask="0x40"> |
| 126 | <bounds x="303" y="34" width="45" height="28" /> |
| 127 | </bezel> |
| 128 | |
| 129 | <bezel nmae="data_entry_yes_1" element="data_entry"> |
| 130 | <bounds left="350" right="399" top="0" bottom="15" /> |
| 131 | </bezel> |
| 132 | <bezel name="data_entry_yes_2" element="yes"> |
| 133 | <bounds left="350" right="399" top="16" bottom="31" /> |
| 134 | </bezel> |
| 135 | <bezel element="button" inputtag="PANEL" inputmask="0x80"> |
| 136 | <bounds x="353" y="34" width="45" height="28" /> |
| 137 | </bezel> |
| 138 | |
| 139 | |
| 140 | <bezel name="inst_assign_1" element="inst"> |
| 141 | <bounds left="200" right="249" top="64" bottom="79" /> |
| 142 | </bezel> |
| 143 | <bezel name="inst_assign_2" element="assign"> |
| 144 | <bounds left="200" right="249" top="80" bottom="95" /> |
| 145 | </bezel> |
| 146 | <bezel element="button" inputtag="PANEL" inputmask="0x04"> |
| 147 | <bounds x="203" y="98" width="45" height="28" /> |
| 148 | </bezel> |
| 149 | |
| 150 | <bezel name="inst_function_1" element="inst"> |
| 151 | <bounds left="250" right="299" top="64" bottom="79" /> |
| 152 | </bezel> |
| 153 | <bezel name="inst_function_2" element="function"> |
| 154 | <bounds left="250" right="299" top="80" bottom="95" /> |
| 155 | </bezel> |
| 156 | <bezel element="button" inputtag="PANEL" inputmask="0x08"> |
| 157 | <bounds x="253" y="98" width="45" height="28" /> |
| 158 | </bezel> |
| 159 | |
| 160 | <bezel name="voice_function_1" element="voice"> |
| 161 | <bounds left="300" right="349" top="64" bottom="79" /> |
| 162 | </bezel> |
| 163 | <bezel name="voice_function_2" element="function"> |
| 164 | <bounds left="300" right="349" top="80" bottom="95" /> |
| 165 | </bezel> |
| 166 | <bezel element="button" inputtag="PANEL" inputmask="0x10"> |
| 167 | <bounds x="303" y="98" width="45" height="28" /> |
| 168 | </bezel> |
| 169 | |
| 170 | <bezel name="voice_select_1" element="voice"> |
| 171 | <bounds left="350" right="399" top="64" bottom="79" /> |
| 172 | </bezel> |
| 173 | <bezel name="voice_select_2" element="select"> |
| 174 | <bounds left="350" right="399" top="80" bottom="95" /> |
| 175 | </bezel> |
| 176 | <bezel element="button" inputtag="PANEL" inputmask="0x20"> |
| 177 | <bounds x="353" y="98" width="45" height="28" /> |
| 178 | </bezel> |
| 179 | </view> |
| 180 | </mamelayout> |
trunk/src/mess/drivers/fb01.c
| r0 | r30948 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Yamaha FB-01 |
| 4 | |
| 5 | ***************************************************************************/ |
| 6 | |
| 7 | #include "emu.h" |
| 8 | #include "cpu/z80/z80.h" |
| 9 | #include "sound/2151intf.h" |
| 10 | #include "machine/nvram.h" |
| 11 | #include "video/hd44780.h" |
| 12 | #include "machine/i8251.h" |
| 13 | #include "machine/clock.h" |
| 14 | #include "bus/midi/midi.h" |
| 15 | #include "fb01.lh" |
| 16 | |
| 17 | |
| 18 | class fb01_state : public driver_device |
| 19 | { |
| 20 | public: |
| 21 | fb01_state(const machine_config &mconfig, device_type type, const char *tag) |
| 22 | : driver_device(mconfig, type, tag) |
| 23 | , m_upd71051(*this, "upd71051") |
| 24 | , m_midi_thru(*this, "mdthru") |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | DECLARE_WRITE_LINE_MEMBER(write_usart_clock); |
| 29 | DECLARE_WRITE_LINE_MEMBER(midi_in); |
| 30 | |
| 31 | private: |
| 32 | required_device<i8251_device> m_upd71051; |
| 33 | required_device<midi_port_device> m_midi_thru; |
| 34 | }; |
| 35 | |
| 36 | |
| 37 | static ADDRESS_MAP_START(fb01_mem, AS_PROGRAM, 8, fb01_state) |
| 38 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 39 | AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("nvram") // 2 * 8KB S-RAM |
| 40 | ADDRESS_MAP_END |
| 41 | |
| 42 | |
| 43 | static ADDRESS_MAP_START(fb01_io, AS_IO, 8, fb01_state) |
| 44 | ADDRESS_MAP_UNMAP_HIGH |
| 45 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 46 | // 00-01 YM2164 |
| 47 | AM_RANGE(0x00, 0x00) AM_DEVWRITE("ym2164", ym2151_device, register_w) |
| 48 | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("ym2164", ym2151_device, status_r, data_w) |
| 49 | |
| 50 | // 10-11 USART uPD71051C 4MHz & 4MHz / 8 |
| 51 | AM_RANGE(0x10, 0x10) AM_DEVREADWRITE("upd71051", i8251_device, data_r, data_w) |
| 52 | AM_RANGE(0x11, 0x11) AM_DEVREADWRITE("upd71051", i8251_device, status_r, control_w) |
| 53 | |
| 54 | // 20 PANEL SWITCH |
| 55 | AM_RANGE(0x20, 0x20) AM_READ_PORT("PANEL") |
| 56 | |
| 57 | // 30-31 HD44780A |
| 58 | AM_RANGE(0x30, 0x30) AM_DEVREADWRITE("hd44780", hd44780_device, control_read, control_write) |
| 59 | AM_RANGE(0x31, 0x31) AM_DEVREADWRITE("hd44780", hd44780_device, data_read, data_write) |
| 60 | ADDRESS_MAP_END |
| 61 | |
| 62 | |
| 63 | static INPUT_PORTS_START( fb01 ) |
| 64 | PORT_START("PANEL") |
| 65 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("System Set Up") |
| 66 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Inst Select") |
| 67 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Inst Assign") |
| 68 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Inst Function") |
| 69 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Voice Function") |
| 70 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Voice Select") |
| 71 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("-1/No") |
| 72 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("+1/Yes") |
| 73 | INPUT_PORTS_END |
| 74 | |
| 75 | |
| 76 | WRITE_LINE_MEMBER(fb01_state::write_usart_clock) |
| 77 | { |
| 78 | m_upd71051->write_txc(state); |
| 79 | m_upd71051->write_rxc(state); |
| 80 | } |
| 81 | |
| 82 | |
| 83 | WRITE_LINE_MEMBER(fb01_state::midi_in) |
| 84 | { |
| 85 | m_midi_thru->write_txd(state); |
| 86 | m_upd71051->write_rxd(state); |
| 87 | } |
| 88 | |
| 89 | |
| 90 | static HD44780_PIXEL_UPDATE(fb01_pixel_update) |
| 91 | { |
| 92 | if ( pos < 8 && line < 2 ) |
| 93 | { |
| 94 | bitmap.pix16(y, line*6*8 + pos*6 + x) = state; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | |
| 99 | static MACHINE_CONFIG_START( fb01, fb01_state ) |
| 100 | /* basic machine hardware */ |
| 101 | MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) |
| 102 | MCFG_CPU_PROGRAM_MAP(fb01_mem) |
| 103 | MCFG_CPU_IO_MAP(fb01_io) |
| 104 | |
| 105 | /* video hardware */ |
| 106 | MCFG_SCREEN_ADD("screen", LCD) |
| 107 | MCFG_SCREEN_REFRESH_RATE(50) |
| 108 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 109 | MCFG_SCREEN_SIZE(6*16, 9) |
| 110 | MCFG_SCREEN_VISIBLE_AREA(0, 6*16-1, 0, 9-1) |
| 111 | MCFG_DEFAULT_LAYOUT(layout_lcd) |
| 112 | MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update) |
| 113 | MCFG_SCREEN_PALETTE("palette") |
| 114 | |
| 115 | MCFG_DEFAULT_LAYOUT( layout_fb01 ) |
| 116 | |
| 117 | MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") |
| 118 | |
| 119 | MCFG_HD44780_ADD("hd44780") |
| 120 | MCFG_HD44780_LCD_SIZE(2, 8) // 2x8 displayed as 1x16 |
| 121 | MCFG_HD44780_PIXEL_UPDATE_CB(fb01_pixel_update) |
| 122 | |
| 123 | MCFG_DEVICE_ADD("upd71051", I8251, XTAL_4MHz) |
| 124 | MCFG_I8251_RXRDY_HANDLER(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) MCFG_DEVCB_XOR(1) // inverted -> Z80 INT |
| 125 | MCFG_I8251_TXRDY_HANDLER(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) MCFG_DEVCB_XOR(1) // inverted -> Z80 INT |
| 126 | MCFG_I8251_TXD_HANDLER(DEVWRITELINE("mdout", midi_port_device, write_txd)) |
| 127 | |
| 128 | MCFG_DEVICE_ADD("usart_clock", CLOCK, XTAL_4MHz / 8) // 500KHz |
| 129 | MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(fb01_state, write_usart_clock)) |
| 130 | |
| 131 | MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin") |
| 132 | MCFG_MIDI_RX_HANDLER(WRITELINE(fb01_state, midi_in)) |
| 133 | |
| 134 | MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") |
| 135 | |
| 136 | MCFG_MIDI_PORT_ADD("mdthru", midiout_slot, "midiout") |
| 137 | |
| 138 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 139 | MCFG_YM2151_ADD("ym2164", XTAL_4MHz) |
| 140 | MCFG_YM2151_IRQ_HANDLER(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) |
| 141 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.00) |
| 142 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.00) |
| 143 | |
| 144 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 145 | MACHINE_CONFIG_END |
| 146 | |
| 147 | |
| 148 | /* ROM definition */ |
| 149 | ROM_START( fb01 ) |
| 150 | ROM_REGION( 0x8000, "maincpu", 0 ) |
| 151 | ROM_LOAD("fb01.ic11", 0, 0x8000, CRC(7357e9a4) SHA1(049c482d6c91b7e2846757dd0f5138e0d8b687f0)) |
| 152 | ROM_END |
| 153 | |
| 154 | |
| 155 | /* Driver */ |
| 156 | |
| 157 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 158 | CONS( 1986, fb01, 0, 0, fb01, fb01, driver_device, 0, "Yamaha", "FB-01", GAME_NOT_WORKING ) |
| 159 | |