static void readtimezone(void) { char buf[TZSIZE*11+30], *p; int i; memset(buf, 0, sizeof(buf)); i = open("/env/timezone", 0); if(i < 0) goto error; if(read(i, buf, sizeof(buf)) >= sizeof(buf)) goto error; close(i); p = buf; if(rd_name(&p, timezone.stname)) goto error; if(rd_long(&p, &timezone.stdiff)) goto error; if(rd_name(&p, timezone.dlname)) goto error; if(rd_long(&p, &timezone.dldiff)) goto error; for(i=0; i<TZSIZE; i++) { if(rd_long(&p, &timezone.dlpairs[i])) goto error; if(timezone.dlpairs[i] == 0) return; } error: timezone.stdiff = 0; strcpy(timezone.stname, "GMT"); timezone.dlpairs[0] = 0; }
/* Read hardware parameter block from image. */ int ti68k_get_hw_param_block(uint8_t *rom_data, uint8_t rom_base, HW_PARM_BLOCK *s) { int i = 0; uint32_t addr; addr = rd_long(&rom_data[0x104]); addr &= 0x000fffff; memset(s, 0, sizeof(HW_PARM_BLOCK)); s->len = rd_word(&(rom_data[addr+0])); if(s->len > 2+(4*i++)) s->hardwareID = rd_long(&(rom_data[addr+2])); if(s->len > 2+(4*i++)) s->hardwareRevision = rd_long(&(rom_data[addr+6])); if(s->len > 2+(4*i++)) s->bootMajor = rd_long(&(rom_data[addr+10])); if(s->len > 2+(4*i++)) s->bootRevision = rd_long(&(rom_data[addr+14])); if(s->len > 2+(4*i++)) s->bootBuild = rd_long(&(rom_data[addr+18])); if(s->len > 2+(4*i++)) s->gateArray = rd_long(&(rom_data[addr+22])); if(s->len > 2+(4*i++)) s->physDisplayBitsWide = rd_long(&(rom_data[addr+26])); if(s->len > 2+(4*i++)) s->physDisplayBitsTall = rd_long(&(rom_data[addr+30])); if(s->len > 2+(4*i++)) s->LCDBitsWide = rd_long(&(rom_data[addr+34])); if(s->len > 2+(4*i++)) s->LCDBitsTall = rd_long(&(rom_data[addr+38])); if((s->hardwareID == HWID_V200) && (rom_base == 0x40)) { tiemu_info(_("Detected V200 patched ROM (ExtendeD): emulated as TI92+ by changing the hwID from 8 to 1.")); s->hardwareID = HWID_TI92P; } if((s->hardwareID == HWID_TI89T) && (rom_base == 0x20)) { tiemu_info(_("Detected TI89 Titanium patched ROM (ExtendeD): emulated as TI89 by changing the hwID from 9 to 3.")); s->hardwareID = HWID_TI89; } return 0; }