root/platform/g9/lib.c

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

DEFINITIONS

This source file includes following definitions.
  1. shutdown
  2. camera_jpeg_count_str
  3. debug_led
  4. camera_set_led1
  5. get_flash_params_count
  6. vid_get_viewport_live_fb
  7. vid_get_bitmap_fb
  8. vid_get_viewport_fb
  9. vid_get_viewport_height
  10. vid_get_palette_type
  11. vid_get_palette_size
  12. vid_get_bitmap_active_palette
  13. vid_get_bitmap_active_buffer

   1 #include "platform.h"
   2 
   3 void shutdown()
   4 {
   5     volatile long *p = (void*)0xc022006C;
   6         
   7     asm(
   8          "MRS     R1, CPSR\n"
   9          "AND     R0, R1, #0x80\n"
  10          "ORR     R1, R1, #0x80\n"
  11          "MSR     CPSR_cf, R1\n"
  12          :::"r1","r0");
  13         
  14     *p = 0x44;
  15 
  16     while(1);
  17 }
  18 
  19 char *camera_jpeg_count_str()
  20 {
  21     return (char*)0x60354;
  22 }
  23 
  24 #define LED_PR 0xC022006C //used iso blue, was 0xc02200C4  //a650- 0xc02200C4
  25 
  26 
  27 void debug_led(int state)
  28 {
  29     volatile long *p=(void*)LED_PR;
  30     if (state)
  31         p[0]=0x46;
  32     else
  33         p[0]=0x44;
  34 }
  35 
  36 #define LED_BASE 0xc0220080
  37 #define LED_AF 0xC0220094//was 0xc0220080 //a650- 0xc0220080//from g7
  38 
  39 void camera_set_led1(int led, int state, int bright)//?
  40 {
  41   int leds[] = {12,16,4,8,4,0,4};
  42   if(led < 4 || led > 10 || led == 6) return;
  43   volatile long *p=(void*)LED_BASE + leds[led-4];
  44     if (state)
  45         p[0]=0x46;
  46     else
  47         p[0]=0x44;
  48 }
  49 
  50 
  51 int get_flash_params_count(void){
  52  return 114;    //++  FF956AEC
  53 }
  54 
  55 void *vid_get_viewport_live_fb() //By comparison to A720 - UNTESTED
  56 {
  57     void **fb=(void **)0x228C;
  58     unsigned char buff = *((unsigned char*)0x2124);
  59     if (buff == 0) {
  60         buff = 2;
  61     }
  62     else {
  63         buff--;
  64     }
  65     return fb[buff];
  66 }
  67 
  68 void *vid_get_bitmap_fb()
  69 { 
  70     return (void*)0x10361000; 
  71 }
  72 
  73 void *vid_get_viewport_fb()
  74 { 
  75     return (void*)0x1067b540; 
  76 }
  77 
  78 long vid_get_viewport_height()
  79 {
  80     return 240;
  81 }
  82 
  83 // PTP display stuff
  84 int vid_get_palette_type() { return 1; } //UNTESTED
  85 int vid_get_palette_size() { return 16*4; } //UNTESTED
  86 
  87 void *vid_get_bitmap_active_palette() 
  88 {
  89     return (void *)0x47ce8;        //Found @ 0xff8f5e4c - Two refs to "BmpDDev"
  90 }
  91 
  92 void *vid_get_bitmap_active_buffer() 
  93 {
  94     return (void*)(*(int*)0xd548); //Found @ 0xff8f5e50 - Two refs to "BmpDDev"
  95 }

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