Territory_ReadTimeZones giving constant results
Sprow (202) 1158 posts |
Having loaded a couple of territory modules up (in addition to the UK), I want to build a list of known timezones. Calling Territory_ReadTimeZones for each loaded territory module returns the appropriate local names for DST/NoDST but always returns 0h and 1h for the offsets from UTC. Looking at the code, regardless of territory, it loads the timezone offset from CMOS, multiplies by 15*60*100 (to get it into centiseconds) and then adds the difference between DST and NoDST to it – and then returns that in R2 and R3. That seems wrong: it should be returning the constants from its table (as though the territory was in use) not the timezone that is currently set. I propose to fix it by just returning the offsets in R2 and R3 as though the territory were in force just like the text in R0 and R1 is. While I think about it (this bit’s not a bug, yet) there’s no API to get a list of timezones for territories that are wide enough to span several. As there’s a proposal to up the number of territories to 1024 this could just be swept under the carpet by allocating one territory per timezone (for Brazil, USA, Canada, Russia, Australia) but then producing international versions of things would require lots of duplication of resources (eg. messages files in the ROM, res files on disk for Toolbox stuff). Since R0 is a 32 bit value and we only need 10 bits for the territory number there’s plenty of spare reason codes bits to extend the API. |