Beginning Wimp Programming in C
Pages: 1 2
François Vanzeveren (2221) 241 posts |
Dear all I recently bought the official DDE v26 from ROOL.
I precisly followed the book to create the !Run, !Sprites and !Sprites22 files. I configured my C projet using !Make with !RunImage as target, so as to have in my !Test folder the above files. If anyone can help… Thank you in advanced François |
David Pitt (102) 743 posts |
Try a larger WimpSlot and/or verify the syntax of the relevant line :-
That bracket is not entirely correct. |
Chris Mahoney (1684) 2165 posts |
I’d go as far as saying that it’s not correct at all :) Also, although Make will still work, it’s deprecated and you’re now encouraged to use shared makefiles. I might write a (short!) tutorial if there’s some interest. |
David Pitt (102) 743 posts |
I’ve just tried it here and the error is “(Number)”! |
François Vanzeveren (2221) 241 posts |
David Thank you for pointing this. Stupid error! Regards |
François Vanzeveren (2221) 241 posts |
David Thank you for pointing this. Stupid error! Regards |
David Pitt (102) 743 posts |
Well not really, the error message was not that helpful, and all of us do typos! |
Steve Pampling (1551) 8172 posts |
It’s known as a “typo” – short for typographical error. I tend to refer to them as “digital errors” since a digit1 poked the wrong key :) 1 A finger in this case. |
David Pitt (102) 743 posts |
I am sure that would help, those Makefiles are a bit eye-watering at first sight. |
Colin (478) 2433 posts |
Make it longer :-) and do a tutorial based on the DDE-Examples.skeletons.exampleapp as it comes with DDE. While !make is deprecated it was an easier way into C for newcomers the new method assumes a lot of C knowledge I think.
You can say that again. I can just imagine the person that wrote it thinking this will make it easier for everyone. I think if I was just starting I’d just use !cc that comes with DDE and just compile a single file – just to get a feel for the language and not get bogged down in makefiles That would be the nearest thing to how people use basic. Then you can tackle makefiles when you understand a bit more. |
Alan Robertson (52) 420 posts |
I too would find that useful and interesting, and I’m sure it would be a great addition to the RISC OS Open Wiki. |
David Pitt (102) 743 posts |
those Makefiles are a bit eye-watering at first sight. I think, once one has got one’s head around it all, that it probably is easier than it looks. All the user has to do is to interface with the Shared Makefile with a user Makefile of additions or amendments. The learning curve is the syntax of that user Makefile.
The DDE-Examples reflect that, there is no user Makefile for ‘HelloW’. |
Steve Fryatt (216) 2105 posts |
I think I’ve been trailing some vapour-documentation for a while now, covering the writing of Wimp stuff in C. They’re still far from complete (and stop before anything representing a useful application gets produced), but since the first couple of chapters deal with using the DDE, Shared Makefiles and OSLib, I probably ought to make them available. The documentation is here: http://www.stevefryatt.org.uk/docs/wimp/ If you’re specifically after compiling, then there’s a chapter on compiling code using the desktop front-end and that leads on in to converting the process to use Shared Makefiles Constructive criticism is welcome, but please remember that it’s not finished! ETA: I should probably add that the documentation does not use the Toolbox. That’s because I don’t use it either (inertia, mainly), and because the original aim of the project was to get some documentation out for my Wimp library to make it more useful than just a blob of code on my website. It hasn’t progressed that far yet. |
David Feugey (2125) 2709 posts |
Thanks. Cool, and easy to understand. |
Chris Mahoney (1684) 2165 posts |
Neat. Now I don’t need to write anything :) |
David Feugey (2125) 2709 posts |
Time for a TCC port? :) |
Steve Fryatt (216) 2105 posts |
You’re aware that OSLib is just calling the SWIs directly? Despite the ‘lib’ in its name, OSLib is just a suite of type safe veneers around the system’s SWIs. There’s no extra code in there. UnixLib’s a red herring, too. UnixLib is an alternative to the Shared C Library (with additional functionality), and is at a level higher up than OSLib. If it helps, consider that OSLib contains veneers around the SWIs that initialise the Shared C Library. With OSLib available, it’s hard to see why anyone would use _kernel_swi() or _swi() in new code. They all do the same, but OSLib is the only one that doesn’t require the user to cast everything to and from int each time. |
Colin (478) 2433 posts |
While I would agree that it is better to use oslib for type safety, you can’t compare it to _swix for ease of use so it’s rather obvious why no one uses it. Invariably you are reading the programmers manuals to work out what you are doing where it tells you the register values to call. At that point you can either use _swix – which requires no typecasting – or search through the oslib libraries looking for the header file which has the function you want and then you have to work out how oslib has mapped the swi to the function. Added to that anyone who wants to modify your code who is not familiar with OSLib but wants to keep the programs ‘style’ has the added hastle of working out oslib. This together with the fact that _swix is always up to date – changes to the os does not need any changes – makes _swix the way to go for me. |
Chris Johnson (125) 825 posts |
I was under the impression it was still used. I certainly use it – I started using it once I decided to convert all my stuff to C, rather than the original Basic (using !ABC to compile the bigger apps). I have always found oslib very useful. There is a good StrongHelp manual for it, which is much quicker to use than the PRMs. Oslib also has some higher level support libraries. I found the event library and the message library helpful. Just my 2d. |
Colin (478) 2433 posts |
I would hope it is but I wouldn’t let it any where near any of my projects unless I was releasing it as GPL. I know no-one agrees with me so I hope this doesn’t spread like the ususal GPL thread but in my view OSLib is released with a GPL licence and although the web site history says this has been relaxed so you can use it in commercial software that ‘relaxation’ doesn’t appear in the license the only licence you have is GPL.
I prefer searching the pdf manuals as they are definitive. |
Rick Murray (539) 13851 posts |
If you don’t like OSLib, there’s always DeskLib. ;-) |
Colin (478) 2433 posts |
I have no problem with OSLib what it does it does well, my problem is the effort involved with using it and my perception of the licence that it won’t let me use my own licence for my code. If I liked using OSLib and was writing GPL great. In a similar way I have a problem with the DDE. As far as I can see I can only use it’s libraries with Castles ROM licence so as I see it I would have to release my code with a compatible licence. So I now only tinker with the ROM and won’t be writing any Apps for distribution. People will say my interpretation is wrong but as I see it without clarity in the licence these products are of limited use. |
Vince M Hudd (116) 534 posts |
“Because I can” :p There is a little more to my reason than that, but that’s all it really needs to be, with no further justification. |
Chris Mahoney (1684) 2165 posts |
Most of the relevant files seem to say “[This file] may be used freely in the creation of programs for Archimedes”. While the wording is out-of-date, I don’t see any issue with creating commercial apps under any licence you choose. It’s really difficult to search for the word “licence” in the DDE though, because virtually every file has the Castle boilerplate on it too! |
Steve Fryatt (216) 2105 posts |
The OSLib ReadMe says…
That seems fairly clear: the OSLib code is GPL, but applications that you write using it don’t need to be.
The licence appears to be in the ReadMe file (as above), which in turn refers to the GPL for the OSLib code itself. You don’t have to rely on the website: it’s in the download archive. |
Pages: 1 2