Page 1 of 1

New demo uploaded: Mandelbrot Assembly Demo

Posted: Sun Jan 17, 2021 2:02 pm
by gavinhaslehurst



Mandelbrot Assembly Demo




View File






Here is the Mandelbrot version of my Julia Set program, coded in assembly. Again, many thanks to the forum users here for their guidance, as well as the many YouTubers with their excellent tutorials on 6502 assembly language. It's a lot faster than the BASIC version, but nevertheless, benefits from being run in warp mode.

Now in colour, with thanks to: VERA Overview (8bitcoding.com)

NEW VERSION NOW WITH MOUSE CONTROLS! 

When the image has finished rendering, click the left mouse on the area of the screen you wish to zoom in to. 

To change the detail settings (cycle between Low, Med, High) click the right mouse button.  

Poke around in the old version...

Try copying and pasting the following groups of POKEs to explore further (not all at once, just each paragraph in turn!):

POKE $D6B,$19:POKE $D6A,$64:REM FX=6500

POKE $D6D,$13:POKE $D6C,$54:REM FY=4948

POKE $D6E,$00:POKE $D6F,$FF:REM FX=POS,FY=NEG

POKE $D7B,$00:POKE $D7A,$01:REM STEP=1

POKE $D7C,$FF:REM ITERATIONS=255

SYS2061

POKE $D6B,$0F:POKE $D6A,$A0:REM FX=4000

POKE $D6D,$00:POKE $D6C,$00:REM FY=0

POKE $D6E,$FF:POKE $D6F,$FF:REM FX=NEG,FY=NEG

POKE $D7B,$01:POKE $D7A,$F4:REM STEP=500

POKE $D7C,$FF:REM ITERATIONS=255

SYS2061

POKE $D6B,$0F:POKE $D6A,$878:REM FX=3960

POKE $D6D,$03:POKE $D6C,$E8:REM FY=1000

POKE $D6E,$FF:POKE $D6F,$FF:REM FX=NEG,FY=NEG

POKE $D7B,$00:POKE $D7A,$32:REM STEP=50

POKE $D7C,$FF:REM ITERATIONS=255

SYS2061

To use the POKES above in the web emulator, first click the X in the top right corner of the web emulator. Paste the POKES above that you want to use in to the text field to the left, replacing what's already in there, then click the Run button. 

Individual addresses that can be poked:

$D6A    30 75        .word 30000     ; FX

$D6C    A8 61        .word 25000     ; FY

$D6E    FF           .byte $ff  ; FX SIGN ff = negative

$D6F    FF           .byte $ff  ; FY SIGN ff = negative

$D7A    A8 61        .word 25000 ; STEP (lower=higher zoom)

$D7C    10           .byte $10 ; ITERATIONS 

Old poke codes for the colour PETSCII version:

step: POKE $0D3D e.g. 50 for a step of 0.05

(smaller number, higher zoom)

iterations: POKE $0D3F e.g. 30 iterations about right, higher = slower

start x: POKE $0D2F, normally 8 (for -0.8) - nicely centred at low zoom

start y: POKE $0D31, normally 12 (for -1.2) - again centred at low zoom

Old poke codes for the PETSCII version: 

step: POKE $0cff e.g. 50 for a step of 0.05

(smaller number, higher zoom)

iterations: POKE $0d01 e.g. 30 iterations about right, higher = slower

start x: POKE $0cf1, normally 8 (for -0.8) - nicely centred at low zoom

start y: POKE $0cf3, normally 12 (for -1.2) - again centred at low zoom

You Tube video of this in action:

Commander X16 - 6502 assembly demo - Mandelbrot set - YouTube

Commander X16 - Fractal Zoom Demo - 6502 Assembly - YouTube

 

widemand.jpg