A first (and very kludgy) attempt at 6545 emulation

Topics pertaining to the emulation or simulation of the 65xx microprocessors and their peripheral chips.
Post Reply
User avatar
Twylo
Posts: 11
Joined: 11 Dec 2008
Location: Fremont, CA, USA
Contact:

A first (and very kludgy) attempt at 6545 emulation

Post 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
fachat
Posts: 1124
Joined: 05 Jul 2005
Location: near Heidelberg, Germany
Contact:

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

Post 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é
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
6502inside
Posts: 102
Joined: 03 Jan 2007
Location: Sunny So Cal
Contact:

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

Post by 6502inside »

It's a great start!
User avatar
barrym95838
Posts: 2056
Joined: 30 Jun 2013
Location: Sacramento, CA, USA

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

Post by barrym95838 »

Does the "killer POKE" do anything unusual or interesting? ;-)

Mike
6502inside
Posts: 102
Joined: 03 Jan 2007
Location: Sunny So Cal
Contact:

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

Post by 6502inside »

barrym95838 wrote:
Does the "killer POKE" do anything unusual or interesting? ;-)
It shuts down the Mac.
Post Reply