root/platform/a480/sub/100b/lib.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. hook_raw_image_addr
  2. vid_get_viewport_live_fb
  3. vid_get_bitmap_fb
  4. vid_get_viewport_fb
  5. vid_get_viewport_fb_d
  6. vid_get_viewport_height
  7. camera_jpeg_count_str
  8. vid_get_palette_type
  9. vid_get_palette_size
  10. vid_get_bitmap_active_palette
  11. vid_get_bitmap_active_buffer
  12. vid_get_viewport_width_proper
  13. vid_get_viewport_height_proper

   1 #include "platform.h"
   2 
   3 char *hook_raw_image_addr()
   4 {
   5         return (char*) 0x10C5FA60; // "CRAW BUFF"
   6 }
   7 
   8 void *vid_get_viewport_live_fb()
   9 {
  10     void **fb=(void **)0x3E80;
  11     unsigned char buff = *((unsigned char*)0x3CF0); // sub_FFC87F0C
  12     if (buff == 0) buff = 2;  else buff--;    
  13     return fb[buff];
  14 }
  15 
  16 void *vid_get_bitmap_fb()
  17 {
  18         return (void*)0x10361000; // "BmpDDev.c"
  19 }
  20 
  21 void *vid_get_viewport_fb()
  22 {
  23         return (void*)0x10659EC0;  // "VRAM Address"
  24 }
  25 
  26 void *vid_get_viewport_fb_d()
  27 {
  28     // TODO need to check if this is valid if camera started with video selected in PB mode
  29         return (void*)(*(int*)(0x2554+0x54)); // sub_FFC3C050
  30 }
  31 
  32 long vid_get_viewport_height()
  33 {
  34         return 240;
  35 }
  36 
  37 char *camera_jpeg_count_str()
  38 {
  39         return (char*)0x2CFF8;  // "9999"
  40 }
  41 
  42 // PTP display stuff, untested, adapted from ewavr chdkcam patch
  43 // reyalp - type probably wrong, chdkcam patch suggests opposite order from a540 (e.g. vuya)
  44 int vid_get_palette_type() { return 1; }
  45 int vid_get_palette_size() { return 16*4; }
  46 
  47 void *vid_get_bitmap_active_palette() {
  48     return (void *)(0x4C0C+0x20); // sub_FFCA5000
  49 }
  50 void *vid_get_bitmap_active_buffer()
  51 {
  52     return (void*)(*(int*)(0x4C0C+0x0C)); //SaveBmpVRAMData()->sub_FFCA50C4
  53 }
  54 
  55 // values from chdkcam patch
  56 // commented for now, protocol changes needed to handle correctly
  57 // note, play mode may be 704, needs to be tested
  58 #if 0
  59 int vid_get_viewport_width_proper() { 
  60     return ((mode_get()&MODE_MASK) == MODE_PLAY)?720:*(int*)0x3E50; // VRAM DataSiz
  61 }
  62 int vid_get_viewport_height_proper() {
  63     return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:*(int*)(0x32C68+4);
  64 }
  65 #endif

/* [<][>][^][v][top][bottom][index][help] */