C'est pas bête, je pense faire pareil, mais doit-on tenter de garder la compatibilité avec Ion (en adaptant ses routines au nouvel écran) ? J'hésite, ce serait peut être mieux de repartir sur du neuf.
edit : Le parser hook commence à me prendre la tête
_chkfindsym est sensé retourner 0 ou le # de la page flash dans laquelle est le programme dans le registre b, sauf que ça me renvoi toujours 0...
hook.inc
zshell_hook:
.db $83 ; used by os for hook safety check (add a,e can be used too)
or a
jr z,zshell_hook_start ; we just want to handle prgm, not TI-Basic functions
zshell_hook_return_z:
xor a
ret
zshell_hook_start:
ld a,(parse_var) ; check the currently executed program type
cp progobj
jr z,zshell_hook_continue
cp protprogobj
jr nz,zshell_hook_return_z ; if it's not a prgm or a protected prgm, let the parser continue
zshell_hook_continue:
ld hl,parse_var
rst rmov9toop1
bcall(_chkfindsym)
;ex de,hl
;ld a,(parse_var+1)
;cp '#'
;jr nz,zshell_hook_return_z
ld a,b
or a ; if the prgm is in ram, read it as it
jr z,zshell_hook_read_data
; todo : unarchive or read the prgm from flash
jr zshell_hook_return_nz
zshell_hook_read_data:
run_program:
ld hl,test_str
call iputs
zshell_hook_return_nz:
or $80 ; reset zero flag, the parser can't continue to parse the variable
ret
test_str:
.db "test",0