Psprint lua edition (with trainer wip)
Moderators: Shine, Insert_witty_name
Psprint lua edition (with trainer wip)
EDIT: I have now completed porting p-sprint to lua (see http://forums.ps2dev.org/viewtopic.php?t=2913 for more info on the c version of p-sprint )
Here you can download the latest version:
http://www.niwra.nl/psp/p-sprint-lua/psprintlua.rar
This contains the following files:
http://www.niwra.nl/psp/p-sprint-lua/psprint.lc
http://www.niwra.nl/psp/p-sprint-lua/index.lua
The psprint.lc is a lua include file for easy use.
The index.lua is an example of how to use the include file to read p-sprint like text input.
(It's my first lua program and (thus obviously) the first time I made an include file - things may therefore look very messy, but at least it works; input is appreciated;) )
I will post my process here as I did in my p-sprint thread, and input is more than welcome.
Done:
- keychars
- keycodes
- keynames
- keygroups
- modifiers
- key repeat
- make into lua include
Still to do:
- trainer
- the wrapper functions for readex (e.g. the blocking calls like getChar)
- allow user-configuration of keymaps (all six available ones)
Here you can download the latest version:
http://www.niwra.nl/psp/p-sprint-lua/psprintlua.rar
This contains the following files:
http://www.niwra.nl/psp/p-sprint-lua/psprint.lc
http://www.niwra.nl/psp/p-sprint-lua/index.lua
The psprint.lc is a lua include file for easy use.
The index.lua is an example of how to use the include file to read p-sprint like text input.
(It's my first lua program and (thus obviously) the first time I made an include file - things may therefore look very messy, but at least it works; input is appreciated;) )
I will post my process here as I did in my p-sprint thread, and input is more than welcome.
Done:
- keychars
- keycodes
- keynames
- keygroups
- modifiers
- key repeat
- make into lua include
Still to do:
- trainer
- the wrapper functions for readex (e.g. the blocking calls like getChar)
- allow user-configuration of keymaps (all six available ones)
Last edited by Arwin on Tue Jan 24, 2006 1:36 am, edited 4 times in total.
Ok, finally got round to a bit of coding. Still trying to get a grip on this Lua thing, but the very basics at least seem to work. I'm stuck a bit now figuring out how to do a bitwise OR in Lua, but we'll figure it out eventually I'm sure. ;)
Here's a link to the very early stuff, just the first group, basic typing, no training yet, not even backspace or a cursor.
EDIT: link removed, see first post.
Here's a link to the very early stuff, just the first group, basic typing, no training yet, not even backspace or a cursor.
EDIT: link removed, see first post.
Last edited by Arwin on Tue Jan 24, 2006 12:13 am, edited 1 time in total.
Thanks for the offer, youresam.
And thanks modsyn. That # happened to be one I was looking for, and it's not that easy to find in the basic documentation of the psp version of lua.
After some playing around I felt I could do everything I did in C in Lua in about the same structure, so I rewrote to match the original.
Psprint in Lua is now already pretty much completed! :) Went smoother than I thought.
EDIT: See first post for updates, p-sprint lua is now pretty much up to speed with the C version. :)
And thanks modsyn. That # happened to be one I was looking for, and it's not that easy to find in the basic documentation of the psp version of lua.
After some playing around I felt I could do everything I did in C in Lua in about the same structure, so I rewrote to match the original.
Psprint in Lua is now already pretty much completed! :) Went smoother than I thought.
EDIT: See first post for updates, p-sprint lua is now pretty much up to speed with the C version. :)
i know, i found it while looking for a way to do bit shifting. it was on
wikipedia, the great source: http://en.wikipedia.org/wiki/Lua_for_PSP
wikipedia, the great source: http://en.wikipedia.org/wiki/Lua_for_PSP
Ah, there you go. Confusing that the luaplayer.org website points to a different Wiki!:modsyn wrote:i know, i found it while looking for a way to do bit shifting. it was on
wikipedia, the great source: http://en.wikipedia.org/wiki/Lua_for_PSP
http://wiki.ps2dev.org/psp:lua_player
That should be fixed. The official integrated Wiki page is much better.
I have an idea for a little onscreen aid for p-sprint. The final version is going to be a bit bigger to be able to incorporate function keys and other named keys, but this is a start.
Basically you can look at this is a grid/matrix. The columns represent the left,up,right,square,triangle,circle as the first button press, and the rows represent the same for the second button press.
So the highlighted column represent the keys available to you when you have pressed the fourth button, which is the square. The highlighted letter 't' corresponds to the 5th button, which is the triangle. So square + triangle = 't'.
The keys on the diagonal (left top to right bottom) represents all buttons that can be pressed with double presses, and if I did my job right, then the most used keys should be mapped around that diagonal. It does look that way very nicely, with the diacritics at the corners. Where it deviates this was intended to be so that keys that are frequently used together are placed close to each other.
This is probably also what I'd use for a keymap manager, though I think most gain will be had by just simply adding shortcuts to frequently used keys by virtue of assigning them to Alt or Control button combinations or something similar, depending on context.
If, for instance, you'd use this in a Lua Code Editor, you could assign shortcuts to [ and ] so that Alt [ gives a (, so that you don't have to go into numbers mode to get at those. Stuff like that.
Basically you can look at this is a grid/matrix. The columns represent the left,up,right,square,triangle,circle as the first button press, and the rows represent the same for the second button press.
So the highlighted column represent the keys available to you when you have pressed the fourth button, which is the square. The highlighted letter 't' corresponds to the 5th button, which is the triangle. So square + triangle = 't'.
The keys on the diagonal (left top to right bottom) represents all buttons that can be pressed with double presses, and if I did my job right, then the most used keys should be mapped around that diagonal. It does look that way very nicely, with the diacritics at the corners. Where it deviates this was intended to be so that keys that are frequently used together are placed close to each other.
This is probably also what I'd use for a keymap manager, though I think most gain will be had by just simply adding shortcuts to frequently used keys by virtue of assigning them to Alt or Control button combinations or something similar, depending on context.
If, for instance, you'd use this in a Lua Code Editor, you could assign shortcuts to [ and ] so that Alt [ gives a (, so that you don't have to go into numbers mode to get at those. Stuff like that.
i'm not sure if this is still maintained, but i cant seem to get this to work on the current version of lua player (.20). when i try to run your code, it complains (and gives very odd error messages) about the include file, so i tried just taking the source from the include and sticking it into the index.lua, but it then it complains about expecting a 'then' but got a '&'. maybe the bitwise functions are broken in the new lua player?
Remember, for all your psp dev needs you could do worse than pspdev.org ;)
-John_K
That does sound like the new Lua version might be the problem. I haven't worked on it, but I'm still around and watching. If Lua changed in this respect and it was supposed to, and the code needs fixing, let me know.
In the meantime, you probably should ask this question in a Lua Engine related thread.
To verify, you could try using this with an older version of Lua, if you haven't already done so, to verify that there isn't another problem.
In the meantime, you probably should ask this question in a Lua Engine related thread.
To verify, you could try using this with an older version of Lua, if you haven't already done so, to verify that there isn't another problem.
I'm not sure what I worked with, but I think it should at least work with 0.16.razorrifh wrote:which version of lua is this designed for? i think pspupdates still has the .15 version of lua player, unless you know another place to get the older updates.
I could see that something might have gone wrong possibly when Lua went prx compliant.
You are testing with the bare code that you downloaded from the first post, right? That should definitely work.