mirror of
https://frontier.innolan.net/github/AmigaExamples.git
synced 2026-01-11 23:17:50 +00:00
setup board
This commit is contained in:
@ -57,9 +57,12 @@ palette_output(imagecon_image_t* ic, char* outFilename)
|
||||
FILE* paletteFP = 0;
|
||||
FILE* paletteAsmFP = 0;
|
||||
FILE* paletteGreyFP = 0;
|
||||
FILE* paletteTableFP = 0;
|
||||
FILE* paletteGreyTableFP = 0;
|
||||
|
||||
if (config.outputCopperList) {
|
||||
fp = file_openWrite("%s-copper-list.s", outFilename);
|
||||
paletteTableFP = file_openWrite("%s-palette-table.s", outFilename);
|
||||
}
|
||||
|
||||
if (config.outputPalette) {
|
||||
@ -68,6 +71,7 @@ palette_output(imagecon_image_t* ic, char* outFilename)
|
||||
|
||||
if (config.outputPaletteGrey) {
|
||||
paletteGreyFP = file_openWrite("%s-grey.s", outFilename);
|
||||
paletteGreyTableFP = file_openWrite("%s-grey-table.s", outFilename);
|
||||
fprintf(paletteGreyFP, "\tmovem.l d0-a6,-(sp)\n\tlea CUSTOM,a6\n");
|
||||
}
|
||||
|
||||
@ -101,11 +105,29 @@ palette_output(imagecon_image_t* ic, char* outFilename)
|
||||
fprintf(paletteGreyFP, "\tlea COLOR%02d(a6),a0\n\tmove.w #$%03x,(a0)\n", i, grey << 8 | grey << 4 | grey);
|
||||
}
|
||||
|
||||
if (paletteGreyTableFP) {
|
||||
// TODO: this is for compat, can be better
|
||||
unsigned grey = ((RGB24TORGB12(ic->palette[i].r) + RGB24TORGB12(ic->palette[i].g) + RGB24TORGB12(ic->palette[i].b))/3);
|
||||
fprintf(paletteGreyTableFP, "\tdc.w\t$%03x\n", grey << 8 | grey << 4 | grey);
|
||||
}
|
||||
|
||||
if (paletteTableFP) {
|
||||
fprintf(paletteTableFP, "\tdc.w\t$%03x\n", RGB24TORGB12(ic->palette[i].r) << 8 | RGB24TORGB12(ic->palette[i].g) << 4 | RGB24TORGB12(ic->palette[i].b));
|
||||
}
|
||||
|
||||
if (fp) {
|
||||
fprintf(fp, "\tdc.w $%x,$%x\n", 0x180+(i*2), RGB24TORGB12(ic->palette[i].r) << 8 | RGB24TORGB12(ic->palette[i].g) << 4 | RGB24TORGB12(ic->palette[i].b));
|
||||
}
|
||||
}
|
||||
|
||||
if (paletteGreyTableFP) {
|
||||
fclose(paletteGreyTableFP);
|
||||
}
|
||||
|
||||
if (paletteTableFP) {
|
||||
fclose(paletteTableFP);
|
||||
}
|
||||
|
||||
if (paletteFP) {
|
||||
fclose(paletteFP);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user