Open tobiasvl opened 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
DX also rescrolls and redraws current room when closing window (why?)
.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
subscreen scrolling åpning:
subscreen scrolling lukking:
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
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
.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
.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
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
.renderInteractiveFrame