Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.
Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.
lda <dlist
sta $200
lda >dlist
sta $201
lda #$c0
sta $22f
dlist
pha
lda >adres_zestawu_fontow ;$e0 (?)
sta $d409
pla
rti
ldx #20*3
loop lda linia1-3,x
ora przesuniecie ; <0,63-16>
sta linia1-3,x
dex
dex
dex
bne loop
XXXX12
XXXX12
XXXX12
111112
222222
byte highlight_mask[4]={0xC0,0x30, 0xC, 0x3};
void highlight_map(byte x,byte y)
{
register word i;
register byte line;
// Choose the proper sprite (PMBASE = &sprites)
i=x/4;
i*=0x80;
// 0x200 - first sprite
i+=0x200;
i+=16; // top of the map on the screen
i+=y*8;
for (line=0;line<8;++line)
POKE(&sprites+i+line,PEEK(&sprites+i)|highlight_mask[x%4]);
}
i equ $80
lda x
:2 lsr @
sta i
lda y
:3 asl @
adc i
adc #16+7
tay
lda x
and #3
tax
lda highlight_mask,x
sta spr+1
ldx #7
spr lda #$c0
ora sprites+$200,y
sta sprites+$200,y
dey
dex
bpl spr
;.X=x, .Y=y, spr=Z
txa
lsr @
lsr @
lsr @
pha
php
tya
asl @
asl @
asl @
adc #16
plp
bcc *+4
adc #$80-1
sta spr
pla
adc #>sprities+$200
sta spr+1
txa
and #%11
tax
lda highlight_mask,x
ldy #8-1
ora (spr),y
mark equ *
sta (spr),y
dey
bpl mark
adc #>sprities+$180
php
tya
asl @
asl @
asl @
adc #16
plp
bcc *+4
adc #$80-1
tya
bcc *+4
ora #%10000
asl @
asl @
asl @
adc #16
;.X=x, .Y=y, spr=Z
txa
lsr @
lsr @
lsr @
pha
tya
bcc *+4
ora #%10000
asl @
asl @
asl @
adc #16
sta spr
pla
adc #>sprities+$200
sta spr+1
txa
and #%11
tax
lda highlight_mask,x
ldy #8-1
ora (spr),y
sta (spr),y
dey
bpl *-3
lda >sprites+$200/2
sta spr+1
lda x
and #18
asl @
ora y
:3 asl @
rol spr+1
adc #16
sta spr
lda x
and #3
tax
lda highlight_mask,x
ldy #7
ora (spr),y
lspr
sta (spr),y
dey
bpl lspr
;.Y=yx, spr=Z
lda lspr,y
sta spr
lda hspr,y
sta spr+1
lda mask,y
ldy #8-1
ora (spr),y
sta (spr),y
dey
bpl *-3
mask equ *
dta b($c0,$30,$c,3)
dta b($c0,$30,$c,3)
...
lspr equ *
dta l(sprities+$210,sprities+$210,sprities+$210,sprities+$210) ;x=0..3, y=0
dta l(sprities+$290,sprities+$290,sprities+$290,sprities+$290) ;x=4..7, y=0
...
dta l(sprities+$218,sprities+$218,sprities+$218,sprities+$218) ;x=0..3, y=1
...
hspr equ *
dta h(sprities+$210,sprities+$210,sprities+$210,sprities+$210) ;x=0..3, y=0
;.Y=yx (x - bity 1..4), .CF=x - bit 0, spr=Z
lda lspr,y
sta spr
lda hspr,y
sta spr+1
tya
rol @
tay
lda mask,y
ldy #8-1
ora (spr),y
sta (spr),y
dey
bpl *-3
...
mask equ *
dta b($c0,$30,$c,3)
...
lspr equ *
:2 dta l(sprities+$190) ;x=0..3, y=0
:2 dta l(sprities+$210) ;x=4..7, y=0
:2 dta l(sprities+$290) ;x=8..11, y=0
:2 dta l(sprities+$310) ;x=12..15, y=0
:2 dta l(sprities+$390) ;x=16..19, y=0
:6 dta b(?) ;6 bajtów nieistotnych
:2 dta l(sprities+$198) ;x=0..3, y=1
...
hspr equ *
:2 dta h(sprities+$190) ;x=0..3, y=0
:2 dta h(sprities+$210) ;x=4..7, y=0
:2 dta h(sprities+$290) ;x=8..11, y=0
:2 dta h(sprities+$310) ;x=12..15, y=0
:2 dta h(sprities+$390) ;x=16..19, y=0
:6 dta b(?) ;6 bajtów nieistotnych
:2 dta h(sprities+$198) ;x=0..3, y=1
...
;.Y=yx (x - bity 1..4), .CF=x - bit 0, spr=Z
lda lspr,y
sta spr
lda hspr,y
sta spr+1
bcs v2
lda mask,y
ldy #8-1
ora (spr),y
sta (spr),y
dey
bpl *-3
...
v2 equ *
lda mask2,y
ldy #8-1
ora (spr),y
sta (spr),y
dey
bpl *-3
...
mask equ *
dta b($c0,$c)
...
mask2 equ *
dta b($30,3)
...
;.Y=yx (x - bity 1..4), .CF=x - bit 0, spr=Z
lda lspr,y
sta spr
lda hspr,y
sta spr+1
lda mask,y
bcc *+5
lda mask2,y
ldy #8-1
ora (spr),y
sta (spr),y
dey
bpl *-3
...
lda x
and #$18
asl @
ora y
adc #2
:3 asl @
sta spr
lda >(sprites+$200)/2
rol @
sta spr+1
lda x
and #3
tay
lda highlight_mask,y
ldy #7
ora (spr),y
sta (spr),y
dey
bpl *-3
;.Y=yx (x - bity 1..4), .CF=x - bit 0, spr=Z
rol maskh
lda lspr,y
sta spr
lda hspr,y
sta spr+1
lda mask/2,y
maskh equ *-1
ldy #8-1
ora (spr),y
sta (spr),y
dey
bpl *-3
lsr maskh
;.Y=yx (x - bity 1..4), .CF=x - bit 0, spr=Z
highlight_map equ *
rol maskh
lda lspr,y
sta spr
lda hspr,y
sta spr+1
lda mask/2,y
maskh equ *-1
ldy #8-1
ora (spr),y
spr equ *+1
sta $ffff,y ;adres zostanie nadpisany
dey
bpl *-4
lsr maskh
rts