Stellar Fortress v0.10
Hi all,I haven't posted in a while, but I've been busy coding. I spent about 12 hours over the past week tweaking the hell out of the kernel. Version .09 was a sanity revision that still needed cleanup. Version .10 is a cleaned up demo of the new kernel.lynxflyer199112html.zipNew Features:- The kernel is now 2-scanlines per pass. But it can still do high-resolution (single scanline) graphics for both player sprites, plus it handles both player missles, the asymetric playfield shield, and a variable height and width ball.Here's the kernel. Comments and suggestions are welcome.
TheKernel TSX ;Careful! Need to initialize stack hack here. STX Temp3;Preserve the stack. LDX #ENAM1;ENABL is set manually. TXS LDX #95 LDA #0 STA Temp1 STA Temp2 JMP KernelLoop align 256SkipShipDraw LDA Temp1;3 (+1 from previous branch.) STA Temp4;3 BEQ ContinueKernel;3 Block = 10 cycles.ClearBall LDA Temp1;3 (+1 for branch) Careful! Temp1 = 0. BEQ ContinueBall;3 Block = 7 cycles.KernelLoop STA WSYNC;3 This can be removed if more time is needed. STA GRP0;3; Draw the first missile CPX MissleY;3 PHP ;3 sets ENAM1, Block = 6 cycles. <9th cycle>; Draw the left side of the shield. LDY ShieldIndex,X;4 LDA LShield,Y;4 STA PF2 ;3 STA Temp5;3 Save for next scanline. Block = 14 cycles.; Draw the cannon. LDY CannonIndex,X;4 LDA (CannonGfxLoa),Y;5 STA GRP1;3 Block = 12 cycles. <35th cycle>; Draw the right side of the shield. LDY ShieldIndex,X;4 LDA RShield,Y;4 SEC ;2 <45th cycle> Refresh PF2 now. STA PF2 ;3 STA Temp6;3 Save for next scanline. <51st cycle>; Determine player graphics for next line.; SEC ;2 Careful! Already did this above. TXA ;2 A now holds scanline. SBC ShipPosYHi;3 ADC #ShipHeight;2 BCC SkipShipDraw;2 or 3 <60th cycle> TAY ;2 LDA (ShipGfxLoa),Y;5 STY Temp4;3 This holds the player graphics Y index for the next line. ; <70th cycle>ContinueKernel; Get ready to draw the FBomb. CPX.w FBombY;4 NOP ;2 <76th cycle>; Next scanline starts here. PHP ;3 sets ENAM0. STA GRP0;3; Draw the variable-height Ball. CPX BallEnd;3 BCS ClearBall;2 or 3 CPX BallStart;3 ROL ;2 ROL ;2ContinueBall STA ENABL;3 Block = 15 cycles. <21st cycle>; Draw the left side of the shield. LDA Temp5;3 STA PF2 ;3 Block = 6 cycles. <27th cycle>; Draw the cannon. LDY CannonIndex,X;4 LDA (CannonGfxLob),Y;5 STA GRP1;3 Block = 12 cycles. <39th cycle>; Draw the right side of the shield. LDA.w Temp6;4 <43rd cycle> NOP ;2 <45th cycle> STA PF2 ;3; Reset the stack TXA ;2 LDX #ENAM1;2 TXS ;2 TAX ;2 Block = 11 cycles. <56th cycle>; Prepare the next player graphics LDY Temp4;3 Load in the stored GRP0 graphics. LDA (ShipGfxLob),Y;5 DEX ;2 <66th cycle> BPL KernelLoop;2 or 3 <72 cycles including the WSYNC at the top.>
5 Comments
Recommended Comments