Skip to content

Commit 8d6e917

Browse files
committed
tabs to spaces
1 parent ecd8718 commit 8d6e917

3 files changed

Lines changed: 213 additions & 213 deletions

File tree

cia.asm

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
#importonce
22
.filenamespace c64lib
33

4-
.label CIA1_BASE = $DC00
5-
.label CIA2_BASE = $DD00
4+
.label CIA1_BASE = $DC00
5+
.label CIA2_BASE = $DD00
66
.label CIA1_DATA_PORT_A = CIA1_BASE + 0
7-
.label CIA1_DATA_PORT_B = CIA1_BASE + 1
7+
.label CIA1_DATA_PORT_B = CIA1_BASE + 1
88
.label CIA2_DATA_PORT_A = CIA2_BASE + 0
99

10-
.label JOY_UP = %00001
11-
.label JOY_DOWN = %00010
12-
.label JOY_LEFT = %00100
13-
.label JOY_RIGHT = %01000
14-
.label JOY_FIRE = %10000
10+
.label JOY_UP = %00001
11+
.label JOY_DOWN = %00010
12+
.label JOY_LEFT = %00100
13+
.label JOY_RIGHT = %01000
14+
.label JOY_FIRE = %10000
1515

16-
.label BANK_0 = %00000011
17-
.label BANK_1 = %00000010
18-
.label BANK_2 = %00000001
19-
.label BANK_3 = %00000000
16+
.label BANK_0 = %00000011
17+
.label BANK_1 = %00000010
18+
.label BANK_2 = %00000001
19+
.label BANK_3 = %00000000
2020

2121
/*
2222
* Configures memory "bank" (16K) which is directly addressable by VIC2 chip.
2323
*
2424
* MOD: A
2525
*/
2626
.macro @setVICBank(bank) {
27-
lda CIA2_DATA_PORT_A
28-
and #%11111100
29-
ora #[bank & %00000011]
30-
sta CIA2_DATA_PORT_A
27+
lda CIA2_DATA_PORT_A
28+
and #%11111100
29+
ora #[bank & %00000011]
30+
sta CIA2_DATA_PORT_A
3131
}
3232
.assert "setVICBank(BANK_0) sets 11", { :setVICBank(BANK_0) }, {
33-
lda $DD00
34-
and #%11111100
35-
ora #%00000011
36-
sta $DD00
33+
lda $DD00
34+
and #%11111100
35+
ora #%00000011
36+
sta $DD00
3737
}
3838
.assert "setVICBank(BANK_3) sets 00", { :setVICBank(BANK_3) }, {
39-
lda $DD00
40-
and #%11111100
41-
ora #%00000000
42-
sta $DD00
39+
lda $DD00
40+
and #%11111100
41+
ora #%00000000
42+
sta $DD00
4343
}

sprites.asm

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Calculates sprite X position register address
77
*/
88
.function spriteXReg(spriteNo) {
9-
.return BASE + spriteNo * 2
9+
.return BASE + spriteNo * 2
1010
}
1111
.assert "Reg address for sprite0 X pos", spriteXReg(0), SPRITE_0_X
1212
.assert "Reg address for sprite7 X pos", spriteXReg(7), SPRITE_7_X
@@ -16,7 +16,7 @@
1616
* Calculates sprite Y position register address
1717
*/
1818
.function spriteYReg(spriteNo) {
19-
.return spriteXReg(spriteNo) + 1
19+
.return spriteXReg(spriteNo) + 1
2020
}
2121
.assert "Reg address for sprite0 Y pos", spriteYReg(0), SPRITE_0_Y
2222
.assert "Reg address for sprite7 Y pos", spriteYReg(7), SPRITE_7_Y
@@ -26,7 +26,7 @@
2626
* Calculates sprite bit position
2727
*/
2828
.function spriteMask(spriteNo) {
29-
.return pow(2, spriteNo)
29+
.return pow(2, spriteNo)
3030
}
3131
.assert "Bit mask for sprite 0", spriteMask(0), %00000001
3232
.assert "Bit mask for sprite 7", spriteMask(7), %10000000
@@ -36,7 +36,7 @@
3636
* Calculate sprite color register address
3737
*/
3838
.function spriteColorReg(spriteNo) {
39-
.return SPRITE_0_COLOR + spriteNo
39+
.return SPRITE_0_COLOR + spriteNo
4040
}
4141
.assert "Reg address for sprite0 color", spriteColorReg(0), SPRITE_0_COLOR
4242
.assert "Reg address for sprite7 color", spriteColorReg(7), SPRITE_7_COLOR
@@ -47,47 +47,47 @@
4747
* MOD: A
4848
*/
4949
.macro @locateSpriteX(x, spriteNo) {
50-
.if (x > 255) {
51-
lda #<x
52-
sta spriteXReg(spriteNo)
53-
lda SPRITE_MSB_X
54-
ora #spriteMask(spriteNo)
55-
sta SPRITE_MSB_X
56-
} else {
57-
lda #x
58-
sta spriteXReg(spriteNo)
59-
}
50+
.if (x > 255) {
51+
lda #<x
52+
sta spriteXReg(spriteNo)
53+
lda SPRITE_MSB_X
54+
ora #spriteMask(spriteNo)
55+
sta SPRITE_MSB_X
56+
} else {
57+
lda #x
58+
sta spriteXReg(spriteNo)
59+
}
6060
}
6161
.assert "locateSpriteX stores X in SPRITE_X reg", { :locateSpriteX(5, 3) }, {
62-
lda #$05
63-
sta SPRITE_3_X
62+
lda #$05
63+
sta SPRITE_3_X
6464
}
6565
.assert "locateSpriteX stores X in SPRITE_X and MSB regs", { :locateSpriteX(257, 3) }, {
66-
lda #$01
67-
sta SPRITE_3_X
68-
lda SPRITE_MSB_X
69-
ora #%00001000
70-
sta SPRITE_MSB_X
66+
lda #$01
67+
sta SPRITE_3_X
68+
lda SPRITE_MSB_X
69+
ora #%00001000
70+
sta SPRITE_MSB_X
7171
}
7272

7373
/*
7474
* Sets Y position of given sprite
7575
* MOD: A
7676
*/
7777
.macro @locateSpriteY(y, spriteNo) {
78-
lda #y
79-
sta spriteYReg(spriteNo)
78+
lda #y
79+
sta spriteYReg(spriteNo)
8080
}
8181
.assert "locateSpriteY stores Y in SPRITE_Y reg", { :locateSpriteY(5, 3) }, {
82-
lda #$05
83-
sta SPRITE_3_Y
82+
lda #$05
83+
sta SPRITE_3_Y
8484
}
8585

8686
/*
8787
* Sets X,Y position of given sprite
8888
* MOD A
8989
*/
9090
.macro @locateSprite(x, y, spriteNo) {
91-
:locateSpriteX(x, spriteNo)
92-
:locateSpriteY(y, spriteNo)
91+
:locateSpriteX(x, spriteNo)
92+
:locateSpriteY(y, spriteNo)
9393
}

0 commit comments

Comments
 (0)