Lillapojkenpåön Posted September 19, 2018 Share Posted September 19, 2018 Is it possible to put all the animations of a sprite into one long sprite and change the pointer to which line to start reading from like I've seen done in the standard kernel? And would the sprite be limited to 255 lines tall then? Here's an example to copy and add to, let's say I added 5 to the variable f every frame and wanted that to be the offset, what would that look like? asm LDX #<mytext1 STX player0pointerlo LDA #((>mytext1) & $0f) | (((>mytext1) / 2) & $70) STA player0pointerhi end Quote Link to comment Share on other sites More sharing options...
Lillapojkenpåön Posted September 23, 2018 Author Share Posted September 23, 2018 (edited) nevermind, this worked asm LDA #<mytext1 STA temp5 end player0pointerlo = temp5 + f asm LDA #((>mytext1) & $0f) | (((>mytext1) / 2) & $70) STA player0pointerhi end Edited September 23, 2018 by Lillapojkenpåön 1 Quote Link to comment Share on other sites More sharing options...
+Muddyfunster Posted September 23, 2018 Share Posted September 23, 2018 What's the benefit in doing it this way? (genuine question, I'm new to this). It seems complicated for little benefit ? Quote Link to comment Share on other sites More sharing options...
Lillapojkenpåön Posted September 23, 2018 Author Share Posted September 23, 2018 (edited) I can only speak for the DPC+ kernel, I have quite a bit of animation in my game and before I was using "on goto" to jump to the sprites and "goto" to jump back to the loop again, and the regular way to load a sprite in bB like this.. (that I was jumping to and from..) player0: %11000000 %11000000 %11000000 %11000000 end outputs something like this when assembled, except the automaticly generated name playerL02841_0 will be different LDX #<playerL02841_0 STX player0pointerlo LDA #((>playerL02841_0) & $0f) | (((>playerL02841_0) / 2) & $70) STA player0pointerhi LDA #5 STA player0height and it puts the graphic in the graphics bank playerL02841_0 .byte %11000000 .byte %11000000 .byte %11000000 .byte %11000000 .byte %11000000 That's alot of duplicate code when the animation frames start adding up, if you can just use the same code and a tall sprite and a counter that make it works more like a filmstrip. I saved cycles and 3000 bytes (not counting the graphics bank) so it was very beneficial. It looks complicated to me to i have no Idea what #((>playerL02841_0) & $0f) | (((>playerL02841_0) / 2) & $70) does or even what pointers do exactly, the nice thing is that you don't have to to still get it to work. Edited September 23, 2018 by Lillapojkenpåön 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 23, 2018 Share Posted September 23, 2018 nevermind, this worked asm LDA #<mytext1 STA temp5 end player0pointerlo = temp5 + f asm LDA #((>mytext1) & $0f) | (((>mytext1) / 2) & $70) STA player0pointerhi end Where did the magical math come from? I should probably put a version of this on the bB page and link to the source of the information. Also, can "mytext1" be called anything the programmer wants? Quote Link to comment Share on other sites More sharing options...
Lillapojkenpåön Posted September 24, 2018 Author Share Posted September 24, 2018 (edited) Yes it can be called anything, I made an example you can play around with, it uses playerheight instead of deathbits example.bas press up down left or right to blow the robots up, and fire to reset them Edited September 24, 2018 by Lillapojkenpåön 3 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 26, 2018 Share Posted September 26, 2018 Yes it can be called anything, I made an example you can play around with, it uses playerheight instead of deathbits example.bas press up down left or right to blow the robots up, and fire to reset them It compiles, but Stella doesn't come up when I try to run it. I'm guessing that I need to upgrade Stella. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted September 26, 2018 Share Posted September 26, 2018 It works for me with Stella 5.1. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 26, 2018 Share Posted September 26, 2018 It works for me with Stella 5.1. I'm using 4.6, so maybe that's the problem. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 26, 2018 Share Posted September 26, 2018 I'm using 4.6, so maybe that's the problem. This is annoying. I downloaded Visual C++ Redistributable for Visual Studio 2017 (vc_redist.x64.exe) and Stella-5.1.3-x64.exe and now Stella won't even run. I get this pop up message: Quote Link to comment Share on other sites More sharing options...
+Karl G Posted September 26, 2018 Share Posted September 26, 2018 Did you get the x64 version of the runtime? If you got the x86 version, then that might explain why it can't find it (32-bit version). 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 26, 2018 Share Posted September 26, 2018 Did you get the x64 version of the runtime? If you got the x86 version, then that might explain why it can't find it (32-bit version). Yep, the x64 version. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted September 26, 2018 Share Posted September 26, 2018 Uhh...maybe try rebooting? Or ask in the Emulation forum to see if anyone has any better ideas. 1 Quote Link to comment Share on other sites More sharing options...
Lillapojkenpåön Posted September 27, 2018 Author Share Posted September 27, 2018 It compiles, but Stella doesn't come up when I try to run it. I'm guessing that I need to upgrade Stella. That happens to me all the time, didn't know it was contagious, sorry 1 Quote Link to comment Share on other sites More sharing options...
+mksmith Posted December 27, 2018 Share Posted December 27, 2018 (edited) HI, I'm currently working on a platform game for DPC+ and have a lot of animation for the player - this is exactly what i'm looking for to create a animation engine to go with it. One question - how can I change the pointer to another set of animations ie. moving, jumping, falling etc. I've played around with diming a variable and referencing a starting animation and then changing that variable to another animation in data but it doesn't change - i'm assuming the compiler maybe hard-coding this into the asm which would in some ways make an animation engine reasonably difficult. Anyone who better understands pointers have any ideas? In the end I could load up all animation into one only data reference I guess... Update: Maybe some further info here as well - maybe not possible to have separate animations http://atariage.com/forums/topic/256849-re-use-player-sprites-without-duplication-dpc Thanks! Edited December 27, 2018 by mksmith 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.