65f02 wrote:
For the more advanced Apple //e and //c, I am firmly with Ed: That's out of scope for me, just like the BBC Master. Too much hassle and an awkward solution; and the result would be less than convincing since I could only accelerate a fraction of the available host memory.
Well, I think that would be giving up great gains too soon. I'm sure that there are plenty of people like me who use a IIc mainly to run II+ software, and in such cases accelerating less than 50% of host memory would give you virtually all of the speedup. It would indeed be less convincing to people who can detect a difference in overall program run speed of a few percent (or in the case of programs using the host ROM very little, such as chess games, a fraction of a percent), but I doubt that many of your users are even set up to do such comparisons between a II+ and a IIe or IIc.
Even the IIc's original 16K v255 ROM uses a few locations in the auxilliary address space (such as the "screen holes" in the frame buffers allocated to data storage for I/O devices), so if you don't support this the system probably won't even boot, and certainly some devices (such as the serial ports) won't work. But many of these are little used, or even not used at all after setup if you're not using some devices. With the later 32K ROMs there is code in the alternate ROM bank that is used in normal operation, but not a huge amount of it. I don't have a figure, but my guess would be that in these cases over 90% of ROM accesses are from the main bank, not the alternate bank.
If you commit to supporting the language card at all, you've committed to emulating memory management logic in the 65F02. And come to think of it, if you commit to supporting an Apple II with any cards beyond a single disk controller in slot 6 (or any other single card) you still have to commit to emulating memory management logic anyway, because the $C800-$CFFF space is bank switched between the ROM on each card. (
PR#6 switches in the ROM on slot six before jumping to it.)
Especially if you're going to be doing this for any other systems, it seems worthwhile to develop a "mini-language" to describe such memory management logic, which would need to describe:
- Which ranges of the address space are banked, and what's backing each bank.
- How to deal with each bank: internal RAM only, external access only, write-through on free external bus cycles (if you want to implement that), and perhaps in the future some sort of LRU cache or something like that.
- Which addresses and what kind of access to them (read, write, two sequential writes, perhaps other patterns) change the bank currently in use in a given area of address space.
Note that in this model of 65F02 memory management the RAM and ROM at the $E000-$FFFF range actually are viewed as four mappings: read/write ROM, read ROM/write RAM, read RAM/write ROM ("read only RAM") and read RAM/write RAM. (The $D000-$DFFF bank will be the same, except with further mappings because there are two RAM banks.) Not supporting all of these will almost certainly break a lot of software (including, probably, UCSD Pascal) because it's common use the read ROM/write RAM mapping during setup so you can call ROM routines while loading the language card.
Even for just the Apple II language card it seems to me simpler to develop and debug a simple, general system like this than to try to special-case the whole thing, and once you have this it's easy to add support for a lot of other systems, too, including the IIc, which is not inherently more complex but just has a few more mappings.
The one thing this does not yet get you is support for systems like the C64 where external signals contribute to determining memory mapping. A simple way to handle that woudl be to have a few connections on the board to serve as inputs to the memory management logic; C64 users could then wire up the /GAME and /EXROM signals (provided by whatever's plugged into the cartridge port) to this and the memory management logic could examine the state of those as well as its internal state from past instructions executed to determine the current mapping for any address range.
Quote:
I guess I have only ever used my language card for UCSD Pascal, which may be a special case. To support switching back and forth between RAM and ROM, I guess my best bet, in view of the limited 64k block RAM I have in the FPGA, is a compromise: Upon startup, read in (and accelerate) the ROM; allow it to be overwritten and used as RAM once the language card gets enabled; and then revert to un-accelerated mode in that address space whenever the ROM gets switched back in.
Yes, simply saying "I'm going to allow only a fixed 64K of memory to be 'fast memory'" (i.e., read/writes use the 65F02 onboard memory) is I think an excellent simplification to start with, and does not get in the way of later adding schemes to more dynamically switch back and forth. However, for the Apple II I might start by providing both "ROM is fast" and "language card is fast" schemes (perhaps switched by your DIP switch on the board) because for users on a II+ not running an alternate language (Integer BASIC or UCSD Pascal) that would greatly slow down the system.
Quote:
Supporting a much larger, off-chip RAM would be neat, but I don't think I can accommodate it in the 40-pin DIP footprint. Even if I find room for the chip, bringing out approx. 30 additional address/data/control lines from the FPGA seems impossible....
I agree that's probably a non-starter. But it seems to me it doesn't really matter how much RAM you add to your system; there will always be
something out there where you don't have enough on-board RAM to replace all of the system memory. So you might as well just deal with that by declaring you're not always going to map all system memory into on-board RAM, leaving yourself in a place where you can handle larger memories with simple solutions ("always access as I/O space") for the moment and then upgrade those to more complex solutions within the same structure later, if that's worthwhile. (For some systems, such as the IIc, I don't think it would be.)
Quote:
Besides technical reasons, personal preferences and nostalgia come into play too, to be honest. The Apple II plus was my first computer -- I still have it, and did my initial tests of the 65F02 on that very machine. And UCSD Pascal was dear to my heart as my first "real" programming language, so I would like to support it. But by the time the Apple //e came out, I had moved on to 68000 systems, so that generation of machines does not mean as much to me.
I am similar: I have little interest in Apple II systems after the II+. However, I now own a IIc, not a II+, simply because it gets me real Apple II hardware in much less space than a II+ system would and it works just fine as a II+ for all the purposes for which I need it. (Well, almost all, but what little it doesn't do I can live with; it's better than giving up one of my other computers in order to make space for a II+.)