twh/f2 Posted November 11, 2015 Share Posted November 11, 2015 HI ! can please somebody give me an example on how to play an RMT instrument with a specific volume? I'm not really understanding all possible RMT-vectors, so it might be pretty simple or bloody compliacted. The RMT code "API documentation" is simply highlighting this: jmp rmt_sfx ;* A=note(0,..,60),X=channel(0,..,3 or 0,..,7),Y=instrument*2(0,2,4,..,126) not a word about volume .proc setSfx tax lda sfx_table,x asl @ tay ; RMT routine expects instrument number * 2 in Y register ldx #0 ; channel number (0-3) lda #12 ; C-1 note jsr rmt_player+15 ; initialise instrument rts .endp Quote Link to comment Share on other sites More sharing options...
Xuel Posted November 12, 2015 Share Posted November 12, 2015 The example in asm_src/sfx/sfx.a65 shows how to set the SFX volume. Namely, before calling RASTERMUSICTRACKER+15 (or rmt_sfx), write a $X0 to RMTSFXVOLUME where X is the desired volume. For example: lda RANDOM ;random number and #$07 ;0..7 ora #$08 ;8..15 asl @ asl @ asl @ asl @ ;*16 sta RMTSFXVOLUME ; ... set registers here ... jsr RASTERMUSICTRACKER+15 2 Quote Link to comment Share on other sites More sharing options...
twh/f2 Posted November 12, 2015 Author Share Posted November 12, 2015 @Xuel: Awesome! Exactly what I was looking for! :thumbsup: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.