Jump to content
Sign in to follow this  
jbs30000

Include files

Recommended Posts

I decided to rewrite my Super Mario program because the code desperately needs to be cleaned up. So first I made definitions for all of the variables of "a". Then, in order to make things look neater, I put them in a file named SMarioM.h and put the file in the bB\includes folder.

 

I then put include SMarioM.h in my main program. When I compile it seems to be OK, but if I try to use any of the definitions they aren't recognized, so obviously my include file isn't be read.

 

Here's what my main code looks like:

rem Rebuilding Super Mario Bros with hopefully better code.
include div_mul.asm
set kernel_options player1colors pfcolors no_blank_lines
set romsize 32kSC
const pfres=32
set smartbranching on

rem **************************************************************************************************
rem * This file uses all the bits in variable "a" to set or check on various attributes about Mario. *
rem **************************************************************************************************
include SMarioM.h



bank 2

bank 3

bank 4

bank 5

bank 6

bank 7

bank 8

Share this post


Link to post
Share on other sites

I should also note that I played with the path, even putting in

include c:\Atari2600\bB\includes\SMarioM.h

 

It still doesn't work.

Share this post


Link to post
Share on other sites

What does SMarioM.h contain? If it contains the original bB dims, it won't work - typically .h files contain assembler-friendly equates.

 

However, there is an automatically generated file called 2600basic_variable_redefs.h that contains the dims converted to equates, among some other things. You can pull just the converted equates you need out of the generated 2600basic_variable_redefs.h and make the SMarioM.h out of them. Make you sure only pull out the converted equates or you might get errors. They should be fairly simple to identify.

Share this post


Link to post
Share on other sites

They're all defs

Here are a few lines of code

rem **************************************************
rem * Make or check if Mario is small or large. *
rem **************************************************
def Shrink_Mario=a{0}=0
def Mario_is_Small=!a{0}

def Grow_Mario=a{0}=1
def Mario_is_Large=a{0}

Share this post


Link to post
Share on other sites

OK, thank you for the information. It's good to know. I tried changing the extension of my include file to bas, but that didn't work either.

 

No big deal, I just wanted my program to look a little less crowded.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...