bugbiter Posted January 29, 2018 Share Posted January 29, 2018 Hah! at first I thought you got me, but here in this case I wanted to get bits 7 and 6 shifted right to position 1 and 0. So instead of lsr lsr lsr lsr lsr lsr lsr I did it the other way round through the carry bit. The ASLs won't help me here :-) But thanks! I am sure there are hundreds of places in my code where there could be speed improvements. I love to hear hints from you demo coders! There is a 24 bit division routine that I use to calculate the slope of the center line between the tiles (step). Maybe I could use a bresenham algorithm instead... Or lookup tables.. At the moment the lineloop routine that puts all the values into the color and hscrol tables is finished just 3 or 4 scanlines befor the Kernel has to start! Way too slow! 1 Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 29, 2018 Share Posted January 29, 2018 Its already running on a different platform I implemented already the fastmul. Brese not sure if that helps as it works in integers only? Of course you could precalc a lot maybe tables tables and tables Unrolling code... Counting tables from top to bottom to avoid the CPX etc, important vars are in page 6 not ZP... As your tables are 85 for each color why not put them into ZP, too? The turn off OS. 1 Quote Link to comment Share on other sites More sharing options...
bugbiter Posted January 29, 2018 Share Posted January 29, 2018 Yessss!! Thank you! What platform? Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 29, 2018 Share Posted January 29, 2018 Yessss!! Thank you! What platform? One which has not the luxury of having LMS and a nice palette... So horizontal is an issue... What is the gfx in your source? 1:1 copy of BB or own? How long is a line? Sorry have not counted. I am toying with dimension X checkboard at the moment. Quote Link to comment Share on other sites More sharing options...
bugbiter Posted January 29, 2018 Share Posted January 29, 2018 hmm what could that be? NES? I coded the gfx data by hand :-) the lines are different in length, the topmost needs only to be about 45 bytes as it doesn't move much, the bottom line must be about 90.. not sure. yeah, dimensionx could look better! Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 29, 2018 Share Posted January 29, 2018 a quick hack Martin's code with original BB texture.... as you see Martin does make a larger screen... but basicly works... just needed to adjust the center line value... next is Dimension X... ballblazer.zip 2 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 29, 2018 Share Posted January 29, 2018 Just tried these in Altirra: impressive work both. Quote Link to comment Share on other sites More sharing options...
emkay Posted January 29, 2018 Share Posted January 29, 2018 a quick hack Martin's code with original BB texture.... as you see Martin does make a larger screen... Cough.... heaven .... cough..... The original BB texture is used in a game, and not just one time: It is 2 times independently working, at the same time. Interestingly, the dither line helps to fill the moving part more vertically, as the line doesn't need any calculations. Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 29, 2018 Share Posted January 29, 2018 emkay.... sure BB has 2 screens.... I was referring only to the fact that Martin did a larger map... nothing more and no blaming BB... @Bugbiter Dimension X does not work somehow.... esp when you are looking at the game it moves 1 tile when you move left/right so no "fine" adjustments possible. Dx uses much smaller grids... I tried to adjust c_line value but i am not 100 % sure how you calc the wrapping...esp with that value ("2*c_lines"). what is your 94? as you have 95 lines data? Quote Link to comment Share on other sites More sharing options...
bugbiter Posted January 29, 2018 Share Posted January 29, 2018 with the ballblazer grid each tile is two pixels wider each line as you go down. That's why it wraps (with a colour flip) when the bottom line has moved for the amount of #c_lines*2 pixels which is the tile width at the bottom line. c_lines itself is the number of lines counted from the imaginary central point [Fluchtpunkt] to the bottom. We actually see less lines to achieve the effect of the over-the-horizon-curve. 'lines' is the number of visible lines on the screen. If both were the same the top line would be in the central point and would not move at all, the tiles woild be infinitely small in width and the diagonals in the checkerboard geometry would look very curved near the horizon. The halving of the horizontal border's Y positions is just an approximation of the correct function and that curved error is already there if you look closely... Try to count the visible playfield lines in Dimension X and set Lines to that value. Then look if there is a central point above the first playfield line (where would the line be that has tiles which would be zero pixels wide) and take that for c_lines. Then the field should move right. For the wrapping just look at how wide the tiles are at the bottom and wrap with that number of pixels. Just put a fixed value instead of #c_lines*2 for the wrapping routines. I hope that helps a bit. 1 Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 30, 2018 Share Posted January 30, 2018 (edited) yeah helped... haven't completed analysis of your code in terms of maths... but it is good that it is not out optimised so it remains readable and maintainable... here my attempt with Dimension X... it was more tricky and trial and error with the wrapping pixel as 1 grid should be 34 pixel but c_line=94 and wrapping pixel value = 48 as slope is 0.5 (2 pixels down, 1 to the side instead of 1 pixel down, 2 to side) BBgrid02_dx2.zip Edited January 30, 2018 by Heaven/TQA 1 Quote Link to comment Share on other sites More sharing options...
emkay Posted January 30, 2018 Share Posted January 30, 2018 How about a version that scrolls on the bottom and on the top.... mirrored Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 30, 2018 Share Posted January 30, 2018 Too easy for a8... like Amiga... Quote Link to comment Share on other sites More sharing options...
bugbiter Posted January 30, 2018 Share Posted January 30, 2018 (edited) Nice! If I only knew how to solve this 'combing' problem... Edited January 30, 2018 by bugbiter Quote Link to comment Share on other sites More sharing options...
roland p Posted January 30, 2018 Share Posted January 30, 2018 Nice! If I only knew how to solve this 'combing' problem... Maybe scroll every other line instead of every line. Quote Link to comment Share on other sites More sharing options...
emkay Posted January 30, 2018 Share Posted January 30, 2018 Nice! If I only knew how to solve this 'combing' problem... Add another buffered line with the correct graphics Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted January 30, 2018 Share Posted January 30, 2018 @Martin don't worry... I suspect rounding errors... so count that as "dithered realtime" i am sure its because grid vs formulars vs heaven hacking Quote Link to comment Share on other sites More sharing options...
emkay Posted January 30, 2018 Share Posted January 30, 2018 @Martin don't worry... I suspect rounding errors... so count that as "dithered realtime" i am sure its because grid vs formulars vs heaven hacking the weird "interleave" reminds me of a lot C64 demos. Quote Link to comment Share on other sites More sharing options...
bugbiter Posted July 18, 2023 Share Posted July 18, 2023 (edited) Just for fun I tried to apply Anti aliasing on the vertical lines too.. It is working, but now I have to change all 4 color registers plus Hscrol in each scanline - ugly midline colour changes are visible! You can set to a higher clock rate in Altirra to get rid of that and have a clean picture... BBgrid03.xex Edited July 18, 2023 by bugbiter 5 Quote Link to comment Share on other sites More sharing options...
bugbiter Posted July 18, 2023 Share Posted July 18, 2023 .. I forgot to say it runs in Pal only. Not enough time in ntsc for frame setup.. Quote Link to comment Share on other sites More sharing options...
The V-Man Posted August 3, 2023 Share Posted August 3, 2023 Pretty cool. Even after all these years, Ballblazer still challenges programming skills. 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.