Read about our upcoming Code of Conduct on this issue

Commit 2835d628 authored by a1ex's avatar a1ex
Browse files

600D: fix trap focus, magic zoom, shutter half-press...

--HG--
branch : unified
parent d109ba182f24
......@@ -39,8 +39,11 @@
#define YUV422_HD_PITCH_REC_480P 1280
#define YUV422_HD_HEIGHT_REC_480P 480
#define FOCUS_CONFIRMATION (*(int*)0x41d0)
#define FOCUS_CONFIRMATION_AF_PRESSED (*(int*)0x1bb0) // only used to show trap focus status
#define FOCUS_CONFIRMATION (*(int*)0x41d0) // see "focusinfo" and Wiki:Struct_Guessing
#define FOCUS_CONFIRMATION_AF_PRESSED (*(int*)0x1bb0) // used for Trap Focus and Magic Off.
// To find it, go to MainCtrl task and take the number from the second line minus 4.
// See also "cam event metering"
//~ #define DISPLAY_SENSOR (*(int*)0x2dec)
//~ #define DISPLAY_SENSOR_ACTIVE (*(int*)0xC0220104)
#define DISPLAY_SENSOR_POWERED (*(int*)0x3138)
......
......@@ -152,7 +152,7 @@
#define YUV422_LV_BUFFER_DMA_ADDR (*(uint32_t*)0x2490)
#define YUV422_HD_BUFFER_DMA_ADDR (*(uint32_t*)0x73620)
// changes during record
#define YUV422_HD_BUFFER 0x44000080
......@@ -174,9 +174,8 @@
#define YUV422_HD_PITCH_REC_480P 1280
#define YUV422_HD_HEIGHT_REC_480P 480
#define FOCUS_CONFIRMATION (*(int*)0x41d0)
//~ #define FOCUS_CONFIRMATION_AF_PRESSED (*(int*)0x1bb0) // used to show trap focus status, and for Magic Off
#define FOCUS_CONFIRMATION_AF_PRESSED 0 // not found yet
#define FOCUS_CONFIRMATION (*(int*)0x479C)
#define FOCUS_CONFIRMATION_AF_PRESSED (*(int*)0x1bdc) // same as 60D
//~ #define DISPLAY_SENSOR (*(int*)0x2dec)
//~ #define DISPLAY_SENSOR_ACTIVE (*(int*)0xC0220104)
......@@ -187,8 +186,8 @@
#define GMT_FUNCTABLE 0xff56dccc
#define SENSOR_RES_X 5202
#define SENSOR_RES_Y 3465
#define SENSOR_RES_X 5184
#define SENSOR_RES_Y 3456
#define FLASH_BTN_MOVIE_MODE (((*(int*)0x14c1c) & 0x40000) && (shooting_mode == SHOOTMODE_MOVIE))
#define FLASH_BTN_MOVIE_MODE 0
......
......@@ -113,18 +113,13 @@ static int handle_buttons(struct event * event) {
output = 0;
}
break;
case BGMT_Q:
case BGMT_Q_ALT:
if(gui_menu_shown())
{
menu_send_event(PRESS_DIRECT_PRINT_BUTTON);
return 0;
}
if (gui_state == GUISTATE_PLAYMENU)
{
livev_playback_toggle();
return 0;
}
case BGMT_Q:
case BGMT_Q_ALT:
if(gui_menu_shown())
{
menu_send_event(PRESS_DIRECT_PRINT_BUTTON);
return 0;
}
case BGMT_ZOOM_OUT :
// Do nothing for now
break;
......@@ -168,11 +163,13 @@ static int handle_buttons(struct event * event) {
// Do nothing for now
break;
case BGMT_PRESS_HALFSHUTTER :
halfshutter_pressed = 1;
// Shared with magnify/zoom out under certain circumstances
// This button handling can be catched but not overriden (returning 0 does nothing)
// Do nothing for now
break;
case BGMT_UNPRESS_HALFSHUTTER :
halfshutter_pressed = 0;
// Shared with magnify/zoom out
// Do nothing for now
output = 0;
......@@ -204,22 +201,22 @@ static int handle_buttons(struct event * event) {
struct gui_main_struct {
void * obj; // off_0x00;
uint32_t counter; // off_0x04;
uint32_t off_0x08;
uint32_t counter_600D; //off_0x0c;
uint32_t off_0x10;
uint32_t off_0x14;
uint32_t off_0x18;
uint32_t off_0x1c;
uint32_t off_0x20;
uint32_t off_0x24;
uint32_t off_0x28;
uint32_t off_0x2c;
struct msg_queue * msg_queue_60d; // off_0x30;
struct msg_queue * msg_queue; // off_0x34;
struct msg_queue * msg_queue_550d; // off_0x38;
uint32_t off_0x3c;
void * obj; // off_0x00;
uint32_t counter; // off_0x04;
uint32_t off_0x08;
uint32_t counter_600D; //off_0x0c;
uint32_t off_0x10;
uint32_t off_0x14;
uint32_t off_0x18;
uint32_t off_0x1c;
uint32_t off_0x20;
uint32_t off_0x24;
uint32_t off_0x28;
uint32_t off_0x2c;
struct msg_queue * msg_queue_60d; // off_0x30;
struct msg_queue * msg_queue; // off_0x34;
struct msg_queue * msg_queue_550d; // off_0x38;
uint32_t off_0x3c;
};
extern struct gui_main_struct gui_main_struct;
......@@ -227,35 +224,35 @@ extern struct gui_main_struct gui_main_struct;
// if called from some other task, the function waits until the previous fake button was handled
void fake_simple_button(int bgmt_code)
{
if (!handle_buttons_active) take_semaphore(fake_sem, 0);
fake_event.type = 0,
fake_event.param = bgmt_code,
fake_event.obj = 0,
fake_event.arg = 0,
msg_queue_post(gui_main_struct.msg_queue_60d, &fake_event, 0, 0);
if (!handle_buttons_active) take_semaphore(fake_sem, 0);
fake_event.type = 0,
fake_event.param = bgmt_code,
fake_event.obj = 0,
fake_event.arg = 0,
msg_queue_post(gui_main_struct.msg_queue_60d, &fake_event, 0, 0);
}
static void gui_main_task_600D() {
struct event * event = NULL;
int index = 0;
void* funcs[GMT_NFUNCS];
memcpy(funcs, GMT_FUNCTABLE, 4*GMT_NFUNCS);
gui_init_end();
while(1) {
msg_queue_receive(gui_main_struct.msg_queue_60d, &event, 0);
gui_main_struct.counter_600D--;
if (event == NULL) continue;
index = event->type;
if ((index >= GMT_NFUNCS) || (index < 0))
continue;
if (!magic_is_off())
if (handle_buttons(event) == 0)
continue;
void(*f)(struct event *) = funcs[index];
f(event);
}
struct event * event = NULL;
int index = 0;
void* funcs[GMT_NFUNCS];
memcpy(funcs, GMT_FUNCTABLE, 4*GMT_NFUNCS);
gui_init_end();
while(1) {
msg_queue_receive(gui_main_struct.msg_queue_60d, &event, 0);
gui_main_struct.counter_600D--;
if (event == NULL) continue;
index = event->type;
if ((index >= GMT_NFUNCS) || (index < 0))
continue;
if (!magic_is_off())
if (handle_buttons(event) == 0)
continue;
void(*f)(struct event *) = funcs[index];
f(event);
}
}
......
......@@ -75,23 +75,23 @@ void display_lcd_remote_icon(int x0, int y0) {}
struct vram_info * get_yuv422_hd_vram()
{
static struct vram_info _vram_info;
_vram_info.vram = YUV422_HD_BUFFER;
_vram_info.width = recording ? (video_mode_resolution == 0 ? 1720 :
_vram_info.vram = YUV422_HD_BUFFER_DMA_ADDR;
_vram_info.width = recording ? (video_mode_resolution == 0 ? 1680 :
video_mode_resolution == 1 ? 1280 :
video_mode_resolution == 2 ? 640 : 0)
: lv_dispsize > 1 ? 1024
: shooting_mode != SHOOTMODE_MOVIE ? 1056
: (video_mode_resolution == 0 ? 1056 :
video_mode_resolution == 1 ? 1024 :
: (video_mode_resolution == 0 ? 1680 :
video_mode_resolution == 1 ? 1280 :
video_mode_resolution == 2 ? (video_mode_crop? 640:1024) : 0);
_vram_info.pitch = _vram_info.width << 1;
_vram_info.height = recording ? (video_mode_resolution == 0 ? 974 :
video_mode_resolution == 1 ? 580 :
_vram_info.height = recording ? (video_mode_resolution == 0 ? 945 :
video_mode_resolution == 1 ? 720 :
video_mode_resolution == 2 ? 480 : 0)
: lv_dispsize > 1 ? 680
: shooting_mode != SHOOTMODE_MOVIE ? 704
: (video_mode_resolution == 0 ? 704 :
video_mode_resolution == 1 ? 680 :
: (video_mode_resolution == 0 ? 945 :
video_mode_resolution == 1 ? 720 :
video_mode_resolution == 2 ? (video_mode_crop? 480:680) : 0);
return &_vram_info;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment