Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
scAFwATLxpKzRCmVaHv wrote:
Thanks for your help!

When I tried ld.sis, the compiler says "value too large for 16-bits, truncation required". Should I just ignore it, or am I doing something wrong?

Nah; that's just a native spasm thing. I'll ask calc84 about it.
EDIT: It might just be a better idea to just do this:

Code:
#define MBASE_OFFSET $D00000
; And usage example:
 ld.sis (drawFGcolor-MBASE_OFFSET),hl


scAFwATLxpKzRCmVaHv wrote:
Why is _SetTextFGBGColors being used incorrectly? Because I don't have a background color?

Yeah; that's about it. Razz Sorry; should have explained more.

scAFwATLxpKzRCmVaHv wrote:
I meant the _VPutS and all of the related commands, because I want my email to display in small, navy blue text.

Oh whoops; sorry about that! I wasn't quite sure what was happening. Razz I changed it back.

scAFwATLxpKzRCmVaHv wrote:
On the TI-84+CSE, the resetting of onInterrupt was unnecessary. Are you sure that it's necessary here?

No; it's not at all necessary; it just makes sure that the Err:Break message doesn't appear when exiting your program.

scAFwATLxpKzRCmVaHv wrote:
The loading of 1 onto $E00005 was a trick that I have successfully tested to make the calculator run faster. It is from a program in Cemetech archives called "Faster". I also have a question about this: will long-term usage of this trick damage the calculator?

No; there shouldn't be any adverse affects from this. DrDnar and his tricks. Razz

Also, please disregard my previous statements about penCol only being two bytes in width; I've spent too much time in the OS, and that is how TI loads it every time, which is rather silly. It's actually 24-bit, so you can save to it just fine. Of course, penRow is located at penCol+3 now. Razz *Mateo facepalms*

Anywho, here's some updated code: (You may want to update the include file; I fixed a couple things here and there)


Code:
.nolist
   #include "ti84pce.inc"
   #define PutMapFlags $4A
   #define RED $F800
   #define NAVY $0010
   #macro bcall(x)
      call x
   #endmacro
#define MBASE_OFFSET $D00000
.list
   .org userMem-2
   .db tExtTok,tAsm84CeCmp

PasswordStart:
   bcall(_EnableAPD)
   ld a,1
   ld (apdTimer),a
   ld (apdSubTimer),a
   set apdRunning,(iy+apdFlags)
   bcall(_ClrScrnFull)
   bcall(_HomeUp)
   ld hl,PressText
   bcall(_PutS)
   bcall(_NewLine)
   bcall(_NewLine)
   ld de,RED
   ld.sis (textBGcolor-MBASE_OFFSET), de
   set 4,(iy+PutMapFlags)
   bcall(_PutS)
   res 4,(iy+PutMapFlags)
   bcall(_NewLine)
   bcall(_PutS)
   ld bc,$03
   ld (penCol),bc
   ld a,$50
   ld (penRow),a
   ld bc,NAVY
   ld.sis (drawFGColor-MBASE_OFFSET),bc
   bcall(_vPutS)
   ld bc,$400
   ld hl,Password
KeyPress:
   call GetKey
   cp (hl)
   inc hl
   jr z,Asterisk
   inc c
Asterisk:
   ld a,'*'
   bcall(_PutC)
   djnz KeyPress
   dec c
   inc c
   jr nz,WrongPassword
   bcall(_ClrScrnFull)
   res onInterrupt, (iy + onFlags)
   ret
WrongPassword:
   ld hl,WrongPasswordMsg
   bcall(_NewLine)
   bcall(_PutS)
   bcall(_NewLine)
   bcall(_PutS)
   call GetKey
   jp PasswordStart

GetKey:
   push hl
   bcall(_GetCSC)
   pop hl
   or a
   jr z,GetKey
   ret

PressText:
   .db "This calculator belongs to****** ***********.",0
   .db "(***) ***-****",0
   .db "Password: ",0
   .db "******.***********@*******.com",0
WrongPasswordMsg:
   .db "Wrong password!",0
   .db "Press a key to turn off   the calculator.",0

Password:
   .db sk0
   .db sk0
   .db sk0
   .db sk0
Thank you very much! The password program now successfully works on the TI-84 Plus CE.

Make sure you remember to switch textFGcolor and textBGcolor in your next update of ti84pce.inc.
What does this password program do? I have always wanted to make a password program for my TI-84+CSE, but I only know Hybrid TI-Basic, so I can't or there is the On break.
What exactly does it do? Like does it prompt you to create a password, etc?
If I wanted this program for a TI-84 Plus C Silver Edition, what would I have to change?

Here's what I think:

Change the include file obviously
Change "tAsm84CECmp" to "tAsm84CCmp"
Change the "ld.sis" to something else (when I tried to compile, it showed error)

How would you print onto the screen in color?
Probably get rid of the "macro" in the beginning, right?
So I think it should look something like this:


Code:
.nolist
   #include "ti84pcse.inc"
   #define PutMapFlags $4A
   #define RED $F800
   #define NAVY $0010
.list
   .org userMem-2
   .db tExtTok,tAsm84CCmp

PasswordStart:
   bcall(_EnableAPD)
   ld a,1
   ld (apdTimer),a
   ld (apdSubTimer),a
   set apdRunning,(iy+apdFlags)
   bcall(_ClrScrnFull)
   bcall(_HomeUp)
   ld hl,PressText
   bcall(_PutS)
   bcall(_NewLine)
   bcall(_NewLine)
   ld de,RED
   ld (textBGcolor),de
   set 4,(iy+PutMapFlags)
   bcall(_PutS)
   res 4,(iy+PutMapFlags)
   bcall(_NewLine)
   bcall(_PutS)
   ld bc,$03
   ld (penCol),bc
   ld a,$50
   ld (penRow),a
   ld bc,NAVY
   ld (drawFGColor),bc
   bcall(_vPutS)
   ld bc,$400
   ld hl,Password
KeyPress:
   call GetKey
   cp (hl)
   inc hl
   jr z,Asterisk
   inc c
Asterisk:
   ld a,'*'
   bcall(_PutC)
   djnz KeyPress
   dec c
   inc c
   jr nz,WrongPassword
   bcall(_ClrScrnFull)
   res onInterrupt, (iy + onFlags)
   ret
WrongPassword:
   ld hl,WrongPasswordMsg
   bcall(_NewLine)
   bcall(_PutS)
   bcall(_NewLine)
   bcall(_PutS)
   call GetKey
   jp PasswordStart

GetKey:
   push hl
   bcall(_GetCSC)
   pop hl
   or a
   jr z,GetKey
   ret

PressText:
   .db "This calculator belongs to****** ***********.",0
   .db "(***) ***-****",0
   .db "Password: ",0
   .db "******.***********@*******.com",0
WrongPasswordMsg:
   .db "Wrong password!",0
   .db "Press a key to turn off   the calculator.",0

Password:
   .db sk0
   .db sk0
   .db sk0
   .db sk0
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 5 of 5
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement