Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RectWindow:
- ;bc=height, de=x, hl=y, (sp)=ret, (sp+2)=width
- ex (sp),hl
- pop af
- ex (sp),hl
- push bc
- ld bc,320
- push af
- ld a,$21*2
- call RectWindow_1
- pop de
- ex (sp),hl
- push bc
- ld bc,240
- ld a,$20*2
- call RectWindow_1
- ld a,h
- or l
- ld a,c
- Abort_2:
- pop bc
- pop de
- ret
- ;a=clipped height, bc=clipped width, de=x feedback, hl=y feedback
- RectWindow_1:
- ;a=aport*2, bc=sdim, de=p1, hl=rdim
- dec hl
- add hl,de
- rra
- ex de,hl
- push hl
- sbc hl,bc
- or a
- add hl,bc
- jr c,RectWindow_1_P1Ok
- ld l,a
- and h
- jp p,Abort_4
- ld a,l
- sbc hl,hl
- RectWindow_1_P1Ok:
- and $7F
- call LCD_Out_A_HL
- add a,8
- add a,a
- call LCD_Out_A_HL
- ex de,hl
- dec c
- sbc hl,bc
- jr c,RectWindow_1_P2Ok
- sbc hl,hl
- RectWindow_1_P2Ok:
- add hl,bc
- add a,1
- call LCD_Out_A_HL
- inc hl
- sbc hl,de
- ld b,h
- ld c,l
- pop hl
- sbc hl,de
- ret
- ;a=weport, bc=clipped rdim, de=clipped p1, hl=p1 feedback
- Abort_4:
- scf
- pop bc
- Abort_3:
- pop bc
- jr Abort_2
- LCD_Out_A_HL:
- push af
- out ($10),a
- out ($10),a
- ld a,h
- out ($11),a
- ld a,l
- out ($11),a
- pop af
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement