2013-03-29

Monodevelop rules!

I recently gave another look at Monodevelop. Wow. Just wow. A lot of progress has been done since last time I tried it.

Look at it, in all its XFCE glory:
Elegant and well-designed


And there is even NuGet support:
 
Look ma! Without hands!

I like the auto-completion even better than Visual Studio. It's a pity the IDE detects LINQ syntax and 'var' as errors, but still I can live with that.

A small edit

A change which I did was to modify /usr/share/liteide/litebuild/gosrc.xml regarding the build working directory, see highlighted part:


Conclusion

I usually don't have these nice words for most of the UIs I use on Linux, so compliments to all contributors and Xamarin for this quality open source product!

2013-02-10

Go-SDL with callback support: done!

It is always fashioning to discover the type of big challenges that can arise from an apparently trivial task, like porting an ncurses game to Go! language. It's like watching the unexpected chessboard developments that can happen between two beginners.

This time I wanted to add support for sound through SDL_Audio, so I came up with a decent square-wave generator and started using this Go-SDL fork for audio output.
Problem: SDL audio works with samples or callbacks, and my samples are generated on the fly, being simple PC-buzzer-like sounds.

Strangely enough, that Go-SDL package I found uses a very complex architecture of mutexes and hard-coded hacks to simulate possibility of sending audio synchronously from Go, and only continuous streaming is supported, no custom samples playing, although the API fingerprint seems like it could support it.

Without continuous playback, my game was condemned to display
ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred
 from time to time during gameplay. And that sucks.

The cage of Love where Go
is currently held prisoner without
proper support of C integration
I came in contact with author, and the end of a short discussion I wanted to roll my own version using CGO callbacks, easy done, but then I met this guy:
runtime: cgo callback on thread not created by Go.
runtime: signal received on thread not created by Go.
I digged a bit and found out the reason behind it, basically Go language is not (yet) that well-integrated with C language.
However, thanks to Roger Peppe's callback package it is possible to use C callbacks in Go, like Gordon K. did for PortAudio. It is a hack, but a nice one.
At this point I was going to use PortAudio because it already uses that callback package, but PortAudio has an extra "feature": incredible garbage in the console terminal, and that was not going to be bearable for my little ncurses game.

So I armed my fingers and started coding a fix, here's the result:
https://github.com/neagix/Go-SDL
I removed most mutexes and synchronization black magic and I am now using a single synchronous channel for samples mixing, and it has also support of custom sound-generation callbacks. The cherry on top is that it comes with a nice PC-speaker buzz sound simulator, for all you nostalgic BEEP guys :)

Talk about how much you can learn with a such a simple game :)

At the end of this coding adventure I have to agree with Otstol that it is a huge limitation (to usage&adoption) that Go! language does not sport better callbacks support. I am quite sure all these fireworks will soon be obsolete because the Go Authors will fix this ;)

* = the game in question is Langwar, my battering ram used to discover the Go! language and also bring back what I recognize with some nostalgia as a classic game useful for learning programming

Update 16 June 2013: thanks to G. Klaus for letting me know about Go having fixed the issue, I have now updated my fork of Go-SDL

2013-02-03

The sorry status of Go! IDEs

It is indeed the IDE which makes a developer feel powerful or powerless in front of common modern development challenges; I have used the most common IDEs, amongst the best I recall Visual Studio 6, Borland Delphi and NetBeans, that I still use nowadays.

In my recent adventure at using Go! language to port a simple game, I've found that Go! does not (yet) have an IDE made with love and care for the language.

I've tried Go-IDE (horrible MDI, will reopen the same file and cause crosswrites), NetBeans with the (in)famous plugin (IDE will not search into .go extension files, no Ctrl+click support, no nothing, just syntax highlighting) and then reverted back to my good old Geany.

 
Actually I've found that with the changes explained here:

http://go-lang.cat-v.org/text-editors/geany/

It becomes a really good deal. Now back to coding ;)

Update 29 March: I found what I was looking for, golangide, awesome! :)

2013-01-27

The state of SNES emulation on Raspberry Pi

Some weeks ago I started tweaking basically all Snes9x forks around, questioning the possibility to run decent SNES emulation on Raspberry PI.

First, I went for the pure approach, porting the current Snes9x git master (1.53) to Raspberry Pi, that was however barely usable. byuu's new sound core is very precise but makes it slow (this has become riddle for me, right now).
As second attempt I merged the spc700 sound core from a snes9x-0.40 version (by notaz, ported to Symbian); this was effectively the pre-byuu sound core, and the backport was bloody. As a result, it didn't work: a few samples were being produced resulting in no sound at all.

On my third attempt I looked at the current Pandora port, snes9x-1.39ff, and that worked better; after some hard work it could successfully run. I added native OpenGL ES display support (already added to previous attempt) and then started tinkering with the input code. I stopped after finding a weird bug with the new keyboard input (game input freeze, possibly unrelated to my additions). Ideally I would have added native keyboard and joystick support.

Nowadays there's to say that I've lost most interest on working on this project, thus I've released my patched work as-is, and going on to my next challenge. :)

With this project I was slowly restarting with C/C++ and hacking around; this work, although not completely successful, has taken quite some effort! In the end I will listen to the advice of Toad King, that basically we don't have the numbers to make this work.

I don't want to set a trend of many interrupted projects, but eventually I will sit on something that I like :P

2013-01-20

My first RaspberryPi release

I have been tinkering a lot with Snes9x codebase and I was able to successfully use the hardware-accelerated display. Cool :)

In this process I've read many OpenGL ES tutorials and also seen some 2D examples about how to render on Raspberry PI, thus I wanted to properly format my achievements into a static library for multiple reasons: to help other newbies, to have it in good shape for my next Raspberry Pi 2D projects, and to sharpen my long-forgotten C++ skills :)

The library is C++ (with some C), not really packaged for portability but you should be able to use it with little efforts. There are some nice&interesting features, like:
  • support for hardware-provided scaling
  • tileset loading from PNG and index-based tile selection for drawing
  • render-to-texture (this is what you will use to port other software to Raspberry PI)
I am also using render-to-texture on the snes9x-rpi port (not yet released), thus I will mantain this library at least for some time.


Any feedback welcome! Enjoy

2013-01-05

RaspberryPi ideas

I have been playing/tweaking/hacking with my RaspberryPi for some months now. The device has indeed some use; its limited power is a good constraint to keep focused on good programming practices and embedded systems development, that is one area of expertize that I loved in the past and still fosters my curiosity.


Some projects that I would like to complete as a hobby are:

I will document the progress and of course properly publish the projects in a genuine open-source way.

Hello world!

A few words about myself: I could be considered a software developer on steroids, with a large interest area that I continuously feed by reading and learning (that's how I gained interest in IT). For the purposes of this blog I will not use my personal identity, I will talk about software development and other related tales.
8bit mario kart by killdoser666

After about a decade I finally convinced myself that blogging is not so bad - after all. Talk about stubborness.. ;)

It has actually been a combination of different factors pulling me back from using the blogging medium so far; first of all, I saw its very beginning and I was not convinced about the professionality or inherent value of blogs. I was probably struck by some very bad personal diaries back then. I made up my mind that there were better ways to present projects, persons, news etc. but I have changed this idea now.

It is clearly possible to use blogs in the right way (TM), and I am here to start practicing. So please be critic, I want your feedback!