![]() |
![]() |
#21 |
Registered User
Join Date: May 2001
Location: ?
Posts: 19,646
|
I wonder if Shatterhand's problem would go away if he has a routine synced to CIA. What do you think?
|
![]() |
![]() |
#22 |
Unregistered User
Join Date: Nov 2005
Location: Tasmania
Age: 42
Posts: 893
|
That is the general concensus, but unfortunately Blitz's CIA module playing routines are for >WB2. Adapting a 68k replayer would be one solution, but I imagine that is probably a little bit beyond Shatterhand's Amiga coding skills at the moment. It's not quite as simple as just copying the ASM code into your Blitz code, there are a few restrictions on which registers can be used safely for one thing.
|
![]() |
![]() |
#23 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
Just to let you guys know.. today I had a full day, I got home like 1 Am. It's about 2 am right now and I need to go to bed.
But I did a quick test with Winuae putting the Playmed command BEFORE the VWait instead of after like the manual suggests. The flicker is gone on Winuae. Tomorrow I'll test in real hardware because I really need to go to sleep now. And I just found out the crash I had using this library had nothing to do with playing music, but with another problem with the code (if you don't press enter in your last line of code Blitz will ignore it, heh ![]() |
![]() |
![]() |
#24 | |
Unregistered User
Join Date: Nov 2005
Location: Tasmania
Age: 42
Posts: 893
|
Quote:
|
|
![]() |
![]() |
#25 | |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
Quote:
![]() ![]() Yeah, I wasn't going to mess with code yesterday, I got home really tired, but it came to my mind that if the routine was making sprites at the top of screen flicker, if I executed it at the end of the frame (while the video beam would be closer to the bottom), maybe it would stop the flicker. It was more an investigating curiosity than an attempt to do something right. I tried doing setint 5 playmed endint and I got a nasty and quick Guru as soon as the code reaches the setint 5 command while testing on Winuae. I'll try on real hardware to see if I still have the same problem. By the way, thank you a lot for trying to help me. I wrote a "thank you" section on my game for everyone helping me out here, I am really very grateful for all the help I am getting here at EAB (not that would expect any different ![]() |
|
![]() |
![]() |
#26 | |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,547
|
Quote:
|
|
![]() |
![]() |
#27 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
I tried after, tried before and also tried as the very first instruction of the code (before Blitz).
Debugging, as soon as I get in the setint 5 line, I get a guru. |
![]() |
![]() |
#28 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
No problems using SetInt on real hardware, gotta be something with my Winuae configuration.
But using playmed on the VBlank interrupt made things even worse, even more flicker and artefacts appearing randomly on screen. I found this interesting because I can play music even while loading files (this worked really well). The best result I got so far was doing the playmed before VWait, this eliminates any flicker, but like Anakirob pointed out, when I miss a frame the music slows down (also I miss frames where I wasn't missing without music... without music I can have my boss firing 12 bullets at the same time while keeping moving without problem. With the music playing this send me to slowdown land). Well.. anyone has any other ideas? I am all open to any suggestions. If you guys thinking I may be doing something really stupid, don't hold off and tell me please ![]() I am using 12 queues for the QBlits, could this be a problem? I had to raise the number of queues on the compiler option. I did it like that because I have some stuff being drawn/erased at different moments and I thought it would be better this way. I am pretty sure I can make it with less queues if needed. Maybe something else I could change on the Compiler options? (I am already selecting "make smallest code" and turning off runtime debug) Also, I have a display palette command running every frame, I was worried this could be causing trouble, but turning it off didn't make the flicker go away. This is frustrating me a little bit. I am thinking about trying that Kick2 library, if I can make it work better, just make the game check if the user have 2.0 kick or not. If it does, use it. It now, use playmed before the VWait and deal with slowdown, but it's far from being the best solution. |
![]() |
![]() |
#29 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
SOLVED. YEAH!
I was getting ready to going to bed when something came to mind, so I knew I wouldn't sleep if I didn't test it before. Every example on Blitz Manual puts the Vwait BEFORE the DisplayBitmap. I tried putting the Vwait AFTER the DisplayBitmap command. Everything works like a charm now, using the VBlank interrupt to play the music flawless. No flicker, no artefacts on screen, everything working perfectly on my A600. ![]() |
![]() |
![]() |
#30 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,348
|
That doesn't make sense. Does VWait wait for too long?
|
![]() |
![]() |
#31 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
I dont know. I just thought that displaying the bitmap and playing the module were fighting for time in the beginning of the frame. So I display the bitmap as the last thing instead of the first and things worked.
I am not sure if this makes any sense, I was just thinking along the lines Earok settled ![]() Now I was having trouble using SFX and Music together... the music uses just channels 0,1 and 2 while the sfx uses sound 3. Music would *still* mute the sfx. So I found about the SetMedMask command, which let you choose what channels you're going to use for playing the song. Except it wasn't working, up until I put it right before the PlayMed command on the Interrupt #5. I don't know if this makes sense either, but it only worked like this. |
![]() |
![]() |
#32 | |
Registered User
Join Date: Nov 2015
Location: Vaasa, Finland
Posts: 525
|
I just tried to replicate this problem with my Megaman X code, which also plays MED modules.
My normal Main Loop does things in this order: ----------------- VWAIT Show bitmap Playmed Draw graphics ----------------- And this works OK. But then I tried to change the order of Show and Playmed, so that it looked like: ----------------- VWAIT Playmed Show bitmap Draw graphics ----------------- And with this command order I started getting problems; not flicker, but scrolling and graphics started "jumping". I think this happened because the Playmed command takes so much time to execute, and so the "Show" is executed too late; the display beam has already drawn the upper parts of the screen when Show finally happens. And if my code would use a standard Double Buffering method instead of Single Buffering, then I guess also flickering would have happened. --- So maybe the problem that you had was just the order of the commands after VWAIT: "Show" or "DisplayBitmap" should always be the first command that happens after VWAIT, and Playmed and everything else should come after these. ![]() And although you already solved the problem by moving the DisplayBitmap command before Vwait, you could also try out that simple command order of "VWAIT - DisplayBitmap - PlayMed". Because right now, even if your code works without flicker, with DisplayBitmap located before VWAIT, I think this also means that the bitmaps now get flipped in the middle of the frame, because the display beam has not yet drawn the full screen when DisplayBitmap happens, and I think this could cause some "screen tearing" effects, meaning that the upper screen half displaying the previous frame and the lower half displaying the current frame. Quote:
Command order seems to be very important in Blitz, I have noticed that all Sprite commands too are very "orderly", maybe because they too are "channels", just like the sound channels. ![]() |
|
![]() |
![]() |
#33 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
I am doing the playmed command on the VBlank interrupt like it has been suggested here, so the playmed command is always executed even if the game skips a frame (and it does happen).
Doing the way you are doing, the music will slowdown together with the game and this is awful. One interesting thing when doing this is that you can play music at *any* point of the program, even while loading files or while the game is doing something out of the main loop, for example. |
![]() |
![]() |
#34 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,348
|
Indeed it makes sense to flip the screen before playing sound. It is of utmost importance that the screen is flipped in the vblank interval, and it is an atomic operation of a constant cycle count. A sound routine may or may not take so long on any given frame that the screen flipping is delayed until the raster beam has already started redrawing the old screen.
|
![]() |
![]() |
#35 | |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,348
|
Try the Enhanced Music Library: http://aminet.net/package/dev/basic/eml17b
Quote:
|
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Get Shapes | Retro1234 | Coders. Blitz Basic | 53 | 17 March 2017 11:41 |
HippoPlayer very slow down system when playing module | michaljarz | support.WinUAE | 6 | 21 February 2016 20:34 |
Shapes (PD) | Devlin | HOL data problems | 0 | 17 July 2015 19:03 |
FS: Scandoubler/Flicker Fixer DCE Flicker Magic | lopos2000 | MarketPlace | 15 | 23 October 2007 11:18 |
What Makes a Game Worth Playing for You? | Dastardly | Retrogaming General Discussion | 7 | 09 April 2004 21:49 |
|
|