flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Test Area > 233

Author
Thread Post new topic Reply to topic
l4m2



Joined: 15 Jan 2015
Posts: 611

233


Code:
RE equ 1
        org 100h

        push $a000
        pop es
        mov ax$13
        int $10

        ; AX ubx&uby
        ; BX seed
        ; CX len
        ; DX dir&tmpb
        ; SP part
        ; BP tmp2
        ; SI BRUSH
        ; DI tmp1

        ubx equ al ;Fixed, can't change
        uby equ ah ;Fixed
        dir equ dl
        len equ cx
        tmp1 equ di
        tmp2 equ bp
        tmpb equ dh
        seed equ ebx
        seedL equ bx
        seedLL equ bl
        mov seed0x7ec80040
        mov dir0
        part equ sp
        if RE
          mov partseedL
        else
          xor partpart
        end if
        mov siBRUSH

LP1:    lodsw
        mov seedLax
        if RE
          mov lenpart
        else
          mov len64
          sub lenpart
        end if
        shl len5
LP2:    shl seed1
        jnc NC
        xor seed$04c11db7
        mov dirseedLL
NC:     and dir0x82
        jz  _00
        jpe _82
        js  _80
_02:    inc ax
        inc ax
_82:    dec al  ; ubx
        dec ah  ; uby
_00:    add ah2
_80:    dec ah
        and ax$7f7f
        cmp ah96
        jae skip
        mov tmp1part
        and tmp13
        mov tmpb, [color+tmp1]
        movzx tmp1uby
        imul tmp1320
        movzx tmp2ubx
        mov [es:tmp1+tmp2], tmpb
skip:   loop LP2
        if RE
          dec part
          jnz LP1
        else
          inc part
          cmp part64
          jl  LP1
        end if
        jmp $
BRUSH:
    dw  0x030A0x37BE0x2F9B0x072B0x0E3C0xF59B0x8A910x1B0B
    dw  0x0EBD0x93780xB83E0xB05A0x70B50x02800xD0B10x9CD2
    dw  0x20930x209C0x3D110x26D60xDF190x97F50x90A30xA347
    dw  0x8AF70x08590x29AD0xA32C0x7DFC0x0D7D0xD57A0x3051
    dw  0xD4310x542B0xB2420xB1140x8A960x29140xB0F10x532C
    dw  0x04130x0A090x3EBB0xE9160x18770xB8E20xAC720x80C7
    dw  0x52400x8D3C0x3EAF0xAD630x1E140xB23D0x238F0xC07B
    dw  0xAF9D0x312E0x96CE0x25A70x9E370x2C440x2BB90x2139
color:
    if RE
      db 0x43,0x00,0x06,0x42
    else
      db 0x43,0x42,0x06,0x00
    end if



optimized from https://codegolf.stackexchange.com/a/127790/76323
Post 28 Dec 2017, 18:10
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15640
Location: Thasus

Yeah, the Mona Lisa thing is pretty cool for a "random" generator. Smile
Post 28 Dec 2017, 18:24
View user's profile Send private message Visit poster's website Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 611

Now cut to 225
Post 29 Dec 2017, 03:50
View user's profile Send private message Reply with quote
macgub



Joined: 11 Jan 2006
Posts: 201
Location: Poland

Nice Very Happy
I made a screenshot:
Image
Post 02 Jan 2018, 16:54
View user's profile Send private message Visit poster's website Reply with quote
l4m2



Joined: 15 Jan 2015
Posts: 611

My solution itself has screenshot
https://codegolf.stackexchange.com/a/152009/76323
Post 05 Jan 2018, 11:46
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2018, Tomasz Grysztar.
Powered by rwasa.