
A texture-mapped raycaster in 128 bytes - RodgerTheGreat
http://www.pouet.net/prod.php?which=63518
======
3rd3

        ; Wolf128 by Baudsurfer/rsi 2014 aka olivier.poudade.free.fr
        ; A 128 bytes interactive intro tested on XPSP3 and DOSBox
        ; Presented at Outline demoparty in Eersel/The Netherlands
        ; 256 bytes versions : 
        ; http://www.pouet.net/prod.php?which=24755
        ; http://www.pouet.net/prod.php?which=3396
        ; P.S : click left mouse button to start moving in maze
        ; Greets to UkkO Ggn Fra Den and assembly language lovers 
          org 100h
          mov al,13h
          int 10h
          les dx,[bx]
        A:mov cl,0ffh
        B:mov bl,cl
          not bl
          lea ax,[di-10h]
          mov bp,140h
          cdq
          div bp
          call G
          call G
          test byte [1dh],7
          jz C
          add dh,[1fh]
          sub bl,[1eh]
          jmp short E
        C:mov dl,[fs:46ch]
          sub bl,[si]
          test dl,40h
          jnz D
          add dh,dl
        D:add bl,dl
        E:shld bp,bx,10
          sub dh,[bp]
          mov al,dh
          and dh,bl
          or dh,ah
          and dh,20h
          loopz B
          xor al,bl
          xor al,ah
          db 0d4h,10h
          add al,10h
          stosb
          or di,di
          jnz A
          mov ax,3
          int 33h
          test bl,al
          mov [1dh],bl
          jz F
          mov [1eh],dl
          mov [1fh],cl
        F:in ax,60h
          dec ax
          jnz B
        G:xchg ax,dx
          sub ax,64h
          imul ax,bx
          add ax,[si]
          ret

~~~
atesti
Does someone know what "mov dl,[fs:46ch]" does? In win32, fs and gs point to
some process or thread info blocks, but in DOS? I was never aware of anything
regarding the fs register and DOS unless a dos extender was run or pmode was
entered!

~~~
beagle3
If memory serves me right, fs=gs=0 in DOS mode, and 46C is a tick counter of
some sort.

And on a C64, addresses 53280 and 53281 change text background and border.
Don't know why I remember these things.

------
bshimmin
Something terrible and greatly upsetting seems to have happened in the
comments, but I can't for the life of me understand what.

~~~
patrickyeon
As CountHackulus says, basically "drama". If it amuses you for some reason,
you might want to check out "Jason Scott - You're Stealing It Wrong! 30 Years
of Inter-Pirate Battles" from Defcon 18.
[http://youtu.be/QCAL_YgYiP0](http://youtu.be/QCAL_YgYiP0) The meat of the
talk starts around 24min.

edit: while re-watching, I should warn you lots of foul language and some NSFW
imagery

~~~
anon4
For some reason the link to all the scene lingo is down now. Is there a
backup? Did it move? Do I need to be "in" something?

------
hexagonsun
Ah the Demoscene... This is the kind of stuff that got me interested in
programming in the first place. :)

------
userbinator
The 1st place entry is apparently very similar, but trades interactivity for
_sound_ and rather more psychedelic colours:

[http://www.pouet.net/prod.php?which=63517](http://www.pouet.net/prod.php?which=63517)

~~~
egypturnash
Same author.

------
jakejake
These demos always amaze me. Can somebody enlighten me as far as the way the
size is measured - does it typically include all of the assets such as music
and textures? I was watching a few of the demos and it blows my mind that the
audio would even fit in that amount of space, let alone the visuals.

~~~
joshvm
Size includes everything. Usually the textures are procedural, but can be
seeded so they're the same every time. Music is usually pretty easy to encode
if it's a chiptune, loads of redundant data.

~~~
malnourish
bemmu

Hopefully you see this, unfortunately your comment is dead.

Because I think your comment has value I will quote it here, please let me
know if you'd like it removed.

"You can also have procedural music.

Viznut (a legendary Finnish democoder) did some experiments to see how short
you could code something that still sounds at least interesting:

[https://www.youtube.com/watch?v=GtQdIYUtAHg](https://www.youtube.com/watch?v=GtQdIYUtAHg)

I also wrote piece of JavaScript that can play these programs in case you want
to try create your own:
[http://www.bemmu.com/music/index.html](http://www.bemmu.com/music/index.html)
"

~~~
erikano
Thank you all, malnourish, bemmu and viznut -- now I understand how the 8bit
synth works in Caustic on my Android tablet. Furthermore, I want to make my
own music software on my Raspberry Pi and Adapteva Parallellas and this is the
first real step on the path to that.

~~~
bemmu
Make sure to watch some of the later videos too as viznut added some
visualizations as well:
[https://www.youtube.com/watch?v=tCRPUv8V22o](https://www.youtube.com/watch?v=tCRPUv8V22o)

~~~
erikano
Thanks for the link, very cool.

------
PhasmaFelis
Man, wouldn't it be awesome if we'd had the public internet instead of just
BBSes back when stuff like this was cutting-edge tech, instead of just a
clever hack? Imagine if, say, C64 devs and hackers could do this kind of
sharing instead of being limited to word-of-mouth.

------
leorocky
These kinds of ray casters are really cool, but at this point in time I don't
care about how small the code base is, just make a really cool ray caster in
JavaScript and don't worry about how big the code is (within reasonable
limits)! I just want an awesome JavaScript ray caster library to be honest. :)

~~~
leorocky
Looks like this comment of mine was irrevocably wrong and completely
irredeemable. No apology is possible and I'm sorry for my very existence. Go
social voting sites! Go internet culture! Yay.

~~~
bunderbunder
A harsh response, yes. But frankly, what you said was harsh. An interactive
raycaster in an executable an order of magnitude smaller than most networks'
minimum transmission unit is an incredible accomplishment, and your response
is to essentially drop trou and take a dump on it because teh w3b 4evaz.

~~~
leorocky
What I said wasn't harsh, it just wasn't apparently enough genuflection and
awe to appease the people that happened to be interested enough to check the
comments on this link. I care about as much as I did yesterday, which is not
nothing. You and everyone else who demands more will just have to deal with
it.

~~~
fl0wenol
No; if you don't appreciate something because you suspect you don't understand
or lack context (as you expressed), you should just keep your mouth shut lest
you sound like an idiot.

