Skip to content

Instantly share code, notes, and snippets.

@jacobly0
Created October 3, 2016 12:14
Show Gist options
  • Select an option

  • Save jacobly0/f72c368eb0b65aafff7be6b402af341c to your computer and use it in GitHub Desktop.

Select an option

Save jacobly0/f72c368eb0b65aafff7be6b402af341c to your computer and use it in GitHub Desktop.
Instant Scroll
include '../fasmg-ez80/ez80.inc'
include '../fasmg-ez80/tiformat.inc'
include '../ti84pceg.inc'
format ti executable protected program 'SCROLL'
ld hl,v_PrgmName+1
ld de,ti.progToEdit
ld bc,8
ldir
xor a,a
ld (de),a
ld a,ti.kPrgmEd
call ti.NewContext
ld hl,(ti.curPC)
ld de,(ti.begPC)
or a,a
sbc hl,de
push hl
pop bc
ld de,(ti.editTop)
ld hl,(ti.editTail)
ldir
ld (ti.editCursor),de
ld (ti.editTail),hl
ld hl,0
push hl
EditorLoop: ;Check if at beginning of program
ld de,(ti.editTop)
or a,a
sbc hl,de
jr z,EditorFound
call ti.BufLeft
ld hl,(ti.editCursor)
ld a,(hl)
cp ti.tEnter
jr z,EditorFound
pop hl
inc hl
push hl
jr EditorLoop
EditorFound:
call ti.BufRight
call ti.DispEOW
pop hl
ld a,h
or l
jr z,EditorMon
EditorScroll:
dec hl
ld a,h
or l
jr z,EditorMon
push hl
call ti.CursorRight
pop hl
jr EditorScroll
EditorMon:
call ti.DelRes
jp ti.Mon
v_PrgmName db ti.ProgObj, 'A', 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment