gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
gbdk-lib/libc/targets/mos6502/nes/fill_rect_bk.s
1 .include "global.s"
2
3 .area GBDKOVR (PAG, OVR)
4 .fill_bkg_rect_padding:: .ds 4 ; Padding to avoid clash with _set_bkg_tile_xy vars
5 _fill_bkg_rect_PARM_3::
6 _fill_win_rect_PARM_3:: .ds 1
7 _fill_bkg_rect_PARM_4::
8 _fill_win_rect_PARM_4:: .ds 1
9 _fill_bkg_rect_PARM_5::
10 _fill_win_rect_PARM_5:: .ds 1
11 .xpos: .ds 1
12 .ypos: .ds 1
13 .xpos_save: .ds 1
14 .width_save: .ds 1
15
16 .area _HOME
17
18 .ifdef NES_WINDOW_LAYER
19 _fill_win_rect::
20 tay
21 lda *__current_vram_cfg_write
22 pha
23 ora #PPUHI_WIN
24 sta *__current_vram_cfg_write
25 tya
26 jsr _fill_bkg_rect
27 pla
28 sta *__current_vram_cfg_write
29 rts
30 .endif
31
32 _fill_bkg_rect::
33 .define .width "_fill_bkg_rect_PARM_3"
34 .define .height "_fill_bkg_rect_PARM_4"
35 .define .tile "_fill_bkg_rect_PARM_5"
36 sta *.xpos
37 sta *.xpos_save
38 stx *.ypos
39 lda *.width
40 sta *.width_save
41 lda *.tile
42 sta *_set_bkg_tile_xy_PARM_3
43 1$:
44 lda *.xpos
45 and #.DEVICE_SCREEN_BUFFER_WIDTH-1
46 ldx *.ypos
47 jsr _set_bkg_tile_xy
48 inc *.xpos
49 dec *.width
50 bne 1$
51 lda *.xpos_save
52 sta *.xpos
53 lda *.width_save
54 sta *.width
55 inc *.ypos
56 lda *.ypos
57 cmp #.DEVICE_SCREEN_BUFFER_HEIGHT
58 bne 0$
59 lda #0
60 0$:
61 sta *.ypos
62 dec *.height
63 bne 1$
64 rts
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.