Author Topic: 256 intro commented source code released  (Read 22255 times)

nobody

  • Guest
256 intro commented source code released
« on: November 22, 2008, 08:32:16 AM »
Hi,

I have released the commented source code of my demo group's 256 byte intro on my blog. It features 3D rendering with depth shading, texture mapping and z-buffering of a moebius strip. Needless to say, it was done in NASM :)

http://bytethings.blogspot.com/2008/11/moebius-256-byte-intro-commented-source.html

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: 256 intro commented source code released
« Reply #1 on: November 27, 2008, 08:36:44 AM »
Hi Marcelo,

Pretty cool! But like Pirx's comment on your web site, I'm having some "issues". This is with FreeDos, not MSDOS...

If I don't run Nasm first, it hangs my machine! Screen goes black, then random "grey", then clears to black, and a single diagonal line appears. Reboot.

If I run Nasm first, I see your moebius strip. ("moebius" or "mobius"? - either, I think) This is the djgpp build of Nasm. It is known to leave the CPU in a subtly different state (their dos-extender, not Nasm's fault... I think). For one thing, the upper word of 32-bit regs (edx, at least, IIRC) has got "garbage" in 'em. For another thing, if you were in "flat real mode" before, you aren't any more - limit is set back to 0xFFFF. I don't see why this should have any impact on anything you're doing, but if I run Nasm first, it works. Doesn't have to assemble your file - just "nasm" and let it complain about "no input file" does it.

Hitting ESC causes it to crash, however. Just hangs hard... but if I reset to text mode before exiting (257 bytes - no good to you!), I see FreeDos complaining about corrupted MCB chain... (and a bit of the offending MCB, I think - includes "MOEBIUS"... the owner?).

If I assemble with the "-O" switch to Nasm ("cheating" to you demo-scene guys, I suppose), Nasm optimizes "add ax, 64" (at "._32:") - doesn't gain you anything, what you win on the operand, you lose on the opcode - helps in 32-bit code - to "add ax, byte 64". Since "._32 + 1" is used as a constant elsewhere in the code, it screws up your texture. Gives kind of a "moire" effect. Might be "interesting" with a different palette(?). (Oh, and ESC doesn't work if I do this!???)

I'll try to reboot to dos again soon, and play with this some more. Some of the "side effects" are almost more interesting than the intended effect. :) Thank you!

Best,
Frank