From 964da828073765d994736629242a3890acae42cb Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Mon, 22 Jun 2020 23:45:25 -0400 Subject: [PATCH] Add some sprites for the scorpion. --- BuGS/game.s | 6 + BuGS/main.c | 4 +- BuGS/sprites.s | 347 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 356 insertions(+), 1 deletion(-) diff --git a/BuGS/game.s b/BuGS/game.s index f49dc71..16be18f 100644 --- a/BuGS/game.s +++ b/BuGS/game.s @@ -204,6 +204,12 @@ game start ldx #$3493 jsl score900 + ldx #$3e0b + jsl scorpion1 + + ldx #$3e1b + jsl scorpion1s + jsl waitForKey rtl diff --git a/BuGS/main.c b/BuGS/main.c index 3d00fca..ae205cb 100644 --- a/BuGS/main.c +++ b/BuGS/main.c @@ -56,7 +56,9 @@ int main(void) TOOLFAIL("Unable to start tools"); CompactMem(); - NewHandle(0x8000, userid, attrLocked | attrFixed | attrAddr | attrBank, (Pointer)0x012000); + /* Allocate $1000 extra before the SHR screen so I can write sprites above the start of the + screen without overwriting memory I do not own. */ + NewHandle(0x9000, userid, attrLocked | attrFixed | attrAddr | attrBank, (Pointer)0x011000); TOOLFAIL("Unable to allocate SHR screen"); game(); diff --git a/BuGS/sprites.s b/BuGS/sprites.s index 987502a..2b6ee4d 100644 --- a/BuGS/sprites.s +++ b/BuGS/sprites.s @@ -4234,6 +4234,353 @@ score900 entry _spriteFooter +scorpion1 entry + _spriteHeader + +; $d - Green +; $e - Red +; $f - Off-white +; +; O.O.|.ROR|..O.|O... +; .O..|RROR|R..O|.... +; .OO.|.OOO|..OO|.OOO +; ..OO|OOOO|OOO.|.O.O +; ....|.OOO|O...|...O +; ....|.OOO|O...|..OO +; ....|.OOO|OOOO|OOOO +; ....|..OO|OOOO|OOO. +; + + dex + dex + dex + dex + dex + dex + dex + dex + txa + tcs + ldy #$ffff ; Off-white, Off-white, Off-white, Off-white + ldx #$feee ; Red, Red, Off-white, Red + clc + + lda $1,s + and #$0f0f + ora #$f0f0 + sta $1,s + + lda $3,s + and #$00f0 + ora #$fe0e + sta $3,s + + lda $5,s + and #$0fff + ora #$f000 + sta $5,s + + lda $7,s + and #$ff0f + ora #$00f0 + sta $7,s + + lda $a1,s + and #$fff0 + ora #$000f + sta $a1,s + + tsc + adc #$a4 + tcs + + phx + + lda $3,s + and #$f00f + ora #$0fe0 + sta $3,s + + lda $9f,s + and #$0ff0 + ora #$f00f + sta $9f,s + + lda $a1,s + and #$00f0 + ora #$ff0f + sta $a1,s + + lda $a3,s + and #$00ff + ora #$ff00 + sta $a3,s + + lda $a5,s + and #$00f0 + ora #$ff0f + sta $a5,s + + tsc + adc #$142 + tcs + + phy + + tsc + dec a + dec a + tcs + + lda $1,s + and #$00ff + ora #$ff00 + sta $1,s + + lda $5,s + and #$0f00 + ora #$f0ff + sta $5,s + + lda $7,s + and #$f0f0 + ora #$0f0f + sta $7,s + + lda $a3,s + and #$00f0 + ora #$ff0f + sta $a3,s + + lda $a5,s + and #$ff0f + ora #$00f0 + sta $a5,s + + lda $a7,s + and #$f0ff + ora #$0f00 + sta $a7,s + + tsc + adc #$140 + tcs + + lda $3,s + and #$00f0 + ora #$ff0f + sta $3,s + + lda $5,s + and #$ff0f + ora #$00f0 + sta $5,s + + lda $7,s + and #$00ff + ora #$ff00 + sta $7,s + + lda $a3,s + and #$00f0 + ora #$ff0f + sta $a3,s + + tsc + adc #$a8 + tcs + + phy + phy + + lda $9f,s + and #$00ff + ora #$ff00 + sta $9f,s + + lda $a3,s + and #$0f00 + ora #$f0ff + sta $a3,s + + + tsc + adc #$a2 + tcs + + phy + + _spriteFooter + + +scorpion1s entry + _spriteHeader + +; $d - Green +; $e - Red +; $f - Off-white +; +; ...O|.O..|ROR.|.O.O|.... +; ....|O..R|RORR|..O.|.... +; ....|OO..|OOO.|.OO.|OOO. +; ....|.OOO|OOOO|OO..|O.O. +; ....|....|OOOO|....|..O. +; ....|....|OOOO|....|.OO. +; ....|....|OOOO|OOOO|OOO. +; ....|....|.OOO|OOOO|OO.. +; + + dex + dex + dex + dex + dex + dex + dex + dex + dex + dex + txa + tcs + ldy #$ffff ; Off-white, Off-white, Off-white, Off-white + ldx #$eeef ; Red, Off-white, Red, Red + clc + + lda $1,s + and #$f0ff + ora #$0f00 + sta $1,s + + lda $3,s + and #$fff0 + ora #$000f + sta $3,s + + lda $5,s + and #$0f00 + ora #$e0ef + sta $5,s + + lda $7,s + and #$f0f0 + ora #$0f0f + sta $7,s + + lda $a3,s + and #$f00f + ora #$0ef0 + sta $a3,s + + lda $a7,s + and #$0fff + ora #$f000 + sta $a7,s + + tsc + adc #$a6 + tcs + + phx + + lda $9f,s + and #$ff00 + ora #$00ff + sta $9f,s + + lda $a1,s + and #$0f00 + ora #$f0ff + sta $a1,s + + lda $a3,s + and #$0ff0 + ora #$f00f + sta $a3,s + + lda $a5,s + and #$0f00 + ora #$f0ff + sta $a5,s + + tsc + adc #$142 + tcs + + phy + + tsc + dec a + dec a + tcs + + lda $1,s + and #$00f0 + ora #$ff0f + sta $1,s + + lda $5,s + and #$ff00 + ora #$00ff + sta $5,s + + lda $7,s + and #$0f0f + ora #$f0f0 + sta $7,s + + lda $a7,s + and #$0fff + ora #$f000 + sta $a7,s + + tsc + adc #$a4 + tcs + + phy + + lda $a5,s + and #$0ff0 + ora #$f00f + sta $a5,s + + tsc + adc #$a2 + tcs + + phy + + lda $a5,s + and #$0f00 + ora #$f0ff + sta $a5,s + + tsc + adc #$a4 + tcs + + phy + phy + + lda $a1,s + and #$00f0 + ora #$ff0f + sta $a1,s + + lda $a5,s + and #$ff00 + ora #$00ff + sta $a5,s + + tsc + adc #$a4 + tcs + + phy + + _spriteFooter + + backupStack dc i2'0' end