Code Monkey home page Code Monkey logo

hunter-adams-rp2040-demos's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hunter-adams-rp2040-demos's Issues

fix28 overflow

VGA_Graphics/Mandelbrot_Set/mandelbrot_fixvfloat.c

if ((Zre_sq + Zim_sq) >= FOURfix28) break ;

The fix28 values Zre_sq + Zim_sq can overflow, resulting in artifacts.
You can mitigate the problem a little by

    if ((unsigned)(Zre_sq + Zim_sq) > (unsigned)FOURfix28) break;

(or using fix27, but losing precision).
However some points remain for which the iterates will overflow.
Probably better to check for potential overflow before the escape check (affects only iterates outside the circle)

    if (Zre < -TWOfix28 || Zre > TWOfix28) break;
    if (Zim < -TWOfix28 || Zim > TWOfix28) break;

    if ((unsigned)(Zre_sq + Zim_sq) > (unsigned)FOURfix28) break;

In principle the rectangle check is an escape check, so it would also work (the rectangle contains the circle), but the contour lines outside the Mandelbrot set would look different.

Windows installation instruction.

I had to restart windows after some of the installation to get around an error when trying to run the command cmake -G "NMake Makefiles" .. It might have been Cmake or something that needed a restart after installation. Worth adding a restart step to the instructions. Thanks so much for making these instructions publicly available.

Hardfault on Serial Bootloader

I'm having a hard fault on the serial bootloader application.

Running the debugger, it seems to be OK with parsing the "bad checksum" data that the Python program sends initially. But as soon as it starts sending real data from the bootloader_blinky hex file, it goes into hard fault.

I've traced it down to the "transformLine" function, and there is something that it doesn't like about this code, but I don't know why:
for (i=0; i<(char_count>>1); i++) {
// Get the top nibble (careful of ASCII offsets)
if (buffer[i<<1] < 'A') top = buffer[i<<1] - '0' ;
else top = buffer[i<<1] - 'A' + 10 ;
// Get the bottom nibble (careful of ASCII offsets)
if (buffer[(i<<1)+1] < 'A') bottom = buffer[(i<<1)+1] - '0' ;
else bottom = buffer[(i<<1)+1] - 'A' + 10 ;
// Mask the two nibbles into a byte
buffer[i] = (top<<4) | bottom ;

I will keep digging.

How do I change the effective resolution to 320x240?

This code is almost exactly what I need for a project I am working on. Thanks!

However, I don't want to drive 640x480. Instead, I would like an effective resolution of 320x240. Of course, the actual VGA timing can stay at 640x480, I just need to draw "fat pixels" (x2 on X/Y).

I have tried reducing the buffer by 1/4, changing the timing, etc. but nothing seems to work.

For example:

#define RGB_ACTIVE 159    // (horizontal active)/2 - 1

...

pull block 					; Pull from FIFO to OSR (only once)
mov y, osr 					; Copy value from OSR to y scratch register

.wrap_target
set pins, 0 				; Zero RGB pins in blanking
mov x, y 					; Initialize counter variable

wait 1 irq 1 [3]			; Wait for vsync active mode (starts 5 cycles after execution)

colorout:
pull block				; Pull color value
out pins, 3	[2]			; Push out to pins (first pixel)
out pins, 3	[1]			; Push out to pins (next pixel)
jmp x-- colorout		; Stay here thru horizontal active mode

.wrap

Then, I try drawing a white rect and it only fills 1/4 of the screen. I would expect it to be full screen.

fillRect(0, 0, 319, 239, WHITE);

Drawing a single pixel is obviously still a 640x480 pixel.

What am I doing wrong?

Thanks!

-2 belongs to the Mandelbrot set

Thanks for the nice lectures!

Your escape check in
VGA_Graphics/Mandelbrot_Set/mandelbrot_fixvfloat.c
should be |z|^2 > 4, and not


if ((Zre_sq + Zim_sq) >= FOURfix28) break ;

The parameter c=-2 belongs to the Mandelbrot set. For this parameter the critical point is pre-periodic (0 -> -2 -> 2 -> 2 -> ...), so it is bounded and the corresponding Julia set is connected (it is the interval [-2,2] on the real axis).
If the orbit gets outside of radius 2, you can show that it escapes to infinity, i.e. that the parameter is not in the Mandelbrot set.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.