Re: 65816 emulating a C64.

From: admin_at_wavestarinteractive.com admin_at_wavestarinteractive.com <admin_at_wavestarinteractive.com>
Date: Thu, 23 Jul 2020 01:33:04 -0700 (PDT)
Message-ID: <1094194914.184118.1595493184108_at_privateemail.com>
tokafondo,

Groepaz gave you a short answer. The longer answer (although it can be a lot longer) is that when you are emulating a C64, you are not merely emulating a CPU. While the 65c816 and 6510 shares a lot in the machine language except those "illegal opcodes" and slight timing differences among others which will break a number of programs. While you can work around timing, you have illegal opcodes which are different and you have to find a way to emulate it well enough. This may require a 65816 running at possibly over 20 Mhz to emulate the 6510 functions all the opcodes and still match the clock timing because you'll have to pad up some of the clock cycles with NOP instructions in the 65c816 instructions just to soft-"emulate" each instruction. While the 65c816 can natively handle all the non-illegal opcodes with close to perfect compatibility, it is the "illegal opcodes" that demoscene used a lot that will break so you kind of have to emulate the behavior using one or more 65c816 instruct
 ions which you may have to perform at a faster clock rate to map the timing just right so a 6510 cpu software emulator would run on a 65c816. 

I haven't even attempted this so I don't have exact math numbers but it's conceivable. YOUR problem doesn't stop there. You not only have to emulate the CPU but you have to emulate a video chip, a sound chip, and I/O chips and so forth. A 65c816 alone can't be used so you need a video chip and a sound chip and I/O chips that can perform the functionality of the VIC-II, SID (produce decent SID sound), and CIA (6526 chips) chips. You might be able to pull off the CIA chip functionality with some logic chips and a 65c22. You will need to have a video chip to display the "VIC-II display" so either you have a modern VGA chip and do what a PC does or you have an FPGA solution. The SID is another challenge that you'll face. Modern PC sound chip emulating the sound generated by the SID. On a modern PC, how much is the CPU involved in producing PCM? Another option is some kind of FPGA or whatever solution. At some point, you run into FPGA or you'll be needing a chipset like you seen in Pentiu
 m and later based PCs. At what point would you basically be in the realm of why not just use your PC? What's the 65c816 going to be useful for. If I am going to have a 65c186 on to a C64, I am not wanting it to emulate my 6510 let alone the C64. I would want it to do stuff I can't do on a stock C64 hardware. This was the appeal of the SuperCPU. However, I would be aiming for an FPGA based 65c816 core solution that can be running at 100 Mhz and using much more than 16 MB of RAM through a memory controller and additional bank switching beyond the 24 bit address bus. Then I am getting something possibly with 4 GB of RAM, possible enhanced video chip that operates locally on the same bus as the 100 MHz "65c816". Options like fast I/O could also be something. It might be essentially a 65c816-based computer attached to the C64 and functionally slaved to it. Otherwise, what's the point? A SuperCPU isn't going to be reproduced anytime soon from what I can recall unless there is some news I 
 missed. 

I am looking at FPGA based placement ICs for the chips on the C64 to be a nice option. Although not the cheapest but certainly provides viable replacement options for our motherboard ICs that we aren't going to see the original ICs reproduced in the foundries ever again. The lithographs are probably no longer around in order to do so. MOS Technology's plant was demolished and removed by EPA regulations and that means complete erasing the building and ground cleanup removing contaminants and ALL previously existing infrastructure on site. Basically a clean slate (as close to it as possible) for development which might have already begun (or not). I don't know. I haven't checked the area on Google maps to see what has been done to the site. It was a superfund site. I wouldn't be surprised if the site had been redeveloped. Prime real estate for other development instead of a blank dirt field.

I don't think the 65c816 has the hardware facility on its own to emulate functions like a video chip or sound chip. It can't generate video or sound on its own. You would end up needing a microcontroller which then is basically a computer on a chip which you can do in FPGA. There is a point where you might ask yourself, if I am already doing this in FPGA, why not outright 'emulate' the 6510 accurately in the first place. This is what has been done to a reasonable level with the Turbo Chameleon project and that built upon the work previously on CommodoreOne / C-One. If you want to make a new 65c816 based CPU accelerator, go for it. The 65c816 would lend itself to a new SCPU type device. Maybe, you can use an FPGA based approach and go better than 20 MHz and have 100 MHz and possibly a memory controller for access to say.... 4 GB of RAM. Something that can be an accessory to the C64 or 128.

However, the market is small and most of us are long past the time of using the C64 as a main computer. We don't want to dare run these computers for 8-12 hours a day, 5+ days a week that we used to. This is why most of us use software emulators because we rather wear out a Windrone PC and replace it with another commodity mass produced PC than our antiques that we can't easily run under such level of activity without running through our irreplaceable chips because the supplies are running thin on the market and getting more expensive.

> On July 22, 2020 5:55 AM tokafondo <tokafondo_at_gmail.com> wrote:
> 
>  
> The question is easy: could a 65816 system emulate by software a C64?
> 
> Not talking about creating a supercharged C64 computer by hardware, but
> about coding software that would work as VICE, CCS64 and others.
> 
> It would benefit from sharing a lot if not all the instructions between the
> host and guest machine.
> 
> The extra cycles got from running at 20Mhz could be used to emulate the SID
> and VIC-II.
> 
> The CIAs could just be bypassed to real CIAs.
> 
> The emulator could even drive real Commodore drives, I think - or just load
> X64, TAP and CRT files.
> 
> What do you think?
> 
> 
> 
> --
> Sent from: http://cbm-hackers.2304266.n4.nabble.com/
Received on 2020-07-23 11:00:02

Archive generated by hypermail 2.3.0.