getNew: ;beginpunt om een nieuwe reacteivergelijking in te voeren xor a ld (inLoadMenu), a ;call debuga xor a ld (bf2ndpage), a ld hl, bfIX ld bc, 40 call clear;reset wat variables die zometeen worden gebruikt getLoaded: ;beginpunt om een oude reactievergelijking te laten zien zodat hij gewijzigd kan worden(we hoeven niet alle variables te resetten, die staan al goed) xor a ld (inLoadMenu), a ; call debuga res textinverse, (iy + textflags) b_call (_ClrLCDFull) ld hl, $0300 ld (penCol), hl call resFont call dispBuffer xor a ld (lastkey), a ;ld (lastAction), a ld (lastActionSet), a ld a, (bf2ndpage);gwon niet 0 zodat ie refresh krijgt ld (prevNr), a _keyLoop: ;deze loop wordt telkens herhaald wanneer we een vergelijking aan het invullen zijn ld a, (lastActionSet) ld (lastAction), a xor a ld (lastActionSet), a nokeypress: b_call (_getCSC) ;krijg de code van de key die is ingedrukt or a jr z, nokeypress ;herhaal als er niks is ingedrukt ; cp skWindow ; jr nz, nietwi ; ld a, (bfix) ; call debuga ; jr _keyloop ;nietwi: ;push af ;ld a, (lastkey) ;call debuga ;pop af cp skClear jp z, prevpage cp skEnter jp z, submit ;met enter gaan we weer uit dit scherm cp skAlpha jp z, keyalphabtn cp skDown jp z, keyDown cp skUp jp z, keyUp cp skLeft jp z, keyLeft cp skRight jp z, keyRight cp sk2nd jp z, key2nd cp skDel jp z, keyDel cp skTrace jp z, _end cp skGraph jp z, keyGraph bit subScript, (IY + ShiftFlags) jr nz, keyNumCheck bit superScript, (IY + ShiftFlags) jr nz, keyNumCheck cp skAdd jp z, keyAdd cp skYEqu jp z, keyEqu bit other, (IY + ShiftFlags) jr nz, keyOtherCheck cp sk0;space jp z, keySpace keyAlphaCheck: sub skSub ;alles voor de 'W' eruit gooien jr c, _keyLoop cp skMath - skSub + 1;en alles na de 'A' jr nc, _keyLoop jp keyAlpha keyNumCheck: sub skAdd ;alles voor de '+' eruit gooien jr c, _keyLoop cp sk7 - skAdd + 1;en alles na de '7' jr nc, _keyLoop jp keyNum keyOtherCheck: cp skLParen jr nz, not1 ld a, $28 jp noBig not1: cp skRParen jr nz, not2 ld a, $29 jp noBig not2: cp skStore jp z, keyEqu jr keyAlphaCheck ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; alle functies die worden gecalled wanneer er een bepaalde key wordt ingedrukt ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; keyDel: ld a, lkDel ld (lastkey), a bit other, (iy + shiftflags) jr z, realDel call resFont bit insert, (iy + shiftFlags) jr z, setInsert res insert, (iy + shiftflags) jr setInsertEnd setInsert: set insert, (iy + shiftflags) setInsertEnd: call blink jp _keyloop realDel: ld a, (lastAction) cp laSetSmall jr nz, niet2 call ressmallfont niet2: ld a, (bfLength) or a jp z, _keyLoop ld a, (bfIX) ld hl, (bfLength) inc a cp l jp nc, lastChar ld a, l ld hl, (bfIX) sub l ld b, 0 ld c, a;bc = bfLength - bfIX ld a, (bfIX) ld hl, buffer ld d, 0 ld e, a add hl, de;hl = pos in buffer van char die gedelete moet worden ld d, h ld e, l ex de, hl;de = pos char inc hl; hl = de+1 ldir ;buffer is weer goed jr lastCharEnd lastChar: jr z, notOnChar dec a notOnChar: dec a ld (bfIX), a ld hl, buffer ld d, 0 ld e, a add hl, de ld (hl), 0 lastCharEnd: ld a, (bfLength);buflength -= 1; dec a ld (bfLength), a call checkprevpage b_call (_ClrLCDFull) call blink call dispBuffer jp _keyLoop key2nd: ld a, lk2nd ld (lastkey), a bit other, (IY + ShiftFlags) jr z, set2nd call resFont jr key2nd_ set2nd: call resFont set other, (IY + ShiftFlags) key2nd_: call blink jp _keyLoop keyDown: ld a, lkDown ld (lastkey), a bit other, (IY + ShiftFlags) jr nz, PageDown bit superScript, (IY + ShiftFlags) jr nz, keyAlphaBtn call resFont set subScript, (IY + ShiftFlags) call blink jp _keyLoop keyUp: ld a, lkUp ld (lastkey), a bit other, (IY + ShiftFlags) jr nz, PageUp bit subScript, (IY + ShiftFlags) jr nz, keyAlphaBtn call resFont set superScript, (IY + ShiftFlags) call blink jp _keyloop PageUp: xor a ld (bf2ndpage), a xor a ld (bfix), a PageUp_: ;call checkPrevPage call resFont call dispbuffer jp _keyloop PageDown: ld a, (bfLength) ld (bfix), a jr PageUp_ keyAlphaBtn: ld a, (lastAction) cp laSetSmall jr z, dontpressalphabtn ld a, lkAlpha ld (lastkey), a call togglesmallfont jp _keyloop dontpressalphabtn:;na sommige letters gaat hij automatisch naar de kleine letters mode, misschien zie je dit niet dus druk je op de alfa Key waardoor die juist weer terug wisselt... ld a, lkAlpha ld (lastkey), a jp _keyloop keyLeft: ld a, (lastAction) cp laSetSmall jr nz, niet3 call ressmallfont niet3: ld a, lkLeft ld (lastkey), a res insert, (iy + shiftflags) ld a, (bfIX) or a jp z, _keyloop dec a ld (bfIX), a call checkPrevPage jr keyRight_ keyRight: ld a, (lastAction) cp laSetSmall jr nz, niet4 call ressmallfont niet4: ld a, lkRight ld (lastkey), a res insert, (iy + shiftflags) ld a, (bfIX) ld hl, (bfLength) cp l jp nc, _keyLoop inc a ld (bfIX), a keyRight_: call dispbuffer ; hier wordt blink ook gecalled, nu kunnen we aan FracDrawLFont, (IY + FontFlags) zien of we over een sub/super script char gaan, dan veranderen we namelijk meteen de stand van de cursor ; we gebruiken blinkChar om te zien of het sub / super is ; werkt nog niet goed, laat maar ;bit FracDrawLFont, (IY + FontFlags) ;jp nz, _keyloop ;call resFont ;set tempState, (IY + asm_Flag1) ;ld a, (blinkChar) ;or a ;jr z, superChar ;set subscript, (IY + ShiftFlags) ;jp _keyloop ;superChar: ;set superscript, (IY + ShiftFlags) jp _keyloop keyAlpha: ld h, 0 ld l, a ld de, chartable add hl, de ld a, (hl) or a jp z, _keyLoop bit smallFont, (IY + ShiftFlags) jr z, noBig add a, $20 noBig: push af call writeBuffer call dispBuffer res other, (IY + ShiftFlags) call resSmallFont pop af cp 'a' jp nc, _keyloop;dan is het toch niet iets van hieronder cp 'A' jr z, setSmall cp 'D' jr z, setSmall cp 'E' jr z, setSmall cp 'G' jr z, setSmall cp 'L' jr z, setSmall cp 'M' jr z, setSmall cp 'R' jr z, setSmall cp 'T' jr z, setSmall cp 'X' jr z, setSmall cp 'Z' jr z, setSmall jp _keyLoop setSmall: ld a, laSetSmall ld (lastActionSet), a call setSmallFont jp _keyloop keyNum: ld h, 0 ld l, a ld de, numtable add hl, de ld a, (hl) or a jp z, _keyloop ;010 bit subScript, (IY + shiftFlags) jr z, geen cp $30 jp c, _keyloop;kom er later 8er dat subscript helemaal geen +,- nodig heeft...... geen: push af call writeBuffer call dispBuffer pop af bit subScript, (IY + shiftFlags) jr nz, keyNum_4 cp $2d;'-' jr z, keyNum_3 cp $2b;'+' jr z, keyNum_3 jp _keyLoop keyNum_4: cp 129;bij een 1 niet resfont(komt namelijk sowieso getal 8er jp z, _keyloop keyNum_3: call resFont call blink jp _keyLoop keyEqu: ld a, $1c jr keyAdd_2 keyAdd: ld a, $2b keyAdd_2: call writeBuffer call dispBuffer call resFont call Blink jp _keyLoop keySpace: ld a, $20 call writebuffer call dispbuffer jp _keyloop keyGraph: call atomDetails call dispbuffer jp _keyloop checkprevpage: ld h, a ld a, (bf2ndpage) dec a cp h ret nz xor a ld (bf2ndpage), a ret