Tursi Posted October 7, 2015 Share Posted October 7, 2015 Scanline coloring is a great trick! It's cool to see it being used in MESS. Now I really need to catch up. 30hz won't likely hurt the game appeal at all -- 60hz is a tough goal on a retro machine. That said, you are pretty close!! 1 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted October 7, 2015 Share Posted October 7, 2015 You're right, I got confused and used the roughly 12000 cycles we have during vblank as the total per frame but I'm double buffering (not very well, mind you, but that's another story) so I can draw to VRAM for the entire frame. That seems to imply I'm using way more cycles for scrolling (about 15000?) than I think I should be if I'm not mistaken about what the most efficient implementation would look like (that '3000' figure seems awfully far off now...). Back to the drawing board to figure out how much potential for optimization there is, hopefully I was completely wrong in a good way . 15000 is also what you said here: http://atariage.com/forums/topic/222529-smooth-scrolling-in-c/?do=findComment&comment=2937655 Quote Link to comment Share on other sites More sharing options...
TheMole Posted October 7, 2015 Author Share Posted October 7, 2015 15000 is also what you said here: http://atariage.com/forums/topic/222529-smooth-scrolling-in-c/?do=findComment&comment=2937655 Clearly my memory is not what it used to be . Quote Link to comment Share on other sites More sharing options...
TheMole Posted October 7, 2015 Author Share Posted October 7, 2015 Just as a test, I replaced the sound player with the 30hz version, and that alone brings me very close (it's actually fast enough when not picking up money or punching boxes). So I might just start by converting all audio to 30hz and try to optimize the rest enough to make it all fit in one frame. I also realized I had to triple buffer my name table since when scrolling two pixels in one frame I ran the risk of writing in the first three rows of my active name table. Quote Link to comment Share on other sites More sharing options...
Willsy Posted October 7, 2015 Share Posted October 7, 2015 I also realized I had to triple buffer my name table since when scrolling two pixels in one frame I ran the risk of writing in the first three rows of my active name table. Yeah. I'm just gonna make out like I understood you perfectly and quietly drift away before anyone notices! 1 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted October 7, 2015 Share Posted October 7, 2015 Yeah. I'm just gonna make out like I understood you perfectly and quietly drift away before anyone notices! Too late! ...lee 1 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted October 7, 2015 Share Posted October 7, 2015 I had to try timing Bouncy with background coloring. Starting from the bottom just after vertical refresh: Black: Play music Light green: Upload sprite attributes Dark blue: Scrolling Light blue: Update switched meta tiles (not happening for this screenshot) Dark red: Ball - Map interaction Cyan: Enemy collisions Light red: Read joystick Yellow: Move ball Dark green: Move enemies Magenta: Display 'sparkle' sprites (not happening for this screenshot) Grey (not visible): Check quit key White: Unused Looks like I still have a nice chunk of the frame left for improvements. 4 Quote Link to comment Share on other sites More sharing options...
Opry99er Posted October 7, 2015 Share Posted October 7, 2015 That is fascinating... What a cool test! Quote Link to comment Share on other sites More sharing options...
TheMole Posted October 7, 2015 Author Share Posted October 7, 2015 Yeah. I'm just gonna make out like I understood you perfectly and quietly drift away before anyone notices! I think it says more about my ability to explain things than about your ability to understand them . 2 Quote Link to comment Share on other sites More sharing options...
TheMole Posted October 7, 2015 Author Share Posted October 7, 2015 I had to try timing Bouncy with background coloring. Starting from the bottom just after vertical refresh: Black: Play music Light green: Upload sprite attributes Dark blue: Scrolling Light blue: Update switched meta tiles (not happening for this screenshot) Dark red: Ball - Map interaction Cyan: Enemy collisions Light red: Read joystick Yellow: Move ball Dark green: Move enemies Magenta: Display 'sparkle' sprites (not happening for this screenshot) Grey (not visible): Check quit key White: Unused Looks like I still have a nice chunk of the frame left for improvements. Very cool! I wonder why your soundplayer is taking so much less time than mine though, since we're both using Tursi's library. Are you using the sfx enabled version, and are you running at 60hz? Quote Link to comment Share on other sites More sharing options...
Asmusr Posted October 7, 2015 Share Posted October 7, 2015 Very cool! I wonder why your soundplayer is taking so much less time than mine though, since we're both using Tursi's library. Are you using the sfx enabled version, and are you running at 60hz? I'm not using the sfx version, but I'm running at 60Hz. The timing varies, sometimes the green line at the bottom (signifying the end of sound playing) is visible and sometimes it's not. I guess it also depends on the music. If I measure it in Classic99 I get an average around 3000 cycles (range 1000 - 9000). Quote Link to comment Share on other sites More sharing options...
Tursi Posted October 8, 2015 Share Posted October 8, 2015 The sound player is VERY variable - it depends entirely on the music. In my comments at the top of the file where I list a range of cycles from 1000-10,000 cycles per frame - that's real world, not estimated (it IS rounded though ). It depends on how many of the 12 streams need to be reloaded that frame (there are four for tone, four for volume, and four for timing). The SFX version needs to run twice, once for the song and once for the SFX (but most SFX are simpler and don't use all the channels, so are not as expensive as the music). Unfortunately there's really nothing I can think of that can be done to stagger that - when it needs a new note, it needs it now. I've not been happy with the performance, so I've been taking notes for an optimization pass. I can at least remove some of the duplicated tests that happen on every single byte. Something that should be feasible in the meantime (since I can't promise my free time right now) is moving the "getbyte" function into scratchpad should get back a bit of CPU time - that's where the heaviest lifting happens. It's the first function in the code and runs to the "stinit" function. At a quick count, it looks like it's about 184 bytes, which is a lot to ask of scratchpad, I know. But it should help a lot as it's code heavy, relying a lot on indexed addressing and immediate values. 1 Quote Link to comment Share on other sites More sharing options...
TheMole Posted October 9, 2015 Author Share Posted October 9, 2015 By using the 30hz player (I will need to reconvert all my music files again, which is a bit impractical since my only machine with vmware fusion on it died, but otherwise no big deal), rewriting the scrolling function and putting it in scratchpad it seems I can make most of the logic fit within the 50k cycles we have. When scrolling and picking up items I still go over budget, so I will need to optimize my "item pickup" routine (moving sideways + scrolling + playing a sound effect + manipulating the map and VRAM add up quickly), but I'm sure there's room for improvement there. I'm at the point where if I can't optimize it further I think I'll just release the demo as-is and get feedback from the community on how acceptable the occasional screen tearing is. Hopefully more soon, when I've had a chance to setup a (virtual) windows machine. Quote Link to comment Share on other sites More sharing options...
TheMole Posted October 9, 2015 Author Share Posted October 9, 2015 (edited) Something that should be feasible in the meantime (since I can't promise my free time right now) is moving the "getbyte" function into scratchpad should get back a bit of CPU time - that's where the heaviest lifting happens. It's the first function in the code and runs to the "stinit" function. At a quick count, it looks like it's about 184 bytes, which is a lot to ask of scratchpad, I know. But it should help a lot as it's code heavy, relying a lot on indexed addressing and immediate values. I think the scrolling code needed the speed boost a bit more, but with the gcc workspace, soundplayer workspace and copy-scrolldata-to-vram code running from scratchpad, I have exactly 140 bytes left. If there's another easy target that would benefit in the player code (and fits within 140 bytes), let me know and I'll give it a try. Edited October 9, 2015 by TheMole 1 Quote Link to comment Share on other sites More sharing options...
TheMole Posted January 25, 2016 Author Share Posted January 25, 2016 Okay, life got in the way of this project for a while there (nothing bad, just work and renovations... I don't have a home office anymore currently). I'll be picking this up again and hopefully fixing the one remaining bug in the demo that I hadn't gotten to yet. Then I can start adding the last remaining parts of the game (shops, bosses, special items, more enemies, ...) and hopefully knock out some more interesting levels and flesh out the story a bit more. Either way, I'm eager to get back to this, so hopefully I'll be sharing some real progress soon! 8 Quote Link to comment Share on other sites More sharing options...
TheMole Posted April 20, 2016 Author Share Posted April 20, 2016 Ok, so now that I've got a bit more time, I've dug up my old to-do list. First up, add the 'shop' functionality, so that all that money you pick up is actually worth something... This is my first try, what do you all think? (Note that I will have to redesign the items that are for sale somewhat, these are too colorful for the 9918a, consider these here placeholders) 4 Quote Link to comment Share on other sites More sharing options...
Omega-TI Posted April 20, 2016 Share Posted April 20, 2016 Will you get to buy extra lives too? For 'marginal' players like myself, that could be beneficial! Quote Link to comment Share on other sites More sharing options...
TheMole Posted April 20, 2016 Author Share Posted April 20, 2016 Will you get to buy extra lives too? For 'marginal' players like myself, that could be beneficial! Yup, I'm currently thinking: Extra life Invincibility shield (get hit once without dying) Invincibility potion (can't die for a short amount of time) Flying fist (you 'shoot' your fist across the entire screen, destroying all destructible terrain and enemies on its way) Wings (Gravity won't affect you, allowing you to fly over tricky parts) Mystery item (one of the above for a discounted price, but you don't know which) 7 Quote Link to comment Share on other sites More sharing options...
Tursi Posted April 21, 2016 Share Posted April 21, 2016 Just to make the mystery item a bit less attractive, one of the possible items should be a brick. (Or something else completely useless.) 2 Quote Link to comment Share on other sites More sharing options...
TheMole Posted April 21, 2016 Author Share Posted April 21, 2016 Just to make the mystery item a bit less attractive, one of the possible items should be a brick. (Or something else completely useless.) Good idea! Quote Link to comment Share on other sites More sharing options...
+Ksarul Posted April 21, 2016 Share Posted April 21, 2016 Of course, this being Alex Kidd, the nominally useless item could be a cookie. He'll enjoy eating it, but it doesn't actually do anything for him. . . 3 Quote Link to comment Share on other sites More sharing options...
The Usotsuki Posted April 21, 2016 Share Posted April 21, 2016 Or a nigiri? Quote Link to comment Share on other sites More sharing options...
RupanIII Posted December 17, 2016 Share Posted December 17, 2016 So, how is this going? Good idea! 1 Quote Link to comment Share on other sites More sharing options...
CLBrown Posted December 19, 2023 Share Posted December 19, 2023 Okay, I haven't read every last post in this thread, but as far as I can tell, this is F18A-only... right? I have a BIN file for this, and ran it... and got the opening screen, in green only, and the computer locked up. So, I'm GUESSING that means it's F18A-centric. If so, just one more reason to hope... SOMEDAY... they become available again. (sigh) Quote Link to comment Share on other sites More sharing options...
TheMole Posted December 19, 2023 Author Share Posted December 19, 2023 It supports both the tms9918a and the F18-A, with bespoke graphics for each version: So, not sure what went wrong when you tried it on your console, but if you can tell me a bit more about your setup I could perhaps look into it. Are you using a FinalGrom99, or did you burn the image to a cartridge? 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.