Search found 802 matches

by dp11
Mon Jul 09, 2018 6:46 pm
Forum: emulators
Topic: Ceefax Engineering Test Page - BeebEm 4.13 & B-em
Replies: 67
Views: 10750

Re: Ceefax Engineering Test Page - BeebEm 4.13 & B-em

Clocksp adjust its run time so that very fast cpus don't finish so quickly you end up with a test taking zero time.
by dp11
Sun Jul 08, 2018 11:46 am
Forum: hardware
Topic: RGB to HDMI using a Pi Zero and a small CPLD
Replies: 186
Views: 6916

Re: RGB to HDMI using a Pi Zero and a small CPLD

If glitches do occur then a diode across R119 will speed up the rising edge. If the ls86 is socketed then replacing it with a 74hc86 could also work.
by dp11
Sat Jul 07, 2018 6:26 pm
Forum: hardware
Topic: RGB to HDMI using a Pi Zero and a small CPLD
Replies: 186
Views: 6916

Re: RGB to HDMI using a Pi Zero and a small CPLD

Simply take the video input and feed it through a potential divider. E. G. Video input via R1 to Cpld input. At the junction of of R1 and the cpld connect R2. The other end of R2 could just go to ground but could goto a dac.
by dp11
Sat Jul 07, 2018 5:24 pm
Forum: hardware
Topic: RGB to HDMI using a Pi Zero and a small CPLD
Replies: 186
Views: 6916

Re: RGB to HDMI using a Pi Zero and a small CPLD

You could move the sampling threshold voltage with two resistors. For a dac you can a pwm and and rc filter.
by dp11
Fri Jun 29, 2018 4:08 pm
Forum: off-topic
Topic: Using BBC BASIC to teach programming concepts in 2017
Replies: 82
Views: 2219

Re: Using BBC BASIC to teach programming concepts in 2017

There are a number of solutions

A P C
42 6 52
41 13 46
40 20 40
39 27 34
38 34 28
37 41 22
36 48 16
35 55 10
34 62 4

Notice how P changes by 7 each time and C changes by 6
by dp11
Mon Jun 04, 2018 10:42 pm
Forum: hardware
Topic: RGB to HDMI using a Pi Zero and a small CPLD
Replies: 186
Views: 6916

Re: RGB to HDMI using a Pi Zero and a small CPLD

An option would be to use the spare GPIO signals and TX RX Via Jumpers so that the CPLD can be insystem programmed
by dp11
Sun Jun 03, 2018 8:18 am
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

If I'm right this

Code: Select all

bit #1
    beq left_margin_even
    inc A
    
Can be replaced with

Code: Select all

   Inc a
   And #&fe
Saves a few bytes
by dp11
Sat Jun 02, 2018 8:17 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

The final txa in kernel isn't used in hline or vline (14000ish times) it is used in box (1751 times) so it might be worth in box after calculate_through_cache testing bit 7 of A is it is clear doing ASL A
by dp11
Sat Jun 02, 2018 6:10 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

just a bit of tidying up really in .box lda #&ff sta colourflag I think the lda can be removed before JSR hline there is this bit of code sec lda boxx2 sbc boxx1 sta sidecount This can be moved into hline. similar for vline. bne hline will need to be changed to bne hline_loop. I do wonder if hline c...
by dp11
Fri Jun 01, 2018 10:26 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

I was thinking just one kernel, but two setups. Mandel setup is the longest so that is one block followed by kernel. julia is assembled with a bra to kernel at the end of it. then just swap block over at the start.
by dp11
Fri Jun 01, 2018 8:57 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

I think

inc zp;5
lda zp;3

is the same as

lda zp;3
inc a;2
sta zp; 3

But does save code space which is good.
by dp11
Fri Jun 01, 2018 7:25 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

how much more space do you think we can get in ZP ?

Can we get recalculate_pixel at the beginning of kernel but make the beginning self modifying by copying two different code sets one for Julia and one for mandel at first call . saves an LDA, BNE and JMP
by dp11
Fri Jun 01, 2018 6:39 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

If I can count correctly that is 37px so over 1% gain.

In flood fill very minor but

Code: Select all

    lda screeny
    inc A
    sta screeny
can become

Code: Select all

    inc screeny
by dp11
Fri Jun 01, 2018 4:46 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

Just when we thought fixup was optimal. As all the important fixups are in ZP we can pull another trick macro fixup_a_zp { STA lowbyteoftable ; 3 cycles lowbyteoftable = *+1 LDA fixuptable;4 cycle } align &100 .fixuptable ;.... Fixup is now always 7 cycles and 5 bytes long, The and #&AA can move in ...
by dp11
Wed May 30, 2018 9:50 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

Can't give much but a better floodfill if nothing else it is smaller ; Fill the current box with corecolour, which is corrupted. .floodfill { ; Hacky temporary storage, reusing zr and zi in the kernel. boxx1i = zr+0 boxy1i = zr+1 boxx2i = zi+0 boxy2i = zi+1 ; Compute pixel colour. lda corecolour lsr...
by dp11
Wed May 30, 2018 8:30 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

can you page align the palette table such that when the palette table is read it is ldx absolute ; where the low byte of absolute is the iterations byte?
by dp11
Wed May 30, 2018 7:33 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

well I'm baffled why the palette change doesn't make any speed difference.
by dp11
Wed May 30, 2018 6:15 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

Could the palette table be extended so the and #7 isn't required before accessing the palette table ? Can .box be tweaked to: pla: sta boxy1 plx: stx boxx2 ; Recurse into bottom right. ldx boxx1: phx ;lda boxy1: ; A now already has boxy1 pha I think floodfill will now fit straight after .box and the...
by dp11
Wed May 30, 2018 2:00 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

Sorry, You are right, I miss read the code
by dp11
Wed May 30, 2018 1:23 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

I have some of those Branch cases lined up but your profile does confirm my ideas. Thanks.
by dp11
Wed May 30, 2018 1:06 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

Thanks Dave,

Looking at the output I think the numbers look a bit strange at places just before labels e.g &209E
by dp11
Tue May 29, 2018 10:02 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

we have broken Julia.
by dp11
Tue May 29, 2018 9:25 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

Sorry, my suggestions are only very small improvements.
by dp11
Tue May 29, 2018 8:54 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

is it worth making vline and hline macros ?

the clc in hline isn't needed.
by dp11
Tue May 29, 2018 8:49 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

From : lda iterations and #7 tax lda palette, X tax ; Plot colour A to the current pixel. sta temp ; Unshifted values refer to the *left* hand pixel, so odd pixels ; need adjusting. lda screenx ; Is this an even pixel? ror A ; odd/even bit to C lda #&55 ; a = pixel mask bcc plot_even_pixel lsr temp ...
by dp11
Tue May 29, 2018 8:30 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

Thanks for aligning the tables I'm slightly surprised it didn't make more of a difference . tiny change from : .recurse ; Start recursion. lda midx: pha lda midy: pha ; Calculate centre point. clc lda boxx1 adc boxx2 ; produces 9-bit result in C:A ror A ; 9-bit right shift sta midx cmp boxx1 beq box...
by dp11
Tue May 29, 2018 5:47 pm
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

I don't think the tax before bpl dont_calculate is needed, just move the txa to before .dont_calculate
by dp11
Tue May 29, 2018 8:02 am
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

is it worth working out if the fill is going to plot both the odd and even pixels if so doing them together?
by dp11
Tue May 29, 2018 6:36 am
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

Some other things that might help

Not calling osbyte to check for keypress so often.

Making calculate_address a macro

Possibly putting the common sub expression before vline and hline into vline and hline to save code space.
by dp11
Tue May 29, 2018 4:00 am
Forum: programming
Topic: 12-second Mandelbrot rendering on the BBC Master!
Replies: 107
Views: 2887

Re: 12-second Mandelbrot rendering on the BBC Master!

I've noticed some good improvements committed to github. Excellent work. It might be worth trying aligning the lookup tables to page boundaries again. They just might be out of the noise now.