popmilo Posted January 29, 2013 Share Posted January 29, 2013 You would only need the normal 960 bytes for an Antic 4 screen. It's only the character set memory which is doubled (2K vs 1K). ...It might work. I was able to fit my sample screen into 128 chars with some to spare. You are right... 2k for each charset, as IRG uses two, that is 4k for charsets and double buffering screen data takes another 2x1k. Not a problem... Speed ? As each 'IRG frame' consists of two frames, what happens when sprites can not be drawn in one frame time ? We get animation at 4 frames, that is 15fps in NTSC land... and only 12 in PAL ... Hey, all this is theory, it's better to have real code and see it on tv for real Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted January 29, 2013 Share Posted January 29, 2013 Actually, you don't need to double-buffer the screen. This means, when putting the actual characters on screen, Super IRG behaves like a normal Antic 4/5 mode, in regards to screen memory (only one character screen needed). The only allowance is for the double char set (CHBAS is changed every VBLANK). If you were changing your font data on the fly, it would require twice as much processing time. If it's only the character data, then it's normal processing time. Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 13, 2013 Share Posted February 13, 2013 As I mentioned, better to have concrete example before writing tutorial Little work over weekend and I managed to convert my C64 code to A8: http://www.youtube.com/watch?v=RndymXTvTL0 Screen is double buffered (both character set and screen). At 25fps I got 6 fully masked sprites in 4 colors, 12x21 size (like C64). No pre-shifted data necessary, only 63 bytes for mask and 63 bytes for data. Each sprite requires 16 chars, so 32 left for background. At 25fps it's rather slow, but at least Atari's cpu makes it faster than on C64 Next, testing with preshifted data 6 Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 13, 2013 Share Posted February 13, 2013 ps. Here is xex file if someone wants to test it... char_sprites.xex 1 Quote Link to comment Share on other sites More sharing options...
Xuel Posted February 13, 2013 Share Posted February 13, 2013 Awesome! Does it work over a background? 1 Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 13, 2013 Share Posted February 13, 2013 Awesome! Does it work over a background? Yes. Every animation frame erases previous positions, copies background graphics into sprite characters and does whole "LDA back, AND mask, ORA sprite, STA screen" stuff... (shifting included). Basically, you can use them as hardware sprites and don't worry much about them... Set sprite data pointer, x,y coordinates and that's it... Price you pay is in number of characters left for background (32) and relative slowness... Of course, different sprite sizes are possible, so something like ten 8x16 sprites would require 90 chars -> 38 left for background. Hey, it's just V 0.1 3 Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 16, 2013 Share Posted February 16, 2013 Preshifted sprites done, managed to pull one more out with time saved: http://www.youtube.com/watch?v=axm33fYns1Q Here is a funny experiment with 8 sprites. As there are no characters left for background, part of sprite shows over whole scren and as every frame routine is copying background to sprite buffer, a rather flickery recursive graphics demo effect shows ps. Watch your eyes http://www.youtube.com/watch?v=NojXuyIg4kA As I like raster-color-profiling here it is: So, yes - preshifted sprites do save time. But most of the time still goes on that "copy background to buffer". Next step... Eliminate copy completly 4 Quote Link to comment Share on other sites More sharing options...
MaPa Posted February 16, 2013 Share Posted February 16, 2013 (edited) I don't know your drawing algorithm but why are you erasing sprite characters? Why are you copying background to sprite characters? Don't you do LDA background, AND mask, ORA spritedata, STA spritechar ? Your preshifted sprites are really slow, IMHO it should do 8 sprites with 50fps. Edited February 16, 2013 by MaPa Quote Link to comment Share on other sites More sharing options...
Creature XL Posted February 16, 2013 Share Posted February 16, 2013 8 12x21 in 50 FPS is hard I guess. I am pretty sure you can't draw them in VBlank only. My (pre-shifted) 9x16 sprites need around 10 144-cycles scan-lines. So 8 in the area from line 220 to 312 (PAL only) is possible. But 12x24? I'll try when it some day. @Popmillo: If you are out of chars, you know what to do... Quote Link to comment Share on other sites More sharing options...
MaPa Posted February 16, 2013 Share Posted February 16, 2013 Of course not in VBLANK. As it is double buffered, you have whole frame to draw them. But probably 8 sprites is too much. Depends if it's done for general purpose, or you can take advantage of uniform background etc. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted February 16, 2013 Share Posted February 16, 2013 Do you have the source code to this? I'd love to have a look. Quote Link to comment Share on other sites More sharing options...
matosimi Posted February 17, 2013 Share Posted February 17, 2013 my first ASM game (2005)... laser blaster: 12 soft sprites, bitmap mode, preshifted, doublebuffered (25fps), extremely nooby-coded - i planned some other movement of letters before - in circle, but at the end i put simple sinus wave there... so it looks like its just using HW scrolling, but in fact there is no HW scrolling. M. 1 Quote Link to comment Share on other sites More sharing options...
Creature XL Posted February 17, 2013 Share Posted February 17, 2013 my first ASM game (2005)... laser blaster: 12 soft sprites, bitmap mode, preshifted, doublebuffered (25fps), extremely nooby-coded - i planned some other movement of letters before - in circle, but at the end i put simple sinus wave there... so it looks like its just using HW scrolling, but in fact there is no HW scrolling. M. Das it use background masking? :ph34r: Quote Link to comment Share on other sites More sharing options...
matosimi Posted February 17, 2013 Share Posted February 17, 2013 Das it use background masking? :ph34r: I dont remember , but there is no background so i guess it does not, also there are not any alpha masks of letters, so they cannot overlap (overlapping area would be EORed). Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 17, 2013 Share Posted February 17, 2013 I don't know your drawing algorithm but why are you erasing sprite characters? Why are you copying background to sprite characters? Don't you do LDA background, AND mask, ORA spritedata, STA spritechar ? Your preshifted sprites are really slow, IMHO it should do 8 sprites with 50fps. Sprites can go over anything in the background (other sprites, background characters) and there is no 'rule' for coordinate changes (every animation frame sprites could jump anywhere on the screen). So, I have to erase sprite characters from its previous position (restore background chars). Copying background to sprite buffer was easiest way to do it... Next in the plan is to try to dynamically change background address in core routine so I could skip that step completely. I also wish they would work in 50fps, but with 4x4 characters size and full masking its tough... It will be rather easy to skip parts of routine and test different combos (without masking, without overlapping sprite positions etc...) and see what speed we get then. Do you have the source code to this? I'd love to have a look. You should be able to look at it here (let me know if it doesn't work): https://bitbucket.or.../src?at=default Main file is 'char_sprites' + all other with that prefix (you'll notice other 'pop' files, that is because I'm testing this character sprites approach in my PoP project folder ). Here is the newest demo with rotating background and some front layer chars: http://youtu.be/FFVUGGuwgC0 char_sprites.xex 6 Quote Link to comment Share on other sites More sharing options...
+CharlieChaplin Posted February 17, 2013 Share Posted February 17, 2013 (edited) Looking great ! Visually this reminds me of an old Peter Sabath demo, but it looks like he did not have/use background sprites or chars. (originally released as an intro for Abbuc mag. 20, but ended on side-B, since the intro of Gnome Design was much better): http://www.youtube.com/watch?v=SUArGd1tJI8 Greetings, Andreas Koch. Edited February 17, 2013 by CharlieChaplin Quote Link to comment Share on other sites More sharing options...
emkay Posted February 17, 2013 Share Posted February 17, 2013 Sprites can go over anything in the background (other sprites, background characters) and there is no 'rule' for coordinate changes (every animation frame sprites could jump anywhere on the screen). So, I have to erase sprite characters from its previous position (restore background chars). Copying background to sprite buffer was easiest way to do it... Next in the plan is to try to dynamically change background address in core routine so I could skip that step completely. I also wish they would work in 50fps, but with 4x4 characters size and full masking its tough... It will be rather easy to skip parts of routine and test different combos (without masking, without overlapping sprite positions etc...) and see what speed we get then. You should be able to look at it here (let me know if it doesn't work): https://bitbucket.or.../src?at=default Main file is 'char_sprites' + all other with that prefix (you'll notice other 'pop' files, that is because I'm testing this character sprites approach in my PoP project folder ). Here is the newest demo with rotating background and some front layer chars: http://youtu.be/FFVUGGuwgC0 char_sprites.xex Looks interesting. Is it possible to give every (at least 4 of them) "ball" a "Player Missile" Overlay? For the start a simple square? Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 17, 2013 Share Posted February 17, 2013 Looks interesting. Is it possible to give every (at least 4 of them) "ball" a "Player Missile" Overlay? For the start a simple square? These are 12x21 sized... With double sized Players with priority under graphics, 4 sprites could have one additional color... So, something like 5 sprites (4 sprites with underlay + 1 'simple' (4 colors)) could probably work in 25fps. For now, I'll try to make it as fast as I can. Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 26, 2013 Share Posted February 26, 2013 (edited) Time for new improved soft sprite routine Bigger, faster, better sprites! 7 x 4 color soft sprites, each 12x24 over background with front layer. Character screen, each sprite needs 16 characters, so only 16 characters remains for background Fully masked, 25 fps, each sprite can go under and over anything in background (background chars or other sprites). No preshifted graphics needed, everything done on-the-fly. http://youtu.be/TddPaY8_YKA Unfortunately that's about it - only 3-4 scanlines left free !!! ps. Best of all, while working on it, I got some new ideas, think it can be done better Edit: Forgot to add executable: char_sprites.xex Edited February 26, 2013 by popmilo 5 Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted February 27, 2013 Share Posted February 27, 2013 Why is preshifting no help? Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 27, 2013 Share Posted February 27, 2013 Why is preshifting no help? I'm not saying they don't help In previous routine (last one with 12x21 sprites) I had part of code that did "copy background to sprite buffer" before masking and drawing sprite. That copy took more time than drawing sprites (with or without shifting). This new version works without that copy part... Takes longer to prepare all the addresses and main loop is 8 cycles instead of 21. It's still faster than previous version even with 24 vs 21 lines high sprites! Next test: 12x24 with preshifted data and timing comparison. Stay tuned 1 Quote Link to comment Share on other sites More sharing options...
snicklin Posted February 27, 2013 Share Posted February 27, 2013 Which graphics mode are you using for the background Popmilo? Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 28, 2013 Share Posted February 28, 2013 Which graphics mode are you using for the background Popmilo? Multi color character mode = Graphics 12 (Antic mode 4). Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted February 28, 2013 Share Posted February 28, 2013 Aarg... Nearly whole frame.... Damned VIC2 with its hardware sprites 1 Quote Link to comment Share on other sites More sharing options...
MaPa Posted February 28, 2013 Share Posted February 28, 2013 Aarg... Nearly whole frame.... Damned VIC2 with its hardware sprites Whole two frames.. it's 25fps 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.