Title   : BeeBrowser Reflection               .------------------.
Date    : 27th April 2025                     |.----------------.|
Author  : Vela025                             || LDX#0          ||
Category: Old Tech                            || .HelloWorld    ||
                                             || STA hello,X    ||
This wasn't the post I had planned for today, || CMP #0         ||
but that one is stuck on the Amstrad NC100 so || BEQ DoneHello  ||
will have to wait until next week. Instead I  ||________________||
thought I'd tell you briefly about the Web    |-[CUB]---------[]-|
browser I've been working on for the  BBC     '------------------'
Micro in 6502 assembly and then my reflections on the project.

On the BBC Micro page you'll find info about my other two 6502
assembly projects (a simple BBS dialler and a simple html scraper).
Both of these make use of TcpSer (the go4retro fork) which has the
ability to start telnet sessions with remote URLs.

   | ATDTwww.google.com:80
   | CONNECTED 9600

This makes it possible to resolve GET requests and then attempt to
parse the HTML page. There is a tool to already render HTML pages
from local storage by Sprow (WeBBC), but I wanted to have an actual
web browser, complete with hyperlinks and the ability to search.

As with my other two projects I used BeebASM to compile my assembly
(as the BBCs 6502 syntax has a few quirks, note the labelling of
HelloWorld in the ASCII art header), as my text editor I used Kate
(being a KDE boy; I used to be Gnome all the way up until Gnome 3).
Kate has a nice Asm6502 option to make it all nice and colourful
and a nice dark mode.

The browser relies heavily on the HTML scraper from my previous
project, but now has the ability to understand HTML tags. I flip-
flopped between Mode 7 (7 colour teletext mode), Mode 1 (4 colour
traditional 40 column text and graphics mode) and Mode 0 (2
colour 80 column mode). Eventually I opted for Mode 7 it has the
highest amount of free memory (although this proved not to be a
problem) and has a nice font and colour balance.

To parse the HTML I used a memory table to store the different
tags I intended to support and then stored each tag when an < was
encountered coming in over serial until the tag ended with >.

Some tags like <a href="...,<img src="... and <input are handled
differently with the program instead searching through the string
and then looking for matches. So for example the <input tag looks
for name=" and then from there can work out how to construct the
query URL with /?x=with x being whatever it found in name= (which
is 99% likely to be q...but you never know!).

Well that's an overview of the the program itself (there will be
be a detailed write up in the Beeb section from the main page)
now on to the reflection.

I started the project when my days were confined to either being
out the house and working or living in one room watching over
our cat who had been incredibly ill and after some very expensive
vet appointments it had transpired his body was killing all his
red blood cells before they were released and he had used up all
his white blood cells fighting an infection. We needed to keep him
going long enough for the steroids to kick in to fix the problem
(~10 days)...oh and stop him ripping out his feeding tube at all
hours. So my head space wasn't great at the time, however it did
give my mind a lot of problem solving to do which was a welcome
distraction.

I find assembly both infuriating and cathartic, I like its
simplicity but equally get very frustrated trying to do the
simplest of things...in this project I had constant battles with
JSR/RTS and finding the correct OS call to check the serial buffer
and clear the serial buffer. Which results in obsessing over how
to do something, spending hours trying to figure it out and then
needing to walk away and try again with fresh eyes as I start to
make lots of silly mistakes.

So around 2 weeks off and on of coding went into the BeeBrowser
resulting in a 2k program that (via TcpSer) could dial a website,
form the GET request, load the page, list the hyperlinks, create
the new dial and GET request from said hyperlinks and conduct
searches.  But as with most my projects as soon as it was done I
gave up on it. The interface doesn't look great, I made no
documentation, I've not shared it with anyone I think it was just
something to do to fill the time.

Now out cat is doing so much better, and he and I have been
allowed out the nursing room working on BeeBrowser hasn't
interested me. I know that there's a bug with resolving local
links that aren't preceded with a / but I've not been motivated
enough to fix it. I don't feel that this project is unique in this
regard, I will often spend ages tinkering with something trying
to get it to work and when it does I lose interest, I wonder what
that's about? Like a constant hunt for perfection, but when I get
there I don't take the time to look back at the achievement, or
the journey instead I just think of what next...or worse lull
around for a bit and think how much time I wasted on something
that realistically I could have put in to self development.
Luckily it's has been the Easter holidays so I don't feel too
guilty about not spending much time on my studies; although
I do need to learn another ~20 Latin plant names by Thursday,
I made my flashcards today so that's half of the battle done.