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: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?
- 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
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