Tools used SpritePad, KickassIDE so there's no confusion.
Music By (ECO) giving credit where credit is do!
http://www.uploadmb.com/dw.php?id=1414999292
http://www.uploadmb.com/dw.php?id=1414997203
For the nosey REMOVED unregistered people.
Code: Select all
.pc = $801
.byte $0b, $08, $06, $00, $9e, $32, $30, $36, $34, 0,0,0
.pc = $810
jmp Start
.var _TmpOffset = $02
.var _ObjectDirection = $03
.var _ObjectDataPtr = $05
.var _ObjectFrameTic = $07
.var _ObjectFrameStructPtrOffset = $09
.var _Counter = $20
//////////////////////////////////////////////////////////////////////////////////
.const Black = 0
.const White = 1
.const Red = 2
.const Cyan = 3
.const Purple = 4
.const Green = 5
.const Blue = 5
.const Yellow = 7
.const Orange = 8
.const Brown = 9
.const Pink = 10
.const DarkGrey = 11
.const MediumGrey = 12
.const LightGreen = 13
.const LightBlue = 14
.const LightGrey = 15
.const EndMarker = $ff
.const ObjectFrameDataPointer = $07f8
.const ObjectXMSBReg = $d010
.const ObjectMultiColorReg = $d01c
.const ObjectColorReg = $d027
//////////////////////////////////////////////////////////////////////////////////
.pc = $8000-2
Start:
jsr Do_ClearScreen
lda #Black
sta $d020 //BorderColorReg = Black
sta $d021 //BackRoundColor Reg = Black
lda #%00000011 //Enable 3 objects
sta $d015
lda #%00000010
sta ObjectMultiColorReg
lda #5
sta ObjectColorReg
lda #1
sta ObjectColorReg+1
lda #13
sta $d025
lda #3
sta $d026
ldx #$ad
stx ObjectFrameDataPointer
dex
stx ObjectFrameDataPointer+1
ldx #0
stx _ObjectDirection
stx _ObjectDirection+1
stx _ObjectFrameStructPtrOffset
stx _ObjectFrameTic
lda #50
sta $d000 //Object 1 xposition
sta $d002 //Object 2 x poosition
lda #160
sta $d001 //Object 1 y position
sta $d003 //Object 2 y position
jsr do_initIRQ
GameLoop:
jsr Do_HandleVblank
jsr Do_HandleAnimation
jsr Do_HandleObjects
inc _Counter
jmp GameLoop
//////////////////////////////////////////////////////////////////////////////////
Do_HandleVblank:
lda $d012
bpl Do_HandleVblank
VblankWait:
lda $d012
bmi VblankWait
rts
//////////////////////////////////////////////////////////////////////////////////
Do_HandleAnimation:
ldx #0
lda _ObjectFrameTic,x
bne HandleAnimationCont3
//////////////////////////////////////////////////////////////////////////////////
//Used For Pointer Creation [Clarity]
//Added Code Incoming As I Add Additional Objects
//Conversing with TMR on Irc And Learning The Amount Of Frames Armour Storm Used,I've Modified My Animation Function
//No worries This will Progress Into A Dynamic Animation Function /Macro Once I Think It Through
//////////////////////////////////////////////////////////////////////////////////
lda #<BlobDataTab
sta _ObjectDataPtr
lda #>BlobDataTab
sta _ObjectDataPtr+1
ldy #0
lda _ObjectFrameStructPtrOffset,x
HandleAnimationCont:
sta _TmpOffset
asl
asl
tay
inc _ObjectFrameStructPtrOffset,x
lda (_ObjectDataPtr),y
cmp #EndMarker
bne HandleAnimationCont2
lda #0
sta _ObjectFrameStructPtrOffset,x
beq HandleAnimationCont
HandleAnimationCont2:
sta $07f8
sec
sbc #1
sta $07f9
iny
iny
lda (_ObjectDataPtr),y
sta _ObjectFrameTic,x
HandleAnimationCont3:
dec _ObjectFrameTic,x
HandleAnimationDone:
rts
//////////////////////////////////////////////////////////////////////////////////
//Object Direction
//1 = east
//0 = west
//Temp Object Handling Function
//////////////////////////////////////////////////////////////////////////////////
Do_HandleObjects:
lda _Counter
and #1
bne HandleObjectsDone
ldy #1
ldx #2
HandleObjectsCont:
lda _ObjectDirection,y
beq ObjectDirectionWest
ObjectDirectionEast:
inc $d000,x
lda $d000,x
cmp #254
bne NextObject
InvertDirection:
lda _ObjectDirection,y
eor #1
sta _ObjectDirection,y
jmp NextObject
ObjectDirectionWest:
dec $d000,x
lda $d000,x
cmp #26
bne NextObject
jmp InvertDirection
NextObject:
dex
dex
dey
bpl HandleObjectsCont
HandleObjectsDone:
rts
//////////////////////////////////////////////////////////////////////////////////
do_initIRQ:
sei
ldx #1
stx $d019
stx $d01a
lda #<do_tune
sta $314
lda #>do_tune
sta $315
dex
stx $d012
lda #$7f
sta $dc0d
sta $dd0d
txa
jsr $1000
cli
rts
//////////////////////////////////////////////////////////////////////////////////
do_tune:
inc $d019
jsr $1003
jmp $ea31
//////////////////////////////////////////////////////////////////////////////////
Do_ClearScreen:
ldx #0
lda #32
ClearScreenLoop:
sta $400,x
sta $500,x
sta $600,x
sta $700,x
inx
bne ClearScreenLoop
rts
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
BlobFrameStructurePtr: //not used yet
.word BlobDataTab //not used yet
//////////////////////////////////////////////////////////////////////////////////
BlobDataTab:
.byte $ad //currentframe
.byte $00 //not used yet
.byte $0c //frame tic counter
.byte $40 //not used yet
//////////////////////////////////////////////////////////////////////////////////
.byte $af //currentframe
.byte $00 //not used yet
.byte $0c //frame tic counter
.byte $40 //not used yet
//////////////////////////////////////////////////////////////////////////////////
.byte $b1 //currentframe
.byte $00 //not used yet
.byte $0c //frame tic counter
.byte $40 //not used yet
//////////////////////////////////////////////////////////////////////////////////
.byte $af //currentframe
.byte $00 //not used yet
.byte $0c //frame tic counter
.byte $40 //not used yet
.byte EndMarker
//////////////////////////////////////////////////////////////////////////////////
.pc = $2000-2
.import binary "BubObjects.prg"
.pc = $1000-$7e
.import binary "Love_Is_a_Shield.sid"