Page 1 of 1

A first (and very kludgy) attempt at 6545 emulation

Posted: Mon Dec 30, 2013 2:58 am
by Twylo
I've been busy over the holiday adding experimental 6545 CRTC support to my 6502 simulator project, "Symon".

https://github.com/sethm/symon

Image

I've been meaning to do a real 6845/6545 project on my 6502 SBC, but since I was too lazy to work on the hardware over the break, I decided to throw together the Symon support so I could start writing code instead.

The simulated version only handles a few of the registers that the real thing does:
  • Address Register (at address $9000)
  • R1: Horizontal Displayed Columns
  • R6: Vertical Displayed Rows
  • R9: Scan Lines per Row
  • R10: Cursor Start Scan Line and Cursor Control Mode
  • R11: Cursor End Scan Line
  • R12: Display Start Address (High Byte)
  • R13: Display Start Address (Low Byte)
  • R14: Cursor Position (High Byte)
  • R15: Cursor Position (Low Byte)
The simulation is also frame-at-a-time, the entire screen is redrawn during a single step of the simulated CPU. That means you can't play any of the cool tricks with timing that you can with the real thing, e.g., no virtual split-screen by changing Display Start Address during horizontal blanking! I think I COULD add that behavior at the expense of performance, but I didn't feel like I needed it.

I'd love feedback from anyone here with 6545 experience. I'm sure there are probably bugs and other ways that it isn't like the real thing. If I can improve accuracy, I think it'd be useful.

Best Wishes,

-Twylo

Re: A first (and very kludgy) attempt at 6545 emulation

Posted: Fri Jan 03, 2014 12:02 am
by fachat
Nice work! Did you look at the 6545 emulation in the Commodore emulator VICE ( http://vice-emu.sourceforge.net/ ) that contains a 6545 emulation for the PET and CBM-II machines?

You mention
Quote:
That means you can't play any of the cool tricks with timing that you can with the real thing, e.g., no virtual split-screen by changing Display Start Address during horizontal blanking!
Are you sure that works? I would not think it does, because the memory address counter is only loaded with the accessible register value on vertical retrace, not horizontal retrace. At least that is what I think.

http://www.6502.org/users/andre/hwinfo/ ... index.html

André

Re: A first (and very kludgy) attempt at 6545 emulation

Posted: Fri Jan 03, 2014 12:25 am
by 6502inside
It's a great start!

Re: A first (and very kludgy) attempt at 6545 emulation

Posted: Fri Jan 03, 2014 7:49 am
by barrym95838
Does the "killer POKE" do anything unusual or interesting? ;-)

Mike

Re: A first (and very kludgy) attempt at 6545 emulation

Posted: Fri Jan 03, 2014 5:32 pm
by 6502inside
barrym95838 wrote:
Does the "killer POKE" do anything unusual or interesting? ;-)
It shuts down the Mac.