Skip to content

Commit

Permalink
nvbios: add more fields to P.unk50 table
Browse files Browse the repository at this point in the history
  • Loading branch information
karolherbst committed May 13, 2016
1 parent 9c26704 commit a1eda44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion nvbios/bios.h
Original file line number Diff line number Diff line change
Expand Up @@ -968,8 +968,10 @@ struct envy_bios_power_unk4c {
struct envy_bios_power_unk50_entry {
uint16_t offset;

uint16_t t0;
uint8_t mode;
uint16_t downclock_t;
uint16_t t1;
uint16_t t2;
};

struct envy_bios_power_unk50 {
Expand Down
11 changes: 7 additions & 4 deletions nvbios/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,8 +1079,10 @@ int envy_bios_parse_power_unk50(struct envy_bios *bios) {
struct envy_bios_power_unk50_entry *e = &unk50->entries[i];

e->offset = unk50->offset + unk50->hlen + i * unk50->rlen;
bios_u16(bios, e->offset + 0x2, &e->t0);
bios_u16(bios, e->offset + 0x6, &e->t1);
bios_u8 (bios, e->offset + 0x0, &e->mode);
bios_u16(bios, e->offset + 0x2, &e->downclock_t);
bios_u16(bios, e->offset + 0x4, &e->t1);
bios_u16(bios, e->offset + 0x6, &e->t2);
}

return 0;
Expand All @@ -1104,10 +1106,11 @@ void envy_bios_print_power_unk50(struct envy_bios *bios, FILE *out, unsigned mas
for (i = 0; i < unk50->entriesnum; i++) {
struct envy_bios_power_unk50_entry *e = &unk50->entries[i];

if (e->t0 == 0 && e->t1 == 0)
if (e->downclock_t == 0)
continue;

fprintf(out, "-- entry %i, t0 %.2f, t1 %.2f\n", i, (double)e->t0 / 32, (double)e->t1 / 32);
fprintf(out, "-- entry %i, mode %i, donwclock_t %.2f, t1 %.2f, t2 %.2f\n",
i, e->mode, (double)e->downclock_t / 32, (double)e->t1 / 32, (double)e->t2 / 32);

envy_bios_dump_hex(bios, out, unk50->entries[i].offset, unk50->rlen, mask);
if (mask & ENVY_BIOS_PRINT_VERBOSE) fprintf(out, "\n");
Expand Down

0 comments on commit a1eda44

Please sign in to comment.