Retrocomputing with the 6502

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
jshriver
Posts: 1342
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: Retrocomputing with the 6502

Post by jshriver »

Didn't the original 8-bit NES use the 6502? I believe there was a chess program for it :) Original Chessmaster or Battlechess or something akin to that.
Dan Andersson
Posts: 442
Joined: Wed Mar 08, 2006 8:54 pm

Re: Retrocomputing with the 6502

Post by Dan Andersson »

It sported a 6502 sibling. The Ricoh 2A03 with some additions like 'nearly' DMA, sound and controller IO. So porting would be relatively easy.
The 6502 class ISA was so ill defined that there was a market for a special filtering chip for the instruction stream to filter out undefined instructions :)
I was a Z80 enthusiast myself. That CPU is still going strong :) The eZ80 however might be the pinnacle of its lineage.

MvH Dan Andersson
User avatar
jshriver
Posts: 1342
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: Retrocomputing with the 6502

Post by jshriver »

Nifty info. I once thought it would be fun to try and write a modest chess engine for use on a PIC chip. But my lack of EE kept me from it, since once it was burned on the chip I had no idea how to really use it :)

Also I've had a hard enough time trying to write a basic C engine over the years.
User avatar
Bill Rogers
Posts: 3562
Joined: Thu Mar 09, 2006 3:54 am
Location: San Jose, California

Re: And if you have a Palm handheld

Post by Bill Rogers »

About Microchess by Peter Jennings.
In the begining it was only rated about 600 points making it the lowest rated chess program written for a PC or in this case an Apple, an TRS80 and Commador.
I am not sure now if it allowed Enpassant captures or not but it did have a major bug in castling. For example on a first or second move or any number in you could castle right or left whether or not the square were empty. If you catled king side and both your knight and bishop were still there they would be wiped off the board.
I had a friend who once made a clone of it in Basic but he did it in Apple basic and I did not think that I could use it.
Funny thing is that it ran just as fast in Basic as it did in machine language.
Bill
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Retrocomputing with the 6502

Post by sje »

Dan Andersson wrote:I was a Z80 enthusiast myself. That CPU is still going strong :) The eZ80 however might be the pinnacle of its lineage.
The Z80 was a set of kludges piled on an earlier set of kludges. It became more popular than the 8080 mostly because it allowed cheaper hardware interfacing.

Given the choice between more registers or mode address modes, I'll take the latter. That's why the 6502 and its later versions is preferred over the 8080/Z80.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Retrocomputing with the 6502

Post by sje »

jshriver wrote:Nifty info. I once thought it would be fun to try and write a modest chess engine for use on a PIC chip. But my lack of EE kept me from it, since once it was burned on the chip I had no idea how to really use it :)
Some of those very low cost PICs are really too slow for chess of any kind, even if a program could be made to fit.

There are plenty of low cost development kits available for single chip systems for those who've learned and not forgotten how to program small systems.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: And if you have a Palm handheld

Post by sje »

Bill Rogers wrote:About Microchess by Peter Jennings.
In the begining it was only rated about 600 points making it the lowest rated chess program written for a PC or in this case an Apple, an TRS80 and Commador.
I am not sure now if it allowed Enpassant captures or not but it did have a major bug in castling. For example on a first or second move or any number in you could castle right or left whether or not the square were empty. If you catled king side and both your knight and bishop were still there they would be wiped off the board.
Microchess, like a number of other early programs, didn't do legality checking, had castling problems, was ignorant of en passant, missed all draws (except maybe stalemate), and couldn't underpromote. It was actually several years until the best micro programs could handle fully legal chess; the last feature added was position repetition detection.

My plan for a 4 KB 6502 chess program supports full chess except for draw by repetition. It's also missing many convenience features like move take back. The biggest challenge is to fit the move stack into limited memory while still having a data representation scheme permitting some semblance of execution speed.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Honest comments from the Microchess manual

Post by sje »

Some honest comments from the manual for Microchess (a one KB chess program running on the MOS 6502, written in 1976):
As mentioned above, there are three types of moves which the
current version of MICROCHESS does not play. These are
castling, en passant pawn captures, and queening of pawns. In
order to make the game fair some players adopt one of the two
following strategies. Recognizing that the computer cannot
make these moves, some players choose not to make them
themselves, thus both players suffer the same restrictions.
On the other hand, other players have decided to help the
computer by watching for appropriate castling or en passant
situations and making the moves on the computer's behalf at
that time. Of course, you may always play without regard to
the computer's disadvantage, allowing it to fend for itself as
best it can.
We've come a long way since then, haven't we?
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Microchess, 2nd gen: a dedicated unit

Post by sje »

Alessandro Scotti

Re: Retrocomputing with the 6502

Post by Alessandro Scotti »

Dan Andersson wrote: I was a Z80 enthusiast myself. That CPU is still going strong :)
Very strong! :-) I wrote many programs in Assembly for both the 6502 and the Z80 and I'm also a Z80 enthusiast! :-) So much, in fact, that I have written emulation code for the Z80 and many peripherals as part of my arcade emulation program Tickle (http://www.ascotti.org/programming/tickle/tickle.htm).
I have also good (if fading) memories of the 6502 though. At the time I had a VIC 20 but no external storage so I programmed on paper, assembled the program manually (in decimal), coded the program using a BASIC loader, and wrote back to paper the modifications I did while testing.
Oh... I also spent a lot of time playing Sargon II and Boss! ;-)