Primordial Ooze Posted September 5, 2011 Share Posted September 5, 2011 (edited) This is the code i am using for drawing the playfield. For some reason it's causing the scan lines to jump to 343. However what i am doing is much simpler then most games, yet it still is using more scan lines then normal. Snip: lda (pf0_ptr),y ; load PF0 data sta PF0 ; set it as PF0 lda (pf1_ptr),y ; load PF1 data sta PF1 ; set it as PF1 lda (pf2_ptr),y ; load PF2 data sta PF2 ; set it as PF2 If anyone can help me it would be greatly appreciated. Sincerely, Primordial Ooze Edited September 5, 2011 by Primordial Ooze Quote Link to comment Share on other sites More sharing options...
Joe Musashi Posted September 5, 2011 Share Posted September 5, 2011 I took a (very) quick look at it in the Stella debugger. It seems that your ScanLoop is too time consuming. Even when no players are visible, i.e., all the skip branches are taken (SkipActivatePlayer, FinishPlayer, SkipActivateZombie, FinishZombie) the CPU is already at cycle 74 when it arrives at $F10E bne ScanLoop If the branch is taken it crosses a page boundary and the instruction will take 4 cycles. At ScanLoop: sta WSYNC the CPU is then already at cycle 2 in the next line and the sta WSYNC skips this line. So a single loop iteration takes two lines. Quote Link to comment Share on other sites More sharing options...
Primordial Ooze Posted September 6, 2011 Author Share Posted September 6, 2011 I took a (very) quick look at it in the Stella debugger. It seems that your ScanLoop is too time consuming. Even when no players are visible, i.e., all the skip branches are taken (SkipActivatePlayer, FinishPlayer, SkipActivateZombie, FinishZombie) the CPU is already at cycle 74 when it arrives at $F10E bne ScanLoop If the branch is taken it crosses a page boundary and the instruction will take 4 cycles. At ScanLoop: sta WSYNC the CPU is then already at cycle 2 in the next line and the sta WSYNC skips this line. So a single loop iteration takes two lines. I don't understand why. Even combat does more stuff then I'm trying to do and it uses less cycles not to mention page boundaries. Can you please tell me what I'm doing wrong? Any assistence in this matter would be greatly appreciated. Sincerely, Primordial Ooze Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted September 6, 2011 Share Posted September 6, 2011 I don't understand why. Even combat does more stuff then I'm trying to do and it uses less cycles not to mention page boundaries. Can you please tell me what I'm doing wrong? Its not the number of things you are doing, but HOW you are doing them.Your code is less efficient than required, taking 2 cycles too long. Count your cycles and compare with Combat, then you will find what is making the difference. Quote Link to comment Share on other sites More sharing options...
Joe Musashi Posted September 6, 2011 Share Posted September 6, 2011 Ah, now I see. You want to use a two-line kernel (as Combat does). Then you have 2*76 cycles for each loop iteration. This then means your line counter needs to be adapted so that it counts double lines instead of single lines, i.e., you have to initialize Y with ldy #(192/2)-1 I did a couple of small changes and got your kernel running, code is attached. Here are some more comments: - In a two-line kernel players have to move at least two scanlines per frame when moving vertically. If this is too fast, you have to make use of the VDEL register. VDEL explained explains how this works. - It's probably necessary to rearrange the TIA writes in the scan loop so that they are not done in the visible part of the scanline. You can see this in the image were the player graphics is changed in the middle of the player sprite. - There was a typo, cpy #zombiey needs to be cpy zombiey. - I added two more WSYNCs so that Stella reports 262 scanlines. I haven't checked but maybe vblank is too short. - And finally, just for fun I replaced the zombie graphics with the one from PAC-MAN-RED's thread http://www.atariage.com/forums/topic/169238-free-sprites-for-the-taking/page__st__75__p__2118746#entry2118746 . Look's really scary now partyofthedead.zip Quote Link to comment Share on other sites More sharing options...
Primordial Ooze Posted September 7, 2011 Author Share Posted September 7, 2011 Great, thanks for fixing it. I think i might keep your zombie in the game and give you credit. The only problem now is trying to get the playfield to mimic a room instead of white snow. Any assistance would be greatly appreciated. Sincerely, Primordial Ooze 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.