Skip to content

Commit

Permalink
Improve UI
Browse files Browse the repository at this point in the history
  • Loading branch information
rmsk2 committed Dec 24, 2022
1 parent 25d4b88 commit 44f6fce
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ your machine. Under Linux the makefile should run without changes as long as ACM

![](/result.png?raw=true "Example picture in hires mode")

# Using the program

When you start the program you can select whether you want to start with the current

# Zooming into the Mandelbrot set

The calculation can be interrupted at any time by pressing a key and resumed by again by pressing `RETURN`.
Expand All @@ -38,7 +42,7 @@ select the new section:
The cursor keys can be used to move a rectangular frame of reversed pixels over the visualization. The frame
represents the currently selected new section. `F1` and `F3` can be used to change the size of that frame.
Pressing return starts the calculation of the selected subsection. If the caclulation has finished you can
also select a new subsection after pressing `F5`. Pressing any other key ends the program.
also select a new subsection after pressing `F5`. Pressing any other key ends the program.

Zooming in essence halves the stepping width in X and Y direction and increases the so called zoom level by one.
As this software uses fixed point arithmetic this results in a loss of accuracy which at a certain point can
Expand All @@ -51,9 +55,7 @@ visibly. Here an example of this effect at zoom level 12 and iteration depth 64.

# Limitations at the moment

- No possibility to save the caclulated picture. As a primitive workaround all the parameters needed to recreate
the last picture are printed to the screen when the program shuts down.
- No possibilty to view a saved picture
- Loading and saving pictures only work with a mounted SD-card image. I am at the moment not sure if I can do anything about that.
- As I do not have access to real hardware and therefore have to use the X16 emulator it is not 100% sure that the program
performs in the same way on a real machine
- I have not yet tested whether my fixed point math routines are actually faster than the floating point routines
Expand Down
8 changes: 4 additions & 4 deletions disk_io.a
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ readErrorChannel

; open 15,DEVICE_NUM,15
+openChannelNoFileName 15, DEVICE_NUM, 15
bcs .checkError ; open failed
bcs .handleOpenError ; open failed

ldx #15
jsr CHKIN ; use file 15 as input
Expand All @@ -89,15 +89,15 @@ readErrorChannel
.close
lda #15
jsr CLOSE ; close file 15
.endWithoutClose
;.endWithoutClose
jsr CLRCHN ; restore default input and output channels

rts
.checkError
.handleOpenError
; room for additional error handling
lda #DISK_IO_ERR
sta DISK_ERROR
jmp .endWithoutClose
jmp .close ; Even if open failed we have to close the channel


; --------------------------------------------------
Expand Down
14 changes: 14 additions & 0 deletions main.a
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,12 @@ selectIterationDepth
!tx "LOADING ..."
!byte 13

.TXT_SAVING
!byte 11
!tx "SAVING ..."
!byte 13


ALLOWED_FILE_CHARS
!byte 37
!tx "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789."
Expand All @@ -467,6 +473,7 @@ savePicture
pla
cmp #0
beq .noSave ; do nothing if user entered an empty string
+printStr .TXT_SAVING
jsr saveHiresDataToDisk ; save data from banked RAM to disk
rts

Expand All @@ -493,6 +500,7 @@ loadPicture
rts

.noLoad
lda #DISK_IO_ERR
rts

.TXT_SELECT
Expand Down Expand Up @@ -526,6 +534,9 @@ progStart
jsr loadPicture
cmp #DISK_IO_OK
beq .doShowAfterLoad ; do nothing if load failed
jsr readAndEvalErrorChannel ; read error channel
+printStr ERR_BYTE_COUNTER ; print error message
jsr printCRLF
rts
.doShowAfterLoad
jsr bitMapOn ; This also clears Video RAM
Expand Down Expand Up @@ -574,6 +585,9 @@ progStart
cmp #KEY_DO_SAVE
bne .infoOnly
jsr savePicture ; save picture if user pressed F7. No error check. The routine generates error messages
jsr readAndEvalErrorChannel ; read error channel
+printStr ERR_BYTE_COUNTER ; print error message
jsr printCRLF
.infoOnly
jsr .printLastValues ; print info about values used for calculation
.endMandel
Expand Down

0 comments on commit 44f6fce

Please sign in to comment.