Well, got my sprite drawer working yesterday. I have to admit - it's a basic clone of Steve's ... OK I'll hold my hands up and admit to that.
It's a shame I'm so busy at the moment - but just to keep you updated; ... I'm currently thinking about the masking! I keep trying to think if there's an easier way over my current effort - (that's not working proper like)... I'll post the code here and I'll update the post, if I work out where I've got wrong...
Code:
; check if both pixels blank - skip write
CMP #0
BEQ SW_SkipWrite
STA TEMP
AND #$AA
BNE SW_TryRight
LDA ScreenAddPtr+1,X
AND #$AA
ORA SpriteDataPtr+1,Y
STA TEMP
SW_TryRight:
LDA SpriteDataPtr+1,Y
AND #$55
BNE SW_WritePixel
LDA ScreenAddPtr+1,X
AND #$55
ORA TEMP
JMP ScreenAddPtr
SW_WritePixel:
LDA TEMP
ScreenAddPtr:
STA $FFFF,X ; is -> STA ScreenAddPtr+1,X
Ok, the idea is - two blank pixels - skip write, then check for either left or right blank ... If this is the case - mask the pixel from the screen position, or the sprite data onto this, store - check the other pixel then ... write back to the screen position.
Now, I can assure you - I'm doing something wrong as the image is basically there, however the pixels being written to the screen are incorrect. As you can see - if you have seen Steve's sprite plotter, the code is placed between the read and write of the sprite data to the screen.
Hopefully, someone can see a mistake in my AND'ing values or general approach to the masking... WHY it couldn't be like the Amstrad and not be interleaved LOL!
Anyway, thanks in advance for having a look - and I'm feeling more confident about 6502, so hopefully any posts soon will be a little be more juicy for you all to get your teeth into!
many thanks - Neil
