Skip to content

Commit

Permalink
added ReadEClock in timer.device (@bebbo #151)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnvogelg committed Mar 4, 2021
1 parent 18fe317 commit 7147d51
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion amitools/vamos/lib/TimerDevice.py
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

0 comments on commit 7147d51

Please sign in to comment.