Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Created February 12, 2024 23:40
Show Gist options
  • Save cleverca22/2f443a175ba76c6b12d636c0c74b8c15 to your computer and use it in GitHub Desktop.
Save cleverca22/2f443a175ba76c6b12d636c0c74b8c15 to your computer and use it in GitHub Desktop.
uint hdmi_close(void)
{
uint uVar1;
int iVar2;
uint uVar3;
code *pcVar4;
gp_area *gp;
undefined4 local_20;
rtos_latch_get_real(&gp->field_0x878);
uVar3 = (gp->hdmi_state).field_0x4;
if (uVar3 != 0) {
uVar3 = uVar3 - 1;
(gp->hdmi_state).field_0x4 = uVar3;
if (uVar3 == 0) {
uVar3 = read_volatile_4(0x7e9020a0);
write_volatile_4(0x7e9020a0,uVar3 & 0xfffeffff);
write_volatile_4(0x7e902350,0x1ffff);
(gp->hdmi_state).field_0x58 = 8;
memset(&(gp->hdmi_state).field_0x5c,0,0x40);
pcVar4 = *(code **)(*(int *)&(gp->hdmi_state).fun_table + 0x14);
(*pcVar4)(*(undefined4 *)&(gp->hdmi_state).field_0x50,0x68,0,pcVar4);
(**(code **)(*(int *)&(gp->hdmi_state).fun_table + 0x10))
(*(undefined4 *)&(gp->hdmi_state).field_0x50);
local_20 = 0;
rtos_register_lisr(0x68,(gp->hdmi_state).isr_hdmi0,&local_20);
*(undefined *)&(gp->hdmi_state).field_0xb6 = 0;
write_volatile_4(0x7e9022c0,0xf0000);
write_volatile_4(0x7e9022c0,0x1ff);
uVar1 = read_volatile_4(0x7e9022c4);
write_volatile_4(0x7e9022c4,uVar1 | 0x2000000);
uVar3 = read_volatile_4(0x7e9020c0);
write_volatile_4(0x7e9020c0,uVar3 & 0xfffffffe);
*(undefined *)&(gp->hdmi_state).field_0x28 = 0;
(gp->hdmi_state).field_0x34 = 0;
*(undefined *)&(gp->hdmi_state).field_0x2c = 0;
(gp->hdmi_state).field_0x30 = 0;
(gp->hdmi_state).field_0x18 = 0;
iVar2 = *(int *)&(gp->hdmi_state).field_0x20;
pcVar4 = *(code **)(iVar2 + 0x1c);
(*pcVar4)(*(undefined4 *)&(gp->hdmi_state).field_0x24,uVar1 | 0x2000000,iVar2,pcVar4);
(**(code **)(*(int *)&(gp->hdmi_state).field_0x20 + 0x10))
(*(undefined4 *)&(gp->hdmi_state).field_0x24);
sysman_set_user_request(*(undefined4 *)&(gp->hdmi_state).field_0x8,6,0,1);
}
}
rtos_latch_put_real(&gp->field_0x878);
return (gp->hdmi_state).field_0x4;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment