As you already know, the HIRES screen is made of 200 lines of 40 bytes, but only six bits of each byte are actually displayed.
As soon as you want to shift these bits in order to have a smooth animation, it becomes a nightmare...
E.g.: let's say there's an object in memory you want to transfer to screen.
Without any shift, a sequence of bytes (a line of the object) would normally be transfered like this:
Code: Select all
ldy #WIDTH_IN_BYTES-1
xferloop:
lda (obj_line_ptr),y
sta (screen_ptr),y
dey
bpl xferloop
When you wish to shift the bytes one position to the left, it is a bit more complicated, but still manageable through the Carry flag, like in:
Code: Select all
ldy #WIDTH_IN_BYTES-1
clc
xferloop:
lda (obj_line_ptr),y
rol a ; shifts in the bit coming from the right
tax
asl a ; shifts the 6th bit two times to carry
asl a ; so that the 6th bit can be propagated to next byte
txa
and #$3F ; keeps only the 6 bits
ora #$40 ; make sure the byte is not an attribute
sta (screen_ptr),y
dey
bpl xferloop
We don't have a hardware shifter like there was on the early Midway arcade machines (Space Invaders, etc). So, an obvious fast technique is to store all objects (and their masks) six times. This means that a single 24x40 sprite would require something like 2400 bytes (5x40x2x6)... 15 sprites and you eat all the memory...
So, come on, share you ideas for fast hires shift techniques on the Oric...
Cheers,
Fabrice