Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dbfCn2BASICGet: ;INCOMPLETE
- ; Check to see if there is a frame.
- ; if there is parse the frame and write out
- ; id gets copied into the String
- ; List gets copied into the list
- ; we are sending raw variable data in the frames
- ; So if it is a list add it to a list if it is a string add it to a string
- ; MAKE SURE WE HAVE ENOUGH Ram for this
- ;Order of routine.
- ; Check for pending frame [x]
- ; MTROC ID string8
- ; Copy ID over
- ; Check Data Type
- ; MTROC Appropriate variable (LCn2,Str9)
- ; Copy Data over
- ; Clear Frame Pending
- ; Ret
- ld a,($86f8) ; load a with the incoming flag byte
- bit 7,a ; if the msb is set we have a frame
- jp z,xLIBEndNoOut ; if its not quit
- ld hl,IDrealName
- ld a,1 ;delete and create theta.
- ld (RVarLength),a
- call DeleteAndCreate
- push de ; save data pointer so we can write the id to it later
- ld a,(rdat) ; load a with frame id
- or a ;if 0 we have a string if one we have a list.
- jp nz,ldlist ; if list div length by nine
- ld a,(Rword)
- sub 1 ; if string calculate length
- ld (RVarLength),a
- ld hl,DataStringName
- jr Copydata
- ldlist:
- ld a,(rword)
- sub 1
- ld b,0
- Div9Loop:
- inc b
- sub 9
- jr z,Div9Done
- jr nc,div9loop
- Div9Done:
- ld a,b
- ld (RVarLEngth),a
- ld hl,DataListName
- CopyData:
- Call DeleteAndCreate
- ;get data length -1 -> bc
- ld a,(rword) ; get length from frame and store into bc
- sub 1
- ld c,a
- ld b,0
- ld hl,(rdat+1) ; load hl with pointer to frame+1 for variable data
- ldir
- pop de
- ;here i handle the real this should be rather easy
- ;we are interested in just the first 5 values in the mantessa
- ; the mantessa is de+2
- ; so lets initialise our variable
- ld hl,$0080 ;standard exponent and no negative? i think we will see
- inc de \ inc de
- ;Now the next 5 bytes are our id.
- ld bc,5
- ld hl,($86F3) ; recieve id
- ldir
- ;theta now has the user id in it
- ld hl,RWord+1
- res 7,(hl)
- ; aknowledge we got a frame and quit
- jp XlibEndNoOut
- DeleteAndCreate
- ;expects pointer to variable name in hl
- ;destroys all
- ;returns pointer to variable data in de
- push hl
- rst 20h ;load op1 with variable name
- bcall(_chkfindsym)
- jr c,create
- bcall(_DelVarArc) ;delete if since it exists
- Create:
- pop hl
- ld a,(hl)
- ld hl,(RVarLength)
- bcall(_createvar)
- ret
- DataStringName:
- .db strngOBJ,tVarStrng,tstr9,$0
- IDRealName:
- .db $0,tTheta,$0,$0
- DataListName:
- .db $01,tVarLst,tC,tN,t2,$0
Advertisement
Add Comment
Please, Sign In to add comment