Author Topic: 84+/SE System Clock?  (Read 6887 times)

0 Members and 1 Guest are viewing this topic.

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
84+/SE System Clock?
« on: January 21, 2011, 09:05:54 pm »
Does anyone know how to get the system time on an 84+? I know how to get the battery state and free ram and some other stuff (thanks to wikiti) but i dont know how to get the time. Im assuming it will require Asm(hex).

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: 84+/SE System Clock?
« Reply #1 on: January 21, 2011, 09:07:51 pm »
Does anyone know how to get the system time on an 84+? I know how to get the battery state and free ram and some other stuff (thanks to wikiti) but i dont know how to get the time. Im assuming it will require Asm(hex).
Yes, well it's kinda complicated.  There are several ports that describe it.  And yes, it will require asm(

Look at this: http://wikiti.brandonw.net/index.php?title=83Plus:Ports:40

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: 84+/SE System Clock?
« Reply #2 on: January 21, 2011, 09:10:05 pm »
Code: [Select]
.Input is pointer to 4-byte area to write the 32-bit time value (little endian)
Asm(0E45EDA20CEDA20CEDA20CEDA2)
.Output is pointer+4, and time value is written to memory

Assembly source here:
Code: [Select]
ld c,$45
ini
inc c
ini
inc c
ini
inc c
ini
« Last Edit: January 21, 2011, 09:12:57 pm by calc84maniac »
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: 84+/SE System Clock?
« Reply #3 on: January 21, 2011, 09:10:23 pm »
O.o so i need to get a value from ports 45 thru 48 then?

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: 84+/SE System Clock?
« Reply #4 on: January 21, 2011, 09:13:35 pm »
Since Axe uses up to 65535, usually, you will probably have to deal with a simple timer. For example, doing Asm(DB456FDB4667 *should* store the current timer value mod 65536 in Ans.

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: 84+/SE System Clock?
« Reply #5 on: January 21, 2011, 09:22:11 pm »
Code: [Select]
.Input is pointer to 4-byte area to write the 32-bit time value (little endian)
Asm(0E45EDA20CEDA20CEDA20CEDA2)
.Output is pointer+4, and time value is written to memory

Assembly source here:
Code: [Select]
ld c,$45
ini
inc c
ini
inc c
ini
inc c
ini

Is there a way to format the output of this, and make it update? It doesnt appear to update within the program (its in a subroutine that is called once on each iteration of my main loop)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: 84+/SE System Clock?
« Reply #6 on: January 21, 2011, 09:24:07 pm »
I don't understand what you mean. Could I see the source code?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: 84+/SE System Clock?
« Reply #7 on: January 21, 2011, 09:30:31 pm »
K
Code: [Select]
Fix 0
Fix 5
Repeat getKey(15)
sub(TR)
DispGraphClrDraw //EDIT: This is also in there lol
End

Return

Lbl TR //time and RAM :)
Asm(EFE542EF9247EF5641)->R //RAM
Asm(0E45EDA20CEDA20CEDA20CEDA2)->T //time i guess
Text(0,56,R>Dec
Text(70,56,T>Dec //Without >dec it only displays a 4, with it it diplays some weird long number
Return
« Last Edit: January 21, 2011, 09:31:23 pm by Broseph Radson »

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: 84+/SE System Clock?
« Reply #8 on: January 21, 2011, 09:33:39 pm »
You have to put a pointer to the place to store to in the "last result". Example:
Code: [Select]
°A
Asm(0E45EDA20CEDA20CEDA20CEDA2)
Then A holds low 16 bits and B holds the high 16 bits.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: 84+/SE System Clock?
« Reply #9 on: January 21, 2011, 09:42:02 pm »
Oh i see what you mean by confusing. Ill be back later. Just got my n64 hooked up so imma play Goldeneye with my dad

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: 84+/SE System Clock?
« Reply #10 on: January 24, 2011, 05:28:32 pm »
OK finally got a chance to get back to this. I tried using that method and its one big long number ???

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: 84+/SE System Clock?
« Reply #11 on: January 27, 2011, 09:05:53 am »
Indeed. It is the number of seconds since January 1, 1970, making it equivalent to Unix time
You'll have to convert seconds into years, months, days, hours, minutes, and seconds. ;)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: 84+/SE System Clock?
« Reply #12 on: January 28, 2011, 12:02:43 pm »
Im trying to do something like the Basic GetTimeStr(12)

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: 84+/SE System Clock?
« Reply #13 on: January 28, 2011, 11:27:37 pm »
I think it's actually the number of seconds since January 1, 1997, and it's local time, not UTC.  So not exactly Unix time.

Quote
Im trying to do something like the Basic GetTimeStr(12)
What does that do?  I don't remember how the BASIC time functions work.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: 84+/SE System Clock?
« Reply #14 on: January 28, 2011, 11:29:07 pm »
Quote
Im trying to do something like the Basic GetTimeStr(12)
What does that do?  I don't remember how the BASIC time functions work.
That returns a string telling the time, normally.