Calculator Community > ASM

Miscellaneous ASM Questions

<< < (2/5) > >>

Xeda112358:
What do you mean by the edit buffer? Edit buffers can be fairly complicated to work with.

The home screen does have a 128 byte buffer reserved as a copy for each char on it (16*8) called textShadow. There is another, similar buffer called cmdShadow that is intended for programs to use to back up that data.

For those two 128-byte buffers, you can do whatever you want with them. Worst case is that the home screen displays garbage. You can just fill it with spaces manually or preferably through one of the bcalls (I believe bcall 0x4546 is the bcall, but I forgot the name and I'm on mobile so it's a pain to search).

Sue Doenim:

--- Quote from: Xeda112358 on April 04, 2019, 09:26:42 pm ---What do you mean by the edit buffer? Edit buffers can be fairly complicated to work with.
--- End quote ---
I don't mean the text shadow, but the place the tokens that you type in are stored.  I want to work with hooks to change things.  My current plan is to make an app that supports double-clicking of certain keys to access the [2nd] function of that key (e.g. double clicking [^] puts the pi token).

Xeda112358:
Oh, you probably don't want to work with an edit buffer for a task like that!

The data is stored in the program named !. (That's an exclamation point). Just locate the variable, get its size and locate the end if the program.

Just remember that if you replace a 1-byte token with a 2-byte token, you'll need to increase the size of the var (use InsertMem and manually update the var's size bytes) and vice versa.

Runer112:
... except you have to work with an edit buffer for that, because home screen input works by having that program open in an edit buffer.

E37:
I know that I'm 2 weeks late to the party (and several months if you count it from the original post) but I actually did something pretty similar to what you are trying to do a while ago. If you want to mess around with the homescreen input, you should use a homescreen hook. (http://wikiti.brandonw.net/index.php?title=83Plus:Hooks:9B8C) Since you mentioned hooks already, I assume that you already know how to use them. If you use the mode when A=2, then you don't have to worry about edit buffers and you can just open prgm! and edit it like anything else without worrying about edit buffers and such. If you want to change what a key sends on a double press by using the mode where A=1, you are in for something much trickier. It is simple to change B to the keypress that produces the token that you want. If I recall correctly, you should change keyExtend to the second byte if it is a two byte keypress.
The problem is with removing the previous token. There is an edit buffer command to shift the cursor one token to the left (BufLeft) so that might work, and then you could call BufReplace to replace that token that was previously typed in with the one you want to change it to and then return nz to ignore the keypress since you handled it manually. I don't know how this would work when the user is in insert mode.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version