src/mess/drivers/dim68k.c
| r9919 | r9920 | |
| 4 | 4 | |
| 5 | 5 | 28/12/2011 Skeleton driver. |
| 6 | 6 | |
| 7 | This computer had the facility for plug-in cards to emulate popular |
| 8 | computers of the time such as apple, trs80, kaypro, etc. The floppy |
| 9 | disk parameters could be set to be able to read the disks of the |
| 10 | various systems, or you create any other format you wished. |
| 11 | |
| 12 | There is no schematic available, and no native software exists (afaik). |
| 13 | So, without a boot disk, cannot proceed very far. |
| 14 | |
| 15 | ToDo: |
| 16 | |
| 17 | - Floppy controller |
| 18 | - Floppy formats (not sure if MESS supports user-defined formats) |
| 19 | - Banking |
| 20 | - Graphics display (including colour and video_control options) |
| 21 | - DUART |
| 22 | - RTC |
| 23 | - RS232 interface |
| 24 | - Keyboard |
| 25 | - Centronics printer |
| 26 | - Video-high |
| 27 | - Video-reset |
| 28 | - Game switches, paddles and timers |
| 29 | - The plug-in boards |
| 30 | - Emulator trap function |
| 31 | |
| 7 | 32 | ****************************************************************************/ |
| 8 | 33 | #define ADDRESS_MAP_MODERN |
| 9 | 34 | |
| r9919 | r9920 | |
| 91 | 116 | |
| 92 | 117 | WRITE16_MEMBER( dim68k_state::dim68k_video_control_w ) |
| 93 | 118 | { |
| 94 | | /* D7 0 = Hires/Graphics; 1= Lores/Text |
| 95 | | D6 0 = 8 dots per character; 1 = 7 dots |
| 96 | | D5 0 = CRTC and CPU run Asynchronously; 1 = Synchronously |
| 97 | | D4,D3 Dot clock 00=14MHz; 01=3.58MHz; 10=7MHz; 11=1.79MHz |
| 98 | | D2 0 = Screen On; 1 = Off |
| 99 | | D1 0 = Standard Chars & LoRes; 1 = Alternate Chars & HiRes |
| 100 | | D0 0 = Non-Mixed (all text or all Graphics); 1 = Mixed (Colour Graphics and Monochrome Text) |
| 119 | /* D7 0 = Hires/Graphics; 1= Lores/Text [not emulated yet] |
| 120 | D6 0 = 8 dots per character; 1 = 7 dots [emulated] |
| 121 | D5 0 = CRTC and CPU run Asynchronously; 1 = Synchronously [won't be emulated] |
| 122 | D4,D3 Dot clock: 00=14MHz; 01=3.58MHz; 10=7MHz; 11=1.79MHz [emulated] |
| 123 | D2 0 = Screen On; 1 = Off [emulated] |
| 124 | D1 0 = Standard Chars & LoRes; 1 = Alternate Chars & HiRes [not emulated yet] |
| 125 | D0 0 = Non-Mixed (all text or all Graphics); 1 = Mixed (Colour Graphics and Monochrome Text) [not emulated yet] |
| 101 | 126 | */ |
| 127 | mc6845_set_hpixels_per_column(m_crtc, (data & 0x40) ? 7 : 8); |
| 102 | 128 | m_video_control = data; |
| 129 | |
| 130 | switch (data & 0x18) |
| 131 | { |
| 132 | case 0x00: mc6845_set_clock(m_crtc, XTAL_14MHz); |
| 133 | break; |
| 134 | case 0x08: mc6845_set_clock(m_crtc, XTAL_3_579545MHz); |
| 135 | break; |
| 136 | case 0x10: mc6845_set_clock(m_crtc, XTAL_14MHz / 2); |
| 137 | break; |
| 138 | case 0x18: mc6845_set_clock(m_crtc, XTAL_3_579545MHz / 2); |
| 139 | break; |
| 140 | } |
| 103 | 141 | } |
| 104 | 142 | |
| 105 | 143 | WRITE16_MEMBER( dim68k_state::dim68k_video_reset_w ) |
| r9919 | r9920 | |
| 127 | 165 | |
| 128 | 166 | static ADDRESS_MAP_START(dim68k_mem, ADDRESS_SPACE_PROGRAM, 16, dim68k_state) |
| 129 | 167 | ADDRESS_MAP_UNMAP_HIGH |
| 130 | | AM_RANGE(0x00000000, 0x00feffff) AM_RAM AM_BASE(ram) // 16MB RAM / ROM at boot |
| 131 | | AM_RANGE(0x00ff0000, 0x00ff1fff) AM_ROM AM_REGION("user1",0) |
| 168 | AM_RANGE(0x00000000, 0x00feffff) AM_RAM AM_BASE(ram) // 16MB RAM / ROM at boot |
| 169 | AM_RANGE(0x00ff0000, 0x00ff1fff) AM_ROM AM_REGION("bootrom", 0) |
| 132 | 170 | AM_RANGE(0x00ff2000, 0x00ff7fff) AM_RAM // Graphics Video RAM |
| 133 | 171 | AM_RANGE(0x00ff8000, 0x00ff8001) AM_DEVREADWRITE8_LEGACY("crtc", mc6845_status_r, mc6845_address_w, 0xff) |
| 134 | 172 | AM_RANGE(0x00ff8002, 0x00ff8003) AM_DEVREADWRITE8_LEGACY("crtc", mc6845_register_r, mc6845_register_w, 0xff) |
| r9919 | r9920 | |
| 160 | 198 | static MACHINE_RESET(dim68k) |
| 161 | 199 | { |
| 162 | 200 | dim68k_state *state = machine->driver_data<dim68k_state>(); |
| 163 | | UINT8* user1 = machine->region("user1")->base(); |
| 201 | UINT8* ROM = machine->region("bootrom")->base(); |
| 164 | 202 | |
| 165 | | memcpy((UINT8*)state->ram,user1,0x20000); |
| 203 | memcpy((UINT8*)state->ram, ROM, 0x2000); |
| 166 | 204 | |
| 167 | 205 | machine->device("maincpu")->reset(); |
| 168 | 206 | } |
| r9919 | r9920 | |
| 180 | 218 | return 0; |
| 181 | 219 | } |
| 182 | 220 | |
| 183 | | // Text-only; graphics isn't emulated yet |
| 221 | // Text-only; graphics isn't emulated yet. Need to find out if hardware cursor is used. |
| 184 | 222 | MC6845_UPDATE_ROW( dim68k_update_row ) |
| 185 | 223 | { |
| 186 | 224 | dim68k_state *state = device->machine->driver_data<dim68k_state>(); |
| 187 | 225 | UINT8 chr,gfx,x,xx,inv; |
| 188 | | UINT16 dchr; |
| 189 | | |
| 226 | UINT16 chr16=0x2020; // set to spaces if screen is off |
| 190 | 227 | UINT16 *p = BITMAP_ADDR16(bitmap, y, 0); |
| 228 | UINT8 screen_on = ~state->m_video_control & 4; |
| 229 | UINT8 dot8 = ~state->m_video_control & 40; |
| 191 | 230 | |
| 192 | 231 | // need to divide everything in half to cater for 16-bit reads |
| 193 | 232 | x_count /= 2; |
| 194 | 233 | ma /= 2; |
| 195 | 234 | xx = 0; |
| 196 | 235 | |
| 236 | if (!screen_on) |
| 237 | cursor_x = 0xff; // disable cursor if screen is off |
| 238 | |
| 197 | 239 | for (x = 0; x < x_count; x++) |
| 198 | 240 | { |
| 199 | | dchr = state->ram[ma+x]; // reads 2 characters |
| 241 | if (screen_on) |
| 242 | chr16 = state->ram[ma+x]; // reads 2 characters |
| 200 | 243 | |
| 201 | 244 | inv=0; |
| 202 | 245 | if (xx == cursor_x) inv=0xff; |
| 203 | 246 | xx++; |
| 204 | 247 | |
| 205 | | chr = dchr>>8; |
| 248 | chr = chr16>>8; |
| 206 | 249 | gfx = state->FNT[(chr<<4) | ra] ^ inv ^ ((chr & 0x80) ? 0xff : 0); |
| 207 | 250 | *p++ = ( gfx & 0x80 ) ? 1 : 0; |
| 208 | 251 | *p++ = ( gfx & 0x40 ) ? 1 : 0; |
| r9919 | r9920 | |
| 211 | 254 | *p++ = ( gfx & 0x08 ) ? 1 : 0; |
| 212 | 255 | *p++ = ( gfx & 0x04 ) ? 1 : 0; |
| 213 | 256 | *p++ = ( gfx & 0x02 ) ? 1 : 0; |
| 214 | | *p++ = ( gfx & 0x01 ) ? 1 : 0; |
| 257 | if (dot8) *p++ = ( gfx & 0x01 ) ? 1 : 0; |
| 215 | 258 | |
| 216 | 259 | inv = 0; |
| 217 | 260 | if (xx == cursor_x) inv=0xff; |
| 218 | 261 | xx++; |
| 219 | 262 | |
| 220 | | chr = dchr; |
| 263 | chr = chr16; |
| 221 | 264 | gfx = state->FNT[(chr<<4) | ra] ^ inv ^ ((chr & 0x80) ? 0xff : 0); |
| 222 | 265 | *p++ = ( gfx & 0x80 ) ? 1 : 0; |
| 223 | 266 | *p++ = ( gfx & 0x40 ) ? 1 : 0; |
| r9919 | r9920 | |
| 226 | 269 | *p++ = ( gfx & 0x08 ) ? 1 : 0; |
| 227 | 270 | *p++ = ( gfx & 0x04 ) ? 1 : 0; |
| 228 | 271 | *p++ = ( gfx & 0x02 ) ? 1 : 0; |
| 229 | | *p++ = ( gfx & 0x01 ) ? 1 : 0; |
| 272 | if (dot8) *p++ = ( gfx & 0x01 ) ? 1 : 0; |
| 230 | 273 | } |
| 231 | 274 | } |
| 232 | 275 | |
| r9919 | r9920 | |
| 317 | 360 | */ |
| 318 | 361 | /* ROM definition */ |
| 319 | 362 | ROM_START( dim68k ) |
| 320 | | ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF ) |
| 363 | ROM_REGION( 0x2000, "bootrom", ROMREGION_ERASEFF ) |
| 321 | 364 | ROM_LOAD16_BYTE( "mc103e.bin", 0x0000, 0x1000, CRC(4730c902) SHA1(5c4bb79ad22def721a22eb63dd05e0391c8082be)) |
| 322 | 365 | ROM_LOAD16_BYTE( "mc104.bin", 0x0001, 0x1000, CRC(14b04575) SHA1(43e15d9ebe1c9c1bf1bcfc1be3899a49e6748200)) |
| 323 | 366 | |