Skip to content

Commit

Permalink
Not broken again!
Browse files Browse the repository at this point in the history
  • Loading branch information
burnsauce committed Nov 18, 2019
1 parent 974d1e8 commit 3fa2a3d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 25 deletions.
8 changes: 8 additions & 0 deletions common.asm
Expand Up @@ -31,13 +31,21 @@
adc _16bitNext(b)
sta _16bitNext(tar)
}

.pseudocommand inc16 a {
inc a
bne !+
inc _16bitNext(a)
!:
}

.pseudocommand dec16 a {
lda a
bne !+
dec _16bitNext(a)
!: dec a
}

.function reserve(bytes) {
.var ret = nextVar
.if (nextVar == $100) {
Expand Down
49 changes: 29 additions & 20 deletions frame.asm
Expand Up @@ -20,6 +20,7 @@
.label secondsc = reserve(1)
.label level = reserve(1)
.label xscroll = reserve(1)
.label scrolling = reserve(1)
.label nextFrameISR = reserve(2)

.macro scankey(col) {
Expand All @@ -42,6 +43,7 @@
sta keyheld
sta powerLevel
sta seconds
sta scrolling
lda #1
sta level
lda #$f
Expand Down Expand Up @@ -95,11 +97,22 @@ preFrameISR:
lda #preFrameRaster
sta $d012
}

.label ftmp = reserve(1)
.align $100
*=* "finishFrame"
finishFrame:
dec xscroll
lda #80
bit scrolling
bne !+
jmp fdone
!: dec scrolling
lda scrolling
and #$7f
bne !+
sta scrolling
jmp fdone
!: dec xscroll
lda #$f
and xscroll
sta xscroll
Expand All @@ -111,29 +124,20 @@ finishFrame:
ora ftmp
sta $d016
lda xscroll
/* cmp #$0
bne fswitch
!: lda $d011
bpl !-
!: lda $d011
bmi !-
!: lda $d012
cmp #14
bmi !-
copyDblToRam()
//cmp #0
beq !+
jmp fsw
!: //switchToPreframe()
switchBank()
jmp fdone
*/
fswitch:
cmp #$f
fsw: cmp #$f
beq !+
jmp fdone
!: switchBank()
doSwitchBank()
!: doSwitchBank()
copyDblToRam()
fdone: asl $d019
finishISR()


*=* "Animation Handlers"

ph1ani: pushFrogRight(frspd)
Expand Down Expand Up @@ -177,6 +181,7 @@ frameISR:
lda #0
sta DDRB
scankey(0)
//scankey(7)
beq !+
jmp holding
!: scankey(1)
Expand All @@ -203,7 +208,8 @@ frameISR:
!: lda keyheld
bne jumpnow
animate()
jumpnow: lda #1
jumpnow:
lda #1
sta jumping
sta phcount
lda powerLevel
Expand All @@ -218,10 +224,13 @@ jumpnow: lda #1
sta frdiv
lda #0
sta keyheld
lda #$ff
sta scrolling
jmp skipkey
holding: lda keyheld
holding:
lda keyheld
bne !+
jmpsound()
jmpsound()
lda #1
sta keyheld
!: lda powerLevel
Expand Down
17 changes: 12 additions & 5 deletions main.asm
Expand Up @@ -41,10 +41,17 @@ init: sei
.segment Code "Main Loop"
ready: copySprites()
copyDblRam()
loop: lda xscroll
cmp #$f
bne loop
copyDblBitmap()
lda #$80
loop: bit scrolling
beq loop
scrl: lda xscroll
cmp #$e
bne scrl
copyDblMatrix()
copyDblBitmap()
copyDblRam()
jmp loop
lda #$80
bit scrolling
beq !+
jmp scrl
!: jmp loop
2 changes: 2 additions & 0 deletions run.cfg
@@ -1 +1,3 @@
-execute "C:\Vice\x64sc -sound +warp"
-showmem
-symbolfile

0 comments on commit 3fa2a3d

Please sign in to comment.