Due to issues with the Internet.ee domain registry, our main domain, paste.ee, is currently disabled due to abuse reports. We are looking into alternative domains to continue operation, but for now the pastee.dev domain is the primary domain.
If you wish to blame someone, blame the scum using this site as a malware host.
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