6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Apr 28, 2024 10:58 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: 6502 for chess
PostPosted: Tue Nov 29, 2011 9:52 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
Some long time ago I came across this comment by 'Xerxes'
"This was one reason why the 6502 was so popular for chess computers"
in a tabulation of QueenBench timings of different micros (right at the bottom of the last post in that thread)

I'd also previously found Peter Jenning's telling of his story of Microchess which he describes as the first game program sold for home computers.

But today I looked a bit deeper, to try to find reasons why the 6502 was favoured. I found this specific evidence in a chess wiki: the advantages of zero page as an extended register file, and the performance advantage of the relative branches.

And from there, I found this recent thread on a chess forum, covering 6502 tactics and Briel's MicroKim.

Anyone else any ideas about the 6502, specifically in relation to chess? I believe it's in a few chess machines.

Cheers
Ed


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 for chess
PostPosted: Sun May 03, 2020 8:19 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Since this thread got linked, I might as well resurrect it…

The 6502 was indeed used in a number of dedicated chess computers, perhaps most notably including the Mephisto Rebel series programmed by Ed Schröder. There's a document (attached) titled "Inside Rebel" which described, at a high level, many of the techniques it relied upon - I've confirmed some of these details by examining a disassembly of the Mephisto Academy ROMs. Notable by its absence is a transposition table; most of the address space of the 6502 was occupied by the program ROM. But by sophisticated search and evaluation techniques, a 5MHz 65C02 could search parts of the game tree to about 16 ply (if given sufficient time), and thereby solve endgames up to 8-move depth. These machines were still doing well in computer chess tournaments around 1990, which seems very late.

A successor to these machines was the Mephisto RISC, which used an ARM2 (VL86C010, so no cache). The greatly improved execution efficiency and higher clock speed made a big difference, but Schröder still didn't implement a transposition table AFAIK, just ported over an expanded version of Rebel. However, that machine arrived just when the company was getting out of the dedicated chess computer business; the greater capabilities of desktop computers had made it too specialised a market to sustain.

Some chess computers used other CPUs. There was one competing in serious tournaments that used a 68030, for example, and earlier ones that used a 68000. Curiously, Mephisto had the 68000-based Berlin which was only similar in strength to the 6502-based Mephisto Polgar, despite having much more clock speed, ROM and RAM to work with. It took the Berlin Professional, using a 68020, to make a significant improvement - but again, using more resources and a higher clock speed to merely equal the Mephisto RISC of several years earlier.

Low-end consumer machines for novice players often used some random microcontroller, such as a Hitachi SH4 or a 68HC05, with a very limited chess engine squeezed in. My family once had a Tandy 1450 portable of this type, which apparently had just 5KB ROM and 256 nybbles of RAM, scarcely enough to write an engine that knows all the rules and can search a few ply. Clearly the focus here was on cost and battery life, not playing strength. Consumer chess computers of this unambitious sort are still on the market; they are what you find if you look on Amazon.

But there is now a professional-grade chessboard with integrated engine, based around a Raspberry Pi. This allows it to run several different engines with various playing styles and strength. This, of course, brings everything back to the ARM CPU.

Perhaps notably, I have not been able to find any dedicated chess computer that used a Z80 family CPU. Of course there were chess games released for Z80 based micros. Some 1980s machines used a 6800 family CPU, such as the Hitachi 6301. A very early Mephisto model used an RCA 1801. But most of the serious 1980s machines did use a 6502.

As 65xx enthusiasts, I'm sure one of us could find the time to rig up a 65816 to some sort of sensor-board arrangement…


Attachments:
Inside Rebel.pdf [268.17 KiB]
Downloaded 86 times
Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 for chess
PostPosted: Mon May 04, 2020 2:47 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
As it turns out, Fidelity did make some chess computers using the Z80, and a little later using the Intel 80C50. These were however not very strong opponents, comparable to the Tandy portable. They started using the 6502 in 1981, though they sold models using several different CPUs contemporaneously.


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 for chess
PostPosted: Mon May 04, 2020 7:41 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
Thanks for the Inside Rebel paper! I see there's much more about and from Ed Schroder:
https://www.chessprogramming.org/Ed_Schroder

There's a table of chess machines and their strengths, with incidental information about the CPU and the clock speed, here:
https://www.oocities.org/marochess/ssdf ... df9601.htm

This history mentions Z80 as being the machine underneath the very first Sargon implementation:
http://billwall.phpwebhosting.com/artic ... meline.htm

And here's a list of chess machines powered by Z80
https://www.schach-computer.info/wiki/i ... egorie:Z80


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 for chess
PostPosted: Mon May 04, 2020 8:45 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Right, the Z80 based machines all seem to top out at about 1500 ELO or so, despite clock speeds sometimes reaching 7.5MHz. By comparison, even the slower 6502 machines with only a 2MHz clock run at around 1700 ELO, with the later (faster) 65C02 machines starting at 1800 ELO. A difference of 300 ELO points is enough that the lower rated machine would hardly ever win (nor even draw) a game.

This is despite, in some cases, the same programmer having written the engine. So there definitely seems to have been something about the 6502 that favoured its use for chess, more than the usual difference in efficiency noted between the two.

I did find one remarkable machine that happens to be Z80 based, though - the Novag Robot Adversary. It has a motorised arm that can make moves, like the fabled Mechanical Turk, and is even programmed to mock you or show frustration at appropriate (if obnoxious) moments in the game.


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 for chess
PostPosted: Mon May 04, 2020 9:10 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
BigEd wrote:
This history mentions Z80 as being the machine underneath the very first Sargon implementation:
http://billwall.phpwebhosting.com/artic ... meline.htm

Sargon I was written using a Z80 assembler with non-standard mnemonics. They published the source code in a book and someone has uploaded it
https://web.archive.org/web/20070614114334/http://madscientistroom.org/chm/Sargon.html

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 for chess
PostPosted: Mon May 04, 2020 10:22 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
In practice, there are three purposes to which you can put a chess engine:

1: Analysis of positions and problems from games (or other sources) encountered elsewhere. For this you want the engine to be as insightful as possible, and strong enough to not miss tactical traps that might be several moves deep. This is an area where chess computing has grown consistently better over the years, although the "insight" part can be lacking as usually only a numerical score is given.

2: Playing against other chess computers, or possibly master-level human players. Here you want the engine to play as strongly as possible, now also taking time management into account. Insight at the human level is not valuable here, but searching deeply and carefully is. This has been the major focus of chess engine development, for better or worse.

3: Playing against it as an amateur. Here you want the engine to give you an interesting game, and to be challenging but beatable. This is very different from the first two use cases, and something that chess engines have generally not been very good at. It's easy to make an engine weak enough for a relative novice to beat; it's much more difficult to do so while still making it play both realistically and in an interesting manner. But this is why chess computers are usually built around a cheap microcontroller; it's all that's needed to make an engine that can beat most amateurs.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: