Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .nolist
- #include "ti84pcse.inc"
- .list
- .db tExtTok, tAsm84CCmp
- .org UserMem
- ASMStart:
- .org UserMem
- ProgramStart:
- ;LabelON
- ld hl,sInstructions
- bcall(_PutS)
- ld a,1
- bcall(52EAh) ;_EnableSmartViewInputPad
- bcall(52F0h) ;_RecycleUSB
- res 0,(iy+asm_Flag1)
- res 1,(iy+asm_Flag1)
- call Delay
- smartViewLoop:
- ; bcall(530Eh) ;_IsConnectedToPC
- ; jr z,smartViewLoopDone
- ; bcall(4C9Ch) ;_HandleLinkActivity
- bit 4,(iy+9)
- res 4,(iy+9)
- jr z,notOnPressed
- onPressed:
- xor a
- ld b,a
- bcall(52E7h) ;_SendSmartViewKeypress
- ld a,3fh
- ld b,0
- bcall(52E7h) ;_SendSmartViewKeypress
- xor a
- ld b,a
- bcall(52E7h) ;_SendSmartViewKeypress
- bit 0,(iy+asm_Flag1)
- jr nz,smartViewLoopDone
- jr smartViewLoop
- notOnPressed:
- bit 3,(iy+0)
- jr z,smartViewLoop
- bcall(_GetCSC)
- or a
- jr nz,keyCodeFound
- bit 1,(iy+asm_Flag1)
- jr z,smartViewLoop
- res 1,(iy+asm_Flag1)
- xor a
- ld b,a
- bcall(52E7h) ;_SendSmartViewKeypress
- jr smartViewLoop
- keyCodeFound:
- set 1,(iy+asm_Flag1)
- cp sk2nd
- jr nz,not2ndPressed
- bit 0,(iy+asm_Flag1)
- jr nz,sk2ndWas
- set 0,(iy+asm_Flag1)
- jr not2ndPressed
- sk2ndWas:
- res 0,(iy+asm_Flag1)
- not2ndPressed:
- ld hl,keyTable
- ld b,a
- findKeyCodeLoop:
- ld a,(hl)
- or a
- jr z,smartviewLoop
- cp b
- jr z,sendKeyCode
- inc hl
- inc hl
- inc hl
- jr findKeycodeLoop
- sendKeyCode:
- inc hl
- ld b,(hl)
- inc hl
- ld a,(hl)
- bcall(52E7h) ;_SendSmartViewKeypress
- jr smartViewLoop
- smartViewLoopDone:
- xor a
- ld b,a
- bcall(52E7h) ;_SendSmartViewKeypress
- call Delay
- xor a
- bcall(52EAh) ;_EnableSmartViewInputPad
- bcall(52F0h) ;_RecycleUSB
- clearScreen:
- ret
- Delay: ei
- ld a,42h
- out (36h),a
- xor a
- out (37h),a
- ld a,10
- out (38h),a
- timerLoop:
- in a,(4)
- bit 7,a
- jr z,timerLoop
- ret
- sInstructions:
- .db 0
- keyTable:
- .db sk2nd,2h,0h
- .db skYequ,00h,58
- .db skWindow,00h,59
- .db skZoom,00h,60
- .db skTrace,00h,61
- .db skGraph,00h,62
- .db skMode,00h,41
- .db skDel,00h,76
- .db skAlpha,01h,00
- .db skGraphvar,00h,35h
- .db skStat,00h,77
- .db skMath,00h,4
- .db skMatrix,00h,5
- .db skPrgm,00h,6
- .db skVars,00h,73
- .db skClear,00h,38h
- .db skRecip,00h,7
- .db skSin,00h,8
- .db skCos,00h,9
- .db skTan,00h,10
- .db skPower,00h,11
- .db skSquare,00h,12
- .db skComma,00h,13
- .db skLParen,00h,14
- .db skRParen,00h,15
- .db skDiv,00h,16
- .db skLog,00h,17
- .db sk7,00h,18
- .db sk8,00h,19
- .db sk9,00h,20
- .db skMul,00h,21
- .db skLn,00h,22
- .db sk4,00h,23
- .db sk5,00h,24
- .db sk6,00h,25
- .db skSub,00h,26
- .db skStore,00h,27
- .db sk1,00h,28
- .db sk2,00h,29
- .db sk3,00h,32
- .db skAdd,00h,87
- .db sk0,00h,44
- .db skDecPnt,00h,55
- .db skChs,00h,45
- .db skEnter,00h,40
- .db skup,00h,82
- .db skDown,00h,81
- .db skLeft,00h,80
- .db skRight,0h,79
- .db 0
- .end
- .nolist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement