Previous 15994 Revisions Next

r5866 Wednesday 23rd September, 2009 at 19:52:40 UTC by Curt Coder
[MIKROMIK] Added memory banking and keyboard speaker.
[src/mess/drivers]mikromik.c
[src/mess/includes]mikromik.h

src/mess/includes/mikromik.h
r5865r5866
1010#define I8275_TAG      "ic59"
1111#define UPD7201_TAG      "ic11"
1212#define UPD7220_TAG      "ic101"
13#define SPEAKER_TAG      "speaker"
1314
1415#define DMA_CRT         0
1516#define DMA_MPSC_TX      1
r5865r5866
3738   const device_config      *i8275;
3839   const device_config      *upd765;
3940   const device_config      *upd7201;
41   const device_config      *speaker;
4042};
4143
4244#endif
src/mess/drivers/mikromik.c
r5865r5866
1111#include "video/i8275.h"
1212#include "video/i82720.h"
1313#include "video/upd7220.h"
14#include "sound/speaker.h"
1415
1516/*
1617
1718   TODO:
1819
1920   - ROM dumps
21   - ALL RAM CHIPS FAIL shows a screenful of garbage (DMA error?)
2022   - pixel display
2123   - floppy
2224   - keyboard
r5865r5866
7476static WRITE8_HANDLER( cs6_w )
7577{
7678   mm1_state *state = space->machine->driver_data;
79   const address_space *program = cputag_get_address_space(space->machine, I8085A_TAG, ADDRESS_SPACE_PROGRAM);
7780   int d = BIT(data, 0);
7881
7982   switch (offset)
8083   {
8184   case 0: /* IC24 A8 */
85      //logerror("IC24 A8 %u\n", d);
86      memory_set_bank(space->machine, 1, d);
87
88      if (d)
89         memory_install_readwrite8_handler(program, 0x0000, 0x0fff, 0, 0, SMH_BANK(1), SMH_BANK(1));
90      else
91         memory_install_readwrite8_handler(program, 0x0000, 0x0fff, 0, 0, SMH_BANK(1), SMH_UNMAP);
8292      break;
8393
8494   case 1: /* RECALL */
r5865r5866
106116      break;
107117
108118   case 7: /* MOTOR ON */
119      //logerror("MOTOR %u\n", d);
109120      floppy_drive_set_motor_state(get_floppy_image(space->machine, 0), d);
110121      floppy_drive_set_ready_state(get_floppy_image(space->machine, 0), d, 1);
111122      break;
r5865r5866
115126/* Memory Maps */
116127
117128static ADDRESS_MAP_START( mm1_map, ADDRESS_SPACE_PROGRAM, 8 )
118   AM_RANGE(0x0000, 0x3fff) AM_ROM
119   AM_RANGE(0x4000, 0xbfff) AM_RAM
129   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK(1)
130   AM_RANGE(0x1000, 0xfeff) AM_RAM
120131   AM_RANGE(0xff00, 0xff0f) AM_DEVREADWRITE(I8237_TAG, dma8237_r, dma8237_w)
121132   AM_RANGE(0xff10, 0xff13) AM_DEVREADWRITE(UPD7201_TAG, upd7201_cd_ba_r, upd7201_cd_ba_w)
122133    AM_RANGE(0xff20, 0xff21) AM_DEVREADWRITE(I8275_TAG, i8275_r, i8275_w)
r5865r5866
246257static DMA8237_MEM_READ( memory_dma_r )
247258{
248259   const address_space *program = cputag_get_address_space(device->machine, I8085A_TAG, ADDRESS_SPACE_PROGRAM);
249   //logerror("DMA read %04x\n", offset);
260//   logerror("DMA read %04x\n", offset);
250261   return memory_read_byte(program, offset);
251262}
252263
r5865r5866
281292static DMA8237_CHANNEL_READ( fdc_dack_r )
282293{
283294   mm1_state *state = device->machine->driver_data;
284
285   return nec765_dack_r(state->upd765, 0);
295   UINT8 data = nec765_dack_r(state->upd765, 0);
296//logerror("FDC DACK read %02x\n", data);
297   return data;
286298}
287299
288300static DMA8237_CHANNEL_WRITE( fdc_dack_w )
289301{
290302   mm1_state *state = device->machine->driver_data;
303//logerror("FDC DACK write %02x\n", data);
291304
292305   nec765_dack_w(state->upd765, 0, data);
293306}
r5865r5866
299312   /* floppy terminal count */
300313   nec765_tc_w(driver_state->upd765, !state);
301314
302   cputag_set_input_line(device->machine, I8085A_TAG, I8085_RST75_LINE, state ? CLEAR_LINE : ASSERT_LINE);
315   cputag_set_input_line(device->machine, I8085A_TAG, I8085_RST75_LINE, state ? ASSERT_LINE : CLEAR_LINE);
303316}
304317
305318static const struct dma8237_interface mm1_dma8237_intf =
r5865r5866
327340   DEVCB_CPU_INPUT_LINE(I8085A_TAG, I8085_RST55_LINE),
328341   drq_w,
329342   NULL,
330   NEC765_RDY_PIN_CONNECTED, // ???
331   {FLOPPY_0,FLOPPY_1, NULL, NULL}
343   NEC765_RDY_PIN_NOT_CONNECTED,
344   { FLOPPY_0, FLOPPY_1, NULL, NULL }
332345};
333346
334347/* 8253 Interface */
r5865r5866
434447   return 1;
435448}
436449
437static WRITE_LINE_DEVICE_HANDLER( bell_w )
438{
439}
440
441450static I8085_CONFIG( mm1_i8085_config )
442451{
443452   DEVCB_NULL,         /* STATUS changed callback */
444453   DEVCB_NULL,         /* INTE changed callback */
445454   DEVCB_LINE(dsra_r),   /* SID changed callback (8085A only) */
446   DEVCB_LINE(bell_w)   /* SOD changed callback (8085A only) */
455   DEVCB_DEVICE_LINE(SPEAKER_TAG, speaker_level_w)   /* SOD changed callback (8085A only) */
447456};
448457
449458/* Machine Initialization */
r5865r5866
451460static MACHINE_START( mm1 )
452461{
453462   mm1_state *state = machine->driver_data;
463   const address_space *program = cputag_get_address_space(machine, I8085A_TAG, ADDRESS_SPACE_PROGRAM);
454464
455465   /* look up devices */
456466   state->i8212 = devtag_get_device(machine, I8212_TAG);
r5865r5866
458468   state->i8275 = devtag_get_device(machine, I8275_TAG);
459469   state->upd765 = devtag_get_device(machine, UPD765_TAG);
460470   state->upd7201 = devtag_get_device(machine, UPD7201_TAG);
471   state->speaker = devtag_get_device(machine, SPEAKER_TAG);
461472
473   /* setup memory banking */
474   memory_install_readwrite8_handler(program, 0x0000, 0x0fff, 0, 0, SMH_BANK(1), SMH_UNMAP);
475   memory_configure_bank(machine, 1, 0, 1, memory_region(machine, "bios"), 0);
476   memory_configure_bank(machine, 1, 1, 1, mess_ram, 0);
477   memory_set_bank(machine, 1, 0);
478
462479   /* register for state saving */
463480   state_save_register_global(machine, state->llen);
464481   state_save_register_global(machine, state->intc);
r5865r5866
468485   state_save_register_global(machine, state->recall);
469486}
470487
488static MACHINE_RESET( mm1 )
489{
490   const address_space *program = cputag_get_address_space(machine, I8085A_TAG, ADDRESS_SPACE_PROGRAM);
491
492   memory_install_readwrite8_handler(program, 0x0000, 0x0fff, 0, 0, SMH_BANK(1), SMH_UNMAP);
493   memory_set_bank(machine, 1, 0);
494}
495
471496static FLOPPY_OPTIONS_START( mm1 )
472497   FLOPPY_OPTION( mm1_640kb, "dsk", "Nokia MikroMikko 1 640KB disk image", basicdsk_identify_default, basicdsk_construct_default,
473498      HEADS([2])
r5865r5866
521546
522547   MDRV_GFXDECODE(mm1)
523548   MDRV_PALETTE_LENGTH(2)
524   MDRV_PALETTE_INIT(black_and_white)
549   MDRV_PALETTE_INIT(monochrome_green)
525550
526551   MDRV_VIDEO_START(mm1)
527552   MDRV_VIDEO_UPDATE(mm1)
528553
554   /* sound hardware */
555   MDRV_SPEAKER_STANDARD_MONO("mono")
556   MDRV_SOUND_ADD(SPEAKER_TAG, SPEAKER, 0)
557   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
558
529559   /* peripheral hardware */
530560   MDRV_I8212_ADD(I8212_TAG, mm1_i8212_intf)
531561   MDRV_I8275_ADD(I8275_TAG, mm1_i8275_intf)
r5865r5866
546576/* ROMs */
547577
548578ROM_START( mm1m6 )
549   ROM_REGION( 0x4000, I8085A_TAG, 0 ) /* BIOS */
579   ROM_REGION( 0x4000, "bios", 0 ) /* BIOS */
550580   ROM_LOAD( "9081b.ic2", 0x0000, 0x2000, CRC(2955feb3) SHA1(946a6b0b8fb898be3f480c04da33d7aaa781152b) )
551581
552582   ROM_REGION( 0x200, "address", 0 ) /* address decoder */
553   ROM_LOAD( "mmi6349-1.ic24", 0x0000, 0x0200, NO_DUMP )
583   ROM_LOAD( "720793a.ic24", 0x0000, 0x0200, NO_DUMP )
554584
555585   ROM_REGION( 0x200, "keyboard", 0 ) /* keyboard encoder */
556586   ROM_LOAD( "mmi6349-1j.bin", 0x0000, 0x0200, NO_DUMP )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team