tobiasvl / LADX-Disassembly

My hacks of Legend of Zelda: Links Awakening DX
0 stars 0 forks source link

Scrolling pause screen #15

Open tobiasvl opened 1 year ago

tobiasvl commented 1 year ago

home/interrupts.asm: LoadRequestedGfx (skrur av skjermen, brukes kanskje under fade?) jp InterruptLCDStatus InterruptVBlank LoadTiles (under VBlank) palettes.asm

GAMEPLAY_INVENTORY

wC150 == window scroll offset wC151 == blir satt til 0 og så 1 når man åpner inventory? wC154 == en slags inventory scroll state

bank20.asm

wWindowY (0x80/128 når stengt)

CloseInventory: xor a ; $6436: $AF ld [wTransitionSequenceCounter], a ; $6437: $EA $6B $C1 ld [wC16C], a ; $643A: $EA $6C $C1 inc a ; $643D: $3C ld [wPaletteUnknownE], a ; $643E: $EA $D5 $DD ld a, JINGLE_CLOSE_INVENTORY ; $6441: $3E $12 ldh [hJingle], a ; $6443: $E0 $F2 .return: ret

func_001_5895:: ld a, $80 ; $5895: $3E $80 ld [wWindowY], a ; $5897: $EA $9A $DB ld a, $07 ; $589A: $3E $07 ld [rWX], a ; $589C: $E0 $4B ld a, $08 ; $589E: $3E $08 ld [wC150], a ; $58A0: $EA $50 $C1 xor a ; $58A3: $AF ld [wInventoryAppearing], a ; $58A4: $EA $4F $C1

ret_001_58A7:: ret ; $58A7: $C9

UpdateWindowPosition:: ld a, [wInventoryAppearing] ; $5F4B: $FA $4F $C1 and a ; $5F4E: $A7 jr z, jr_001_5F6A ; $5F4F: $28 $19 ld hl, wOAMBuffer ; $5F51: $21 $00 $C0 ld a, [wWindowY] ; $5F54: $FA $9A $DB add a, $08 ; $5F57: $C6 $08 ld d, a ; $5F59: $57 ld e, $28 ; $5F5A: $1E $28

jr_001_5F5C:: ld a, [hl] ; $5F5C: $7E cp d ; $5F5D: $BA jr c, .jr_5F62 ; $5F5E: $38 $02 ld [hl], $00 ; $5F60: $36 $00

.jr_5F62:: inc hl ; $5F62: $23 inc hl ; $5F63: $23 inc hl ; $5F64: $23 inc hl ; $5F65: $23 dec e ; $5F66: $1D jr nz, jr_001_5F5C ; $5F67: $20 $F3 ret ; $5F69: $C9

.jr_613D == close inventory?

jr_002_61C6: ld a, [wC150] ; $61C6: $FA $50 $C1 ld hl, wWindowY ; $61C9: $21 $9A $DB add [hl] ; $61CC: $86 ld [hl], a ; $61CD: $77 cp $80 ; $61CE: $FE $80 jr z, .jr_61DE ; $61D0: $28 $0C

cp   $00                                      ; $61D2: $FE $00
jr   nz, jr_002_61E4                          ; $61D4: $20 $0E

ld   a, $03                                   ; $61D6: $3E $03
ldh  [hVolumeRight], a                        ; $61D8: $E0 $A9
ld   a, $30                                   ; $61DA: $3E $30
ldh  [hVolumeLeft], a                         ; $61DC: $E0 $AA

.jr_61DE xor a ; $61DE: $AF ld [wInventoryAppearing], a ; $61DF: $EA $4F $C1 jr label_002_61E7 ; $61E2: $18 $03

label_002_61E7: ld a, [wWindowY] ; $61E7: $FA $9A $DB cp $80 ; $61EA: $FE $80 jr z, label_002_61F5 ; $61EC: $28 $07

ld   a, [wInventoryAppearing]                 ; $61EE: $FA $4F $C1
and  a                                        ; $61F1: $A7
jr   nz, .jr_61F4                             ; $61F2: $20 $00

.jr_61F4 pop af ; $61F4: $F1

label_002_61F5: ld a, [wDialogState] ; $61F5: $FA $9F $C1 and $7F ; $61F8: $E6 $7F jr z, .jr_002_6203 ; $61FA: $28 $07

cp   $0C                                      ; $61FC: $FE $0C
jr   z, .jr_002_6203                          ; $61FE: $28 $03

cp   $0D                                      ; $6200: $FE $0D
ret  nz                                       ; $6202: $C0

InventoryLoad5Handler:: xor a ; $5E1A: $AF ld [wWindowY], a ; $5E1B: $EA $9A $DB ld a, $01 ; $5E1E: $3E $01 ld [wPaletteUnknownE], a ; $5E20: $EA $D5 $DD ldh a, [hIsGBC] ; $5E23: $F0 $FE and a ; $5E25: $A7 jr z, jr_020_5E6D ; $5E26: $28 $45

ld   bc, InventoryPalettes                    ; $5E28: $01 $61 $5D
ld   hl, wBGPal1                              ; $5E2B: $21 $10 $DC
di                                            ; $5E2E: $F3
ld   a, $02                                   ; $5E2F: $3E $02
ldh  [rSVBK], a                               ; $5E31: $E0 $70

.renderInteractiveFrame

; Update graphics registers from game values
ld   a, [wWindowY]                            ; $02D5: $FA $9A $DB
ld   [rWY], a                                 ; $02D8: $E0 $4A
ld   a, [wBGPalette]                          ; $02DA: $FA $97 $DB
ld   [rBGP], a                                ; $02DD: $E0 $47
ld   a, [wOBJ0Palette]                        ; $02DF: $FA $98 $DB
ld   [rOBP0], a                               ; $02E2: $E0 $48
ld   a, [wOBJ1Palette]                        ; $02E4: $FA $99 $DB
ld   [rOBP1], a                               ; $02E7: $E0 $49
tobiasvl commented 1 year ago

kartlegg strukturene for åpning av inventory-skjermen i bank2 vs bank20 finn ut hvordan vi dispatcher bank2 i stedet for bank20, eller i tillegg (bare kopiere koden?) når vinduet scroller, prøv å kopiere over inventory-pallett i HBlank, enten før vinduet tegnes, eller i de 16 øverste linjene av vinduet

tobiasvl commented 1 year ago

DX also rescrolls and redraws current room when closing window (why?)

tobiasvl commented 1 year ago

.renderTransitionSfx

; If TransitionSfxFrameCount >= $60,
; start fading the screen to white.
push af                                       ; $02A0: $F5
cp   $60                                      ; $02A1: $FE $60
jr   c, .transitionFadeOutEnd                 ; $02A3: $38 $12
; If GBC...
ldh  a, [hIsGBC]                              ; $02A5: $F0 $FE
and  a                                        ; $02A7: $A7
jr   z, .renderDMGFadeOut                     ; $02A8: $28 $0A
; Render fade-to-white effect for GBC
callsb ApplyFadeToWhite_GBC                   ; $02AA: $3E $20 $EA $00 $21 $CD $A7 $6C
jr   .transitionDone                          ; $02B2: $18 $03

.renderDMGFadeOut ; Render fade-to-white effect for DMG call ApplyFadeToWhite_DMG ; $02B4: $CD $E8 $4F .transitionFadeOutEnd

.transitionDone ; Render transition effect ld a, BANK(RenderTransitionEffect) ; $02B7: $3E $14 ld [MBC3SelectBank], a ; $02B9: $EA $00 $21 pop af ; $02BC: $F1 call RenderTransitionEffect ; $02BD: $CD $38 $50

tobiasvl commented 1 year ago

subscreen scrolling åpning:

subscreen scrolling lukking:

tobiasvl commented 1 year ago

set LYC interrupt on last visible line change STAT to request mode 0 interrupt di halt popslide to copy colors

; this could go in the STAT handler for LY=LYC=$80

; turn off sprites ld a, $80 ld [rBCPI], a ld hl, rBCPD ld [wSP], sp di ld sp, PaletteData ld a, [rSTAT] ld [wSTAT], a ld a, $08 ; hblank ld [rSTAT], a halt REPT 5 pop de ld [hl], e ld [hl], d ENDR ld sp, wSP pop hl ld sp, hl ld a, [wSTAT] ld [rSTAT], a