
@andreiformiga After you gave me that ffi example with sdl I started to get interested in doing some sdl myself. It was going fine until I implemented SDL_LoadBMP. I get an error (The specified procedure could not be found.; errid=127)
. Have you had this problem? Any ideas?

@mark.warren I don’t remember having this issue. If it’s any help, my code is here: https://github.com/tautologico/rasdel

In the examples
dir there’s a program that loads bmp

@andreiformiga Thanks I’ll take a look, probably something basic.

@andreiformiga Looks like you are using SDL_LoadBMP_RW not SDL_LoadBMP. Maybe SDL_LoadBMP is obsolete.

I think I used the RW form because it’s more versatile, I don’t remember exactly

Fair enough.

my plan was to release this as a package eventually. part of the code is based on the racket-sdl
package but it was not working properly and I changed bindings to the functions I used to improve their interface (at least for my tastes)

Looks good. I’m just playing. Trying to improve my knowledge of ffi.

@mark.warren here is a Coleco Vision emulator (incomplete, no sound yet etc) that uses this code: https://www.youtube.com/watch?v=gj-7rGGjT8I

@andreiformiga That’s very cool.

you can see many bugs in this video, I have to clear some time to debug Z80 code :slightly_smiling_face:

All part of the fun :grin:

right now it’s all racket code, except for the SDL of course

Is it a full Z80 emulator?

Yes. Passes all but one of the ZEXALL tests

There are a few details missing but it emulates the Coleco Vision and MSX computers

Probably other hardware too but I only have the video chip working for these two :grinning:

Sweet

@andreiformiga Aha! Found out why SDL_LoadBMP is a macro for SDL_LoadBMP_RW. Should have looked in the header file first #define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)

oh right, I think that was the reason :slightly_smiling_face:

:grin: You don’t close the file in the example, is that not necessary? Because RWClose is a macro to close
which is not in sdl.

I think it would be better to close the file :slightly_smiling_face:

Probably

I’m not sure but I think that loading from a file in one call does not leave the file open

I’ll check that

The RW functions in SDL are a kind of generic facility for streams

maybe RWClose is to be used with streams that you open… in the case of loading the image from a file the stream is opened and closed internally… I think. Better check that

Cheers, will do