Prev: F3B6 Up: Map Next: F414
F3E2: Replay the four 4K windows at $C000 through the engine sound routine
Not a paging routine, despite the label and the call sites' comments. It walks four 4096-byte windows from $C000 up. Each window is copied down to $B000, setup_engine_sfx is entered at $8209 with the engine speed set up, the window is replayed a byte at a time by the LDI loop at f3fd_loop with a write back to the source, the relocated reset_paging_128k at $8208 restores the pager, and the window is copied back from $B000.
page_128k F3E2 LD HL,$C000 HL = $C000
F3E5 LD B,$04 4 iterations
F3E7 LD E,L E = 0
f3e8_loop F3E8 PUSH BC Preserve iterations
F3E9 LD D,$B0 DE = $B000
F3EB LD BC,$1000 4096 bytes
F3EE PUSH BC Preserve
F3EF PUSH HL
F3F0 LDIR Copy
F3F2 LD A,$03 A = 3
F3F4 CALL setup_engine_sfx_48k_0 Jump into setup_engine_sfx with engine speed setup
F3F7 POP HL Retrieve from stack
F3F8 POP BC
F3F9 PUSH BC
F3FA PUSH HL
F3FB LD D,$B0 DE = $B000
f3fd_loop F3FD LD A,(DE) A = *DE
F3FE LDI Transfer a byte
F400 DEC HL HL[-1] = A
F401 LD (HL),A
F402 INC HL
F403 JP PE,$81F1 Loop if (parity even) to f3fd_loop
F406 CALL $8208 Call relocated reset_paging_128k
F409 POP DE Restore
F40A POP BC
F40B LD H,$B0 HL = $B000
F40D LDIR Copy
F40F LD H,D H = D
F410 POP BC Restore iterations
F411 DJNZ f3e8_loop Loop to f3e8_loop
F413 RET Return
Prev: F3B6 Up: Map Next: F414