src/mess/drivers/bml3.c
| r8629 | r8630 | |
| 1 | 1 | /*************************************************************************** |
| 2 | | |
| 2 | |
| 3 | 3 | Hitachi Basic Master Level 3 (MB-6890) |
| 4 | 4 | |
| 5 | 5 | 13/07/2010 Skeleton driver. |
| r8629 | r8630 | |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "cpu/m6809/m6809.h" |
| 11 | #include "video/mc6845.h" |
| 11 | 12 | |
| 13 | static VIDEO_START( bml3 ) |
| 14 | { |
| 15 | } |
| 16 | |
| 17 | static VIDEO_UPDATE( bml3 ) |
| 18 | { |
| 19 | return 0; |
| 20 | } |
| 21 | |
| 22 | static WRITE8_HANDLER( bml3_6845_w ) |
| 23 | { |
| 24 | static int addr_latch; |
| 25 | |
| 26 | if(offset == 0) |
| 27 | { |
| 28 | addr_latch = data; |
| 29 | mc6845_address_w(space->machine->device("crtc"), 0,data); |
| 30 | } |
| 31 | else |
| 32 | { |
| 33 | /*if(addr_latch == 0x0a) |
| 34 | cursor_raster = data; |
| 35 | if(addr_latch == 0x0e) |
| 36 | cursor_addr = ((data<<8) & 0x3f00) | (cursor_addr & 0xff); |
| 37 | else if(addr_latch == 0x0f) |
| 38 | cursor_addr = (cursor_addr & 0x3f00) | (data & 0xff);*/ |
| 39 | |
| 40 | mc6845_register_w(space->machine->device("crtc"), 0,data); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | /* Note: this custom code is there just for simplicity, it'll be nuked in the end */ |
| 45 | static READ8_HANDLER( bml3_io_r ) |
| 46 | { |
| 47 | static UINT8 *rom = memory_region(space->machine, "maincpu"); |
| 48 | |
| 49 | if(offset < 0xc0) |
| 50 | { |
| 51 | logerror("I/O read [%02x] at PC=%04x\n",offset,cpu_get_pc(space->cpu)); |
| 52 | return 0; |
| 53 | } |
| 54 | |
| 55 | if(offset == 0xc8) //this seems the keyboard status |
| 56 | return 0; |
| 57 | |
| 58 | /* TODO: pretty sure that there's a bankswitch for this */ |
| 59 | return rom[offset+0xff00]; |
| 60 | } |
| 61 | |
| 62 | static WRITE8_HANDLER( bml3_io_w ) |
| 63 | { |
| 64 | if(offset == 0xc6 || offset == 0xc7) { bml3_6845_w(space,offset-0xc6,data); } |
| 65 | else |
| 66 | { |
| 67 | logerror("I/O write %02x -> [%02x] at PC=%04x\n",data,offset,cpu_get_pc(space->cpu)); |
| 68 | } |
| 69 | } |
| 70 | |
| 12 | 71 | static ADDRESS_MAP_START(bml3_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 13 | 72 | ADDRESS_MAP_UNMAP_HIGH |
| 14 | | AM_RANGE(0x0000, 0x9FFF) AM_RAM |
| 15 | | AM_RANGE(0xA000, 0xFFFF) AM_ROM |
| 73 | AM_RANGE(0x0000, 0x9fff) AM_RAM |
| 74 | AM_RANGE(0xff00, 0xffff) AM_READWRITE(bml3_io_r,bml3_io_w) |
| 75 | AM_RANGE(0xa000, 0xffff) AM_ROM |
| 16 | 76 | ADDRESS_MAP_END |
| 17 | 77 | |
| 18 | 78 | |
| r8629 | r8630 | |
| 21 | 81 | INPUT_PORTS_END |
| 22 | 82 | |
| 23 | 83 | |
| 24 | | static MACHINE_RESET(bml3) |
| 25 | | { |
| 26 | | } |
| 27 | | |
| 28 | | static VIDEO_START( bml3 ) |
| 84 | static MACHINE_RESET(bml3) |
| 29 | 85 | { |
| 30 | 86 | } |
| 31 | 87 | |
| 32 | | static VIDEO_UPDATE( bml3 ) |
| 88 | static const mc6845_interface mc6845_intf = |
| 33 | 89 | { |
| 34 | | return 0; |
| 35 | | } |
| 90 | "screen", /* screen we are acting on */ |
| 91 | 8, /* number of pixels per video memory address */ |
| 92 | NULL, /* before pixel update callback */ |
| 93 | NULL, /* row update callback */ |
| 94 | NULL, /* after pixel update callback */ |
| 95 | DEVCB_NULL, /* callback for display state changes */ |
| 96 | DEVCB_NULL, /* callback for cursor state changes */ |
| 97 | DEVCB_NULL, /* HSYNC callback */ |
| 98 | DEVCB_NULL, /* VSYNC callback */ |
| 99 | NULL /* update address callback */ |
| 100 | }; |
| 36 | 101 | |
| 102 | |
| 37 | 103 | static MACHINE_DRIVER_START( bml3 ) |
| 38 | 104 | /* basic machine hardware */ |
| 39 | 105 | MDRV_CPU_ADD("maincpu",M6809, XTAL_1MHz) |
| 40 | 106 | MDRV_CPU_PROGRAM_MAP(bml3_mem) |
| 41 | 107 | |
| 42 | 108 | MDRV_MACHINE_RESET(bml3) |
| 43 | | |
| 109 | |
| 44 | 110 | /* video hardware */ |
| 45 | 111 | MDRV_SCREEN_ADD("screen", RASTER) |
| 46 | | MDRV_SCREEN_REFRESH_RATE(50) |
| 112 | MDRV_SCREEN_REFRESH_RATE(60) |
| 47 | 113 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 48 | 114 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 49 | 115 | MDRV_SCREEN_SIZE(640, 480) |
| r8629 | r8630 | |
| 51 | 117 | MDRV_PALETTE_LENGTH(2) |
| 52 | 118 | MDRV_PALETTE_INIT(black_and_white) |
| 53 | 119 | |
| 120 | MDRV_MC6845_ADD("crtc", H46505, XTAL_3_579545MHz, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ |
| 121 | |
| 122 | |
| 54 | 123 | MDRV_VIDEO_START(bml3) |
| 55 | 124 | MDRV_VIDEO_UPDATE(bml3) |
| 56 | 125 | MACHINE_DRIVER_END |