A question about mixing spin and C [solved]
Reinhard
Posts: 489
Hello, I am currently working on graphics on the P2 (as can easily be seen in the imperfect picture).
Is there a possibility to mix with fastspin C-sources and spin-sources to a binary. I have in mind to use the NTSC examples of Chip as a video driver and to create the image content with C, i.e. to fill the bitmap buffer area.
Thank's
Reinhard
Is there a possibility to mix with fastspin C-sources and spin-sources to a binary. I have in mind to use the NTSC examples of Chip as a video driver and to create the image content with C, i.e. to fill the bitmap buffer area.
Thank's
Reinhard
Comments
Reinhard
I have this spin object in file NTSC_Frame.spin2
And the C - code is
global
and in main
give error
I am far away from spin programming.
I need a spin method foo, PUB foo, which in turn calls me the asm routine bar. Is that correct?
Thanks for patience
Reinhard
But I have not looked closely at this object, and I have no idea if this will work correctly. You'll also have to figure out where in memory the frame buffer is in order for the C code to write into that.
Yes, the frame buffer is located at 0x1000, and C code can write into with following steps: I tested this by first loading the program that writes the video buffer and then loading the NTSC_Frame.spin2 to see something on the monitor.
I make the change in NTSC_Frame.spin2 at the end of file: I can compile the spin2 file and it runs standalone, a composite video signal is generated and on monitor I can see random noise, the random content of bitmap buffer.
but with call from C: I get error:
In fastspin 4.2.0 or later the symbol case sensitivity is kept along with the symbol, so this isn't a problem. So your best bet is probably to upgrade to the newer fastspin, but changing to all lower case will work too (and will continue to work in 4.2.0).