| 1 | #include "lolevel.h" |
|---|
| 2 | #include "platform.h" |
|---|
| 3 | #include "core.h" |
|---|
| 4 | #include "keyboard.h" |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | extern long link_bss_start; |
|---|
| 8 | extern long link_bss_end; |
|---|
| 9 | extern void boot(); |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | void startup() |
|---|
| 13 | { |
|---|
| 14 | long *bss = &link_bss_start; |
|---|
| 15 | long *ptr; |
|---|
| 16 | |
|---|
| 17 | // sanity check |
|---|
| 18 | if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)){ |
|---|
| 19 | started(); |
|---|
| 20 | shutdown(); |
|---|
| 21 | } |
|---|
| 22 | |
|---|
| 23 | // initialize .bss senment |
|---|
| 24 | while (bss<&link_bss_end) |
|---|
| 25 | *bss++ = 0; |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | boot(); |
|---|
| 29 | } |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | static const int fl_tbl[] = {5800, 6420, 7060, 7700, 8340, 9950, 11550, 13160, 14750, 17150, 19570, 22760, 26750, 30750, 34800}; |
|---|
| 33 | #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) |
|---|
| 34 | #define CF_EFL 60345 |
|---|
| 35 | |
|---|
| 36 | const int zoom_points = NUM_FL; |
|---|
| 37 | |
|---|
| 38 | int get_effective_focal_length(int zp) { |
|---|
| 39 | return (CF_EFL*get_focal_length(zp))/10000; |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | int get_focal_length(int zp) { |
|---|
| 43 | if (zp<0) return fl_tbl[0]; |
|---|
| 44 | else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]; |
|---|
| 45 | else return fl_tbl[zp]; |
|---|
| 46 | } |
|---|
| 47 | |
|---|
| 48 | int get_zoom_x(int zp) { |
|---|
| 49 | if (zp<1) return 10; |
|---|
| 50 | else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0]; |
|---|
| 51 | else return fl_tbl[zp]*10/fl_tbl[0]; |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | #if 0 |
|---|
| 55 | int rec_switch_state(void) { |
|---|
| 56 | return (physw_status[1] & 0x02000000); |
|---|
| 57 | } |
|---|
| 58 | #endif |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | long get_vbatt_min() |
|---|
| 62 | { |
|---|
| 63 | return 2300; |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | long get_vbatt_max() |
|---|
| 67 | { |
|---|
| 68 | return 2550; |
|---|
| 69 | } |
|---|