commanderx16 / x16-emulator

Emulator for the Commander X16 8-bit computer
383 stars 60 forks source link

Implement VIA timers #55

Open mist64 opened 5 years ago

mist64 commented 5 years ago

Gábor Lénárt has agreed to relicense his VIA code under the 2-clause BSD license:

https://github.com/lgblgblgb/xemu/blob/x16/xemu/via65c22.c https://github.com/lgblgblgb/xemu/blob/x16/xemu/via65c22.h

And he's happy if we import it.

lgblgblgb commented 5 years ago

Some comments on my stuff:

As a side note, it would beneficial for me too, if someone finds an error in it, or can expand it, so I can re-use that as well khmm :) This quite unfinished (and ugly) VIA emulation has the characteristic, that it uses call-backs for the in/out (SR or parallel) and set/clear interrupt, so the user can write its own code how to handle those (eg for input, there can be pull-ups, or even more interesting things, when it's dependent of the emulator how it's used, and in my Xemu emulator, actually multiple emulations uses this generic code. At least it seemed to be enough to work with my Commodore VIC20 emulator, and Commodore LCD (where the shift register is used as well, since keyboard matrix is read through the SR). But certainly it does not have too much extra features a real VIA would know (thus, not everything is emulated!) other than that I needed for the mentioned machines to be emulated at a very basic level.

I'd love to help X16 project at least this way ...

mist64 commented 5 years ago

(The serial port of VIA#2 is currently hacked into the SPI interface for the SD card. The SPI interface will be removed from the VIAs, so no need to convert this over.)