kopia lustrzana https://github.com/hoglet67/RGBtoHDMI
Add 12BPP capture & 16BPP frame buffer support
rodzic
de2e4e7b92
commit
15b43eecaf
|
@ -64,18 +64,18 @@ file( GLOB core_files
|
|||
rgb_to_fb.S
|
||||
capture_line_mode7_4bpp.S
|
||||
capture_line_default_4bpp_8bpp.S
|
||||
capture_line_default_sixbits_4bpp_8bpp.S
|
||||
capture_line_default_eightbits_8bpp.S
|
||||
capture_line_default_double_4bpp_8bpp.S
|
||||
capture_line_default_sixbits_double_4bpp_8bpp.S
|
||||
capture_line_default_eightbits_double_8bpp.S
|
||||
capture_line_fast_4bpp_8bpp.S
|
||||
capture_line_fast_sixbits_4bpp_8bpp.S
|
||||
capture_line_fast_eightbits_8bpp.S
|
||||
capture_line_ntsc_sixbits_8bpp.S
|
||||
capture_line_inband_4bpp_8bpp.S
|
||||
capture_line_fast_4bpp_8bpp.S
|
||||
capture_line_oddeven_4bpp_8bpp.S
|
||||
capture_line_half_4bpp_8bpp.S
|
||||
capture_line_default_sixbits_4bpp_8bpp.S
|
||||
capture_line_default_sixbits_double_4bpp_8bpp.S
|
||||
capture_line_ntsc_sixbits_4bpp_8bpp.S
|
||||
capture_line_fast_sixbits_4bpp_8bpp.S
|
||||
capture_line_default_eightbits_8bpp_16bpp.S
|
||||
capture_line_default_eightbits_double_8bpp_16bpp.S
|
||||
capture_line_fast_eightbits_8bpp_16bpp.S
|
||||
defs.h
|
||||
arm-exception.c
|
||||
cache.c
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
.text
|
||||
|
||||
.global capture_line_default_eightbits_8bpp
|
||||
.global capture_line_default_twelvebits_16bpp
|
||||
|
||||
// The capture line function is provided the following:
|
||||
// r0 = pointer to current line in frame buffer
|
||||
|
@ -83,3 +84,45 @@ loop_8bpp:
|
|||
preload_capture_line_default_eightbits_8bpp:
|
||||
SETUP_DUMMY_PARAMETERS
|
||||
b capture_line_default_eightbits_8bpp
|
||||
|
||||
|
||||
.ltorg
|
||||
|
||||
// *** 16 bit ***
|
||||
b preload_capture_line_default_twelvebits_16bpp
|
||||
capture_line_default_twelvebits_16bpp:
|
||||
push {lr}
|
||||
SETUP_VSYNC_DEBUG_R11_R12_DOUBLE
|
||||
SKIP_PSYNC_NO_OLD_CPLD
|
||||
push {r14}
|
||||
SETUP_MASK_R14
|
||||
loop_16bpp:
|
||||
WAIT_FOR_PSYNC_EDGE_FAST // expects GPLEV0 in r4, result in r8
|
||||
CAPTURE_TWELVE_BITS_16BPP_LO r11 // input in r8
|
||||
WAIT_FOR_PSYNC_EDGE_FAST // expects GPLEV0 in r4, result in r8
|
||||
CAPTURE_TWELVE_BITS_16BPP_HI r5 // input in r8
|
||||
WAIT_FOR_PSYNC_EDGE_FAST // expects GPLEV0 in r4, result in r8
|
||||
CAPTURE_TWELVE_BITS_16BPP_LO r12 // input in r8
|
||||
WAIT_FOR_PSYNC_EDGE_FAST // expects GPLEV0 in r4, result in r8
|
||||
CAPTURE_TWELVE_BITS_16BPP_HI r6 // input in r8
|
||||
|
||||
WAIT_FOR_PSYNC_EDGE_FAST // expects GPLEV0 in r4, result in r8
|
||||
CAPTURE_TWELVE_BITS_16BPP_LO r11 // input in r8
|
||||
WAIT_FOR_PSYNC_EDGE_FAST // expects GPLEV0 in r4, result in r8
|
||||
CAPTURE_TWELVE_BITS_16BPP_HI r7 // input in r8
|
||||
WAIT_FOR_PSYNC_EDGE_FAST // expects GPLEV0 in r4, result in r8
|
||||
CAPTURE_TWELVE_BITS_16BPP_LO r12 // input in r8
|
||||
WAIT_FOR_PSYNC_EDGE_FAST // expects GPLEV0 in r4, result in r8
|
||||
CAPTURE_TWELVE_BITS_16BPP_HI r10 // input in r8
|
||||
|
||||
WRITE_R5_R6_R7_R10
|
||||
|
||||
subs r1, r1, #1
|
||||
bne loop_16bpp
|
||||
|
||||
pop {r0, pc}
|
||||
|
||||
|
||||
preload_capture_line_default_twelvebits_16bpp:
|
||||
SETUP_DUMMY_PARAMETERS
|
||||
b capture_line_default_twelvebits_16bpp
|
|
@ -53,6 +53,11 @@ static const char *deint_names[] = {
|
|||
"Interlaced Teletext"
|
||||
};
|
||||
|
||||
static const char *bpp_names[] = {
|
||||
"4",
|
||||
"8",
|
||||
"16"
|
||||
};
|
||||
|
||||
static param_t params[] = {
|
||||
{ SETUP_MODE, "Setup Mode", "setup_mode", 0,NUM_SETUP-1, 1 },
|
||||
|
@ -65,11 +70,11 @@ static param_t params[] = {
|
|||
{ H_ASPECT, "H Pixel Aspect", "h_aspect", 0, 8, 1 },
|
||||
{ V_ASPECT, "V Pixel Aspect", "v_aspect", 0, 8, 1 },
|
||||
{ FB_SIZEX2, "FB Size", "fb_size", 0, 3, 1 },
|
||||
{ FB_BPP, "FB Bits/Pixel", "fb_bits_pixel", 4, 8, 4 },
|
||||
{ CLOCK, "Clock Frequency", "clock_frequency", 1000000, 40000000, 1000 },
|
||||
{ LINE_LEN, "Line Length", "line_length", 100, 5000, 1 },
|
||||
{ CLOCK_PPM, "Clock Tolerance", "clock_tolerance", 0, 100000, 100 },
|
||||
{ LINES_FRAME, "Lines per Frame", "lines_per_frame", 250, 1200, 1 },
|
||||
{ FB_BPP, "FB Bits/Pixel", "fb_bits_pixel", 0, NUM_BPP-1, 1 },
|
||||
{ CLOCK, "Clock Frequency", "clock_frequency", 1000000,40000000, 1000 },
|
||||
{ LINE_LEN, "Line Length", "line_length", 100, 5000, 1 },
|
||||
{ CLOCK_PPM, "Clock Tolerance", "clock_tolerance", 0, 100000, 100 },
|
||||
{ LINES_FRAME, "Lines per Frame", "lines_per_frame", 250, 1200, 1 },
|
||||
{ SYNC_TYPE, "Sync Type", "sync_type", 0, NUM_SYNC-1, 1 },
|
||||
{ VSYNC_TYPE, "V Sync Type", "vsync_type", 0,NUM_VSYNC-1, 1 },
|
||||
{ VIDEO_TYPE, "Video Type", "video_type", 0,NUM_VIDEO-1, 1 },
|
||||
|
@ -125,7 +130,7 @@ void geometry_init(int version) {
|
|||
mode7_geometry.h_aspect = 3;
|
||||
mode7_geometry.v_aspect = 4;
|
||||
mode7_geometry.fb_sizex2 = 1;
|
||||
mode7_geometry.fb_bpp = 4;
|
||||
mode7_geometry.fb_bpp = 0;
|
||||
mode7_geometry.clock = 12000000;
|
||||
mode7_geometry.line_len = 12 * 64;
|
||||
mode7_geometry.clock_ppm = 5000;
|
||||
|
@ -144,7 +149,7 @@ void geometry_init(int version) {
|
|||
default_geometry.h_aspect = 1;
|
||||
default_geometry.v_aspect = 2;
|
||||
default_geometry.fb_sizex2 = 1;
|
||||
default_geometry.fb_bpp = 8;
|
||||
default_geometry.fb_bpp = 1;
|
||||
default_geometry.clock = 16000000;
|
||||
default_geometry.line_len = 16 * 64;
|
||||
default_geometry.clock_ppm = 5000;
|
||||
|
@ -245,6 +250,9 @@ const char *geometry_get_value_string(int num) {
|
|||
if (num == VIDEO_TYPE) {
|
||||
return deint_names[geometry_get_value(num)];
|
||||
}
|
||||
if (num == FB_BPP) {
|
||||
return bpp_names[geometry_get_value(num)];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -377,13 +385,24 @@ void geometry_get_fb_params(capture_info_t *capinfo) {
|
|||
capinfo->vsync_type = geometry->vsync_type;
|
||||
capinfo->video_type = geometry->video_type;
|
||||
capinfo->sizex2 = geometry->fb_sizex2;
|
||||
capinfo->bpp = geometry->fb_bpp;
|
||||
switch(geometry->fb_bpp) {
|
||||
case BPP_4:
|
||||
capinfo->bpp = 4;
|
||||
break;
|
||||
default:
|
||||
case BPP_8:
|
||||
capinfo->bpp = 8;
|
||||
break;
|
||||
case BPP_16:
|
||||
capinfo->bpp = 16;
|
||||
break;
|
||||
}
|
||||
if (capinfo->video_type == VIDEO_TELETEXT) {
|
||||
capinfo->bpp = 4; //force 4bpp for teletext
|
||||
} else {
|
||||
if (capinfo->sample_width >= WIDTH_8) {
|
||||
capinfo->bpp = 8; //force 8bpp in 8 bit modes
|
||||
}
|
||||
} else if (capinfo->sample_width >= WIDTH_8 && capinfo->bpp == 4) {
|
||||
capinfo->bpp = 8; //force at least 8bpp in 8 bit modes
|
||||
} else if (capinfo->bpp == 16 && capinfo->sample_width < WIDTH_8) {
|
||||
capinfo->bpp = 8; //force 8bpp in 3 and 6 bit modes if 16 bpp set
|
||||
}
|
||||
|
||||
#ifdef INHIBIT_DOUBLE_HEIGHT
|
||||
|
|
|
@ -76,6 +76,13 @@ enum {
|
|||
NUM_SETUP
|
||||
};
|
||||
|
||||
enum {
|
||||
BPP_4,
|
||||
BPP_8,
|
||||
BPP_16,
|
||||
NUM_BPP
|
||||
};
|
||||
|
||||
void geometry_init(int version);
|
||||
void geometry_set_mode(int mode);
|
||||
int geometry_get_mode();
|
||||
|
|
21
src/macros.S
21
src/macros.S
|
@ -529,13 +529,32 @@ wait_wr\@:
|
|||
|
||||
.macro CAPTURE_EIGHT_BITS_DOUBLE_8BPP_HI reg
|
||||
// Pixel 0 in GPIO 9.. 2 -> 7.. 0
|
||||
|
||||
and r9, r8, r14
|
||||
eor r10, r10, r9, lsl #(16 - PIXEL_BASE)
|
||||
// Pixel double
|
||||
orr \reg, r10, r10, lsl #8
|
||||
.endm
|
||||
|
||||
.macro CAPTURE_TWELVE_BITS_16BPP_LO reg
|
||||
// Pixel 0 in GPIO 9.. 2 -> 7.. 0
|
||||
and r9, r8, #0x0f << PIXEL_BASE
|
||||
eor r10, \reg, r9, lsr #(PIXEL_BASE - 1)
|
||||
and r14, r8, #0x0f << (PIXEL_BASE + 4)
|
||||
eor r10, r10, r14, lsl #(PIXEL_BASE + 1)
|
||||
and r9, r8, #0x0f << (PIXEL_BASE + 8)
|
||||
eor r10, r10, r9, lsl #(PIXEL_BASE + 2)
|
||||
.endm
|
||||
|
||||
.macro CAPTURE_TWELVE_BITS_16BPP_HI reg
|
||||
// Pixel 0 in GPIO 9.. 2 -> 7.. 0
|
||||
and r9, r8, #0x0f << PIXEL_BASE
|
||||
eor r10, r10, r9, lsl #(16 - PIXEL_BASE + 1)
|
||||
and r14, r8, #0x0f << (PIXEL_BASE + 4)
|
||||
eor r10, r10, r14, lsl #(16 + PIXEL_BASE + 1)
|
||||
and r9, r8, #0x0f << (PIXEL_BASE + 8)
|
||||
eor \reg, r10, r9, lsl #(16 + PIXEL_BASE + 2)
|
||||
.endm
|
||||
|
||||
.macro CAPTURE_LOW_BITS_8BPP_WIDE reg
|
||||
// Pixel 0 in GPIO 7.. 2 -> 7.. 0
|
||||
// Pixel 1 in GPIO 13.. 8 -> 15.. 8
|
||||
|
|
842
src/osd.c
842
src/osd.c
|
@ -725,6 +725,14 @@ static uint32_t double_size_map_8bpp[0x1000 * 6];
|
|||
// Mapping table for expanding 12-bit row to 12 bit pixel (3 words) with 8 bits/pixel
|
||||
static uint32_t normal_size_map_8bpp[0x1000 * 3];
|
||||
|
||||
// Mapping table for expanding 12-bit row to 24 bit pixel (12 words) with 16 bits/pixel
|
||||
static uint32_t double_size_map_16bpp[0x1000 * 12];
|
||||
|
||||
// Mapping table for expanding 12-bit row to 12 bit pixel (6 words) with 16 bits/pixel
|
||||
static uint32_t normal_size_map_16bpp[0x1000 * 6];
|
||||
|
||||
|
||||
|
||||
// Mapping table for expanding 8-bit row to 16 bit pixel (2 words) with 4 bits/pixel
|
||||
static uint32_t double_size_map8_4bpp[0x1000 * 2];
|
||||
|
||||
|
@ -737,6 +745,12 @@ static uint32_t double_size_map8_8bpp[0x1000 * 4];
|
|||
// Mapping table for expanding 8-bit row to 8 bit pixel (2 words) with 8 bits/pixel
|
||||
static uint32_t normal_size_map8_8bpp[0x1000 * 2];
|
||||
|
||||
// Mapping table for expanding 8-bit row to 16 bit pixel (8 words) with 16 bits/pixel
|
||||
static uint32_t double_size_map8_16bpp[0x1000 * 8];
|
||||
|
||||
// Mapping table for expanding 8-bit row to 8 bit pixel (4 words) with 16 bits/pixel
|
||||
static uint32_t normal_size_map8_16bpp[0x1000 * 4];
|
||||
|
||||
// Temporary buffer for assembling OSD lines
|
||||
static char message[80];
|
||||
|
||||
|
@ -2832,145 +2846,144 @@ void generate_palettes() {
|
|||
|
||||
|
||||
void osd_update_palette() {
|
||||
int r = 0;
|
||||
int g = 0;
|
||||
int b = 0;
|
||||
int m = 0;
|
||||
int num_colours = (capinfo->bpp == 8) ? 256 : 16;
|
||||
int design_type = (cpld->get_version() >> VERSION_DESIGN_BIT) & 0x0F;
|
||||
if (capinfo->bpp != 16) {
|
||||
int r = 0;
|
||||
int g = 0;
|
||||
int b = 0;
|
||||
int m = 0;
|
||||
int num_colours = (capinfo->bpp == 8) ? 256 : 16;
|
||||
int design_type = (cpld->get_version() >> VERSION_DESIGN_BIT) & 0x0F;
|
||||
|
||||
//copy selected palette to current palette, translating for Atom cpld and inverted Y setting (required for 6847 direct Y connection)
|
||||
for (int i = 0; i < num_colours; i++) {
|
||||
int i_adj = i;
|
||||
if(design_type == DESIGN_ATOM) {
|
||||
switch (i) {
|
||||
case 0x00:
|
||||
i_adj = 0x00 | (bz + rz); break; //black
|
||||
case 0x01:
|
||||
i_adj = 0x10 | (bz + rp); break; //red
|
||||
case 0x02:
|
||||
i_adj = 0x10 | (bm + rm); break; //green
|
||||
case 0x03:
|
||||
i_adj = 0x12 | (bm + rz); break; //yellow
|
||||
case 0x04:
|
||||
i_adj = 0x10 | (bp + rz); break; //blue
|
||||
case 0x05:
|
||||
i_adj = 0x10 | (bp + rp); break; //magenta
|
||||
case 0x06:
|
||||
i_adj = 0x10 | (bz + rm); break; //cyan
|
||||
case 0x07:
|
||||
i_adj = 0x12 | (bz + rz); break; //white
|
||||
case 0x0b:
|
||||
i_adj = 0x10 | (bm + rp); break; //orange
|
||||
case 0x13:
|
||||
i_adj = 0x12 | (bm + rp); break; //bright orange
|
||||
case 0x08:
|
||||
i_adj = 0x00 | (bm + rm); break; //dark green
|
||||
case 0x10:
|
||||
i_adj = 0x00 | (bm + rp); break; //dark orange
|
||||
default:
|
||||
i_adj = 0x00 | (bz + rz); break; //black
|
||||
}
|
||||
}
|
||||
|
||||
if (get_feature(F_INVERT) == INVERT_Y) {
|
||||
i_adj ^= 0x12;
|
||||
}
|
||||
|
||||
if (get_feature(F_PALETTECONTROL) < PALETTECONTROL_NTSCARTIFACT_CGA || (get_feature(F_PALETTECONTROL) == PALETTECONTROL_NTSCARTIFACT_CGA && get_feature(F_NTSCCOLOUR) == 0) || geometry_get_value(FB_BPP) != 8 || (geometry_get_value(FB_SIZEX2) & 2) != 0) {
|
||||
palette_data[i] = palette_array[palette][i_adj];
|
||||
} else {
|
||||
//if (get_paletteControl() == PALETTECONTROL_NTSCARTIFACT_CGA) {
|
||||
if ((i & 0x7f) < 0x30) {
|
||||
int filtered_bitcount = ((i % 0x30) >> 4) + 1;
|
||||
palette_data[i] = create_NTSC_artifact_colours(i & 0x7f, filtered_bitcount);
|
||||
} else if ((i & 0x7f) < 0x50) {
|
||||
palette_data[i] = create_NTSC_artifact_colours_palette_320(i & 0x7f);
|
||||
//copy selected palette to current palette, translating for Atom cpld and inverted Y setting (required for 6847 direct Y connection)
|
||||
for (int i = 0; i < num_colours; i++) {
|
||||
int i_adj = i;
|
||||
if(design_type == DESIGN_ATOM) {
|
||||
switch (i) {
|
||||
case 0x00:
|
||||
i_adj = 0x00 | (bz + rz); break; //black
|
||||
case 0x01:
|
||||
i_adj = 0x10 | (bz + rp); break; //red
|
||||
case 0x02:
|
||||
i_adj = 0x10 | (bm + rm); break; //green
|
||||
case 0x03:
|
||||
i_adj = 0x12 | (bm + rz); break; //yellow
|
||||
case 0x04:
|
||||
i_adj = 0x10 | (bp + rz); break; //blue
|
||||
case 0x05:
|
||||
i_adj = 0x10 | (bp + rp); break; //magenta
|
||||
case 0x06:
|
||||
i_adj = 0x10 | (bz + rm); break; //cyan
|
||||
case 0x07:
|
||||
i_adj = 0x12 | (bz + rz); break; //white
|
||||
case 0x0b:
|
||||
i_adj = 0x10 | (bm + rp); break; //orange
|
||||
case 0x13:
|
||||
i_adj = 0x12 | (bm + rp); break; //bright orange
|
||||
case 0x08:
|
||||
i_adj = 0x00 | (bm + rm); break; //dark green
|
||||
case 0x10:
|
||||
i_adj = 0x00 | (bm + rp); break; //dark orange
|
||||
default:
|
||||
i_adj = 0x00 | (bz + rz); break; //black
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
palette_data[i] = adjust_palette(palette_data[i]);
|
||||
}
|
||||
|
||||
//scan translated palette for equivalences
|
||||
for (int i = 0; i < num_colours; i++) {
|
||||
for(int j = i; j < num_colours; j++) {
|
||||
if (palette_data[i] == palette_data[j]) {
|
||||
equivalence[i] = (char) j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// modify translated palette for remaining settings
|
||||
for (int i = 0; i < num_colours; i++) {
|
||||
if (paletteFlags & BIT_MODE2_PALETTE) {
|
||||
r = customPalette[i & 0x7f] & 0xff;
|
||||
g = (customPalette[i & 0x7f]>>8) & 0xff;
|
||||
b = (customPalette[i & 0x7f]>>16) & 0xff;
|
||||
m = ((299 * r + 587 * g + 114 * b + 500) / 1000);
|
||||
if (m > 255) {
|
||||
m = 255;
|
||||
if (get_feature(F_INVERT) == INVERT_Y) {
|
||||
i_adj ^= 0x12;
|
||||
}
|
||||
} else {
|
||||
r = palette_data[i] & 0xff;
|
||||
g = (palette_data[i] >> 8) & 0xff;
|
||||
b = (palette_data[i] >>16) & 0xff;
|
||||
m = (palette_data[i] >>24);
|
||||
}
|
||||
if (get_feature(F_INVERT) == INVERT_RGB) {
|
||||
r = 255 - r;
|
||||
g = 255 - g;
|
||||
b = 255 - b;
|
||||
m = 255 - m;
|
||||
}
|
||||
if (get_feature(F_COLOUR) != COLOUR_NORMAL) {
|
||||
switch (get_feature(F_COLOUR)) {
|
||||
case COLOUR_MONO:
|
||||
r = m;
|
||||
g = m;
|
||||
b = m;
|
||||
break;
|
||||
case COLOUR_GREEN:
|
||||
r = 0;
|
||||
g = m;
|
||||
b = 0;
|
||||
break;
|
||||
case COLOUR_AMBER:
|
||||
r = m*0xdf/0xff;
|
||||
g = m;
|
||||
b = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (active) {
|
||||
if (i >= (num_colours >> 1)) {
|
||||
palette_data[i] = 0xFFFFFFFF;
|
||||
|
||||
if (capinfo->palette_control < PALETTECONTROL_NTSCARTIFACT_CGA || (capinfo->palette_control == PALETTECONTROL_NTSCARTIFACT_CGA && get_feature(F_NTSCCOLOUR) == 0) || capinfo->bpp != 8 || (capinfo->sizex2 & 2) != 0) {
|
||||
palette_data[i] = palette_array[palette][i_adj];
|
||||
} else {
|
||||
if (!inhibit_palette_dimming) {
|
||||
r >>= 1; g >>= 1; b >>= 1;
|
||||
//if (get_paletteControl() == PALETTECONTROL_NTSCARTIFACT_CGA) {
|
||||
if ((i & 0x7f) < 0x30) {
|
||||
int filtered_bitcount = ((i % 0x30) >> 4) + 1;
|
||||
palette_data[i] = create_NTSC_artifact_colours(i & 0x7f, filtered_bitcount);
|
||||
} else if ((i & 0x7f) < 0x50) {
|
||||
palette_data[i] = create_NTSC_artifact_colours_palette_320(i & 0x7f);
|
||||
}
|
||||
}
|
||||
palette_data[i] = 0xFF000000 | (b << 16) | (g << 8) | r;
|
||||
palette_data[i] = adjust_palette(palette_data[i]);
|
||||
}
|
||||
|
||||
//scan translated palette for equivalences
|
||||
for (int i = 0; i < num_colours; i++) {
|
||||
for(int j = i; j < num_colours; j++) {
|
||||
if (palette_data[i] == palette_data[j]) {
|
||||
equivalence[i] = (char) j;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ((i >= (num_colours >> 1)) && get_feature(F_SCANLINES)) {
|
||||
int scanline_intensity = get_feature(F_SCANLINESINT) ;
|
||||
r = (r * scanline_intensity)>>4;
|
||||
g = (g * scanline_intensity)>>4;
|
||||
b = (b * scanline_intensity)>>4;
|
||||
palette_data[i] = 0xFF000000 | (b << 16) | (g << 8) | r;
|
||||
}
|
||||
|
||||
// modify translated palette for remaining settings
|
||||
for (int i = 0; i < num_colours; i++) {
|
||||
if (paletteFlags & BIT_MODE2_PALETTE) {
|
||||
r = customPalette[i & 0x7f] & 0xff;
|
||||
g = (customPalette[i & 0x7f]>>8) & 0xff;
|
||||
b = (customPalette[i & 0x7f]>>16) & 0xff;
|
||||
m = ((299 * r + 587 * g + 114 * b + 500) / 1000);
|
||||
if (m > 255) {
|
||||
m = 255;
|
||||
}
|
||||
} else {
|
||||
palette_data[i] = 0xFF000000 | (b << 16) | (g << 8) | r;
|
||||
r = palette_data[i] & 0xff;
|
||||
g = (palette_data[i] >> 8) & 0xff;
|
||||
b = (palette_data[i] >>16) & 0xff;
|
||||
m = (palette_data[i] >>24);
|
||||
}
|
||||
}
|
||||
if (get_debug()) {
|
||||
palette_data[i] |= 0x00101010;
|
||||
}
|
||||
}
|
||||
RPI_PropertyInit();
|
||||
RPI_PropertyAddTag(TAG_SET_PALETTE, num_colours, palette_data);
|
||||
RPI_PropertyProcess();
|
||||
if (get_feature(F_INVERT) == INVERT_RGB) {
|
||||
r = 255 - r;
|
||||
g = 255 - g;
|
||||
b = 255 - b;
|
||||
m = 255 - m;
|
||||
}
|
||||
if (get_feature(F_COLOUR) != COLOUR_NORMAL) {
|
||||
switch (get_feature(F_COLOUR)) {
|
||||
case COLOUR_MONO:
|
||||
r = m;
|
||||
g = m;
|
||||
b = m;
|
||||
break;
|
||||
case COLOUR_GREEN:
|
||||
r = 0;
|
||||
g = m;
|
||||
b = 0;
|
||||
break;
|
||||
case COLOUR_AMBER:
|
||||
r = m*0xdf/0xff;
|
||||
g = m;
|
||||
b = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (active) {
|
||||
if (i >= (num_colours >> 1)) {
|
||||
palette_data[i] = 0xFFFFFFFF;
|
||||
} else {
|
||||
if (!inhibit_palette_dimming) {
|
||||
r >>= 1; g >>= 1; b >>= 1;
|
||||
}
|
||||
palette_data[i] = 0xFF000000 | (b << 16) | (g << 8) | r;
|
||||
}
|
||||
} else {
|
||||
if ((i >= (num_colours >> 1)) && get_feature(F_SCANLINES)) {
|
||||
int scanline_intensity = get_feature(F_SCANLINESINT) ;
|
||||
r = (r * scanline_intensity)>>4;
|
||||
g = (g * scanline_intensity)>>4;
|
||||
b = (b * scanline_intensity)>>4;
|
||||
palette_data[i] = 0xFF000000 | (b << 16) | (g << 8) | r;
|
||||
} else {
|
||||
palette_data[i] = 0xFF000000 | (b << 16) | (g << 8) | r;
|
||||
}
|
||||
}
|
||||
if (get_debug()) {
|
||||
palette_data[i] |= 0x00101010;
|
||||
}
|
||||
}
|
||||
RPI_PropertyInit();
|
||||
RPI_PropertyAddTag(TAG_SET_PALETTE, num_colours, palette_data);
|
||||
RPI_PropertyProcess();
|
||||
}
|
||||
}
|
||||
|
||||
void osd_clear() {
|
||||
|
@ -3972,6 +3985,16 @@ void osd_init() {
|
|||
memset(double_size_map_4bpp, 0, sizeof(double_size_map_4bpp));
|
||||
memset(normal_size_map_8bpp, 0, sizeof(normal_size_map_8bpp));
|
||||
memset(double_size_map_8bpp, 0, sizeof(double_size_map_8bpp));
|
||||
memset(normal_size_map_16bpp, 0, sizeof(normal_size_map_16bpp));
|
||||
memset(double_size_map_16bpp, 0, sizeof(double_size_map_16bpp));
|
||||
|
||||
memset(normal_size_map8_4bpp, 0, sizeof(normal_size_map8_4bpp));
|
||||
memset(double_size_map8_4bpp, 0, sizeof(double_size_map8_4bpp));
|
||||
memset(normal_size_map8_8bpp, 0, sizeof(normal_size_map8_8bpp));
|
||||
memset(double_size_map8_8bpp, 0, sizeof(double_size_map8_8bpp));
|
||||
memset(normal_size_map8_16bpp, 0, sizeof(normal_size_map8_16bpp));
|
||||
memset(double_size_map8_16bpp, 0, sizeof(double_size_map8_16bpp));
|
||||
|
||||
for (int i = 0; i < NLINES; i++) {
|
||||
attributes[i] = 0;
|
||||
}
|
||||
|
@ -4075,6 +4098,88 @@ void osd_init() {
|
|||
double_size_map8_8bpp[i * 4 ] |= 0x8080 << (16 * (7 - j)); // aaaaaaaa
|
||||
}
|
||||
|
||||
// ======= 16 bits/pixel tables ======
|
||||
|
||||
|
||||
// Normal size
|
||||
|
||||
if (j < 2) {
|
||||
double_size_map_16bpp[i * 6 + 5] |= 0xffff << (16 * (1 - j));
|
||||
} else if (j < 4) {
|
||||
double_size_map_16bpp[i * 6 + 4] |= 0xffff << (16 * (3 - j));
|
||||
} else if (j < 6) {
|
||||
double_size_map_16bpp[i * 6 + 3] |= 0xffff << (16 * (5 - j));
|
||||
} else if (j < 8) {
|
||||
double_size_map_16bpp[i * 6 + 2] |= 0xffff << (16 * (7 - j));
|
||||
} else if (j < 10) {
|
||||
double_size_map_16bpp[i * 6 + 1] |= 0xffff << (16 * (9 - j));
|
||||
} else {
|
||||
double_size_map_16bpp[i * 6 ] |= 0xffff << (16 * (11 - j));
|
||||
}
|
||||
|
||||
// Double size
|
||||
|
||||
if (j < 1) {
|
||||
double_size_map_16bpp[i * 12 + 11] |= 0xffffffff;
|
||||
} else if (j < 2) {
|
||||
double_size_map_16bpp[i * 12 + 10] |= 0xffffffff;
|
||||
} else if (j < 3) {
|
||||
double_size_map_16bpp[i * 12 + 9] |= 0xffffffff;
|
||||
} else if (j < 4) {
|
||||
double_size_map_16bpp[i * 12 + 8] |= 0xffffffff;
|
||||
} else if (j < 5) {
|
||||
double_size_map_16bpp[i * 12 + 7] |= 0xffffffff;
|
||||
} else if (j < 6) {
|
||||
double_size_map_16bpp[i * 12 + 6] |= 0xffffffff;
|
||||
} else if (j < 7) {
|
||||
double_size_map_16bpp[i * 12 + 5] |= 0xffffffff;
|
||||
} else if (j < 8) {
|
||||
double_size_map_16bpp[i * 12 + 4] |= 0xffffffff;
|
||||
} else if (j < 9) {
|
||||
double_size_map_16bpp[i * 12 + 3] |= 0xffffffff;
|
||||
} else if (j < 10) {
|
||||
double_size_map_16bpp[i * 12 + 2] |= 0xffffffff;
|
||||
} else if (j < 11) {
|
||||
double_size_map_16bpp[i * 12 + 1] |= 0xffffffff;
|
||||
} else {
|
||||
double_size_map_16bpp[i * 12 ] |= 0xffffffff;
|
||||
}
|
||||
|
||||
|
||||
// ======= 16 bits/pixel tables for 8x8 font======
|
||||
|
||||
// Normal size
|
||||
// aaaaaaaa bbbbbbbb
|
||||
if (j < 2) {
|
||||
normal_size_map8_16bpp[i * 4 + 3] |= 0xffff << (16 * (1 - j));
|
||||
} else if (j < 4) {
|
||||
normal_size_map8_16bpp[i * 4 + 2] |= 0xffff << (16 * (3 - j));
|
||||
} else if (j < 6) {
|
||||
normal_size_map8_16bpp[i * 4 + 1] |= 0xffff << (16 * (5 - j));
|
||||
} else {
|
||||
normal_size_map8_16bpp[i * 4 ] |= 0xffff << (16 * (7 - j));
|
||||
}
|
||||
|
||||
|
||||
// Double size
|
||||
// aaaaaaaa bbbbbbbb cccccccc dddddddd
|
||||
if (j < 1) {
|
||||
double_size_map8_16bpp[i * 8 + 7] |= 0xffffffff;
|
||||
} else if (j < 2) {
|
||||
double_size_map8_16bpp[i * 8 + 6] |= 0xffffffff;
|
||||
} else if (j < 3) {
|
||||
double_size_map8_16bpp[i * 8 + 5] |= 0xffffffff;
|
||||
} else if (j < 4) {
|
||||
double_size_map8_16bpp[i * 8 + 4] |= 0xffffffff;
|
||||
} else if (j < 5) {
|
||||
double_size_map8_16bpp[i * 8 + 3] |= 0xffffffff;
|
||||
} else if (j < 6) {
|
||||
double_size_map8_16bpp[i * 8 + 2] |= 0xffffffff;
|
||||
} else if (j < 7) {
|
||||
double_size_map8_16bpp[i * 8 + 1] |= 0xffffffff;
|
||||
} else {
|
||||
double_size_map8_16bpp[i * 8 ] |= 0xffffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4239,70 +4344,92 @@ void osd_update(uint32_t *osd_base, int bytes_per_line) {
|
|||
// Character row is 12 pixels
|
||||
int data = fontdata[32 * c + y] & 0x3ff;
|
||||
// Map to the screen pixel format
|
||||
if (capinfo->bpp == 8) {
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map_8bpp + data * 6;
|
||||
for (int k = 0; k < 6; k++) {
|
||||
*word_ptr &= 0x7f7f7f7f;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x7f7f7f7f;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map_8bpp + data * 3;
|
||||
for (int k = 0; k < 3; k++) {
|
||||
*word_ptr &= 0x7f7f7f7f;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
// Map to three 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = double_size_map_4bpp + data * 3;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x77777777;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x77777777;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x77777777;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
} else {
|
||||
// Map to two 32-bit words in frame buffer format
|
||||
if (i & 1) {
|
||||
// odd character
|
||||
uint32_t *map_ptr = normal_size_map_4bpp + (data << 2) + 2;
|
||||
*word_ptr &= 0x7777FFFF;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
} else {
|
||||
// even character
|
||||
uint32_t *map_ptr = normal_size_map_4bpp + (data << 2);
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr &= 0xFFFF7777;
|
||||
*word_ptr |= *map_ptr;
|
||||
}
|
||||
}
|
||||
switch (capinfo->bpp) {
|
||||
case 4:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
// Map to three 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = double_size_map_4bpp + data * 3;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x77777777;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x77777777;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x77777777;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
} else {
|
||||
// Map to two 32-bit words in frame buffer format
|
||||
if (i & 1) {
|
||||
// odd character
|
||||
uint32_t *map_ptr = normal_size_map_4bpp + (data << 2) + 2;
|
||||
*word_ptr &= 0x7777FFFF;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
} else {
|
||||
// even character
|
||||
uint32_t *map_ptr = normal_size_map_4bpp + (data << 2);
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr &= 0xFFFF7777;
|
||||
*word_ptr |= *map_ptr;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case 8:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map_8bpp + data * 6;
|
||||
for (int k = 0; k < 6; k++) {
|
||||
*word_ptr &= 0x7f7f7f7f;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x7f7f7f7f;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map_8bpp + data * 3;
|
||||
for (int k = 0; k < 3; k++) {
|
||||
*word_ptr &= 0x7f7f7f7f;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map_16bpp + data * 12;
|
||||
for (int k = 0; k < 12; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map_16bpp + data * 6;
|
||||
for (int k = 0; k < 6; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
|
@ -4329,50 +4456,73 @@ void osd_update(uint32_t *osd_base, int bytes_per_line) {
|
|||
// Character row is 12 pixels
|
||||
int data = (int) fontdata8[8 * c + y];
|
||||
// Map to the screen pixel format
|
||||
if (capinfo->bpp == 8) {
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map8_8bpp + data * 4;
|
||||
for (int k = 0; k < 4; k++) {
|
||||
*word_ptr &= 0x7f7f7f7f;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x7f7f7f7f;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map8_8bpp + data * 2;
|
||||
for (int k = 0; k < 2; k++) {
|
||||
*word_ptr &= 0x7f7f7f7f;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
// Map to three 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = double_size_map8_4bpp + data * 2;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x77777777;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x77777777;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
} else {
|
||||
// Map to one 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = normal_size_map8_4bpp + data;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
switch (capinfo->bpp) {
|
||||
case 4:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
// Map to three 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = double_size_map8_4bpp + data * 2;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x77777777;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x77777777;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
} else {
|
||||
// Map to one 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = normal_size_map8_4bpp + data;
|
||||
*word_ptr &= 0x77777777;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case 8:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map8_8bpp + data * 4;
|
||||
for (int k = 0; k < 4; k++) {
|
||||
*word_ptr &= 0x7f7f7f7f;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) &= 0x7f7f7f7f;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map8_8bpp + data * 2;
|
||||
for (int k = 0; k < 2; k++) {
|
||||
*word_ptr &= 0x7f7f7f7f;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map8_16bpp + data * 8;
|
||||
for (int k = 0; k < 8; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map8_16bpp + data * 4;
|
||||
for (int k = 0; k < 4; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
|
@ -4383,7 +4533,6 @@ void osd_update(uint32_t *osd_base, int bytes_per_line) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// This is a stripped down version of the above that is significantly
|
||||
|
@ -4434,57 +4583,80 @@ void osd_update_fast(uint32_t *osd_base, int bytes_per_line) {
|
|||
// Character row is 12 pixels
|
||||
int data = fontdata[32 * c + y] & 0x3ff;
|
||||
// Map to the screen pixel format
|
||||
if (capinfo->bpp == 8) {
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map_8bpp + data * 6;
|
||||
for (int k = 0; k < 6; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map_8bpp + data * 3;
|
||||
for (int k = 0; k < 3; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
// Map to three 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = double_size_map_4bpp + data * 3;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
} else {
|
||||
// Map to two 32-bit words in frame buffer format
|
||||
if (i & 1) {
|
||||
// odd character
|
||||
uint32_t *map_ptr = normal_size_map_4bpp + (data << 2) + 2;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
} else {
|
||||
// even character
|
||||
uint32_t *map_ptr = normal_size_map_4bpp + (data << 2);
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr |= *map_ptr;
|
||||
}
|
||||
}
|
||||
switch (capinfo->bpp) {
|
||||
case 4:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
// Map to three 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = double_size_map_4bpp + data * 3;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
} else {
|
||||
// Map to two 32-bit words in frame buffer format
|
||||
if (i & 1) {
|
||||
// odd character
|
||||
uint32_t *map_ptr = normal_size_map_4bpp + (data << 2) + 2;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
} else {
|
||||
// even character
|
||||
uint32_t *map_ptr = normal_size_map_4bpp + (data << 2);
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr |= *map_ptr;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case 8:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map_8bpp + data * 6;
|
||||
for (int k = 0; k < 6; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map_8bpp + data * 3;
|
||||
for (int k = 0; k < 3; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map_16bpp + data * 12;
|
||||
for (int k = 0; k < 12; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map_16bpp + data * 6;
|
||||
for (int k = 0; k < 3; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
|
@ -4516,41 +4688,63 @@ void osd_update_fast(uint32_t *osd_base, int bytes_per_line) {
|
|||
// Character row is 8 pixels
|
||||
int data = (int) fontdata8[8 * c + y];
|
||||
// Map to the screen pixel format
|
||||
if (capinfo->bpp == 8) {
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map8_8bpp + data * 4;
|
||||
for (int k = 0; k < 4; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map8_8bpp + data * 2;
|
||||
for (int k = 0; k < 2; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
// Map to two 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = double_size_map8_4bpp + data * 2;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
} else {
|
||||
// Map to one 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = normal_size_map8_4bpp + data;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
switch (capinfo->bpp) {
|
||||
case 4:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
// Map to two 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = double_size_map8_4bpp + data * 2;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
} else {
|
||||
// Map to one 32-bit words in frame buffer format
|
||||
uint32_t *map_ptr = normal_size_map8_4bpp + data;
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case 8:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map8_8bpp + data * 4;
|
||||
for (int k = 0; k < 4; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map8_8bpp + data * 2;
|
||||
for (int k = 0; k < 2; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
uint32_t *map_ptr = double_size_map8_16bpp + data * 8;
|
||||
for (int k = 0; k < 8; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
*(word_ptr + words_per_line) |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
} else {
|
||||
uint32_t *map_ptr = normal_size_map8_16bpp + data * 4;
|
||||
for (int k = 0; k < 4; k++) {
|
||||
*word_ptr |= *map_ptr;
|
||||
word_ptr++;
|
||||
map_ptr++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (attr & ATTR_DOUBLE_SIZE) {
|
||||
|
|
|
@ -213,11 +213,11 @@ skip_swap:
|
|||
orreq r3, r3, #BIT_NO_LINE_DOUBLE
|
||||
ldr r8, param_palette_control
|
||||
ldr r7, param_fb_bpp
|
||||
cmp r7, #4
|
||||
moveq r7, #0
|
||||
movne r7, #1
|
||||
cmp r7, #8
|
||||
moveq r7, #1
|
||||
movne r7, #0
|
||||
|
||||
// r7 0= 4 bpp, 1=8 bpp
|
||||
// r7 0= 4 bpp or 16bpp, 1=8 bpp
|
||||
// r8 0=normal, 1= in band, 2=CGA ntsc, 3=mono ntsc, 4=auto mono ntsc
|
||||
// r9 0=normal, 1=Hx2, 2=Wx2, 3=H&Wx2
|
||||
|
||||
|
@ -1810,29 +1810,29 @@ capture_line_normal_6bpp_table:
|
|||
|
||||
|
||||
capture_line_normal_8bpp_table:
|
||||
.word capture_line_default_4bpp //never called
|
||||
.word capture_line_default_twelvebits_16bpp
|
||||
.word capture_line_default_eightbits_8bpp
|
||||
.word capture_line_default_4bpp //never called
|
||||
.word capture_line_default_twelvebits_16bpp
|
||||
.word capture_line_default_eightbits_8bpp
|
||||
.word capture_line_default_4bpp //never called
|
||||
.word capture_line_default_twelvebits_16bpp
|
||||
.word capture_line_default_eightbits_8bpp
|
||||
.word capture_line_default_4bpp //never called
|
||||
.word capture_line_default_twelvebits_16bpp
|
||||
.word capture_line_default_eightbits_8bpp
|
||||
.word capture_line_default_4bpp //never called
|
||||
.word capture_line_default_twelvebits_16bpp
|
||||
.word capture_line_default_eightbits_8bpp
|
||||
|
||||
.word capture_line_default_4bpp //never called
|
||||
.word capture_line_default_twelvebits_16bpp
|
||||
.word capture_line_default_eightbits_double_8bpp
|
||||
.word capture_line_default_4bpp //never called
|
||||
.word capture_line_default_twelvebits_16bpp
|
||||
.word capture_line_default_eightbits_double_8bpp
|
||||
.word capture_line_default_4bpp //never called
|
||||
.word capture_line_default_twelvebits_16bpp
|
||||
.word capture_line_default_eightbits_double_8bpp
|
||||
.word capture_line_default_4bpp //never called
|
||||
.word capture_line_default_twelvebits_16bpp
|
||||
.word capture_line_default_eightbits_double_8bpp
|
||||
.word capture_line_default_4bpp //never called
|
||||
.word capture_line_default_twelvebits_16bpp
|
||||
.word capture_line_default_eightbits_double_8bpp
|
||||
|
||||
.word capture_line_default_4bpp //never called
|
||||
.word capture_line_default_twelvebits_16bpp
|
||||
.word capture_line_fast_eightbits_8bpp
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue