![]() But when I execute the example, not much happens, because the program writes directly to the screen RAM. iOS with C64 BASIC and Mandelbrot Setįor the Mandelbrot Set example, I used my C64-BASIC-iOS-emu6502-cbm example. ![]() POKE 1024+COUNT,160 sets a filled character on the screen and the Color RAM starts from memory location 55296 (0xD800). The blog post explains what it is about the 4. If the result is greater than 4, the point is outside the Mandelbrot Set. Within a loop with the REPS, the calculation is performed. The 300+ lines are responsible for the calculation. Within two loops for width and height, each point is calculated and displayed. The lines 100 to 120 define the parameters: The original code example looks like this: 90 REM **TO CHANGE THE SHAPE, CHANGE**ģ70 : IF (RZ*RZ + IZ*IZ)>4 THEN ISMND=0:K=REPS This blog post also explains in detail how complex numbers and the Mandelbrot Set work. But in this case, there is no example of Stack Overflow, but the internet is big: How to simply create the Mandelbrot Set on the Commodore 64. Unlike in the past when you typed code from a magazine - really - today you copy something from Stack Overflow. Is anyone else here, or did I lose you watching the video? Cause now I need code with a Mandelbrot Set calculation example. Have a look at the video - the whole thing is preferable. That’s why I don’t want to start explaining the principle here and deal with complex numbers and imaginary numbers, that have nothing to do with any conspiracy theory (at least I don’t know any). At about 10 minutes and 30 seconds he talks about Mandelbrot Set and how the idea behind it works. I had the idea for the Mandelbrot Set recently when I watched The Art of Code from Dylan Beattie at the TNG Big TechDay. But how about calculating the Mandelbrot Set? Mandelbrot Set But I don’t want to try or implement that with the C64 BASIC. Maybe the factor calculation as I used it in the Lua example? The great thing there was that I called a Swift factor method within the Lua factor method. ![]() Which example should I use? A Hello World application is boring. But why not implement it in Swift or Objective-C? Mandelbrot Set example gyroscope and writes it to memory and the BASIC program reads it and performs some calculation. It would also be possible that iOS reads the value of the iPhone e.g. This makes it possible to call a BASIC program with parameters and read the result. The iOS application can read the result from memory, which the BASIC application writes to memory using POKE.A BASIC application which is waiting for user input could read a value with PEEK.But BASIC can read or write memory contents with the PEEK and POKE commands: Data transferĪ direct interface where I can call result = command(parameter) does not exist within the interpreters. ![]() ![]() On the other side, I don’t want to rewrite a bigger BASIC application into another programming language. But when I look at the code example for the Mandelbrot Set calculation, the code with two GOSUB calls is not intuitive the first time you read it. Although I don’t believe that someone unpacks his floppy disk or and has a miracle calculation that only runs on a C64. I already asked myself why I want to do this with Lua, but there might be some legacy C64 BASIC code that you want to integrate into iOS. An iOS application calls the BASIC code within Swift or Objective-C, passes a few values, the BASIC application is executed and returns the result. Now I want to integrate BASIC into iOS, like I did with Lua. But the screen RAM is not read, and the status is not taken into account whether the program is finished or not. But between the iOS app and the C64 interpreter only the data for the commands and the output is sent. The interpreter can execute BASIC commands and programs. In the blog post C64 BASIC on iOS I wrote how a C64 BASIC emulator can run as an application on an iPhone. The Mandelbrot Set is the set of complex numbers c for which the function fc(z) = z^2 + c does not diverge when iterated from z=0, i.e., for which the sequence fc(0), fc(fc(0)), etc., remains bounded in absolute value. ![]()
0 Comments
Leave a Reply. |