RevEng Posted September 22, 2009 Share Posted September 22, 2009 (edited) Check out the shared sprite data example in this thread: http://www.atariage.com/forums/topic/109288-code-snippets-samples-for-bb-beginners/ Edited September 22, 2009 by RevEng Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 22, 2009 Author Share Posted September 22, 2009 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 Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 23, 2009 Author Share Posted September 23, 2009 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 Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted September 23, 2009 Share Posted September 23, 2009 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 Quote Link to comment Share on other sites More sharing options...
RevEng Posted September 23, 2009 Share Posted September 23, 2009 (edited) 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 September 23, 2009 by RevEng Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 23, 2009 Author Share Posted September 23, 2009 (edited) 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 September 23, 2009 by disjaukifa Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 23, 2009 Author Share Posted September 23, 2009 (edited) 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 September 23, 2009 by disjaukifa Quote Link to comment Share on other sites More sharing options...
RevEng Posted September 23, 2009 Share Posted September 23, 2009 IIRC it won't work with just bank4 set. Just go ahead and define them sequentially anyway. The don't actually need any code in them. Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 23, 2009 Author Share Posted September 23, 2009 IIRC it won't work with just bank4 set. Just go ahead and define them sequentially anyway. The don't actually need any code in them. AHHH ok so I just need to like this bank 3 bank 4 Code here Right? Thanks Disjaukifa Quote Link to comment Share on other sites More sharing options...
RevEng Posted September 23, 2009 Share Posted September 23, 2009 Yup, that's right. Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 23, 2009 Author Share Posted September 23, 2009 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 Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted September 24, 2009 Share Posted September 24, 2009 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!) 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 Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted September 24, 2009 Share Posted September 24, 2009 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 Quote Link to comment Share on other sites More sharing options...
RevEng Posted September 24, 2009 Share Posted September 24, 2009 Nice trick! I've seen posts of several different round-about ways to share the sprite data, but that's definitely the best way to do it. Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 24, 2009 Author Share Posted September 24, 2009 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.