root/platform/sx10/lib.c

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

DEFINITIONS

This source file includes following definitions.
  1. camera_jpeg_count_str
  2. vid_bitmap_refresh
  3. shutdown
  4. debug_led
  5. camera_set_led
  6. get_flash_params_count
  7. JogDial_CW
  8. JogDial_CCW
  9. vid_get_viewport_fb_d
  10. vid_get_viewport_height
  11. vid_get_palette_type
  12. vid_get_palette_size
  13. vid_get_bitmap_active_palette
  14. vid_get_bitmap_active_buffer

   1 #include "platform.h"
   2 #include "lolevel.h"
   3 
   4 char *camera_jpeg_count_str()
   5 {
   6     extern char jpeg_count_str[];
   7     return jpeg_count_str;
   8 }
   9 
  10 void vid_bitmap_refresh()
  11 {
  12  extern int enabled_refresh_physical_screen;
  13  enabled_refresh_physical_screen=1;
  14  _RefreshPhysicalScreen(1);
  15 }
  16 
  17 
  18 void shutdown()
  19 {
  20         volatile long *p = (void*)0xC022001C;    
  21         
  22         asm(
  23                 "MRS     R1, CPSR\n"
  24                 "AND     R0, R1, #0x80\n"
  25                 "ORR     R1, R1, #0x80\n"
  26                 "MSR     CPSR_cf, R1\n"
  27                 :::"r1","r0");
  28         
  29         *p = 0x44;  // power off.
  30         
  31         while(1);
  32 }
  33 
  34 #define LED_PR 0xC0220060
  35 
  36 void debug_led(int state)
  37 {
  38  *(int*)LED_PR=state ? 0x46 : 0x44;
  39 }
  40 
  41 void camera_set_led(int led, int state, int bright) {
  42  static char led_table[5]={4,5,7,8,9};
  43  _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state);
  44 }
  45 
  46 int get_flash_params_count(void){
  47  return 120; 
  48 }
  49 
  50 void JogDial_CW(void){
  51  _PostLogicalEventForNotPowerType(0x874, 1);  // RotateJogDialRight, 1 - rotation count
  52 }
  53 
  54 void JogDial_CCW(void){
  55  _PostLogicalEventForNotPowerType(0x875, 1);  // RotateJogDialLeft, 1 - rotation count
  56 }
  57 
  58 void *vid_get_viewport_fb_d()
  59 {
  60     extern char *viewport_fb_d;
  61         return viewport_fb_d;
  62 }
  63 
  64 long vid_get_viewport_height()
  65 {
  66         return 240;
  67 }
  68 
  69 
  70 // PTP display stuff
  71 int vid_get_palette_type() { return 4; }  //Test 1, 2 or 4
  72 int vid_get_palette_size() { return 16*4; }
  73 
  74 void *vid_get_bitmap_active_palette() {
  75     return (void *)*(unsigned int*)(0x8378+0x20);  // sub_ff8f3a08, via sub_ff9d9e1c two refs to "Palette Class."
  76 }
  77 void *vid_get_bitmap_active_buffer()
  78 {
  79     return (void*)(*(int*)(0x8378+0xC)); //"Add: %p Width : %ld Hight : %ld", 
  80                                          // 100c: sub_ff8f3acc
  81                                          // 101a: sub_ff8f3ad4
  82 }

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