src/mess/drivers/mikromik.c
| r0 | r4413 | |
| 1 | #include "driver.h"
|
| 2 | #include "includes/mikromik.h"
|
| 3 | #include "cpu/i8085/i8085.h"
|
| 4 | #include "devices/basicdsk.h"
|
| 5 | #include "video/i8275.h"
|
| 6 | |
| 7 | /*
|
| 8 | |
| 9 | This system is pretty useless without the boot disks, and the chargen ROM.
|
| 10 | |
| 11 | Video chips
|
| 12 | -----------
|
| 13 | - Intel 8275H
|
| 14 | - NEC uPD7220
|
| 15 | |
| 16 | */
|
| 17 | |
| 18 | /* Video */
|
| 19 | |
| 20 | static I8275_DMA_REQUEST( mm1_i8275_dma_request )
|
| 21 | {
|
| 22 | logerror("i8275 DMA\n");
|
| 23 | }
|
| 24 | |
| 25 | static I8275_INT_REQUEST( mm1_i8275_int_request )
|
| 26 | {
|
| 27 | logerror("i8275 INT\n");
|
| 28 | }
|
| 29 | |
| 30 | static I8275_DISPLAY_PIXELS( mm1_i8275_display_pixels )
|
| 31 | {
|
| 32 | /* int i;
|
| 33 | bitmap_t *bitmap = tmpbitmap;
|
| 34 | UINT8 *charmap = memory_region(device->machine, "gfx1") + (mikrosha_font_page & 1) * 0x400;
|
| 35 | UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff;
|
| 36 | if (vsp) {
|
| 37 | pixels = 0;
|
| 38 | }
|
| 39 | if (lten) {
|
| 40 | pixels = 0xff;
|
| 41 | }
|
| 42 | if (rvv) {
|
| 43 | pixels ^= 0xff;
|
| 44 | }
|
| 45 | for(i=0;i<6;i++) {
|
| 46 | *BITMAP_ADDR16(bitmap, y, x + i) = (pixels >> (5-i)) & 1 ? (hlgt ? 2 : 1) : 0;
|
| 47 | }*/
|
| 48 | }
|
| 49 | |
| 50 | static const i8275_interface mm1_i8275_intf = |
| 51 | {
|
| 52 | SCREEN_TAG,
|
| 53 | 8,
|
| 54 | 0,
|
| 55 | mm1_i8275_dma_request,
|
| 56 | mm1_i8275_int_request,
|
| 57 | mm1_i8275_display_pixels
|
| 58 | };
|
| 59 | |
| 60 | static VIDEO_UPDATE( mm1 )
|
| 61 | {
|
| 62 | mm1_state *state = screen->machine->driver_data;
|
| 63 | |
| 64 | i8275_update(state->i8275, bitmap, cliprect);
|
| 65 | |
| 66 | return 0;
|
| 67 | }
|
| 68 | |
| 69 | /* Memory Maps */
|
| 70 | |
| 71 | static ADDRESS_MAP_START( mm1_map, ADDRESS_SPACE_PROGRAM, 8 )
|
| 72 | AM_RANGE(0x0000, 0x0fff) AM_ROM // is this banked out somehow?
|
| 73 | AM_RANGE(0x1000, 0xffff) AM_RAM
|
| 74 | // AM_RANGE(0x4000, 0x4fff) AM_RAM // videoram?
|
| 75 | ADDRESS_MAP_END
|
| 76 | |
| 77 | static ADDRESS_MAP_START( mm1_io_map, ADDRESS_SPACE_IO, 8 )
|
| 78 | // AM_RANGE(0xd000, 0xd001) AM_DEVREADWRITE(I8275_TAG, i8275_r, i8275_w)
|
| 79 | ADDRESS_MAP_END
|
| 80 | |
| 81 | /* Input Ports */
|
| 82 | |
| 83 | static INPUT_PORTS_START( mm1 )
|
| 84 | INPUT_PORTS_END
|
| 85 | |
| 86 | /* Machine Initialization */
|
| 87 | |
| 88 | static MACHINE_START( mm1 )
|
| 89 | {
|
| 90 | mm1_state *state = machine->driver_data;
|
| 91 | |
| 92 | /* look up devices */
|
| 93 | |
| 94 | state->i8275 = devtag_get_device(machine, I8275_TAG);
|
| 95 | |
| 96 | /* register for state saving */
|
| 97 | |
| 98 | //state_save_register_global(machine, state->);
|
| 99 | }
|
| 100 | |
| 101 | /* Machine Drivers */
|
| 102 | |
| 103 | static MACHINE_DRIVER_START( mm1 )
|
| 104 | MDRV_DRIVER_DATA(mm1_state)
|
| 105 | |
| 106 | /* basic system hardware */
|
| 107 | MDRV_CPU_ADD(I8085_TAG, 8085A, 2000000)
|
| 108 | MDRV_CPU_PROGRAM_MAP(mm1_map, 0)
|
| 109 | MDRV_CPU_IO_MAP(mm1_io_map, 0)
|
| 110 | |
| 111 | MDRV_MACHINE_START(mm1)
|
| 112 | |
| 113 | /* video hardware */
|
| 114 | MDRV_SCREEN_ADD( SCREEN_TAG, RASTER )
|
| 115 | MDRV_SCREEN_REFRESH_RATE( 50 )
|
| 116 | MDRV_SCREEN_FORMAT( BITMAP_FORMAT_INDEXED16 )
|
| 117 | MDRV_SCREEN_SIZE( 800, 327 )
|
| 118 | MDRV_SCREEN_VISIBLE_AREA( 0, 800-1, 0, 327-1 )
|
| 119 | |
| 120 | MDRV_PALETTE_LENGTH(2)
|
| 121 | MDRV_PALETTE_INIT(black_and_white)
|
| 122 | MDRV_VIDEO_UPDATE(mm1)
|
| 123 | |
| 124 | MDRV_I8275_ADD(I8275_TAG, mm1_i8275_intf)
|
| 125 | MACHINE_DRIVER_END
|
| 126 | |
| 127 | /* ROMs */
|
| 128 | |
| 129 | ROM_START( mm1m6 )
|
| 130 | ROM_REGION( 0x1000, I8085_TAG, 0 )
|
| 131 | ROM_LOAD( "mm1.bin", 0x0000, 0x1000, CRC(07400e72) SHA1(354ff97817a607ca38d296af8b2813878d092a08) )
|
| 132 | |
| 133 | ROM_REGION( 0x1000, "chargen", 0 )
|
| 134 | ROM_LOAD( "chargen", 0x0000, 0x1000, NO_DUMP )
|
| 135 | ROM_END
|
| 136 | |
| 137 | #define rom_mm1m7 rom_mm1m6
|
| 138 | |
| 139 | /* System Configuration */
|
| 140 | |
| 141 | static DEVICE_IMAGE_LOAD( mm1_floppy )
|
| 142 | {
|
| 143 | if (image_has_been_created(image))
|
| 144 | return INIT_FAIL;
|
| 145 | |
| 146 | if (device_load_basicdsk_floppy(image) == INIT_PASS)
|
| 147 | {
|
| 148 | int size = image_length(image);
|
| 149 | |
| 150 | if (size == 80*2*16*256) // 640KB
|
| 151 | {
|
| 152 | /* image, tracks, heads, sectors per track, sector length, first sector id, offset track zero, track skipping */
|
| 153 | basicdsk_set_geometry(image, 80, 2, 16, 256, 1, 0, FALSE);
|
| 154 | |
| 155 | return INIT_PASS;
|
| 156 | }
|
| 157 | }
|
| 158 | |
| 159 | return INIT_FAIL;
|
| 160 | }
|
| 161 | |
| 162 | #ifdef UNUSED_CODE
|
| 163 | static DEVICE_IMAGE_LOAD( mm2_floppy )
|
| 164 | {
|
| 165 | if (image_has_been_created(image))
|
| 166 | return INIT_FAIL;
|
| 167 | |
| 168 | if (device_load_basicdsk_floppy(image) == INIT_PASS)
|
| 169 | {
|
| 170 | int size = image_length(image);
|
| 171 | |
| 172 | switch (size)
|
| 173 | {
|
| 174 | case 40*2*9*512: // 360KB
|
| 175 | /* image, tracks, heads, sectors per track, sector length, first sector id, offset track zero, track skipping */
|
| 176 | basicdsk_set_geometry(image, 40, 2, 9, 512, 1, 0, FALSE);
|
| 177 | break;
|
| 178 | |
| 179 | case 40*2*18*512: // 720KB (number of sectors has been doubled, instead of tracks as in 720KB DOS floppies)
|
| 180 | /* image, tracks, heads, sectors per track, sector length, first sector id, offset track zero, track skipping */
|
| 181 | basicdsk_set_geometry(image, 40, 2, 18, 512, 1, 0, FALSE);
|
| 182 | break;
|
| 183 | |
| 184 | default:
|
| 185 | return INIT_FAIL;
|
| 186 | }
|
| 187 | |
| 188 | return INIT_PASS;
|
| 189 | }
|
| 190 | |
| 191 | return INIT_FAIL;
|
| 192 | }
|
| 193 | #endif
|
| 194 | |
| 195 | static void dual_640kb_floppy(const mess_device_class *devclass, UINT32 state, union devinfo *info)
|
| 196 | {
|
| 197 | switch(state)
|
| 198 | {
|
| 199 | /* --- the following bits of info are returned as 64-bit signed integers --- */
|
| 200 | case MESS_DEVINFO_INT_COUNT: info->i = 2; break;
|
| 201 | |
| 202 | /* --- the following bits of info are returned as pointers to data or functions --- */
|
| 203 | case MESS_DEVINFO_PTR_LOAD: info->load = DEVICE_IMAGE_LOAD_NAME(mm1_floppy); break;
|
| 204 | |
| 205 | /* --- the following bits of info are returned as NULL-terminated strings --- */
|
| 206 | case MESS_DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "img"); break;
|
| 207 | |
| 208 | default: legacybasicdsk_device_getinfo(devclass, state, info); break;
|
| 209 | }
|
| 210 | }
|
| 211 | |
| 212 | static SYSTEM_CONFIG_START( mm1m6 )
|
| 213 | CONFIG_RAM_DEFAULT (64 * 1024)
|
| 214 | CONFIG_DEVICE(dual_640kb_floppy)
|
| 215 | SYSTEM_CONFIG_END
|
| 216 | |
| 217 | static SYSTEM_CONFIG_START( mm1m7 )
|
| 218 | CONFIG_RAM_DEFAULT (64 * 1024)
|
| 219 | CONFIG_DEVICE(dual_640kb_floppy)
|
| 220 | // 5MB Winchester
|
| 221 | SYSTEM_CONFIG_END
|
| 222 | |
| 223 | /* System Drivers */
|
| 224 | |
| 225 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS
|
| 226 | COMP( 1981, mm1m6, 0, 0, mm1, mm1, 0, mm1m6, "Nokia Data", "MikroMikko 1 M6", GAME_NOT_WORKING )
|
| 227 | COMP( 1981, mm1m7, mm1m6, 0, mm1, mm1, 0, mm1m7, "Nokia Data", "MikroMikko 1 M7", GAME_NOT_WORKING )
|