6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 14, 2024 10:30 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Furby 1998 source code
PostPosted: Mon Aug 13, 2018 9:06 pm 
Offline
User avatar

Joined: Mon Jan 09, 2017 10:16 pm
Posts: 16
Location: Mexico, Mexico
Hi.

I've read in Twitter the existance of the source code for the Furby toy of 1998.

And guess what? it's written in 6502 ;)

http://www.seanriddle.com/furbysource.pdf

_________________
Author, IOCCC+JS1K winner, Princess Quest in Evercade Intellivision, MSX/Atari/CV/Intellivision/SMS game dev, Knight of boot sector games, IntyBASIC/CVBasic creator.


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 14, 2018 12:27 am 
Offline
User avatar

Joined: Mon Apr 23, 2012 12:28 am
Posts: 760
Location: Huntsville, AL
Cool. Thanks for sharing.

_________________
Michael A.


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 14, 2018 7:47 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
An excellent find!


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 20, 2018 10:52 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
First thing to note is that it's not quite a 6502 - there's no Y register and some addressing modes and many opcodes are missing. But the source certainly looks like 6502 and would probably run on a 6502.

I noticed a couple of oddities:

- they always CLC before SBC, so maybe SEC is missing? It makes the result out-by-one, unless maybe SBC has the opposite sense of carry on this chip. Or, witness the comment on the front page, the programmers hadn't quite got the idea of borrow and SEC.

- they PHA and PHP in their interrupt routine. Is that PHP a mistake, or does RTI work differently on this chip? If it does, then PLA needs not to affect the flags.

Also available at the Internet Archive in their book viewer.

See also the discussion on Hacker News - with links to more readings.

See also this previous post.

(Text above mostly recycled from the recent gplus post by mos6502.)


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 20, 2018 12:54 pm 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1431
The Sunplus SPC81A microcontroller was mentioned here in the forum in 2017.
The datasheet doesn't explicitly tell you that there is an Y register, so we could assume that this register is missing.
The data sheet doesn't tell you anything about the instruction set, either.

kakemoms wrote:
Sunplus SPC81A¤¤ (2000) - 4&6MHz - 69 opcodes(?), 80KB ROM + 128Byte RAM, 2 D/A converters (8-bit), 20-IO ports
Sunplus has a full range of controllers that contain 65B02 or 65N02 (Full instruction set), 65R02 (Reduced instruction set) or 65S02 (Reduced instruction set+bit+TAX+TXA).

A manual for 6502 related Sunplus instruction sets seems to be here.
//'Google Analytics' again, you better go with AdBlocker, NoScript etc.
Starting at page 52, there seems to be a list of the instructions for the different instruction sets...
...but I just fail to spot an instruction set where the Y register is missing.

Hmm... that Chinese Sunplus MCU page wants you to log in with a password when klicking "English".


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 20, 2018 1:11 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
ttlworks wrote:
kakemoms wrote:
Sunplus has a full range of controllers that contain 65B02 or 65N02 (Full instruction set), 65R02 (Reduced instruction set) or 65S02 (Reduced instruction set+bit+TAX+TXA).

A manual for 6502 related Sunplus instruction sets seems to be here.

Thanks for the link!
Quote:
...
...but I just fail to spot an instruction set where the Y register is missing.


Yes, see for example TAY, the instruction has cycle counts for two flavours of core but an X for the reduced flavours.

Attachment:
65r02-TAY.png
65r02-TAY.png [ 38.09 KiB | Viewed 3638 times ]


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 20, 2018 1:32 pm 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1431
BigEd wrote:
Yes, see for example TAY, the instruction has cycle counts for two flavours of core but an X for the reduced flavours.

When taking a closer look at the addressing modes for LDA...

Attachment:
sunplus_opcodes.png
sunplus_opcodes.png [ 44.58 KiB | Viewed 3634 times ]

Aha: _all_ variations of LDY are missing for 65r02, 65s02 and CPU12... plus quite a few other instructions.


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: No registered users and 7 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: