From 404a61653d13acf90c5420b6031644b322aaf736 Mon Sep 17 00:00:00 2001 From: Zsolt Vasvari Date: Tue, 12 Feb 2008 20:58:40 +0000 Subject: [PATCH] Using this interesting document as a reference: http://www.6502.org/users/andre/hwinfo/crtc/diffs.html - allows reading registers 12 and 13 - reading write-only registers return 0 - updated comments in header - added copyright since there was none --- src/emu/video/mc6845.c | 25 +++++++++++++++++++++++-- src/emu/video/mc6845.h | 15 ++++++++++++++- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c index 06358babc92..f0951c673b0 100644 --- a/src/emu/video/mc6845.c +++ b/src/emu/video/mc6845.c @@ -1,6 +1,19 @@ /********************************************************************** - Motorola MC6845 CRT controller emulation + Motorola MC6845 and compatible CRT controller emulation + + Copyright Nicola Salmoria and the MAME Team. + Visit http://mamedev.org for licensing and usage restrictions. + + The following variations exist that are different in + functionality and not just in speed rating(1): + * Motorola 6845, 6845-1 + * Hitachi 46505 + * Rockwell 6545, 6545-1 + * Commodore 6545-1 + + (1) as per the document at + http://www.6502.org/users/andre/hwinfo/crtc/diffs.html **********************************************************************/ @@ -108,10 +121,18 @@ void mc6845_address_w(mc6845_t *mc6845, UINT8 data) UINT8 mc6845_register_r(mc6845_t *mc6845) { - UINT8 ret = 0xff; + UINT8 ret = 0; switch (mc6845->address_latch) { + case 12: + /* Motorola version only */ + ret = mc6845->start_addr >> 8; + break; + case 13: + /* Motorola version only */ + ret = mc6845->start_addr; + break; case 14: ret = mc6845->cursor >> 8; break; diff --git a/src/emu/video/mc6845.h b/src/emu/video/mc6845.h index 4ebd64374bb..b769845853f 100644 --- a/src/emu/video/mc6845.h +++ b/src/emu/video/mc6845.h @@ -1,6 +1,19 @@ /********************************************************************** - Motorola MC6845 CRT controller emulation + Motorola MC6845 and compatible CRT controller emulation + + Copyright Nicola Salmoria and the MAME Team. + Visit http://mamedev.org for licensing and usage restrictions. + + The following variations exist that are different in + functionality and not just in speed rating(1): + * Motorola 6845, 6845-1 + * Hitachi 46505 + * Rockwell 6545, 6545-1 + * Commodore 6545-1 + + (1) as per the document at + http://www.6502.org/users/andre/hwinfo/crtc/diffs.html **********************************************************************/