Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums


Forums > C64 Coding > Goattracker .. can someone add a feature for me?
2020-07-04 18:42
Raistlin

Registered: Mar 2007
Posts: 213
Goattracker .. can someone add a feature for me?

I couldn't figure out how to get GT to compile .. and wondered if somebody could help?

Basically, what I'd like is to be able to have tunes output from GT that write to -both- ghost registers -and- D4xx. Eg.:-

STA $d418
STA zpghost + $18

for whatever ZP address we specify.

I believe that GT will allow either of these options.. but not both at the same time.

Being a crazy fool - I want BOTH :-)

I don't suppose anyone can help...?

I could do this in the CPP .. but I have no idea what configuration of MinGW/GCC/... i need in order for GT to compile for me :'( (yeah, I'm a Windows user.. one that's used to Visual Studio / C++ etc.............).
 
... 1 post hidden. Click here to view all posts....
 
2020-07-04 19:24
Mixer

Registered: Apr 2008
Posts: 329
Like iAN said. You can enable the buffered writes in GT2 when exporting the tune, then just copy from the zp or the buffer mem to sid. GT2 Documentation covers this.
2020-07-04 19:32
Krill

Registered: Apr 2002
Posts: 1510
I sense an XY problem.

Raitlin: What do you want to achieve? And why is using either option and copying memory to SID yourself not an option?
2020-07-04 20:26
Groepaz

Registered: Dec 2001
Posts: 9429
I think he wants to know the written values for visualization purposes :) But indeed, using ghostregs and copying them to SID in your IRQ is the solution :)
2020-07-04 20:38
Raistlin

Registered: Mar 2007
Posts: 213
That's what I already do (with a reverse copy to D4xx from D418 to D400)... however... I'm reliably informed by our musicians that it doesn't sound the same...

For a 1x tune, I can keep everyone happy:-

- one copy of the tune at $1000-2fff that plays music as usual, writing to D4xx;
- another copy at $3000-4fff that writes to ghostregs .. I use this version for the visualiser.

Expensive in memory and CPU to do this way as you'll appreciate .. and 6x tunes will never work ;-)

So... my hopeful solution is that GT2 could write to both ghostregs and D4xx and, hopefully, the music will still sound correct.

Trust me, ask your artists - they can hear the difference. The timing of the writes is important .. I suspect also that repeatedly writing into D4xx unchanged/unused values that you're copying from ghost registers could cause problems.
2020-07-04 20:38
cadaver

Registered: Feb 2002
Posts: 1134
If the music is written so to require very specific timing of writes (ie. unsafe ADSR settings) it can be trouble to figure out a "good" write order and timing for the ghostregs.

However, in that case also adding anything extra to the player would disturb the timing too.
2020-07-04 20:42
Raistlin

Registered: Mar 2007
Posts: 213
Cadaver's right .. but I still think this is the best solution (other than doubling CPU and memory use). Adding 3 cycles to each D4xx write is going to be much better than completely changing the timing by copying ghost regs around.
2020-07-04 21:00
Krill

Registered: Apr 2002
Posts: 1510
I thought it's mostly the SID register write order that must be preserved to ensure that there are no distortions to the sound.

That is, a regular SID tune should tolerate something like calling the player, which would write to memory, then immediately copying the values to SID registers. (And regular SID players don't need stable raster routines. :D)

Things like writing to the same register twice (with different values) and rather precise hard-restart timings or similar should be observed, probably.

So yeah, at a certain point having the player itself write to SID registers and memory may be unavoidable.
2020-07-04 21:02
Groepaz

Registered: Dec 2001
Posts: 9429
What i did for a similar thing (Bullets over Vegas).... just find out the order of writes (VICE watchpoints are really useful for this) and then do the copying of the ghostregs in the same order.

copymethod_sidwizard:
    // copy registers in same order as sidwizard does (DAM tunes)
    .for (var i = 0; i < 3; i++) {
    lda sid_ghostbytes_adr+5+(i*7)
    sta $d400+5+(i*7)
    lda sid_ghostbytes_adr+6+(i*7)
    sta $d400+6+(i*7)
    lda sid_ghostbytes_adr+3+(i*7)
    sta $d400+3+(i*7)
    lda sid_ghostbytes_adr+2+(i*7)
    sta $d400+2+(i*7)
    lda sid_ghostbytes_adr+0+(i*7)
    sta $d400+0+(i*7)
    lda sid_ghostbytes_adr+1+(i*7)
    sta $d400+1+(i*7)
    lda sid_ghostbytes_adr+4+(i*7)
    sta $d400+4+(i*7)
    }

    lda sid_ghostbytes_adr+$17
    sta $d400+$17
    lda sid_ghostbytes_adr+$18
    sta $d400+$18
    lda sid_ghostbytes_adr+$16
    sta $d400+$16
    lda sid_ghostbytes_adr+$15
    sta $d400+$15
    jmp play_continue

copymethod_sidtracker:
	// copy registers in same order as sidtracker does (topshelf tunes)
    .for (var i = 0; i < 3; i++) {
    lda sid_ghostbytes_adr+4+(i*7)
    sta $d400+4+(i*7)
    lda sid_ghostbytes_adr+5+(i*7)
    sta $d400+5+(i*7)
    lda sid_ghostbytes_adr+6+(i*7)
    sta $d400+6+(i*7)
    lda sid_ghostbytes_adr+2+(i*7)
    sta $d400+2+(i*7)
    lda sid_ghostbytes_adr+3+(i*7)
    sta $d400+3+(i*7)
    lda sid_ghostbytes_adr+0+(i*7)
    sta $d400+0+(i*7)
    lda sid_ghostbytes_adr+1+(i*7)
    sta $d400+1+(i*7)
    }
    
    lda sid_ghostbytes_adr+$15
    sta $d400+$15
    lda sid_ghostbytes_adr+$16
    sta $d400+$16
    lda sid_ghostbytes_adr+$17
    sta $d400+$17
    lda sid_ghostbytes_adr+$18
    sta $d400+$18
    jmp play_continue


copymethod_gt:
    // copy registers in reverse order, like what goattracker does
	ldx #$18
	!l1:
		lda sid_ghostbytes_adr,x
		sta $d400,x
		dex
	bpl !l1-

play_continue:


(apparently xiny (gt tunes) already used buffered writes =P)
2020-07-04 21:30
Raistlin

Registered: Mar 2007
Posts: 213
Ahhh. You can check Stinsen's latest tune on CSDB, however... Jazz i Jacuzzin (where I do the nasty double-load/call thing I described earlier).

I now see though that the D4xx writes happen in this order:-

$16,$17,$18
$05,$02,$03,$00,$01,$04 //; channel 0
$0c,$09,$0a,$07,$08,$0b //; channel 1
$13,$10,$11,$0e,$0f,$12 //; channel 2

I've just reordered my ghost-to-sid copy to this .. and Stinsen tells me it sounds perfect. So I guess that's all I needed :-)

Ian: your reverse-copy is what I started with .. so maybe that's for a different GT mode or something..? Stinsen didn't like it that way, regardless ;-)

Thanks everyone.
2020-07-04 21:35
iAN CooG

Registered: May 2002
Posts: 2735
> Ian: your reverse-copy

Don't look at me, I just report how I see things done, I've done nothing =)
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Fabs/Hokuto Force
Brittle/Demozoo
Mason/Unicess
Deev/Onslaught
Fred/Channel 4
Stone/Prosonix/Offence
Acidchild/Padua
The Human Co../Maste..
LMan
Snabel
JonEgg
Guests online: 44
Top Demos
1 Coma Light 13  (9.7)
2 Uncensored  (9.6)
3 Edge of Disgrace  (9.6)
4 Comaland 100%  (9.6)
5 Unboxed  (9.6)
6 The Shores of Reflec..  (9.6)
7 Lunatico  (9.5)
8 Remains  (9.5)
9 NGC 1277 100%  (9.5)
10 C=Bit 18  (9.5)
Top onefile Demos
1 Smile to the Sky  (9.5)
2 Listen to Your Eyes  (9.5)
3 Cuarentenauta  (9.5)
4 MD202006 - Get Well ..  (9.5)
5 Dawnfall V1.1  (9.5)
6 Rewind  (9.5)
7 Instinct  (9.5)
8 Crystal Gazer  (9.5)
9 The Tuneful Eight [u..  (9.5)
10 Bad Boy  (9.5)
Top Groups
1 PriorArt  (9.6)
2 Performers  (9.5)
3 Booze Design  (9.4)
4 Censor Design  (9.4)
5 Fossil  (9.4)
Top Public Relations Managers
1 Irata  (10)
2 Baracuda  (10)
3 hedning  (10)
4 Liesbeth  (10)
5 MacGyver  (3.0)

Home - Disclaimer
Copyright © No Name 2001-2020
Page generated in: 0.052 sec.