Permalink
Browse files

bugfixes re button read/next song

  • Loading branch information...
jkotlinski committed Jul 3, 2018
1 parent 2d84409 commit a30e7d049efc29e47f90c010a3d8c67b9144947c
Showing with 18 additions and 5 deletions.
  1. +1 −1 README.md
  2. +10 −3 boot.s
  3. +7 −1 player.s
@@ -34,7 +34,7 @@ Contains the player code. Following symbols are exported:

; IN: a = song number
; OUT: -
; SIDE EFFECTS: trashes af, de, hl
; SIDE EFFECTS: trashes af
;
; Starts playing a song. If a song is already playing,
; make sure interrupts are disabled when calling this.
13 boot.s
@@ -53,18 +53,25 @@ SECTION "setup",ROM0[$150]
call LsdjPlaySong
ei

call .delay

.wait_button_released
ldh a,[0]
and $f
cp $f
jr nz,.wait_button_released

.delay
inc a
jr nz,.delay
call .delay

jr .mainloop

.delay
xor a
.delay_loop
inc a
jr nz,.delay_loop
ret

.lcd_interrupt_handler
push af

@@ -14,9 +14,12 @@ SECTION "player_code",ROM0
;
; IN: a = song number
; OUT: -
; SIDE EFFECTS: trashes af, de, hl
; SIDE EFFECTS: trashes af
;
LsdjPlaySong::
push de
push hl

ld [Song],a
ld d,0
add a,a
@@ -34,6 +37,9 @@ LsdjPlaySong::
ld [CurrentPtr],a
ld a,[hl]
ld [CurrentPtr+1],a

pop hl
pop de
ret

; Call this six times per screen update,

0 comments on commit a30e7d0

Please sign in to comment.