Hello from Jaguar developer

Discussion in 'New Member Introduction Forum' started by VladR, Feb 27, 2018.

  1. VladR

    VladR Member

    Joined:
    Feb 27, 2018
    Messages:
    11
    Likes Received:
    21
    Hi guys,

    I just joined the forum, even though I've been lurking (without an account) for some time, every now&then.

    I'm mostly interested in eventual homebrew coding for Sega Saturn, as it's such a beautifully irresistable and insane architecture.

    I've been developing a flatshading 3D engine in assembler in past for Atari Jaguar's RISC GPU, so this is something I'd like to eventually try to port onto Saturn's RISCs, as I recently acquired my very own Saturn console.

    The ultimate goal (spanning few years for sure) would be for all cores to be 100% effectively utilized in parallel :)
    And hopefully without having to check into the mental institution after the fact :D

    Here's my latest progress on the Jaguar's GPU engine front:


    I've seen that there is some activity on Saturn coding here, so I'll go check it out.
     
    takeshi385, KGRAMR, stevo9389 and 6 others like this.
  2. DeChief

    DeChief Rustled.

    Joined:
    Jan 25, 2014
    Messages:
    1,704
    Likes Received:
    708
    That's running impressively fast for a Jaguar, wow, good job! I can't wait to see what you can do with the Saturn, welcome to the forums.
     
  3. VladR

    VladR Member

    Joined:
    Feb 27, 2018
    Messages:
    11
    Likes Received:
    21
    Glad you like it, as compared to the Saturn standard visuals, the flatshading looks very barren and simplistic :D
    Besides, it's just single-core at the moment (using just GPU) and the engine fits into 4 KB cache - so it's something that would translate well to Saturn's SH-2 cache.
    Personally, I'm a huge fan of flatshading, as it's such a clean look and ages well (compared to early pixelated texturing).

    For me, Saturn represents the pedestal of technological challenge in pre-shader software rasterizing with all its cores and HW support for rasterizing. It's like Jaguar on steroids, just with great graphics libraries and amazing dev environment.

    Given that Saturn has working compilers from C to SH-2, probably nobody really tries hand-written SH2 assembler (understandably). If the C->RISC compiler worked on jag, I wouldn't spend a year optimizing the RISC engine. But then it wouldn't fit into 4 KB, like it does now, which would result in major performance drop (as it would have to be split into chunks, that severely impact framerate).
    So, in a way, it's good that the environment on jag sucks, as you're pushed to limits :)

    I'm however really curious about what kind of performance one could extract from Saturn, if you combined all cores in a craaazy hybrid engine, in a handwritten assembler :) :
    - HW rasterizing via VDP1
    - SW rasterizing via both SH-2 + DSP + Motorola

    I don't have any concrete numbers of course right now, but given my benchmarks on the polygonal throughput of the 26 MHz GPU on jag, the two SH-2 would roughly provide double the polycount, the DSP should provide about 50% and Motorola could also do perhaps additional 20%.
    And that's on top of what the VDP1 can rasterize. Granted, we need to do the transformation on SH-2 for VDP1, but that's usually minor cost.

    Now, imagine we'd halve the framerate from 60 to 30 fps. That's ~2x of the above.
    And some game genres (where camera doesn't move like crazy - like top-down 3D RPGs - e.g. Dungeon Siege/Diablo3) work well even in 15 fps. So, that's again, ~2x of all of the above.

    Of course, who really knows how the system bus behaves when all chips try to access it, but still - that should result in some pretty insane high polycount regardless :)
     
  4. DeChief

    DeChief Rustled.

    Joined:
    Jan 25, 2014
    Messages:
    1,704
    Likes Received:
    708
    So you're telling me... your Saturn is going to run Crysis? :p :p
     
  5. VladR

    VladR Member

    Joined:
    Feb 27, 2018
    Messages:
    11
    Likes Received:
    21
    Nah, Crysis is too many complex shaders :)

    But Diablo3 environment complexity is certainly possible (characters would have to be sprites, though).

    Another genre that doesn't necessarily need textured meshes (but would benefit from more polys) is space sims, and partially futuristic racers.
     
    DeChief likes this.
  6. dgrubb

    dgrubb Member

    Joined:
    Mar 11, 2018
    Messages:
    9
    Likes Received:
    11
    I I think I've seen this video posted on one of the Jaguar Facebook groups recently, great work! I'm also pretty enamoured with the Jaguar and Saturn for much the same reasons: quirky interesting architectures that reward creativity.
     
  7. ASSEMbler

    ASSEMbler Administrator Staff Member

    Joined:
    Mar 13, 2004
    Messages:
    19,394
    Likes Received:
    981
    Welcome to the site!
     
  8. jollyroger

    jollyroger Peppy Member

    Joined:
    Oct 18, 2008
    Messages:
    383
    Likes Received:
    213
    More "insane" developers interested in working on the Saturn? Excellent :)
    You would be surprised to see the extent to which people tried to optimize games for Saturn, even with absurd time constraints. At the time of introduction, a fair amount of developers were still coding entire games in assembler. Most decent Saturn games have at least the time critical subroutines hand written in assembler, especially due to the very poor code optimization capabilities of C compilers of the time. Now that compilers have come a long, long way, there is less of a need to go those lengths, but there is plenty of scope for hand tuned code on the Saturn (and other consoles of course).
    You will find the bus architecture to result challenging for pure software rendering, as lots of concurrent access slows the chipset down. Additionally, as you probably know, the two SH2 share the same memory interface, therefore to use them effectlvely, both code and data have to fit into the caches (which can also be configured as scratchpad memory, in a similar fashion to the PS1/PS2 scratchpad RAM) as much as possible, and careful planning is required to access the memory bus.
    Welcome :)
     
    VladR likes this.
  9. VladR

    VladR Member

    Joined:
    Feb 27, 2018
    Messages:
    11
    Likes Received:
    21
    I should probably create an FB account and go check those FB groups again. I'm currently in the final stages of porting my 3D engine to 6502, and boy those 1.79 MHz, really make you work hard :D
    There's no such cool and rewarding technology anymore. These are the last pre-shader consoles, and there will never be any others...
     
  10. VladR

    VladR Member

    Joined:
    Feb 27, 2018
    Messages:
    11
    Likes Received:
    21
    There really isn't anything else quite like it :)
    Now, I may be slightly skewed towards assembler, because as a kid I learnt to code in hexa on Atari (a necessity, due to RAM consumption of the source code on a system with a 600 baud tape). However, you do not get that feeling anywhere else, when you spend a weekend optimizing and get 40% higher framerate. Hell, I did full-HD normal-mapped&postprocessed renderer on X360 at 30 fps, when everyone said, it's impossible, but it's just not the same thing as these 32-bit machines.

    That's a new information to me. From what I read I was under impression all Saturn games were coded in C, and given the state of dev environment, I see no reason otherwise, unless one feels compelled to squeeze the HW for more cycles.

    Yeah, that's a never-ending route. Every single time I squeeze 5% more of a time-critical routine, I come up with 2 more ideas. It just never ends ! At that rate, the code will finish before it even hit the pipeline!

    I don't really mean pure SW rasterizing. I mean a hybrid, where whatever polycount the HW can provide, the SH2's will continue crunching some additional polygons into the framebuffer. Sorting this will be a b*tch, but that's where the fun is :)
    Also, I heard soooo many stories about jaguar's HW capabilities, and when I finally started working with GPU, none of them turned out to be true in the end.

    But, you bring an extremely valid point of the shared resource and that's basically a constraint in virtually every HW.

    Nothing beats the hands-on experience in the end :)
     
  11. Arcadia

    Arcadia Spirited Member

    Joined:
    Aug 24, 2016
    Messages:
    179
    Likes Received:
    86
    Welcome! As an amateur with very limited technical knowhow, I'm also intrigued by the Saturn and the Jaguar with their complex hardware, and love to see stuff from people who really pushes the limits of those consoles.
     
  12. jollyroger

    jollyroger Peppy Member

    Joined:
    Oct 18, 2008
    Messages:
    383
    Likes Received:
    213
    I worked on a Saturn engine, and saw code from multiple Saturn games, and people (in some cases) did what they could to get reasonable performance. By all means the bulk of the code for an average game would be in C, but good games (the ones with semi-reasonable deadlines and competent developers) had large portions written in assembler. I saw at least one engine that had the entire game logic running as time-sharing state machine using coroutines written in assembler running on both SH-2.

    I too learnt to code in machine language on a C64. Over the years I met (and still know) quite a few people who pulled off crazy feats (and not always necessarily graphics/effects-related) on machines where people else thought it would be impossible, and I even did that myself a few times on systems like Amiga, Gameboy Advance, PS1, PS2, PS3, Saturn; it is undeniably very satisfying, even more so when the hardware is very limited to start with, e.g. 16 bit systems and before...

    Accessing the framebuffer directly from the SH-2 is amazingly slow, the few games that do that for effects like mirrors, transparency, etc. pretty much invariably write everything in high-RAM and then use DMA to transfer to the framebuffer, so that the bus contention is somewhat lower.
    Resources constraints are always present in some form, but the memory bus contention between the two SH-2 in the Saturn is quite unique to this machine.

    The Saturn is a truly fascinating machine in my humble opinion, as it has immense flexibility and therefore there are a thousand different ways to accomplish a goal. This also made it very painful to quickly obtain good results, and thus the large discrepancy between games that were designed with the architecture in mind (and the time to exploit it) and the ones that were brutal ports of PS1 titles or just quickly and poorly written...

    Fun times :)
     
    VladR and dgrubb like this.
  13. VladR

    VladR Member

    Joined:
    Feb 27, 2018
    Messages:
    11
    Likes Received:
    21
    I don't think I would go as far as writing game routines in Asm. While on 1.79 MHz 6502 it's a necessity, given the number of available processors on Saturn, I'm more than happy to delegate the less performance-critical functionality to a C language.
    That being said, things like A* algorithm and similar, are still probably best if either written in Asm or spread over multiple frames (in which case, the C becomes indispensable in debugging the whole damn thing).

    The direct framebuffer access is slow on Saturn ? I suspect that's because one's not really supposed to do so. Oh, well. But, DMA to the rescue...

    You bring another point that was a source of great amount of research on jaguar for me - thousand ways to do the same thing. While working on Road rash proto, I discovered several quite different ways how to do road texturing, with several more optimizations. Half of them merely presented themselves while I was in the middle of the work, so there was quite a lot of discovery - which for me is a primary motivator and a source of great satisfaction (the reinventing the wheel, so to speak). You start in the morning, and by the end of the day, you discovered a new way of doing some effect or feature, that you had no idea about in the morning in the first place :lol:
     
    dgrubb, Syclopse and jollyroger like this.
  14. VladR

    VladR Member

    Joined:
    Feb 27, 2018
    Messages:
    11
    Likes Received:
    21
    KGRAMR and jollyroger like this.
  15. KGRAMR

    KGRAMR Gaming aficionado raised by family & friends.

    Joined:
    Feb 24, 2017
    Messages:
    484
    Likes Received:
    191
    VladR! DUDE!!! Do you remember me? I'm KidGameR189664 from AtariAge! How's been going for you man :D ?
     
  16. KGRAMR

    KGRAMR Gaming aficionado raised by family & friends.

    Joined:
    Feb 24, 2017
    Messages:
    484
    Likes Received:
    191
    I have something in regards to a old post from Jaguar Sector II that i got from my mate philipj from AA so it will be cool once i re-dig it :)
     
  17. VladR

    VladR Member

    Joined:
    Feb 27, 2018
    Messages:
    11
    Likes Received:
    21
    Hey ! Yeah, working slowly on my 3D engine across many platforms. I'm almost done with the 6502 research&build (for Atari 800), but just now got hooked on the 8088 from the Konix, so jag will have to wait a bit :lol:

    I just have to find a way how to keep progressing across all platforms at the same time :lol:
     
  18. speedyink

    speedyink Site Supporter 2016

    Joined:
    Apr 10, 2015
    Messages:
    1,262
    Likes Received:
    508
    Very cool to see people still interested in developing for the older systems. I too find them very interesting, just because of how unique they were and how developers managed to squeeze things out of them previously thought impossible.
     

Share This Page