Re: BASIC for the CBM-II/8088

From: Mia Magnusson <mia_at_plea.se>
Date: Sun, 15 Jul 2018 22:11:07 +0200
Message-ID: <20180715221107.000039d6@plea.se>
Den Sun, 15 Jul 2018 20:56:55 +0200 skrev Michał Pleban
<lists@michau.name>:
> Mia Magnusson wrote:
> 
> > That would probably be easiest, or rather the most pcb space
> > efficient, to implement using programmable logic.
> 
> Probably so :-)
> 
> > Otherwise something like 74LS279 contain four set/reset flip flops.
> > A 74LS138 could detect which 1/8 part of video ram is written, and
> > it's output could go to the set inputs of two of theese. It would
> > also require some three state thing to read this,
> 
> Not necessarily. The value of this latch should go to the 6509 anyway,
> so you can connect them (using some additional connector) to the user
> port, where they would be read by a CIA port.

Then the list member SMF would figure out a yet non-existing use case
where those user port pins are needed for something else ;) ;)

> > Btw how fast is the 8088 at comparing two memory blocks, compared to
> > how fast the 6509 is at copying the same size of memory? Would
> > there be any benefit using the 8088 to search for what has been
> > changed since last time the video memory were examined, and build a
> > list for single bytes (or smaller blocks) for the 6509 to copy?
> > I recall a discussion about the REP instructions of the 8088, but
> > can't remember exactly what we were discussing. Probably video
> > ram :)
> 
> That's a good suggestion. If my 8086 instruction set reference is
> correct, you should be able to do a REP SCASW of the whole screen in
> 8ms.
> 
> However, it would also mean that you must keep an additional copy of
> the screen on the 8088 side to compare what's changed. The cost of
> updating this copy will add to the solution. I guess it depends on
> what kind of application is being run; if the application updates
> large small portions of the sceen at a time, the SCASW solution will
> be faster; but if it redraws the whole screen a lot, it will be
> slower.

A rather complicated solution which probably would be efficient would
be to not have a simple flip flop remembering which areas that were
written to, but a counter for each area (which cannot overflow but
gets stuck when reaching it's max value). That way the software can
check how much has been written to a particular area of the screen. If
it's only a few bytes, SCASW would be the fastest solution while if
much has been written a pure copy would be the fastest.


The performance-wise best solution must be to use some synchronisation
so the same memory can be simultaneously used by both the 8088 and the
6509. There are expensive dual port SRAM's but I think it would be good
enough with a solution that just delays one processor when both want to
access the memory at the same time. Or it could even work like the
original CGA card, with "snow" if the 8088 writes outside the vblank
period, but this "snow" would be that the 6509 gets incorrect data
while reading. As this is easily detectable by the hardware, it could
generate some flag or interrupt to the 6509 making it redo the last few
bytes.

Or as I suggested previously, the super complicated but performance
wise excellent solution would be to build a replica B with a replica
8088 card where the memory is fast enough for both CPU's and the video
hardware to read from memory without conflicts.

A first step of that could be to add fast memory directly to the 8088
board and make it possible to access that from the 6509 in a window in
the free area of bank 15. If that can be made to work, then this
solution could replace all internal ram on the B and make it possible
for both processors to access all memory simultaneously. 

But the question is when is it still a B with a "B 8088" card, and when
is it something else? :)

> > Using BIOS means that there is one place less where the program has
> > do do things different with monochrome v.s. color display, so it
> > might had made sense to use those INT's even for programs using the
> > video memory directly.
> 
> Yes, that's what I think too.

Btw this must be easy to check with an emulator.

-- 
(\_/) Copy the bunny to your mails to help
(O.o) him achieve world domination.
(> <) Come join the dark side.
/_|_\ We have cookies.
Received on 2018-07-15 23:00:04

Archive generated by hypermail 2.2.0.