Archives for Uncategorized

Freepascal Threading

Posted by ALB42 on 22. September 2013No Comments

A new Release of FPC for AROS is out today.
The only new thing is:

* Support for Threads (using TThread class)

Thanks to Mag, he supplied some example codes and the library wrapper unit in the FPC-AROS Wiki.
So my interrest was awaked and I need a little break from the boring basic library rewriting and documentary work.

Implemented id the TThread Class and the Critical sections functionality, “TEvents” are still not supported as long I dont know exactly how they are working, it seems its not directly possible to do such thing in AROS, maybe must self write a mechanism for it.

AROS Threads (with thread.library) have no chance to suspend/kill from outside and so on.
The suspend I managed with a Mutex Condition, wich can be fired with a “resume”, but this makes it impossible to Suspend the Thread from outside. But this is not allowed at some other platforms as well, Resume and Suspend are even marked as deprecated in newer Delphi/Freepascal versions.
I known a nice replacement for Suspend is the TEvent feature which is still not available for aros… but I’m working on this until this the suspend inside the thread and resume from outside must do it.

An example for the us of threads with suspend resume and critical sections can be found in pp/fp/src/threadtest.pas inside the archive

Buggy Bugs and difficult keys

Posted by ALB42 on 15. Januar 2013No Comments

Sometimes when a Button or so is destroyed in runtime the software crashed because in the messageport still some messages for this particular object and I have no chance to see if it is still alive.

First Idea was to poll all messages before destroy this windowthis was implemented when writing the Message for 07.01.2013 in this blog the first error report. But now I noticed sometimes a stack overflow appear when large windows are closed.

When searching for CloseWindowSafely Amiga  you find a lot of source snips which all do the same, remove all messages for this window from the messageport.
for example this
So the StripIntuiMessage is exactly what I need, conversation to Pascal is simple, the problem was it didn’t change the problem. I changed the routine that it counts how many messages are there and how many are removed. So at least it does something. Then I let the routine run twice one after the other so the second should not find a message and the overall should be smaller (because removed messages). I was surprised that the messages are not be removed.. so both runs are identical, I’m not sure whats wrong with my routine it does exactly the same as this C routine. So in the end I wrote a complete new routine, which gets all messages with GetMsg and then put them back with PutMsg when they not belong the removed window. Task done, now its working.

Another task I set for myself was the keybinding for fp-editor, and this is really crap, finally I think it would be easier to make a very big table for all cases, so all keys combinations with shift, alt, ctrl, sounds crazy but this keycodes have no real systematics. The most keys are working already… so menu keys, copy paste and so on, are working also mark text with keys is working, but still need some testing.

Wii und Beamer

Posted by ALB42 on 15. Mai 2008No Comments

Ich habe heute das erste mal Wii mit einem Beamer gespielt, ganz anderes Spielgefühl 🙂 Tennis macht viel mehr Laune und auch bei Splitscreen wird es nicht all zu klein, obwohl sich der Ball immer noch recht oft ausserhalb des Bildschirms befindet.Bei Excite Truck fühlt sich das Spiel viel schneller und schwieriger an… naja gut man ist es halt nicht gewöhnt 🙂  Aber ich glaube ein anständiger grosser Fernseher tut es auch so ein Beamer ist doch recht laut und teuer.