Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VASYL & access to system bus
#2
(2020-09-30, 09:03 AM)abbruzze Wrote: I would like to understand how VAYSL behaves when accessing the system bus (for example when it executes a MOV towards a VIC register) and how it can "halt" the CPU as mentioned in the FAQ.

Another point: according to the Instruction's doc., MOV will be delayed in case VIC is fetching data (e.g. badline or sprite). Is it the same for XFER (in the documentation is not mentioned)?

Any write to VIC-II register will be postponed until the access is physically possible, i.e. until VIC-II is willing to listen to us. This means that XFER, MOV and BADLINE can stall while they are waiting for AEC line to go up.

Once VIC-II is available, BeamRacer will first separate system and local buses (address and data, see https://docs.beamracer.net/lib/exe/detai...iagram.png). On the local side, the write proceeds as usual - first with a write to the address bus and VIC-II CS and RW lines getting asserted, followed by a write to the data bus.

6510 continues unimpeded on the system bus side, and if it does not want anything from VIC/VASYL IO address space, it will not lose any cycles. However, if it accesses $d000-$d3ff, it will be halted until VASYL is done writing to VIC-II, which may be arbitrarily long (e.g. if the display list makes a sequence of VIC-II writes in successive cycles). BTW, technically the 6510's RDY line is going HIGH at the beginning of every stopped cycle and stays there until VASYL completes its instruction fetch and determines what it will be doing later in the cycle, at which point RDY may go LOW again. But I believe this is irrelevant from the viewpoint of an emulator (correct me if I am wrong).

Now, if the 6510 was trying to make a write access, it naturally won't stop immediately, but merrily push forward. BeamRacer cannot use VIC-II's approach of asserting RDY ahead of time, because display lists are dynamic and VASYL only finds out what needs to happen once it fetches and decodes its current instruction. It cannot let the CPU make the access either, because that would mean postponing display list's write access and likely result in a visual glitch.

So what happens is that 6510 is allowed to continue, and the writes by the CPU and by VASYL happen concurrently. The system and local buses are isolated, so VASYL write gets to VIC-II, while CPU write gets recorded by BeamRacer and preserved for future use. When the time comes for the CPU to run again, it will need to wait one more cycle, during which the previously recorded write access is replayed to VIC/VASYL.

In other words, VASYL writes always have priority over CPU writes.
Reply


Messages In This Thread
VASYL & access to system bus - by abbruzze - 2020-09-30, 09:03 AM
RE: VASYL & access to system bus - by laubzega - 2020-09-30, 09:05 PM
RE: VASYL & access to system bus - by abbruzze - 2020-10-01, 11:07 AM
RE: VASYL & access to system bus - by silverdr - 2020-10-01, 06:06 PM
RE: VASYL & access to system bus - by laubzega - 2020-10-01, 05:45 PM
RE: VASYL & access to system bus - by abbruzze - 2020-10-02, 11:13 AM
RE: VASYL & access to system bus - by laubzega - 2020-10-02, 07:25 PM
RE: VASYL & access to system bus - by shazz - 2020-10-03, 01:30 PM
RE: VASYL & access to system bus - by abbruzze - 2020-10-03, 05:24 PM
RE: VASYL & access to system bus - by laubzega - 2020-10-04, 08:11 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)