Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- build_songs_big_map:
- ; zero entire songs map
- ; ld hl,songs_map
- ; ld bc,$1000 ; 4096 = 64 * 64
- ; xor a
- ; call mem_set
- ; enable ram access to read/write
- xor a
- ld e,a
- ld d,a
- ld a,$0a
- ld [de],a ; $0000 = $0a
- ; Loop over all songs
- ld hl,$a000
- ld a,[hl]
- ld [reg_r],a
- ld d,a
- ld bc,$a001
- .curr_song_loop:
- ld a,d
- and a
- jp z,.curr_song_loop_done
- ld h,b
- ld l,c
- ld a,[hli] ; get row
- ld [reg_r],a
- ld a,[hli] ; get col
- ld [reg_q],a
- push bc
- ; set songs big map position to 1
- ; calculate row * 64 => hl
- ld a,[reg_r]
- ld l,a
- ld h,0 ; hl = [reg_r]
- REPT 6
- add hl,hl ; hl = hl * 64
- ENDR
- ; add col to hl
- ld a,[reg_q]
- ld c,a
- ld b,0
- add hl,bc
- ; add songs_map to hl
- ld h,b
- ld l,c
- ld hl,songs_map
- add hl,bc
- ; set songs_map value to having a song
- ld [hl],1
- pop bc
- ; move to next song
- add_8bit_to_16bit 64,c,b
- dec d
- jp .curr_song_loop
- .curr_song_loop_done:
- ; For each song, get its row/col coordinates
- ; Go to proper position for row/col coordinates in map and put 1 there
- ld hl,songs_map
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement