src/mess/drivers/mycom.c
| r9416 | r9417 | |
| 7 | 7 | TODO: |
| 8 | 8 | - SN doesn't seem to work properly, needs to find out what's the WE bit |
| 9 | 9 | for. |
| 10 | | - Hook-up FDC and CMT load / save; |
| 10 | - Hook-up FDC (only the basic components have been added) |
| 11 | - Hook-up CMT load / save; (save works, load does not) |
| 11 | 12 | - Printer |
| 12 | 13 | - RTC |
| 13 | 14 | |
| r9416 | r9417 | |
| 18 | 19 | #include "video/mc6845.h" |
| 19 | 20 | #include "machine/i8255a.h" |
| 20 | 21 | #include "sound/sn76496.h" |
| 22 | #include "devices/cassette.h" |
| 23 | #include "sound/wave.h" |
| 24 | #include "machine/wd17xx.h" |
| 25 | #include "devices/flopdrv.h" |
| 26 | #include "formats/basicdsk.h" |
| 21 | 27 | |
| 22 | | static UINT16 mycom_amask; |
| 23 | | static UINT8 ram_bank; |
| 28 | static UINT8 mc6845_reg[32]; /* registers */ |
| 29 | static UINT8 mc6845_ind; /* register index */ |
| 30 | static const UINT8 mc6845_mask[32]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0}; |
| 31 | static running_device *mc6845; |
| 32 | static running_device *mycom_cassette; |
| 33 | static UINT8 *vram; |
| 34 | static UINT8 *gfx_rom; |
| 24 | 35 | static UINT16 vram_addr; |
| 25 | | static UINT16 cursor_addr,cursor_raster; |
| 26 | 36 | static UINT8 keyb_press,keyb_press_flag,shift_press_flag; |
| 27 | 37 | static UINT8 video_mode,sn_we; |
| 28 | 38 | |
| 29 | 39 | static VIDEO_START( mycom ) |
| 30 | 40 | { |
| 41 | mc6845 = machine->device("crtc"); |
| 42 | vram = memory_region(machine, "vram"); |
| 43 | gfx_rom = memory_region(machine, "gfx"); |
| 31 | 44 | } |
| 32 | 45 | |
| 33 | 46 | static VIDEO_UPDATE( mycom ) |
| 34 | 47 | { |
| 35 | | int x,y,count; |
| 36 | | int xi,yi; |
| 37 | | int width; |
| 38 | | static UINT8 *vram = memory_region(screen->machine, "vram"); |
| 39 | | static UINT8 *gfx_rom = memory_region(screen->machine, "gfx"); |
| 48 | mc6845_update(mc6845, bitmap, cliprect); |
| 49 | return 0; |
| 50 | } |
| 40 | 51 | |
| 41 | | count = 0; |
| 52 | static MC6845_UPDATE_ROW( mycom_update_row ) |
| 53 | { |
| 54 | UINT8 chr,gfx=0,z; |
| 55 | UINT16 mem,x; |
| 56 | UINT16 *p = BITMAP_ADDR16(bitmap, y, 0); |
| 42 | 57 | |
| 43 | 58 | if(video_mode & 0x40) |
| 44 | 59 | { |
| 45 | | width = (video_mode & 0x80) ? 160 : 320; |
| 46 | | |
| 47 | | for(y=0;y<24;y++) |
| 60 | for (x = 0; x < x_count; x++) // lores pixels |
| 48 | 61 | { |
| 49 | | for(x=0;x<width;x+=4) |
| 50 | | { |
| 51 | | //int xi,yi; |
| 52 | | int xi,yi; |
| 53 | | |
| 54 | | for(yi=0;yi<4;yi++) |
| 55 | | { |
| 56 | | for(xi=0;xi<2;xi++) |
| 57 | | { |
| 58 | | int pen; |
| 59 | | |
| 60 | | pen = vram[count] >> (yi+(xi*4)); |
| 61 | | pen &= 1; |
| 62 | | |
| 63 | | *BITMAP_ADDR16(bitmap, y*8+(yi*2+0), (x+(xi*2+0))*2+0) = screen->machine->pens[pen]; |
| 64 | | *BITMAP_ADDR16(bitmap, y*8+(yi*2+0), (x+(xi*2+1))*2+0) = screen->machine->pens[pen]; |
| 65 | | *BITMAP_ADDR16(bitmap, y*8+(yi*2+1), (x+(xi*2+0))*2+0) = screen->machine->pens[pen]; |
| 66 | | *BITMAP_ADDR16(bitmap, y*8+(yi*2+1), (x+(xi*2+1))*2+0) = screen->machine->pens[pen]; |
| 67 | | *BITMAP_ADDR16(bitmap, y*8+(yi*2+0), (x+(xi*2+0))*2+1) = screen->machine->pens[pen]; |
| 68 | | *BITMAP_ADDR16(bitmap, y*8+(yi*2+0), (x+(xi*2+1))*2+1) = screen->machine->pens[pen]; |
| 69 | | *BITMAP_ADDR16(bitmap, y*8+(yi*2+1), (x+(xi*2+0))*2+1) = screen->machine->pens[pen]; |
| 70 | | *BITMAP_ADDR16(bitmap, y*8+(yi*2+1), (x+(xi*2+1))*2+1) = screen->machine->pens[pen]; |
| 71 | | } |
| 72 | | } |
| 73 | | |
| 74 | | count++; |
| 75 | | } |
| 62 | UINT8 dbit=1; |
| 63 | if (x == cursor_x) dbit=0; |
| 64 | mem = (ma + x) & 0x7ff; |
| 65 | chr = vram[mem]; |
| 66 | z = ra / 3; |
| 67 | *p++ = BIT( chr, z ) ? dbit: dbit^1; |
| 68 | *p++ = BIT( chr, z ) ? dbit: dbit^1; |
| 69 | *p++ = BIT( chr, z ) ? dbit: dbit^1; |
| 70 | *p++ = BIT( chr, z ) ? dbit: dbit^1; |
| 71 | z += 4; |
| 72 | *p++ = BIT( chr, z ) ? dbit: dbit^1; |
| 73 | *p++ = BIT( chr, z ) ? dbit: dbit^1; |
| 74 | *p++ = BIT( chr, z ) ? dbit: dbit^1; |
| 75 | *p++ = BIT( chr, z ) ? dbit: dbit^1; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | | return 0; |
| 78 | // width = (video_mode & 0x80) ? 160 : 320; |
| 79 | |
| 79 | 80 | } |
| 80 | 81 | else |
| 81 | 82 | { |
| 82 | | width = (video_mode & 0x80) ? 40 : 80; |
| 83 | | |
| 84 | | for(y=0;y<24;y++) |
| 83 | for (x = 0; x < x_count; x++) // text |
| 85 | 84 | { |
| 86 | | for(x=0;x<width;x++) |
| 85 | UINT8 inv=0; |
| 86 | if (x == cursor_x) inv=0xff; |
| 87 | mem = (ma + x) & 0x7ff; |
| 88 | if (ra > 7) |
| 89 | gfx = inv; // some blank spacing lines |
| 90 | else |
| 87 | 91 | { |
| 88 | | int tile = vram[count]; |
| 89 | | //int color = (display_reg & 0x80) ? 7 : (attr & 0x07); |
| 90 | | |
| 91 | | for(yi=0;yi<8;yi++) |
| 92 | | { |
| 93 | | for(xi=0;xi<8;xi++) |
| 94 | | { |
| 95 | | int pen; |
| 96 | | |
| 97 | | pen = (gfx_rom[tile*8+yi] >> (7-xi) & 1) ? 1 : 0; |
| 98 | | |
| 99 | | //if(pen) |
| 100 | | *BITMAP_ADDR16(bitmap, y*8+yi, x*8+xi) = screen->machine->pens[pen]; |
| 101 | | } |
| 102 | | } |
| 103 | | |
| 104 | | if(cursor_addr == count) |
| 105 | | { |
| 106 | | int xc,yc,cursor_on; |
| 107 | | |
| 108 | | cursor_on = 0; |
| 109 | | switch(cursor_raster & 0x60) |
| 110 | | { |
| 111 | | case 0x00: cursor_on = 1; break; //always on |
| 112 | | case 0x20: cursor_on = 0; break; //always off |
| 113 | | case 0x40: if(screen->machine->primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink |
| 114 | | case 0x60: if(screen->machine->primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink |
| 115 | | } |
| 116 | | |
| 117 | | if(cursor_on) |
| 118 | | { |
| 119 | | for(yc=0;yc<(8-(cursor_raster & 7));yc++) |
| 120 | | { |
| 121 | | for(xc=0;xc<8;xc++) |
| 122 | | { |
| 123 | | *BITMAP_ADDR16(bitmap, y*8+yc, x*8+xc) = screen->machine->pens[0x1]; |
| 124 | | } |
| 125 | | } |
| 126 | | } |
| 127 | | } |
| 128 | | |
| 129 | | count++; |
| 92 | chr = vram[mem]; |
| 93 | gfx = gfx_rom[(chr<<3) | ra] ^ inv; |
| 130 | 94 | } |
| 95 | |
| 96 | /* Display a scanline of a character */ |
| 97 | *p++ = ( gfx & 0x80 ) ? 1 : 0; |
| 98 | *p++ = ( gfx & 0x40 ) ? 1 : 0; |
| 99 | *p++ = ( gfx & 0x20 ) ? 1 : 0; |
| 100 | *p++ = ( gfx & 0x10 ) ? 1 : 0; |
| 101 | *p++ = ( gfx & 0x08 ) ? 1 : 0; |
| 102 | *p++ = ( gfx & 0x04 ) ? 1 : 0; |
| 103 | *p++ = ( gfx & 0x02 ) ? 1 : 0; |
| 104 | *p++ = ( gfx & 0x01 ) ? 1 : 0; |
| 131 | 105 | } |
| 132 | 106 | } |
| 133 | | |
| 134 | | return 0; |
| 135 | 107 | } |
| 136 | 108 | |
| 137 | | static READ8_HANDLER( wram_r ) |
| 138 | | { |
| 139 | | static UINT8 *ram = memory_region(space->machine, "maincpu"); |
| 109 | // width = (video_mode & 0x80) ? 40 : 80; |
| 140 | 110 | |
| 141 | | if(offset & 0xc000 && ram_bank) |
| 142 | | return ram[(offset & 0x3fff) | 0x10000]; |
| 143 | 111 | |
| 144 | | return ram[offset | mycom_amask]; |
| 145 | | } |
| 146 | | |
| 147 | | static WRITE8_HANDLER( wram_w ) |
| 112 | static WRITE8_HANDLER( mycom_00_w ) |
| 148 | 113 | { |
| 149 | | static UINT8 *ram = memory_region(space->machine, "maincpu"); |
| 150 | | |
| 151 | | ram[offset | mycom_amask] = data; |
| 152 | | } |
| 153 | | |
| 154 | | static WRITE8_HANDLER( sys_control_w ) |
| 155 | | { |
| 156 | 114 | switch(data) |
| 157 | 115 | { |
| 158 | | case 0x00: mycom_amask = 0xc000; break; |
| 159 | | case 0x01: mycom_amask = 0x0000; break; |
| 160 | | case 0x02: ram_bank = 0; break; |
| 161 | | case 0x03: ram_bank = 1; break; |
| 116 | case 0x00: memory_set_bank(space->machine, "boot", 1); break; |
| 117 | case 0x01: memory_set_bank(space->machine, "boot", 0); break; |
| 118 | case 0x02: memory_set_bank(space->machine, "upper", 0); break; |
| 119 | case 0x03: memory_set_bank(space->machine, "upper", 1); break; |
| 162 | 120 | } |
| 163 | 121 | } |
| 164 | 122 | |
| 165 | | static WRITE8_HANDLER( mycom_6845_w ) |
| 123 | static READ8_HANDLER( mycom_6845_r ) |
| 166 | 124 | { |
| 167 | | static int addr_latch; |
| 125 | if (!offset) |
| 126 | return 0; |
| 168 | 127 | |
| 128 | /* need to read the start registers or scroll wont work */ |
| 129 | if ((mc6845_ind & 0x1e) == 0x0c) |
| 130 | return mc6845_reg[mc6845_ind]; |
| 131 | else |
| 132 | return mc6845_register_r(mc6845, 0); |
| 133 | } |
| 134 | |
| 135 | static WRITE8_HANDLER( mycom_6845_w ) |
| 136 | { |
| 169 | 137 | if(offset == 0) |
| 170 | 138 | { |
| 171 | | addr_latch = data; |
| 172 | | mc6845_address_w(space->machine->device("crtc"), 0,data); |
| 139 | mc6845_ind = data; |
| 140 | mc6845_address_w(mc6845, 0, data); |
| 173 | 141 | } |
| 174 | 142 | else |
| 175 | 143 | { |
| 176 | | if(addr_latch == 0x0a) |
| 177 | | cursor_raster = data; |
| 178 | | if(addr_latch == 0x0e) |
| 179 | | cursor_addr = ((data<<8) & 0x3f00) | (cursor_addr & 0xff); |
| 180 | | else if(addr_latch == 0x0f) |
| 181 | | cursor_addr = (cursor_addr & 0x3f00) | (data & 0xff); |
| 182 | | |
| 183 | | mc6845_register_w(space->machine->device("crtc"), 0,data); |
| 144 | mc6845_reg[mc6845_ind] = data & mc6845_mask[mc6845_ind]; |
| 145 | mc6845_register_w(mc6845, 0,data); |
| 184 | 146 | } |
| 185 | 147 | } |
| 186 | 148 | |
| 187 | 149 | static READ8_HANDLER( vram_data_r ) |
| 188 | 150 | { |
| 189 | | static UINT8 *vram = memory_region(space->machine,"vram"); |
| 190 | | |
| 191 | 151 | return vram[vram_addr]; |
| 192 | 152 | } |
| 193 | 153 | |
| 194 | 154 | static WRITE8_HANDLER( vram_data_w ) |
| 195 | 155 | { |
| 196 | | static UINT8 *vram = memory_region(space->machine,"vram"); |
| 197 | | |
| 198 | 156 | vram[vram_addr] = data; |
| 199 | 157 | } |
| 200 | 158 | |
| 201 | 159 | static ADDRESS_MAP_START(mycom_map, ADDRESS_SPACE_PROGRAM, 8) |
| 202 | 160 | ADDRESS_MAP_UNMAP_HIGH |
| 203 | | AM_RANGE(0x0000, 0xffff) AM_READWRITE(wram_r,wram_w) |
| 161 | AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot") |
| 162 | AM_RANGE(0x1000, 0xbfff) AM_RAM |
| 163 | AM_RANGE(0xc000, 0xffff) AM_ROMBANK("upper") |
| 204 | 164 | ADDRESS_MAP_END |
| 205 | 165 | |
| 206 | 166 | static ADDRESS_MAP_START(mycom_io, ADDRESS_SPACE_IO, 8) |
| 207 | 167 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 208 | | AM_RANGE(0x00, 0x00) AM_WRITE(sys_control_w) |
| 168 | AM_RANGE(0x00, 0x00) AM_WRITE(mycom_00_w) |
| 209 | 169 | AM_RANGE(0x01, 0x01) AM_READWRITE(vram_data_r,vram_data_w) |
| 210 | | AM_RANGE(0x02, 0x03) AM_DEVREAD("crtc", mc6845_register_r) AM_WRITE(mycom_6845_w) |
| 170 | AM_RANGE(0x02, 0x03) AM_READWRITE(mycom_6845_r,mycom_6845_w) |
| 211 | 171 | AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("ppi8255_0", i8255a_r, i8255a_w) |
| 212 | 172 | AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ppi8255_1", i8255a_r, i8255a_w) |
| 213 | 173 | AM_RANGE(0x0c, 0x0f) AM_DEVREADWRITE("ppi8255_2", i8255a_r, i8255a_w) |
| 174 | AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("fdc", wd17xx_r, wd17xx_w) |
| 214 | 175 | ADDRESS_MAP_END |
| 215 | 176 | |
| 216 | 177 | /* Input ports */ |
| r9416 | r9417 | |
| 346 | 307 | GFXDECODE_ENTRY( "gfx", 0x0000, mycom_charlayout, 0, 1 ) |
| 347 | 308 | GFXDECODE_END |
| 348 | 309 | |
| 310 | static const wd17xx_interface wd1771_intf = |
| 311 | { |
| 312 | DEVCB_NULL, |
| 313 | DEVCB_NULL, // no information available |
| 314 | DEVCB_NULL, |
| 315 | {FLOPPY_0, FLOPPY_1, NULL, NULL} |
| 316 | }; |
| 317 | |
| 349 | 318 | static const mc6845_interface mc6845_intf = |
| 350 | 319 | { |
| 351 | 320 | "screen", /* screen we are acting on */ |
| 352 | | 8, /* number of pixels per video memory address */ |
| 321 | 8, /* number of pixels per video memory address */ |
| 353 | 322 | NULL, /* before pixel update callback */ |
| 354 | | NULL, /* row update callback */ |
| 323 | mycom_update_row, /* row update callback */ |
| 355 | 324 | NULL, /* after pixel update callback */ |
| 356 | 325 | DEVCB_NULL, /* callback for display state changes */ |
| 357 | 326 | DEVCB_NULL, /* callback for cursor state changes */ |
| r9416 | r9417 | |
| 360 | 329 | NULL /* update address callback */ |
| 361 | 330 | }; |
| 362 | 331 | |
| 363 | | static WRITE8_DEVICE_HANDLER( vram_laddr_w ) |
| 332 | static WRITE8_DEVICE_HANDLER( mycom_04_w ) |
| 364 | 333 | { |
| 365 | 334 | vram_addr = (vram_addr & 0x700) | (data & 0x0ff); |
| 366 | 335 | |
| r9416 | r9417 | |
| 370 | 339 | // sn76496_w(device->machine->device("sn1"), 0, data); |
| 371 | 340 | } |
| 372 | 341 | |
| 373 | | static WRITE8_DEVICE_HANDLER( vram_haddr_w ) |
| 342 | static WRITE8_DEVICE_HANDLER( mycom_06_w ) |
| 374 | 343 | { |
| 375 | 344 | vram_addr = (vram_addr & 0x0ff) | ((data & 0x007) << 8); |
| 376 | 345 | } |
| 377 | 346 | |
| 378 | | static READ8_DEVICE_HANDLER( input_1a ) |
| 347 | static READ8_DEVICE_HANDLER( mycom_08_r ) |
| 379 | 348 | { |
| 380 | 349 | /* |
| 381 | 350 | x--- ---- display flag |
| 382 | 351 | ---- --x- keyboard shift |
| 383 | 352 | ---- ---x keyboard strobe |
| 384 | 353 | */ |
| 385 | | int res; |
| 354 | UINT8 data = shift_press_flag << 1; |
| 386 | 355 | |
| 387 | | res = keyb_press_flag; |
| 356 | data |= keyb_press_flag; |
| 388 | 357 | keyb_press_flag = 0; |
| 389 | 358 | |
| 390 | | return 0x00 | (shift_press_flag << 1) | res; |
| 359 | //if (cassette_input(mycom_cassette) > 0.03) // not working |
| 360 | // data+=4; |
| 361 | |
| 362 | return data; |
| 391 | 363 | } |
| 392 | 364 | |
| 393 | | static READ8_DEVICE_HANDLER( input_0c ) |
| 365 | static READ8_DEVICE_HANDLER( mycom_06_r ) |
| 394 | 366 | { |
| 395 | 367 | /* |
| 396 | 368 | xxxx ---- keyboard related, it expects to return 1101 here |
| r9416 | r9417 | |
| 398 | 370 | return (mame_rand(device->machine) & 0x20) | 0x00; |
| 399 | 371 | } |
| 400 | 372 | |
| 401 | | static READ8_DEVICE_HANDLER( key_r ) |
| 373 | static READ8_DEVICE_HANDLER( mycom_05_r ) |
| 402 | 374 | { |
| 403 | 375 | //keyb_press_flag = 0; |
| 404 | 376 | return keyb_press; |
| 405 | 377 | } |
| 406 | 378 | |
| 407 | | static WRITE8_DEVICE_HANDLER( output_1c ) |
| 379 | static WRITE8_DEVICE_HANDLER( mycom_0a_w ) |
| 408 | 380 | { |
| 409 | 381 | /* |
| 410 | 382 | x--- ---- width 80/40 (0 = 80, 1 = 40) |
| r9416 | r9417 | |
| 417 | 389 | ---- ---x printer strobe |
| 418 | 390 | */ |
| 419 | 391 | |
| 392 | if (data & 8) // motor on |
| 393 | cassette_output(mycom_cassette, (data & 4) ? -1.0 : +1.0); |
| 394 | |
| 420 | 395 | video_mode = data & 0xc0; |
| 421 | 396 | sn_we = data & 0x10; |
| 422 | 397 | // printf("%02x\n",data & 0x10); |
| r9416 | r9417 | |
| 424 | 399 | |
| 425 | 400 | static I8255A_INTERFACE( ppi8255_intf_0 ) |
| 426 | 401 | { |
| 427 | | DEVCB_NULL, /* Port A read */ |
| 428 | | DEVCB_HANDLER(key_r), /* Port B read */ |
| 429 | | DEVCB_HANDLER(input_0c), /* Port C read */ |
| 430 | | DEVCB_HANDLER(vram_laddr_w), /* Port A write */ |
| 431 | | DEVCB_NULL, /* Port B write */ |
| 432 | | DEVCB_HANDLER(vram_haddr_w) /* Port C write */ |
| 402 | DEVCB_NULL, /* Port A read */ |
| 403 | DEVCB_HANDLER(mycom_05_r), /* Port B read */ |
| 404 | DEVCB_HANDLER(mycom_06_r), /* Port C read */ |
| 405 | DEVCB_HANDLER(mycom_04_w), /* Port A write */ |
| 406 | DEVCB_NULL, /* Port B write */ |
| 407 | DEVCB_HANDLER(mycom_06_w) /* Port C write */ |
| 433 | 408 | }; |
| 434 | 409 | |
| 435 | 410 | static I8255A_INTERFACE( ppi8255_intf_1 ) |
| 436 | 411 | { |
| 437 | | DEVCB_HANDLER(input_1a), /* Port A read */ |
| 412 | DEVCB_HANDLER(mycom_08_r), /* Port A read */ |
| 438 | 413 | DEVCB_NULL, /* Port B read */ |
| 439 | 414 | DEVCB_NULL, /* Port C read */ |
| 440 | 415 | DEVCB_NULL, /* Port A write */ |
| 441 | 416 | DEVCB_NULL, /* Port B write */ |
| 442 | | DEVCB_HANDLER(output_1c) /* Port C write */ |
| 417 | DEVCB_HANDLER(mycom_0a_w) /* Port C write */ |
| 443 | 418 | }; |
| 444 | 419 | |
| 445 | 420 | static I8255A_INTERFACE( ppi8255_intf_2 ) |
| r9416 | r9417 | |
| 502 | 477 | static MACHINE_START(mycom) |
| 503 | 478 | { |
| 504 | 479 | timer_pulse(machine, ATTOTIME_IN_HZ(240/32), NULL, 0, keyboard_callback); |
| 480 | mycom_cassette = machine->device("cassette"); |
| 505 | 481 | } |
| 506 | 482 | |
| 507 | 483 | static MACHINE_RESET(mycom) |
| 508 | 484 | { |
| 509 | | mycom_amask = 0xc000; |
| 485 | memory_set_bank(machine, "boot", 1); |
| 486 | memory_set_bank(machine, "upper", 0); |
| 510 | 487 | } |
| 511 | 488 | |
| 489 | static DRIVER_INIT( mycom ) |
| 490 | { |
| 491 | UINT8 *RAM = memory_region(machine, "maincpu"); |
| 492 | memory_configure_bank(machine, "boot", 0, 2, &RAM[0x0000], 0xc000); |
| 493 | memory_configure_bank(machine, "upper", 0, 2, &RAM[0xc000], 0x4000); |
| 494 | } |
| 495 | |
| 512 | 496 | static MACHINE_CONFIG_START( mycom, driver_device ) |
| 513 | | /* basic machine hardware */ |
| 514 | | MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz) |
| 515 | | MDRV_CPU_PROGRAM_MAP(mycom_map) |
| 516 | | MDRV_CPU_IO_MAP(mycom_io) |
| 497 | /* basic machine hardware */ |
| 498 | MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz) |
| 499 | MDRV_CPU_PROGRAM_MAP(mycom_map) |
| 500 | MDRV_CPU_IO_MAP(mycom_io) |
| 517 | 501 | |
| 518 | | MDRV_MACHINE_START(mycom) |
| 519 | | MDRV_MACHINE_RESET(mycom) |
| 502 | MDRV_MACHINE_START(mycom) |
| 503 | MDRV_MACHINE_RESET(mycom) |
| 520 | 504 | |
| 521 | 505 | MDRV_I8255A_ADD( "ppi8255_0", ppi8255_intf_0 ) |
| 522 | 506 | MDRV_I8255A_ADD( "ppi8255_1", ppi8255_intf_1 ) |
| 523 | 507 | MDRV_I8255A_ADD( "ppi8255_2", ppi8255_intf_2 ) |
| 524 | 508 | |
| 525 | | /* video hardware */ |
| 526 | | MDRV_SCREEN_ADD("screen", RASTER) |
| 527 | | MDRV_SCREEN_REFRESH_RATE(60) |
| 528 | | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 529 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 530 | | MDRV_SCREEN_SIZE(640, 480) |
| 531 | | MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 192-1) |
| 532 | | MDRV_PALETTE_LENGTH(2) |
| 533 | | MDRV_PALETTE_INIT(black_and_white) |
| 509 | /* video hardware */ |
| 510 | MDRV_SCREEN_ADD("screen", RASTER) |
| 511 | MDRV_SCREEN_REFRESH_RATE(60) |
| 512 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 513 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 514 | MDRV_SCREEN_SIZE(640, 480) |
| 515 | MDRV_SCREEN_VISIBLE_AREA(0, 320-1, 0, 192-1) |
| 516 | MDRV_PALETTE_LENGTH(2) |
| 517 | MDRV_PALETTE_INIT(black_and_white) |
| 534 | 518 | MDRV_GFXDECODE(mycom) |
| 535 | 519 | |
| 536 | 520 | MDRV_MC6845_ADD("crtc", H46505, XTAL_3_579545MHz/4, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ |
| 537 | 521 | |
| 538 | | MDRV_VIDEO_START(mycom) |
| 539 | | MDRV_VIDEO_UPDATE(mycom) |
| 522 | MDRV_VIDEO_START(mycom) |
| 523 | MDRV_VIDEO_UPDATE(mycom) |
| 540 | 524 | |
| 541 | 525 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 542 | | |
| 526 | MDRV_SOUND_WAVE_ADD("wave", "cassette") |
| 527 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 543 | 528 | MDRV_SOUND_ADD("sn1", SN76489A, 1996800) // unknown clock / divider |
| 544 | 529 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 530 | |
| 531 | /* Devices */ |
| 532 | MDRV_CASSETTE_ADD( "cassette", default_cassette_config ) |
| 533 | MDRV_WD179X_ADD("fdc", wd1771_intf) // WD1771 |
| 545 | 534 | MACHINE_CONFIG_END |
| 546 | 535 | |
| 547 | 536 | /* ROM definition */ |
| 548 | 537 | ROM_START( mycom ) |
| 549 | | ROM_REGION( 0x14000, "maincpu", ROMREGION_ERASEFF ) |
| 550 | | ROM_LOAD( "bios.rom", 0xc000, 0x3000, CRC(e6f50355) SHA1(5d3acea360c0a8ab547db03a43e1bae5125f9c2a)) |
| 551 | | ROM_LOAD( "basic.rom",0xf000, 0x1000, CRC(3b077465) SHA1(777427182627f371542c5e0521ed3ca1466a90e1)) |
| 538 | ROM_REGION( 0x14000, "maincpu", ROMREGION_ERASEFF ) |
| 539 | ROM_LOAD( "bios.rom", 0xc000, 0x3000, CRC(e6f50355) SHA1(5d3acea360c0a8ab547db03a43e1bae5125f9c2a) ) |
| 540 | ROM_LOAD( "basic.rom",0xf000, 0x1000, CRC(3b077465) SHA1(777427182627f371542c5e0521ed3ca1466a90e1) ) |
| 552 | 541 | |
| 553 | 542 | ROM_REGION( 0x0800, "vram", ROMREGION_ERASE00 ) |
| 554 | 543 | |
| 555 | | ROM_REGION( 0x0800, "gfx", ROMREGION_ERASEFF ) |
| 556 | | ROM_LOAD( "font.rom", 0x0000, 0x0800, CRC(4039bb6f) SHA1(086ad303bf4bcf983fd6472577acbf744875fea8)) |
| 544 | ROM_REGION( 0x0800, "gfx", 0 ) |
| 545 | ROM_LOAD( "font.rom", 0x0000, 0x0800, CRC(4039bb6f) SHA1(086ad303bf4bcf983fd6472577acbf744875fea8) ) |
| 557 | 546 | ROM_END |
| 558 | 547 | |
| 559 | 548 | /* Driver */ |
| 560 | 549 | |
| 561 | 550 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 562 | | COMP( 1981, mycom, 0, 0, mycom, mycom, 0, "Japan Electronics College", "MYCOMZ-80A", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 551 | COMP( 1981, mycom, 0, 0, mycom, mycom, mycom, "Japan Electronics College", "MYCOMZ-80A", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 563 | 552 | |