All Posts (blitter)




#1
Re: G&P Monthly
Posted on: Yesterday 16:51
Virtual Freak
Joined 2007/12/14
97 Posts
CoderLong Time User (6 Years) App Coder
One feature request: importing of MIDI files. There are already a lot of excellent MIDI sequencers out there (some commercial-grade), and I for one don't relish the thought of learning a new composing tool. ;)
Top

Topic | Forum


#2
WRAM access optimizations
Posted on: 8/29 6:27
Virtual Freak
Joined 2007/12/14
97 Posts
CoderLong Time User (6 Years) App Coder
My PCM mixer runs fine on its own but slows execution down to a crawl when paired with music and rendering, so I'm looking to optimize it wherever I can, including dropping down and rewriting parts of it in assembly where practical. When examining the output of building with both -Os and -O3 in gccVB 4, though, I noticed the following peculiar pattern when accessing variables kept in WRAM:


movhi hi
(_masterMusVolume),r0,r10
    ld
.b lo(_masterMusVolume)[r10],r14
    movhi hi
(_noiseVolume),r0,r27
    movhi hi
(_musDataStart),r0,r10
    movhi hi
(_freeVSUChannelCur),r0,r25
    movhi hi
(_noiseVelocity),r0,r26
    movhi hi
(_noiseLeft),r0,r29
    movhi hi
(_noiseRight),r0,r31
    ld
.b lo(_noiseVolume)[r27],r11
    ld
.w lo(_musDataStart)[r10],r18
    movhi hi
(_vbTranspose),r0,r10
    ld
.w lo(_vbTranspose)[r10],r10
    ld
.b lo(_freeVSUChannelCur)[r25],r17
    ld
.b lo(_noiseVelocity)[r26],r23
    ld
.b lo(_noiseLeft)[r29],r22
    ld
.b lo(_noiseRight)[r31],r12


Since WRAM on the VB is located at 0x05000000 and therefore aligned on a 64KB boundary, wouldn't it be more economical to, say, movhi hi(_WRAMStart),r0,r10 just once and then ld lo(_variable)[r10] subsequently for each WRAM access? Why doesn't the code do this or something similar?

I could rewrite this particular routine in assembly (it runs over 8000 times a second via the timer interrupt, so it needs to be as fast as possible) but this kind of code is generated all over the place whenever WRAM is read or written, so that to me just seems like putting a band-aid over a larger problem. Is this a bug in gccVB or is there a way to coax the compiler into generating more efficient code here?
Top

Topic | Forum


#3
Re: PCM and speaker pops
Posted on: 8/27 5:40
Virtual Freak
Joined 2007/12/14
97 Posts
CoderLong Time User (6 Years) App Coder
Thanks Guy Perfect!

In my first post I tried adding a fade in/out to my sound files as you suggested but that had no effect on the popping. However, what you said got me to take a closer look at the raw sound data, and that got me thinking (always a scary thing). My mixer was resetting LRV to 0 when there were no samples to play, and my sound data is converted from unsigned 8-bit PCM to unsigned 4-bit. *But,* unsigned PCM is more like "offset PCM," centered around 0x80, not 0 as I had incorrectly assumed. So... I added a tiny bit of code that resets LRV to 0x88 when no samples are present, and now the pops are gone, both on hardware and in Mednafen. :)

Attach file:



png  Screen shot 2014-08-26 at 8.32.50 PM.png (93.37 KB)
676_53fd530c4381b.png 1920X599 px
Top

Topic | Forum


#4
Re: PCM and speaker pops
Posted on: 8/26 18:40
Virtual Freak
Joined 2007/12/14
97 Posts
CoderLong Time User (6 Years) App Coder
Using SSTOP for SFX silence isn't an option for me since I have music playing in the other channels.
Top

Topic | Forum


#5
Re: PCM and speaker pops
Posted on: 8/26 17:59
Virtual Freak
Joined 2007/12/14
97 Posts
CoderLong Time User (6 Years) App Coder
Ah, good question. No, I only set SSTOP when I initialize the DC waveform, then I reset SSTOP and from then on just leave LRV of each channel at 0 unless there are samples played.
Top

Topic | Forum


#6
PCM and speaker pops
Posted on: 8/26 5:31
Virtual Freak
Joined 2007/12/14
97 Posts
CoderLong Time User (6 Years) App Coder
I wrote a PCM mixer last week and it's running great but when starting from silence, the sounds generated always start with a very noticeable "pop" at the beginning and end. Is there a way to prevent this? The effects themselves contain no such artifacts, but I've tried introducing a fade in/out, and also tried leaving the DC value wherever it leaves off instead of resetting to zero, but neither of those techniques seem to work. It doesn't seem to matter what the first or last sample is; that irritating pop is always there.

I did a capture from the headphone jack in Audacity for reference, attached. Any ideas? DogP? Guy Perfect?

Attach file:



png  Screen shot 2014-08-25 at 8.22.29 PM.png (98.15 KB)
676_53fbff00610d7.png 1920X600 px
Top

Topic | Forum


#7
Re: RFC: Standardized interrupt vectors
Posted on: 8/18 8:29
Virtual Freak
Joined 2007/12/14
97 Posts
CoderLong Time User (6 Years) App Coder
I almost never use dev mode-- most of my development happens against Mednafen, and my game consumes nearly 100% of the 16Mb of the FlashBoy anyway, so dev mode isn't too effective for me. Why do you need to test against hardware so often? Is there a bug in Mednafen requiring hardware for accurate results?
Top

Topic | Forum


#8
Re: Possible compo in 2015 ??? lets talk about this
Posted on: 8/17 9:20
Virtual Freak
Joined 2007/12/14
97 Posts
CoderLong Time User (6 Years) App Coder
I'm still working on the same project I've been hacking away at for years now. Didn't have time to finish it for the 2013 compo, but who knows maybe another one will light a fire under me... ;)
Top

Topic | Forum


#9
Re: Vanguard V coming to virtual boy???
Posted on: 8/12 5:34
Virtual Freak
Joined 2007/12/14
97 Posts
CoderLong Time User (6 Years) App Coder
Article on RtoVR includes shoutouts to PVB and Guy Perfect! :) http://www.roadtovr.com/vanguard-v-ki ... endo-virtual-boy-version/

I've reached out to Justin and if/when they start production, maybe they can make use of some of the libraries I've written.
Top

Topic | Forum


#10
Re: Bit String Details, ft. How Mednafen is Wrong
Posted on: 8/10 5:13
Virtual Freak
Joined 2007/12/14
97 Posts
CoderLong Time User (6 Years) App Coder
Sorry, I must have missed the part where you clarified that it wasn't the same across resets (fresh CPU and hardware state), in addition to being different across subsequent executions in the same program loop.
Top

Topic | Forum




You are not logged in.
Lost Password?
Register Resend Activation