FBS (or, an experiment of updating old code) (+source +game)
Posted: Sun Mar 07, 2021 3:18 pm
While I was looking at some old thread this week, I found an old experiment of mine from 2014, called FBS.
So I decided to see if this still compiles in 2021, using the 2.1 official version (shouldn't matter that much in this case.)
Source code and compiled version in enclosed in the zip file.
If you're not interested in the technical details of porting to 2021, then it's also fine to just play with it or read the (really old) code.
Anyway, it seems the differences between the 2012(!) and the 2021 compiler in this case, are very minimal, but important. And here they were all about the inline assembly functions. (PS. I kept the compiler options the same for the old and the current compilers.)
1) __CALLEE__ behaviour has changed. Back then the behaviour of callee was that the inline assembly code is responsible for the popping of the parameters. The current 2.1 instead adds all the POPs at the end of the callee function. So I added "ret"s at the end of each callee function so that those new POPs won't be invoked.
2) __FASTCALL__ behaviour has changed too. Back then all parameter declarations in the fastcall were ignored. In 2.1, inline fastcall functions with an input parameter starts with "push hl" instead of nothing. (and probably ends with something too, not checked). It seems that removing the parameter declaration will remove the push.
3) Oh, and the resulting tap file is twice the size now. No idea why. (No I haven't included the symbols or other output. I have no idea how to generate them. But I can generate them if you need them.)
I wonder why these things were changed. I can adapt to the function behaviour changes, but I'm worried about the size blow up.
So I decided to see if this still compiles in 2021, using the 2.1 official version (shouldn't matter that much in this case.)
Source code and compiled version in enclosed in the zip file.
If you're not interested in the technical details of porting to 2021, then it's also fine to just play with it or read the (really old) code.
Anyway, it seems the differences between the 2012(!) and the 2021 compiler in this case, are very minimal, but important. And here they were all about the inline assembly functions. (PS. I kept the compiler options the same for the old and the current compilers.)
1) __CALLEE__ behaviour has changed. Back then the behaviour of callee was that the inline assembly code is responsible for the popping of the parameters. The current 2.1 instead adds all the POPs at the end of the callee function. So I added "ret"s at the end of each callee function so that those new POPs won't be invoked.
2) __FASTCALL__ behaviour has changed too. Back then all parameter declarations in the fastcall were ignored. In 2.1, inline fastcall functions with an input parameter starts with "push hl" instead of nothing. (and probably ends with something too, not checked). It seems that removing the parameter declaration will remove the push.
3) Oh, and the resulting tap file is twice the size now. No idea why. (No I haven't included the symbols or other output. I have no idea how to generate them. But I can generate them if you need them.)
I wonder why these things were changed. I can adapt to the function behaviour changes, but I'm worried about the size blow up.