It is currently Thu Dec 14, 2017 1:10 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Mon Sep 24, 2012 3:33 am 
Offline
User avatar

Joined: Wed Feb 13, 2008 9:10 am
Posts: 595
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
http://tiido.rocketcat.info/BitShit/ANIM.BIN

I had quite a bit of fun getting things to a point where animation is still fast and sound does not suffer from VDP FIFO overflow induced system halts. On MD you can write VRAM anytime, there will be no lost data unlike SMS and I think SNES, but there's a catch :
When the FIFO is full and another write is coming in, !DTACK won't be released and the 68K side will be halted. This normally is not a problem, but when Z80 does a ROM access, it will be halted too.
This means goodbye timings so there will be considerable jitter in any PCM playback that may happen. DMA is fastest way to send data to VRAM but it takes the bus for the duration of DMA which will not work out at all for the Z80, unless there's some elaborate buffering scheme worked out that buffers data while there are no VDP access and plays it during DMA or intense FIFO overflowing :P

In this demo I start off sending data in tile quantities using 68K loop (68K cannot overwhelm VDP in VBL) and Z80 won't be closed off from the bus. I switch to slow update loop when there's active display, since there will be very few access slots per line and you can easily overflow the FIFO.

I coded a new WAV playback program for this one, my old code is just horrible haha.
You supply the address of the file, and the driver looks up the lenght and will do automatic looping. One thing I could add is automatic sample rate adjustment, but it is not very high on my priorities list.
In any case I am very happy with it, it took me a while to do but it works like a charm ^^

Sound sample is 26.5KHz, so this means it sounds best on real hardware !
Emulators seem to have problems with high PCM rates, everything is noticably scratchier (writes getting missed or such).

_________________
http://www.tmeeco.eu


Top
 Profile  
 
PostPosted: Mon Sep 24, 2012 9:42 pm 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2806
TmEE wrote:
In any case I am very happy with it, it took me a while to do but it works like a charm ^^


And you should be quite happy with it. You've outdone the developers of many other games. I recall hearing about this issue with PCM playback and using DMA at the same time. Don't some or many games just go ahead and play PCM and use DMA at the same time and the result being it sounds awful?


Top
 Profile  
 
PostPosted: Mon Sep 24, 2012 10:56 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2982
Location: Tampere, Finland
Link doesn't work, and video would be nice. :)

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Tue Sep 25, 2012 2:15 am 
Offline
User avatar

Joined: Wed Feb 13, 2008 9:10 am
Posts: 595
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
You're the first one that has reported problems... can you access the main site : http://tiido.rocketcat.info ?
I made a mirror on Fileden : http://www.fileden.com/files/2008/4/21/1876835/ANIM.BIN
As for making a video, the content may not fit so well with some people.

MottZilla wrote:
And you should be quite happy with it. You've outdone the developers of many other games. I recall hearing about this issue with PCM playback and using DMA at the same time. Don't some or many games just go ahead and play PCM and use DMA at the same time and the result being it sounds awful?

For (action)games the only really viable thing is buffering samples for the duration of DMA, you do want to use DMA unless you're happy with throwing away good chunk of VRAM bandwidth.
Most games do PCM and DMA at the same time, and it is only part of the reason for bad sound. Other part that is just as bad if not worse is poor code and it happens a lot.

_________________
http://www.tmeeco.eu


Top
 Profile  
 
PostPosted: Tue Sep 25, 2012 2:52 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2982
Location: Tampere, Finland
TmEE wrote:
You're the first one that has reported problems... can you access the main site : http://tiido.rocketcat.info ?

The link works now, it probably was temporarily down or it was a temporary hiccup in my internet connection (although other sites were working fine at the time).

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Mon Oct 08, 2012 4:21 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2425
TmEE wrote:
...and I think SNES


That is true.


Top
 Profile  
 
PostPosted: Mon Oct 08, 2012 5:42 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19342
Location: NE Indiana, USA (NTSC)
This technique of using a MOVEM loop to move a tile at a time instead of DMA resembles what would later be done on the GBA, where LDMIA/STMIA loops instead of big DMA copies help keep the bus free for Game Link (serial port) interrupts and the like.

But then the GBA has a relative buttload of access slots per line. How many access slots per line does the Genesis VDP have?


Top
 Profile  
 
PostPosted: Mon Oct 08, 2012 7:46 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2425
tepples wrote:
This technique of using a MOVEM loop to move a tile at a time instead of DMA resembles what would later be done on the GBA, where LDMIA/STMIA loops instead of big DMA copies help keep the bus free for Game Link (serial port) interrupts and the like.

But then the GBA has a relative buttload of access slots per line. How many access slots per line does the Genesis VDP have?


Any cycle that the SNES uses to render BG3 in Mode1, the Genesis uses as a VDP access slot.

Btw, I have always wondered how the GBA is capable of rendering 4BG layers, with so many rotating and scaling sprites, without flickering, and still able to write to memory during active display.


Top
 Profile  
 
PostPosted: Mon Oct 08, 2012 9:20 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
tepples wrote:
But then the GBA has a relative buttload of access slots per line. How many access slots per line does the Genesis VDP have?

Assuming VRAM in H32 mode (same resolution width as the SNES)? During blanking: about the same bandwidth as the SNES (though vblank time is larger so more data can be sent at this speed), during active scan: 16 bytes per line. H40 mode (larger width) has more bandwidth.

psycopathicteen wrote:
Btw, I have always wondered how the GBA is capable of rendering 4BG layers, with so many rotating and scaling sprites, without flickering, and still able to write to memory during active display.

Faster memory and clock, I presume? Also it's possible it's going the C64 way where the video hardware accesses in one half cycle and the CPU in the other half cycle (and with ARM processors doing all accesses in one cycle, it's possible).


Top
 Profile  
 
PostPosted: Tue Oct 09, 2012 4:33 am 
Offline
User avatar

Joined: Wed Feb 13, 2008 9:10 am
Posts: 595
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
tepples wrote:
But then the GBA has a relative buttload of access slots per line. How many access slots per line does the Genesis VDP have?

Code:
==================================================
*** 68K to VRAM
==================================================

Access slots :
+------------+---------+--------+
| Line width | Passive | Active |
+------------+---------+--------+
| 256 pixels |   161   |   16   |
| 320 pixels |   198   |   18   |
+------------+---------+--------+
Number of bytes that can be transferred per frame :
+----+------------+---------+---------+---------+
| Hz | Resolution | Passive | Active  |  Total  |
+----+------------+---------+---------+---------+
| 60 | 256 * 224  |   6118  |   3584  |   9702  |
|    | 320 * 224  |   7524  |   4032  |  11556  |
+----+------------+---------+---------+---------+
| 50 | 256 * 224  |  14329  |   3584  |  17913  |
|    | 320 * 224  |  17622  |   4032  |  21654  |
|    | 256 * 240  |  11753  |   3840  |  15593  |
|    | 320 * 240  |  14454  |   4320  |  18774  |
+----+------------+---------+---------+---------+
Number of tiles that can be transferred per frame :
+----+------------+---------+---------+---------+
| Hz | Resolution | Passive | Active  |  Total  |
+----+------------+---------+---------+---------+
| 60 | 256 * 224  |   191   |   112   |   303   |
|    | 320 * 224  |   235   |   126   |   361   |
+----+------------+---------+---------+---------+
| 50 | 256 * 224  |   447   |   112   |   559   |
|    | 320 * 224  |   550   |   126   |   676   |
|    | 256 * 240  |   367   |   120   |   487   |
|    | 320 * 240  |   451   |   135   |   586   |
+----+------------+---------+---------+---------+

_________________
http://www.tmeeco.eu


Top
 Profile  
 
PostPosted: Fri Oct 12, 2012 2:45 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3968
GBA sometimes adds one waitstate to VRAM accesses during render time. Not always, just when the video chip is also accessing it.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 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