Menu

#452 Mapper color blue

SVN
open
nobody
None
1
2017-04-22
2017-04-20
Hex
No

Clean SVN build on raspberry pi 3 using sdl is causing mapper colors to be distorted. See attachment.

Changing colors to different numbers like follows in sdl_mapper.cpp file even if not defined changes colors.

Black 0
Grey 73
White 255
Red 224
Green 24
Blue 15

1 Attachments

Discussion

  • ripsaw8080

    ripsaw8080 - 2017-04-20

    The attached screenshot does not appear to be current SVN, judging by the lowercase characters on the letter keys.

    Your point about changing colors seems incongruous with official source, as the color numbers should be row indexes in an array of RGB values.

     
  • Hex

    Hex - 2017-04-21

    Yes I didnt bother taking another photo as the effect was the same. I have attached a new photo taken after a clean SVN build from raspberry pi 3 (the blue one). On clicking on one of the buttons (Clicked on Q).

    Modifying the method responsible for drawing text causes rainbow colors. Color > 6 (SDL_Color map_pal[6]) are also accessible.

    // Store current color 
    static int hex = 0;
    
    static void DrawText(Bitu x,Bitu y,const char * text,Bit8u color) {
        Bit8u * draw=((Bit8u *)mapper.surface->pixels)+(y*mapper.surface->pitch)+x;
        while (*text) {
            Bit8u * font=&int10_font_14[(*text)*14];
            Bitu i,j;Bit8u * draw_line=draw;
            for (i=0;i<14;i++) {
                Bit8u map=*font++;
                for (j=0;j<8;j++) {
                    // Assign custom color to text character
                    if (map & 0x80) *(draw_line+j)=hex;
                    else *(draw_line+j)=CLR_BLACK;
                    map<<=1;
                }
                draw_line+=mapper.surface->pitch;
            }
            text++;draw+=8;
    
            // Increment color after ever character printed
            hex++;
        }
    }
    
     

    Last edit: Hex 2017-04-21
  • ripsaw8080

    ripsaw8080 - 2017-04-22

    Make sure you're using SDL 1.2.x (1.2.15 recommended), as other versions may indeed require changes to the DOSBox source. If you are using 1.2.x then the color issue would appear to be with SDL on your platform, as it is not known to affect other platforms, so perhaps bring it to the attention of the SDL developers. In either case it is not a bug in DOSBox.

     

Log in to post a comment.