Author |
Message |
|
pugboy
Active Member
Joined: 11 Apr 2007 Posts: 544
|
Posted: 18 Feb 2008 09:36:58 pm Post subject: |
|
|
Could you explain in further detail, possible with code? I am not that great at assembly yet :blush: |
|
Back to top |
|
|
brandonw
Advanced Member
Joined: 12 Jan 2007 Posts: 455
|
Posted: 18 Feb 2008 10:24:13 pm Post subject: |
|
|
Code: IsNspire:
;Determines if calculator is an Nspire.
;Inputs: None
;Outputs: Carry set if NOT Nspire
;Notes: This must run from RAM.
; Destroys all
scf
in a,(2)
bit 7,a
ret z
in a,(21h)
and 3
scf
ret z
in a,(6)
push af
ld a,7Fh
out (6),a
ld hl,4000h
ld bc,4000h
isNspireLoop:
ld e,(hl)
inc hl
dec bc
ld a,b
or c
scf
jr z,exitIsNspire
ld a,e
cp 0EDh
jr nz,isNspireLoop
ld e,(hl)
inc hl
dec bc
ld a,b
or c
scf
jr z,exitIsNspire
ld a,e
cp 0EFh
jr nz,isNspireLoop
exitIsNspire:
pop bc
ld a,b
out (6),a
ret
I hate that there's not a more foolproof or quicker way of finding it out, but this is the only way I know of right now.
Last edited by Guest on 18 Feb 2008 10:26:44 pm; edited 1 time in total |
|
Back to top |
|
|
pugboy
Active Member
Joined: 11 Apr 2007 Posts: 544
|
Posted: 18 Feb 2008 10:37:20 pm Post subject: |
|
|
Great, thanks.
When you say it has to be run from the RAM, does that mean it can't be executed in an app? |
|
Back to top |
|
|
brandonw
Advanced Member
Joined: 12 Jan 2007 Posts: 455
|
Posted: 19 Feb 2008 12:09:29 am Post subject: |
|
|
Right, so just copy it to saferam first and then run it:
Code: ld hl,IsNspire
ld de,appData
ld bc,IsNspireEnd-IsNspire;make an IsNspireEnd label at the end of the routine
ldir
call appData
The reason why is that it swaps into port 6, which is where your application is. If you tried that within 4000h-7FFFh, you die. |
|
Back to top |
|
|
pugboy
Active Member
Joined: 11 Apr 2007 Posts: 544
|
Posted: 19 Feb 2008 12:24:37 am Post subject: |
|
|
Thanks!
Now to figure out how to hide programs from the memory menu... |
|
Back to top |
|
|
brandonw
Advanced Member
Joined: 12 Jan 2007 Posts: 455
|
Posted: 19 Feb 2008 07:08:21 pm Post subject: |
|
|
You can use some ugly menu hooks to make the Mem Mgmt/Del menu appear empty, but to selectively hide things, you're just going to have to recreate it from scratch.
I haven't looked into this too deeply, but you can get the OS to recreate nearly any OS menu, including the Mgm Mgmt/Del, group, link, PRGM, and APPS menus. But you can't get control over what variable it's going to display or acknowledge next. |
|
Back to top |
|
|
pugboy
Active Member
Joined: 11 Apr 2007 Posts: 544
|
Posted: 19 Feb 2008 08:03:29 pm Post subject: |
|
|
Hmm... I was thinking about that menu hook, but can't seem to get it to work for me... |
|
Back to top |
|
|
brandonw
Advanced Member
Joined: 12 Jan 2007 Posts: 455
|
Posted: 20 Feb 2008 07:51:43 am Post subject: |
|
|
I found some old code which uses the menu hook to block everything (which may or may not be what you want).
If I remember right, it installs both a menu and key hook, and cancels drawing on the Mem Mgmt/Del screen, which causes it to go back to the "select type" menu just before it...and then once that happens, it cancels drawing the rest of that and blocks most keypresses, so you're left with a blank screen with RAM/arc free, which is what an empty Mem Mgmt/Del screen looks like.
Like I said, it's ugly (and I can tell this is incomplete), but yeah.
Code: .nolist
#include "ti83plus.inc"
.list
.org userMem-2
.db 0BBh,6Dh
ld hl,myHook
ld de,appBackUpScreen
push de
ld bc,myHookEnd-myHook
ldir
pop hl
in a,(6)
bcall(5083h)
ld hl,keyHook-myHook+appBackUpScreen
bcall(4F66h)
res 0,(iy+asm_Flag1)
ret
myHook:
add a,e
or a
jr z,myHook0
dec a
jr z,myHook1
dec a
ret z
dec a
jr z,myHook3
;A=4
res 0,(iy+asm_Flag1)
ld a,b
cp 20h
jr nz,xorAret
ld a,(menuCurrent)
cp 20h
jr nz,xorAret
set 0,(iy+asm_Flag1)
inc a
ret
myHook0:
;A=0
bit 0,(iy+asm_Flag1)
jr nz,myHook0_fakeMenu
ld a,(menuCurrent)
cp 03h;mProgramHome
jr nz,myHook0_notPrgm
ld hl,prgmMenuTable-myHook+appBackUpScreen
or a
ret
myHook0_notPrgm:
ld a,(menuCurrent)
cp 02h;mApps
jr nz,xorAret
myHook0_fakeMenu:
ld hl,appsMenuTable-myHook+appBackUpScreen
or a
ret
xorAret:
xor a
ret
myHook1:
;A=1
bit 0,(iy+asm_Flag1)
jr z,myHook1_notMem
xor a
ld (curCol),a
inc a
ret
myHook1_notMem:
ld a,(menuCurrent)
cp 02h
jr z,myHook1_isApps
cp 03h
jr nz,xorAret
ld a,(menuCurrent+1)
cp 02h
jr z,xorAret
xor a
ld (curCol),a
inc a
ret
myHook1_isApps:
ld hl,sFinance-myHook+appBackUpScreen
bcall(_PutS)
or 1
ret
sFinance:
.db "Finance",0CEh,0
myHook3:
;A=3
ld a,b
cp 1Fh
jr nz,xorAret
inc a
ret
appsMenuTable:
.db 01h,1,1Eh,0,3Ch
prgmMenuTable:
.db 03h,1,1,1,2Fh,2Ch,3Ah
.db 0,0
.db 0,0
.db 0,47h
keyHook:
add a,e
ld d,a
bit 0,(iy+asm_Flag1)
jr nz,keyHookMemMenu
ld a,(menuCurrent)
ld hl,memValues-myHook+appBackUpScreen
ld bc,6
cpir
ld b,d
jr z,keyhook_isReset
cp 02h
jr nz,keyHookEnd
ld a,d
ld c,a
cp kEnter
ld b,kFin
jr z,keyHookEnd
cp k1
jr z,keyHookEnd
ld b,c
keyHookEnd:
ld a,b
or a
ret
keyHookMemMenu:
ld b,d
cp kEnter
jr z,keyHookCancel
cp kUp
jr z,keyHookCancel
cp kDown
jr z,keyHookCancel
cp k1
jp m,keyHookEnd-myHook+appBackUpScreen
cp kCapZ
jp p,keyHookEnd-myHook+appBackUpScreen
keyHookCancel:
xor a
ret
keyHook_isReset:
ld a,d
cp k2
jr z,keyHook_resetAttempted
ld a,(menuCurrent+2)
dec a
ld a,d
ret nz
cp kEnter
ret nz
keyHook_resetAttempted:
bcall(_clrLCDFull)
ld hl,OP1
ld (hl),05h
inc hl
ld (hl),21h
inc hl
ld (hl),0
bcall(_chkFindSym)
jr c,noDelete
bcall(_delVar)
noDelete:
;display reset text
ld hl,sResetAllText-myHook+appBackUpScreen
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld (curRow),de
bcall(_PutS)
ld hl,0
ld (curRow),hl
res 5,(iy+34h)
bcall(_DisableApd)
bcall(_runIndicOff)
res curLock,(iy+curFlags)
bcall(_cursorOn)
xor a
ld (menuCurrent),a
ld (menuCurrent+2),a
ld a,40h
ld (cxCurApp),a
set 7,(iy+28h)
bcall(_getKey)
push af
bcall(_clrLCDFull)
bcall(_clrTxtShd)
ld hl,cmdShadow
ld de,cmdShadow+1
ld (hl),' '
ld bc,127
ldir
set 5,(iy+34h)
pop af
or a
ret
memValues:
.db 21h,23h,24h,25h,26h,27h
sResetAllText:
.dw 0205h
.db "Mem cleared",0
myHookEnd:
.end
end
|
|
Back to top |
|
|
pugboy
Active Member
Joined: 11 Apr 2007 Posts: 544
|
Posted: 20 Feb 2008 12:36:07 pm Post subject: |
|
|
After trying the code out, it seems as if it just hides everything on the Prgm and Apps menu, not the Mem menu.
Thanks anyways. |
|
Back to top |
|
|
brandonw
Advanced Member
Joined: 12 Jan 2007 Posts: 455
|
Posted: 20 Feb 2008 09:53:54 pm Post subject: |
|
|
Works for me...what OS version are you using? I suspected for a while that they changed the menu hook at some point, but it works for me on 1.16 and 2.41. |
|
Back to top |
|
|
pugboy
Active Member
Joined: 11 Apr 2007 Posts: 544
|
Posted: 21 Feb 2008 11:40:52 am Post subject: |
|
|
Yikes! 1.12!
That must be the problem. Thanks!
I guess the only issue now is an uninstall :P
Thanks again!
Last edited by Guest on 21 Feb 2008 11:45:11 am; edited 1 time in total |
|
Back to top |
|
|
TheStorm
Calc Guru
Joined: 17 Apr 2007 Posts: 1233
|
Posted: 21 Feb 2008 05:42:42 pm Post subject: |
|
|
[rant]1.12???!!!?!?!?! why do people still insist on Using VTI do they not realize that it fails. Use PTI or Wabbit damnit they are more acreate and whoa they work on recent os versions, heck even flash debugger is better than VTI it emulates flash and os version 1.13 allowing for se calcs. [/rant] |
|
Back to top |
|
|
magicdanw pcGuru()
Calc Guru
Joined: 14 Feb 2007 Posts: 1110
|
Posted: 21 Feb 2008 05:56:52 pm Post subject: |
|
|
Um, he never said he used VTI. He just said he had OS version 1.12. He could be using that OS version on any emulator, or even a real calculator! |
|
Back to top |
|
|
JoostinOnline
Active Member
Joined: 22 Aug 2007 Posts: 559
|
Posted: 21 Feb 2008 06:11:17 pm Post subject: |
|
|
Also, VTI 2.5 beta is the most popular emulator on ticalc.org, so it kinda jumps out. People are much more likely to download a high rated file on ticalc that to search through other sites more known for forums than programs for an emulator.
[offtopic]PindurTI has been declared dead[/offtopic] |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 21 Feb 2008 07:20:53 pm Post subject: |
|
|
TheStorm wrote: [rant]1.12???!!!?!?!?! why do people still insist on Using VTI do they not realize that it fails. Use PTI or Wabbit damnit they are more acreate and whoa they work on recent os versions, heck even flash debugger is better than VTI it emulates flash and os version 1.13 allowing for se calcs. [/rant]
[post="120587"]<{POST_SNAPBACK}>[/post]
a bit of backwards compatability is something to consider, since a lot of people don't have cables for 83+ to update their OS. I see a lot of handme down calcs w/ 1.12 or earlier at school. |
|
Back to top |
|
|
pugboy
Active Member
Joined: 11 Apr 2007 Posts: 544
|
Posted: 22 Feb 2008 06:31:34 pm Post subject: |
|
|
I should get a newer version :P
I am using PTI btw.
The code you provided in Latenite (without the .nolist to the .or user mem) will run, then exit and display this:
[attachment=2187:attachment]
I am very confused by the code :confused:
Last edited by Guest on 22 Feb 2008 06:32:32 pm; edited 1 time in total |
|
Back to top |
|
|
TheStorm
Calc Guru
Joined: 17 Apr 2007 Posts: 1233
|
Posted: 23 Feb 2008 11:03:32 am Post subject: |
|
|
Liazon wrote: TheStorm wrote: [rant]1.12???!!!?!?!?! why do people still insist on Using VTI do they not realize that it fails. Use PTI or Wabbit damnit they are more acreate and whoa they work on recent os versions, heck even flash debugger is better than VTI it emulates flash and os version 1.13 allowing for se calcs. [/rant]
[post="120587"]<{POST_SNAPBACK}>[/post]
a bit of backwards compatability is something to consider, since a lot of people don't have cables for 83+ to update their OS. I see a lot of handme down calcs w/ 1.12 or earlier at school.
[post="120597"]<{POST_SNAPBACK}>[/post]
true but they won't be able to get this app on their calc unless they have a cable so it doesn't matter, I feel you should support as many os's as possible but if you cant then you can't if they want to use this app just tell them they have to upgrade. |
|
Back to top |
|
|
brandonw
Advanced Member
Joined: 12 Jan 2007 Posts: 455
|
Posted: 23 Feb 2008 03:04:45 pm Post subject: |
|
|
pugboy wrote: I should get a newer version :P
I am using PTI btw.
The code you provided in Latenite (without the .nolist to the .or user mem) will run, then exit and display this:
[attachment=2187:attachment]
I am very confused by the code :confused:
[post="120631"]<{POST_SNAPBACK}>[/post]
Impossible to know without seeing code or an 8XP. What OS version is that? I haven't looked into how the menu hook might've changed in 1.12 or lower. |
|
Back to top |
|
|
pugboy
Active Member
Joined: 11 Apr 2007 Posts: 544
|
Posted: 23 Feb 2008 08:55:41 pm Post subject: |
|
|
Dang it. I forgot, I am testing with 1.12. I will test with another OS in a sec.
Never mind. Same with OS 1.16.
It is an app, does that matter? The code is below (from LateNnite)
Code:
; ===============================================================
; HideMem
; ===============================================================
main
.db 0BBh,6Dh
ld hl,myHook
ld de,appBackUpScreen
push de
ld bc,myHookEnd-myHook
ldir
pop hl
in a,(6)
bcall(5083h)
ld hl,keyHook-myHook+appBackUpScreen
bcall(4F66h)
res 0,(iy+asm_Flag1)
ret
myHook:
add a,e
or a
jr z,myHook0
dec a
jr z,myHook1
dec a
ret z
dec a
jr z,myHook3
;A=4
res 0,(iy+asm_Flag1)
ld a,b
cp 20h
jr nz,xorAret
ld a,(menuCurrent)
cp 20h
jr nz,xorAret
set 0,(iy+asm_Flag1)
inc a
ret
myHook0:
;A=0
bit 0,(iy+asm_Flag1)
jr nz,myHook0_fakeMenu
ld a,(menuCurrent)
cp 03h;mProgramHome
jr nz,myHook0_notPrgm
ld hl,prgmMenuTable-myHook+appBackUpScreen
or a
ret
myHook0_notPrgm:
ld a,(menuCurrent)
cp 02h;mApps
jr nz,xorAret
myHook0_fakeMenu:
ld hl,appsMenuTable-myHook+appBackUpScreen
or a
ret
xorAret:
xor a
ret
myHook1:
;A=1
bit 0,(iy+asm_Flag1)
jr z,myHook1_notMem
xor a
ld (curCol),a
inc a
ret
myHook1_notMem:
ld a,(menuCurrent)
cp 02h
jr z,myHook1_isApps
cp 03h
jr nz,xorAret
ld a,(menuCurrent+1)
cp 02h
jr z,xorAret
xor a
ld (curCol),a
inc a
ret
myHook1_isApps:
ld hl,sFinance-myHook+appBackUpScreen
bcall(_PutS)
or 1
ret
sFinance:
.db "Finance",0CEh,0
myHook3:
;A=3
ld a,b
cp 1Fh
jr nz,xorAret
inc a
ret
appsMenuTable:
.db 01h,1,1Eh,0,3Ch
prgmMenuTable:
.db 03h,1,1,1,2Fh,2Ch,3Ah
.db 0,0
.db 0,0
.db 0,47h
keyHook:
add a,e
ld d,a
bit 0,(iy+asm_Flag1)
jr nz,keyHookMemMenu
ld a,(menuCurrent)
ld hl,memValues-myHook+appBackUpScreen
ld bc,6
cpir
ld b,d
jr z,keyhook_isReset
cp 02h
jr nz,keyHookEnd
ld a,d
ld c,a
cp kEnter
ld b,kFin
jr z,keyHookEnd
cp k1
jr z,keyHookEnd
ld b,c
keyHookEnd:
ld a,b
or a
ret
keyHookMemMenu:
ld b,d
cp kEnter
jr z,keyHookCancel
cp kUp
jr z,keyHookCancel
cp kDown
jr z,keyHookCancel
cp k1
jp m,keyHookEnd-myHook+appBackUpScreen
cp kCapZ
jp p,keyHookEnd-myHook+appBackUpScreen
keyHookCancel:
xor a
ret
keyHook_isReset:
ld a,d
cp k2
jr z,keyHook_resetAttempted
ld a,(menuCurrent+2)
dec a
ld a,d
ret nz
cp kEnter
ret nz
keyHook_resetAttempted:
bcall(_clrLCDFull)
ld hl,OP1
ld (hl),05h
inc hl
ld (hl),21h
inc hl
ld (hl),0
bcall(_chkFindSym)
jr c,noDelete
bcall(_delVar)
noDelete:
;display reset text
ld hl,sResetAllText-myHook+appBackUpScreen
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld (curRow),de
bcall(_PutS)
ld hl,0
ld (curRow),hl
res 5,(iy+34h)
bcall(_DisableApd)
bcall(_runIndicOff)
res curLock,(iy+curFlags)
bcall(_cursorOn)
xor a
ld (menuCurrent),a
ld (menuCurrent+2),a
ld a,40h
ld (cxCurApp),a
set 7,(iy+28h)
bcall(_getKey)
push af
bcall(_clrLCDFull)
bcall(_clrTxtShd)
ld hl,cmdShadow
ld de,cmdShadow+1
ld (hl),' '
ld bc,127
ldir
set 5,(iy+34h)
pop af
or a
ret
memValues:
.db 21h,23h,24h,25h,26h,27h
sResetAllText:
.dw 0205h
.db "Mem cleared",0
myHookEnd:
ret
EDIT:
Found the error. A ret is used to quit the app after install. As a program, it works on 1.16. Thanks!
Last edited by Guest on 23 Feb 2008 09:02:11 pm; edited 1 time in total |
|
Back to top |
|
|
brandonw
Advanced Member
Joined: 12 Jan 2007 Posts: 455
|
Posted: 24 Feb 2008 02:17:04 am Post subject: |
|
|
Yeah, you always quit an application with _JForceCmdNoChar. |
|
Back to top |
|
|
|