It is currently Sat Oct 21, 2017 4:22 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Tue Feb 07, 2017 1:57 pm 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1306
I have an idea to save a cycle in reading from a cartridge-based expansion (as in many mappers). While I can read from some magic location, I'd like to read from a zero-page location.

During reset, I'd write #$FF to a location (let's say $80, but it's arbitrary as long as it is unused elsewhere). An open collector buffer sits between my peripheral and the data bus, and my device responds to the same address $80. This way, when $80 is read by the CPU, the peripheral can pull data bits low, or leave them at the #$FF that the RAM is already outputting.

This is a bus conflict, but as I do not expect it to sink very much current from the NMOS SRAM chip, it should not damage anything.

As the 2A03 and RAM are NMOS devices, as well as the RAM in the NES, which pull lines low but do not drive them high, would it be safe to do something like that?


Last edited by mikejmoffitt on Wed Feb 08, 2017 12:42 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue Feb 07, 2017 2:13 pm 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19115
Location: NE Indiana, USA (NTSC)
Later revisions of the NES Control Deck may have a CMOS RAM, as may clones.


Top
 Profile  
 
PostPosted: Tue Feb 07, 2017 2:22 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6292
Location: Seattle
I don't know if any revision of the NES or Famicom used NMOS SRAM. The MB8416A, LH5116, and HM6116LFP are all CMOS.

Can't find any documentation about the TMM2115BP.


Top
 Profile  
 
PostPosted: Tue Feb 07, 2017 3:09 pm 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1306
I see, that's a bummer. Out with that idea, then.

What I wanted to do is create a simple wavetable synth, with a 7-bit output. It is responsible for synthesis, and the 2A03's job is just to take samples and push them to $4011 when there is free time.

I would just insert
Code:
lda SAMPLE
sta $4011

whenever it's convenient in the middle of code, and certainly while I wait for the next frame. Since synthesis is done off of the 2A03 the pitch won't shift, just the rate and subsequent aliasing artifacts will. During game logic and OAM DMA, there would be a small gap (and a bit of a 60Hz buzz), but I'd like to try it and see how noisy it is. It may be suitable for low-frequencies or drums, and if it's not too bad it would be a fun way of having expansion audio on a stock NES. I could forego OAM DMA in favor of a slower but less noisy implementation, if the game is simple enough to allow such a luxury.

I wanted to use zero-page to speed up this access, but this will require a normal two-byte address read. Even still, experimentation might be worth doing.


Top
 Profile  
 
PostPosted: Tue Feb 07, 2017 3:33 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6292
Location: Seattle
mikejmoffitt wrote:
Since synthesis is done off of the 2A03
I kinda have this suspicion that the best seamless way to get expansion audio on an unmodified frontloader is to have the synth coprocessor encode its output as DPCM. Then the 2A03 just sets up the DPCM streamer to endlessly loop a single byte (e.g. $FFC0) and the only thing the 2A03 has to do is tell the synth what to generate.

If it were primarily used with sine, triangle, and trapezoid waves, it should even mostly be able to avoid the slew rate distortion that comes from DPCM encoding.

More similar to your actual idea, we've previously played around with the idea of mapping a read port overlaying the $4011 DAC, and then the game "just" has to LSR $4011 occasionally. Somewhere I think we have some simulations of the resulting audio quality? It's ok.


Top
 Profile  
 
PostPosted: Tue Feb 07, 2017 5:25 pm 
Offline
User avatar

Joined: Sun May 27, 2012 8:43 pm
Posts: 1306
lidnariq wrote:
mikejmoffitt wrote:
Since synthesis is done off of the 2A03
I kinda have this suspicion that the best seamless way to get expansion audio on an unmodified frontloader is to have the synth coprocessor encode its output as DPCM. Then the 2A03 just sets up the DPCM streamer to endlessly loop a single byte (e.g. $FFC0) and the only thing the 2A03 has to do is tell the synth what to generate.

If it were primarily used with sine, triangle, and trapezoid waves, it should even mostly be able to avoid the slew rate distortion that comes from DPCM encoding.

More similar to your actual idea, we've previously played around with the idea of mapping a read port overlaying the $4011 DAC, and then the game "just" has to LSR $4011 occasionally. Somewhere I think we have some simulations of the resulting audio quality? It's ok.


That too could work as a mode. Unfortunately, DPCM is quite noisy for quiet waves, but there certainly are use cases otherwise. That is certainly worth playing with. Maybe I will try to throw together a simple test "cartridge" with a magic ROM location for this like $FFC0.

If it works well, it would be nice to create proper documentation for it, and hook it up as an extension of some common mapper so that it might actually be supported in a testing environment. This would not be difficult to implement as a PowerPak or Everdrive N8 mapper, either.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: krzysiobal and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group