Space Journey build 2025-03-14

Post your FreeBASIC source, examples, tips and tricks here. Please don’t post code without including an explanation.
UEZ
Posts: 1078
Joined: May 05, 2017 19:59
Location: Germany

Re: Space Journey build 2025-03-12

Post by UEZ »

Thanks dafhi for your contribution. There are a lot of tunez in that kg archive and some of them fits for the space journey. 8)

Stars look much smoother with your aa dots code - thx. :)

You can optimize your filled_circle_aa_sub function slightly by moving out (y - CY) * (y - CY) from the x loop because it will not change within the x loop and recalculation is not needed.

Code: Select all

Sub filled_circle_aa_sub(ByVal cx As Single, ByVal CY As Single, ByVal r As Single, ByVal c As Unsigned Long, ByVal aa As Single= 128.0)
    
    Dim As Long y0 = max( 0, floor(CY-r) ), y1 = min( h-1, ceil(CY+r) ) '' 2025 March 13 - dafhi
    Dim As Long x0 = max( 0, floor(cx-r) ), x1 = min( w-1, ceil(cx+r) )
    
    For y As Integer=y0 To y1
        Dim As ULong Ptr row = ScreenPtr + y * pitch '' 2025 March 13 - dafhi
    	Dim As Single dy = (y - CY) * (y - CY)
        For x As Integer=x0 To x1
            Dim As Integer d = (r - Sqr((x - cx) * (x - cx) + dy))*aa
            If d>0 Then
                If d>255 Then
'                        pset (x,y),c
                    row[x] = c
                Else
                    Dim As Unsigned Long p=row[x]'point(x,y)
                    'pset (x,y),(((((c and &hff00ff)*d)+((p and &hff00ff)*(256-d)))and &hff00ff00)or((((c and &hff00)*d)+((p and &hff00)*(256-d)))and &hff0000))shr 8
                    row[x] = (((((c And &h00ff00ff)*d) + ((p And &h00ff00ff) * (256 - d))) And &hff00ff00) Or ((((c And &h0000ff00)*d) + ((p And &h0000ff00) * (256 - d))) And &h00ff0000)) Shr 8
                End If
            End If
        Next
    Next
End Sub
dafhi
Posts: 1738
Joined: Jun 04, 2005 9:51

Re: Space Journey build 2025-03-14

Post by dafhi »

can't believe i missed that :D

stonemonkey made the sub

u know what's weird. bass dll doesn't sound as good as xmplay
UEZ
Posts: 1078
Joined: May 05, 2017 19:59
Location: Germany

Re: Space Journey build 2025-03-14

Post by UEZ »

dafhi wrote: Mar 14, 2025 10:30 can't believe i missed that :D

stonemonkey made the sub

u know what's weird. bass dll doesn't sound as good as xmplay
Have you activated ‘Auto-amp’ / equalizer in XMPLAY? I have also been using XMPLAY for years - small, powefull and handy player.

Btw, I updated the code by adding your circle code and dodicat's Regulate function.
dafhi
Posts: 1738
Joined: Jun 04, 2005 9:51

Re: Space Journey build 2025-03-14

Post by dafhi »

auto amp is on but not EQ. aoki.xm in b - intrigue folder .. i hear more midrange and bass w/ xmplay. unfortunately you have to wait till 0:36 for the specific section.

i'll look for a more obvious track.

[edit] it's probably my imagination

[update] - i_realize.xm .. there is more high frequency in xmplay. my EQ is not active, never was
UEZ
Posts: 1078
Joined: May 05, 2017 19:59
Location: Germany

Re: Space Journey build 2025-03-14

Post by UEZ »

dafhi wrote: Mar 14, 2025 14:56 auto amp is on but not EQ. aoki.xm in b - intrigue folder .. i hear more midrange and bass w/ xmplay. unfortunately you have to wait till 0:36 for the specific section.

i'll look for a more obvious track.

[edit] it's probably my imagination

[update] - i_realize.xm .. there is more high frequency in xmplay. my EQ is not active, never was
Agree, there is a difference. Maybe it is also possible to get the same result by calling some settings in bass.dll...
Post Reply