kategoria: ANSI C
[#1] [C] Obsluga formatu Player61
Chcialbym sprobowac w swoich produkcjach uzyc formatu Player61.
Jednak calkowicie nie wiem jak sie do tego zabrac.
Wiem tylko tyle ze trzeba wczesniej moda skompresowac. Ale czym?
Dodatkowo, jak z poziomu C obslozyc replayer tego formatu?
Posiada ktos moze jakis plik "#?.o" z includami?

Ostatnia aktualizacja: 31.01.2026 20:01:09 przez Phibrizzo
[#2] Re: [C] Obsluga formatu Player61

@Phibrizzo, post #1

Czy to nie są źródła. Tyle że ASM...

https://aminet.net/package/mus/misc/The_Player6.0A

6.1 na Github

https://github.com/amigadev/player6.1a

Ostatnia aktualizacja: 31.01.2026 20:38:23 przez mailman
[#3] Re: [C] Obsluga formatu Player61

@Phibrizzo, post #1

W tym archiwum co podał mailman jest konverter, użyj go. Dostaniesz wtedy kod który trzeba użyć w źródle. Musisz też ogarnąć vbr, inaczej na maszynach gdzie ktoś ma vbr w fascie nie usłyszy muzyki. Napiszę więcej jak znajdę trochę czasu.
[#4] Re: [C] Obsluga formatu Player61

@asman, post #3

Konverter juz ogarnalem. Najwazniejsze to nie uruchamiac go z Shella.
VBR to nie problem. Gorzej z tym asmem.
1
[#5] Re: [C] Obsluga formatu Player61

@mailman, post #2

P60A i P61A to 2 różne formaty. P61A nie odgrywa modów P60A.
[wyróżniony] [#6] Re: [C] Obsluga formatu Player61

@Phibrizzo, post #4

@cholok
Racja. Trzeba być czujnym. Wielkie dzięki.

@Phibrizzo
Ja użyłem P6112. P61Con normalnie mi działa z shell bez problemu. Konwertuje moda i dostaje kod hex który potem używam. Kompilujesz skrośnie ?
Jeśli chcesz użyć z poziomu C to trzeba wykonać trochę pracy, czyli skompilować do obiektu za pomocą asemblera z kodem który otrzymałeś (więc używanie ponowne tego samego obiektu dla przykładu replayer.o nie ma sensu). Zatem jeśli masz jakiś makefile musisz dodać reguły dla asemblera by było wszystko automatycznie. Ja z poziomu asm, robię to tak, że mam dwa pliki jeden to P6112-Head.i, w którym są wszystkie definicje typu
;;    ---  options common to all P61modes  ---
P61mode	=1	;Try other modes ONLY IF there are no Fxx commands >= 20.
		;(f.ex., P61.new_ditty only works with P61mode=1) 
usecode	= $d069d09 ;city lights newest
P61pl=usecode&$400000

split4	=0	;Great time gain, but INCOMPATIBLE with F03, F02, and F01
		;speeds in the song! That's the ONLY reason it's default 0.
		;So ==> PLEASE try split4=1 in ANY mode!
		;Overrides splitchans to decrunch 1 chan/frame.
		;See ;@@ note for P61_SetPosition.


splitchans=1	;#channels to be split off to be decrunched at "playtime frame"
		;0=use normal "decrunch all channels in the same frame"
		;Experiment to find minimum rastertime, but it should be 1 or 2
		;for 3-4 channels songs and 0 or 1 with less channels.

visuctrs=1	;enables visualizers in this example: P61_visuctr0..3.w 
		;containing #frames (#lev6ints if cia=1) elapsed since last
		;instrument triggered. (0=triggered this frame.)
		;Easy alternative to E8x or 1Fx sync commands.

asmonereport	=0	;ONLY for printing a settings report on assembly. Use
			;if you get problems (only works in AsmOne/AsmPro, tho)

p61system=0	;1=system-friendly. Use for DOS/Workbench programs.

p61exec	=1	;0 if execbase is destroyed, such as in a trackmo.

p61fade	=0	;enable channel volume fading from your demo

channels=4	;<4 for game sound effects in the higher channels. Incompatible
		; with splitchans/split4.

playflag=0	;1=enable music on/off capability (at run-time). .If 0, you can
		;still do this by just, you know, not calling P61_Music...
		;It's a convenience function to "pause" music in CIA mode.

p61bigjtab=0	;1 to waste 480b and save max 56 cycles on 68000.

opt020	=0	;1=enable optimizations for 020+. Please be 68000 compatible!
		;splitchans will already give MUCH bigger gains, and you can
		;try the MAXOPTI mode.

p61jump	=0	;0 to leave out P61_SetPosition (size gain)
		;1 if you need to force-start at a given position fex in a game

C	=0	;If you happen to have some $dffxxx value in a6, you can 
		;change this to $xxx to not have to load it before P61_Music.

clraudxdat=0	;enable smoother start of quiet sounds. probably not needed.

optjmp	=1	;0=safety check for jump beyond end of song. Clear it if you 
		;play unknown P61 songs with erroneous Bxx/Dxx commands in them

oscillo	=0	;1 to get a sample window (ptr, size) to read and display for 
		;oscilloscope type effects (beta, noshorts=1, pad instruments)
		;IMPORTANT: see ;@@ note about chipmem dc.w buffer.

quietstart=0	;attempt to avoid the very first click in some modules
		;IMPORTANT: see ;@@ note about chipmem dc.w buffer.

use1Fx=1	;Optional extra effect-sync trigger (*). If your module is free
		;from E commands, and you add E8x to sync stuff, this will 
		;change the usecode to include a whole code block for all E 
		;commands. You can avoid this by only using 1Fx. (You can 
		;also use this as an extra sync command if E8x is not enough, 
		;of course.)

;(*) Slideup values>116 causes bugs in Protracker, and E8 causes extra-code 
;for all E-commands, so I used this. It's only faster if your song contains 0
;E-commands, so it's only useful to a few, I guess. Bit of cyclemania. :)

;Just like E8x, you will get the trigger after the P61_Music call, 1 frame 
;BEFORE it's heard. This is good, because it allows double-buffered graphics 
;or effects running at < 50 fps to show the trigger synced properly.

 
p61cia	=1	;call P61_Music on the CIA interrupt instead of every frame.
lev6	=1	;1=keep the timer B int at least for setting DMA.
noshorts=0	;1 saves ~1 scanline, requires Lev6=0. Use if no instrument is
dupedec	=0	;0=save 500 bytes and lose 26 cycles - I don't blame you. :)
suppF01	=1	;0 is incompatible with CIA mode. It moves ~100 cycles of

To jest w zasadzie cały ten plik, który sobie stworzyłem i który swobie inkluduje na początku źródła. Potem w kodzie robie sobie include (gdzieś na końcu)
include	"P6112-Play-stripped.i"


Oczywiśćie gdzieś na początku kodu mam też
;get vbr
		moveq	#0,d0
		btst.b	#0,$129(a6)	;test bit AFB_68010 on AttnFlags+1
		beq	.mc68000

		lea	GetVBR(pc),a5
		jsr	-30(a6)		;exec Supervisor

.mc68000	move.l	d0,P61_VBR


Przed główną pętla robie init
lea	chipModule,a0
		sub.l	a1,a1
		sub.l	a2,a2
		moveq	#0,d0
		bsr	P61_Init


i przy wyjściu do OS to robię

bsr	P61_End


I wszystko automagicznie działa. Gdyż używa przerwań CIA. Z poziomu C tego nie robiłem, nie widzę tu nic strasznego. Trzeba by daćze 3 XDEF (na P61_VBR, P61_Init, P61_End) i powinno banglać.

Jeśli dalej jest to czarna magia. To weź mi na mejla prześlij jakieś archiwum tego nad czym pracujesz (jak wiesz nie mam w zwyczaju puszczania tego dalej, więc nie musisz się martwić :) ) I ja jak znajdę czas toprzysiądę do tego i ogarnę. Wyślę Ci też instrukcje krok po kroku co robiłem.
1
[#7] Re: [C] Obsluga formatu Player61

@asman, post #6

Bede szczery, nie ogarniam tego :)

Z kompilatorow asma to mam tylko PhxAss.
Wysle ci PM jak to mam zrobione dla AHXa. Moze dla P61 trzeba podobnie tylko ja tego nie widze.
1
[#8] Re: [C] Obsluga formatu Player61

@Phibrizzo, post #1

Dzieki koledze Asmanowi udalo sie osiagnac cel.
Zrobil to naprawde szybko i prosto.

Dzieki Wielkie :)
2
Na stronie www.PPA.pl, podobnie jak na wielu innych stronach internetowych, wykorzystywane są tzw. cookies (ciasteczka). Służą ona m.in. do tego, aby zalogować się na swoje konto, czy brać udział w ankietach. Ze względu na nowe regulacje prawne jesteśmy zobowiązani do poinformowania Cię o tym w wyraźniejszy niż dotychczas sposób. Dalsze korzystanie z naszej strony bez zmiany ustawień przeglądarki internetowej będzie oznaczać, że zgadzasz się na ich wykorzystywanie.
OK, rozumiem