
But what is the real palette?
Modes 32 and 33 use 5 and 6 bit colors, but how to correctly convert these colors to RGB888?
The confusing part is that the x/y resolution is given as mode 4 pixels (e.g. 512x256).Dec wrote: Sat Apr 08, 2023 12:29 am Lets compare internal file header structure of astronaut.pic4 and astronaut.pic8.
Here is one way to convert Aurora mode 16 colours to 24 bit RGB, using a table:Dec wrote: Sat Apr 08, 2023 2:27 am BTW. I can't find information on how the palette used is converted to RGB888. <>
Code: Select all
* Native colour conversion
*
* V0.01, ©pjwitte 2oi8+
*
* Compatible with all GD2 modes
*
section code
xdef ut_cv16to24
xdef cv_16to24
*
ut_cv16to24
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* entry:
* d3.b = grbgrbgx - Aur (mode 16) colour code
*
* exit:
* d3.l = 0 R G B - 24 bit colour code <> mode 64!
* a3 smashed
*
* no errors; always "suceeds"
lea.l tab_aur8rgb,a3
andi.w #$00ff,d3 byte -> word
*
cv_16to24
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This routine employs a table of all 256 possible Aurora RGB values groups
* of 3 bytes per value, one each for R, G & B.
*
* entry:
* d3.w = 00000000 grbgrbgx - Aur (mode 16) byte in a word
* a3 -> tab_aur8rgb - RGB conversion table
*
* exit:
* d3.l = 0 R G B - 24 bit colour code <> mode 64!
*
* No other registers affected
*
* No errors; always "suceeds"
adda.w d3,a3
adda.w d3,a3
adda.w d3,a3
moveq #0,d3
move.b (a3)+,d3
lsl.w #8,d3
move.b (a3)+,d3
lsl.l #8,d3
move.b (a3)+,d3
rts
*
tab_aur8rgb
dc.b $00,$00,$00,$20,$00,$00,$00,$20,$00,$20,$20,$00,$00,$00,$40,$00,$00,$60,$00,$20,$40,$00,$20,$60
dc.b $40,$00,$00,$60,$00,$00,$40,$20,$00,$60,$20,$00,$40,$00,$40,$60,$00,$60,$40,$20,$40,$60,$20,$60
dc.b $00,$40,$00,$20,$40,$00,$00,$60,$00,$20,$60,$00,$00,$40,$40,$00,$40,$60,$00,$60,$40,$00,$60,$60
dc.b $40,$40,$00,$60,$40,$00,$40,$60,$00,$60,$60,$00,$40,$40,$40,$60,$40,$60,$40,$60,$40,$60,$60,$60
dc.b $00,$00,$80,$00,$00,$A0,$00,$20,$80,$00,$20,$A0,$00,$00,$C0,$00,$00,$E0,$00,$20,$C0,$00,$20,$E0
dc.b $40,$00,$80,$60,$00,$A0,$40,$20,$80,$60,$20,$A0,$40,$00,$C0,$60,$00,$E0,$40,$20,$C0,$60,$20,$E0
dc.b $00,$40,$80,$00,$40,$A0,$00,$60,$80,$00,$60,$A0,$00,$40,$C0,$00,$40,$E0,$00,$60,$C0,$00,$60,$E0
dc.b $40,$40,$80,$60,$40,$A0,$40,$60,$80,$60,$60,$A0,$40,$40,$C0,$60,$40,$E0,$40,$60,$C0,$60,$60,$E0
dc.b $80,$00,$00,$A0,$00,$00,$80,$20,$00,$A0,$20,$00,$80,$00,$40,$A0,$00,$60,$80,$20,$40,$A0,$20,$60
dc.b $C0,$00,$00,$E0,$00,$00,$C0,$20,$00,$E0,$20,$00,$C0,$00,$40,$E0,$00,$60,$C0,$20,$40,$E0,$20,$60
dc.b $80,$40,$00,$A0,$40,$00,$80,$60,$00,$A0,$60,$00,$80,$40,$40,$A0,$40,$60,$80,$60,$40,$A0,$60,$60
dc.b $C0,$40,$00,$E0,$40,$00,$C0,$60,$00,$E0,$60,$00,$C0,$40,$40,$E0,$40,$60,$C0,$60,$40,$E0,$60,$60
dc.b $80,$00,$80,$A0,$00,$A0,$80,$20,$80,$A0,$20,$A0,$80,$00,$C0,$A0,$00,$E0,$80,$20,$C0,$A0,$20,$E0
dc.b $C0,$00,$80,$E0,$00,$A0,$C0,$20,$80,$E0,$20,$A0,$C0,$00,$C0,$E0,$00,$E0,$C0,$20,$C0,$E0,$20,$E0
dc.b $80,$40,$80,$A0,$40,$A0,$80,$60,$80,$A0,$60,$A0,$80,$40,$C0,$A0,$40,$E0,$80,$60,$C0,$A0,$60,$E0
dc.b $C0,$40,$80,$E0,$40,$A0,$C0,$60,$80,$E0,$60,$A0,$C0,$40,$C0,$E0,$40,$E0,$C0,$60,$C0,$E0,$60,$E0
dc.b $00,$80,$00,$20,$80,$00,$00,$A0,$00,$20,$A0,$00,$00,$80,$40,$00,$80,$60,$00,$A0,$40,$00,$A0,$60
dc.b $40,$80,$00,$60,$80,$00,$40,$A0,$00,$60,$A0,$00,$40,$80,$40,$60,$80,$60,$40,$A0,$40,$60,$A0,$60
dc.b $00,$C0,$00,$20,$C0,$00,$00,$E0,$00,$20,$E0,$00,$00,$C0,$40,$00,$C0,$60,$00,$E0,$40,$00,$E0,$60
dc.b $40,$C0,$00,$60,$C0,$00,$40,$E0,$00,$60,$E0,$00,$40,$C0,$40,$60,$C0,$60,$40,$E0,$40,$60,$E0,$60
dc.b $00,$80,$80,$00,$80,$A0,$00,$A0,$80,$00,$A0,$A0,$00,$80,$C0,$00,$80,$E0,$00,$A0,$C0,$00,$A0,$E0
dc.b $40,$80,$80,$60,$80,$A0,$40,$A0,$80,$60,$A0,$A0,$40,$80,$C0,$60,$80,$E0,$40,$A0,$C0,$60,$A0,$E0
dc.b $00,$C0,$80,$00,$C0,$A0,$00,$E0,$80,$00,$E0,$A0,$00,$C0,$C0,$00,$C0,$E0,$00,$E0,$C0,$00,$E0,$E0
dc.b $40,$C0,$80,$60,$C0,$A0,$40,$E0,$80,$60,$E0,$A0,$40,$C0,$C0,$60,$C0,$E0,$40,$E0,$C0,$60,$E0,$E0
dc.b $80,$80,$00,$A0,$80,$00,$80,$A0,$00,$A0,$A0,$00,$80,$80,$40,$A0,$80,$60,$80,$A0,$40,$A0,$A0,$60
dc.b $C0,$80,$00,$E0,$80,$00,$C0,$A0,$00,$E0,$A0,$00,$C0,$80,$40,$E0,$80,$60,$C0,$A0,$40,$E0,$A0,$60
dc.b $80,$C0,$00,$A0,$C0,$00,$80,$E0,$00,$A0,$E0,$00,$80,$C0,$40,$A0,$C0,$60,$80,$E0,$40,$A0,$E0,$60
dc.b $C0,$C0,$00,$E0,$C0,$00,$C0,$E0,$00,$E0,$E0,$00,$C0,$C0,$40,$E0,$C0,$60,$C0,$E0,$40,$E0,$E0,$60
dc.b $80,$80,$80,$A0,$80,$A0,$80,$A0,$80,$A0,$A0,$A0,$80,$80,$C0,$A0,$80,$E0,$80,$A0,$C0,$A0,$A0,$E0
dc.b $C0,$80,$80,$E0,$80,$A0,$C0,$A0,$80,$E0,$A0,$A0,$C0,$80,$C0,$E0,$80,$E0,$C0,$A0,$C0,$E0,$A0,$E0
dc.b $80,$C0,$80,$A0,$C0,$A0,$80,$E0,$80,$A0,$E0,$A0,$80,$C0,$C0,$A0,$C0,$E0,$80,$E0,$C0,$A0,$E0,$E0
dc.b $C0,$C0,$80,$E0,$C0,$A0,$C0,$E0,$80,$E0,$E0,$A0,$C0,$C0,$C0,$E0,$C0,$E0,$C0,$E0,$C0,$E0,$E0,$E0
*
end
Code: Select all
* Native colour conversion
*
* V0.01, ©pjwitte 2oi8+
* V0.02, pjw, Nov 21 2018, Nybble-based Aurora RGB table
*
* Compatible with all GD2 modes
*
section code
xdef ut_cv16to24
xdef cv_16to24
*
ut_cv16to24
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* entry:
* d3.b = grbgrbgx - Aur (mode 16) colour code
*
* exit:
* d3.l = 0 R G B - 24 bit colour <> mode 64!
*
* d0/d5/d6/a1/a3 smashed
*
* no errors; always "suceeds"
lea.l tab_aur8rgbn,a3
*
cv_16to24
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This version uses a smaller RGB table, taking advantage of the fact that
* only the MS nybble of each colour element is significant. Thus the table
* consists of the Aurora RGB palette in 3 x 3 nybble format - a 50% space
* saving, although computationally more demanding.
*
* entry:
* d3.b = grbgrbgx - Aur (mode 16) colour code
*
* exit:
* d3.l = 0 R G B - 24 bit colour <> mode 64!
*
* d0/d5/d6/a1 smashed
*
* No errors; always "suceeds"
move.l #$ff,d6 clear out (most of) d6
and.w d6,d3 byte -> word
move.w d3,d5 00 CC
add.w d3,d5 cc cc
add.w d3,d5 CC CC
lsr.w #1,d5 0C CC
lea.l (a3,d5.w),a1 od ev
move.b (a1)+,d6 xR / RG
move.b (a1),d0 GB / Bx
btst #0,d3
beq.s even
odd
lsl.b #4,d6 R0
move.b d0,d3 GB
andi.b #$f0,d3 G0
andi.b #$0f,d0 0B
lsl.b #4,d0 B0
bra.s finalise
even
move.b d6,d3 rG
lsl.b #4,d3 G0
andi.b #$f0,d6 R0
andi.b #$f0,d0 B0
finalise
swap d6 00R0 | xxxx
move.b d3,d6
lsl.w #8,d6 00R0 | G0xx
move.b d0,d6 00R0 | G0B0
done
move.l d6,d3 fudge
rts
*
* Aurora RGB palette in a 3 x 3 nybble format
*
tab_aur8rgbn
dc.b $00,$02,$00,$02,$02,$20,$00,$40,$06,$02,$40,$26
dc.b $40,$06,$00,$42,$06,$20,$40,$46,$06,$42,$46,$26
dc.b $04,$02,$40,$06,$02,$60,$04,$40,$46,$06,$40,$66
dc.b $44,$06,$40,$46,$06,$60,$44,$46,$46,$46,$46,$66
dc.b $00,$80,$0A,$02,$80,$2A,$00,$C0,$0E,$02,$C0,$2E
dc.b $40,$86,$0A,$42,$86,$2A,$40,$C6,$0E,$42,$C6,$2E
dc.b $04,$80,$4A,$06,$80,$6A,$04,$C0,$4E,$06,$C0,$6E
dc.b $44,$86,$4A,$46,$86,$6A,$44,$C6,$4E,$46,$C6,$6E
dc.b $80,$0A,$00,$82,$0A,$20,$80,$4A,$06,$82,$4A,$26
dc.b $C0,$0E,$00,$C2,$0E,$20,$C0,$4E,$06,$C2,$4E,$26
dc.b $84,$0A,$40,$86,$0A,$60,$84,$4A,$46,$86,$4A,$66
dc.b $C4,$0E,$40,$C6,$0E,$60,$C4,$4E,$46,$C6,$4E,$66
dc.b $80,$8A,$0A,$82,$8A,$2A,$80,$CA,$0E,$82,$CA,$2E
dc.b $C0,$8E,$0A,$C2,$8E,$2A,$C0,$CE,$0E,$C2,$CE,$2E
dc.b $84,$8A,$4A,$86,$8A,$6A,$84,$CA,$4E,$86,$CA,$6E
dc.b $C4,$8E,$4A,$C6,$8E,$6A,$C4,$CE,$4E,$C6,$CE,$6E
dc.b $08,$02,$80,$0A,$02,$A0,$08,$40,$86,$0A,$40,$A6
dc.b $48,$06,$80,$4A,$06,$A0,$48,$46,$86,$4A,$46,$A6
dc.b $0C,$02,$C0,$0E,$02,$E0,$0C,$40,$C6,$0E,$40,$E6
dc.b $4C,$06,$C0,$4E,$06,$E0,$4C,$46,$C6,$4E,$46,$E6
dc.b $08,$80,$8A,$0A,$80,$AA,$08,$C0,$8E,$0A,$C0,$AE
dc.b $48,$86,$8A,$4A,$86,$AA,$48,$C6,$8E,$4A,$C6,$AE
dc.b $0C,$80,$CA,$0E,$80,$EA,$0C,$C0,$CE,$0E,$C0,$EE
dc.b $4C,$86,$CA,$4E,$86,$EA,$4C,$C6,$CE,$4E,$C6,$EE
dc.b $88,$0A,$80,$8A,$0A,$A0,$88,$4A,$86,$8A,$4A,$A6
dc.b $C8,$0E,$80,$CA,$0E,$A0,$C8,$4E,$86,$CA,$4E,$A6
dc.b $8C,$0A,$C0,$8E,$0A,$E0,$8C,$4A,$C6,$8E,$4A,$E6
dc.b $CC,$0E,$C0,$CE,$0E,$E0,$CC,$4E,$C6,$CE,$4E,$E6
dc.b $88,$8A,$8A,$8A,$8A,$AA,$88,$CA,$8E,$8A,$CA,$AE
dc.b $C8,$8E,$8A,$CA,$8E,$AA,$C8,$CE,$8E,$CA,$CE,$AE
dc.b $8C,$8A,$CA,$8E,$8A,$EA,$8C,$CA,$CE,$8E,$CA,$EE
dc.b $CC,$8E,$CA,$CE,$8E,$EA,$CC,$CE,$CE,$CE,$CE,$EE
*
end
There is some (old) documentation by Tony Tebby here: https://www.dilwyn.theqlforum.com/docs/s ... index.htmlDec wrote: Sat Apr 08, 2023 2:27 am BTW. I can't find information on how the palette used is converted to RGB888. For example, for mode 16, I use this palette:
But what is the real palette?
Modes 32 and 33 use 5 and 6 bit colors, but how to correctly convert these colors to RGB888?
2 PNG renders of the tiger_pic4 and tiger_pic8 renders.Dec wrote: Sat Apr 08, 2023 1:23 amCould you provide renders in PNG or BMP format. Jpeg images have compression artifacts and I can't see all the pixels. I don't need all the images. I will be satisfied with one render of the mode 4, and one render of the mode 8.dilwyn wrote: Fri Apr 07, 2023 6:58 pmI rendered them on a QL-compatible display in QPC2 (mode 4 and mode 8)
I'm not familiar with assembler and I can't understand this code. Is it possible to translate this into pseudo-code?pjw wrote: Sat Apr 08, 2023 12:07 pmHere is one way to convert Aurora mode 16 colours to 24 bit RGB, using a table
Code: Select all
---------- ------------------ -----------
| | | | | |
| Memory | --> | GPU | --> | Monitor |
| | | (6bit VGA DAC) | | |
---------- ------------------ -----------
The main question is - are you sure that the tables contain the correct values? How were these values obtained?