Post by oss003 on Jan 7, 2021 7:24:47 GMT
At the MPAGD FB page, there was a question about the possibility to use flashing background blocks.
This is until v0.7.10 not possible with WinAGD but there is a trick to make background blocks flashing.
Each block of 8x8 pixels has a single byte of colour attribute packed as follows
Bit 7 if set indicates the colour flashes between the fore and back colours.
Bit 6 if set indicates the colours are rendered bright.
Bits 5 to 3 contain the PAPER (background) colour 0..7
Bits 2 to 0 contain the INK (foreground) colour 0..7
The flash attribute alternates a cell between its foreground and background colours on a timer.
The bright attribute makes the foreground and background colours, err…, brighter.
The bright attribute nearly doubles the effective number of colours the spectrum could display.
I say nearly because bright black is still black.
So what do you have to do in MPAGD:
1) Create a file called BLINK.ASM and save it in the UserRoutines\Spectrum directory:
2) Select BLINK.ASM as User routine in WinAGD
3) Now you can overwrite the colour (and setting the flash bit) of a block by doing this once in eg EVENT INTROMENU (before a screen is drawn):
The COLOUR command is also used by text routines so set PAPER or COLOUR after calling USER otherwise the text is also flashing.
Repeat setting colour and calling USER <blocknummer> for every blocknumber you want to set.
You only have to do this once ..... or more if you want to change the colour of a block during gameplay.
This is until v0.7.10 not possible with WinAGD but there is a trick to make background blocks flashing.
Each block of 8x8 pixels has a single byte of colour attribute packed as follows
Bit 7 6 5 4 3 2 1 0
F B P P P I I I
Bit 7 if set indicates the colour flashes between the fore and back colours.
Bit 6 if set indicates the colours are rendered bright.
Bits 5 to 3 contain the PAPER (background) colour 0..7
Bits 2 to 0 contain the INK (foreground) colour 0..7
The flash attribute alternates a cell between its foreground and background colours on a timer.
The bright attribute makes the foreground and background colours, err…, brighter.
The bright attribute nearly doubles the effective number of colours the spectrum could display.
I say nearly because bright black is still black.
So what do you have to do in MPAGD:
1) Create a file called BLINK.ASM and save it in the UserRoutines\Spectrum directory:
ld c,a ; Set BC=blockcolour pointer
ld b,0
ld hl,bcol ; Set HL=blockcolour table address
add hl,bc ; Point to blockcolour
ld a,(23693) ; Get COLOUR
ld (hl),a ; Store COLOUR as blockcolour
ret
2) Select BLINK.ASM as User routine in WinAGD
3) Now you can overwrite the colour (and setting the flash bit) of a block by doing this once in eg EVENT INTROMENU (before a screen is drawn):
COLOUR $87 ; Flashing black/white
USER 1 ; Set colour block 1
The COLOUR command is also used by text routines so set PAPER or COLOUR after calling USER otherwise the text is also flashing.
Repeat setting colour and calling USER <blocknummer> for every blocknumber you want to set.
You only have to do this once ..... or more if you want to change the colour of a block during gameplay.