src/mess/video/mbee.c
| r9400 | r9401 | |
| 218 | 218 | if( port == 7 && bit == 1 ) data = 1; /* Control */ |
| 219 | 219 | if( port == 0 && bit == 4 ) data = 1; /* D */ |
| 220 | 220 | } |
| 221 | #if 0 |
| 222 | // this key doesn't appear on any keyboard afaik |
| 221 | 223 | else |
| 222 | 224 | if( extra & 0x10 ) /* extra: insert */ |
| 223 | 225 | { |
| 224 | 226 | if( port == 7 && bit == 1 ) data = 1; /* Control */ |
| 225 | 227 | if( port == 2 && bit == 6 ) data = 1; /* V */ |
| 226 | 228 | } |
| 229 | #endif |
| 227 | 230 | } |
| 228 | 231 | |
| 229 | 232 | if( data ) |
| r9400 | r9401 | |
| 254 | 257 | screen_device *screen = screen_first(*space->machine); |
| 255 | 258 | const rectangle &visarea = screen->visible_area(); |
| 256 | 259 | |
| 257 | | UINT8 data = sy6545_status; |
| 260 | UINT8 data = sy6545_status; // bit 6 = lpen strobe, bit 7 = update strobe |
| 258 | 261 | int y = space->machine->primary_screen->vpos(); |
| 259 | 262 | |
| 260 | 263 | if( y < visarea.min_y || y > visarea.max_y ) |
| r9400 | r9401 | |
| 265 | 268 | |
| 266 | 269 | READ8_HANDLER ( m6545_data_r ) |
| 267 | 270 | { |
| 268 | | int addr, data = 0; |
| 271 | UINT16 addr; |
| 272 | UINT8 data = mc6845_register_r(mc6845, 0); |
| 269 | 273 | |
| 270 | 274 | switch( sy6545_ind ) |
| 271 | 275 | { |
| r9400 | r9401 | |
| 300 | 304 | switch( sy6545_ind ) |
| 301 | 305 | { |
| 302 | 306 | case 12: |
| 303 | | data &= 0x3f; |
| 307 | data &= 0x3f; // select alternate character set |
| 304 | 308 | if( sy6545_reg[12] != data ) |
| 305 | 309 | memcpy(gfxram, memory_region(space->machine, "gfx") + (((data & 0x30) == 0x20) << 11), 0x800); |
| 306 | 310 | break; |
| r9400 | r9401 | |
| 412 | 416 | |
| 413 | 417 | MC6845_ON_UPDATE_ADDR_CHANGED( mbee_update_addr ) |
| 414 | 418 | { |
| 415 | | /* not sure what goes in here - parameters passed are device, addr, strobe */ |
| 419 | /* not sure what goes in here - parameters passed are device, address, strobe */ |
| 416 | 420 | } |
| 417 | 421 | |
| 418 | 422 | MC6845_ON_UPDATE_ADDR_CHANGED( mbee256_update_addr ) |
src/mess/video/super80.c
| r9400 | r9401 | |
| 2 | 2 | |
| 3 | 3 | /* Notes on using MAME MC6845 Device (MMD). |
| 4 | 4 | 1. Speed of MMD is about 20% slower than pre-MMD coding |
| 5 | | 2. Undocumented cursor start and end-lines is not supported by MMD, so we do it here |
| 6 | | 3. MMD doesn't support auto-screen-resize, so we do it here. */ |
| 5 | 2. Undocumented cursor start and end-lines is not supported by MMD, so we do it here. */ |
| 7 | 6 | |
| 8 | 7 | |
| 9 | 8 | #include "emu.h" |
| r9400 | r9401 | |
| 289 | 288 | FNT = memory_region(machine, "gfx1"); |
| 290 | 289 | } |
| 291 | 290 | |
| 291 | /**************************** I/O PORTS *****************************************************************/ |
| 292 | |
| 293 | WRITE8_HANDLER( super80_f1_w ) |
| 294 | { |
| 295 | vidpg = (data & 0xfe) << 8; |
| 296 | current_charset = data & 1; |
| 297 | } |
| 298 | |
| 292 | 299 | /*--------------------------------------------------------------- |
| 293 | 300 | |
| 294 | 301 | Super-80R and Super-80V |
| r9400 | r9401 | |
| 298 | 305 | static UINT8 mc6845_cursor[16]; // cursor shape |
| 299 | 306 | static UINT8 mc6845_reg[20]; /* registers */ |
| 300 | 307 | static UINT8 mc6845_ind; /* register index */ |
| 301 | | static const UINT8 mc6845_mask[]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0}; |
| 308 | static const UINT8 mc6845_mask[32]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0}; |
| 302 | 309 | static running_device *mc6845; |
| 303 | 310 | static UINT8 framecnt=0; |
| 304 | 311 | static UINT8 speed,flash; |
| r9400 | r9401 | |
| 390 | 397 | if (curs_type == 3) for (i = r11; i < r10;i++) mc6845_cursor[i]=0; // now take a bite out of the middle |
| 391 | 398 | } |
| 392 | 399 | |
| 393 | | /* Resize the screen within the limits of the hardware. Expand the image to fill the screen area */ |
| 394 | | static void mc6845_screen_configure(running_machine *machine) |
| 395 | | { |
| 396 | | rectangle visarea; |
| 397 | | |
| 398 | | UINT16 width = mc6845_reg[1]*7-1; // width in pixels |
| 399 | | UINT16 height = mc6845_reg[6]*(mc6845_reg[9]+1)-1; // height in pixels |
| 400 | | UINT16 bytes = mc6845_reg[1]*mc6845_reg[6]-1; // video ram needed -1 |
| 401 | | |
| 402 | | /* Resize the screen */ |
| 403 | | visarea.min_x = 0; |
| 404 | | visarea.max_x = width-1; |
| 405 | | visarea.min_y = 0; |
| 406 | | visarea.max_y = height-1; |
| 407 | | if ((width < 610) && (height < 460) && (bytes < 0x1000)) /* bounds checking to prevent an assert or violation */ |
| 408 | | machine->primary_screen->set_visible_area(0, width, 0, height); |
| 409 | | } |
| 410 | | |
| 411 | 400 | VIDEO_START( super80v ) |
| 412 | 401 | { |
| 413 | 402 | mc6845 = machine->device("crtc"); |
| r9400 | r9401 | |
| 492 | 481 | |
| 493 | 482 | WRITE8_HANDLER( super80v_11_w ) |
| 494 | 483 | { |
| 495 | | if (mc6845_ind < 16) mc6845_reg[mc6845_ind] = data & mc6845_mask[mc6845_ind]; /* save data in register */ |
| 496 | | if ((mc6845_ind == 1) || (mc6845_ind == 6) || (mc6845_ind == 9)) mc6845_screen_configure(space->machine); /* adjust screen size */ |
| 497 | | if ((mc6845_ind > 8) && (mc6845_ind < 12)) mc6845_cursor_configure(); /* adjust cursor shape - remove when mame fixed */ |
| 484 | mc6845_reg[mc6845_ind] = data & mc6845_mask[mc6845_ind]; /* save data in register */ |
| 498 | 485 | mc6845_register_w( mc6845, 0, data ); |
| 486 | if ((mc6845_ind > 8) && (mc6845_ind < 12)) mc6845_cursor_configure(); /* adjust cursor shape - remove when mame fixed */ |
| 499 | 487 | } |
| 500 | | |
| 501 | | WRITE8_HANDLER( super80_f1_w ) |
| 502 | | { |
| 503 | | vidpg = (data & 0xfe) << 8; |
| 504 | | current_charset = data & 1; |
| 505 | | } |
| 506 | | |