![]() |
Compiler's heretic behaviour - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15) +---- Thread: Compiler's heretic behaviour (/showthread.php?tid=182) |
Compiler's heretic behaviour - apenao - 03-15-2010 I don't know how to call this, but heretic might be close. Let me explain what happens: I'm making my crap game and I'm following strictly the programmers manual of good practics, you know, first I do the loading screen, then I do some graphics, sprite first and then the backgrounds and at last I try to do some code to move the whole thing with QAOPM (it could be I'm reading the manual upside down, yes). Now I'm at the stage where I have the sprites done and I'm making the rooms' background. At this stage I just draw it all on the screen and when I'm happy with an item I add a ' before the line to make it a coment and move on to the next item. When I have everything, I will sort it all out. Well, I had the first room layout. I did a carpet to decorate it. It was ok so I greyed it out (with the ' ) and started to desing a "David Star". When I print it, the first two graphics of the sprite data (which happen to be the mask for the sprite looking down) are corrupted. Somehow it seems that the background data (made with plots and draws) is overwritting the beginning of the sprite data. The strange thing is that if I print the carpet first and over it I print the star, nothing happens. And if I print the star making it double lined, everything is OK too. So I'll send you a package with the code and attachements so you can check it if you want. No need to hurry up, I can workaround it and go on with the game. Apenao ![]() Re: Compiler's heretic behaviour - britlion - 03-15-2010 I'm tied up with something else right this minute, Apenao - so I haven't really looked - but are you compiling with -O3? Try without as well. My football game has some issues with -O3 in the graphics department. *lion* Re: Compiler's heretic behaviour - apenao - 03-15-2010 Mmm I forgot to mention. That's without optimization at all, I haven't tried with optimization yet. But I've done several drawings an got the same results. It seems that the graphic gets corrupted when there are just a few draw sentences after a plot. Say 4 or 5. If the picture is more complex, the corruption disapears. Strange. Re: Compiler's heretic behaviour - apenao - 03-15-2010 Well, I've just tried with optimization -O 2 and got the same result. But with optimization -O 3 it compiles and the result is OK. Re: Compiler's heretic behaviour - boriel - 03-16-2010 apenao Wrote:Well, I've just tried with optimization -O 2 and got the same result. But with optimization -O 3 it compiles and the result is OK.At first sight, it seems the compiler is getting confused with an ASM data block not being isolated from the main execution code. So I enclosed it between SUB FASTCALL xxx and END SUB, and it worked. Also added a fake call Gentlecillo() to avoid -O3 to remove this sub. Code: SUB FASTCALL Gentlecillo Code: SUB FASTCALL eSprite |