Tuesday, August 25

Geek

Daily News Stuff 24 August 2020

Four Frierens And A Funeral Edition

Tech News

  • So I rewrote my VM testbench in Nim. With just a minimal framework in place - instruction decode, registers, memory, condition flags, and one instruction - I'm getting 80 MIPS. That's not amazing and I could certainly do better in C++ (and have in the past) but for these purposes it's just fine. The imaginary machine would be lucky to do 1 MIPS downhill with a tailwind, after all.

    Nim is nice enough. I like Crystal somewhat more, but Nim is reasonably well-designed and seems reasonably well-implemented. You don't seem to be able to use ternary operators in compound expressions, though, so I'll have to figure out the proper way to evaluate the condition flags.

    I did realise something when thinking about Elite on the BBC Micro. Although the imaginary hardware will implement hardware scrolling and sprites (the TI 99/4 had 32 sprites all the way back in 1979), that only helps for 2d games. For 3d what you need - apart from hardware line-drawing - is double-buffering.

    And since I'm deliberately limiting the available memory to keep the system conceptually simple, it doesn't have enough memory to double-buffer at full resolution (a whopping 480x270).

    The options as I see them are:

    • "Well, that game came out in 1985, when the 256k upgrade was available."
    • Weird cheats like the Apple IIgs fill mode to make 3d fast enough that you don't notice the flickering.
    • Weird cheats like RLL-encoding of the pixel data to reduce memory requirements, which would be horrible to draw into but very effective when there are only a few colours in use.
    • Weird cheats like chroma subsampling, which is period legitimate because both the Apple II and the ZX Spectrum did that. (The ZX Spectrum in a rather more organised way, colour in the Apple II's hi-res mode was just plain weird.) There are lots of ways to implement this, some of them easy to do in period hardware, most of them nasty to program for.
    • Just use half-resolution - 240x270 isn't completely awful, and it can switch to full-resolution for the controls at the bottom which don't need to be fully re-rendered every frame.
    • Drop the pixel clock from 12MHz to 8MHz, reducing the number of pixels per scan line to 320, and pack 5 4-bit pixels into each double-word read instead of 4 5-bit pixels, and finally letter-box it down to, um, oh, right, 256 lines. That's exactly 64k.
    • The (imaginary) video chip has dual buses, originally so that the CPU could write directly to video RAM as it would with any other RAM, just with wait states inserted until the VRAM was free. But vice-versa, that allows the video controller to map system RAM for video functions, stealing cycles from the CPU. Still, using 480x270 5-bit mode with double buffering like this would leave 736 bytes free for your 10-bit version of Elite, so it might need to be applied in combination with some other trick.

      (This is why I mentioned the video controller would have needed more than 40 pins if it had ever been made - two 10-bit data buses and two 8-bit multiplexed address buses is 36 pins before any control signals or even power and ground.)

    Given the nature of computers of that era it might be appropriate to implement all of these and never bother to test what happens if you set all the mode bits at once.


  • Every ten years, move everything that's done on the client to the server, and everything that's done on the server to the client, and everyone will think you're a genius. (Solovyov.net)

    Server-side rendering, huh? Whatever will they think of next?


  • We are continuing to work on a fix for this issue. (ZDNet)

    I felt a disturbance in the Force, as if millions of children suddenly cried out with joy.

    Zoom is down.


Disclaimer: Six months to bury a cat?

Posted by: Pixy Misa at 12:13 AM | No Comments | Add Comment | Trackbacks (Suck)
Post contains 662 words, total size 5 kb.




Apple pies are delicious. But never mind apple pies. What colour is a green orange?




47kb generated in CPU 0.11, elapsed 0.2518 seconds.
56 queries taking 0.1628 seconds, 264 records returned.
Powered by Minx 1.1.6c-pink.