TAPE85/ *recieving* wave data question.


[Prev][Next][Index][Thread]

TAPE85/ *recieving* wave data question.



Okay, I analysed the waveform data when sending information over good
quality tapes (new ones, type II, not the really expensive ones or
anything), and over a bit older ones. I don't see any serious problems as
to wrong data. A few correction checksums will take care of that. However,
I somehow can't get wave data into the calculator. I wrote this small
program that writes 15000 bytes of data over approx. 5 seconds into the
string TAPEDATA. Link it over to the pc and analyse it. However, depending
on the last OUT statement, that's what's passed back, and nothing more.

ie: if I out $C0 (11), that's exactly what's returned when I send it plain
wave data. if I OUTed the signature for 00, (forgot..), that's what I get.

ie, if i IN A, (7), AND 3, A is 11, 10, 01, or 00, depending on the last
OUT statement. Whatever I send to the link port, no data is actually being
recieved.. Probably a bug on my side. Anyone care to debug my code?

NB: New to the TI85.. not new to machine code.
NB2: the messages are a bit off for now. However, when you compile&run this
program, hit enter once, then connect your source of data, hit enter again,
and after approx. 5 secs (unturbo-ed 85), the program should quit. It makes
(or overwrites) the string variable TAPEDATA. Scroll down to ;**** START OF
LINK STUFF
to get to the actual area where I made a mistake, but can't figure out
what. I searched around for source reading wav files, but, alas, didn't
find any.

any help would be greatly appreciated.

;---------

;Meant for TASM (The Table assembler for Z80, not Turbo asm.).

;This code is meant to be compiled for The usgard operating system,
;for the TI-85 calculator.

;-------- T85LRECV- TAPE85Link Recieve v1.0 ----------
;source by Ray.

#INCLUDE "USGARD.H"             ;Basic usgard definitions and calls.
#INCLUDE "WINLIB.H"             ;Usgard windows utilities.
#INCLUDE "DISPLIB.H"            ;Usgard Number display utilities.

TString = $0C

.ORG 0
.DB     "TAPE85 Recv v1.0",0    ;Title.
.DB     WINLIB,DISPLIB,0        ;Libraries used.

R_Begn: LD IX,M_IntroToTR
        LD DE,(PROGRAM_ADDR)       ;DE -> Title. (from prog. header.)
        LD BC,$020C                ;Top Left.
        LD HL,$0C27                ;delta LR,TB.
        LD A,7                     ;disp T,C,focus.
        LIB_CALL_(WINLIB,WIN_PSHOW);Go!
        CALL OTH_PAUSE             ;Wait for a key.
R_001:  LD DE,T_TapeReady
R_002:  LD IX,M_TapeReady
        LD BC,$020C
        LD HL,$0C27
        LD A,7
        LIB_CALL_(WINLIB,WIN_PSHOW)
        CALL OTH_PAUSE
R_003:  LD DE,T_TapeReady
R_004:  LD IX,M_GetData
        LD BC,$020C
        LD HL,$0C27
        LD A,7
        LIB_CALL_(WINLIB,WIN_PSHOW)

        ;listening for the synchronize signature.

R_005:  LD HL, VarStoreN        ;->Name
        CALL VAR_DELETE
R_008:  LD HL, VarStoreN
        LD BC, 15000            ;Size
        LD A, TString           ;Type
        CALL VAR_NEW
        JR NC, VarOk
R_006:  LD DE,T_Error
R_007:  LD IX,M_Outofmem
        LD BC,$020C
        LD HL,$0C27
        LD A,7
        LIB_CALL_(WINLIB,WIN_PSHOW)
        CALL OTH_PAUSE
        CALL OTH_EXIT

;**** START OF LINK STUFF

VarOk:  LD D, $3A
        LD E, $98        ;load 1500 into DE. ($3A98)
        LD A, $FC
        OUT (7), A        ;send 00 to the linkport.

Lp1:    IN A, (7)        ;get data at linkport.
        LD (HL),A        ;write to memory.
        INC HL            ;increase position in memory.
        DEC DE          ;decrease bytes-to-go.
        LD A, 80          ;a small loop. with 80, total time is ca.5 sec.
Lp2:    DEC A
        JR NZ, Lp2
        LD A, D           ;check for DE=0.
        OR E
        JR NZ, Lp1       ;if not, repeat it all.

        LD A, $C0        ;send the standard 11.
        OUT (7), A
        JP OTH_EXIT                ;exit the program.

;******* end of the link business.

M_IntroToTR:
 .dB    XTAB,7,"The official TAPE85",LF
 .dB    XTAB,6,"Tape -> TI loader by",LF
 .dB    XTAB,28,"Ray Z.",LF

T_TapeReady:
 .dB    "T85LRECV infoscreen.",0
M_TapeReady:
 .dB    XTAB,2,"Set up cable and tape,",LF
 .dB    XTAB,2,"Hit <enter> BEFORE play.",0

M_GetData:
 .dB    XTAB,2,"Listening to tape...",LF
 .dB    XTAB,2,"Status: "
 .dB    "                    ",0      ;20 blanks.

T_Error:
 .dB    "Error!",0

M_Outofmem:
 .dB    "Out of memory!",LF
 .dB    "You need 15000 bytes",0

VarStoreN:
 .dB    "TAPEDATA",0
.end


--
-R.Zwitserloot@BTInternet.com