Previous Thread
Next Thread
Print Thread
6502 Variants #100512 07/11/15 10:07 PM
Joined: Apr 2012
Posts: 272
Pernod Online Content OP
Senior Member
OP Online Content
Senior Member
Joined: Apr 2012
Posts: 272
As you know I'm still learning/improving the bbc driver when time permits.

The various machines use different variants of the 6502 CPU and would like to clarify that they are actually using the most appropriate.

bbcb has 6502A and uses M6502
bbcbp has 6512A and uses M6502
bbcm has 65C12A and uses M65SC02
bbcmc has 65SC12P and uses M65SC02

So that's four different variants but currently only use M6502 and M65SC02. Are they using closest match available? I expect 6512A has advantages over 6502A.

Thanks.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: 6502 Variants [Re: Pernod] #100513 07/12/15 02:37 AM
Joined: Feb 2010
Posts: 71
M
Matty Offline
Member
Offline
Member
M
Joined: Feb 2010
Posts: 71
6512 is just a 6502 without a internal clock generator module. You seem to be talking crap.

Re: 6502 Variants [Re: Matty] #100516 07/12/15 01:01 PM
Joined: May 2003
Posts: 225
T
Trebor Offline
Senior Member
Offline
Senior Member
T
Joined: May 2003
Posts: 225
Originally Posted By Matty
6512 is just a 6502 without a internal clock generator module.


Another difference between the 6502 and 6512, is the data bus is enable on the 12.

Looking over the other variants, more items such as additional instructions and address modes come into play:

http://www.cpu-world.com/info/6502/65xx_65Cxx_65SCxx_differences.html

Re: 6502 Variants [Re: Pernod] #100518 07/12/15 02:14 PM
Joined: Mar 2001
Posts: 16,499
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,499
Originally Posted By Pernod
I expect 6512A has advantages over 6502A.


Actually, all the 6503+ variants except for the 6510 are disadvantaged in some way over a stock 6502. Most famously, the Atari 2600's 6507 only has an 8k address space and no interrupts.

Anyhow, from an emulation POV, the CPUs we're using all line up properly. An NMOS 6512 is a 6502 for emulation purposes, and the CMOS 6512 is an 'SC02 for emulation purposes.

Re: 6502 Variants [Re: R. Belmont] #100519 07/12/15 02:52 PM
Joined: Apr 2012
Posts: 272
Pernod Online Content OP
Senior Member
OP Online Content
Senior Member
Joined: Apr 2012
Posts: 272
Originally Posted By R. Belmont
Anyhow, from an emulation POV, the CPUs we're using all line up properly. An NMOS 6512 is a 6502 for emulation purposes, and the CMOS 6512 is an 'SC02 for emulation purposes.

That's exactly what I wanted to confirm, thanks.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: 6502 Variants [Re: Pernod] #102513 11/08/15 06:03 PM
Joined: Apr 2012
Posts: 272
Pernod Online Content OP
Senior Member
OP Online Content
Senior Member
Joined: Apr 2012
Posts: 272
I've been running the Dormann tests https://github.com/Klaus2m5/6502_65C02_functional_tests in bbcb and bbcm to test m6502 and m65sc02 respecitively.
The 6502 test passes in bbcb but 65C02 fails in bbcm when testing SBC.
A BBC compatible image of the tests is at https://github.com/mattgodbolt/jsbeeb/blob/master/discs/bcdtest.ssd?raw=true which passes on real hardware.
To run in bbcm:
- load the image
- select DFS, D + BREAK (F12)
- type *BCDTEST

I suspect this is the reason I have a few Master versions of games hanging in bbcm.

Making changes to a CPU core is a little beyond me at the moment so would appreciate someone who knows it to take a look, thanks.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: 6502 Variants [Re: Pernod] #102514 11/08/15 09:43 PM
Joined: Jun 2001
Posts: 418
O
Olivier Galibert Online Content
Senior Member
Online Content
Senior Member
O
Joined: Jun 2001
Posts: 418
Originally Posted By Pernod
I've been running the Dormann tests https://github.com/Klaus2m5/6502_65C02_functional_tests in bbcb and bbcm to test m6502 and m65sc02 respecitively.
The 6502 test passes in bbcb but 65C02 fails in bbcm when testing SBC.
A BBC compatible image of the tests is at https://github.com/mattgodbolt/jsbeeb/blob/master/discs/bcdtest.ssd?raw=true which passes on real hardware.
To run in bbcm:
- load the image
- select DFS, D + BREAK (F12)
- type *BCDTEST

I suspect this is the reason I have a few Master versions of games hanging in bbcm.

Making changes to a CPU core is a little beyond me at the moment so would appreciate someone who knows it to take a look, thanks.



Yeah, the cmos versions of the 6502 are buggy for sbc in decimal mode, a missing xor gate iirc. I haven't yet added that though, forgot.

It's such a specific bug that I kinda doubt it causes hangs, but who knows.

Re: 6502 Variants [Re: Pernod] #102599 11/15/15 09:37 PM
Joined: Jun 2014
Posts: 84
P
peter ferrie Offline
Member
Offline
Member
P
Joined: Jun 2014
Posts: 84
There are two issues with 6502 vs 65C02 decimal mode - the most obvious is that for 65C02, N/V/Z flags are set properly, so ADC is affected along with SBC (and both take one cycle longer to compute).
The second one is that invalid decimal values will return different results between the two CPUs.

Re: 6502 Variants [Re: Pernod] #102604 11/16/15 12:32 AM
Joined: Mar 2006
Posts: 1,042
L
Lord Nightmare Offline
Very Senior Member
Offline
Very Senior Member
L
Joined: Mar 2006
Posts: 1,042
There is a decimal mode bug causing incorrect sbc results, specific to the rare 65SC02 used on the amiga 8 port serial card, and its derivatives used on the c65 prototypes. I believe this bug is what OG is talking about. The plain 65C02 is not affected by this bug, AFAIK.

LN


"When life gives you zombies... *CHA-CHIK!* ...you make zombie-ade!"
Re: 6502 Variants [Re: Pernod] #102605 11/16/15 01:30 AM
Joined: Mar 2001
Posts: 16,499
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,499
And none of this applies to the WDC 65C02, which has different added instructions and is forward-compatible with the 65816.


Who's Online Now
5 registered members (Dorando, Alegend45, xinyingho, Praxis, Carbon), 56 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,775
Posts115,470
Members4,899
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3