Given the "Stage 2 Start" appears in the reflection of the water, I'd like to think the words exist in the game world and John or Eric actually see them floating there and are too jaded to react like "Whatever, not the weirdest thing I've seen today." Please do more SEGA Genesis videos, this was great! :-)
@@JustWasted3HoursHere I can't remember what channel he posted it to, but I remember watching a video about just that he made a few years ago. He made a behind the scenes video about how he captured footage and used emulators to capture memory values with scripts that he had made.
@@coolbrotherf127 Interesting. I'll see if I can find it. He definitely puts a CRAP LOAD of work into these videos, which explains why they take weeks and months to be released sometimes.
5:39 The way you animate the graphics (like in this part) is so stylish and looks so natural that I constantly forget you're actually isolating and animating all of those things yourself. The amount of work that goes into these videos is completely superhuman 😱
I'd wager they still do, it's just a lot harder to explain in modern games. There's no way something like Last of Us runs so well on a PS3 without marvelous engineering
@@andijacobsen9148 Yep. Just the amount of optimization it took to get the cell processors synced perfectly with the CPU was very impressive for that game, but it's way too complicated to explain in a single UA-cam video even if we had an the source code.
@@tbird-z1r So, because they made one game where they bit off more than they could chew, that makes them a no-effort developer? None of the Witcher series matters anymore?
@@linkthehero8431 Yeaah, Contra: Hard Corps is by far the game with the most varied and awesome effects! Every 5 seconds there's some crazy new thing going on
@@supersexysega Fair point, that one has fluid animation and tons of variety too, but unlike Contra: Hard Corps, it's pretty much impossible to beat... I sure never could. While Contra isn't frustratingly difficult and you can take a different path in each playthrough to experience new crazy levels with awesome effects and bosses. I guess we can just say that the Genesis had so many great games that pushed the hardware, that it's hard to pick a single best one.
Glad to see a video about the SEGA Mega Drive :-) Afaik this game is abusing the SAT caching mechanism (which is not described here but that is really something obscure) for the reflection effect of the level 2, it's why the actual second SAT doesn't exactly fit what we see on the screen. That is, to my knowledge, the only game relying on this feature.
I was really confused about why changing the sprite table would work at all for vertical position... So having left out an important detail would explain why it was so
@@AURORAFIELDS I just looked it up, and basically, both SATs has two copies of each sprite In SAT #1: the above-reflection sprite is in the correct position, and the below-reflection sprite is at the right y-position, but off-screen to the left, which causes the reflection sprite drawing to be triggered once the SAT pointer has been updated. In SAT #2: the above-reflection sprite is in the correct Y position, but off-screen to the left, which causes it to be clipped off when under-water. The below reflection sprite is on-screen in the correct X and Y position in this table. Extremely clever!
I really enjoy the lack of music and the actual captions. While a lot of the stuff you talk about goes right over my head, lack of music makes your voice clear and keeps me from getting distracted. Also, I do enjoy the depth at which you explain things, even if I don't fully understand it all the time.
After watching this channel and learning the concepts of the era via the SNES series, I decided to make a simple Genesis game. So it's a cool feeling to see this channel tackle a Genesis game, and focus on a feature (H-blank interrupts) I didn't end up using in my experiments.
Very interesting video! I especially like seeing how the assembly code is written. I hope that I can include some nice effects in my own Castlevania game (although I'll need to work out how to do them in C/SGDK, or else learn some real 68k assembly!).
Chances are to do stuff like this effectively you'll need a little assembly, or at the bare minimum, some control over page alignment. For scanline interrupts like these, I point the IRQ vector to RAM, and whatever level is being loaded, the code will copy the desired interrupt handler for that level to that RAM. That way the interrupt handler never needs to check which level the player is on to do the correct task, it just does what it needs to do. I imagine that's what this game did, since not every level has water on the bottom half like this.
@@evertonfrancisco9149 Yes but GCC's syntax is absolutely atrocious. It's almost its own language. It's really not worth it to have a C function that is mostly C but has a little ASM in it. It's much easier to write a function entirely in assembly or entirely in C
I'm happy you're covering the Genesis. I grew up with one, and while it may not be as capable as the SNES, graphically speaking, it's still a notable machine (IMO).
That was a good eye for detail. I always thought the reflection was just the screen flipped. I never noticed the underside reflection of the bridge. Although the underside is just the same as the topside but with the pylon on top.
Great technical developer-friendly explanations. Could you please explain the screen effects that occur in Yoshi's Island in world 1-7 while the dizzy effect is active?
I'm no expert on the super nintendo but I'd guess it's a similar trick that the pirate ship boss in Puggsy used. It seems to me that the vertical scrolling is altered in chunks. Not sure how the color effect is done though. I think it's no coincidence that only Fuzzies make this effect and only one room in each level they're in has them. This is so the code responsible for the effect can be unloaded when no longer needed.
Segaretro is a good resource. I just wish there were more articles explaining the process in a less technical way. Most of the time I can read that stuff multiple times and still not understand it
One more SEGA Genesis quirk of interest for the water reflection scene: Changing the sprite table address will not update vertical positions of sprites since those are cached in the VDP itself for faster access. That cache is only updated when VRAM writes to the current location of the sprite table are done. There are basically 3 ways of working around that: (1) likely what the game did - have 2 copies of each sprite in both sprite tables, one copy for the top and one for the reflection, and hide sprites as needed by setting their X positions to be outside of the frame. Disadvantage: those hidden sprites still take bandwidth and with too much action they might not get rendered correctly but that scene does not look like that might be an issue. (2) manually update sprite Y positions after switching tables. Not the best idea since that can take a while and create render glitches too (the VDP reads the Y position twice for each scanline and if an update happens inbetween those reads it might display "glitch pixels" instead) (3) have 2 copies of each sprite in a single sprite table and use a sprite's "link field" (not shown in this video, probably for simplicity) to directly control which sprites the VDP should consider for rendering. Avoids the bandwidth issues of and needs less VRAM than (1) so no idea why the developers did not use (3)...
If there's one thing I've learned from all these videos about retro game programming, it's that horizontal interrupts can do _anything._ Curing cancer? Horizontal interrupts. Ending world hunger? Horizontal interrupts. Solving the climate crisis? You guessed it--horizontal interrupts.
Shadow-Highlight mode is the only way here to darken the screen mid-frame, since modifying the palette on Hblank on the Genesis will add garbage pixels to that line. There seem to be no workaround for this. This CRAM (color ram) garbage pixels are always shown at the bottom border (overscan) anyways, but get shifted into view if palette is modified mid-frame. Emulators fail to add these garbage pixels, but you can see them clearly on captured video from real hardware. These are limits of the Genesis VDP.
Kind of right, but you can hide those CRAM dots off frame with some clever tricks. (If you notice the water line in Sonic 3's Angel Island, you'll notice no CRAM dots on screen at all nor "waves" to mask it, (not all CRAM dots are displays on bottom overscan.) Really clever stuff at the time.
@@gizaha The creator of Sonic 3D Blast tells us why this happens in his video watch?v=o8qgArSqMsc "If CRAM is attempted to be read or written during active display, the value that was being read or written to the CRAM at that location will appear on-screen due to a bug in the hardware"
I'm learning how to code the Genesis and this was quite informative. In the first piece of code you showed, I noticed that no registers were used and it was all either memory-to-memory or immediates to memory - this was likely deliberate to avoid the cost of putting all the registers onto the stack and popping them off before the RTE. Funnily enough this is something that a lot of modern CPUs can't do - your smartphone CANNOT directly move memory to memory without using registers.
So not a palette swap but done via shadow mode in register, and playing with horizontal interrupts. The flips of horizontal and vertical flags, vertical offsets, and a separate Sprite attribute table to jumpy to, I didn't get at all. That's pretty cool!
Basically the sprite data is copied to VRAM twice, in two separate sections of video memory, but the video chip is only showing the first section. The video chip stores all video memory (be it sprites, backgrounds, color palettes, etc) in a big 64k heap, and uses pointers to decide what data is the background tiles, the sprites, and so on. Basically what happens is, when the TV has drawn everything above the waterline, the Genesis tells the video chip "The data stored at (insert whatever address the mirrored sprites are stored at here) are sprites now" and the video chip interprets them as such.
It's quite the clever trick, really. Relocating the sprite table is nearly instant, so they can just frontload all the actual work required to display the sprite and then "flip the switch" at that scanline. Trying to copy all that data to the new table during the interrupt just isn't happening.
Could you do a video about multisegmented, rotating objects in old video games? Such as the Seven Force boss from Gunstar Heroes or many of the bosses from Alien Soldier. That stuff has always fascinated me, it looks like there's a lot of complicated code involved.
One of the effects shown at the start of the video was the simulated leaning tower. I saw another video not too long ago that talked about clever visual tricks on the Genesis that made good illusions of 3D and rotation effects without actually doing any of that. The leaning tower, and in another game, a giant helicopter that appears to swing back and forth, uses a vertical skewing trick but doesn't actually rotate anything. These objects only "rotate" a few degrees - any more, and it would be obvious that they were being skewed. Pretty clever, but definitely not anything resembling Mode 7.
Genesis doesn't have dedicated Mode 7 hardware (the Sega CD and SNES do) but it can technically be done in software. You would probably need perfectly timed code to do it so chances are it's not worth the trouble
What about the sprite flipping effects that are also used in the last stage?I actually saw that those where not emulated well on the old Genecyst DOS emulator.
The light beam effect uses Hilight/Shade mode on the genesis allowing up to 183 colors from a total of 3,375. Edit: and the darkening thing does the same. Ps, the Genesis doesn’t need interrupts to shift the screen horizontally , it can have a table in VRAM for this.
I know it's a relatively simple effect visually, but I've always liked they way they rendered robots/enemies in Gunstar Heroes: The Bravo Man, Valvation, and many others were just pieces, or even pieces of pieces, on the sprite sheets, but they were rendered cohesively and even had quite a bit of personality. (My theory is Treasure saw that the Genesis had an odd call system for large sprites, and just used it for... everything they could get their hands on. You could see them dabble with this in Dynamite Headdy, but not quite commit yet. And you know this could go horribly wrong if you've ever watched or played Earnest Evans.) Seven Force is particularly impressive because of it's many forms made from a few parts plus some uniques, and Core Guard System (Dragon/Hammer/Runner) is impressive because it's doing all this, plus being rendered in front of a vertically rotating BG that changes speeds not only each form, but as the boss moves within the phase. Tho not the system of my childhood, your videos on the SNES and it's games really makes me appreciate the games I was limited to as a kid. This channel is amazing! :3
Yeah, sprites on the Genesis are a bit odd if I recall. While you can technically have either dimension be 8, 16, 24, or 32 pixels, in any combination you like, it seems to me that your sprite management routines are more efficient if you assume all sprites are "square"
So those 6-2 screen segments may actually be misdrawn due to the code not accounting for a timer delaying when the scanline counts are actually applied? I'd love to see what was intended and if it would make playing 6-2 easier.
@@RGMechEx Thank you for responding! That is amazing. I had no idea that was even possible. I've been learning how to program the mega drive in 68000 assembly and a feature like this would honestly be a life saver. So far I've only made some prototypes of putting tiles on planes A and B along with a few sprites and I'm planning to learn more. Are you maybe using gens or regen?
I wonder if it would be possible to enhance the reflection by also offsetting lines horizontally and doubling or skipping lines to shorten or stretch the reflection and make it a little more realistic. Doing all of that at once alone nevermind with additional highlight and shadow is probably asking too much of the Genesis.
I think it's possible, but it would be quite difficult. Getting an IRQ to trigger at a desired scanline is kinda tricky, you can only tell it to "occur every X scanlines" by loading a new value of X
when you were going to talk about how the sprites dont clip into each i thought youd say they were masked away.. instead found out the sprite table is even less static than i thought
It's a clever trick since the act of changing where the "sprite table" is, takes almost no time at all compared to modifying every sprite's flip state and position all at once
Writing to OAM during H-Blank is very unreliable, it may work, it may not work depending on PPU's state. Writing to OAM during F-blank however is fine, it's done by e.g. Super Mario Kart.
I noticed something! Because the Genesis's screen isn't a perfect 4:3, the screen in this vid (and all of its sprites) are ever-so-slightly squished. This is most noticeable in one level you showed in the intro, with the gears that are more oval than circle.
RetroRGB said it's to focus all the CPU power to the middle of the screen. snes also did this in super metroid, hagane and king of dragons, and the rotation levels in super castlevania 4 FYI.
I think I would just put a copy of the sprites rotated and underneath the characters and use masking and opacity stuff to make it look like water reflection
I'll be honest, the first time I saw the splitting screen effect on the final stage, I thought the game was glitching. I think the second stage reflection effect pays off, but the final stage effect isn't worth the extra coding.
Edit: You're using the Castlevania sprites. Disregard. -Are you able to modify the monospace font you use for addresses and code? The O and 0 look a bit too similar; perhaps someone could add a stroke or slash to differentiate them at a glance.- -Of course, programmers would know that O is not a valid hexadecimal value, but still.-
Great video! I didn't know this game even existed on the Genesis, much less used such interesting effects. I'm curious: I'm sure the same background effects are easily achievable on the SNES using HDMA, but can the sprite splitting be done there as well? I'm trying to remember if there's some reason why manipulating the OAM mid-frame was either impossible or inadvisable.
@@fungo6631 i dont think it would be that easy, h-blank time is far too short to update all sprites on screen, and the snes doesn't have movable sprite tables.
@@fungo6631 I get that, but it would be difficult to display correctly at the seam line, you would need to manualy remove parts of the sprite in code if you dont want the problem shown at 3:54
@@mazionach Well, you could use BG priority to hide sprites. And as said, even if you need modifying the sprite, it can be done by precomputing the sprite and storing it in RAM. The SNES has 128K of RAM so it should be plentiful.
this is great in terms of the level of detail. But it would be easier to follow if instead of raw hex addresses in the machine code dumps you just labeled what vdp register they correspond to (kind of like you do on the bottom of the screen as you step thru the code). No body really needs or wants to hear you read out hex addresses of hardware registers. Furthermore, if you could put a comment after each line of assembly code saying what it does, it would be way easier to see the overall structure. The video would be a few minutes shorter, but the same level of detail AND easier to follow. Just MHO.
@@piratesephiroth I assume that it was supposed to be panes of glass, slightly tilted and/or curved to distort the view. Or just some dark magic to mess with our minds?
@@segasystem1671 If it's a mirror, is it curved so as to flip (reflip? unflip?) the image? Most of the mirrors I've seen show everything backwards. :P EDIT: Or maybe it's like that one bit in Sonic Adventure where you view and control the reflection's reflection, so it just seems normal.
Im confused by this „Horizontal” interrupts naming for raster/scanline, when clearly they are Vertical, although making horizontal splits or bands (?!) …
Part 06 of the SNES series on this channel has more details, but in short it's named after what the TV is doing at that moment the interrupt triggers, rather than what effects you can do with it. During "horizontal blanking", the beam is moving primarily horizontally (it does move down one scanline, so I can understand the confusion, but compared to "vertical blanking" it's not moving vertically very much at all).
The lighting and shadows is shadow/highlight w/ sprites or background planes. The rotating gears are probably pre-calculated, and the 3D rotating is just careful animation of pre-calculated tiles. Why thumbs down a well-made video that gives useful information?
@@Ehal256 well thanks for mentioning this but the big thumbs down was because of not explaining everything in this video wich i did expected once he talked about it,but other then that he explained things pretty well.
Umm, the video is already 15 minutes long. Sure, ask for another video covering that, but there's no call for thumbs downing the video for being too short.
@@xeostube to me he talked waaay too much about the same subject, if he just covered all subjects into 1 video and made that video 40 minutes, i would,ve be fine with it,but i don’t like if i hate to wait another 1000 years for another video about those other subjects wich reallly get’s annoying.
Given the "Stage 2 Start" appears in the reflection of the water, I'd like to think the words exist in the game world and John or Eric actually see them floating there and are too jaded to react like "Whatever, not the weirdest thing I've seen today."
Please do more SEGA Genesis videos, this was great! :-)
that means when they see FINAL STAGE START at the beginning of stage 6, they know they're almost to the end
I dunno, I don't think they're accustomed to THAT kind of horror.
Game Hut might be of interest to you.
So glad you're back posting again. You're one of my favorite channels. These videos are always so interesting and well edited.
Exactly how I feel, only you didn't say anything cringey like I almost did until I realized I could just agree with you haha
@@TroyBlackford ditto
I'd love to see a video on his workflow for making these very detailed explanations. A huge amount of work no doubt goes into each one.
@@JustWasted3HoursHere I can't remember what channel he posted it to, but I remember watching a video about just that he made a few years ago. He made a behind the scenes video about how he captured footage and used emulators to capture memory values with scripts that he had made.
@@coolbrotherf127 Interesting. I'll see if I can find it. He definitely puts a CRAP LOAD of work into these videos, which explains why they take weeks and months to be released sometimes.
5:39 The way you animate the graphics (like in this part) is so stylish and looks so natural that I constantly forget you're actually isolating and animating all of those things yourself. The amount of work that goes into these videos is completely superhuman 😱
I can never get over how cleverly the game designers exploited the specific hardware in those early games!
I'd wager they still do, it's just a lot harder to explain in modern games. There's no way something like Last of Us runs so well on a PS3 without marvelous engineering
@@andijacobsen9148 Yep. Just the amount of optimization it took to get the cell processors synced perfectly with the CPU was very impressive for that game, but it's way too complicated to explain in a single UA-cam video even if we had an the source code.
@@andijacobsen9148 Some shitty developers don't bother. (CDPR for instance.)
Back then there was passion for these things. Nowadays they just want to look HD pretty.
@@tbird-z1r So, because they made one game where they bit off more than they could chew, that makes them a no-effort developer? None of the Witcher series matters anymore?
Yaaay a Sega Genesis video, thanks!! Bloodlines has so many cool effects.
Right? It's one of the games that makes me glad I splurged on the Expansion Pack for Nintendo Switch Online. Contra Hard Corps is awesome too.
@@linkthehero8431 Yeaah, Contra: Hard Corps is by far the game with the most varied and awesome effects! Every 5 seconds there's some crazy new thing going on
@@TheSektorz I would give tje edge to Adventures of Batman and Robin on Genesis.
@@supersexysega Fair point, that one has fluid animation and tons of variety too, but unlike Contra: Hard Corps, it's pretty much impossible to beat... I sure never could. While Contra isn't frustratingly difficult and you can take a different path in each playthrough to experience new crazy levels with awesome effects and bosses.
I guess we can just say that the Genesis had so many great games that pushed the hardware, that it's hard to pick a single best one.
99% of this is over my head. I'm not a programmer but I just find it so interesting. Nice to see you covering the Megadrive
Glad to see a video about the SEGA Mega Drive :-)
Afaik this game is abusing the SAT caching mechanism (which is not described here but that is really something obscure) for the reflection effect of the level 2, it's why the actual second SAT doesn't exactly fit what we see on the screen. That is, to my knowledge, the only game relying on this feature.
I would have talked about the caching but the video was already quite long! It tripped me up for a bit when I was creating graphics for the video.
@@RGMechEx hi :)
I was really confused about why changing the sprite table would work at all for vertical position... So having left out an important detail would explain why it was so
@@AURORAFIELDS I just looked it up, and basically, both SATs has two copies of each sprite
In SAT #1: the above-reflection sprite is in the correct position, and the below-reflection sprite is at the right y-position, but off-screen to the left, which causes the reflection sprite drawing to be triggered once the SAT pointer has been updated.
In SAT #2: the above-reflection sprite is in the correct Y position, but off-screen to the left, which causes it to be clipped off when under-water. The below reflection sprite is on-screen in the correct X and Y position in this table.
Extremely clever!
I really enjoy the lack of music and the actual captions. While a lot of the stuff you talk about goes right over my head, lack of music makes your voice clear and keeps me from getting distracted.
Also, I do enjoy the depth at which you explain things, even if I don't fully understand it all the time.
After watching this channel and learning the concepts of the era via the SNES series, I decided to make a simple Genesis game. So it's a cool feeling to see this channel tackle a Genesis game, and focus on a feature (H-blank interrupts) I didn't end up using in my experiments.
One of the most visually impressive games I ever played on Genesis as a kid. Vectorman blew me away too.
Whoa. The detail that the water reflection in the second stage actually shows the underside of the platforms blew my mind
Very interesting video! I especially like seeing how the assembly code is written. I hope that I can include some nice effects in my own Castlevania game (although I'll need to work out how to do them in C/SGDK, or else learn some real 68k assembly!).
learning assembly is fun until you try to make anything more complicated than a Hello World program
At least the 68k has the benefit of modern compilers that actually emit fast assembly.
Chances are to do stuff like this effectively you'll need a little assembly, or at the bare minimum, some control over page alignment. For scanline interrupts like these, I point the IRQ vector to RAM, and whatever level is being loaded, the code will copy the desired interrupt handler for that level to that RAM. That way the interrupt handler never needs to check which level the player is on to do the correct task, it just does what it needs to do. I imagine that's what this game did, since not every level has water on the bottom half like this.
Can't you implement assembly in c compiler??
@@evertonfrancisco9149 Yes but GCC's syntax is absolutely atrocious. It's almost its own language. It's really not worth it to have a C function that is mostly C but has a little ASM in it. It's much easier to write a function entirely in assembly or entirely in C
It's amazing that video games were ever made at all.
Your videos are extraordinary for these topics. Thank you!
I didn't expect a Mega Drive game-related video from you :O this is awesome!!!
The legend came back :)
Hello videoman I've never seen before, talking about a game I've never played before. This is really cool, and I'm glad to have stumbled in here.
I'm happy you're covering the Genesis. I grew up with one, and while it may not be as capable as the SNES, graphically speaking, it's still a notable machine (IMO).
Glad you're back. You make probably the most impressive educational videos on UA-cam
That was a good eye for detail. I always thought the reflection was just the screen flipped. I never noticed the underside reflection of the bridge. Although the underside is just the same as the topside but with the pylon on top.
Rocket Knight uses the same effect on stage 3 but its even even better looking and faster.
Great technical developer-friendly explanations. Could you please explain the screen effects that occur in Yoshi's Island in world 1-7 while the dizzy effect is active?
I'm no expert on the super nintendo but I'd guess it's a similar trick that the pirate ship boss in Puggsy used. It seems to me that the vertical scrolling is altered in chunks. Not sure how the color effect is done though. I think it's no coincidence that only Fuzzies make this effect and only one room in each level they're in has them. This is so the code responsible for the effect can be unloaded when no longer needed.
These videos are awesome for me since i'm learning SGDK to make genesis games and want to know more of the low level capabilities of the genesis.
Segaretro is a good resource. I just wish there were more articles explaining the process in a less technical way. Most of the time I can read that stuff multiple times and still not understand it
Welcome to SEGA, don't forget the SNES series!. I like learning from you!
I really like this series
That's some awesome MC68000 stuff!
One more SEGA Genesis quirk of interest for the water reflection scene: Changing the sprite table address will not update vertical positions of sprites since those are cached in the VDP itself for faster access. That cache is only updated when VRAM writes to the current location of the sprite table are done.
There are basically 3 ways of working around that:
(1) likely what the game did - have 2 copies of each sprite in both sprite tables, one copy for the top and one for the reflection, and hide sprites as needed by setting their X positions to be outside of the frame. Disadvantage: those hidden sprites still take bandwidth and with too much action they might not get rendered correctly but that scene does not look like that might be an issue.
(2) manually update sprite Y positions after switching tables. Not the best idea since that can take a while and create render glitches too (the VDP reads the Y position twice for each scanline and if an update happens inbetween those reads it might display "glitch pixels" instead)
(3) have 2 copies of each sprite in a single sprite table and use a sprite's "link field" (not shown in this video, probably for simplicity) to directly control which sprites the VDP should consider for rendering. Avoids the bandwidth issues of and needs less VRAM than (1) so no idea why the developers did not use (3)...
My mind was blown seeing those water effects for the first time back then
RGMechEx: Just uploaded a video!
Me: Time that I bingewatch this channel.
This is so freaking cool.
If there's one thing I've learned from all these videos about retro game programming, it's that horizontal interrupts can do _anything._ Curing cancer? Horizontal interrupts. Ending world hunger? Horizontal interrupts. Solving the climate crisis? You guessed it--horizontal interrupts.
I came to the same conclusion not too long after learning how to use them
He's alive!
This was very interesting, great video
Genesis denisis what Nintendenesis.
Rocket Knight Adventures (also by Konami) uses the reflection effect as well.
Shadow-Highlight mode is the only way here to darken the screen mid-frame, since modifying the palette on Hblank on the Genesis will add garbage pixels to that line. There seem to be no workaround for this. This CRAM (color ram) garbage pixels are always shown at the bottom border (overscan) anyways, but get shifted into view if palette is modified mid-frame. Emulators fail to add these garbage pixels, but you can see them clearly on captured video from real hardware. These are limits of the Genesis VDP.
Even if you change colors in h-blank?
IIRC Sonic modifies the palette, then conceals the stray pixels by overlaying sprites pretending to be surface waves.
Kind of right, but you can hide those CRAM dots off frame with some clever tricks. (If you notice the water line in Sonic 3's Angel Island, you'll notice no CRAM dots on screen at all nor "waves" to mask it, (not all CRAM dots are displays on bottom overscan.) Really clever stuff at the time.
@@gizaha The creator of Sonic 3D Blast tells us why this happens in his video watch?v=o8qgArSqMsc "If CRAM is attempted to be read or written during active display, the value that was being read or written to the CRAM at that location will appear on-screen due to a bug in the hardware"
if the emulators don't show those its probally cause they are not accurate emulators, don't exist better ones for genesis?
I'm learning how to code the Genesis and this was quite informative. In the first piece of code you showed, I noticed that no registers were used and it was all either memory-to-memory or immediates to memory - this was likely deliberate to avoid the cost of putting all the registers onto the stack and popping them off before the RTE. Funnily enough this is something that a lot of modern CPUs can't do - your smartphone CANNOT directly move memory to memory without using registers.
Awesome!!
So not a palette swap but done via shadow mode in register, and playing with horizontal interrupts.
The flips of horizontal and vertical flags, vertical offsets, and a separate Sprite attribute table to jumpy to, I didn't get at all. That's pretty cool!
Basically the sprite data is copied to VRAM twice, in two separate sections of video memory, but the video chip is only showing the first section. The video chip stores all video memory (be it sprites, backgrounds, color palettes, etc) in a big 64k heap, and uses pointers to decide what data is the background tiles, the sprites, and so on. Basically what happens is, when the TV has drawn everything above the waterline, the Genesis tells the video chip "The data stored at (insert whatever address the mirrored sprites are stored at here) are sprites now" and the video chip interprets them as such.
That Greece level is a Masterpiece.
I'm impressed that they made separate tiles and map data for the reflections.
It's quite the clever trick, really. Relocating the sprite table is nearly instant, so they can just frontload all the actual work required to display the sprite and then "flip the switch" at that scanline. Trying to copy all that data to the new table during the interrupt just isn't happening.
Could you do a video about multisegmented, rotating objects in old video games? Such as the Seven Force boss from Gunstar Heroes or many of the bosses from Alien Soldier. That stuff has always fascinated me, it looks like there's a lot of complicated code involved.
7:09 What's that weird 68000 assembler syntax? For sure, not Motorola's one. It lacks the # sign for constants and introduces ( ) for indirection 😵
Could be Milo syntax but I never used it so idk.
amazing
You could summarize this entire series with “moving stuff during horizontal interrupts”
That's 99% of visual effects programming in retro game consoles. 😅
I had just assumed this was done by changing the palette and offsetting the sprite positions manually, but this would be faster of course.
The Split screen in 6-2 feels like an emulation error.
WHAT ABOUT THE RASTA EFFECT MON?
I'd be interested in a general overview of how Genesis graphics work and what all modes and effects it can do.
That's quite a long story. Coding Secrets and Gamehut are two channels that talk about it quite a bit
En Comix Zone tienes efectos muy interesantes, muy buen vídeo 📹 y contenido.
Always wondered if this was a mode 7 hardware like trick
One of the effects shown at the start of the video was the simulated leaning tower. I saw another video not too long ago that talked about clever visual tricks on the Genesis that made good illusions of 3D and rotation effects without actually doing any of that.
The leaning tower, and in another game, a giant helicopter that appears to swing back and forth, uses a vertical skewing trick but doesn't actually rotate anything. These objects only "rotate" a few degrees - any more, and it would be obvious that they were being skewed. Pretty clever, but definitely not anything resembling Mode 7.
Genesis doesn't have dedicated Mode 7 hardware (the Sega CD and SNES do) but it can technically be done in software. You would probably need perfectly timed code to do it so chances are it's not worth the trouble
What about the sprite flipping effects that are also used in the last stage?I actually saw that those where not emulated well on the old Genecyst DOS emulator.
Think you could do a video on Genesis DMA?
The light beam effect uses Hilight/Shade mode on the genesis allowing up to 183 colors from a total of 3,375.
Edit: and the darkening thing does the same. Ps, the Genesis doesn’t need interrupts to shift the screen horizontally , it can have a table in VRAM for this.
I know it's a relatively simple effect visually, but I've always liked they way they rendered robots/enemies in Gunstar Heroes: The Bravo Man, Valvation, and many others were just pieces, or even pieces of pieces, on the sprite sheets, but they were rendered cohesively and even had quite a bit of personality. (My theory is Treasure saw that the Genesis had an odd call system for large sprites, and just used it for... everything they could get their hands on. You could see them dabble with this in Dynamite Headdy, but not quite commit yet. And you know this could go horribly wrong if you've ever watched or played Earnest Evans.)
Seven Force is particularly impressive because of it's many forms made from a few parts plus some uniques, and Core Guard System (Dragon/Hammer/Runner) is impressive because it's doing all this, plus being rendered in front of a vertically rotating BG that changes speeds not only each form, but as the boss moves within the phase.
Tho not the system of my childhood, your videos on the SNES and it's games really makes me appreciate the games I was limited to as a kid. This channel is amazing! :3
Yeah, sprites on the Genesis are a bit odd if I recall. While you can technically have either dimension be 8, 16, 24, or 32 pixels, in any combination you like, it seems to me that your sprite management routines are more efficient if you assume all sprites are "square"
Gotta love inline ASM!
11 flunked their sats
underrated
So those 6-2 screen segments may actually be misdrawn due to the code not accounting for a timer delaying when the scanline counts are actually applied? I'd love to see what was intended and if it would make playing 6-2 easier.
Part 6 when? Or has this series been forgotten/abandoned?
Thank you! This is one of the best videos I've watched regarding Mega Drive/Genesis development.
Where did you get the assembly source code for this?
I got the source code by reading a trace log created by an emulator while playing the game (a file that lists every instruction the CPU executes).
@@RGMechEx Thank you for responding! That is amazing. I had no idea that was even possible.
I've been learning how to program the mega drive in 68000 assembly and a feature like this would honestly be a life saver.
So far I've only made some prototypes of putting tiles on planes A and B along with a few sprites and I'm planning to learn more.
Are you maybe using gens or regen?
I wonder if it would be possible to enhance the reflection by also offsetting lines horizontally and doubling or skipping lines to shorten or stretch the reflection and make it a little more realistic. Doing all of that at once alone nevermind with additional highlight and shadow is probably asking too much of the Genesis.
I think it's possible, but it would be quite difficult. Getting an IRQ to trigger at a desired scanline is kinda tricky, you can only tell it to "occur every X scanlines" by loading a new value of X
Jurassic Park: Rampage Edition - T-REX Chase Scene
when you were going to talk about how the sprites dont clip into each i thought youd say they were masked away.. instead found out the sprite table is even less static than i thought
It's a clever trick since the act of changing where the "sprite table" is, takes almost no time at all compared to modifying every sprite's flip state and position all at once
Konami was a beasts of visual effects back then with sega and snes
do the water effects in Rocket Knight Adventures use the same routine? as both are Konami games
I love the 68000
Would the sprite shenanigans work the same way on an SNES? I've never seen anyone change the OAM in an H-blank before.
Writing to OAM during H-Blank is very unreliable, it may work, it may not work depending on PPU's state. Writing to OAM during F-blank however is fine, it's done by e.g. Super Mario Kart.
My guess was that they changed the Y scroll on every scanline below the water.
I noticed something! Because the Genesis's screen isn't a perfect 4:3, the screen in this vid (and all of its sprites) are ever-so-slightly squished. This is most noticeable in one level you showed in the intro, with the gears that are more oval than circle.
RetroRGB said it's to focus all the CPU power to the middle of the screen. snes also did this in super metroid, hagane and king of dragons, and the rotation levels in super castlevania 4 FYI.
I think I would just put a copy of the sprites rotated and underneath the characters and use masking and opacity stuff to make it look like water reflection
I don't think the Genesis really had opacity though. There were light/dark shading effects, I can't remember all the details.
I'll be honest, the first time I saw the splitting screen effect on the final stage, I thought the game was glitching. I think the second stage reflection effect pays off, but the final stage effect isn't worth the extra coding.
Edit: You're using the Castlevania sprites. Disregard.
-Are you able to modify the monospace font you use for addresses and code? The O and 0 look a bit too similar; perhaps someone could add a stroke or slash to differentiate them at a glance.-
-Of course, programmers would know that O is not a valid hexadecimal value, but still.-
Why is the gameplay footage presented in 8:7? Megadrive is 320x224 NTSC.
next crash bandicoot 1 2 3 how level loadings and animations work and etc...
Great video! I didn't know this game even existed on the Genesis, much less used such interesting effects. I'm curious: I'm sure the same background effects are easily achievable on the SNES using HDMA, but can the sprite splitting be done there as well? I'm trying to remember if there's some reason why manipulating the OAM mid-frame was either impossible or inadvisable.
You could just use another sprite and call it a day. Worst case scenario you could flip the sprites in software and just copy it to VRAM.
@@fungo6631 i dont think it would be that easy, h-blank time is far too short to update all sprites on screen, and the snes doesn't have movable sprite tables.
@@mazionach That's what I said. Just have another sprite in the OAM slot constantly.
@@fungo6631 I get that, but it would be difficult to display correctly at the seam line, you would need to manualy remove parts of the sprite in code if you dont want the problem shown at 3:54
@@mazionach Well, you could use BG priority to hide sprites. And as said, even if you need modifying the sprite, it can be done by precomputing the sprite and storing it in RAM. The SNES has 128K of RAM so it should be plentiful.
Why are the line of codes using dollar sign
Dollar sign means hexadecimal. Many programming languages use "0x" these days. Sega Genesis code uses $ but they both mean the same thing
yo the spc700 plz
Episode five?
this is great in terms of the level of detail. But it would be easier to follow if instead of raw hex addresses in the machine code dumps you just labeled what vdp register they correspond to (kind of like you do on the bottom of the screen as you step thru the code). No body really needs or wants to hear you read out hex addresses of hardware registers. Furthermore, if you could put a comment after each line of assembly code saying what it does, it would be way easier to see the overall structure. The video would be a few minutes shorter, but the same level of detail AND easier to follow. Just MHO.
Yikes, what's up with that Bloodlines aspect ratio? It's so squished horizontally 💀
I think they were using Ray Tracing on the Genesis.
The water reflection is kinda nice but that slicing screen effect is the ugliest thing ever.
I thought the game was broken when I saw that back then.
You mean the mirror level?
@@segasystem1671 yeah.
looks like a complete mess. I had no idea of what that was supposed to mean.
@@piratesephiroth I assume that it was supposed to be panes of glass, slightly tilted and/or curved to distort the view. Or just some dark magic to mess with our minds?
it's a broken mirror effect it's suppose to look ugly, you ever seen a nice looking broken mirror?
@@segasystem1671 If it's a mirror, is it curved so as to flip (reflip? unflip?) the image? Most of the mirrors I've seen show everything backwards. :P
EDIT: Or maybe it's like that one bit in Sonic Adventure where you view and control the reflection's reflection, so it just seems normal.
Im confused by this „Horizontal” interrupts naming for raster/scanline, when clearly they are Vertical, although making horizontal splits or bands (?!) …
Part 06 of the SNES series on this channel has more details, but in short it's named after what the TV is doing at that moment the interrupt triggers, rather than what effects you can do with it. During "horizontal blanking", the beam is moving primarily horizontally (it does move down one scanline, so I can understand the confusion, but compared to "vertical blanking" it's not moving vertically very much at all).
@@2WaterGuns I know how its works. I was C64 coder. It’s should be horizontal BLANK interrupt or raster interrupt.
Yeah the naming convention is weird if you think about it
Ray tracing in sega genesis!
Hmm, so this could run on the SNES, couldn't it?
Rastafarian effects
🙃 𝓟Ř𝔬𝓂𝔬𝐒ϻ
This game should be in 4:3. Clown
No explenations about the lightning shadows and rotating gears and 3D rotating. Tower,that means a big thumbs down 👎
The lighting and shadows is shadow/highlight w/ sprites or background planes. The rotating gears are probably pre-calculated, and the 3D rotating is just careful animation of pre-calculated tiles. Why thumbs down a well-made video that gives useful information?
@@Ehal256 well thanks for mentioning this but the big thumbs down was because of not explaining everything in this video wich i did expected once he talked about it,but other then that he explained things pretty well.
Your mom gave you a big thumbs down when she saw what an unfortunate-looking baby she'd just had.
Umm, the video is already 15 minutes long. Sure, ask for another video covering that, but there's no call for thumbs downing the video for being too short.
@@xeostube to me he talked waaay too much about the same subject, if he just covered all subjects into 1 video and made that video 40 minutes, i would,ve be fine with it,but i don’t like if i hate to wait another 1000 years for another video about those other subjects wich reallly get’s annoying.