0 Members and 1 Guest are viewing this topic.
Disp "A:ROCKET MASS"Prompt ADisp "B:PREV RCKT VELOCITY"Prompt BDisp "PROPELLENT MASS"Prompt CDisp "D:PROPELLENT VELOCITY"Prompt DDisp "E:PLANET MASS"Prompt EDisp "F:END TIME"Prompt FDisp "G:INITIAL DISTANCE"Prompt G
;#####################################;The all inclusive typing routine;input: c = length; de = curRow; hl = buffer location;output:; b = length; de = byte after; hl = beginning; carry = quit; zero terminated string;destroys:; af, bc; 2 bytes after length of stringtyping: push hl ld (hl), e inc hl ld (hl), d inc hl ld (curRow), de push hl push bc bcall(_clrTxtShd) pop bc pop hl ld b, 0editEntry: set shiftAlpha, (iy + shiftFlags) res shiftLwrAlph, (iy + shiftFlags) set curAble, (iy + curFlags) typeLoop: call cursorOntypeLoop2: halt push hl bcall(_getCSC) pop hl or a jr z, typeLoop2 push af call cursorOff pop af cp skEnter jr nz, notEnter res curAble, (iy + curFlags) res shiftLwrAlph, (iy + shiftFlags) res shiftAlpha, (iy + shiftFlags) pop hl push hl ld de, 2 add hl, de pop de push de push bc ld c, b ld b, 0 ldir pop bc pop hl xor a ld (de), a retnotEnter: cp sk2nd jr nz, not2ndz res shiftLwrAlph, (iy + shiftFlags) res shiftAlpha, (iy + shiftFlags) jr typeLoopnot2ndz: cp skAlpha jr nz, notAlpha set shiftAlpha, (iy + shiftFlags) ld a, (iy + shiftFlags) xor %00000001 << shiftLwrAlph ld (iy + shiftFlags), a jr typeLoopnotAlpha: cp skLeft jr nz, notLeftdoLeft: ld a, b or a jp z, typeLoop dec b dec hl ld (hl), 0 ld de, (curRow) dec d jp p, notOffEdge ld d, 15 dec enotOffEdge: ld (curRow), de ld a, ' ' bcall(_putMap) jp typeLoopnotLeft: cp skDel jr z, doLeftnotDelete: cp skMode jr nz, notMode res curAble, (iy + curFlags) res shiftLwrAlph, (iy + shiftFlags) res shiftAlpha, (iy + shiftFlags) pop hl scf retnotMode: cp skClear jr nz, notClear ld a, b or a jp z, typeLoop pop hl push hl ld e, (hl) inc hl ld d, (hl) inc hl push hl push de ld (curRow), de push bc ld c, b ld b, 0 inc bc bcall(_memClear) pop bc ld a, ' 'clearLoop: bcall(_putC) djnz clearLoop pop de ld (curRow), de pop hl jp typeLoopnotClear: sub skAdd jp c, typeLoop cp skMath - skAdd + 1 jp nc, typeLoop push hl ld hl, numTable bit shiftAlpha, (iy + shiftFlags) jr z, setFound ld hl, lowTable bit shiftLwrAlph, (iy + shiftFlags) jr nz, setFound ld hl, charTablesetFound: ld e, a ld d, 0 add hl, de ld a, b cp c jr z, noMore ld a, (hl) or anoMore: pop hl jp z, typeLoop inc b ld (hl), a inc hl bcall(_putC) jp typeLoop cursorOn: res curOn, (iy + curFlags) jr readykcursorOff: set curOn, (iy + curFlags)readyk: ld a, 1 ld (curTime), a ei halt retCharTable: .db $22, "WRMH", 00, 00 .db "?", $5B, "VQLG", 00, 00 .db ":ZUPKFC", 00 .db " YTOJEB", 00, 00 .db "XSNIDA"NumTable: .db "+-*/^", 00, 00 .db $1A, "369)", 00, 00, 00 .db ".258(", 00, 00, 00 .db "0147,", 00, 00, 00, 00 .db $1C, 00, 00, $12, $11, 00lowTable: .db $22, "wrmh", 00, 00 .db "?", $5B, "vqlg", 00, 00 .db ":zupkfc", 00 .db " ytojeb", 00, 00 .db "xsnida"
For getting the text, here's an awesome routine I made.Code: [Select];#####################################;The all inclusive typing routine;input: c = length; de = curRow; hl = buffer location;output:; b = length; de = byte after; hl = beginning; carry = quit; zero terminated string;destroys:; af, bc; 2 bytes after length of stringtyping: push hl ld (hl), e inc hl ld (hl), d inc hl ld (curRow), de push hl push bc bcall(_clrTxtShd) pop bc pop hl ld b, 0editEntry: set shiftAlpha, (iy + shiftFlags) res shiftLwrAlph, (iy + shiftFlags) set curAble, (iy + curFlags) typeLoop: call cursorOntypeLoop2: halt push hl bcall(_getCSC) pop hl or a jr z, typeLoop2 push af call cursorOff pop af cp skEnter jr nz, notEnter res curAble, (iy + curFlags) res shiftLwrAlph, (iy + shiftFlags) res shiftAlpha, (iy + shiftFlags) pop hl push hl ld de, 2 add hl, de pop de push de push bc ld c, b ld b, 0 ldir pop bc pop hl xor a ld (de), a retnotEnter: cp sk2nd jr nz, not2ndz res shiftLwrAlph, (iy + shiftFlags) res shiftAlpha, (iy + shiftFlags) jr typeLoopnot2ndz: cp skAlpha jr nz, notAlpha set shiftAlpha, (iy + shiftFlags) ld a, (iy + shiftFlags) xor %00000001 << shiftLwrAlph ld (iy + shiftFlags), a jr typeLoopnotAlpha: cp skLeft jr nz, notLeftdoLeft: ld a, b or a jp z, typeLoop dec b dec hl ld (hl), 0 ld de, (curRow) dec d jp p, notOffEdge ld d, 15 dec enotOffEdge: ld (curRow), de ld a, ' ' bcall(_putMap) jp typeLoopnotLeft: cp skDel jr z, doLeftnotDelete: cp skMode jr nz, notMode res curAble, (iy + curFlags) res shiftLwrAlph, (iy + shiftFlags) res shiftAlpha, (iy + shiftFlags) pop hl scf retnotMode: cp skClear jr nz, notClear ld a, b or a jp z, typeLoop pop hl push hl ld e, (hl) inc hl ld d, (hl) inc hl push hl push de ld (curRow), de push bc ld c, b ld b, 0 inc bc bcall(_memClear) pop bc ld a, ' 'clearLoop: bcall(_putC) djnz clearLoop pop de ld (curRow), de pop hl jp typeLoopnotClear: sub skAdd jp c, typeLoop cp skMath - skAdd + 1 jp nc, typeLoop push hl ld hl, numTable bit shiftAlpha, (iy + shiftFlags) jr z, setFound ld hl, lowTable bit shiftLwrAlph, (iy + shiftFlags) jr nz, setFound ld hl, charTablesetFound: ld e, a ld d, 0 add hl, de ld a, b cp c jr z, noMore ld a, (hl) or anoMore: pop hl jp z, typeLoop inc b ld (hl), a inc hl bcall(_putC) jp typeLoop cursorOn: res curOn, (iy + curFlags) jr readykcursorOff: set curOn, (iy + curFlags)readyk: ld a, 1 ld (curTime), a ei halt retCharTable: .db $22, "WRMH", 00, 00 .db "?", $5B, "VQLG", 00, 00 .db ":ZUPKFC", 00 .db " YTOJEB", 00, 00 .db "XSNIDA"NumTable: .db "+-*/^", 00, 00 .db $1A, "369)", 00, 00, 00 .db ".258(", 00, 00, 00 .db "0147,", 00, 00, 00, 00 .db $1C, 00, 00, $12, $11, 00lowTable: .db $22, "wrmh", 00, 00 .db "?", $5B, "vqlg", 00, 00 .db ":zupkfc", 00 .db " ytojeb", 00, 00 .db "xsnida"This routine allows you to type letters, but you can remove that ability.Then, as far as making a number out of it. You could probably parse it yourself, and if you can't do that, you might be able to save it as a string and parse it into a TI float, though, I don't really know how to do that. (Probably undocumented.)
This routine allows you to type letters, but you can remove that ability.
;#####################################;The all inclusive typing routine;input: c = length; de = curRow; hl = buffer location;output:; b = length; de = byte after; hl = beginning; carry = quit; zero terminated string;destroys:; af, bc; 2 bytes after length of stringtyping: push hl ld (hl), e inc hl ld (hl), d inc hl ld (curRow), de push hl push bc bcall(_clrTxtShd) pop bc pop hl ld b, 0editEntry: set curAble, (iy + curFlags) typeLoop: call cursorOntypeLoop2: halt push hl bcall(_getCSC) pop hl or a jr z, typeLoop2 push af call cursorOff pop af cp skEnter jr nz, notEnter res curAble, (iy + curFlags) pop hl push hl ld de, 2 add hl, de pop de push de push bc ld c, b ld b, 0 ldir pop bc pop hl xor a ld (de), a retnotEnter: cp skLeft jr nz, notLeftdoLeft: ld a, b or a jp z, typeLoop dec b dec hl ld (hl), 0 ld de, (curRow) dec d jp p, notOffEdge ld d, 15 dec enotOffEdge: ld (curRow), de ld a, ' ' bcall(_putMap) jp typeLoopnotLeft: cp skDel jr z, doLeftnotDelete: cp skMode jr nz, notMode res curAble, (iy + curFlags) pop hl scf retnotMode: cp skClear jr nz, notClear ld a, b or a jp z, typeLoop pop hl push hl ld e, (hl) inc hl ld d, (hl) inc hl push hl push de ld (curRow), de push bc ld c, b ld b, 0 inc bc bcall(_memClear) pop bc ld a, ' 'clearLoop: bcall(_putC) djnz clearLoop pop de ld (curRow), de pop hl jp typeLoopnotClear: sub skChs jp c, typeLoop cp skComma - skChs + 1 jp nc, typeLoop push hl ld hl, numTablesetFound: ld e, a ld d, 0 add hl, de ld a, b cp c jr z, noMore ld a, (hl) or anoMore: pop hl jp z, typeLoop inc b ld (hl), a inc hl bcall(_putC) jp typeLoop cursorOn: res curOn, (iy + curFlags) jr readykcursorOff: set curOn, (iy + curFlags)readyk: ld a, 1 ld (curTime), a ei halt retNumTable: .db $1A, "369", 00, 00, 00, 00 .db ".258", 00, 00, 00, 00 .db "0147", $1B