No script console output - SX20 - DryOS Development - CHDK Forum

No script console output - SX20

  • 8 Replies
  • 3684 Views
No script console output - SX20
« on: 21 / April / 2010, 17:37:35 »
Advertisements
I have a really weird bug on the SX20 102b port I'm working on. Most CHDK functionality has been implemented however I can't get any text out of the script console. Scripts run successfully but when they print messages I get a new black box but no text in it, very odd.

I've checked the code and I think this box is printed with COLOR_FG and COLOR_BG. These have been set correctly but still nothing is displayed on screen.

As a side note I don't get any Zebra output - could this be related?

Re: No script console output - SX20
« Reply #1 on: 21 / April / 2010, 17:57:25 »
.
I've checked the code and I think this box is printed with COLOR_FG and COLOR_BG..


That is what is says in \core\script.c\script_console_draw().

Try changing the colours to something else.

Re: No script console output - SX20
« Reply #2 on: 22 / April / 2010, 05:24:13 »
Quote
That is what is says in \core\script.c\script_console_draw().

Try changing the colours to something else.

I don't understand, this is what it actually says:

Code: [Select]
void script_console_draw() {
    int i,c,l;
    for(c = 0; c < script_con_num_lines;   c) {
        i=script_con_line_index(script_con_start_line c);
        l=strlen(script_console_buf[i]);
        draw_txt_string(SCRIPT_CONSOLE_X, SCRIPT_CONSOLE_Y SCRIPT_CONSOLE_NUM_LINES-script_con_num_lines c, script_console_buf[i], MAKE_COLOR(COLOR_BG, COLOR_FG));
        for (; l<SCRIPT_CONSOLE_LINE_LENGTH;   l)
            draw_txt_char(SCRIPT_CONSOLE_X l, SCRIPT_CONSOLE_Y SCRIPT_CONSOLE_NUM_LINES-script_con_num_lines c, ' ', MAKE_COLOR(COLOR_BG, COLOR_FG));
    }
}

No comments there!

I have already tried changing COLOR_BG, COLOR_FG as in my original post.

Re: No script console output - SX20
« Reply #3 on: 22 / April / 2010, 06:53:55 »
I don't understand, this is what it actually says:

I mean change MAKE_COLOR(COLOR_BG, COLOR_FG) to MAKE_COLOR(COLOR_BLUE, COLOR_WHITE) for example.


Re: No script console output - SX20
« Reply #4 on: 22 / April / 2010, 14:12:27 »
Quote
I mean change MAKE_COLOR(COLOR_BG, COLOR_FG) to MAKE_COLOR(COLOR_BLUE, COLOR_WHITE) for example.

I have.

I've tried:
blue/red
red/blue
black/transparent

I just get the background colour for all of them.

It would appear that draw_string is not working at all for my camera. I know that sprintf does through because I see the OSD. Could there be a function that I have not got right in my stubs? Does anyone know what this is.

Re: No script console output - SX20
« Reply #5 on: 22 / April / 2010, 15:02:30 »
Doing a quick search, draw_txt_string also occurs in the games code, debug, palette, calendar, etc.

Do they work ?

Ultimately, it uses whatever function is currently assigned to draw_pixel_proc and that is normally draw_pixel_std .. which simply writes the appropriate colour value to the two buffers.

« Last Edit: 22 / April / 2010, 15:06:53 by Microfunguy »

Re: No script console output - SX20
« Reply #6 on: 22 / April / 2010, 18:04:38 »
OK, mastermind shows the battery and clock on screen which is drawn with draw_txt_string. The call from this point on must be OK if the arguments are correct.

In addition the 100f SX20 displays console out so it must be something in my sub directory. Does anyone know of any key functions or routines I should investigate first?

Interestingly when I change script_console_draw() to be:

Code: [Select]
void script_console_draw() {
    draw_txt_string(screen_width/FONT_WIDTH-2-9, screen_height/FONT_HEIGHT-1, "Hello", MAKE_COLOR(0xDD, 0x11));
}

I get the expected output. Any ideas?



Update:

Ok so it looks like script_console_buf is empty even though script are supposedly writing to the buffer.
« Last Edit: 22 / April / 2010, 19:16:10 by acid2000 »

Re: No script console output - SX20
« Reply #7 on: 22 / April / 2010, 18:51:17 »
Is there anything in script_console_buf ?

script_console_add_text  uses firmware  functions  strlen, strncpy and strcat.

Are they correct ?
« Last Edit: 22 / April / 2010, 18:56:26 by Microfunguy »


Re: No script console output - SX20
« Reply #8 on: 22 / April / 2010, 19:17:35 »
No!

strcat was wrong, now works!

Thanks everyone

 

Related Topics