Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 23, 2012 18:33:51 GMT -5
Not sure if anyone here is familiar with either scroll modes or HInt's, but I was hoping for some tutorials or a little guidance on how to put these to use. www.youtube.com/watch?v=FcmSxIUbVLEFrom what I understand, the Cheshire Cat's face is animated using different scroll modes (same with the curtain rising), as is the cyclops boss in Contra Hard Corps. Also, from what I've read, the fire in Rocket Knight Adventure uses Horizontal Interrupts to achieve that effect: www.youtube.com/watch?v=IubgO2bbYak (effect starts at 3:45) Other question on scroll modes: I drew an entire screen on plane a. I set the scroll mode: - setscrollmode hscroll_cell, vscroll_overall The I did a loop to scroll the top 3 lines at different speeds (like in Rocket Knight's outside sky), but anything under the scrolling lines pushed the rest of the graphics half off screen. What caused this? Thanks!
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 23, 2012 18:55:55 GMT -5
The I did a loop to scroll the top 3 lines at different speeds (like in Rocket Knight's outside sky), but anything under the scrolling lines pushed the rest of the graphics half off screen. What caused this? Hmm, it works fine for me ( see attached ). And your observations on the scrolling effects in the games your mention are correct. If you need any particular example, just shout Attachments:
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 23, 2012 18:57:34 GMT -5
Thanks moon Mucho Appreciated. If you could do some examples, that would be fantastic
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 23, 2012 19:59:02 GMT -5
If you could do some examples, that would be fantastic Attached is a simple ( un-optimized ) jell-o effect. Attachments:
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 23, 2012 19:59:52 GMT -5
Looks like I was doing something funky in my other test with the hscroll_cell scroll mode. Looking over your quick example, I made a quick one as well (about 20 minutes or so for creating the graphics and whatnot). It be attached. Anyway, other examples of the HBlank on how to do other graphic tricks and a use for vscroll_2cell mode would be great if you have time to make examples moon. ETA: Dammit, you posted as I was posting this lol Attachments:
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 23, 2012 20:25:16 GMT -5
moon, 2 things I don't understand in your jello example:
time = time+8 AND 255
I don't understand the AND part really. I know in Visual Basic, if you were to do x = 3 AND 5, x would = 1 since it converts both values to binary and gives you the difference (5 in binary is 101, and 3 is 011, and since both have a 1 in the 1 position of the byte, that's the value), does this do the same thing in BEX? Also, is the 255 because that's how many tiles you're using?
The 2nd thing is your reload statement:
Reload sin,104+time
What's the 2nd argument? The offset to reload the data pointer from?
Now onto my assumptions lol and please correct me if I'm wrong.
Your sin table (16x16 in the data statements) is the "wave" for each tile, correct? How come you have 2 sets of the same data statements? Are these numbers just the pattern you chose (increment of 3 then plateau (255 for a few values), then wave in the other direction? I guess I'm a little confused on how you came up with these numbers specifically.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 23, 2012 20:38:54 GMT -5
I don't understand the AND part really. You did understand it correct. Decimal 255 is 11111111 in binary, so the value loops when it goes beyond 255. The reason for doing this is because the sine table is 256 entries long What's the 2nd argument? The offset to reload the data pointer from? Yep, pretty sure that's mentioned in the BEX documentation. How come you have 2 sets of the same data statements? Because I don't want to wrap each look-up address to the 256 entries. So i sacrifice a bit of ROM in favor of having to perform allot of CPU operations. I guess I'm a little confused on how you came up with these numbers specifically. You generate sine tables to meet your specific requirements. Sometimes you want more / less entries or 16-bit instead of 8-bit etc.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 23, 2012 20:47:12 GMT -5
Interesting. Looks like I have a lot of trial and error ahead of me.
Last question, I believe. Your sign tables... is that 1 entry for each tile? Same with the 255? If you had, lets say, an area of 10x10 tiles, would you change it to time = time+8 AND 100 and have 10 data statements with 10 values in each?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 23, 2012 21:02:32 GMT -5
Your sign tables... is that 1 entry for each tile? Same with the 255? No, the resolution ( amount of entries ) of the look-up table doesn't have anything to do with the amount of tiles. It only influences the smoothness of the animation. And you can't use "AND 100" to wrap a value. If the value is not a power of two, you have to use ( the more processor intensive ) modulo instead.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 23, 2012 21:20:46 GMT -5
Alright. I'll start screwing around with it.
Any idea on the hblank stuff? Or could your jello example be used to do similar effects?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 24, 2012 7:11:56 GMT -5
If you really want to do the Rocket Knight Adventure thing, you need to use HBlank 0 .. which I never managed to get working properly in BEX ( any other value works fine for me though ).
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 26, 2012 17:50:38 GMT -5
Alright, so I've been doing as much reading as I possibly can on the h interrupt, but I'm still clueless as to what it actually can do and how to use it.
I've noticed that if I enable the hblank, my controller routines stop working. I'm assuming because it's taking precedence over the VBLANK which controls the controller inputs?
Is there any good tutorials on raster effects on the genesis that I can look through? I don't want to keep hounding for this information or examples lol
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 26, 2012 21:47:46 GMT -5
Actually, scrap my previous reply .. HBLANK 0 works just fine, must have done something wrong when I last tried it. Alright, so I've been doing as much reading as I possibly can on the h interrupt, but I'm still clueless as to what it actually can do and how to use it. The horizontal interrupt lets you execute ( a small bit of ) code after a certain amount of scan-lines have been drawn. So if you at that point change a palette entry, or a tile, or the scrolling .. the remaining scan-lines will be drawn using those settings. Common uses are vertical scaling, mirroring ( Castlevania ), deformation, isometric rotation ( Dynamite Headdy ) , road hills ( Super Hang On ), 64+ color gradients etc.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 26, 2012 23:29:46 GMT -5
Ok, I figured out it was my code (too much going on in the hblank), but yeah... I got a nifty little wobbly effect (though it screws with the transparent tiles, so it's useless at this moment for me). I guess I need to read some more theory and any information I can find on these whole raster things >.<
One thing I've noticed is that if I scroll my planes:
setscrollplane scroll_a scroll up, 208 scroll left, 160 setscrollplane scroll_b scroll up, 208 scroll left, 160
then change the scroll mode, half the screen disappears. Any idea's on what's causing that?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 27, 2012 7:32:10 GMT -5
Once you switch modes you usually want to reset the scroll data accordingly .. otherwise there might be "left-over" data from the other scroll mode that is being used. Attached is a simple demo that shows this kind of situation. Attachments:
|
|