root/platform/d10/sub/100a/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_width
  7. vid_get_viewport_height
  8. camera_jpeg_count_str
  9. vid_get_palette_type
  10. vid_get_palette_size
  11. vid_get_bitmap_active_palette
  12. vid_get_bitmap_active_buffer
  13. vid_get_viewport_width_proper
  14. vid_get_viewport_height_proper
  15. vid_get_viewport_fullscreen_height
  16. vid_get_viewport_fullscreen_width
  17. vid_get_viewport_display_xoffset_proper
  18. vid_get_viewport_display_yoffset_proper

   1 #include "platform.h"
   2 
   3 char *hook_raw_image_addr()
   4 {
   5     return (char*)0x41643DEC; // seach on CRAW BUF
   6 // if multi buffer,
   7 // (0x2AEC + 0x8) ??? sub_FF86274C__SsImgProcBuf_c__0 and table FFAD6A24
   8 }
   9 
  10 void *vid_get_viewport_live_fb()
  11 {
  12         // from sub_FF837020 (similar to sd990 sub_FF839850), via sub_FF8EC2DC ref to table at FFAE28FC
  13     void **fb=(void **)0x210C;
  14     unsigned char buff = *((unsigned char*)0x1F74);
  15     if (buff == 0) {
  16         buff = 2;
  17     }
  18     else {
  19         buff--;
  20     }
  21         // d10 adds this extra value.  Didn't ever see the value change from zero, may be wrong
  22     return fb[buff] + *(int *)(0x1F74 + 0xd4); 
  23 }
  24 
  25 void *vid_get_bitmap_fb()       
  26 {
  27     return (void*)0x403F1000; //  DispCon_ShowBitmapColorBar
  28 }
  29 
  30 void *vid_get_viewport_fb()
  31 {
  32     return (void *)0x40A05158; // search on VRAM Address
  33 }
  34 
  35 void *vid_get_viewport_fb_d()
  36 {
  37     return (void*)(*(int*)(0x2884 + 0x54));  // sub_FF8584AC, similar callers to sd990, 3rd, 4th functions following "HFILYUV"
  38 }
  39 
  40 int vid_get_viewport_width()
  41 {
  42         return 360;
  43 }
  44 
  45 long vid_get_viewport_height()
  46 {
  47     return 240;
  48 }
  49 
  50 char *camera_jpeg_count_str()
  51 {
  52     return (char *)0x525E4; // search on "9999" done
  53 }
  54 
  55 
  56 // PTP display stuff
  57 int vid_get_palette_type() { return 3; }
  58 int vid_get_palette_size() { return 256*4; }
  59 
  60 void *vid_get_bitmap_active_palette() {
  61     return (void *)*(unsigned int*)(0x5164+0x28);  // sub_FF8DE674, via sub_FF9B390C two refs to "Palette Class."
  62 }
  63 void *vid_get_bitmap_active_buffer()
  64 {
  65     return (void*)(*(int*)(0x5164+0x14)); //"Add: %p Width : %ld Hight : %ld", sub_FF8DE720
  66 }
  67 
  68 extern int _GetVRAMHPixelsSize();
  69 extern int _GetVRAMVPixelsSize();
  70 // normally 720, goes to 360 for stitch, 320x240 video, max digital zoom
  71 int vid_get_viewport_width_proper() { 
  72     return ((mode_get()&MODE_MASK) == MODE_PLAY)?720:_GetVRAMHPixelsSize();
  73 }
  74 // varies from 62 - 240 with digital zoom, 120 in stitch
  75 int vid_get_viewport_height_proper() {
  76     return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:_GetVRAMVPixelsSize();
  77 }
  78 
  79 int vid_get_viewport_fullscreen_height() {
  80     // except for stitch, always full screen
  81     int m = mode_get();
  82     if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH) {
  83         return 240;
  84     }
  85     return vid_get_viewport_height_proper();
  86 }
  87 int vid_get_viewport_fullscreen_width() {
  88     // except for stitch, always full screen
  89     int m = mode_get();
  90     if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH) {
  91         return 720;
  92     }
  93     return vid_get_viewport_width_proper();
  94 }
  95 int vid_get_viewport_display_xoffset_proper() {
  96     int val=0;
  97     int m = mode_get();
  98     if((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH) {
  99         short dir=0;
 100         short seq=0;
 101         get_property_case(PROPCASE_STITCH_DIRECTION,&dir,sizeof(dir));
 102         get_property_case(PROPCASE_STITCH_SEQUENCE,&seq,sizeof(seq));
 103         // overall stitch window is 3/4 screen width, centered
 104         // live part is 1/2, so margin is either 1/8th or 3/8th
 105         if(dir==0) {
 106             val = seq?270:90;
 107         } else {
 108             val = seq?90:270;
 109         }
 110     }
 111     return val;
 112 }
 113 int vid_get_viewport_display_yoffset_proper() {
 114     int m = mode_get();
 115     return ((m&MODE_MASK) != MODE_PLAY && (m&MODE_SHOOTING_MASK) == MODE_STITCH)?60:0; // window is 120, centered in 240 screen
 116 }

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