Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 2379

programming • Re: VDU commands on BBC micro

$
0
0
One thing I haven't seen explained is how the conversion calculation for mode 7 works - subtract &74 from the high byte of the memory address and then EOR with &20. What is that calculation doing?
The routine at &CA27 (AXCRTB) converts screen addresses for writing to R12 (start address high byte) or R14 (cursor address high byte). On entry A is in the range &7C..&83, and R12 in particular needs programming as follows:
  • bits 7, 6 = unused
  • bit 5, MA13 = 1, TTXVDU address mapping
  • bit 4, MA12 = 0, no HIRES wraparound
  • bit 3, MA11 = 1, high RAM bank
  • bits 1,0 = MA9, MA8 = bits 9, 8 of start address
Resulting in a binary mask of %xx101xxx, corresponding to a range of &28..&2F, though bit 2 is only set in R14 when the cursor is wrapped around.

The SBC then maps the incoming high byte to &08..&0F, and bit 5 (always clear) is set in an extra step. However, SBC #&54 would do it in one.

Statistics: Posted by regregex — Sat Sep 14, 2024 9:13 pm



Viewing all articles
Browse latest Browse all 2379

Trending Articles