wxWabbitemu on Windows
This describes getting wxWabbitemu on Windows.
Many people have wondered - if wxWabbitemu uses wxWidgets, couldn't it be compiled and ran on Windows? To satisfy that curiosity, I've set off to do it myself.
- Remove any
WINVER
#ifdef
'd code. (That is,#ifdef WINVER
.) If you see a#elif WXVER
at the end of it, change it to#ifdef WXVER.
- Change all the
build_wx
COMPILEC
commands toCOMPILECPP
. - Add in the typedefs for
u_*
- I think they are in theinclude/winsock2.h
file. (u_char
, etc.) - Comment out any broken code (I think there was some in the label.c file, but probably more... at LEAST two files need modifications via commenting out lines.)
- Test - recompile, fix, recompile, fix.
- Modify
gui_wx.cpp
to use a full frame (with caption/titlebar, minimize/maximize/close buttons, etc.). - Done!
It works... sort of. It has a seizure inducing flicker (of the screen). The window icon is also non-existent too (and of course the application icon).
![Open ROM dialog] (http://dl.dropbox.com/u/1016340/PublicPictures/wxWabbitemuWindows/wxWabbitemuOnWindows1.png) ![Calculator off] (http://dl.dropbox.com/u/1016340/PublicPictures/wxWabbitemuWindows/wxWabbitemuOnWindows2.png) ![Calculator on] (http://dl.dropbox.com/u/1016340/PublicPictures/wxWabbitemuWindows/wxWabbitemuOnWindows3.png)
The results of my experimentation are available online:
git clone https://github.com/alberthdev/wxwabbitemu.git cd wxwabbitemu git checkout windows-unstable-wxwabbitemu
You can use either the build_wx script (with MSYS) or the CodeBlocks project to get it compiled. HOWEVER, you MUST read the README first before doing so!
Is it possible? Indeed it is! Did I learn anything from it?
-
build_wx
is very, very, hacky, and Linux gives you leeway... perhaps too much leeway! In the future, the build script should have separate arguments (include, define, linking arguments) for each part of the program, and be able to truly use GCC instead of G++... :P - Windows-only code is useless in wxWabbitemu, and is a significant hassle when compiling for Windows, since all of the code wxWabbitemu references in that code is non-existent. Hacky
typedef
s also are needed to supplant any Windows only (like the capitalizedBOOL
oru_char
) or VC++ only (can't name any offhand) types. - Code in its current state is hacky - again, because Linux gives you that leeway. The LCD is flickery, even though it's not evident at all on Linux. The
wxFrame
also is given a border and 3 buttons, even though it isn't specified at all in the code. (This might be a bug though in wxWidgets - I'm not sure whether the style setting call appends an additional style attribute or replaces it. If it's the former, it's a bug.) The CPU usage was at 99% - also because of the LCD flickering? - Some files should be named
.cpp
instead of.c
. Again, Linux gives plenty of leeway, so this went unnoticed. (GCC will automatically pass any C++ code to its cousin, G++... I think.) - Code quality needs to improve overall!
- MSYS in rxvt is slow, slow, slow... but better to live with then the Command Prompt in Windows.
- CodeBlocks isn't a bad IDE, especially for MinGW. However, it does need improvement, as it fails to grab ModalDialog control, and as a result eventually crashes and burns. :P
That's it! Hopefully you've found it as interesting as I did! :)
Signing off, Albert H. (alberthdev)