Best Times Procedures
- Owner:
C.K. Liang
- Purpose: Reads from
the data file to a segment, overwrites the segment and write to the
file only if the finishing time beats any of top three times, then displays
the segment to the screen.
- Inputs:
- _TrackChoice
= track selected and finished
- _Minute
= minute of the time that player finishes the race
- _Second
= second of the time
- _TenthOfSecond = tenths of a second
of the time
- Outputs:
- possibly modified data file
- ScrSeg
= segment to store the array of bytes
- ScratchPad = offset of the
array
- display to the screen the current
top three scores with people's names
Variables
- HighSc1, string of
name of data file for track 1 best times record
- HighSc2, for track 2
- HighSc3, for track 3
- HighSc4, for track 4
- OffSetTrack, offset to the
string containing the filename
- ScLength, number of bytes
to be stored or retrieved
- ReadScore
- Owner:
C.K. Liang
- Purpose: Reads from
the data file to a segment
- Input:
dx = offset of the data filename to read from
- Outputs:
- ScrSeg = segment
which is written to
- ScLength = number of bytes read
from the file
- WriteScore
- Owner: C.K.
Liang
- Purpose: Writes to
a data file from a segment
- Inputs:
- dx
= offset of the string containing the filename
- ScLength = number of bytes to write
- Output: Modified
data file
- ChangeSeg
- Owner: C.K.
Liang
- Purpose: Overwrites
certain part of the ScrSeg segment with the key input from the user at
the DOS prompt
- Inputs:
- di - offset of the segment to write
to
- ScrSeg - segment to write to
- Key input
- _Minute, _Second, TenthOfSecond
- Output: Modified ScrSeg
segment
- Note: Calls KBDIN subroutine
from 291 library
- CompareTime
- Owner: C.K.
Liang
- Purpose: Compares the specific
time in segment with finishing time
- Inputs:
- di = offset of the first byte at
that line
- es = segment of ScrSeg
- _Minute, _Second, _TenthOfSecond
- Outputs: bx - 1 if _Minute,
_Secound, _TenthOfSecond is smaller, 0 otherwise
- PushLine
- Owner:
C.K. Liang
- Purpose: Shifts certain
bytes in the segment by 65 bytes to the next line as in DOS display to
leave a line for the current record
- Inputs:
- di = offset of the segment to begin
the shifting
- es = segment
- Output: Modified
segment
- Note:
Some bytes are lost or the segment doesn't need a change at all
- _CheckBestTime
- Owner: C.K.
Liang
- Purpose: Checks for Best
Time and inserts name and finishing time to a line (as in DOS display)
in the data file
- Inputs:
- _TrackChoice = track chosen and
finished
- ScSeg
- Output: Displays the
updated highest scores achieved so far
- Note: Calls PushLine, ReadScore,
CompareTime, PushLine, ChangeSeg, WriteScore, DspOut (in 291 library)