Jump to content
IGNORED

Separating bank code into files


mksmith

Recommended Posts

Hi,

 

I'm working on my DPC+ game and it's all starting to get a bit large to easily edit. Can you separate each bank's code into it's own files and merge it back together on compile? I've looked at include, includesfile and inline and these don't appear to work in this situation. Any suggestions?

 

Thanks!

Link to comment
Share on other sites

[...]Can you separate each bank's code into it's own files and merge it back together on compile?

A bB program can only include assembly programs, not other bB programs. This functionality isn't impossible, but would require a fair bit of restructure for bB to accomplish.

 

As Muddyfunster suggests, you can use vbb or whatever editor supports bookmarks. I use "section descriptions" that are easily searched in my editor of choice. (vi) Or you could split your source apart into separate files, and combine it right before compiling with a custom batch-file/shell-script.

Link to comment
Share on other sites

Thanks guys - yeah using VbB so will check out bookmarks. Would be great to have that ability though.

 

@Lillapojkenpåön - I've got a bit of a process built now (see here) but would love to see any other examples of the sprite/color stuff. bB has some interesting things you can do but also what you have to work around. The biggie for me now is the 256b limit for data tables and whether there is a way to work around that - otherwise there is a bit of if then checking to work out the data pointers. I did find a macro can give a bit of flexibility around setting stuff from pointers:

 macro SetPlayer0Frame
 rem {1}=datapointer {2}=frame

 rem set data pointer
 asm
  LDX #<{1}
  STX temp5
end
 rem set frame
 player0pointerlo = temp5+({2}*Height)
 asm
  LDA #((>{1}) & $0f) | (((>{1}) / 2) & $70) 
  STA player0pointerhi 
end
end

 macro SetPlayer1To9Frame
 rem {1}=datapointer {2}=spritenumber {3}=frame

 rem set datapointer
 asm
  LDX #<{1}
  STX temp5
end
 rem load sprite pointer
 asm
  LDA #<(playerpointers+({2}*2))
  STA DF0LOW
  LDA #(>(playerpointers+({2}*2))) & $0F
  STA DF0HI
end
 rem set frame
 DF0WRITE = temp5+({3}*Height)
 asm
  LDA #((>{1}) & $0f) | (((>{1}) / 2) & $70) 
  STA DF0WRITE
end
end
Edited by mksmith
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...