Quirkafleeg for the Commodore 64/128 – new 6502 chess engine

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

astrange
Posts: 10
Joined: Mon Nov 02, 2026 11:03 am
Full name: Anders Strange

Quirkafleeg for the Commodore 64/128 – new 6502 chess engine

Post by astrange »

Hi all,

I'm releasing the Commodore 64/128 version of Quirkafleeg, the retro chess engine I released for the ZX Spectrum 48K earlier this month. The goal of the project is to write the strongest chess engine for each of the classic home computers.

Image

Results (40 s + 11 s, 200–400 games per match)
  • Against Colossus 4.0, long regarded as the strongest C64 chess program, the standard C64 version scores +113 Elo.
  • On a C128 the program detects the machine and uses its 2 MHz mode, and that is where it takes down The Final ChessCard:
    – Default mode (2 MHz in the border area, board visible, about 1.4x speed): 52.8 % against the card (+19 Elo, 400 games), i.e. level or slightly ahead. Against Colossus 4.0: +131.
    – Full 2 MHz mode (screen blanked while thinking): 70.2 % against the card (+149 Elo, 400 games), searching deeper than the card. Against Colossus 4.0: +257.
  • On a standard C64 and on the Spectrum 48K it is close to even with the card. On balanced openings the card has a small edge (Quirkafleeg scores 43–44 %). With random openings the 48K engine came out on top (+31 Elo). The card is really a dedicated chess computer in a cartridge, with its own 5 MHz 65C02 and about five times the computing power of the C64. Had software of this strength existed in the late 1980s, the card would hardly have been needed.
For now, Quirkafleeg claims the title of strongest chess program on the standard Z80 ZX Spectrum and on the Commodore 64/128. Counter-claims are welcome.

How the 2 MHz mode works on the C128

In C64 mode the C128 can still switch the CPU to 2 MHz, but the VIC-II can't fetch screen data at that speed, so the display breaks up. Quirkafleeg handles it in two ways:
  • Default, about 1.4x: a raster interrupt switches to 2 MHz when the beam enters the lower border and back to 1 MHz just before the visible area starts. The board stays visible and stable, and the time spent in the border and in vertical blank runs at double speed.
  • Full 2 MHz: the screen is blanked while the engine thinks and comes back when it's your move.
On a standard C64, or with 1 MHz selected, it runs at normal speed.

Image

Why

The hardware is the same as in 1986. What has changed is everything around it: forty years of published chess programming research, cycle-exact emulators that can play thousands of games at the original speed, and a C reference model that matches the assembler node for node. Together they make it possible to take the old machines further than they went back then. No change goes in without a measured gain.

The C64/128 version is in beta and will be released before Christmas. Testers with a real C64/C128 or VICE are welcome to send me a PM. Freeware.

Next target: the 68000

Next up is the Motorola 68000, with the Amiga 500 and Atari ST as the platforms. The work has started, and the goal is the same as before: the strongest chess program on the machine.

Spectrum version, details and downloads: https://frontpoint-sport.com/quirkafleeg/

Anders Strange
Vinvin
Posts: 5386
Joined: Thu Mar 09, 2006 9:40 am
Full name: Vincent Lejeune

Re: Quirkafleeg for the Commodore 64/128 – new 6502 chess engine

Post by Vinvin »

Hi Anders,
Thanks for the interest in this antique computers.
I used a Commodore 128 (at home) and a ZX Spectrum + (at school) and I'm very please to look back at them sometimes.

Where is the link to download the C64/128 version, please ?
astrange
Posts: 10
Joined: Mon Nov 02, 2026 11:03 am
Full name: Anders Strange

Re: Quirkafleeg for the Commodore 64/128 – new 6502 chess engine

Post by astrange »

The C64/128 beta is online for download and play here:

https://frontpoint-sport.com/quirkafleeg/c64/

Enjoy :D

Regards,
Anders
User avatar
mclane
Posts: 19027
Joined: Thu Mar 09, 2006 6:40 pm
Location: US of Europe, germany
Full name: Thorsten Czub

Re: Quirkafleeg for the Commodore 64/128 – new 6502 chess engine

Post by mclane »

One Problem I see is, when I choose 40/120 it stops when time flags. But by operating 2 engines against each other manually, time can run out because you need operator time too. I cannot continue the game though after time out. Maybe you can fix this ?!

I would like to put the engine in my huge zep tepi tournament with other Homecomputer software. C64 is there with Grandmaster and chess 7.5.
So we could also measure if it is stronger then the commercial Homecomputer software for c64.

There is also TacTIcon for the ti99/4a.
Etc.
What seems like a fairy tale today may be reality tomorrow.
Here we have a fairy tale of the day after tomorrow....
User avatar
flok
Posts: 639
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: Quirkafleeg for the Commodore 64/128 – new 6502 chess engine

Post by flok »

Very cool!
Any chance on an MSX or MSX-2 version? (z80, most of them have at least 64 kB ram)
astrange
Posts: 10
Joined: Mon Nov 02, 2026 11:03 am
Full name: Anders Strange

Re: Quirkafleeg for the Commodore 64/128 – new 6502 chess engine

Post by astrange »

mclane wrote: ↑Wed Nov 18, 2026 9:49 am One Problem I see is, when I choose 40/120 it stops when time flags. But by operating 2 engines against each other manually, time can run out because you need operator time too. I cannot continue the game though after time out. Maybe you can fix this ?!
Etc.
Thank you so much for taking the time to try it, and for telling me about this. You are completely right, and it is exactly the kind of thing I could not have found on my own, because I never relayed moves by hand at 40/120.

It is fixed in beta 5, which is on the page now:
https://frontpoint-sport.com/quirkafleeg/c64/

Your own clock no longer ends the game. When it reaches 0:00 it just stays there and you play on. Only the computer's own clock can still lose on time, and that one runs only while Quirkafleeg itself is thinking, so your operator time never counts against it.

I would be delighted to see it in your tournament. I used Colossus 4.0 and The Final ChessCard as my main anchors, since they are the strongest C64 software and the strongest C64 hardware I know of, so those are the only two I have measured against. Your wider field will show how it stands among the commercial programs in general, and I am really curious to see that. TacTIcon on the TI-99/4A sounds like fun as well.

Cheeers
Anders
astrange
Posts: 10
Joined: Mon Nov 02, 2026 11:03 am
Full name: Anders Strange

Re: Quirkafleeg for the Commodore 64/128 – new 6502 chess engine

Post by astrange »

flok wrote: ↑Wed Nov 18, 2026 8:34 pm Very cool!
Any chance on an MSX or MSX-2 version? (z80, most of them have at least 64 kB ram)
Thanks, glad you like it!

That might happen :-)

I have never worked on the MSX, but the very first Quirkafleeg was written for the 48K ZX Spectrum, so the engine is already Z80 code for a machine of about the same speed. You can try that version in the browser here: https://frontpoint-sport.com/quirkafleeg/

The engine itself should move over without much trouble, and with 64 KB there would even be a little more room than on the Spectrum, for a bigger opening book or hash table. The real work would be the screen and keyboard side, which is all new to me on the MSX.

Can you recommend a decent emulator to develop and test on? And which machine would you aim for, a plain MSX1 with 64 KB, or MSX2? Is there an MSX chess program that is regarded as the one to beat? That is how the Spectrum and C64 versions started, with Colossus as the target.

No promises on timing, since the C64 version has to be finished first, but it is on the list now.

Regards
Anders
User avatar
mclane
Posts: 19027
Joined: Thu Mar 09, 2006 6:40 pm
Location: US of Europe, germany
Full name: Thorsten Czub

Re: Quirkafleeg for the Commodore 64/128 – new 6502 chess engine

Post by mclane »

There is a program called msx chess.
It's in my tournament.

Tournament so far in round 14, still games needed to be played:

Code: Select all

    Motor                                                       Punkte  Ch St Ta Cy Me Co Mi Ph Gr Sf Ch Ga De Ca Ch De Ch Wh Gr MS Sc Co Sa Fi Ph My Lo At Ma Ps Sc Sc    S-B
01: CheckCheck 1.75 XT mit 350 cycles                           11,0/13 ··       1  0  0  1     1  1           1     1     1  1        1  1           1                   81,00
02: Steinitz Encore Master Chess 4 mhz Applied Concepts         11,0/13    ··       1  =     0     1  1              1     1  1  =  1        1           1  1             73,00
03: Tacticon TI99/4a                                            10,5/13       ·· 1  1  1        =     0           1        1     =  =     1        1     1  1             70,75
04: Cyrus Dragon Chess {Brettcomputer}                          10,5/14 0     0  ·· =  =     1     1  1              1        =     1        1     1  1        1          69,25
05: Mephisto ESB II {Brettcomputer}                             10,0/14 1  0  0  =  ·· 1     0     1        1     11             =     1                 1     1          72,25
06: Conchess 2 mhz {Brettcomputer}                              10,0/14 1  =  0  =  0  ··    1  =        =  1              1     1        1                 1        1    71,00
07: Millennium Chess Champion 2.0 {Brettcomputer}               9,5/14  0                 ··    1  0  1  1     =  0  1  1  0        1  1        1              1          63,75
08: PhilidorChess IBM XT 350 cycles                             9,5/14     1     0  1  0     ·· 0        =     1        1           1     0  1  1           1        1    61,00
09: Grünfeld S Morphy Capablanca S Applied Concepts             9,5/14  0     =        =  0  1  ··    =           =              1           =     1  1  1  1        1    52,25
10: Sfinks4 TRS-80 {Brettcomputer}                              9,0/14  0  0     0  0     1        ··    1              1     1  =     1  =     1  1              1       54,50
11: Chess Mate Sam Coupe {Brettcomputer}                        8,5/14     0  1  0        0     =     ·· 1  0  1  1     1                 =        =              1  1    55,50
12: Gambiet81 TRS80 {Brettcomputer}                             8,0/14                 =  0  =     0  0  ··    0  1           =        1  1     1        1  =     1       42,75
13: Destiny Prodigy Mini Applied Concepts {Brettcomputer}       8,0/14              0  0              1     ·· =  0  =     0        0        1  1        1  1  1     1    36,50
14: Capa44 286-12 1510 cycles {Brettcomputer}                   7,5/13  0                 =  0        0  1  =  ··    1     1  0     1     =                 1     1       44,75
15: Chess 7.5 C64 {Brettcomputer}                               7,5/14        0     00    1     =     0  0  1     ··       0     1        1              1  1     1       41,25
16: Deep Scan Sam Coupe {Brettcomputer}                         7,5/14  0  0     0        0                 =  0     ··    =     1           =  1  1  1  1     1          34,50
17: Chess 3.48 Oric Atmos o/c {Brettcomputer}                   7,5/14                    0  0     0  0                 ··    1  0     1  1  1  =        1  =     =  1    32,50
18: White Knight MK11 Acorn Electron {Brettcomputer}            7,0/14  0  0  0        0  1                 1  0  1  =     ··       =        0     1              1  1    41,25
19: Grandmaster Chess C64 {Brettcomputer}                       6,5/14  0  0     =                 0     =     1        0     ·· 0  1     =     1     1     =        =    36,25
20: MSX Chess V1.1                                              6,0/14     =  =     =  0        0  =              0  0  1     1  ·· =                 0        =     1    41,00
21: Scisys President Chess {Brettcomputer}                      6,0/14     0  =  0        0  0              1  0           =  0  =  ··    1        =  1        1          33,00
22: Conic Computer Chess Modell 7012 {Brettcomputer}            5,5/14  0           0     0        0     0              0              ··    =  =     1  =  0  11    1    17,50
23: Sargon 2.5 Applied Concepts / Chafitz {Brettcomputer}       5,0/14  0     0        0     1     =  =  0     =  0     0     =     0     ·· 1     1                      34,75
24: Fidelity Chess Challenger Grandmaster Voice {Brettcomputer} 5,0/14     0     0           0  =           0        =  0  1           =  0  ·· =  0        1     1       25,75
25: Phoenix Chess TI99/4a                                       5,0/14                    0  0     0     0  0        0  =     0        =     =  ··    =        1  1  1    18,25
26: Mychess DOS IBM XT 350 cycles {Brettcomputer}               4,5/14        0  0              0  0  =              0     0        =     0  1     ·· 1  =     0  1       19,75
27: Logichess2.2 Lynx {Brettcomputer}                           3,5/14  0        0              0                    0        0  1  0  0        =  0  ·· =     1  =  0    13,75
28: Atari Video Chess VCS {Brettcomputer}                       3,0/14     0  0     0           0        0  0     0  0  0              =           =  =  ··    =  1       10,50
29: Mattel Chess Aquarius {Brettcomputer}                       2,5/14     0  0        0     0  0        =  0  0  0     =     =        1     0              ··       0    16,50
30: Psi Chess Sinclair ZX Spectrum {Brettcomputer}              2,5/14           0  0     0                 0        0           =  0  00       0  1  0  =     ·· =       10,25
31: SciSys Chess Champion MKIV {Brettcomputer}                  2,5/14                             0  0  0     0  0     =  0                 0  0  0  =  0     =  ·· 1     9,25
31: Scisys Senator Chess                                        2,5/14                 0     0  0     0     0           0  0  =  0     0        0     1     1     0  ··    9,25

222 Partien von 496 gespielt
Name des Turniers: Zep tepi summer2024
Ort/ Land: ORION8, Deutschland
Spielstufe: Turnier 40/120 20/60
What seems like a fairy tale today may be reality tomorrow.
Here we have a fairy tale of the day after tomorrow....
User avatar
flok
Posts: 639
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: Quirkafleeg for the Commodore 64/128 – new 6502 chess engine

Post by flok »

astrange wrote: ↑Wed Nov 18, 2026 11:09 pm
flok wrote: ↑Wed Nov 18, 2026 8:34 pm Very cool!
Any chance on an MSX or MSX-2 version? (z80, most of them have at least 64 kB ram)
Thanks, glad you like it!

That might happen :-)

I have never worked on the MSX, but the very first Quirkafleeg was written for the 48K ZX Spectrum, so the engine is already Z80 code for a machine of about the same speed. You can try that version in the browser here: https://frontpoint-sport.com/quirkafleeg/

The engine itself should move over without much trouble, and with 64 KB there would even be a little more room than on the Spectrum, for a bigger opening book or hash table. The real work would be the screen and keyboard side, which is all new to me on the MSX.

Can you recommend a decent emulator to develop and test on? And which machine would you aim for, a plain MSX1 with 64 KB, or MSX2? Is there an MSX chess program that is regarded as the one to beat? That is how the Spectrum and C64 versions started, with Colossus as the target.

No promises on timing, since the C64 version has to be finished first, but it is on the list now.

Regards
Anders
Hi,

A very good emulator is openmsx. Available for I think every platform under the sun.
MSX1 is the easiest I think.
There's ultrachess, I don't know how strong it is unfortunately (tried it https://www.vanheusden.com/chess/ultrachess-uci/ ).
Note that you have only 28,8 kB free RAM in basic-mode. If on the other hand you bankswitch to ram-only, then you have a full 64 kB of RAM: VRAM for the VDP is reachable via I/O instructions and seperate from the main RAM. You need to re-route interrupts though then but that's easy to do. You can also only switch away the basic interpreter to get 48 kB RAM.
astrange
Posts: 10
Joined: Mon Nov 02, 2026 11:03 am
Full name: Anders Strange

Re: Quirkafleeg for the Commodore 64/128 – new 6502 chess engine

Post by astrange »

Thanks Folkert, MSX1 in RAM-only mode it is, that is exactly what Colossus 4 does. I had a very quick look at the MSX image tonight, and it is the Spectrum 48K program that I know so well, same engine and book, running on a small layer that pretends to be a Spectrum ROM. So it sits on an MSX thinking it is still on a Spectrum, I did know that the MSX behaved like that - new to me :-)

Colossus 4 has been my yardstick on both the Spectrum and the C64 (I grew up with it) - Martin Bryant wrote a very good program. My bet is it is the one to beat on the MSX too, but I will check Ultrachess and MSX Chess to be fair.

Thorsten, if an MSX Quirkafleeg gets done, I know where to send it.

Cheers
Anders