egg

by noahx42

Game:

Description:

Init:     ; 
   LDA #$15    ;\  BG1, BG3, OBJ on main screen (TM)
   STA $212C   ; | 
   LDA #$15    ; | BG1, BG3, OBJ on main screen should use windowing. (TMW)
   STA $212E   ;/  
   LDA #$02    ;\  BG2 on sub screen (TS)
   STA $212D   ; | 
   LDA #$02    ; | BG2 on sub screen should use windowing. (TSW)
   STA $212F   ;/  
   LDA #$20    ; Backdrop for color math
   STA $40     ; mirror of $2131
   LDA #$12    ;\  Clip to black: Never, Prevent colot math: Outside
   STA $44     ;/  Add subscreen instead of fixed color: True
   LDA #$11    ;\  values for enabling/inverting BG1/BG2 on window 1/2
   STA $41     ; | mirror of $2123
   STA $42     ; | mirror of $2124
   LDA #$B1    ; | values for enabling/inverting OBJ/Color on window 1/2
   STA $43     ; | mirror of $2125
               ; | Window 1 enabled on Color
               ; | Window 2 enabled on Color
               ; | Window 1 inverted on BG1, BG2, BG3, BG4, OBJ, Color
               ;/  Window 2 inverted on 0

   REP #$20                         ;\  Get into 16 bit mode
   LDA #$2604                       ; | Register $2126 using mode 4
   STA $4330                        ; | 4330 = transfer mode, 4331 = register
   LDA #.windowTable                ; | High byte and low byte of table addresse.
   STA $4332                        ; | 4332 = low byte, 4333 = high byte
   SEP #$20                         ; | Back to 8 bit mode
   LDA.b #.windowTable>>16          ; | Bank byte of table addresse.
   STA $4334                        ;/  = bank byte
   LDA #$08                         ;\  
   TSB $0D9F                        ;/  enable HDMA channel 3
   RTL                              ; Return

.windowTable:                       ; 
   db $55 : db $FF, $00, $FF, $00   ; 
   db $04 : db $75, $7D, $FF, $00   ; 
   db $04 : db $71, $75, $FF, $00   ; 
   db $04 : db $6D, $75, $FF, $00   ; 
   db $04 : db $6D, $79, $FF, $00   ; 
   db $04 : db $69, $79, $FF, $00   ; 
   db $04 : db $69, $89, $79, $7D   ; 
   db $04 : db $65, $8D, $71, $79   ; 
   db $04 : db $65, $8D, $69, $79   ; 
   db $04 : db $65, $89, $69, $7D   ; 
   db $04 : db $69, $75, $FF, $00   ; 
   db $04 : db $69, $79, $FF, $00   ; 
   db $04 : db $6D, $7D, $FF, $00   ; 
   db $04 : db $71, $7D, $FF, $00   ; 
   db $57 : db $FF, $00, $FF, $00   ; 
   db $00                           ; 

back to listings