RISCLua.
Krzysztof Jeszke (6296) 30 posts |
It seems that unlike python for risc os RISCLua is still up to date. The question is, |
Bryan Hogan (339) 593 posts |
One thing to remember is that BBC BASIC has never contained any graphics routines, it simply passes things on to the OS, so the simple answer to your question is Yes, by calling the OS routines (OS_Plot, OS_SpriteOp, etc). Unfortunately I don’t know Lua so can’t tell you how to do that! I’ve just looked in the RiscLua6 examples that are on my ARMX6 and they all seem to be far too advanced for your question :-( (I’m sure Gavin Wraith will be along with a more helpful answer soon!) |
GavinWraith (26) 1563 posts |
Bryan is quite right. About twenty years ago there was a Lua library called vdu which used OS_Plot to provide the usual move_/draw_/point commands. This may not be much help, but there is a new example in the RiscLua83 package called !Codex which uses the toolbox to display a series of Draw files. There is also a rather incomplete library for constructing Draw files. |
Krzysztof Jeszke (6296) 30 posts |
Just enough info. I will look forward to trying it out! Thx! |
GavinWraith (26) 1563 posts |
Time perhaps to make a confession? BBC BASIC is wonderful for graphics programs that take over the whole screen. I enjoyed using it that way, until the RISC OS desktop came along. I really love that desktop. So I tend to shun programs that do not run in the desktop, and have come to think that programs that hog the screen for themselves are a bit antisocial , even. This rules out a large percentage of games, I am afraid. The task, X, is spawned from the toolbox with the name “JustQuit”. The program environment (i.e. where global variables are looked up) is set to X. The variable resdir is the variable for a pointer to a buffer where the application’s path is stored, init registers X with the toolbox manager, the first { } says all wimp events and the second all toolbox events please, the wimp-code mask is set to 257 (no null or keyboard codes wanted) and finally X is run. OK it is artificial, all the effort goes into using ResEd to define the Resources file, but it is compact.
|
Andrew Rawnsley (492) 1445 posts |
I think some tutorials along the lines of this (ie. step by step, creating lua toolbox apps that do stuff) would make for a great magazine series. Perhaps accompanied by a “first steps in lua” to explain the syntax a bit. I know that when I was learning to write wimp apps, that level of simplicity would have been amazing, coupled with enough tutorial to take me through and explain the lua syntax. |
Rick Murray (539) 13851 posts |
While that is a valid opinion, would you not consider that there is a purpose for full screen graphics and such when learning the language? If I was learning, I would expect to take over the whole screen so that I can have the “instant gratification” of having circles and text and stuff on the screen.
Now put your hands up if you inserted teletext colour codes. Now put your hands up if you used variables and AND to cycle through all the available colours. ;-) It’s dumb stuff like that that can introduce what a program can do. |
Rick Murray (539) 13851 posts |
For those of us using C, BASIC, or (god help you!) assembler… that level of simplicity is amazing… |
GavinWraith (26) 1563 posts |
Oh yes, very much so. Cycling colours by exploiting the logical v. physical colours idea is literally eye-opening. The use of recursion to draw fractal shapes with very little code, is a real education. There is another area where I think newcomers to programming can be drawn in, which was never available to BASIC in the early days of Acorn; I refer to scripting with StrongED. You can do amazing things with text by dragging a short script onto the apply icon, using pattern matching and captures. I grant you that learning the syntax is a barrier, and it is not as sexy as graphics, but the payoff is huge. It could all be done in BASIC but only clunkily. I think I converted Jim Nagel to the advantages of small Lua scripts for lots of his editorial chores.
I will get onto this immediately :). |
GavinWraith (26) 1563 posts |
What I really need is feedback. I have put a sample page here and I draw your attention to these notes especially the section on chunks and upvalues. My problem is that I start churning stuff out and then suddenly realize hey, that is not what I intended to write . I know different people will tell me different things. There is masses of literature on Lua, though none with a specifically RISC OS slant. So am I heading in the right direction? |
David Gee (1833) 268 posts |
I get: Not Found The requested URL /lua/primer/chap1.html was not found on this server. Also, with reference to the notes, I suspect using IBTW, Fred Graute is working on AppLua—a Lua version of AppBasic—currently alpha status. |
GavinWraith (26) 1563 posts |
Sorry. Just replaced it. Try instead I take your point. Meanwhile a cry for help. RiscLua83 has ceased to function on my ArmBook. It looks as if ELF files are not handled properly. I get SWI &59D00 not known. If I enter *SOMstatus in a taskwindow on the ArmBook it says there are no libraries registered, I also found that the memory stick I had been using to transfer stuff to |
David Pitt (3386) 1248 posts |
That SWI is provided by the new ARMEABISupport module which should be in 500.Modules. The module is loaded by |
GavinWraith (26) 1563 posts |
Thanks David. It seems to have got lost here. That would explain why replacing SOManager 3.01 with SOManager 2.10 solved the problem. I will ask Andrew to email me a copy of ARMEABISupport and the correct SOM1stRun. |