Author Topic: Turn off Calc and Exit Program in Axe?  (Read 14378 times)

0 Members and 1 Guest are viewing this topic.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Turn off Calc and Exit Program in Axe?
« Reply #15 on: November 27, 2012, 12:47:08 pm »
As FloppusMaximus said here :

Quote from: FloppusMaximus
Well...

- Before calling OFFSCRPT, the OS turns the LCD off and disables all interrupts (via port 3.)
[...]
- GetKey halts the CPU, which freezes the system since interrupts have been disabled.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Turn off Calc and Exit Program in Axe?
« Reply #16 on: November 27, 2012, 12:56:52 pm »
As FloppusMaximus said here :

Quote from: FloppusMaximus
Well...

- Before calling OFFSCRPT, the OS turns the LCD off and disables all interrupts (via port 3.)
[...]
- GetKey halts the CPU, which freezes the system since interrupts have been disabled.

Well, then I am wrong ;D You've convinced me to go disassemble the mechanism that calls OFFSCRPT because I guess I don't actually know where it is.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Turn off Calc and Exit Program in Axe?
« Reply #17 on: November 27, 2012, 01:11:07 pm »
I tried to turn back the LCD on in OFFSCRPT :

Code: [Select]
.org $8001
 ld a,3
 out ($10),a
 ret
.end

It effectively turned the LCD on ... but then freezed O.o

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Turn off Calc and Exit Program in Axe?
« Reply #18 on: November 27, 2012, 01:24:45 pm »
Well, the problem here is that your code was not actually being run. I forgot, but OFFSCRPT copies one too few bytes (which is why it starts at $8001 btw). So, when you make your call to bcall(_createAppvar), just increase the size by one.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Turn off Calc and Exit Program in Axe?
« Reply #19 on: November 27, 2012, 01:46:51 pm »
Yay, I got it working !

This code, when turning the calc off by any mean, keeps the LCD on until you press [clear].

Code: [Select]
.org $8001
  ld a,3
  out ($10),a
loop:
  ld a,$FD
  out (1),a
  in a,(1)
  bit 6,a
  ret z
  jr loop
.end

I assume that it may be possible to run an Axe program as thepenguin77 said above but adding the two first lines of my code.
« Last Edit: November 27, 2012, 01:48:33 pm by Matrefeytontias »

Offline bored_student

  • LV3 Member (Next: 100)
  • ***
  • Posts: 44
  • Rating: +3/-0
    • View Profile
Re: Turn off Calc and Exit Program in Axe?
« Reply #20 on: December 03, 2012, 09:51:22 am »
My problem was that the display turned off and I didn't notice the calculator was nevertheless turned on.

I will try it once again as soon as I have a bit more time x.x
Sorry for my bad English, I'm German.