Jump to content

Photo

8.8 fixed point help please


7 replies to this topic

#1 Tony The 2600 OFFLINE  

Tony The 2600

    Moonsweeper

  • 389 posts
  • 1.19 MHz
  • Location:Adelaide, Australia

Posted Tue Oct 30, 2018 2:13 AM

Hi all,

 

Having some sort of issue and not understanding where im going wrong.

 

For some reason i can compile the code fine if using integers only but as soon as i use decimal points it's saying syntax error. Not sure if its because im using it with the DPC+ kernel or something simple is missing.

 

Anyway here is the bas file if someone can take a quick look that would be much appreciated thanks.

 

Attached File  default.bas   3.83KB   9 downloads


Edited by Tony The 2600, Tue Oct 30, 2018 2:14 AM.


#2 Lewis2907 OFFLINE  

Lewis2907

    Moonsweeper

  • 285 posts
  • Location:Senatobia, MS

Posted Tue Oct 30, 2018 8:02 AM

When I get box work today I will take a look at it if no one else responds before then.

#3 Karl G ONLINE  

Karl G

    Dragonstomper

  • 561 posts

Posted Tue Oct 30, 2018 9:30 AM

I'm not sure why you were trying to define variables in a different bank, but that was what was confusing bB.  I moved the variable definitions to the top like normal, and got rid of the goto to and from where you defined them.  I commented out the fixed_point_math include as it only applies when you mix 4.4 ad 8.8 types in operations, and doesn't work with the DPC+ kernel, anyway.  It seems to work after making these changes.

 

Attached File  fixed.bas   3.96KB   4 downloads



#4 Tony The 2600 OFFLINE  

Tony The 2600

    Moonsweeper

  • Topic Starter
  • 389 posts
  • 1.19 MHz
  • Location:Adelaide, Australia

Posted Wed Oct 31, 2018 3:19 AM

I'm not sure why you were trying to define variables in a different bank, but that was what was confusing bB.

 

Thanks for having a look, yeah i started getting into the habit of defining the variables in bank6 because i would sometimes run out ROM space in bank1. Usually it was only with larger project but kind have got used to it.

 

Yeah seems a bit strange as the only warnings i was getting was a syntax error for the decimal values. Im sure there is a reason why bB was confused beyond my knowledge. Anyway thanks for picking up on the issue for me.

 

EDIT: I noticed you have defined the variables before bank1, interesting i never knew the was possible.


Edited by Tony The 2600, Wed Oct 31, 2018 3:27 AM.


#5 Lewis2907 OFFLINE  

Lewis2907

    Moonsweeper

  • 285 posts
  • Location:Senatobia, MS

Posted Wed Oct 31, 2018 5:00 AM

This link will assist you from RT site.

http://www.randomter...tml#dpc_harmony

It has a DPC template and more information. From what I recall bank 1 uses a lot of space for Vbkank (I think or something similar). You define everything in there though like dim, def, const, etc. Hope this helps you with you game.

#6 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 28,789 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Wed Oct 31, 2018 6:48 AM

EDIT: I noticed you have defined the variables before bank1, interesting i never knew the was possible.


You might want to look at this:

Parts of a Program



#7 Karl G ONLINE  

Karl G

    Dragonstomper

  • 561 posts

Posted Wed Oct 31, 2018 9:48 AM

Variable definitions shouldn't affect ROM space.  What you are doing is giving a readable name to areas in RAM.



#8 Tony The 2600 OFFLINE  

Tony The 2600

    Moonsweeper

  • Topic Starter
  • 389 posts
  • 1.19 MHz
  • Location:Adelaide, Australia

Posted Thu Nov 1, 2018 1:33 AM

This link will assist you from RT site.

http://www.randomter...tml#dpc_harmony

It has a DPC template and more information. From what I recall bank 1 uses a lot of space for Vbkank (I think or something similar). You define everything in there though like dim, def, const, etc. Hope this helps you with you game.

Yeah i use the DPC+ kernel template that comes with vbB, that exact one however i started defining variables in other banks that have more room. Thanks for the tip though

 

You might want to look at this:

Parts of a Program

Yeah i have your site book marked and always open your web page as a guide for whenever needing it. Without your website i would still be that plastic bag blowing in the wind. It's taught me alot from data arrays, stack pointers, to multi-sprites and so on. Im chipping away piece by piece of all the functions and features from the site and 8.8 fix points was my next project.

 

Basically my way of learning is to make an individual program for each of the features that does one thing/function so i can get a full understanding. Can't thank you enough for the effort and time you have put in to help teach us novice programmers by providing the website. Along with every other member that contributes.

 

Variable definitions shouldn't affect ROM space.  What you are doing is giving a readable name to areas in RAM.

I once had an issue a long time ago compiling after clearing all variables and writing a big list of dim's. Thinking it was the variables using all the space left in bank1 i moved it to another and it compiled. The error log did say there was 0 bytes left in back1 although maybe it was a different issue i wasnt aware of, i have no idea.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users