Skip to content

Commit

Permalink
Added macros for setting sprite multicolor
Browse files Browse the repository at this point in the history
  • Loading branch information
intoinside committed Jan 2, 2023
1 parent b600ecd commit 6e75120
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/sprites-global.asm
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
.macro @c128lib_SpriteEnableMulticolor(mask) { SpriteEnableMulticolor(mask) }
.macro @c128lib_SpriteDisableMulticolor(mask) { SpriteDisableMulticolor(mask) }
.macro @c128lib_SpriteColor(spriteNo, color) { SpriteColor(spriteNo, color) }
.macro @c128lib_SpriteMultiColor0(color) { SpriteMultiColor0(color) }
.macro @c128lib_SpriteMultiColor1(color) { SpriteMultiColor1(color) }

.macro @c128lib_sh(data) { sh(data) }
.macro @c128lib_sm(data) { sm(data) }
30 changes: 30 additions & 0 deletions lib/sprites.asm
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,36 @@
lda #1; sta $D029
}

/*
Set sprite multi color 0

Params:
color - color to set

*/
.macro SpriteMultiColor0(color) {
lda #color
sta Vic2.SPRITE_COL_0
}
.assert "SpriteMultiColor0(WHITE)", { SpriteMultiColor0(WHITE) }, {
lda #1; sta $D025
}

/*
Set sprite multi color 1

Params:
color - color to set

*/
.macro SpriteMultiColor1(color) {
lda #color
sta Vic2.SPRITE_COL_1
}
.assert "SpriteMultiColor1(WHITE)", { SpriteMultiColor1(WHITE) }, {
lda #1; sta $D026
}

.macro sh(data) {
.assert "Hires sprite line length must be 24", data.size(), 24
.byte convertHires(data.substring(0, 8)), convertHires(data.substring(8, 16)), convertHires(data.substring(16,24))
Expand Down

0 comments on commit 6e75120

Please sign in to comment.