Jump to content
  • entries
    6
  • comments
    0
  • views
    791

Reading FujiNet Date/Time into Sparta DOS 3.2g


Darken99

121 views

Whenever I booted my Sparta DOS 3.2g disk was entering the current date and time manually. It was usually quick, but sometimes I didn't have the time handy. However, my Atari's (130XE and 576NUC+) both have FujiNet. When I saw on the FujiNet Wiki that you can get the current date and time from the internet (https://tinyurl.com/2r5vae5v) I decided that I had a new assembler project...

 

I am still (gradually) working my way through Atari Roots (https://tinyurl.com/4ea7vac8), so I have a lot to learn. I also needed to find out more about how Sparta Dos handled date and time. This led me to the Sparta DOS Construction Set, especially the R-Time 8 supplement - both found on the Serious Computerist website (https://tinyurl.com/3efmbwt8). It took a little while to figure it out, but it was a great chance to try out my MAC/65 & DDT cartridge image (via my A8picoCart). Among the things I learned:

 

1) DDT does not like to work on Page 6

2) You can hang MAC/65 by picking an assembly address too close to MEMLO

3) Indirect indexed addressing is very useful, and not covered in The Atari Assembler (by Don Inman & Kurt Inman). Luckily, it is in Atari Roots (though briefly).

 

In the end, I replaced my Date and Time calls in the STARTUP.BAT file with a FUJITD.COM file built from the following code:

                10 ;LIST#D:FUJITD.ASM
                20 ;
                30       .OPT OBJ
0000            40       *=  $4000
                50 ;
4000 4C0940     60       JMP START
                70 ;
                80 ;--- DATA & CONSTANTS ---
                90 ;
                0100 ; SD TIME VECTORS
    =FFC0       0110 VGETTD = $FFC0  ; GET TD
    =FFC3       0120 VSETTD = $FFC3  ; SET TD
    =FFC6       0130 VTDON = $FFC6   ; TD ON/OFF
    =FFC9       0140 VFMTTD = $FFC9  ; GET TD FMT
    =000A       0150 COMTAB = $0A    ; DOSVEC
                0160 ;
                0170 ; TIME TO SET
                0180 ; D/M/Y H/M/S
                0190 ;
4003            0200 DATETIME
                0210 ; DAY/MONTH/YEAR
4003 010101     0220     .BYTE $01,$01,$01
                0230 ; HOUR/MINUTE/SECOND
4006 000001     0240     .BYTE $00,$00,$01
                0250 ;
                0260 ;-- MAIN --
                0270 ;
4009            0280 START
                0290 ;
                0300 ; SET IODCB
                0310 ;
4009 A945       0320     LDA #$45    ; APETIME ID
400B 8D0003     0330     STA $0300   ; DDEVIC
400E A901       0340     LDA #$01    ;
4010 8D0103     0350     STA $0301   ; DUNIT
4013 A993       0360     LDA #$93    ; GETTIME
4015 8D0203     0370     STA $0302   ; DCOMND
4018 A940       0380     LDA #$40    ; RECEIVE
401A 8D0303     0390     STA $0303   ; DSTATS
401D A903       0400     LDA #DATETIME&255
401F 8D0403     0410     STA $0304   ; DBUFLOW
4022 A940       0420     LDA #DATETIME/256
4024 8D0503     0430     STA $0305   ; DBUFHI
4027 A906       0440     LDA #$06    ; # BYTES
4029 8D0803     0450     STA $0308   ; DBYTLO
402C A900       0460     LDA #$00    ;
402E 8D0903     0470     STA $0309   ; DBYTHI
4031 A9EE       0480     LDA #$EE    ;
4033 8D0A03     0490     STA $030A   ; DAUX1
4036 A9A0       0500     LDA #$A0    ;
4038 8D0B03     0510     STA $030B   ; DAUX2
403B A900       0520     LDA #$00    ;
403D 8D0703     0530     STA $0307   ; DUNUSE
4040 A90F       0540     LDA #$0F    ; 15 SEC.
4042 8D0603     0550     STA $0306   ; DTIMLO
                0560 ;
                0570 ; GET FUJINET DATE TIME
4045 2059E4     0580     JSR $E459   ; CALL SIOV
                0590 ;
                0600 ;
                0610 ; LOAD NEW DATE/TIME
                0620 ;
4048 A200       0630     LDX #0
404A A00D       0640     LDY #$0D
404C            0650 DTPUT
404C BD0340     0660     LDA DATETIME,X
404F 910A       0670     STA (COMTAB),Y
4051 E8         0680     INX 
4052 C8         0690     INY 
4053 E006       0700     CPX #6
4055 D0F5       0710     BNE DTPUT
                0720 ;
                0730 ; CALL TD SET ROUTINE
                0740 ;
4057 AD01D3     0750     LDA $D301   ;PIA
405A 48         0760     PHA         ;PUSH PORT
405B 29FE       0770     AND #$FE    ;BIT 0 OFF
405D 8D01D3     0780     STA $D301   ;ENABLE RAM
4060 20C3FF     0790     JSR VSETTD  ;CALL SET TD
4063 68         0800     PLA         ;POP PORT
4064 8D01D3     0810     STA $D301   ;RESTORE PORT
                0820 ;
4067 60         0830     RTS 
4068            0840     .END 

 

It works on both of my machines, but I'd love to hear any suggestions for improvement to make the code more robust, compact, or both. I've attached the files in *.ATR format for others to play or use. Regardless, thanks for taking the time to look this over.

FUJITD.atr
 

 

 

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...