The Quest for the Last Baked Bean

discuss classic text/graphic adventures for the bbc micro & electron
User avatar
lurkio
Posts: 2892
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: The Quest for the Last Baked Bean

Post by lurkio » Sun Jun 07, 2020 2:29 pm

lurkio wrote:
Sun Jun 07, 2020 1:25 pm
8bitAG wrote:
Sun Jun 07, 2020 12:19 pm
Can you load finished adventures back into the BBC Quill, by the way?
Not easily. I think you'd have to type it all in manually.
Correction: it seems you can load the database from a runnable game back into the Quill for editing -- you just have to hack the database out of the runnable game first.

I booted the runnable game in BeebEm, saved state, and then hacked out a contiguous block of memory locations from &2500 to &7BFF from the savestate file. I then saved the memory-block as a file on my dekstop, imported that file onto a .SSD disc-image, and loaded the file from the .SSD into the Quill editor. It seemed to work!

Here's the Quill editor program and the QFTLBBean game database file (filename BAKED) together on one .SSD disc-image. I haven't touched any of the game data or logic, so none of the bugs have been fixed yet:
  • [Attachment deleted. See update.]
:idea:

EDIT: I wonder if it matters which version of Quill the game was originally written in..?! Does it have to be the same version you edit it in?

:?:
Last edited by lurkio on Mon Jun 08, 2020 11:07 pm, edited 1 time in total.

User avatar
8bitAG
Posts: 100
Joined: Wed Nov 07, 2018 5:03 pm
Contact:

Re: The Quest for the Last Baked Bean

Post by 8bitAG » Sun Jun 07, 2020 3:16 pm

lurkio wrote:
Sun Jun 07, 2020 2:29 pm
EDIT: I wonder if it matters which version of Quill the game was originally written in..?! Does it have to be the same version you edit it in?
There would potentially be issues with memory if you were attempting to move from the disk version back to the tape one (which you're not).

There was a transfer program to amend the database when moving from tape to disc, wasn't there? So I guess a tape-based game has a slightly different database than a disk-based one.

I doubt there would be any major issues dumping the database directly into the newer disk version, although iirc the BBC version does do some internal tokenisation/compression of the text... so who knows...

User avatar
lurkio
Posts: 2892
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: The Quest for the Last Baked Bean

Post by lurkio » Mon Jun 08, 2020 1:25 am

8bitAG wrote:
Sun Jun 07, 2020 12:22 pm
*as an aside... the solution on CASA doesn't seem to work... doesn't navigate through the bush maze successfully?
Right. Instead of going "South x 6" as per the CASA solution, you actually have to go SOUTH four times and then W and SW. Then SET SAIL and follow the rest of the solution as given -- except that the solution has a couple of further (minor) errors, but they're easy to work around.

I managed to play the game all the way through, using the Test option in the Quill editor on the disc-image attached to my previous post. So it looks like the game database that I hacked out of the runnable game does work in the latest version (A03) of the Quill editor, which is good news.

:idea:

User avatar
8bitAG
Posts: 100
Joined: Wed Nov 07, 2018 5:03 pm
Contact:

Re: The Quest for the Last Baked Bean

Post by 8bitAG » Mon Jun 08, 2020 8:48 am

lurkio wrote:
Mon Jun 08, 2020 1:25 am
I managed to play the game all the way through, using the Test option in the Quill editor on the disc-image attached to my previous post. So it looks like the game database that I hacked out of the runnable game does work in the latest version (A03) of the Quill editor, which is good news.
Excellent work.

Despite, and maybe because of, its differences from the other versions of the Quill, the BBC Quill is a really interesting tool and does some clever things. I definitely want to write something with it at some point. It's just a little disappointing that you can't do anything with colour. I guess some clever coder could possibly trigger an external machine code routine with JSR that triggers a colour swap?

User avatar
lurkio
Posts: 2892
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: The Quest for the Last Baked Bean

Post by lurkio » Mon Jun 08, 2020 8:21 pm

8bitAG wrote:
Sun Jun 07, 2020 12:44 pm
... MES 98 should be MES 108.
Thank you. I've edited the game database and included that fix and the other fixes you suggested. All the reported bugs should now be fixed.

Here's the game on the Quill editor disc-image. The original buggy game database file is named BAKED. The edited bugfixed game database file is named BAKED2. The runnable bugfixed game file is named BAKEDG:
If you just want to run the game, then load the disc-image into an emulator -- but don't autoboot it -- and type *RUN BAKEDG at the BASIC prompt.

:idea:

EDIT: Oh, and here's a walkthrough which you can copy and paste into the emulator when the game is running. (Yes, the "RR" commands are necessary if you're pasting the whole thing in in one go!):

Code: Select all

S
S
S
GET WHISTLE
EXAMINE WHISTLE
GET JAR
NW
N
NW
ENTER HUT
POUR OIL
RR
GET KNIFE
SW
SE
E
E
E
CUT ROPE
GET STAFF
GET CORACLE
BLOW WHISTLE
RR
W
S
S
S
S
W
SW
SET SAIL
RR
DROP KNIFE
S
W
N
GET INCENSE
S
E
E
SW
USE STAFF
DROP STAFF
GET MAGNET
NE
SE
GET BOOTS
WEAR BOOTS
NW
S
S
DROP WHISTLE
DROP MAGNET
S
NE
U
RR
E
S
E
S
LIGHT INCENSE
RR
GET CASKET
GET STRING
D
RR
GET BOOTS
WEAR BOOTS
N
W
N
W
D
RR
SW
NW
W
PULL LEVER
E
WAIT
WAIT
WAIT
WAIT
CROSS PIT
RR
GET HAT
WEAR HAT
CROSS PIT
RR
SE
N
GET MAGNET
TIE MAGNET
GET KEY
DROP MAGNET
GET KEY
OPEN CASKET
RR
DROP CASKET
DROP KEY
GET SALT
S
S
THROW SALT
E
E
RR
W
W
GET BRUSH
E
N
NE
U
RR
E
E
NE
PRESS BUTTON
GET EGG
SW
W
W
D
RR
SW
S
E
E
GET ENVELOPE
GET PAINT
W
W
N
N
DROP HAT
N
N
E
E
N
READ SIGN
NE
N
GET HAMSTER
PAINT HAMSTER
DROP BRUSH
DROP POT
S
SW
S
W
W
S
S
GET WHISTLE
NE
E
S
PRESS BUTTON
N
W
SW
S
S
S
FEED CAT
SW
S
OPEN ENVELOPE
GET PAPER
DEVELOP PAPER
N
NE
SE
INPUT A1C0
ENTER DOOR
RR
E
GET BEAN
BLOW WHISTLE
RR
N
Last edited by lurkio on Tue Jun 09, 2020 12:47 am, edited 1 time in total.

User avatar
richardtoohey
Posts: 3986
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: The Quest for the Last Baked Bean

Post by richardtoohey » Tue Jun 09, 2020 12:14 am

8bitAG wrote:
Mon Jun 08, 2020 8:48 am
the BBC Quill is a really interesting tool and does some clever things. I definitely want to write something with it at some point. It's just a little disappointing that you can't do anything with colour. I guess some clever coder could possibly trigger an external machine code routine with JSR that triggers a colour swap?
I'm definitely not a clever coder, but wondering what you meant by this? What would be involved in trying to add this?

User avatar
lurkio
Posts: 2892
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: The Quest for the Last Baked Bean

Post by lurkio » Tue Jun 09, 2020 12:38 am

richardtoohey wrote:
Tue Jun 09, 2020 12:14 am
8bitAG wrote:
Mon Jun 08, 2020 8:48 am
I guess some clever coder could possibly trigger an external machine code routine with JSR that triggers a colour swap?
wondering what you meant by this? What would be involved in trying to add this?
BBC Quill provides the user with a JSR command which hands control over to a custom user-written machine-code routine.

Here's an example of using JSR to add speech to a Quilled game:
:idea:

EDIT: The trouble with using JSR to change the colour of the text is that on the Beeb The Quill runs in MODE7, and the interaction of Teletext colour codes and line wrapping can quickly turn into a headache!

It might be easier to hack Quill to run in MODE1 or even MODE6 (as it already does on the Elk) and then your JSR routine would, in effect, just be issuing VDU commands to redefine and switch text colours. But then in MODE1 and even in MODE6 the memory available for the game database would be reduced because so much RAM would be taken up by the bitmapped display.
Last edited by lurkio on Tue Jun 09, 2020 9:07 am, edited 8 times in total.

User avatar
richardtoohey
Posts: 3986
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: The Quest for the Last Baked Bean

Post by richardtoohey » Tue Jun 09, 2020 12:50 am

Thanks - and what is the "colour swap"?

Is this text colour changing or palette switching?

Sorry for the questions, just trying to understand what this is about. :D

User avatar
lurkio
Posts: 2892
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: The Quest for the Last Baked Bean

Post by lurkio » Tue Jun 09, 2020 12:54 am

richardtoohey wrote:
Tue Jun 09, 2020 12:50 am
Thanks - and what is the "colour swap"? Is this text colour changing or palette switching?
Crossed posts! See my edits above.

:idea:

User avatar
richardtoohey
Posts: 3986
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: The Quest for the Last Baked Bean

Post by richardtoohey » Tue Jun 09, 2020 2:37 am

Thanks ... will have go an have a play.

Wonder if something more generic would be better? :-k

So if there was a way of passing a string of bytes (one to many), then pass that to OSWRCH &FFEE?

The string could be MODE 7 control characters or 22,6 to go into MODE 6 or 7 for a beep or whatever.

Seems so obvious that surprised there's not something like that already ... I need to go and try one of your Quill SSDs and see what it's all about! :D

And remind myself about MODE 7 control codes ... it's all lurking in the back of my (fading) memory!

EDIT - yes, can see how this would be a challenge on a number of levels.

i) P.CHR$129"HELLO" takes up 6 blocks on MODE 7 screen - one for the "attribute" 129 (red text) and then five for the text. And the effect of CHR$129 is only the current line. So (a) you lose one character per line and (b) you'd have to cope with multiple lines (as lurkio said).

ii) Looks like the Quill has compression. Even if you changed the editor to allow embedded codes e.g. 129 for red text, you'd probably then have issues with the compression code expecting only a subset of ASCII (haven't looked, just assuming!)

iii) If you implemented a JSR routine to change colour text, that would presumably only be callable once per "message". So you could make the first line of a message red, but if you wanted colour switching in a line (e.g. a red word and a green word) - this wouldn't work. Or (again) multiple lines.

:-k

User avatar
richardtoohey
Posts: 3986
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: The Quest for the Last Baked Bean

Post by richardtoohey » Tue Jun 09, 2020 6:06 am

Here's a fudgy way to achieve this (and sorry for the thread hi-jacking.)

Change WRCHV to have routine that sets the appropriate colour "attribute" - so here I've got a routine (OS 1.2 hard-coded, don't tell!) that will replace 35 "#" with 129 "red":
rough_code.png
In action under BASIC:
rough_code_basic.png
And then in the Quill message editor - I started my message, then typed SHIFT+3 - the # character gets replaced:
rough_code_quill.png
Haven't tried in a finished game etc. (got to RTFM first!) but the concept seems to work. Obviously you'd need to use some other characters to turn things back to white, or other colours, etc. but it might fly.

EDIT the nicer code (not OS 1.2 specific anymore either):

Code: Select all

   10 REM MAKE THE HASH SIGN TURN ON TELETEXT RED
   20 ?&70=?&20E
   30 ?&71=?&20F
   40 FOR I%=0 TO 3 STEP 3
   50 P%=&A00
   60 [ OPT I%
   70 CMP#35
   80 BNE emit
   90 LDA#129
  100 .emit
  110 JMP(&70)
  120 ]
  130 NEXTI%
  140 ?&20E=0
  150 ?&20F=&0A
I tried editing the Bean adventure message 0 - changed a space to a hash - and got the expected red text when running the game under the Quill test option. So this might work after all. :D

EDIT 2: Improved version that goes back to white if you use *. Obviously this code means you can't use # or * in any text in the adventure.

Code: Select all

10 REM MAKE THE HASH SIGN TURN ON TELETEXT RED
   20 REM AND STAR FOR WHITE
   30 ?&70=?&20E
   40 ?&71=?&20F
   50 FOR I%=0 TO 3 STEP 3
   60 P%=&A00
   70 [ OPT I%
   80 CMP#35
   90 BNE check2
  100 LDA#129
  110 JMP emit
  120 .check2
  130 CMP#42
  140 BNE emit
  150 LDA#135
  160 .emit
  170 JMP(&70)
  180 ]
  190 NEXTI%
  200 ?&20E=0
  210 ?&20F=&0A
quill colour.jpg

User avatar
8bitAG
Posts: 100
Joined: Wed Nov 07, 2018 5:03 pm
Contact:

Re: The Quest for the Last Baked Bean

Post by 8bitAG » Tue Jun 09, 2020 8:56 am

Yeah, it's a shame about the lack of coloured text on the Beeb Quill. You certainly wouldn't want to do anything that reduced the amount of available memory... the BBC has the least available memory of all the versions of Quill as it is! :)

(The Beeb's compression, which does make up the initial lack of memory, works on lowercase letters and spaces.)

Your experiments above look interesting, Richard.

User avatar
lurkio
Posts: 2892
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: The Quest for the Last Baked Bean

Post by lurkio » Tue Jun 09, 2020 9:24 am

Clever stuff, Richard! But how would you allow the user to choose from the full range of MODE7 colours, I wonder..?

A different way to add some colour to MODE7 Quilled games might be to use JSR to load Teletext artwork from disc. (Assuming you or someone you know is good at creating Teletext art in the first place!)

You wouldn't lose any user RAM because you'd be in MODE7 and all the pictures would be stored on disc. And you wouldn't need to hijack any OS vectors either.

:idea:

User avatar
richardtoohey
Posts: 3986
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: The Quest for the Last Baked Bean

Post by richardtoohey » Tue Jun 09, 2020 9:37 am

I wasn't sure how many colours you'd need ... # for red, $ for green, = for blue, * for white but it would get a bit unwieldy.

Or you have #X where X is 0 for white, 1 for red, 2 for green, etc. but then you are using 2 bytes for the colour attribute so that chews into your memory. And the WRCHV coding becomes more difficult!

You could write all in upper case, and reserve lower case letters for colour coding - r=red g=green b=blue w=white and so on.

I don't think any JSR option works because of the multi-line and changing-colours-in-text problems.

There's also things like *LINE and *CODE ... and you could use *LOAD for your teletext file - but think you've said previously that if you use a * command (I think the example was *SAY?), the command gets displayed so that limits the usefulness of any of those options.

Reverse-engineering and re-writing the Quill would be :shock:

But I'm drifting further and further away from the topic of this post! :oops:

User avatar
8bitAG
Posts: 100
Joined: Wed Nov 07, 2018 5:03 pm
Contact:

Re: The Quest for the Last Baked Bean

Post by 8bitAG » Tue Jun 09, 2020 9:54 am

Even a couple of colours (or just one) would add an extra dimension to games; spot highlighting key words was used to good effect in Quilled games on other platforms.

User avatar
lurkio
Posts: 2892
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: The Quest for the Last Baked Bean

Post by lurkio » Tue Jun 09, 2020 12:32 pm

Well, if, in addition to white, we're just going to use one colour -- red, say -- then we could store a flag in memory to tell the machine code whether to output the control code for red or the one for white, and in that way we'd only need one "special" character (# in Richard's example) to toggle red on and off. So only one char would be unprintable (as itself) in room descriptions, messages, etc.

:idea:

EDIT: I don't know how much longer this discussion about hacking Quill will run but it might be worth splitting it off into its own thread anyway, from this post onwards.

User avatar
8bitAG
Posts: 100
Joined: Wed Nov 07, 2018 5:03 pm
Contact:

Re: The Quest for the Last Baked Bean

Post by 8bitAG » Tue Jun 09, 2020 1:24 pm

Definitely seems worth splitting the post, for anyone with that power. :)

Two characters reserved for a colour mode might be the way to go. One to turn on the alternate colour and one to turn it off?

If you can read the value of a Quilled flag then you could potentially select a colour in advance, before printing the message?

User avatar
lurkio
Posts: 2892
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: The Quest for the Last Baked Bean

Post by lurkio » Tue Jun 09, 2020 1:32 pm

8bitAG wrote:
Tue Jun 09, 2020 1:24 pm
Two characters reserved for a colour mode might be the way to go. One to turn on the alternate colour and one to turn it off?
Yes, that would work, but what I'm suggesting is that if the custom machine-code routine used one memory location (&72, say) as a flag, which it toggled each time it switched colour (to keep track of the state of the colour of the text), then just one character would be needed to turn the colour both on and off. That special character would effectively toggle the selected colour. That way, you wouldn't have to "lose" another printable character (the asterisk in Richard's example) that could otherwise have been displayed in messages or room descriptions, etc.

8bitAG wrote:
Tue Jun 09, 2020 1:24 pm
If you can read the value of a Quilled flag then you could potentially select a colour in advance, before printing the message?
Good idea.

:idea:
Last edited by lurkio on Wed Jun 10, 2020 1:00 pm, edited 1 time in total.

Adam James
Posts: 196
Joined: Tue May 26, 2020 2:32 pm
Contact:

Re: The Quest for the Last Baked Bean

Post by Adam James » Tue Jun 09, 2020 10:14 pm

lurkio wrote:
Mon Jun 08, 2020 8:21 pm
Here's the game on the Quill editor disc-image. The original buggy game database file is named BAKED. The edited bugfixed game database file is named BAKED2. The runnable bugfixed game file is named BAKEDG:
  • QuillA03_BAKED_fixed.ssd
Wow. I hadn't realised that this thread would lead to a fixed version of the game! I'd got the impression it was just idle speculation at the start. There's clearly a lot of clever people on this forum:)

So is there a convention for this sort of thing, e.g. putting fixed games in a certain place where people know where to find them?

User avatar
lurkio
Posts: 2892
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: The Quest for the Last Baked Bean

Post by lurkio » Tue Jun 09, 2020 10:55 pm

Adam James wrote:
Tue Jun 09, 2020 10:14 pm
So is there a convention for this sort of thing, e.g. putting fixed games in a certain place where people know where to find them?
Quest For The Last Baked Bean was a game that Mick had included on one of his Collection discs, which is where most of the games on bbcmicro.co.uk come from, so I reported the fix to him, and he's reintegrated the bugfixed version of the game into his Collection, and it'll eventually make its way back onto bbcmicro.co.uk (usually whenever Lee catches up with things):
:idea:

Post Reply

Return to “8-bit acorn software: classic adventure games”