I've compiled an AmigaOS 4.x of a game engine I'm working on that uses PDCurses/SDL for the "graphics".
Don't know why but there are strange problems when I try to use the buttons on the numpad like:
1) numlock has to be set to off (instead of on) in order for keys to produce numbers
2) when numlock is off and pressing and releasing a numpad key it gets stuck until I press another key sending the input event over and over
3) not all numpad keys produce correct codes even with numlock off
The main input loop is pretty simple ATM and looks like this:
PDCurses version used is latest 3.4 one compiled with:
int input; while ((input = getch()) != KEY_ESCAPE) { switch (input) { case '1': Move(map, cx, cy, -1, 1); break; case KEY_DOWN: case '2': Move(map, cx, cy, 0, 1); break; case '3': Move(map, cx, cy, 1, 1); break; case KEY_LEFT: case '4': Move(map, cx, cy, -1, 0); break; case '5': Move(map, cx, cy, 0, 0); break; case KEY_RIGHT: case '6': Move(map, cx, cy, 1, 0); break; case '7': Move(map, cx, cy, -1, -1); break; case KEY_UP: case '8': Move(map, cx, cy, 0, -1); break; case '9': Move(map, cx, cy, 1, -1); break; default: fprintf(stderr, "Unknown input: %02x\n", (unsigned int)input); break; } RefreshScreen(disp, map, cx, cy); }
$ tar -zxf ~/Downloads/PDCurses-3.4.tar.gz $ cd PDCurses-3.4/sdl1 $ make CC=ppc-amigaos-gcc SFLAGS=-I/SDK/local/common/include/SDL SLIBS=-lSDL DEMOFLAGS=-use-dynldThe AmigaOS 4.x test program I made can be downloaded here: http://dl.dropbox.com/u/26599983/cursesgame.7z I also compiled a Linux version using normal curses under Ubuntu and it works fine there (I haven't gotten either X11 or SDL PDCurses to compile under Ubuntu so I wasn't able to check if it was a general PDCurses bug or an AmigaOS/SDL specific one).