trunk/src/mess/drivers/alesis.c
r17470 | r17471 | |
65 | 65 | m_cassette->output(data & 0x04 ? -1.0 : +1.0); |
66 | 66 | } |
67 | 67 | |
| 68 | WRITE8_MEMBER( alesis_state::sr16_lcd_w ) |
| 69 | { |
| 70 | if (m_kb_matrix & 0x80) |
| 71 | m_lcdc->data_write(space, offset, data); |
| 72 | else |
| 73 | m_lcdc->control_write(space, offset, data); |
| 74 | } |
| 75 | |
68 | 76 | static ADDRESS_MAP_START(hr16_mem, AS_PROGRAM, 8, alesis_state) |
69 | 77 | ADDRESS_MAP_UNMAP_HIGH |
70 | | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 78 | AM_RANGE(0x0000, 0x7fff) AM_MIRROR(0x8000) AM_ROM |
71 | 79 | ADDRESS_MAP_END |
72 | 80 | |
73 | 81 | static ADDRESS_MAP_START(hr16_io, AS_IO, 8, alesis_state) |
r17470 | r17471 | |
90 | 98 | ADDRESS_MAP_END |
91 | 99 | |
92 | 100 | static ADDRESS_MAP_START(sr16_io, AS_IO, 8, alesis_state) |
93 | | ADDRESS_MAP_UNMAP_HIGH |
| 101 | //ADDRESS_MAP_UNMAP_HIGH |
| 102 | AM_RANGE(0x0000, 0x0000) AM_MIRROR(0xff) AM_DEVWRITE("dm3ag", alesis_dm3ag_device, write) |
| 103 | AM_RANGE(0x0200, 0x0200) AM_MIRROR(0xff) AM_WRITE(sr16_lcd_w) |
| 104 | AM_RANGE(0x0300, 0x0300) AM_MIRROR(0xff) AM_WRITE(kb_matrix_w) |
| 105 | AM_RANGE(0x0400, 0x0400) AM_MIRROR(0xff) AM_READ(kb_r) |
| 106 | AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READNOP |
| 107 | AM_RANGE(MCS51_PORT_P2, MCS51_PORT_P2) AM_WRITENOP |
| 108 | AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_READWRITE(p3_r, p3_w) |
| 109 | AM_RANGE(0x8000, 0xffff) AM_RAM AM_SHARE("nvram") // 32Kx8 SRAM, (battery-backed) |
94 | 110 | ADDRESS_MAP_END |
95 | 111 | |
96 | 112 | /* Input ports */ |
97 | | static INPUT_PORTS_START( alesis ) |
| 113 | static INPUT_PORTS_START( hr16 ) |
98 | 114 | PORT_START("COL1") |
99 | 115 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("COPY") PORT_CODE(KEYCODE_C) |
100 | 116 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("OFFSET") PORT_CODE(KEYCODE_O) |
r17470 | r17471 | |
154 | 170 | PORT_BIT(0xff, 0x00, IPT_DIAL) PORT_NAME("SELECT Slider") PORT_SENSITIVITY(50) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_DOWN) PORT_CODE_INC(KEYCODE_UP) |
155 | 171 | INPUT_PORTS_END |
156 | 172 | |
| 173 | static INPUT_PORTS_START( sr16 ) |
| 174 | PORT_START("COL1") |
| 175 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PRESET/USER") PORT_CODE(KEYCODE_U) |
| 176 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PATTERN/SONG") PORT_CODE(KEYCODE_P) |
| 177 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| 178 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| 179 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) |
| 180 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) |
| 181 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) |
| 182 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TEMPO/PAGE UP") PORT_CODE(KEYCODE_UP) |
| 183 | PORT_START("COL2") |
| 184 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RECORD SETUP") PORT_CODE(KEYCODE_R) |
| 185 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DRUM SET") PORT_CODE(KEYCODE_D) |
| 186 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) |
| 187 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) |
| 188 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) |
| 189 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) |
| 190 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) |
| 191 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TEMPO/PAGE DOWN") PORT_CODE(KEYCODE_DOWN) |
| 192 | PORT_START("COL3") |
| 193 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BACKUP") PORT_CODE(KEYCODE_K) |
| 194 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ERASE") PORT_CODE(KEYCODE_DEL) |
| 195 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PLAY") PORT_CODE(KEYCODE_ENTER) |
| 196 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("STOP") PORT_CODE(KEYCODE_END) |
| 197 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) |
| 198 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) |
| 199 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("FILL") PORT_CODE(KEYCODE_F) |
| 200 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("COPY") PORT_CODE(KEYCODE_C) |
| 201 | PORT_START("COL4") |
| 202 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MIDI SETUP") PORT_CODE(KEYCODE_M) |
| 203 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LEFT") PORT_CODE(KEYCODE_LEFT) |
| 204 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TOM 1") PORT_CODE(KEYCODE_1_PAD) |
| 205 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TOM 2") PORT_CODE(KEYCODE_2_PAD) |
| 206 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TOM 3") PORT_CODE(KEYCODE_3_PAD) |
| 207 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RIDE") PORT_CODE(KEYCODE_4_PAD) |
| 208 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CRASH") PORT_CODE(KEYCODE_5_PAD) |
| 209 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PERC 1") PORT_CODE(KEYCODE_6_PAD) |
| 210 | PORT_START("COL5") |
| 211 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PERFORM/COMPOSE") PORT_CODE(KEYCODE_HOME) |
| 212 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) |
| 213 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KICK") PORT_CODE(KEYCODE_F1) |
| 214 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SNARE") PORT_CODE(KEYCODE_F2) |
| 215 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CLOSED HAT") PORT_CODE(KEYCODE_F3) |
| 216 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("OPEN HAT") PORT_CODE(KEYCODE_F4) |
| 217 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CLAPS") PORT_CODE(KEYCODE_F5) |
| 218 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PERC 2") PORT_CODE(KEYCODE_F6) |
| 219 | PORT_START("COL6") |
| 220 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 221 | INPUT_PORTS_END |
157 | 222 | |
| 223 | |
158 | 224 | void alesis_state::palette_init() |
159 | 225 | { |
160 | 226 | palette_set_color(machine(), 0, MAKE_RGB(138, 146, 148)); |
r17470 | r17471 | |
166 | 232 | m_kb_matrix = 0xff; |
167 | 233 | } |
168 | 234 | |
169 | | static SCREEN_UPDATE_IND16( alesis ) |
170 | | { |
171 | | return 0; |
172 | | } |
173 | | |
174 | 235 | static HD44780_INTERFACE( hr16_display ) |
175 | 236 | { |
176 | 237 | 2, // number of lines |
177 | 238 | 16 // chars for line |
178 | 239 | }; |
179 | 240 | |
| 241 | static HD44780_INTERFACE( sr16_display ) |
| 242 | { |
| 243 | 2, // number of lines |
| 244 | 8 // chars for line |
| 245 | }; |
| 246 | |
180 | 247 | static const cassette_interface hr16_cassette_interface = |
181 | 248 | { |
182 | 249 | cassette_default_formats, |
r17470 | r17471 | |
223 | 290 | MCFG_SCREEN_ADD("screen", RASTER) |
224 | 291 | MCFG_SCREEN_REFRESH_RATE(50) |
225 | 292 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
226 | | MCFG_SCREEN_SIZE(640, 480) |
227 | | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
228 | | MCFG_SCREEN_UPDATE_STATIC(alesis) |
| 293 | MCFG_SCREEN_SIZE(6*8, 9*2) |
| 294 | MCFG_SCREEN_VISIBLE_AREA(0, 6*8-1, 0, 9*2-1) |
| 295 | MCFG_DEFAULT_LAYOUT(layout_lcd) |
| 296 | MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update) |
229 | 297 | |
230 | 298 | MCFG_PALETTE_LENGTH(2) |
| 299 | |
| 300 | MCFG_CASSETTE_ADD( CASSETTE_TAG, hr16_cassette_interface ) |
| 301 | |
| 302 | MCFG_HD44780_ADD("hd44780", sr16_display) |
| 303 | |
| 304 | /* sound hardware */ |
| 305 | MCFG_ALESIS_DM3AG_ADD("dm3ag", XTAL_12MHz/2) |
| 306 | |
| 307 | MCFG_NVRAM_ADD_0FILL("nvram") |
231 | 308 | MACHINE_CONFIG_END |
232 | 309 | |
233 | 310 | /* ROM definition */ |
r17470 | r17471 | |
273 | 350 | ROM_SYSTEM_BIOS(0, "v104", "ver 1.04") |
274 | 351 | ROMX_LOAD( "sr16_v1_04.bin", 0x0000, 0x10000, CRC(d049af6e) SHA1(0bbeb4bd25e33a9eca64d5a31480f96a0040617e), ROM_BIOS(1)) |
275 | 352 | |
276 | | ROM_REGION( 0x100000, "sounddata", ROMREGION_ERASEFF ) |
277 | | ROM_LOAD( "sr16.u5", 0x00000, 0x80000, CRC(8bb25cfa) SHA1(273ad59d017b54a7e8d5e1ec61c8cd807a0e4af3)) |
278 | | ROM_LOAD( "sr16.u6", 0x80000, 0x80000, CRC(6da96987) SHA1(3ec8627d440bc73841e1408a19def09a8b0b77f7)) |
| 353 | ROM_REGION( 0x100000, "dm3ag", ROMREGION_ERASEFF ) |
| 354 | ROM_LOAD( "sr16.u6", 0x00000, 0x80000, CRC(6da96987) SHA1(3ec8627d440bc73841e1408a19def09a8b0b77f7)) |
| 355 | ROM_LOAD( "sr16.u5", 0x80000, 0x80000, CRC(8bb25cfa) SHA1(273ad59d017b54a7e8d5e1ec61c8cd807a0e4af3)) |
| 356 | |
| 357 | ROM_REGION( 0x0860, "hd44780", ROMREGION_ERASE ) |
| 358 | ROM_LOAD( "44780a00.bin", 0x0000, 0x0860, BAD_DUMP CRC(3a89024c) SHA1(5a87b68422a916d1b37b5be1f7ad0b3fb3af5a8d)) |
279 | 359 | ROM_END |
280 | 360 | |
281 | 361 | |
r17470 | r17471 | |
292 | 372 | |
293 | 373 | /* Driver */ |
294 | 374 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
295 | | SYST( 1987, hr16, 0, 0, hr16, alesis, alesis_state, hr16, "Alesis", "HR-16", GAME_NOT_WORKING | GAME_NO_SOUND) |
296 | | SYST( 1989, hr16b, hr16, 0, hr16, alesis, alesis_state, hr16, "Alesis", "HR-16B", GAME_NOT_WORKING | GAME_NO_SOUND) |
297 | | SYST( 1990, sr16, 0, 0, sr16, alesis, driver_device, 0, "Alesis", "SR-16", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 375 | SYST( 1987, hr16, 0, 0, hr16, hr16, alesis_state, hr16, "Alesis", "HR-16", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 376 | SYST( 1989, hr16b, hr16, 0, hr16, hr16, alesis_state, hr16, "Alesis", "HR-16B", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 377 | SYST( 1990, sr16, 0, 0, sr16, sr16, driver_device, 0, "Alesis", "SR-16", GAME_NOT_WORKING | GAME_NO_SOUND) |