Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

wrote a commodore-64 emulator using just Python

118 views
Skip to first unread message

Irmen de Jong

unread,
Aug 13, 2017, 9:51:24 AM8/13/17
to
Hi,

As another experiment with using just tkinter for graphics, this time I created a
Commodore-64 emulator. You can find it here https://github.com/irmen/pyc64
You only need the pillow library to be able to run this. I guess most people have that
one already anyway.

It works pretty well :) (although having some slight speed/timing issues on windows)

Now, it's not a "true" emulator: obviously it doesn't simulate the C64 on a hardware
level. It does however implement enough to load and run simple basic programs that can
show interesting PETSCII pictures by manipulating the colors and characters on the screen.

And perhaps you can think of doing some other silly things because part of the BASIC
dialect is just executed using eval() in python. What about hooking this up as a ssh
client to get access to your server in a way nobody thought possible? :-P
There's also https://github.com/mnaberez/py65 so... possibilities?


Fun fact: emulator source is smaller than 64KB

Cheers
Irmen.

Larry Martell

unread,
Aug 13, 2017, 10:03:44 AM8/13/17
to

Larry Martell

unread,
Aug 13, 2017, 10:04:32 AM8/13/17
to
On Sun, Aug 13, 2017 at 9:50 AM, Irmen de Jong <irmen....@xs4all.nl> wrote:
Damn! I should have saved my Cave Of The Word Wizard floppies.

Irmen de Jong

unread,
Aug 14, 2017, 10:21:38 AM8/14/17
to
On 08/13/2017 03:50 PM, Irmen de Jong wrote:

> Now, it's not a "true" emulator: obviously it doesn't simulate the C64 on a hardware
> level. It does however implement enough to load and run simple basic programs that can
> show interesting PETSCII pictures by manipulating the colors and characters on the screen.

As people have been asking me about this: NO - you cannot run any
existing C-64 software with my program. I should have put the word
emulator in quotes I suppose. The program is mostly an experiment with
tkinter graphics, in this case reproducing the C-64 (textmode) screen.
The 'BASIC interpreter' is just enough to be able to print stuff to the
screen and POKE the memory to change the contents of the screen and the
colors.

If you want to run your old c-64 software, use a _real_ emulator such as
Vice or ccs64 - this was never my goal :)

Irmen

Irmen de Jong

unread,
Sep 4, 2017, 5:30:12 PM9/4/17
to
On 08/13/2017 03:50 PM, Irmen de Jong wrote:
> Hi,
>
> As another experiment with using just tkinter for graphics, this time I created a
> Commodore-64 emulator. You can find it here https://github.com/irmen/pyc64

[...]

> There's also https://github.com/mnaberez/py65 so... possibilities?

Well, I went ahead and integrated that with my emulator. With just a
slight modification (that is now merged into the py65 library) I could
hook it up to the bytearray that my emulator uses to simulate the C64's
RAM. And letting the 'SYS' basic command kick of the 6502 simulator,
rather than doing nothing, it suddenly was able to actually run real
(although simple) Commodore-64 programs. Speed seems to be around 0.5x
real-time on my machine.

The py65 library also already provides a simple machine code monitor
(assembler/disassembler) that you can use to inspect or write the
machine code in the C64's memory. With some effort it should be possible
to run it in the emulated screen, but for now, interaction with it is
done on the console prompt.

It was a great deal of fun integrating this into my project and I found
it quite spectacular to see some existing Commodore-64 programs actually
running unaltered. Even when they're doing nothing more than changing
the screen colors and unpacking an image. At half speed. But still :-)


Irmen
0 new messages