root/platform/a460/sub/100d/lib.c

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

DEFINITIONS

This source file includes following definitions.
  1. hook_raw_fptr
  2. hook_raw_ret_addr
  3. hook_raw_image_addr
  4. vid_get_viewport_live_fb
  5. vid_get_bitmap_fb
  6. vid_get_viewport_fb
  7. vid_get_viewport_fb_d
  8. vid_get_viewport_height
  9. camera_jpeg_count_str
  10. vid_get_palette_type
  11. vid_get_palette_size
  12. vid_get_bitmap_active_palette
  13. vid_get_bitmap_active_buffer
  14. vid_get_viewport_width_proper
  15. vid_get_viewport_height_proper
  16. vid_get_viewport_fullscreen_height
  17. vid_get_viewport_fullscreen_width
  18. vid_get_viewport_display_xoffset_proper
  19. vid_get_viewport_display_yoffset_proper

   1 #include "platform.h"
   2 #include "keyboard.h"
   3 
   4 void *hook_raw_fptr()
   5 {
   6     return (void*)0x440C0; 
   7 }
   8 
   9 void *hook_raw_ret_addr()
  10 {
  11     return (void*)0xFFD4CBCC; 
  12 }
  13 
  14 char *hook_raw_image_addr()
  15 {
  16     return (char*)(0x10800000+0x41000+0x260);      
  17 }
  18 
  19 void *vid_get_viewport_live_fb()//found via the a560 port; a560 0xffd74784 equals to a460 0xffd630ec
  20 /*
  21 the value of [0x6028] is located at 0xFFEF3A98 in ROM
  22 */
  23 {
  24     void **fb=(void **)0x6028; //a560: 0x64F0
  25     unsigned char buff = *((unsigned char*)0x6038);//a560: 0x6500
  26     if (buff == 0) {
  27         buff = 2;
  28     }
  29     else {
  30         buff--;
  31     }
  32     return fb[buff];
  33 }
  34 
  35 void *vid_get_bitmap_fb()
  36 {
  37     return (void*)0x10361000;  //(0x10360000 + 0x1000)
  38 }
  39 
  40 void *vid_get_viewport_fb()
  41 {
  42     return (void*)0x10E81260; //0x10558D30
  43 }
  44 
  45 void *vid_get_viewport_fb_d()
  46 {
  47     return (void*)(*(int*)0x6D048);
  48 }
  49 
  50 long vid_get_viewport_height()
  51 {
  52     return 240;
  53 }
  54 
  55 char *camera_jpeg_count_str()
  56 {
  57     return (char*)0x10F70;
  58 } 
  59 
  60 // PTP display stuff
  61 int vid_get_palette_type() { return 1; }
  62 int vid_get_palette_size() { return 16*4; }
  63 
  64 void *vid_get_bitmap_active_palette() {
  65     return (void *)0x45af8;  // sub_ffdbb10c, (marked by 2 adjacent bmpddev.c asserts, just like in A410)
  66 }
  67 
  68 void *vid_get_bitmap_active_buffer()
  69 {
  70     return (void*)(*(int*)(0x8dc8)); //sub_ffdbb10c, fed into 0xc0f140d4
  71 }
  72 
  73 extern int _GetVRAMHPixelsSize();
  74 extern int _GetVRAMVPixelsSize();
  75 // normally 720, goes to 360 for stitch, 320x240 video, max digital zoom
  76 int vid_get_viewport_width_proper() { 
  77     return ((mode_get()&MODE_MASK) == MODE_PLAY)?720:_GetVRAMHPixelsSize();
  78 }
  79 // varies from 62 - 240 with digital zoom, 120 in stitch
  80 int vid_get_viewport_height_proper() {
  81     return ((mode_get()&MODE_MASK) == MODE_PLAY)?240:_GetVRAMVPixelsSize();
  82 }
  83 
  84 int vid_get_viewport_fullscreen_height() {
  85     // except for stitch, always full screen
  86     return vid_get_viewport_height_proper();
  87 }
  88 int vid_get_viewport_fullscreen_width() {
  89     // except for stitch, always full screen
  90     return vid_get_viewport_width_proper();
  91 }
  92 int vid_get_viewport_display_xoffset_proper() {
  93     return 0;
  94 }
  95 int vid_get_viewport_display_yoffset_proper() {
  96     return 0;
  97 }

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