Author Topic: [ON] Add  (Read 2631 times)

0 Members and 1 Guest are viewing this topic.

Offline Joshuasm32

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 142
  • Rating: +19/-7
    • View Profile
    • Network
[ON] Add
« on: April 27, 2013, 02:17:48 pm »
I there a way to do this through ASM on the TI-84 Plus SE?

Code: [Select]
:ASM(prgmPRGMNAME
:If K=101  //Or whatever the keystroke is for [ON] in the program; Can it be stored to K instead of Ans?
:___

 :w00t:
« Last Edit: April 27, 2013, 02:20:20 pm by codebender »
My name is Josh and I a developer at Moonzean. I enjoy Radiohead, web development, Java, and cryptograms.
Spoiler For No Surprises, by Radiohead:
A heart that's full up like a landfill
A job that slowly kills you
Bruises that won't heal

You look so tired unhappy
Bring down the government
They don't, they don't speak for us

I'll take a quiet life
A handshake of carbon monoxide

And no alarms and no surprises
No alarms and no surprises
No alarms and no surprises
Silent, silent

This is my final fit
My final bellyache

With no alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Such a pretty house
And such a pretty garden

No alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [ON] Add
« Reply #1 on: April 27, 2013, 02:39:14 pm »
Actually it's pretty easy, but I don't really have the time to put a prog right now :-X hopefully someone will notice this thread.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3913
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: [ON] Add
« Reply #2 on: April 27, 2013, 03:01:26 pm »
What do you want to do actually? get a keystroke for On? or do you want to catch an [on] keypress in basic o.o
I'm not a nerd but I pretend:

Offline Joshuasm32

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 142
  • Rating: +19/-7
    • View Profile
    • Network
Re: [ON] Add
« Reply #3 on: April 27, 2013, 03:09:51 pm »
Can I keep [ON] from breaking the program and have it register as a keystroke in either variable K (preferred) or Ans by using an ASM sub-program?   ???
My name is Josh and I a developer at Moonzean. I enjoy Radiohead, web development, Java, and cryptograms.
Spoiler For No Surprises, by Radiohead:
A heart that's full up like a landfill
A job that slowly kills you
Bruises that won't heal

You look so tired unhappy
Bring down the government
They don't, they don't speak for us

I'll take a quiet life
A handshake of carbon monoxide

And no alarms and no surprises
No alarms and no surprises
No alarms and no surprises
Silent, silent

This is my final fit
My final bellyache

With no alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Such a pretty house
And such a pretty garden

No alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Offline Dapianokid

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 539
  • Rating: +46/-27
  • That one dude
    • View Profile
Re: [ON] Add
« Reply #4 on: April 27, 2013, 04:01:20 pm »
codebender, yes. If you know ASM, you can learn how to easily with tutorials on tifreak. However, if you do not, good luck searching for one.
The best I can do is give you onblock, but it doesn't have a keypress registry for ON
Keep trying.

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: [ON] Add
« Reply #5 on: April 27, 2013, 04:35:01 pm »
Well, you could compile a program in Axe for NoShell:
Code: [Select]
:.KEY
:Repeat getKey //only use this if you want it to loop
:End
:getKey->Ans
And it will give you getKey codes in Ans, [ON] having a code of its own. (Ans is the only variable I know how to access with Axe.) Keycodes will be different from those in BASIC; look at
http://axe.eeems.ca/keycodes.png
Hope that works.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4669
  • Rating: +718/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [ON] Add
« Reply #6 on: April 27, 2013, 04:51:07 pm »
The only trouble will be that you need to have a custom interrupt to make sure the OS doesn't throw an error. Hopefully somebody with time comes along to help :/ Essentially, you would need the ONBLOCK program active to prevent ON causing an error, then a separate program to scan for key presses and ON. That would essentially be:
Code: [Select]
AsmPrgm
DB03
E608
EE08
2003
3A3F84
EF8C47
EFBF4A
C9
It returns 8 if ON is pressed, else it returns the values in the link that dinosteven linked to.

Offline Dapianokid

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 539
  • Rating: +46/-27
  • That one dude
    • View Profile
Re: [ON] Add
« Reply #7 on: April 27, 2013, 05:01:30 pm »
Teach me hex, oh wise Xeda
Keep trying.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [ON] Add
« Reply #8 on: April 27, 2013, 05:09:21 pm »
Dapianokid : just look at some z80 ASM reference, they often have opcodes. ;)

Offline Joshuasm32

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 142
  • Rating: +19/-7
    • View Profile
    • Network
Re: [ON] Add
« Reply #9 on: April 28, 2013, 08:12:33 am »
Thank you!   :thumbsup:
My name is Josh and I a developer at Moonzean. I enjoy Radiohead, web development, Java, and cryptograms.
Spoiler For No Surprises, by Radiohead:
A heart that's full up like a landfill
A job that slowly kills you
Bruises that won't heal

You look so tired unhappy
Bring down the government
They don't, they don't speak for us

I'll take a quiet life
A handshake of carbon monoxide

And no alarms and no surprises
No alarms and no surprises
No alarms and no surprises
Silent, silent

This is my final fit
My final bellyache

With no alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Such a pretty house
And such a pretty garden

No alarms and no surprises
No alarms and no surprises
No alarms and no surprises please

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1591
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: [ON] Add
« Reply #10 on: April 29, 2013, 09:13:18 pm »
Well, I spent all day on this. But here's what I came up with:

Code: [Select]
ld a, $98
ld ($9900), a
inc a
ld i, a

ld h, a
ld d, h
ld bc, $100
ld l, c
ld e, b
ldir

ld a, e ; e is 1
bcall(_setXXOp1)
bcall(_decO1Exp)

ld hl, data
ld de, $9898
ld bc, dataEnd-data
ldir

im 2


bcall($4744) ; basic getkey, stores it in op2
in a, (04)
and 8
jr z, isOn
bcall(_zeroOp1)
isOn:
bcall(_fpAdd)
bcall(_stoAns)


ret



data:
ex af, af'
bit 1, (iy + 8)
jr nz, $+4
im 1
;$$:
in a, (04)
and 1
jr z, noProblemHere
xor a
out (03), a
ld a, %00001011
out (03), a
noProblemHere:
ex af, af'
rst 38h
ret

dataEnd:

If you wait a couple hours, someone will make this a lot smaller.

The way it works is that you call the program (attached) just like getKey, everything works exactly the same except that if ON is being pressed, it adds 0.1 to the number. You only have to call it once to block the ON button. It will unblock itself when your program quits (and it may even unblock in input, though, I haven't tried).

(The reason it took all day was because I had a rather fatal error in zStart that prevented this from working.)
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