Posted: 12:27pm 22 Sep 2022 |
|
|
|
Hello,
yesterday I build the VGA PicoMite from the Silicon Chip Kit. So there is an SD-Card, VGA and PS/2 connector. Everything works well.
As early microcomputers like the TRS-80 this setup does not have a RTC on board and I had to set the time$ and date$ manually.
I could add an RTC module, but I want to keep the PicoMite as simple as possible.
The idea is to autorun some code to set time$ and date$ at boot. The only mechanism I found in the handbook was to use some mm.startup sub which has to be in the flash somewhere when the pico boots.
I wrote 2 files: autorun.bas and mmstartup.bas and stored them on the sd-card.
In autorun.bas are all commands I want to execute at startup and in mmstartup.bas is the definition of sub mm.startup which calls autorun.bas.
I placed the mmstartup.bas into flash 1 to load it at the end of the day with a flash load 1 and then switching off the VGA PicoMite. At the next boot the Sub will be in memory and found by the firmware.
If someone knows a better way (like CMM2) I would be glad to hear! I think taking care of some mm.startup sub every time I switch off the picomite is not very elegant. May be I simply don't understand how the "autostart" should work normally?!
' mmstartup.bas - prepare next boot ' (2022) Andreas Mueller, Gerolsbach ' Sub mm.startup Run "autorun.bas" End Sub
' autorun.bas ' startup program - will be started when picomite boots ' (2022) Andreas Mueller, Gerolsbach
Dim T$,D$ As String = ""
Do Input "Time: (hh:mm:ss)"; T$ On error skip 1 Time$ = T$ Loop Until MM.Errno = 0
Do Input "Date: (dd-mm-yyyy)"; D$ On error skip 1 Date$ = D$ Loop Until MM.Errno = 0
Run "mmstartup.bas" ' restore mm.startup sub End
-andreas Edited 2022-09-22 23:01 by andreas |