prepare for VU meters

This commit is contained in:
wbcbz7 2025-08-20 18:40:44 +07:00
parent dff96990fc
commit 0bf06f38d1
7 changed files with 84 additions and 74 deletions

View file

@ -1,5 +1,5 @@
@echo off
bas2tap -a10 -spsgplay loader.bas loader.tap
sjasmplus main.asm --lst=main.lst
copy /b loader.tap+player.tap+page0.tap+page1.tap+page3.tap+page4.tap+page6.tap+page7.tap "moebius.tap"
copy /b loader.tap+player.tap+page0.tap+page1.tap+page3.tap+page4.tap+page6.tap+page7.tap+splash.tap "moebius.tap"
pause

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -6,4 +6,5 @@
60 POKE 23388,20 : OUT 32765,20 : LOAD "page4" CODE
70 POKE 23388,22 : OUT 32765,22 : LOAD "page6" CODE
80 POKE 23388,23 : OUT 32765,23 : LOAD "page7" CODE
90 POKE 23388,16 : OUT 32765,16 : LOAD "splash" CODE
100 RANDOMIZE USR 33155

View file

@ -55,6 +55,10 @@ start:
inc hl
call player.reg_out
ld a, 3 : out (0xfe), a
; draw vu meters
ld iy, reg_buffer
call player.play_tick
xor a : out (0xfe), a
@ -106,45 +110,47 @@ vumeter:
; ------------------
; drawing routines
; DE - dst
; BC - dst
.draw_e:
ld a, 0b00000000 : ld [bc], a : inc b ; 18
ld a, 0b11111111 : ld [bc], a : inc b ; 18
ld a, 0b11000011 : ld [bc], a : inc b ; 18
ld a, 0b11011111 : ld [bc], a : inc b ; 18
ld a, 0b11000111 : ld [bc], a : inc b ; 18
ld a, 0b11011111 : ld [bc], a : inc b ; 18
ld a, 0b11000011 : ld [bc], a : inc b ; 18
ld a, 0b11111111 : ld [bc], a : ret ; 24 = 150t per char
ld a, 0b11111110 : ld [bc], a : inc b ; 18
ld a, 0b11000110 : ld [bc], a : inc b ; 18
ld a, 0b11011110 : ld [bc], a : inc b ; 18
ld a, 0b11001110 : ld [bc], a : inc b ; 18
ld a, 0b11011110 : ld [bc], a : inc b ; 18
ld a, 0b11000110 : ld [bc], a : inc b ; 18
ld a, 0b11111110 : ld [bc], a : ret ; 24 = 150t per char
.draw_0:
.draw_1:
dup 7 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*7
dup 1 : ld a, 0x00 : ld [bc], a : ret : edup ; 24*1
.draw_2:
.draw_1:
dup 6 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*6
dup 1 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*1
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
.draw_3:
dup 1 : ld a, 0xFE : ld [bc], a : inc b : edup ; 18*1
dup 1 : ld a, 0xFE : ld [bc], a : ret : edup ; 24
.draw_2:
dup 5 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*5
dup 2 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*2
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
.draw_4:
dup 2 : ld a, 0xFE : ld [bc], a : inc b : edup ; 18*2
dup 1 : ld a, 0xFE : ld [bc], a : ret : edup ; 24
.draw_3:
dup 4 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*4
dup 3 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*3
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
.draw_5:
dup 3 : ld a, 0xFE : ld [bc], a : inc b : edup ; 18*3
dup 1 : ld a, 0xFE : ld [bc], a : ret : edup ; 24
.draw_4:
dup 3 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*3
dup 4 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*4
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
.draw_6:
dup 4 : ld a, 0xFE : ld [bc], a : inc b : edup ; 18*4
dup 1 : ld a, 0xFE : ld [bc], a : ret : edup ; 24
.draw_5:
dup 2 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*2
dup 5 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*5
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
.draw_7:
dup 5 : ld a, 0xFE : ld [bc], a : inc b : edup ; 18*5
dup 1 : ld a, 0xFE : ld [bc], a : ret : edup ; 24
.draw_6:
dup 1 : ld a, 0x00 : ld [bc], a : inc b : edup ; 18*1
dup 6 : ld a, 0xFF : ld [bc], a : inc b : edup ; 18*6
dup 1 : ld a, 0xFF : ld [bc], a : ret : edup ; 24
dup 6 : ld a, 0xFE : ld [bc], a : inc b : edup ; 18*6
dup 1 : ld a, 0xFE : ld [bc], a : ret : edup ; 24
.draw_7:
dup 7 : ld a, 0xFE : ld [bc], a : inc b : edup ; 18*6
dup 1 : ld a, 0xFE : ld [bc], a : ret : edup ; 24
align 256
.calltab:
@ -153,9 +159,8 @@ vumeter:
; player include
include "player.asm"
music_p0_ch10:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch10.bin" ; 10kb D:
; music
code_end
; -------------------------------------------------
@ -163,48 +168,51 @@ code_end
page 0
emptytap "page0.tap"
org 0xC000
music_p0_ch0:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch0.bin"
music_p0_ch1:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch1.bin"
music_p0_ch2:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch2.bin"
music_p0_ch3:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch3.bin"
music_p0_ch4:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch4.bin"
music_p0_ch5:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch5.bin"
music_p0_ch6:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch6.bin"
music_p0_ch7:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch7.bin"
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch2.bin"
music_p0_ch11:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch11.bin"
music_p0_ch12:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch12.bin"
music_p0_ch14:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch14.bin"
savetap "page0.tap",CODE,"page0",0xC000,$-0xC000
; ------------------------------------------------
page 1
emptytap "page1.tap"
org 0xC000
music_p0_ch0:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch0.bin"
music_p0_ch1:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch1.bin"
music_p0_ch3:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch3.bin"
music_p0_ch4:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch4.bin"
music_p0_ch5:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch5.bin"
music_p0_ch6:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch6.bin"
music_p0_ch7:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch7.bin"
music_p0_ch8:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch8.bin"
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch8.bin"
music_p0_ch9:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch9.bin"
music_p0_ch12:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch12.bin"
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch9.bin"
music_p0_ch10:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch10.bin"
music_p0_ch13:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch13.bin"
music_p0_ch15:
incbin "tsfm_1708_2214_optimized/tsfm_1708_2214_optimized_ch15.bin"
savetap "page1.tap",CODE,"page1",0xC000,$-0xC000
; ------------------------------------------------
page 3
emptytap "page3.tap"
org 0xC000
music_p0_ch11:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch11.bin"
music_p0_ch13:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch13.bin"
music_p0_ch14:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch14.bin"
music_p0_ch15:
incbin "tsfm_1308_0451_optimized/tsfm_1308_0451_optimized_ch15.bin"
db 0
savetap "page3.tap",CODE,"page3",0xC000,$-0xC000
; ------------------------------------------------
@ -232,9 +240,9 @@ music_p0_ch15:
emptytap "splash.tap"
org 0x4000
splash:
block 6144, 0
block 768, (0<<3)|(7<<0)
;incbin "200a.scr"
;block 6144, 0
;block 768, (0<<3)|(7<<0)
incbin "!gfx/tsfm2.scr"
savetap "splash.tap",CODE,"splash",0x4000,$-0x4000
endmodule

View file

@ -26,7 +26,8 @@ stack block channel_stack_t*MAX_STACK_DEPTH, 0 ; stack
; reg cache
reg_extch3_fhi block 3, 0 ; extch3 block/fnum-high reg
reg_fhi db 0 ; block/fnum-high reg
reserved block 2, 0
op4_vol db 0
reserved db 0
ends
struct player_struct_t
@ -42,22 +43,22 @@ ssg_r7 block 2, 0
; instantinate structures
align 256
player_channels:
channel_struct_t 0, music_p0_ch0 ; TODO: fill start offsets here
channel_struct_t 0, music_p0_ch1
channel_struct_t 1, music_p0_ch0 ; TODO: fill start offsets here
channel_struct_t 1, music_p0_ch1
channel_struct_t 0, music_p0_ch2
channel_struct_t 0, music_p0_ch3
channel_struct_t 0, music_p0_ch4
channel_struct_t 0, music_p0_ch5
channel_struct_t 0, music_p0_ch6
channel_struct_t 0, music_p0_ch7
channel_struct_t 1, music_p0_ch3
channel_struct_t 1, music_p0_ch4
channel_struct_t 1, music_p0_ch5
channel_struct_t 1, music_p0_ch6
channel_struct_t 1, music_p0_ch7
channel_struct_t 1, music_p0_ch8
channel_struct_t 1, music_p0_ch9
channel_struct_t 0, music_p0_ch10
channel_struct_t 3, music_p0_ch11
channel_struct_t 1, music_p0_ch12
channel_struct_t 3, music_p0_ch13
channel_struct_t 3, music_p0_ch14
channel_struct_t 3, music_p0_ch15
channel_struct_t 1, music_p0_ch10
channel_struct_t 0, music_p0_ch11
channel_struct_t 0, music_p0_ch12
channel_struct_t 1, music_p0_ch13
channel_struct_t 0, music_p0_ch14
channel_struct_t 1, music_p0_ch15
player_struct player_struct_t player_channels+(channel_struct_t*(3+0)+channel_struct_t.reg_extch3_fhi), player_channels+(channel_struct_t*(3+8)+channel_struct_t.reg_extch3_fhi)