Skip to content
Permalink
Browse files

nvbios: add more fields to P.unk50 table

  • Loading branch information
karolherbst committed May 13, 2016
1 parent 9c26704 commit a1eda440b6280050299e3b4c5fd35692d768bd47
Showing with 10 additions and 5 deletions.
  1. +3 −1 nvbios/bios.h
  2. +7 −4 nvbios/power.c
@@ -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 {
@@ -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;
@@ -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");

0 comments on commit a1eda44

Please sign in to comment.
You can’t perform that action at this time.