Jump to content
IGNORED

I need help, I'm a bit stuck at the moment


disjaukifa

Recommended Posts

Check out the shared sprite data example in this thread: http://www.atariage.com/forums/topic/109288-code-snippets-samples-for-bb-beginners/

 

RevEng, that is exactly what I was looking for. I had looked in that thread before I asked but somehow I missed it. I can't tell you how much code that is going to save me!!!.

 

Thanks

Disjaukifa

Link to comment
Share on other sites

Check out the shared sprite data example in this thread: http://www.atariage.com/forums/topic/109288-code-snippets-samples-for-bb-beginners/

 

Hey RevEng,

 

I tried getting this to work with my stuff last night and I couldn't I got a question for you, do you know if this works with bank switching and if it does, does it need some special coding to get it working correctly. I am going to try again to get it working tonight, I partially convinced I was doing something wrong.

 

Thanks

Disjaukifa

Link to comment
Share on other sites

do you know if this works with bank switching and if it does, does it need some special coding to get it working correctly.

I don't know which example you're looking at, but if you're using bank switching, the sprite data has to go in the last bank, because it has to be in the same bank that the display kernel is in. This is true whether you're sharing the sprite data or not. But if you really need to put some sprite data in other banks, then you can get away with it *if* you make a routine that will copy the sprite data into RAM, and then you point your sprites to the RAM location instead of a ROM location.

 

Michael

Link to comment
Share on other sites

Yeah, with bank switching you need to throw the sprite data in the last bank.

 

Normally that's where bB places all the player0/player1 data anyway, no matter where you place it in your code. Because the shared-sprite technique uses a data: statement instead of player0:/player:, bB doesn't know it needs to do this for you.

 

edit: dang! scooped by Michael! ;)

Edited by RevEng
Link to comment
Share on other sites

do you know if this works with bank switching and if it does, does it need some special coding to get it working correctly.

I don't know which example you're looking at, but if you're using bank switching, the sprite data has to go in the last bank, because it has to be in the same bank that the display kernel is in. This is true whether you're sharing the sprite data or not. But if you really need to put some sprite data in other banks, then you can get away with it *if* you make a routine that will copy the sprite data into RAM, and then you point your sprites to the RAM location instead of a ROM location.

 

Michael

 

Michael THANKYOU!!!!

 

See I somehow missed that, i was storing all that information in the . . . 2nd bank I think when I was trying to do it and it was just garage garbage, I couldn't make out what or how it was doing what it was doing.

 

I will try adding them to the 4th bank tonight. I thought I might have to go to a 32K since I couldn't share my sprites, but if this works 4K will be more than enough!!!

 

Thanks

Disjaukifa

Edited by disjaukifa
Link to comment
Share on other sites

Yeah, with bank switching you need to throw the sprite data in the last bank.

 

Normally that's where bB places all the player0/player1 data anyway, no matter where you place it in your code. Because the shared-sprite technique uses a data: statement instead of player0:/player:, bB doesn't know it needs to do this for you.

 

edit: dang! scooped by Michael! ;)

 

Yeah Michael beat you to it, but thanks for the reply, I kept trying to get it in bank 2 and it wouldn't work. After two hours I went to my backup (I back up my code before I make any changes) and just started working on other stuff.

 

Got another question and this one is simple. Do I have to bank3 labeled before I can put stuff in bank4? Hope that makes sense what I am asking.

 

Thanks

Disjaukifa

Edited by disjaukifa
Link to comment
Share on other sites

Yup, that's right.

 

I really can't you guys enough. I don't know many programming forums where you can ask for help and people give it out without calling you a newbie or worst. This is now one of those places on the interest I will always cherish . I hope this forum stays like this forever. I know I am going to start trying to help others more I do this. I defiantly learned a fair amount in the last week I have been messing around with this stuff.

 

Thanks again guys!

Disjaukifa

Link to comment
Share on other sites

I don't know many programming forums where you can ask for help and people give it out without calling you a newbie or worst.

You're a newbie or worst!

 

(Sorry, I couldn't resist!) ;) :D

 

And if you say it over and over fast enough, it sounds like "New beerwurst, new beerwurst, new beerwurst, new beerwurst"-- which I presume is a bratwurst that's been soaked and cooked in beer!

 

Michael

Link to comment
Share on other sites

By the way, the simplest way to share sprite data between two sprites is to just declare it normally for one of the sprites, and then set the other sprite's variables to match the first sprite's variables:

 

  player0:
  %11111111
  %10000001
  %10000001
  %10000001
  %10000001
  %10000001
  %10000001
  %11111111
end

  player1pointerlo = player0pointerlo
  player1pointerhi = player0pointerhi
  player1height = player0height

If you do it that way, batari Basic automatically puts the data in the last bank, even if you put the code that defines the player data in one of the other banks.

 

Michael

Link to comment
Share on other sites

By the way, the simplest way to share sprite data between two sprites is to just declare it normally for one of the sprites, and then set the other sprite's variables to match the first sprite's variables:

 

  player0:
  %11111111
  %10000001
  %10000001
  %10000001
  %10000001
  %10000001
  %10000001
  %11111111
end

  player1pointerlo = player0pointerlo
  player1pointerhi = player0pointerhi
  player1height = player0height

If you do it that way, batari Basic automatically puts the data in the last bank, even if you put the code that defines the player data in one of the other banks.

 

Michael

 

I like it, I am going to have to try it!!!

 

-Disjaukifa

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...