src/mess/video/sed1330.c
| r4835 | r4836 | |
| 1 | 1 | /********************************************************************** |
| 2 | 2 | |
| 3 | | SED1330 LCD Timing Controller emulation |
| 3 | Seiko-Epson SED1330 LCD Timing Controller emulation |
| 4 | 4 | |
| 5 | 5 | Copyright MESS Team. |
| 6 | 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| r4835 | r4836 | |
| 11 | 11 | |
| 12 | 12 | TODO: |
| 13 | 13 | |
| 14 | | - everything |
| 14 | - CSRDIR is +1 or +AP, but no command is written to select? |
| 15 | - garbage on screen |
| 16 | - FX > 8 |
| 15 | 17 | |
| 16 | 18 | */ |
| 17 | 19 | |
| r4835 | r4836 | |
| 22 | 24 | PARAMETERS |
| 23 | 25 | ***************************************************************************/ |
| 24 | 26 | |
| 25 | | #define LOG 1 |
| 27 | #define LOG |
| 26 | 28 | |
| 27 | 29 | #define SED1330_INSTRUCTION_SYSTEM_SET 0x40 |
| 28 | 30 | #define SED1330_INSTRUCTION_SLEEP_IN 0x53 |
| 29 | | #define SED1330_INSTRUCTION_DISP_ON 0x58 |
| 30 | | #define SED1330_INSTRUCTION_DISP_OFF 0x59 |
| 31 | #define SED1330_INSTRUCTION_DISP_ON 0x59 |
| 32 | #define SED1330_INSTRUCTION_DISP_OFF 0x58 |
| 31 | 33 | #define SED1330_INSTRUCTION_SCROLL 0x44 |
| 32 | 34 | #define SED1330_INSTRUCTION_CSRFORM 0x5d |
| 33 | 35 | #define SED1330_INSTRUCTION_CGRAM_ADR 0x5c |
| r4835 | r4836 | |
| 47 | 49 | #define SED1330_CSRDIR_UP 0x10 |
| 48 | 50 | #define SED1330_CSRDIR_DOWN 0x11 |
| 49 | 51 | |
| 50 | | static const int SED1330_CYCLES[] = { |
| 51 | | 4, 4, 4, 4, 4, -1, -1, -1, 4, 4, 4, 4, 6, 6, 36, 36 |
| 52 | | }; |
| 52 | #define SED1330_MX_OR 0x00 |
| 53 | #define SED1330_MX_XOR 0x01 |
| 54 | #define SED1330_MX_AND 0x10 |
| 55 | #define SED1330_MX_PRIORITY_OR 0x11 |
| 53 | 56 | |
| 54 | | #define SED1330_MODE_EXTERNAL_CG 0x01 /* not supported */ |
| 55 | | #define SED1330_MODE_GRAPHIC 0x02 /* text mode not supported */ |
| 56 | | #define SED1330_MODE_CURSOR 0x04 /* not supported */ |
| 57 | | #define SED1330_MODE_BLINK 0x08 /* not supported */ |
| 58 | | #define SED1330_MODE_MASTER 0x10 /* not supported */ |
| 59 | | #define SED1330_MODE_DISPLAY_ON 0x20 |
| 57 | #define SED1330_FC_OFF 0x00 |
| 58 | #define SED1330_FC_NO_FLASH 0x01 |
| 59 | #define SED1330_FC_FLASH_32 0x10 |
| 60 | #define SED1330_FC_FLASH_16 0x11 |
| 60 | 61 | |
| 61 | 62 | /*************************************************************************** |
| 62 | 63 | TYPE DEFINITIONS |
| r4835 | r4836 | |
| 72 | 73 | |
| 73 | 74 | UINT8 ir; /* instruction register */ |
| 74 | 75 | |
| 76 | int d; /* display enabled */ |
| 77 | |
| 75 | 78 | int m0; /* */ |
| 76 | 79 | int m1; /* */ |
| 77 | 80 | int m2; /* */ |
| r4835 | r4836 | |
| 83 | 86 | int cr; /* address range covered by 1 display line */ |
| 84 | 87 | int tcr; /* line length (including horizontal blanking) */ |
| 85 | 88 | int lf; /* frame height in lines */ |
| 86 | | UINT16 ap; /* horizontal address range of the virtual screen */ |
| 89 | UINT16 ap; /* horizontal address pitch of the virtual screen */ |
| 87 | 90 | |
| 91 | UINT16 sad1; /* scroll start address */ |
| 92 | UINT16 sad2; /* scroll start address */ |
| 93 | UINT16 sad3; /* scroll start address */ |
| 94 | UINT16 sad4; /* scroll start address */ |
| 95 | int sl1; /* scroll block screen lines */ |
| 96 | int sl2; /* scroll block screen lines */ |
| 88 | 97 | int hdotscr; /* horizontal dot scroll */ |
| 89 | 98 | |
| 90 | 99 | UINT16 csr; /* cursor address register */ |
| 91 | | int csrdir; /* cursor direction */ |
| 100 | int cd; /* cursor direction */ |
| 101 | int crx; /* horizontal cursor size */ |
| 102 | int cry; /* vertical cursor size/location */ |
| 103 | int cm; /* cursor shape (0=underscore, 1=block) */ |
| 104 | int fc; /* cursor flash control */ |
| 105 | int fp; /* cursor flash control */ |
| 92 | 106 | |
| 107 | UINT16 sag; /* character generator RAM start address */ |
| 108 | |
| 109 | int mx; /* screen layer composition method */ |
| 110 | int dm; /* display mode for screen blocks 1, 3 */ |
| 111 | int ov; /* graphics mode layer composition */ |
| 112 | |
| 93 | 113 | int pbc; /* parameter byte counter */ |
| 94 | 114 | |
| 95 | 115 | /* devices */ |
| r4835 | r4836 | |
| 158 | 178 | |
| 159 | 179 | if (LOG) logerror("SED1330 '%s' Status Read: %s\n", device->tag, sed1330->bf ? "busy" : "ready"); |
| 160 | 180 | |
| 161 | | return sed1330->bf << 6; |
| 181 | return !sed1330->bf << 6; |
| 162 | 182 | } |
| 163 | 183 | |
| 164 | 184 | /*------------------------------------------------- |
| r4835 | r4836 | |
| 180 | 200 | READ8_DEVICE_HANDLER( sed1330_data_r ) |
| 181 | 201 | { |
| 182 | 202 | // sed1330_t *sed1330 = get_safe_token(device); |
| 183 | | |
| 203 | logerror("SED1330 '%s' read data\n"); |
| 184 | 204 | return 0; |
| 185 | 205 | } |
| 186 | 206 | |
| r4835 | r4836 | |
| 207 | 227 | if (LOG) |
| 208 | 228 | { |
| 209 | 229 | logerror("SED1330 '%s' %s CG ROM\n", device->tag, BIT(data, 0) ? "External" : "Internal"); |
| 210 | | logerror("SED1330 '%s' D6 Correction %s\n", device->tag, BIT(data, 1) ? "enabled" : "disabled"); |
| 230 | logerror("SED1330 '%s' D6 Correction: %s\n", device->tag, BIT(data, 1) ? "enabled" : "disabled"); |
| 211 | 231 | logerror("SED1330 '%s' Character Height: %u\n", device->tag, BIT(data, 2) ? 16 : 8); |
| 212 | 232 | logerror("SED1330 '%s' %s Panel Drive\n", device->tag, BIT(data, 3) ? "Dual" : "Single"); |
| 213 | 233 | logerror("SED1330 '%s' Screen Top-Line Correction: %s\n", device->tag, BIT(data, 5) ? "disabled" : "enabled"); |
| r4835 | r4836 | |
| 232 | 252 | |
| 233 | 253 | case 3: |
| 234 | 254 | sed1330->cr = data + 1; |
| 255 | if (LOG) logerror("SED1330 '%s' Visible Characters Per Line: %u\n", device->tag, sed1330->cr); |
| 235 | 256 | break; |
| 236 | 257 | |
| 237 | 258 | case 4: |
| 238 | 259 | sed1330->tcr = data + 1; |
| 260 | if (LOG) logerror("SED1330 '%s' Total Characters Per Line: %u\n", device->tag, sed1330->tcr); |
| 239 | 261 | break; |
| 240 | 262 | |
| 241 | 263 | case 5: |
| 242 | 264 | sed1330->lf = data + 1; |
| 265 | if (LOG) logerror("SED1330 '%s' Frame Height: %u\n", device->tag, sed1330->lf); |
| 243 | 266 | break; |
| 244 | 267 | |
| 245 | 268 | case 6: |
| r4835 | r4836 | |
| 248 | 271 | |
| 249 | 272 | case 7: |
| 250 | 273 | sed1330->ap = (data << 8) | (sed1330->ap & 0xff); |
| 274 | if (LOG) logerror("SED1330 '%s' Virtual Screen Width: %u\n", device->tag, sed1330->ap); |
| 251 | 275 | break; |
| 252 | 276 | |
| 253 | 277 | default: |
| r4835 | r4836 | |
| 257 | 281 | /* |
| 258 | 282 | case SED1330_INSTRUCTION_SLEEP_IN: |
| 259 | 283 | break; |
| 260 | | |
| 284 | */ |
| 261 | 285 | case SED1330_INSTRUCTION_DISP_ON: |
| 262 | | break; |
| 263 | | |
| 264 | 286 | case SED1330_INSTRUCTION_DISP_OFF: |
| 287 | sed1330->d = BIT(data, 0); |
| 288 | sed1330->fc = data & 0x03; |
| 289 | sed1330->fp = data >> 2; |
| 290 | if (LOG) |
| 291 | { |
| 292 | logerror("SED1330 '%s' Display: %s\n", device->tag, BIT(data, 0) ? "enabled" : "disabled"); |
| 293 | } |
| 265 | 294 | break; |
| 266 | 295 | |
| 267 | 296 | case SED1330_INSTRUCTION_SCROLL: |
| 297 | switch (sed1330->pbc) |
| 298 | { |
| 299 | case 0: |
| 300 | sed1330->sad1 = (sed1330->sad1 & 0xff00) | data; |
| 301 | break; |
| 302 | |
| 303 | case 1: |
| 304 | sed1330->sad1 = (data << 8) | (sed1330->sad1 & 0xff); |
| 305 | if (LOG) logerror("SED1330 '%s' Display Page 1 Start Address: %04x\n", device->tag, sed1330->sad1); |
| 306 | break; |
| 307 | |
| 308 | case 2: |
| 309 | sed1330->sl1 = data + 1; |
| 310 | if (LOG) logerror("SED1330 '%s' Display Page 1 Screen Lines: %u\n", device->tag, sed1330->sl1); |
| 311 | break; |
| 312 | |
| 313 | case 3: |
| 314 | sed1330->sad2 = (sed1330->sad2 & 0xff00) | data; |
| 315 | break; |
| 316 | |
| 317 | case 4: |
| 318 | sed1330->sad2 = (data << 8) | (sed1330->sad2 & 0xff); |
| 319 | if (LOG) logerror("SED1330 '%s' Display Page 2 Start Address: %04x\n", device->tag, sed1330->sad2); |
| 320 | break; |
| 321 | |
| 322 | case 5: |
| 323 | sed1330->sl2 = data + 1; |
| 324 | if (LOG) logerror("SED1330 '%s' Display Page 2 Screen Lines: %u\n", device->tag, sed1330->sl2); |
| 325 | break; |
| 326 | |
| 327 | case 6: |
| 328 | sed1330->sad3 = (sed1330->sad3 & 0xff00) | data; |
| 329 | break; |
| 330 | |
| 331 | case 7: |
| 332 | sed1330->sad3 = (data << 8) | (sed1330->sad3 & 0xff); |
| 333 | if (LOG) logerror("SED1330 '%s' Display Page 3 Start Address: %04x\n", device->tag, sed1330->sad3); |
| 334 | break; |
| 335 | |
| 336 | case 8: |
| 337 | sed1330->sad4 = (sed1330->sad4 & 0xff00) | data; |
| 338 | break; |
| 339 | |
| 340 | case 9: |
| 341 | sed1330->sad4 = (data << 8) | (sed1330->sad4 & 0xff); |
| 342 | if (LOG) logerror("SED1330 '%s' Display Page 4 Start Address: %04x\n", device->tag, sed1330->sad4); |
| 343 | break; |
| 344 | |
| 345 | default: |
| 346 | logerror("SED1330 '%s' Invalid parameter byte %02x\n", device->tag, data); |
| 347 | } |
| 268 | 348 | break; |
| 269 | 349 | |
| 270 | 350 | case SED1330_INSTRUCTION_CSRFORM: |
| 351 | switch (sed1330->pbc) |
| 352 | { |
| 353 | case 0: |
| 354 | sed1330->crx = (data & 0x0f) + 1; |
| 355 | if (LOG) logerror("SED1330 '%s' Horizontal Cursor Size: %u\n", device->tag, sed1330->crx); |
| 356 | break; |
| 357 | |
| 358 | case 1: |
| 359 | sed1330->cry = (data & 0x0f) + 1; |
| 360 | sed1330->cm = BIT(data, 7); |
| 361 | if (LOG) |
| 362 | { |
| 363 | logerror("SED1330 '%s' Vertical Cursor Location: %u\n", device->tag, sed1330->cry); |
| 364 | logerror("SED1330 '%s' Cursor Shape: %s\n", device->tag, BIT(data, 7) ? "Block" : "Underscore"); |
| 365 | } |
| 366 | break; |
| 367 | |
| 368 | default: |
| 369 | logerror("SED1330 '%s' Invalid parameter byte %02x\n", device->tag, data); |
| 370 | } |
| 271 | 371 | break; |
| 272 | 372 | |
| 273 | 373 | case SED1330_INSTRUCTION_CGRAM_ADR: |
| 374 | switch (sed1330->pbc) |
| 375 | { |
| 376 | case 0: |
| 377 | sed1330->sag = (sed1330->sag & 0xff00) | data; |
| 378 | break; |
| 379 | |
| 380 | case 1: |
| 381 | sed1330->sag = (data << 8) | (sed1330->sag & 0xff); |
| 382 | if (LOG) logerror("SED1330 '%s' Character Generator RAM Start Address: %04x\n", device->tag, sed1330->sag); |
| 383 | break; |
| 384 | |
| 385 | default: |
| 386 | logerror("SED1330 '%s' Invalid parameter byte %02x\n", device->tag, data); |
| 387 | } |
| 274 | 388 | break; |
| 275 | | */ |
| 389 | |
| 276 | 390 | case SED1330_INSTRUCTION_CSRDIR_RIGHT: |
| 277 | | sed1330->csrdir = data & 0x03; |
| 278 | | if (LOG) logerror("SED1330 '%s' Cursor Direction: Right\n", device->tag); |
| 279 | | break; |
| 280 | | /* |
| 281 | 391 | case SED1330_INSTRUCTION_CSRDIR_LEFT: |
| 282 | | sed1330->csrdir = data & 0x03; |
| 283 | | if (LOG) logerror("SED1330 '%s' Cursor Direction: Left\n", device->tag); |
| 284 | | break; |
| 285 | | |
| 286 | 392 | case SED1330_INSTRUCTION_CSRDIR_UP: |
| 287 | | sed1330->csrdir = data & 0x03; |
| 288 | | if (LOG) logerror("SED1330 '%s' Cursor Direction: Up\n", device->tag); |
| 393 | case SED1330_INSTRUCTION_CSRDIR_DOWN: |
| 394 | sed1330->cd = data & 0x03; |
| 395 | if (LOG) |
| 396 | { |
| 397 | switch (sed1330->cd) |
| 398 | { |
| 399 | case SED1330_CSRDIR_RIGHT: logerror("SED1330 '%s' Cursor Direction: Right\n", device->tag); break; |
| 400 | case SED1330_CSRDIR_LEFT: logerror("SED1330 '%s' Cursor Direction: Left\n", device->tag); break; |
| 401 | case SED1330_CSRDIR_UP: logerror("SED1330 '%s' Cursor Direction: Up\n", device->tag); break; |
| 402 | case SED1330_CSRDIR_DOWN: logerror("SED1330 '%s' Cursor Direction: Down\n", device->tag); break; |
| 403 | } |
| 404 | } |
| 289 | 405 | break; |
| 290 | 406 | |
| 291 | | case SED1330_INSTRUCTION_CSRDIR_DOWN: |
| 292 | | sed1330->csrdir = data & 0x03; |
| 293 | | if (LOG) logerror("SED1330 '%s' Cursor Direction: Down\n", device->tag); |
| 294 | | break; |
| 295 | | */ |
| 296 | 407 | case SED1330_INSTRUCTION_HDOT_SCR: |
| 297 | 408 | sed1330->hdotscr = data & 0x07; |
| 298 | 409 | if (LOG) logerror("SED1330 '%s' Horizontal Dot Scroll: %u\n", device->tag, sed1330->hdotscr); |
| 299 | 410 | break; |
| 300 | | /* |
| 411 | |
| 301 | 412 | case SED1330_INSTRUCTION_OVLAY: |
| 413 | sed1330->mx = data & 0x03; |
| 414 | sed1330->dm = (data >> 2) & 0x03; |
| 415 | sed1330->ov = BIT(data, 4); |
| 416 | |
| 417 | if (LOG) |
| 418 | { |
| 419 | switch (sed1330->mx) |
| 420 | { |
| 421 | case SED1330_MX_OR: |
| 422 | logerror("SED1330 '%s' Layered Screen Composition Method: OR\n", device->tag); |
| 423 | break; |
| 424 | |
| 425 | case SED1330_MX_XOR: |
| 426 | logerror("SED1330 '%s' Layered Screen Composition Method: Exclusive-OR\n", device->tag); |
| 427 | break; |
| 428 | |
| 429 | case SED1330_MX_AND: |
| 430 | logerror("SED1330 '%s' Layered Screen Composition Method: AND\n", device->tag); |
| 431 | break; |
| 432 | |
| 433 | case SED1330_MX_PRIORITY_OR: |
| 434 | logerror("SED1330 '%s' Layered Screen Composition Method: Priority-OR\n", device->tag); |
| 435 | break; |
| 436 | } |
| 437 | |
| 438 | logerror("SED1330 '%s' Display Page 1 Mode: %s\n", device->tag, BIT(data, 2) ? "Graphics" : "Text"); |
| 439 | logerror("SED1330 '%s' Display Page 3 Mode: %s\n", device->tag, BIT(data, 3) ? "Graphics" : "Text"); |
| 440 | logerror("SED1330 '%s' Display Composition Layers: %u\n", device->tag, BIT(data, 4) ? 3 : 2); |
| 441 | } |
| 302 | 442 | break; |
| 303 | | */ |
| 443 | |
| 304 | 444 | case SED1330_INSTRUCTION_CSRW: |
| 305 | 445 | switch (sed1330->pbc) |
| 306 | 446 | { |
| 307 | 447 | case 0: |
| 308 | 448 | sed1330->csr = (sed1330->csr & 0xff00) | data; |
| 309 | | if (LOG) logerror("SED1330 '%s' Cursor Address %04x\n", device->tag, sed1330->csr); |
| 449 | if (LOG) logerror("SED1330 '%s' Cursor Address Low %02x %04x %u\n", device->tag, data, sed1330->csr, sed1330->csr/80); |
| 310 | 450 | break; |
| 311 | 451 | |
| 312 | 452 | case 1: |
| 313 | 453 | sed1330->csr = (data << 8) | (sed1330->csr & 0xff); |
| 314 | | if (LOG) logerror("SED1330 '%s' Cursor Address %04x\n", device->tag, sed1330->csr); |
| 454 | if (LOG) logerror("SED1330 '%s' Cursor Address High %02x %04x %u\n", device->tag, data, sed1330->csr, sed1330->csr/80); |
| 315 | 455 | break; |
| 316 | 456 | |
| 317 | 457 | default: |
| r4835 | r4836 | |
| 323 | 463 | break; |
| 324 | 464 | */ |
| 325 | 465 | case SED1330_INSTRUCTION_MWRITE: |
| 466 | if (LOG) if (data) logerror("SED1330 '%s' Memory Write %02x to %04x\n", device->tag, data, sed1330->csr); |
| 467 | |
| 326 | 468 | devcb_call_write8(&sed1330->out_vd_func, sed1330->csr, data); |
| 327 | | |
| 328 | | switch (sed1330->csrdir) |
| 469 | /* |
| 470 | switch (sed1330->cd) |
| 329 | 471 | { |
| 330 | 472 | case SED1330_CSRDIR_RIGHT: |
| 331 | 473 | sed1330->csr++; |
| 332 | 474 | break; |
| 333 | | |
| 334 | | default: |
| 335 | | logerror("SED1330 '%s' Unsupported cursor direction\n", device->tag); |
| 475 | |
| 476 | case SED1330_CSRDIR_LEFT: |
| 477 | sed1330->csr--; |
| 478 | break; |
| 479 | |
| 480 | case SED1330_CSRDIR_UP: |
| 481 | sed1330->csr -= sed1330->ap; |
| 482 | break; |
| 483 | |
| 484 | case SED1330_CSRDIR_DOWN: |
| 485 | sed1330->csr += sed1330->ap; |
| 486 | break; |
| 336 | 487 | } |
| 337 | | |
| 488 | */ |
| 489 | sed1330->csr += sed1330->ap; // HACK |
| 338 | 490 | break; |
| 339 | 491 | /* |
| 340 | 492 | case SED1330_INSTRUCTION_MREAD: |
| r4835 | r4836 | |
| 346 | 498 | |
| 347 | 499 | sed1330->pbc++; |
| 348 | 500 | } |
| 349 | | #ifdef UNUSED_FUNCTION |
| 501 | |
| 350 | 502 | /*------------------------------------------------- |
| 351 | | draw_scanline - draw one scanline |
| 503 | draw_graphics_scanline - draw one scanline |
| 352 | 504 | -------------------------------------------------*/ |
| 353 | 505 | |
| 354 | | static void draw_scanline(sed1330_t *sed1330, bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 ra) |
| 506 | static void draw_graphics_scanline(sed1330_t *sed1330, bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 va) |
| 355 | 507 | { |
| 508 | int sx, x; |
| 509 | |
| 510 | for (sx = 0; sx < sed1330->cr; sx++) |
| 511 | { |
| 512 | UINT8 data = devcb_call_read8(&sed1330->in_vd_func, va++); |
| 513 | |
| 514 | for (x = 0; x < sed1330->fx; x++) |
| 515 | { |
| 516 | *BITMAP_ADDR16(bitmap, y, sed1330->hdotscr + (sx * sed1330->fx) + x) = BIT(data, 7); |
| 517 | data <<= 1; |
| 518 | } |
| 519 | } |
| 356 | 520 | } |
| 357 | 521 | |
| 358 | 522 | /*------------------------------------------------- |
| r4835 | r4836 | |
| 362 | 526 | static void update_graphics(sed1330_t *sed1330, bitmap_t *bitmap, const rectangle *cliprect) |
| 363 | 527 | { |
| 364 | 528 | } |
| 365 | | #endif |
| 529 | |
| 366 | 530 | /*------------------------------------------------- |
| 531 | update_text - draw text mode screen |
| 532 | -------------------------------------------------*/ |
| 533 | |
| 534 | static void update_text(sed1330_t *sed1330, bitmap_t *bitmap, const rectangle *cliprect) |
| 535 | { |
| 536 | int y; |
| 537 | |
| 538 | for (y = 0; y < sed1330->sl1; y++) |
| 539 | { |
| 540 | UINT16 sad2 = sed1330->sad2 + (y * sed1330->ap); |
| 541 | UINT16 sad4 = sed1330->sad4 + (y * sed1330->ap); |
| 542 | |
| 543 | /* draw graphics display page 2 scanline */ |
| 544 | draw_graphics_scanline(sed1330, bitmap, cliprect, y, sad2); |
| 545 | |
| 546 | /* draw graphics display page 4 scanline */ |
| 547 | draw_graphics_scanline(sed1330, bitmap, cliprect, y + sed1330->sl1, sad4); |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | /*------------------------------------------------- |
| 367 | 552 | sed1330_update - update screen |
| 368 | 553 | -------------------------------------------------*/ |
| 369 | 554 | |
| 370 | 555 | void sed1330_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) |
| 371 | 556 | { |
| 557 | sed1330_t *sed1330 = get_safe_token(device); |
| 558 | |
| 559 | if (sed1330->d) |
| 560 | { |
| 561 | if (sed1330->dm) |
| 562 | { |
| 563 | update_graphics(sed1330, bitmap, cliprect); |
| 564 | } |
| 565 | else |
| 566 | { |
| 567 | update_text(sed1330, bitmap, cliprect); |
| 568 | } |
| 569 | } |
| 570 | else |
| 571 | { |
| 572 | //fillbitmap(bitmap, 0); |
| 573 | } |
| 372 | 574 | } |
| 373 | 575 | |
| 374 | 576 | /*------------------------------------------------- |
| r4835 | r4836 | |
| 424 | 626 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(sed1330); break; |
| 425 | 627 | |
| 426 | 628 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 427 | | case DEVINFO_STR_NAME: strcpy(info->s, " SED1330"); break; |
| 428 | | case DEVINFO_STR_FAMILY: strcpy(info->s, " SED1330"); break; |
| 629 | case DEVINFO_STR_NAME: strcpy(info->s, "Seiko-Epson SED1330"); break; |
| 630 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Seiko-Epson SED1330"); break; |
| 429 | 631 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 430 | 632 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 431 | 633 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; |
src/mess/drivers/pc8401a.c
| r4835 | r4836 | |
| 9 | 9 | |
| 10 | 10 | /* |
| 11 | 11 | |
| 12 | NEC PC-8401A-LS "Starlet" |
| 13 | NEC PC-8500 "Studley" |
| 14 | |
| 12 | 15 | TODO: |
| 13 | 16 | |
| 14 | | - LCD controller |
| 15 | 17 | - keyboard |
| 16 | 18 | - 8251 USART |
| 17 | 19 | - 8255 ports |
| r4835 | r4836 | |
| 22 | 24 | * PC-8441A CRT / Disk Interface |
| 23 | 25 | * PC-8461A 1200 Baud Modem |
| 24 | 26 | * PC-8407A 128KB RAM Expansion |
| 27 | * PC-8508A ROM/RAM Cartridge |
| 25 | 28 | |
| 26 | 29 | */ |
| 27 | 30 | |
| r4835 | r4836 | |
| 90 | 93 | break; |
| 91 | 94 | |
| 92 | 95 | case 3: /* RAM cartridge */ |
| 93 | | memory_install_readwrite8_handler(program, 0x8000, 0xbfff, 0, 0, SMH_UNMAP, SMH_UNMAP); |
| 94 | | // memory_set_bank(machine, 3, 3); // TODO or 4 |
| 96 | if (mess_ram_size > 64) |
| 97 | { |
| 98 | memory_install_readwrite8_handler(program, 0x8000, 0xbfff, 0, 0, SMH_BANK(3), SMH_BANK(3)); |
| 99 | memory_set_bank(machine, 3, 3); // TODO or 4 |
| 100 | } |
| 101 | else |
| 102 | { |
| 103 | memory_install_readwrite8_handler(program, 0x8000, 0xbfff, 0, 0, SMH_UNMAP, SMH_UNMAP); |
| 104 | } |
| 95 | 105 | logerror("0x8000-0xbfff = RAM cartridge\n"); |
| 96 | 106 | break; |
| 97 | 107 | } |
| r4835 | r4836 | |
| 203 | 213 | break; |
| 204 | 214 | |
| 205 | 215 | case 3: /* RAM cartridge */ |
| 206 | | memory_install_readwrite8_handler(program, 0x8000, 0xbfff, 0, 0, SMH_UNMAP, SMH_UNMAP); |
| 207 | | // memory_set_bank(machine, 3, 3); // TODO or 4 |
| 216 | if (mess_ram_size > 64) |
| 217 | { |
| 218 | memory_install_readwrite8_handler(program, 0x8000, 0xbfff, 0, 0, SMH_BANK(3), SMH_BANK(3)); |
| 219 | memory_set_bank(machine, 3, 3); // TODO or 4 |
| 220 | } |
| 221 | else |
| 222 | { |
| 223 | memory_install_readwrite8_handler(program, 0x8000, 0xbfff, 0, 0, SMH_UNMAP, SMH_UNMAP); |
| 224 | } |
| 208 | 225 | logerror("0x8000-0xbfff = RAM cartridge\n"); |
| 209 | 226 | break; |
| 210 | 227 | } |
| r4835 | r4836 | |
| 443 | 460 | |
| 444 | 461 | /* find devices */ |
| 445 | 462 | state->upd1990a = devtag_get_device(machine, UPD1990A_TAG); |
| 463 | state->sed1330 = devtag_get_device(machine, SED1330_TAG); |
| 446 | 464 | |
| 447 | 465 | /* initialize RTC */ |
| 448 | 466 | upd1990a_cs_w(state->upd1990a, 1); |
| r4835 | r4836 | |
| 562 | 580 | return 0; |
| 563 | 581 | } |
| 564 | 582 | |
| 565 | | static READ8_DEVICE_HANDLER( pc8500_sed1330_vd_r ) |
| 583 | static READ8_HANDLER( pc8500_sed1330_vd_r ) |
| 566 | 584 | { |
| 567 | | pc8401a_state *state = device->machine->driver_data; |
| 585 | pc8401a_state *state = space->machine->driver_data; |
| 568 | 586 | |
| 569 | 587 | return state->video_ram[offset & PC8500_VIDEORAM_MASK]; |
| 570 | 588 | } |
| 571 | 589 | |
| 572 | | static WRITE8_DEVICE_HANDLER( pc8500_sed1330_vd_w ) |
| 590 | static WRITE8_HANDLER( pc8500_sed1330_vd_w ) |
| 573 | 591 | { |
| 574 | | pc8401a_state *state = device->machine->driver_data; |
| 592 | pc8401a_state *state = space->machine->driver_data; |
| 575 | 593 | |
| 576 | 594 | state->video_ram[offset & PC8500_VIDEORAM_MASK] = data; |
| 577 | 595 | } |
| r4835 | r4836 | |
| 579 | 597 | static SED1330_INTERFACE( pc8500_sed1330_config ) |
| 580 | 598 | { |
| 581 | 599 | SCREEN_TAG, |
| 582 | | DEVCB_DEVICE_HANDLER(SED1330_TAG, pc8500_sed1330_vd_r), |
| 583 | | DEVCB_DEVICE_HANDLER(SED1330_TAG, pc8500_sed1330_vd_w) |
| 600 | DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, pc8500_sed1330_vd_r), |
| 601 | DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, pc8500_sed1330_vd_w) |
| 584 | 602 | }; |
| 585 | 603 | |
| 586 | 604 | /* uPD1990A Interface */ |
| r4835 | r4836 | |
| 616 | 634 | MDRV_DRIVER_DATA(pc8401a_state) |
| 617 | 635 | |
| 618 | 636 | /* basic machine hardware */ |
| 619 | | MDRV_CPU_ADD(Z80_TAG, Z80, 4000000) |
| 637 | MDRV_CPU_ADD(Z80_TAG, Z80, 4000000) // NEC uPD70008C |
| 620 | 638 | MDRV_CPU_PROGRAM_MAP(pc8401a_mem) |
| 621 | 639 | MDRV_CPU_IO_MAP(pc8401a_io) |
| 622 | 640 | |
| r4835 | r4836 | |
| 660 | 678 | MDRV_DRIVER_DATA(pc8401a_state) |
| 661 | 679 | |
| 662 | 680 | /* basic machine hardware */ |
| 663 | | MDRV_CPU_ADD(Z80_TAG, Z80, 4000000) |
| 681 | MDRV_CPU_ADD(Z80_TAG, Z80, 4000000) // NEC uPD70008C |
| 664 | 682 | MDRV_CPU_PROGRAM_MAP(pc8401a_mem) |
| 665 | 683 | MDRV_CPU_IO_MAP(pc8500_io) |
| 666 | 684 | |
| r4835 | r4836 | |
| 670 | 688 | MDRV_SCREEN_ADD(SCREEN_TAG, LCD) |
| 671 | 689 | MDRV_SCREEN_REFRESH_RATE(44) |
| 672 | 690 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 673 | | MDRV_SCREEN_SIZE(480, 200) |
| 691 | MDRV_SCREEN_SIZE(480, 208) |
| 674 | 692 | MDRV_SCREEN_VISIBLE_AREA(0, 480-1, 0, 200-1) |
| 675 | 693 | |
| 676 | 694 | // MDRV_DEFAULT_LAYOUT(layout_pc8500) |
| r4835 | r4836 | |
| 737 | 755 | |
| 738 | 756 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 739 | 757 | COMP( 1984, pc8401a, 0, 0, pc8401a, pc8401a, 0, pc8401a, "NEC", "PC-8401A-LS", GAME_NOT_WORKING ) |
| 758 | /* |
| 759 | COMP( 1984, pc8401bd, pc8401a,0, pc8401a, pc8401a, 0, pc8401a, "NEC", "PC-8401BD", GAME_NOT_WORKING ) |
| 760 | */ |
| 740 | 761 | COMP( 1985, pc8500, 0, 0, pc8500, pc8401a, 0, pc8500, "NEC", "PC-8500", GAME_NOT_WORKING ) |