3DPLABox
Member
Okay. I have a weird question. So I'm using a lot of unique/bespoke code to manually draw monters to help with slowdown. When I use this method to bankswitch to 1D, I get all kinds of errors if I don't take out a lot of my unique sprite draw code from the default script.
As an example, this is what I'm doing at the top of the script to check for monsters and manually draw them if possible. How do I go about incorporating this system into this method without massive errors? This works fine and I even have several more monsters in the full version of the script below before I hit the "limit" and get an error. Again, for the record, this is just the default drawSprites_Platformer script with a bunch of CMP checks upfront to manually draw monsters (and it has the 1D bankswitch stuff noted in this thread).
Is there a way to use Bank 1D to do these unique draw commands so I can avoid the error? Every time I try to change the place of the bank switch command, I get errors or the game freezes.
Code:LDA gameHandler AND #%01000000 BEQ doDrawThisSprite JMP doneDrawingThisSprite doDrawThisSprite: ;; This routine will work together with the luts created by the old object animation tool. ;; Due to that, it must be included in the same bank with luts. ;; We will use tempA to track the x value of a tile. ;; We will use tempB to track the y value of a tile. ;; X is the index of the object. ;; Y is the index of the object type. ;; ObjectSize,y is the size in tiles for this version of drawing. ;; 00xxxyyy ;; where x = the width in tiles (1-7) ;; where y = the height in tiles (1-7) ;; for both, zero is an impossible value. ;; Object_frame,x keeps track of actions and animations. ;; 00xxxyyy ;; where x = animation frame ;; where y = action frame ;LDY Object_type,x ;; for lut lookups. LDA Object_x_hi,x SEC SBC camX ;; is using scrolling STA tempA LDA Object_y_hi,x ;sec ;SBC camY STA tempB LDY Object_type,x LDA Object_type,x CMP #$01 BEQ +isPlayerProjectile ;;;;START OF NEW STUFF JMP +isNotNormalProjectile +isPlayerProjectile ;;; DRAW PLAYER PROJECTILE GetActionStep temp CMP #$01 BEQ +drawBuzzSaw JMP +BuzzSawReverseCheck +drawBuzzSaw DrawSprite tempA, tempB, #$49, #%00000000 JMP doneDrawingThisSprite +BuzzSawReverseCheck CMP #$02 BEQ +drawBuzzSawReverse JMP +PlasmaCheck +drawBuzzSawReverse DrawSprite tempA, tempB, #$49, #%00000000 JMP doneDrawingThisSprite +PlasmaCheck CMP #$03 BEQ +drawPlasma BCS +drawPlasma JMP +drawNormalProjectile +drawPlasma DrawSprite tempA, tempB, #$56, #%00000011 JMP doneDrawingThisSprite +drawNormalProjectile DrawSprite tempA, tempB, #$56, #%00000000 JMP doneDrawingThisSprite +isNotNormalProjectile ;;;and then it has the default stuff below this. In my actual script, I have WAY more unique monster draw code. But I get errors if I have this material here after this bankswitching method. Any idea how to resolve or where to appropriately move this stuff?
@vanderblade Did you ever find a resolution to this? I really want to move the sprite draw code to 1D but I keep running into the game freezing any time I try to bank switch. I've been at it for hours and have found no solution