Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Description: Run calculator program from hook
Submitted on January 5, 2021 at 04:22 AM

main.asm (MIPS Assembly)

include 'include/ez80.inc'
include 'include/tiformat.inc'
include 'include/ti84pceg.inc'
format ti executable 'RUNSHELL'

hook_reloc_addr := ti.pixelShadow2

	ld	hl,hook				; copy hook to temp location
	ld	de,hook_reloc_addr
	push	de
	ld	bc,lengthof hook_code
	ldir
	pop	hl
	jp	ti.SetGetKeyHook

hook:
	db	hook_code

virtual at hook_reloc_addr
hook_start:
	db	$83
	cp	a,ti.kPrgm			; check if [prgm] pressed
	ret	nz
	ld	a,ti.cxCmd
	call	ti.NewContext0			; switch to homescreen
	call	ti.BufClear			; clear input buffer
	ld	de,(ti.t2ByteTok shl 8) or ti.tasm
	call	ti.BufInsert
	ret	z
	ld	hl,prgm_name
	ld	b,prgm_name.len
.insert:
	push	bc
	push	hl
	ld	de,0
	ld	e,(hl)
	call	ti.BufInsert			; insert program name
	pop	hl
	pop	bc
	ret	z
	inc	hl
	djnz	.insert
	ld	a,ti.kEnter
	jp	ti.JForceCmd			; press enter
prgm_name:
	db	ti.tProg,'VYSION'
.len := $-prgm_name
	load hook_code: $-hook_start from hook_start
end virtual