G11 porting - page 17 - DryOS Development - CHDK Forum supplierdeeply

G11 porting

  • 530 Replies
  • 246005 Views
*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #160 on: 03 / January / 2010, 18:50:38 »
Advertisements
For the book, here is the complete display screenshot.  ::)

Re: G11 porting
« Reply #161 on: 03 / January / 2010, 18:56:28 »
Just to confirm, put an absolute value for the 'x' position rather than half buffer width.

EDIT:

The screen width is 720.

Maybe you also have to draw each pixel twice.

I wonder if the bitmap height is 270 ?

This would then be the same as the IXUS100 that also uses a 720x240 area.

In SDM draw_pixel_std() :-

Code: [Select]
#if defined (CAMERA_ixus980) || defined(CAMERA_ixus100)                      
    frame_buffer[0][y * screen_buffer_width + (x<<1)] = frame_buffer[1][y * screen_buffer_width + (x<<1)] = cl & 0xff;     // draw two pixels side-by-side
    frame_buffer[0][y * screen_buffer_width + (x<<1)+1] = frame_buffer[1][y * screen_buffer_width + (x<<1)+1] = cl & 0xff;


EDIT:

Try running the code you posted in reply #151 again now that you know the correct buffer width.

« Last Edit: 03 / January / 2010, 19:18:45 by Microfunguy »

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #162 on: 03 / January / 2010, 19:21:30 »
Okay, i will try this tomorrow. But here is something other:
CHDK Logo on the G11 (okay, it a little bit stretched, but anyway...  :D )

Re: G11 porting
« Reply #163 on: 03 / January / 2010, 19:25:01 »
Okay, i will try this tomorrow. But here is something other:
CHDK Logo on the G11 (okay, it a little bit stretched, but anyway...  :D )


That's progress !

Another tedious task is to define record and playback colour palettes.

Hopefully the G11 has a reasonable range of colours, unlike the IXUS100.

You will soon be able to permanently display Misc values to inspect physw_status[].



Re: G11 porting
« Reply #164 on: 04 / January / 2010, 05:09:06 »
It looks like it is similar to the SX200IS.
In \include\camera.h you need :

#define CAM_USES_ASPECT_CORRECTION  1

The default aspect-correction in the 'x' direction draws each pixel twice :-

#define ASPECT_XCORRECTION(x)  ( ((x)<<1) )

That assumes the bitmap screen width is defined as 360 in g11\sub\.\lib.c

If the bitmap screen width is 320 you need to stretch by 9/4 :-

#define ASPECT_XCORRECTION(x)  ( ( ((x)<<3) + (x) )  >>2 )

The pixel drawing function in gui_draw.c should then display all CHDK info correctly.

Also in camera.h, you can try try changing the palette number to see if any existing palettes are suitable.

If not, you will have to create a new one.


*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #165 on: 04 / January / 2010, 08:01:34 »
Good idea Microfungy!

I am using now the ASPECT_CORRECTION and BITMAP palette 3 and it looks not so bad now.
And another good thing has happend, the SD-Card write protect message is now also gone!
The mkdir() calls are now working and they creates the CHDK folders on the SD-Card.
I dont know if this is caused as a sideeffect of the framebuffer changes, or by the complette "gmake clean", i have done also before i started my new build. But anyway, its working. :lol

Anyway, the file read is still not working, so i dont have any fonts loaded now and cant print text to the screen.

Re: G11 porting
« Reply #166 on: 04 / January / 2010, 08:10:47 »

And another good thing has happend, the SD-Card write protect message is now also gone!

Was that by magic ?   :)

Quote
Anyway, the file read is still not working, so i dont have any fonts loaded now and cant print text to the screen.

I cannot remember, do you need file-reading for the built-in fonts ?

Maybe the file FUT function addresses are incorrect ?


To summarrise :

The G11 bitmap buffer is probably 960x270.
It uses the top-left 720x240 area for screen display.
The bitmap buffer screen with is 360, the height 240.
The pixel-drawing routine draws every pixel twice in the 'x' direction.



EDIT:

Just having a quick look at gui.c, the CHDK icon is loaded from a file :-

fd = fopen(logo_name, "rb");

So, that seems to work.
« Last Edit: 04 / January / 2010, 08:34:28 by Microfunguy »

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #167 on: 04 / January / 2010, 08:41:16 »
Ah, okay. I only seen the fonts folder in the CHDK subdirectory and guessed that the fonts come from here only.
But know if found the build-in font_8x16 files. But the draw_text functions are still not working. I think, this is maybe
caused by the disabled callback functions in conf_load_defaults() (i have to remove the conf_info.func() call, because system crashes here). So maybe the font_init() functions are not called and this could be the reason for the not working text draw functions.
I have to figure out whats crashing here, or at least which font functions i have to call/init to get working draw_text support.

The "fd = fopen(logo_name, "rb");" ist still not working, to show the CHDK Logo, i converted the logo.dat file into a char* array and compiled it staticly into the diskboot.bin.


*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #168 on: 04 / January / 2010, 09:19:53 »
Success, i added the call of this function:
Code: [Select]
void font_init() {
    font_init_data(cp_common, 0, 128);
    font_init_data(codepages[FONT_CP_WIN_1251], 128, 128);
}
and now draw_text is working!   :)

Re: G11 porting
« Reply #169 on: 04 / January / 2010, 09:26:53 »
Excellent !

Now you can print messages and examine values and work-out the key mapping.



« Last Edit: 04 / January / 2010, 09:58:55 by Microfunguy »

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal