A co-worker is asking for my help in trying to run the game "Breakout" which is found on http://www.sebity.com/games/breakout.php but we are stumped. We are using CLISP in Windows 7 32 bit OS, and we are have tried installing Quicklisp but we are encountering the "not a 32-bit integer: -1" error. We don't have any background on LISP and we are not even sure if the said source code could run in Windows.
Can anyone enlighten us please? TIA
Cannot run "Breakout" from sebity.com
-
- Posts: 78
- Joined: Mon Dec 01, 2014 12:29 pm
- Contact:
Re: Cannot run "Breakout" from sebity.com
Looks like this is the change (from December) that broke it:
https://github.com/lispbuilder/lispbuil ... 48a352186f
The inc-pointer with -1 must not work with CLISP. Question is, what is that piece of code intended to do?
https://github.com/lispbuilder/lispbuil ... 48a352186f
The inc-pointer with -1 must not work with CLISP. Question is, what is that piece of code intended to do?
-
- Posts: 78
- Joined: Mon Dec 01, 2014 12:29 pm
- Contact:
Re: Cannot run "Breakout" from sebity.com
Well, this is interesting. At least I learned something today. It's bugfuck nuts, but it's definitely something. See, the SDL_ListModes function—which is called by the code in question—has a return type of a pointer (specifically: a pointer to a pointer), but one of the possible return values is -1.
Now, I thought I was fluent in C, but I didn't even know that worked, since I was never mentally imbalanced enough to try it. The effect is to return an all-bits-1 pointer, or (depending on how you look at it, I guess) an actual 'negative' pointer. So the Lisp interface to SDL is attempting to replicate this idiom (as a load-time-value) in order to interpret the return value.
And CLISP, apparently, chokes on the idiom—I say apparently because I don't have CLISP installed, but CFFI:INC-POINTER is defined in terms of two CLISP functions that deal only with unsigned integers—namely, FOREIGN-ADDRESS-UNSIGNED and UNSIGNED-FOREIGN-ADDRESS. So somebody who knows CLISP should step in here and figure out how to cope with it.
Now, I thought I was fluent in C, but I didn't even know that worked, since I was never mentally imbalanced enough to try it. The effect is to return an all-bits-1 pointer, or (depending on how you look at it, I guess) an actual 'negative' pointer. So the Lisp interface to SDL is attempting to replicate this idiom (as a load-time-value) in order to interpret the return value.
And CLISP, apparently, chokes on the idiom—I say apparently because I don't have CLISP installed, but CFFI:INC-POINTER is defined in terms of two CLISP functions that deal only with unsigned integers—namely, FOREIGN-ADDRESS-UNSIGNED and UNSIGNED-FOREIGN-ADDRESS. So somebody who knows CLISP should step in here and figure out how to cope with it.