| 1 | |
|---|
| 2 | #include "platform.h" |
|---|
| 3 | #include "lolevel.h" |
|---|
| 4 | |
|---|
| 5 | #define LED_PR 0xc02200C4 |
|---|
| 6 | #define LED_RED 0xc02200C8 |
|---|
| 7 | #define LED_GRN 0xc02200CC |
|---|
| 8 | #define LED_PWR 0xc02200D0 |
|---|
| 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 | void shutdown() |
|---|
| 17 | { |
|---|
| 18 | |
|---|
| 19 | /* |
|---|
| 20 | ROM:FFC0CD8C LDR R1, =0xC0220000 |
|---|
| 21 | ROM:FFC0CD90 MOV R0, #0x44 |
|---|
| 22 | ROM:FFC0CD94 STR R0, [R1,#0x54] |
|---|
| 23 | ROM:FFC0CD98 STR R0, [R1,#0x4C] |
|---|
| 24 | |
|---|
| 25 | C0220000+54+4C=0xC02200A0 |
|---|
| 26 | |
|---|
| 27 | */ |
|---|
| 28 | |
|---|
| 29 | volatile long *p = (void*)0xC02200A0; |
|---|
| 30 | |
|---|
| 31 | asm( |
|---|
| 32 | "MRS R1, CPSR\n" |
|---|
| 33 | "AND R0, R1, #0x80\n" |
|---|
| 34 | "ORR R1, R1, #0x80\n" |
|---|
| 35 | "MSR CPSR_cf, R1\n" |
|---|
| 36 | :::"r1","r0"); |
|---|
| 37 | |
|---|
| 38 | *p = 0x44; // power off. |
|---|
| 39 | |
|---|
| 40 | while(1); |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | void debug_led(int state) |
|---|
| 45 | { |
|---|
| 46 | *(int*)LED_PR=state ? 0x46 : 0x44; |
|---|
| 47 | *(int*)LED_GRN=state ? 0x46 : 0x44; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | void ubasic_set_led(int led, int state, int bright) { |
|---|
| 51 | static char led_table[5]={4,5,7,8,9}; |
|---|
| 52 | _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | int get_flash_params_count(void){ |
|---|
| 56 | return 120; |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | void JogDial_CW(void){ |
|---|
| 60 | _PostLogicalEventForNotPowerType(0x874, 2); // RotateJogDialRight |
|---|
| 61 | } |
|---|
| 62 | |
|---|
| 63 | void JogDial_CCW(void){ |
|---|
| 64 | _PostLogicalEventForNotPowerType(0x875, 2); // RotateJogDialLeft |
|---|
| 65 | } |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | |
|---|