-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
1 changed file
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
from amitools.vamos.libcore import LibImpl | ||
from amitools.vamos.machine.regs import * | ||
from amitools.vamos.astructs import * | ||
|
||
from datetime import datetime | ||
|
||
class TimerDevice(LibImpl): | ||
|
||
pass | ||
def ReadEClock(self, ctx): | ||
eclockval = ctx.cpu.r_reg(REG_A0) | ||
|
||
dt = datetime.now() | ||
|
||
# abuse DateStampStruct | ||
tv = AccessStruct(ctx.mem, DateStampStruct, struct_addr = eclockval) | ||
tv.ds_Days = dt.microsecond / 1000000 | ||
tv.ds_Minute = dt.microsecond % 1000000 | ||
|
||
return 50 |