Chema wrote:This is very smart, Twilighte. So they are actually attributes which are displayed as paper color?
Sort of, there are codes that are redundant under HIRES and these appear as blank (or black) screen bytes.
08 in text mode sets LORES0 (or standard) character set, 09 sets LORES1 (or Alternate) character set, 0A sets standard double height and 0B sets alternate Double height. Since these codes are only relevant in TEXT mode they have no meaning in HIRES.
Chema wrote:I guess, this could be an issue if you want to mask something against them, but I guess (as they are to detect collisions) that such thing never happens...
Not at all, it requires some extra code in the Sprite plotting routine, code that would have to exist anyway to pick up the collision
Code: Select all
lda #00
sta EmbeddedCode
pswm_offset1
ldy $DEAD,x
lda (screen),y
bmi pswm_ProcInversedByte
cmp #64
bcc FoundEmbeddedCode
pswm_mask1
and $dead,x
pswm_bitmap1
ora $dead,x
...
FoundEmbeddedCode
and #3
sta EmbeddedCode
lda #64
jmp pswm_bitmap1
The above is a very simple example since it will only 'deliver' a single embedded code result at the end of the routine. I also only provide the 'essential' part of the code to simplify things.
All values below 64 are treated as embedded codes since i do not use Paper, ink or any other attributes in the map graphics (all down left hand side in AIC mode).
I explored branching on the overflow flag instead of comparing but this would still require the same number of cycles to branch..
The FoundEmbeddedCode routine resets the code to 64 for its visual bitmap equivalent before branching back to ORA with the bitmap. Its pointless masking with the AND before because its already an empty bitmap.
Its also possible to repeat the same branch for Inversed embedded codes and i intend to add this later
I also notice its also possible to include ink colour 6 on the cyan rows in the graphic background. this would mean 5 embedded codes (AND #7).
As mentioned before we could also use codes 32 to 63 but they do set the left most pixel and for my purposes thats a bit too restrictive.
