Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

** Sega Genesis 3D engine Day 2 ** Added solid filled triangles. Added colors ( full 15 color buffer ) . All code in C so far apart form the buffer clear and DMA buffer sending so should be some good speedups to come yet once line / triangle...

17,718 Aufrufe • vor 6 Monaten •via X (Twitter)

30 Kommentare

Profilbild von DANMAKUMAN
DANMAKUMANvor 6 Monaten

I had this question in my mind for some time now. I remember reading a post by one of the programmers that Thunder Force V was originally for the MD with a mix or pre-rendered and actual polygons. A MD version of TFV could be actually possible?

Profilbild von Space ☆ Bruce
Space ☆ Brucevor 6 Monaten

didn't solve the division problem here, but it's partly what led me to preferring Quads as at least you're only doing 4 instead of 6 to fill the same shape!

Profilbild von Shannon Birt
Shannon Birtvor 6 Monaten

I can use reciprical multiplication rather than division so that will cheapen them a bit , although i dislike the cost of the divisions its a the minor part of the cpu load when drawing the triangle in reality, it just hurts seeing 100s of cycles per instruction, thats interesting what you say about quads though . I'm writing the triangle routine in assembly now , hoping for good gains .

Profilbild von Oleg Endo
Oleg Endovor 6 Monaten

@spacebruce Newton-Raphson approximation for 1/x may come in handy 🤓

Profilbild von Shannon Birt
Shannon Birtvor 6 Monaten

@spacebruce Yes ! I've used it before and it could net some gains but the hot path is more in the line drawing part of the triangle filling , so focusing energy there at present. If only i could make a workable row layout buffer rather than column.

Profilbild von Oleg Endo
Oleg Endovor 6 Monaten

@spacebruce My guess is, you'd need to generate a "jumpable" code map for various cases of span offset (within 8-pixel tile) and span length, then do optimized unrolled line drawing. MOVEM looks like it can come in handy, I would expect it to avoid the instruction fetch bus access.

Profilbild von Space ☆ Bruce
Space ☆ Brucevor 6 Monaten

@birt_shannon This seems the way, I'm doing figure out number of tile spans, move.l, decrement 1, branch, which should be easy to adapt to a table.

Profilbild von Shannon Birt
Shannon Birtvor 6 Monaten

Pretty much doing that now , it has to slow down near the edges though . Got to watch the overhead too as if you spend too long figuring out how many spans etc then its slow for everything thats a small span. Unless you have a code segment for every span length which is getting into python script territority to write the asm for you .. the edges eg alignment , do muck up the simplicity of that though . I think movem here is of limited use as it can't stride well .

Profilbild von Space ☆ Bruce
Space ☆ Brucevor 6 Monaten

@EndoOleg Yeah, it's easy to cook up schemes that will load the perfect optimised routine for every occasion, but at some point the detection/entry mechanism drags down all the other cases.

Profilbild von Gustavo Araújo
Gustavo Araújovor 6 Monaten

What if you use smaller forms? If so can you increase the number of them?

Profilbild von Shannon Birt
Shannon Birtvor 6 Monaten

Yes, if they are smaller you can have a lot more of them . Its still been optimised though so should be ablemton get more yet .

Profilbild von Some Random Bloke
Some Random Blokevor 6 Monaten

I hate to just geek out but OMG, so cool!! A great start

Profilbild von Shannon Birt
Shannon Birtvor 6 Monaten

Thanks 😀 Its been a lot of fun so far !

Profilbild von Lara Frost
Lara Frostvor 6 Monaten

Literally incredible! Getting solid 3D at 60fps on Genesis hardware? Respect. 🤩

Profilbild von Зoлoтий Кoзak™🇺🇦🇪🇺
Зoлoтий Кoзak™🇺🇦🇪🇺vor 6 Monaten

👍

Profilbild von Guillaume NUNES
Guillaume NUNESvor 6 Monaten

THX attack chopper 2 is coming !

Profilbild von Shannon Birt
Shannon Birtvor 6 Monaten

Haha , maybe just the tail rotor .

Profilbild von Dr. Pashayan
Dr. Pashayanvor 6 Monaten

@pikuma You need two 68k chips which Genesis lacks

Profilbild von Shannon Birt
Shannon Birtvor 6 Monaten

@pikuma A 68020 would be nice !!

Profilbild von Dr. Pashayan
Dr. Pashayanvor 6 Monaten

@pikuma Konami used dual chips . Wec Le Mans 24 is a good example of 3d w those 32bit older cisc chips

Profilbild von robert james moss
robert james mossvor 6 Monaten

Errr.. distracted again ? cough cough Parodus, lufthott, Sota.........Or maybe start porting oids from the St. good work focus on the goal, before I pass on, 57 you know not much left in the tank....

Profilbild von Shannon Birt
Shannon Birtvor 6 Monaten

Its hard to not get distracted admittedly , but normally able to take the learnings back to the other projects so its not a total time waste 😉

Profilbild von robert james moss
robert james mossvor 6 Monaten

I can feel my arteries tightening , I may not make it to any completions..... dial 99999999999999999999999999999999999999999

Profilbild von Shannon Birt
Shannon Birtvor 6 Monaten

🤣 .. I worry about the same thing haha . Got to keep it fun - we will get there !

Profilbild von Arnaud Carré
Arnaud Carrévor 6 Monaten

So you have a fixed tilemap and the soft rasterizer is writing into 8x8 tiles data?

Profilbild von Shannon Birt
Shannon Birtvor 6 Monaten

Yes , thats how you do a bitmap type mode on the Genesis. It works but the layout does require a bit of cpu to translate to x and y , as you have tile boundaries. For speed you cant Write directly to vram as theres a small window every frame to write to vram at speed, so you Write to ram first , then send a buffer at a time to vram .

Profilbild von Arnaud Carré
Arnaud Carrévor 6 Monaten

ok so the software rasterizer is writing in stadard 32k RAM (using weird tile layout) and then you copy into VRAM using a single DMA memcpy during vblank? I wrote a genesis game decades ago (Shaq Fu), my memory is fading away :)

Profilbild von Shannon Birt
Shannon Birtvor 6 Monaten

Yes, so 2x16 kb ram buffers , write to one in Ram as per tile layout whilst sending the other to vram via dma ( takes 4 frames to send a buffer currently - ill get it to 3 soon ) . 2x16 kb buffers in vram also . Using double buffering to stop screen tearing .

Profilbild von Albert Abramson
Albert Abramsonvor 6 Monaten

I just now finally after all these years of looking at the BDT figured out how to draw 3-D shapes using the DMA. Obviously, it’s an undocumented trick, but would greatly speed up 3-D graphics on the SEGA Genesis. We could even draw textures.

Profilbild von Albert Abramson
Albert Abramsonvor 6 Monaten

Would you like me to rewrite that into Assembly using reciprocal lookups?

Ähnliche Videos

** Sega Genesis 3D Engine Day 3 ** Blast Processing kicks In !! Converted the Line Drawing and Triangle drawing to 68k Assembly and gained 25% in the line drawing and 33% speedups in the triangle drawing vs C ( so far ) . The scheduler calculating the vertexs is still in C , just the drawing routines are now are in assembly . Possibly 5-10 % gains will come from the scheduler being in ASM also. The Line and Triangle drawing C code took some beating , it was surprising - particularly the line drawing to get a speed up over the C code in ASM. I guess its not too surprising as the C code was basically handling pointers and integers so I had to get exotic to find the speedups. Initially my ASM Line draw was 100% slower than the C code - the first pass conversion from C to ASM is always rough as its more about getting it working then refine later , but yeah 100% slower on first pass was brutal, after 4 hrs tweaking it was 25% faster than the C code so thats a good start - might get more yet. So added more squares and more triangles for load testing at the same frame rate. Its still not anything cohesive but right now focussing on performance in rendering to see how much can be pushed. As rendering will be the biggest cpu soak the faster that goes the better. The smaller triangles take about 1/3 the CPU time of the larger triangles at present so theres definately a fill rate limit vs the setup time to consider. The same would go for the squares been line framed - smaller ones would allow al lot more . #SGDK #SegaGenesis #SegaMegadrive

Shannon Birt

21,354 Aufrufe • vor 6 Monaten

** MEGA Parodius Scaling Effects Part 1 ** One of the big challenges with the Parodius Megadrive port is Stage 8's boss - The puffer-fish *Pooyan* with his full screen scaling effect. The goal is to be very close to the arcade (with extras on top ) so I thought lets tackle it head on to see how close we can get. I was also keen to jump into another scaling code rabit hole haha. Pyron pulled out all the stops and got me the source frames and reworked the BG tiles for this test - a big thankyou to him , Vector Orbitex is busy working on Stage 2 tracks so the team is working hard all round on this port. The MD has no sprite / background GFX scaling hardware , however the VDPs Vertical scroll can be updated per scanline to help vertical scaling on backgrounds, but there is a cpu cost to manage all the interupts so thats not free either. With the Horizontal scaling there is no help at all , apart from a semi-friendly packed pixel format for the cpu to work with, its not quite chunky format but better than planar format still for scaling. So its falls back to the 68k CPU to do all of the horizontal expansion which is the largest cpu cost. Basically drawing strips of either 1x, 2x, 3x or 4x wide columns at speed. So we are one week into this Boss's routine and you can see from the below video the horizontal scaling is implented ( vertical will be in the next update ) . We are scaling from 1x to 4x in the video below in 74 steps for testing . The column distributions are always a bit painfull to do - thankfully they are all worked out now. This is the third scaler I have built and the goal was with this one to make it really flexible for use in other projects also, sometimes when you optimise something to the last degree all the flexibility gets taken out of it. Currenty scaling at 12-25 FPS update here, I had some rules against some optimisations which I would use and some I wouldn't , thankfully we are a bit ahead of the Arcades animation frame rate here still and I may yet find optimisations that fit within the scope. We have vertical scaling and sprite spikes to add yet so Im hoping i can find a few more optimisations to offset things when they are implemented also. In a scale frame update we are processing close to 42000 pixels in ram before using DMA to send to VRAM . Using a 41x16 (656 tile scale buffer) - single buffered for now due to its size in VRAM. So thats nearly 21k in tiles ! I had to re-organise ram a bit to support a buffer of that size for the stage. The scaling function is written in 68k assembly , with a little C code handling the Vertical interupt code ( so the game logic can actually run & DMA updates etc ) . The DMA routines are in assembly also and customised for large chunk size ( big blocks of tiles ) which suits the scaler. I had some race conditions to sort out where the cpu was faster than DMA (sending tiles from RAM to VRAM ) and in some cases where it wasn't so it had to be balanced. We may be able to add more detail into the top and bottom of the background yet but its low priority for now until all the other bits are in !! #SGDK #SegaMegadrive #Genesis #Parodius

Shannon Birt

25,803 Aufrufe • vor 9 Monaten

** Sega Genesis 3D Engine Update 8 ** Significant improvements all round as you can see and hear from the last update !! Foremost - A huge thanks to Toni Gálvez - Megastyle - BG. who has joined the project to create a bit of 16bit low poly magic. Toni's an Amiga fan but also crazy about game dev in general, he's worked on GBC, GBA, PC, MD, PSP, C64, CPC, MSX... and others. Gaming titles include War Times, Metal Gear, Rocketman, Tintin & Asterix to name a few. He's provided the great new ship model you see on screen - new striped buildings, all the backgrounds / palettes etc. There's a lot of models he's given me which need to be added, also he will be planning a lot of the level design. Very happy to have him help me turn this into something more than a tech demo as I have my hands tied pushing the MD as far as it can go haha - there is no cpu cycle to be spared. Also many thanks to my good friend CYBERDEOUS - Crouzet Laurent for the Music for this showing , I wanted to have the music load occurring so we have a realistic benchmark for performance and he was only too obliging. If you're into MD chiptunes check him out !! Since last update : New player model , substantially more detailed than the Arwing. Last update had a 23 triangle Arwing , this update has a 39 triangle custom model from Toni. We had several to choose from , others will be used for enemies . 3D Buffer size increased 25% to 256x160. This was quite tricky as I'm close to the DMA limit even with an extended vblank . Spent a few days thinking of how to do this as like anything retro every solution has a drawback, finally got a workable solution. It makes a big difference to have a bit more vertical height . Z Rotation added ( the screen tilting left to right ) , small hit to vertex transform on cpu thanks to look up tables doing the heavy lifting, saving 4 multiplies per vertex. Multiple speed ups in rendering code. Onscreen paths with no range checking used until Z is close enough to cause clipping , partial onscreen drawing pathes that need to check boundaries, quad rendering completely rewritten - was very very painfull to get right . I found out the hard way that things are great when they are not rotating in the Z axis haha . Partial buffer draw optimisations - which have helped with the massive dma load , sending up to a 20kb buffer in a single frame needs a lot of optimisation. Min / Max tile lines are analysed and only sent if dirtied , reducing most buffer swaps substantially. Still some issues to sort out , at times you can see the flicker near top of screen when frames are near full height . I need to optimise that a bit. Due to the onscreen buffer system a full Sprite background had to be implemented almost Neo Geo style. This flips the usual MD rendering system on its head as it uses both foreground and background layers for a foreground 3d plane and sprites for the background. This presents a few issues, one is to get a tilt effect on the background by using narrow sprites (16x32) we run out of sprites when trying to cover the screen. Thankfully the MD is not limited to 80 sprites, to fix this a 114 sprite multiplexor is used to draw the background, its completely made up of 16x32 sprites ! Why do things this way ? speed . Its the interleaved foreground/background layers that allow a double buffered ram system writing to write to vram using dma in a completely linear fashion - virtually no tile translation needed. The negative is you have no planes for the background, that's where the sprites come in . Thanks to H40 mode we still have a few sprites we can use for effects in the forground also . Thankfully we can implement a fairly good tilt still for the background using sprites, in future updates this will be able to move horizontally also and a bit of vertical movement. XGM1 music driver in use to simulate music cpu load, XGM2 unfortunately with the massive DMA needed to shift the 3d buffers would slow down at times rendering it unusable, XGM1 plays at full speed - albiet with a bit more of a cpu hit. Together with the sprite multiplexor and the music driver active theres a 10 % hit to cpu so I've had to play around with draw distances / object heights and other optimisations to offset that. Not to mention the larger buffer takes more cpu to fill also. Everything is placeholder so will be changed with proper stage design. We are averaging 20 FPS in the current video, I'll push for more as always !! Progress continues on my other projects , updates soon on those - retirement can't come quick enough . #SGDK #SegaGenesis #SegaMegadrive

Shannon Birt

35,267 Aufrufe • vor 3 Monaten

*** Mega Parodius Sega Megadrive Update *** Lately I've been having some fun seeing how far we can push the Parodius game engine . This is not arcade accurate - just for testing, decreased bullet timers and upped the bullet count to see what would happen re cpu usage when things are made a lot busier ! Maybe something like this could be insane mode in the options etc. Since last update we are a lot more optimised under the hood . The C based sprite engine, particularly visibility checking was speedup , overall 25 % faster. Then re-wrote the sprite engine completely in 68k assembly , 30% faster again. It took about 3 days and 1500 lines of assembly , thankfully the gains were worth it. All these gains will be back ported to S.O.T.A also as its using the same sprite engine. Usage is around 19% of cpu per frame with a full sprite load - 33 % cpu left in the busiest frame currently . Parodius is using a write the sprite list every frame type engine , so priority and meta-sprite objects can be handled with ease albiet its still a bit slower than static allocation sprite engines such as the one in lufthoheit but this is a bit easier to code for in the long run. All collision checks are been done , we are using a spatial grid system to get the collision checks done faster than a brute force approach . To get to maximum sprite count destruction is disabled in the video. We hit 80 sprites onscreen in this sequence , the sprite counter is one the Left side. We use about 16 sprites in the top hud and water line , about 21 for player attacks / missiles / shots / options . Up to 35 bullets + enemies . No lazer usage here as the Lazers use zero sprites thanks to the raster tricks , this video is all about the sprites ! Improved the water line when the Catboss is active , as he is Sprites + Forground we are doing some tile rotation tricks eg bit scrolling to give the impression of parrallax at that point . Vector Orbitex has updated the stage 1 music again and has made things even higher quality , hes mixed pcm and fm channels together to create higher quality orchestral hits for example . Pyron has started converting assets from stage 2/3 , some amazing work there . Hes well ahead of me at present which is a good thing. Still lots of incomplete animations missing logic etc , its slow going with RL getting in the way haha and 2 other projects !! Still its fun !! #SGDK #SegaMegadrive #SegaGenesis #Parodius

Shannon Birt

16,259 Aufrufe • vor 10 Monaten

** Mega Parodius Update ** The team have been busy over last couple of weeks , implementing more of the games engine. WIP since last update : White Bell power up ( this is the text attack ) Blue Bell power up ( full screen explosion ) Catboss & animating Trees Updated Lazers to work on the BGB layer ( Plane A updated to 64x64 tilemap ) . Pyron has been doing excellent work on Blue bell Explosion, Whitebell power up text gfx - the slogans are great !! Arcade quality tree animations have been added. Feeding me a lot of videos so we can replicate the arcade port more accurately. Vector Orbitex has updated the music to mark IV for stage 1 making it smaller yet again , he's also added the Orchestra Hit in , potentially more samples can be added back in now also as the song now is a miniscule 57 kb. I keep telling him its 2025 - not 1990 for rom sizes haha , a professional is always a professional though !! The Blue Bell power up uses the static large sprite class I made for SOTA where it supports unlimited amount of sprites per object and detects all the reverses / flips & uses the same tile pointers where it can and crunches it down into single sprite object. We use up to 40 sprites in the Explosion but only 147 tiles needed in vram thanks to clever use of mirroring. The Catboss is easily the hardest enemy in the level for a few reasons - we also had to free up Plane A so the boss could shift upwards onscreen, so lazer effects were shifted to Plane B. The bit that caused me the most issues was when he sits in the water line between the two islands. He is quite wide and also has overlapping palettes and animating parts , to do it solely with sprites would have lead to severe dropout at times. At the waterline we have to simulate 3 background planes and sprites at that point and we only have 2 background planes. Luckily the MD sprite engine is very flexible and we were able to recreate the arcade look at this point with some sprite trickery, the water-line is now sprites . So we use Plane A + sprites to recreate him and use a lot of plane animation to reduce the amount of sprites needed. For example the face, the tail the propeller are all plane A animations . I analysed the SNES/PCE versions and we use less sprites than those versions for him so that will help reduce the chance of sprite dropout when attacking. The Catboss is only about 1/2 done , all damage states, the onboard penguin factory, bullets from Cannons yet to added etc. He wraps around at the end of the vid as theres no destruction routine in for him yet . No extra enemies in at this stage , tackling the hard parts first etc. We took the arcade GFX for the Trees that sway around under the Catboss, all the animations are in. There were some DMA bandwidth issues originally I had to sort out as the Catboss has several animating parts + swaying Trees was leading to overload so after some load balancing it all is playing nicely !! We still have loads of stuff to add , collisions are not in - normal enemy waves etc but yeah a lot of future issues were sorting out just getting this far. So the team is very happy with the progress !! #SGDK #Parodius #SegaGenesis #SegaMegadrive #indiegame

Shannon Birt

19,640 Aufrufe • vor 1 Jahr