Login  •  Register


The time is now: Fri Nov 15, 2019 4:04 pm

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 1 [ 23 posts ]
Print view Previous topic  |  Next topic
Author Message
PostPosted: Mon Feb 25, 2013 11:54 am 
Offline
Space Cadet

Joined: Mon Feb 25, 2013 11:48 am
Posts: 2
Hi.
I want to use some software in SheepShaver but it appears to have a date expiration because it'll work when I put the host Mac's clock back. Is there any way I can have the time in SheepShaver work independently of the host system? Thanks.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 25, 2013 12:14 pm 
Offline
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 5614
Location: Amsterdam, Netherlands
That is not possible through any regular user action. I am not sure it is possible at all, but maybe someone with programmer skills can edit the source code with regard to the date and time synchronization and then build SheepShaver from the edited code.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 25, 2013 12:30 pm 
Offline
Space Cadet

Joined: Mon Feb 25, 2013 11:48 am
Posts: 2
A pity. Thanks anyway!


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Nov 13, 2013 5:27 am 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2719
Location: Emaculation.com
Churning my way through old threads...

There's another way (other than compiling a custom SS with a transform function) to change the date only inside the emulator: change it at the system level. Hack the system resource with ResEdit that interprets the start date of the epoch, and you've effectively changed the time. All the OS gets from the chip is the tick count; it's the OS that converts this into something usable. So as long as the software is taking a p-string and not a tick count, you should be able to fake an earlier date and have it work.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue May 24, 2016 3:25 pm 
Offline
Space Cadet

Joined: Mon Apr 27, 2015 9:56 pm
Posts: 7
Hi all,
I know it's a rather old thread, but the issue remains.
I have the same issue with some old software that has been abandoned long ago and the software companies are defunct.
So there is no way expiring codes could ever be made to work and they can't be updated, so the only way is to set that clock back.
Could someone explains a bit more how to do this?
Editing something with resedit seems feasible, but what to edit? where?
Thanks


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed May 25, 2016 7:29 am 
Offline
Apple Corer

Joined: Sun Feb 01, 2009 4:55 pm
Posts: 269
I'd say to disable time synchronization on the host OS, but I'm not sure if Mac OS X allows it. Definitely want to do that to allow you to change the time manually.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed May 25, 2016 9:39 am 
Offline
Tinkerer

Joined: Wed Jan 27, 2016 12:25 pm
Posts: 99
This would be my advice:

- Set up SS in a new user account (with admin privileges)
- Log out of your main account and into the new account
- turn Time Machine off
- in SysPrefs Date & Time uncheck "Set date and time automatically"
- manually set the date and time to what you want it to be and run SS (but no other OS X software)
- when finished, don't forget to re-check "Set date and time automatically" before logging out

It's cumbersome but will be worth it if that software is of value to you.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed May 25, 2016 6:06 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2719
Location: Emaculation.com
Does "Network Time" by Pete Resnick work inside SheepShaver? This might allow you to enforce a time change, or set up a rogue NTP server to feed an older time.

Alternatively, let us know what piece of software is expiring, and I'll see if I can use ResHacker to find a patch for it. One of the old school serials/patch tools might also have a patch for older software. Finding an old version of Serial Box may be a bit difficult however.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Jan 29, 2019 12:59 am 
Offline
Tinkerer

Joined: Sun Nov 19, 2006 6:01 pm
Posts: 84
Location: Belgium
I am going to severely necro this thread to state that supporting a different time inside the guest OS would be a very useful feature. Any attempt to change the clock inside the emulated OS will immediately cause the clock to jump back to the host computer's clock. Currently the only way to time travel inside the guest OS is to turn back the clock of the host computer. Not only is this cumbersome, it also makes some processes on the host go haywire, especially anything involving certificates.

I'm now trying to play King's Quest V for the first time in ages and apparently many of these Sierra games have a ‘year 1993 bug’ that causes them to stop working after September 18th of that year. There is a patch available that tries to fix this, but obviously the patch only shifts the problematic year and the game again hangs on the intro screen unless I turn back my computer's clock to before 2010.
Also to be able to enter my old registration code for EV Nova, I had to turn back the clock to within a few days after the code was originally issued. There are probably many other examples and if Sheepshaver is still in use in the year 2040, then this feature might become a necessity!

I think the most practical solution would be a config item that applies an offset to the clock of the OS inside SheepShaver. Then I could for instance make a specific VM to play those Sierra games.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Jan 29, 2019 7:08 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2719
Location: Emaculation.com
The immediate solution to your problem is to run King's Quest V using ScummVM on your main system instead of attempting to run it inside SheepShaver; ScummVM doesn't have the bugs that the original SCI interpreter on Mac OS had.

As for running SheepShaver with a particular date and time, you can do so using RunAsDate from Nirsoft on Windows; I haven't figured out how to do this on OS X or Linux. You can write a script that temporarily changes the date during launch, but as you say, SheepShaver patches in the time from the host, so the time will jump back on first clock sync.

One thing you could do is modify https://github.com/cebix/macemu/blob/2e ... s_util.cpp so that TimetoMacTime has const int MAC_EPOCH_YEAR changed from 1904 to 1874. This build will always put you 30 years in the past.

It should theoretically also be possible to add a prefs value so you can set this in prefs when you boot, if someone wants to do that.

[edit] to do that, you'd need to add MAC_EPOCH_YEAR to https://github.com/cebix/macemu/blob/ma ... _items.cpp and update prefs_items.h and then include prefs_items.h in macos_util.cpp. That way, the epoch year will be pulled from the prefs file (defaulting to 1904) instead of from the value currently set in macos_util.cpp.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 30, 2019 1:25 pm 
Offline
Tinkerer

Joined: Sun Nov 19, 2006 6:01 pm
Posts: 84
Location: Belgium
I didn't know about ScummVM, thanks for pointing that out. It seems it also supports quite a few other games of which I still have the diskettes or CDs, including ‘The Beast Within’ which I never managed to finish because the Mac game engine was rife with bugs. Still, the option to shift the date would be nice so maybe I'll try to make it a configurable option.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Feb 05, 2019 9:54 am 
Offline
Tinkerer

Joined: Thu Nov 09, 2017 12:06 pm
Posts: 94
I have implemented a preference item named "yearofs".

https://github.com/kanjitalk755/macemu

If you want to go to 1989, append following line to ~/.sheepshaver_prefs.
Code:
yearofs 30

But this option is very dangerous.
For example, the old and new relation of files may be reversed.
Normal user shouldn't use this item.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Feb 05, 2019 10:47 am 
Offline
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 5614
Location: Amsterdam, Netherlands
Thanks. I will post a build with this option later and I will then add it to the setup guide with a warning.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Feb 06, 2019 5:23 pm 
Offline
Tinkerer

Joined: Sun Nov 19, 2006 6:01 pm
Posts: 84
Location: Belgium
kanjitalk755 wrote:
I have implemented a preference item named "yearofs".

https://github.com/kanjitalk755/macemu

If you want to go to 1989, append following line to ~/.sheepshaver_prefs.
Code:
yearofs 30

But this option is very dangerous.
For example, the old and new relation of files may be reversed.
Normal user shouldn't use this item.


Nice, but could this be changed to an offset in days? This would allow to more precisely set the date inside the emulator.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Feb 06, 2019 6:57 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2719
Location: Emaculation.com
This would be difficult, because the shift is done by changing the epoch year, such that 0 starts +/- January 1, 1904. You should be able to set the time into the future by adding a negative value, and you *may* be able to change the day based on using a decimal value (although I haven't tested that and depending on implementation it may just fail), but what you're doing here is changing what year time starts on, not doing an after-the-fact calculation of the time.

For specific date, you'd have better luck temporarily changing the date on the host machine and doing it that way.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Feb 06, 2019 10:38 pm 
Offline
Tinkerer

Joined: Sun Nov 19, 2006 6:01 pm
Posts: 84
Location: Belgium
adespoton wrote:
This would be difficult, because the shift is done by changing the epoch year, such that 0 starts +/- January 1, 1904. You should be able to set the time into the future by adding a negative value, and you *may* be able to change the day based on using a decimal value (although I haven't tested that and depending on implementation it may just fail), but what you're doing here is changing what year time starts on, not doing an after-the-fact calculation of the time.

Unless I'm missing something here, isn't it only a matter of adding the chosen day offset (negative = the past) to the ‘days’ variable in TimeToMacTime(), possibly with some extra bounds checking?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Feb 06, 2019 11:32 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2719
Location: Emaculation.com
That could be done, but that would have to either be an entirely new function to tie it together with year, or we'd need to do two settings, adding dayofs as well as yearofs. Possible, but not by modifying the current change.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Feb 07, 2019 3:06 am 
Offline
Tinkerer

Joined: Thu Nov 09, 2017 12:06 pm
Posts: 94
DrLex wrote:
Nice, but could this be changed to an offset in days? This would allow to more precisely set the date inside the emulator.

I understand that the "yearofs" is useful to avoid bugs of certain older applications.
However, I don't know how useful the "dayofs" is.
Moreover, it is difficult to set this by mental arithmetic.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Feb 07, 2019 4:49 pm 
Offline
Tinkerer

Joined: Sun Nov 19, 2006 6:01 pm
Posts: 84
Location: Belgium
kanjitalk755 wrote:
DrLex wrote:
Nice, but could this be changed to an offset in days? This would allow to more precisely set the date inside the emulator.

I understand that the "yearofs" is useful to avoid bugs of certain older applications.
However, I don't know how useful the "dayofs" is.
Moreover, it is difficult to set this by mental arithmetic.

Most often when I need to change the date inside the emulator it really needs to be more accurate than within a year. I don't want to change the clock on the host computer because then the risk of inconsistent file dates spreads to the host system which is much worse than inside the emulator only.
Since this is an advanced feature anyway, an advanced user won't mind having to use an online date calculator to know the number of days between today and a specific target date. The yearofs can be kept for coarse date offsets, with optional dayofs added on top for finer date changes.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Feb 07, 2019 5:50 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1092
Perhaps you could run SheepShaver inside a VM (VMware, VirtualBox) and change the date of the VM? Without knowing exactly why you need a specific date in SheepShaver (rather than just turning back the clock a certain number of years), it's hard to justify asking kanjitalk755 or anyone else to go to the trouble of changing the code.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sat Feb 09, 2019 10:29 pm 
Offline
Tinkerer

Joined: Sun Nov 19, 2006 6:01 pm
Posts: 84
Location: Belgium
emendelson wrote:
Perhaps you could run SheepShaver inside a VM (VMware, VirtualBox) and change the date of the VM? Without knowing exactly why you need a specific date in SheepShaver (rather than just turning back the clock a certain number of years), it's hard to justify asking kanjitalk755 or anyone else to go to the trouble of changing the code.

Wrapping an emulator inside an entire VM merely to change dates seems a bit inefficient.

I have implemented the change myself and created a pull request to merge this into kanjitalk755's branch. It adds another item dayofs that works together with yearofs to allow finer-grained date offsets. The code prevents users from trying to cross the 1904-01-01 boundary with too large an offset.
Feel free to reject this if deemed unnecessary. In my own SS build I can now at least, without messing up my main computer's clock,
  • register EV Nova and other games with my own registration keys;
  • trigger or hunt for date-based easter eggs, like the one in KanjiTalk (the software, not the forum member!);
  • play Sierra games in exactly the same way as I did 27 years ago if I want to maximize nostalgia;
  • see if something weird happens on February 6, 2040;


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Feb 10, 2019 2:23 am 
Offline
Tinkerer

Joined: Thu Nov 09, 2017 12:06 pm
Posts: 94
I have merged your PR.

I only considered subtracting from year, so I reversed the sign of yearofs.
However, by introducing dayofs, I felt discomfort with it.
Therefore, I have changed the sign of yearofs and dayofs to be natural.

In both, set plus value to increase, minus to decrease.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Feb 10, 2019 3:06 pm 
Offline
Tinkerer

Joined: Sun Nov 19, 2006 6:01 pm
Posts: 84
Location: Belgium
Thanks!


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 1 [ 23 posts ]


Who is online

Users browsing this forum: No registered users and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group