diff --git a/README.md b/README.md index 6f37940..5a6209b 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ LOOP TAY BNE LOOP ``` -This is a small program which lets the accumulator grow quadratically while X decreases linearly: +This is a small program which lets the accumulator grow exponentially while X decreases linearly: ![A at PC 0x6012](doc/example03_1.gif?raw=true) ![X at PC 0x6015](doc/example03_2.gif?raw=true) diff --git a/champ.rb b/champ.rb index adf9933..58eb531 100755 --- a/champ.rb +++ b/champ.rb @@ -424,7 +424,7 @@ class Champ x = (x * canvas_width) / 255 + canvas_left normalized_value = (value.to_f / histogram_x_max * 31).to_i (0..normalized_value).each do |dy| - pixels[(canvas_top - dy - 4) * width + x] = normalized_value + 0x40 + pixels[(canvas_top - dy - 4) * width + x] = normalized_value - dy + 0x40 end end end @@ -432,7 +432,7 @@ class Champ y = ((y ^ 0xff) * canvas_height) / 255 + canvas_top normalized_value = (value.to_f / histogram_y_max * 31).to_i (0..normalized_value).each do |dx| - pixels[y * width + canvas_left + canvas_width + dx + 4] |= normalized_value + 0x40 + pixels[y * width + canvas_left + canvas_width + dx + 4] |= normalized_value - dx + 0x40 end end diff --git a/doc/example01_1.gif b/doc/example01_1.gif index 1ce4913..9a53dff 100644 Binary files a/doc/example01_1.gif and b/doc/example01_1.gif differ diff --git a/doc/example01_2.gif b/doc/example01_2.gif index 0483aa4..b7b58dc 100644 Binary files a/doc/example01_2.gif and b/doc/example01_2.gif differ diff --git a/doc/example02_1.gif b/doc/example02_1.gif index 03a8dd5..83e7551 100644 Binary files a/doc/example02_1.gif and b/doc/example02_1.gif differ diff --git a/doc/example03_1.gif b/doc/example03_1.gif index f757dc9..47dba8b 100644 Binary files a/doc/example03_1.gif and b/doc/example03_1.gif differ diff --git a/doc/example03_2.gif b/doc/example03_2.gif index 0b1508a..1f94e8c 100644 Binary files a/doc/example03_2.gif and b/doc/example03_2.gif differ diff --git a/doc/example03_3.gif b/doc/example03_3.gif index 1f318b5..5973bd1 100644 Binary files a/doc/example03_3.gif and b/doc/example03_3.gif differ diff --git a/examples/example03.s b/examples/example03.s index ba58ff7..73f524b 100644 --- a/examples/example03.s +++ b/examples/example03.s @@ -16,6 +16,7 @@ LOOP TAY LSR STA FOO TYA + CLC ADC FOO ; @Au(post) DEX ; @Xu(post) @Au,FOO(post) BNE LOOP