6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 8:40 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Thu Feb 11, 2016 1:45 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
I wanted to see what the experts think.

I know this is beyond complicated. Especially when compared to more "traditional" memory mapping schemes (ROM/RAM/VIA). But this is my first attempt. I plan on clocking the 65C02 between 1 and 2 MHz.

Code:
            --------------------------------
$FFFF       |   65C02 ROM, WOZ Monitor     |
$E000       |   BASIC (ROM copied to RAM)  |
            |______________________________|
$DFFF       |                              |
$DF00       |       Video (Propeller)      |
            |______________________________|
$DEFF       |                              |
$DEF0       |            VIA 2             |
            |______________________________|
$DEEF       |                              |
$DEE0       |            VIA 1             |
            |______________________________|
$D013       |                              |
$D010       |   PIA (Propeller Emulated)   |
            |______________________________|
$D009       | GENERAL PURPOSE RAM, PAGE 1, |
$0000       | PAGE 0, etc.                 |
            --------------------------------


IC's: 65C02, 128K SRAM (64K used), two 65C22's, two Propellers (two EEPROMS), glue logic.

I wanted to keep the PIA address consistent with the WOZ monitor and use the software PIA Jac wrote for serial communications. But the two VIA's in there are at those addresses because I just think backwards most of the time. They are butted up against the dedicated Propeller for video/audio. I'm not hell-bent on keeping them there.

I also wanted to give the Propeller Video a full 256 registers to play with because I plan on implementing audio and video.
Oh, I received my first 65C51 if you guys think it's worth implementing. I'm just not sure I need it if I follow the emulated PIA route.

Finally, I drew up a bunch of AND/NAND logic on paper to handle this mapping. And I admit, it was pretty "elegant" for me but I realize I have too many gates with lots of propagation delays. Sloppy to the experts but it was fun "solving".

When the system boots up, one Propeller will keep everything disabled except SRAM. It will then copy a ROM image into RAM.

What are your thoughts and suggestions?


------------------------------------------------------------------------------------

Now, a LONG winded explanation....feel free to skip. :-)

First, let me explain some of my logic....

When I was a kid I had a hard time understanding what ROM actually was because I grew up with a Commodore 64 (wasn't my first computer but I learned more on it). The C64 copies ROM into RAM at boot up (or something similar). So pretty much the entire 64K of memory is available to store data. When I was 9 or 10, ROM to me was the game cart I plugged in. :-)

I like the idea of taking a ROM image and copying it to RAM before the CPU is started.

Second, I want something more than another Apple 1 clone. No disrespect to all the guys out there that have built them. Hell, I just bought an L-Star from Jac and can't wait to play with it! I've also built an L-Star on my breadboard...tons of fun.

But I want something with old-school graphics. I've been using the Propeller for a while now and have tons of cool drivers for video. The 65C02 is a perfect fit for it. I have built many Arduino audio players for VGM music using real AY-3-8910's and SN76489's. So I have all this video and audio sitting on micro-controllers. I want to bring them together with an old-school computer. :-D

I will be open-sourcing all of it. Once I get a working prototype. My hopes that others will see that an amateur like me can build something cool that isn't another Arduino shield....maybe they will too.

Thanks!!

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 11, 2016 3:14 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
cbmeeks wrote:
When I was a kid I had a hard time understanding what ROM actually was because I grew up with a Commodore 64 (wasn't my first computer but I learned more on it). The C64 copies ROM into RAM at boot up (or something similar). So pretty much the entire 64K of memory is available to store data. When I was 9 or 10, ROM to me was the game cart I plugged in. :-)

Actually, the C-64 ran directly from its kernel ROM—no shadowing took place. It was possible to copy both ROMs to RAM and run entirely out of RAM, but doing so on the C-64 conferred absolutely no performance advantage.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 11, 2016 3:21 pm 
Offline

Joined: Sun Nov 08, 2009 1:56 am
Posts: 411
Location: Minnesota
Quote:
It was possible to copy both ROMs to RAM and run entirely out of RAM, but doing so on the C-64 conferred absolutely no performance advantage.


Not by itself, no. But once the code is in RAM it is possible to modify it. That slow BASIC garbage collection code comes to mind as something that can be improved.


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 11, 2016 7:39 pm 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 679
One handy thing with the C64 was to put graphics under ROM (or under I/O) and keep the ROMs banked in. The video chip would still read the RAM underneath, while the KERNAL or BASIC would still be used by the CPU. In all, this arrangement utilizes up to 80KB of total address space simultaneously.

A potentially dumb question, though: Can't the Propeller do everything the VIAs can? Is there a reason for keeping the VIAs around, especially since it sounds like the Propeller is going to control the bootstrap?

_________________
WFDis Interactive 6502 Disassembler
AcheronVM: A Reconfigurable 16-bit Virtual CPU for the 6502 Microprocessor


Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 11, 2016 7:42 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
White Flame wrote:
Can't the Propeller do everything the VIAs can? Is there a reason for keeping the VIAs around, especially since it sounds like the Propeller is going to control the bootstrap?


I'm sure it could to a great degree. But it would depend on if you wanted 100% emulation or partial emulation. In other words, if you were to devote 3-5 COGS or so to emulate a 65C22, then why not just put a real on in?

But if you just wanted to emulate timers, for example, then maybe you wouldn't need one.

I'm still on the fence about them anyway. I don't know if I actually need them for what *I* want to do. But, since they are so "versatile", then why not put them in?

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 12, 2016 2:14 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
You seem to have a rather large gap between your PIA and your VIA #1. If you're going through the trouble of fine-grained decode anyway, maybe you could tuck VIA #1 in at $D000 - $D00F, and squeeze the other stuff down to the lower half of $Dxxx, leaving more room for ROM (or "system" RAM) at the upper half of $Dxxx.

It also might be neat to try mapping one of the VIAs to zero-page, for experimentation.

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 12, 2016 3:26 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
barrym95838 wrote:
It also might be neat to try mapping one of the VIAs to zero-page, for experimentation.
Oh, golly, Mike -- I/O in zero page !?? Don't you realize you've touched on one of the Never Ending Debates !?? :shock: :mrgreen: Opponents and proponents have already discussed this to a standstill in the thread major speedup with 65C02 I/O mapped into zero-page. If anyone has anything new to offer then the other thread -- not here -- would seem to be where those thoughts belong.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 12, 2016 12:59 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
barrym95838 wrote:
You seem to have a rather large gap between your PIA and your VIA #1. If you're going through the trouble of fine-grained decode anyway, maybe you could tuck VIA #1 in at $D000 - $D00F, and squeeze the other stuff down to the lower half of $Dxxx, leaving more room for ROM (or "system" RAM) at the upper half of $Dxxx.
Mike B.


That's a good idea. Anything to make the decoding easier. In fact, I thought about forgetting the $D0XX requirement for the software PIA and just patching the actual Woz monitor to use another address.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 12, 2016 4:10 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
cbmeeks wrote:
... Anything to make the decoding easier. In fact, I thought about forgetting the $D0XX requirement for the software PIA and just patching the actual Woz monitor to use another address.

Anything? If that's really true, then Garth's plan's for you. (hey, I was a poet, and didn't know it ...)

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 12, 2016 4:16 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
I've been reading those primers over and over. Great stuff.

I just need to adapt it to use some micro-controllers. Never really designed any sort of address decoders. But I will keep on pushing through. :-)

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 13, 2016 12:39 am 
Offline
User avatar

Joined: Thu Jun 23, 2011 2:12 am
Posts: 229
Location: Rancho Cucamonga, California
cbmeeks wrote:
I wanted to keep the PIA address consistent with the WOZ monitor and use the software PIA Jac wrote for serial communications. But the two VIA's in there are at those addresses because I just think backwards most of the time. They are butted up against the dedicated Propeller for video/audio. I'm not hell-bent on keeping them there.


The Woz monitor and my Apple 1 PIA emulator in the L-Star project are a nice quick way to get up and running but I understand if you want more than that (I do too :) ).

If you want the Apple 1 PIA elsewhere, it's very easy to change the Woz monitor so it addresses the PIA at a different place, and the emulator lets you modify the address by simply changing a constant. Keep in mind that the ROM included with the L-Star project is Ken Wessen's Krusader which has a Woz mon that's slightly different from the original listings in the Apple 1 manual.

You could initially leave the Woz monitor and Krusader and the PIA emulator in place, and use Krusader to write your own operating system that uses the other hardware. You can even tweak the L-Star firmware so it will let you overwrite the Woz monitor (simply configure the memory cog to emulate RAM instead of ROM) to do your testing. Eventually, you can dump your OS through the terminal to a text file (*), convert that to a binary file and incorporate it into the L-Star firmware instead of the Woz mon. If you use other hardware (emulated or not) for interfacing, such as a text video screen with direct addressing, you can eventually remove the A1PIA.spin module from the firmware.

So many ideas...

===Jac

(*) You could even add a bit of code to the L-Star firmware to copy a designated area of emulated RAM to the EEPROM and/or vice versa when you hit a hot key (e.g. Ctrl+PgUp / Ctrl+PgDn). It should also be very easy to let the Propeller firmware "hot-swap" memory areas using a hot key so you can use Krusader and Woz Mon to write your OS, and then hit a key to "install it" or "uninstall it" in memory.


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

All times are UTC


Who is online

Users browsing this forum: DRG and 20 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: