Junosix Posted November 2, 2010 Share Posted November 2, 2010 (edited) Been working on my first bit of 2600 code which I'm quite happy with, managed to get it going without asking any questions so far. It's actually at a state where I can start designing levels and a proper game around it, but I just wanted to ask a couple of questions before I plough ahead. I've attached my code to this post. You'll see that I build the level using a sort of tile map method, and that map is near the end of the code, labelled "pfmapleft" and "pfmapright". Due to the way I've got the sprite jumping, my collision routine depends on a platform being at least a height of 4-scanlines (it's a two-scanline kernel), so I have to double up the data for each platform (should be pretty clear what I mean if you look at the code). So what I'd like to do is not have to do that doubling-up on the data and just refresh from the tile map every other read. My way of thinking is that I would use the data from the Y register (which I use for counting down through the scanlines), and divide it by two, but I just can't find a way to get enough cycles free to do that. I've even done away with STA WSYNC to try to claim as many cycles as I can (there are a few free though, but they're scattered separately throughout the kernel). Do you think it's possible? Ignore what's going on in the vertical blank routine, there's a load of tidying up to do and logic to add. The display kernel is what I'm concerned about at the moment Does that make any sense? I hope it does EDIT - I also thought about using a 4-scanline kernel, but that would complicate the resolution of the sprite movement, I think. wicked.zip Edited November 2, 2010 by Junosix Quote Link to comment Share on other sites More sharing options...
tetrode kink Posted November 2, 2010 Share Posted November 2, 2010 (edited) Oops, sorry, was playing wannabe VCS programmer and discovered I didn't know what the frak I was talking about. Nothing to see here. Move on... Edited November 2, 2010 by tetrode kink Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted November 3, 2010 Share Posted November 3, 2010 You can free some cycles with the illegal opcode LAX. Instead of: LDA (something),Y ; 5+ cycles TAX ; 2 cycles You can simply go: LAX (something),Y ; 5+ cycles With you index it might be simple to use INY and DEY as needed in the loop. You would have 8 free cycles already by using LAX, and the 2 NOP's I say. Alternatively you might simply do something like: TYA LSR TAY To divide Y by 2. Anyhow I'm sure you'll find a few solutions. Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted November 3, 2010 Share Posted November 3, 2010 You could do a 2 line kernel and fine tune the vertical sprite positioning by using e.g. VDELP0. But that requires that you update the opposite sprite (GRP1) each scanline (too). Quote Link to comment Share on other sites More sharing options...
Junosix Posted November 3, 2010 Author Share Posted November 3, 2010 Thanks for the replies! Funnily enough I was thinking about how VDELP0 could be used for doing it over a 4-scanline kernel, and that wouldn't be a problem as I'm only using GRP0 anyway. But I'm thinking about just using illegal opcodes to reserve cycles for other things. For purity, I was trying to avoid using illegal opcodes, but thinking through I realise I could do lots of tasty stuff if I use them (there are other points in the code where they'd be handy, there's at least one I know of that can be used in skipdraw). The game's main element is rising water so I think I might even have enough time left over to change the colour of PF/GRP depending on whether they're submerged or not. I shall have a play and report back 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.