Writing / Reading VRAM - noob questions

Page 9/9
2 | 3 | 4 | 5 | 6 | 7 | 8 |

Par siudym

Resident (39)

Portrait de siudym

01-01-2022, 21:51

Yes. Above I have attached link with WYZTracker song. There are three channels from what I can see and I used one + FX for "drums" (I don't know how "DRUMS" works because they are not in these three channels).

Par siudym

Resident (39)

Portrait de siudym

06-01-2022, 17:28

Does WYZTracker ASM Player also have the ability to use SFX? I can see in the code "TABLA_DATOS_CANAL_SFX", "EFECTO" - but I can't find information / documentation.

Par [WYZ]

Champion (451)

Portrait de [WYZ]

06-01-2022, 18:28

@siudym "TABLA_DATOS_CANAL_SFX", "EFECTO" are internal naming. It does not mean exactly SFX player but it works in a similar way. You can edit samples/SFx with SFx (editor de efectos) and launch them from your code calling the internal SFx player

ld a,SFx_number
call   INICIA_SONIDO

The music replayer needs an small buffer to work. I do not know if you have reserved space for that. Example:

; MUSICA DATOS INICIALES

                LD      HL,$DE00        	;* RESERVAR MEMORIA PARA BUFFER DE SONIDO!!!!! *
                LD      [CANAL_A],HL		;RECOMENDABLE $10 O MAS BYTES POR CANAL. 
                				
                LD      HL,$DE20        	
                LD      [CANAL_B],HL       	
            
                LD      HL,$DE40       	
                LD      [CANAL_C],HL 

                LD      HL,$DE60       	
                LD      [CANAL_P],HL 

Par siudym

Resident (39)

Portrait de siudym

06-01-2022, 18:49

I create SFX in WYZTracker just like regular music? How to attach them to the code? (same .MUS files?)

Par [WYZ]

Champion (451)

Portrait de [WYZ]

06-01-2022, 19:35

Correct, same MUS file.

; Tabla de instrumentos
TABLA_PAUTAS: DW PAUTA_0,PAUTA_1,PAUTA_2,PAUTA_3,PAUTA_4,PAUTA_5,PAUTA_6,PAUTA_7,PAUTA_8,PAUTA_9,PAUTA_10

; Tabla de efectos
TABLA_SONIDOS: DW 0

;Pautas (instrumentos)
;Instrumento 'Konami-IN'
PAUTA_0:	DB	12,0,11,0,10,0,9,0,8,0,129
;Instrumento 'Konami-OUT'
PAUTA_1:	DB	7,0,6,0,5,0,4,0,3,0,2,0,1,0,0,0,129
;Instrumento 'Konami-VIB (MID)'
PAUTA_2:	DB	8,-2,8,0,8,0,8,0,8,4,8,0,8,0,8,0,8,-4,136
;Instrumento 'Konami-VIB (HI)'
PAUTA_3:	DB	8,-1,8,0,8,0,8,0,8,2,8,0,8,0,8,0,8,-2,136
;Instrumento 'DETUNE-IN'
PAUTA_4:	DB	12,-1,11,0,10,0,9,0,8,0,129
;Instrumento 'TOM'
PAUTA_5:	DB	12,0,11,18,10,18,10,18,10,18,9,18,9,18,9,18,9,18,8,18,8,18,8,18,8,18,8,18,7,18,7,18,7,18,7,18,6,18,6,18,5,18,129
;Instrumento 'FLUTE-IN'
PAUTA_6:	DB	6,0,7,0,8,0,129
;Instrumento 'IN-OUT de 3'
PAUTA_7:	DB	12,0,11,0,10,0,9,0,8,0,8,0,7,0,6,0,5,0,0,129
;Instrumento 'IN-OUT de 6'
PAUTA_8:	DB	12,1,11,0,10,0,9,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,8,0,7,0,6,0,5,0,0,129
;Instrumento 'VOLUME CONTROL'
PAUTA_9:	DB	8,0,129
;Instrumento 'BASS -1 oct (Konami IN)'
PAUTA_10:	DB	44,0,11,0,10,0,9,0,8,0,129

And also you can synchronice other effects (samples, graphics...) just capturing the nº of the SFX just here:

;INICIA EL SONIDO Nº [A]

INICIA_SONIDO:  ;CP	19		;SFX SPEECH
		;JP	NC,SET_SAMPLE_P	

Par siudym

Resident (39)

Portrait de siudym

07-01-2022, 12:05

Now if I wanted to run one of these SFXs exclusively on channel C - how do I tell the player that I want to use channel C?

Par [WYZ]

Champion (451)

Portrait de [WYZ]

07-01-2022, 16:58

Just select FX channel at tracker level-

Par siudym

Resident (39)

Portrait de siudym

08-01-2022, 09:14

Something is not working properly, I don't think I fully understood how it works.

- Pautas (instrumentos) are both SONG instruments and SFX sounds?
- for example, by loading:
ld a, 3
call INICIA_SONIDO
- I'm loading the instrument assigned to "PAUTA_3"? (and should it play without interrupting the SONG currently playing?)

In WYZTracker I create a sound e.g. in C channel, I use instrument number 03, exports to SFX.MUS as SFX.
- now this SFX.MUS is attached to the code as SONG_x incbin "SFX.MUS" ? (and will play the instrument PAUTA_3 ?)

As for the buffer you mentioned earlier - do I have to activate it somehow? Because I can see it is already in "WYZPROPLAY47cMSX.ASM" and has bytes reserved in "WYZPROPLAY47c_RAM.tniasm.ASM"

PLAYER_INIT:	LD	HL,BUFFER_CANAL_A	;RESERVAR MEMORIA PARA BUFFER DE SONIDO!!!!!
		LD	[CANAL_A],HL		;RECOMENDABLE $10 O MAS BYTES POR CANAL.

		LD	HL,BUFFER_CANAL_B
		LD	[CANAL_B],HL

		LD	HL,BUFFER_CANAL_C
		LD	[CANAL_C],HL

		LD	HL,BUFFER_CANAL_P
		LD	[CANAL_P],HL
BUFFER_CANAL_A:	rb	$10
BUFFER_CANAL_B:	rb	$10
BUFFER_CANAL_C:	rb	$10
BUFFER_CANAL_P:	rb	$10

Par siudym

Resident (39)

Portrait de siudym

22-04-2022, 11:04

I have a problem with changing ASC16 to ASC8 256KB ROM (I will switch Page 3 i.e. 0A000h-0BFFFh)

Quote:

ASC16

PageSize: equ 04000h ; 16kB
Seg_P8000_SW: equ 07000h ; Segment switch for page 8000h-BFFFh (ASCII 16k Mapper)

call RSLREG
rrca
rrca
and 3 ; Keep bits corresponding to the page 4000h-7FFFh
ld c,a
ld b,0
ld hl,EXPTBL
add hl,bc
ld a,(hl)
and 80h
or c
ld c,a
inc hl
inc hl
inc hl
inc hl
ld a,(hl)
and 0Ch
or c
ld h,080h
call ENASLT ; Select the ROM on page 8000h-BFFFh

org 4000h,7FFFh ; Page 0
ds PageSize - ($ - 4000h),255 ; Fill the unused aera with 0FFh

org 8000h,0BFFFh ; page 1
ds PageSize - ($ - 8000h),255 ; Fill the unused aera with 0FFh

... swappable pages:

org 8000h,0BFFFh ; page 2
ds PageSize - ($ - 8000h),255

org 8000h,0BFFFh ; page 3
ds PageSize - ($ - 8000h),255

org 8000h,0BFFFh ; page 4
ds PageSize - ($ - 8000h),255

org 8000h,0BFFFh ; page 5
ds PageSize - ($ - 8000h),255

org 8000h,0BFFFh ; page 6
ds PageSize - ($ - 8000h),255

org 8000h,0BFFFh ; page 7
ds PageSize - ($ - 8000h),255

...switch page:

ld a,pagenr ; switch 8000
ld (Seg_P8000_SW),a

Here I can't understand how to configure Pages to be split into 0,1,2,3 and Page 3 to be swappable.
ASC8:

Quote:

PageSize: equ 02000h ; 8kB
Seg_PA000_SW: equ 07800h ; Segment switch for page 0A000h~0BFFFh (ASCII 8k Mapper)

org 4000h,5FFFh ; Page 0
ds PageSize - ($ - 4000h),255 ; Fill the unused aera with 0FFh

org 6000h,7FFFh ; page 1
ds PageSize - ($ - 6000h),255

org 8000h,9FFFh ; page 2
ds PageSize - ($ - 8000h),255

org 0A000h,0BFFFh ; page 3
ds PageSize - ($ - 0A000h),255

... swappable pages:

org 0A000h,0BFFFh ; page 4
ds PageSize - ($ - 0A000h),255

org 0A000h,0BFFFh ; page 5
ds PageSize - ($ - 0A000h),255

org 0A000h,0BFFFh ; page 6
ds PageSize - ($ - 0A000h),255

org 0A000h,0BFFFh ; page 7
ds PageSize - ($ - 0A000h),255

org 0A000h,0BFFFh ; page 8
ds PageSize - ($ - 0A000h),255

org 0A000h,0BFFFh ; page 9
ds PageSize - ($ - 0A000h),255

org 0A000h,0BFFFh ; page 10
ds PageSize - ($ - 0A000h),255

org 0A000h,0BFFFh ; page 11
ds PageSize - ($ - 0A000h),255

org 0A000h,0BFFFh ; page 12
ds PageSize - ($ - 0A000h),255

org 0A000h,0BFFFh ; page 13
ds PageSize - ($ - 0A000h),255

org 0A000h,0BFFFh ; page 14
ds PageSize - ($ - 0A000h),255

org 0A000h,0BFFFh ; page 15
ds PageSize - ($ - 0A000h),255

...switch page:

ld a,pagenr ; switch A000
ld (Seg_PA000_SW),a

Page 9/9
2 | 3 | 4 | 5 | 6 | 7 | 8 |