BCP: a BBC Micro printed circuit design program

Got a programming project in mind? Tell everyone about it!
julie_m
Posts: 68
Joined: Wed Jul 24, 2019 8:53 pm
Location: Derby, UK
Contact:

Re: BCP: a BBC Micro printed circuit design program

Post by julie_m » Sat Nov 02, 2019 10:22 pm

BAD NEWS: The graphics library has overflowed the initial estimate of 2kB -- which is also the practical limit of the associated BASIC source code, if building on a Model B (for which there is still some hope).
GOOD NEWS: I can separate out all the maths stuff from the drawing stuff, and in so doing I'll be able to apply a trick I have spotted to condense down some similar code. This will give me a separate maths library to build, and another variable dump to import; but at least nothing in the maths library is likely to change for awhile now. I can even offload some code to there that I had in the database manager.

Also, my workspace registers are a bit of a mess, so I will rearrange them so all the co-ordinate pairs are together and all the base addresses are together.

So then, there is going to be the £64000 question: Will it ever build again?

cmorley
Posts: 1008
Joined: Sat Jul 30, 2016 7:11 pm
Location: Oxford
Contact:

Re: BCP: a BBC Micro printed circuit design program

Post by cmorley » Sun Nov 03, 2019 7:09 am

Are you already putting the code through a BASIC cruncher? JGH wrote (at least?) one (google mdfs crunch). There are plenty of tips for reducing BASIC code size too - have you been targetting this aggressively already? e.g. every new line costs a CR and two(!) bytes for line number IIRC so : is a clear winner. There are many other tips about whitespace and unnecessary ( etc.

I don't do this while I am developing though only as a pass at the end to optimise the BASIC because it obfuscates everything. I just develop on something with more memory (Master/B with shadow/B with OS RAM 8) ) then optimise & crunch for a B.

julie_m
Posts: 68
Joined: Wed Jul 24, 2019 8:53 pm
Location: Derby, UK
Contact:

Re: BCP: a BBC Micro printed circuit design program

Post by julie_m » Mon Nov 04, 2019 2:45 pm

The BASIC isn't the real limitation here; rather, it's the object code that's overgrown the (arbitrary) initial allotted size.

I'm going to separate out all the "mathsy" bits (which mostly are in the graphics library, because that was where I started writing; but there is some code in with the database management that's arguably more mathematics than database) into their own library.

This will mean less space for the test program; but that just means I will have to rewrite more of it from BASIC to assembler.

The code is up there so if there's something really obvious I could have done with to shrink it, I'm all ears .....

julie_m
Posts: 68
Joined: Wed Jul 24, 2019 8:53 pm
Location: Derby, UK
Contact:

Re: BCP: a BBC Micro printed circuit design program

Post by julie_m » Wed Nov 06, 2019 11:36 pm

julie_m wrote:
Sat Nov 02, 2019 10:22 pm
So then, there is going to be the £64000 question: Will it ever build again?
Answer: It builds, but I have introduced a bug into the rotation code while I was working on separating the graphics and maths libraries. Y co-ordinates are coming through wrong -- everything is squished onto the centre line running across the component.

Oh, well, at least I know where to look now .....

EDIT: Found it ..... What a tart! :oops:

EDIT 2: And it's fixed. Behaving exactly as it used to, only a bit more versatile, hopefully. Remember, kids: Unit testing is important .....

julie_m
Posts: 68
Joined: Wed Jul 24, 2019 8:53 pm
Location: Derby, UK
Contact:

Re: BCP: a BBC Micro printed circuit design program

Post by julie_m » Sat Nov 09, 2019 7:59 pm

It's now able to save the points along a route!
bcp_50_saving_routes.png
bcp_50_saving_routes.png (4.01 KiB) Viewed 71 times
This is after making the connections shown on the screen.
bcp_50_restoring_routes.png
bcp_50_restoring_routes.png (4.9 KiB) Viewed 71 times
And this is after changing screen MODE to prove there is no cheating, and retrieving (some of) the points stored earlier. (The beginning of the command is missing, unfortunately; I didn't make the text window big enough. Or I'll make ) Note we are using PLOT 5, as opposed to PLOT 14 and PLOT 6 when we were creating the routes.

I'll put the code so far up on my GitHub sometime soon.

Post Reply