Re: [stella] "kernel panic!"

Subject: Re: [stella] "kernel panic!"
From: Glenn Saunders <cybpunks2@xxxxxxxxxxxxx>
Date: Tue, 02 Jul 2002 23:22:14 -0700
At 11:15 PM 7/2/2002 +0000, you wrote:
that's it. When it's moving over to the left, the top line
(and only the top line) gets cut off; I think my kernel isn't
fitting in HBLANK in the case where it's having to set
VisiblePlayerLine.

Thomas explained his definitive routine for determining when to display sprites last fall when I was working on Death Derby.


You should try to find it in the archives.

As for the timing, I think the standard way to get around it is to use VDEL, so that the timing for one of the sprites is no longer critical.

Here is River Raid's kernel, for instance:

; *** here starts the main kernel loop: ***
.loopKernel:                    ;
       CPY    #JET_Y            ; 2             draw player jet?
       BCS    .skipJet0         ; 2              no, skip
       LDA    (shapePtr0),Y     ; 5              yes, load data..
       TAX                      ; 2              ..into x
.contJet0:
       LDY    blockLine         ; 3
       BIT    roadBlock         ; 3             road displayed?
       BPL    .noRoad           ; 2              no, normal PF color
       LDA    RoadColorTab,Y    ; 4              yes, load road colors
  IF SCREENSAVER
       EOR    SS_XOR            ; 3
.contPFColor:
       AND    SS_Mask           ; 3
  ELSE
       FILL_NOP 2
.contPFColor:
       FILL_NOP 1
  ENDIF
       STA.w  temp              ; 4
       LDA    (shapePtr1b),Y    ; 5
       STA    GRP1              ; 3             time doesn't matter (VDELP1!)
       LDA    (PF1Ptr),Y        ; 5
       STA    PF1               ; 3 @75
;--------------------------------------
; new line starts here!
; odd line:
; - set PF color
; - set P1 color
; - change PF
       STA    HMOVE             ; 3
       STX    GRP0              ; 3 @2          this also updates GRP1
       LDA    temp              ; 3
       STA    COLUPF            ; 3 @8
       LDA    (colorPtr),Y      ; 5
  IF SCREENSAVER
       EOR    SS_XOR            ; 3
       AND    SS_Mask           ; 3
  ELSE
       FILL_NOP 4
  ENDIF
       STA    COLUP1            ; 3 @22
       LDA    (PF2Ptr),Y        ; 5
       STA    PF2               ; 3 @30
enterKernel2:
       LDA    (shapePtr1a),Y    ; 5
       STA    GRP1              ; 3             time doesn't matter (VDELP1!)
       LDY    lineNum           ; 3
       DEY                      ; 2
       BEQ    .exitKernel2      ; 2
       CPY    #JET_Y            ; 2
       BCC    .doJet0a          ; 2
       TYA                      ; 2
       SBC    missileY          ; 3
       AND    #$F8              ; 2
       BNE    .skipEnable0      ; 2
       LDA    #ENABLE           ; 2
.skipEnable0:
       LDX    #$00              ; 2
.contJet0a:
       DEY                      ; 2
       STY    lineNum           ; 3
       STA    WSYNC             ; 3


---------------------------------------------------------------------------------------------- Archives (includes files) at http://www.biglist.com/lists/stella/archives/ Unsub & more at http://www.biglist.com/lists/stella/


Current Thread