It is currently Mon Oct 20, 2014 5:43 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 141 posts ]  Go to page 1, 2, 3, 4, 5 ... 8  Next
Author Message
PostPosted: Mon Jul 07, 2008 7:04 pm 
Offline
 Profile

Joined: Mon Jul 07, 2008 6:58 pm
Posts: 64
Hi All,

I'm quite new here at Retro, and I hope that I post this on the right place.
I got this link via the stairway to hell site.

At the moment I'm busy making a text adventure for the Master.
The stage now is that I'm busy writing all my stuff on paper. But in my mind I'm busy programming.

But I would like to have some help on some assembly/machine code programming.
Is there someone here who can help me out?

Cheers

Koen


Top
 
PostPosted: Mon Jul 07, 2008 7:19 pm 
Offline
User avatar
 WWW  Profile

Joined: Wed Jan 09, 2008 10:23 am
Posts: 359
Location: Glasgow, Scotland
I'm also developing a couple of text adventures. I started off writing them in BASIC and then began substituting parts by assembly equivalents.

There is an example piece of code in the Sample Code section of this forum that I wrote in assembler for getting the text entered by the user.

If there is anything specifically that you are need a hand with let us know.

Kind regards,

Francis.


Top
 
PostPosted: Mon Jul 07, 2008 8:06 pm 
Offline
Site Admin
User avatar
 Profile

Joined: Wed Dec 19, 2007 10:46 pm
Posts: 779
Alternatively, if you're looking for a cross-platform adventure creation tool, we have a Z-Machine Interpreter which is mostly ready for use. If you'd like to write your adventure in Inform 6, I can show you how to build a v3 Z-Machine game which can then be played on a BBC micro, GameBoy, Spectrum, C64, PC, Linux, Mac, PocketPC or dozens of other formats.

Our v3 Inform setup won't let you do anything with graphics, tho.

Give me a shout, if you're interested.

Sam.

Edit: An Inform/Z-Machine development environment for the Beeb (and lots of other platforms) has finally made it to Retro Software here:

http://www.retrosoftware.co.uk/informz3/


Last edited by Samwise on Sun Jul 20, 2008 8:59 pm, edited 1 time in total.
Added dev environment link


Top
 
PostPosted: Mon Jul 07, 2008 8:17 pm 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
And of course if there's something specific on your mind, just ask away :)


Top
 
PostPosted: Mon Jul 07, 2008 8:27 pm 
Offline
 Profile

Joined: Mon Jul 07, 2008 6:58 pm
Posts: 64
WOW :shock: :shock: a lot of replies.
LOL
This is great.

Samwise, looks interesting, but I'm going to use some graphics. Someone mentioned it before in Stairwaytohell. But I keep that application in mind for maybee any future projects.

Francis, We have met before Iat stairway). Thanks for the code. Gonna have a look at it.
Maybe it can be usefull. ;)

Well. At the moment I'm busy using Quill adventure writing too for the BBC/Electron.
This is a nice pease of software I have to say. I'm a BASIC programmer more than Assembly.
But Quill gives the possibilety to use own written assembly code together with your adventure.
So What I would like if someone can help me out to write a little of assembly code so I can use it in combination with my adventure.

Cheers

Koen


Top
 
PostPosted: Mon Jul 07, 2008 9:21 pm 
Offline
User avatar
 WWW  Profile

Joined: Wed Jan 09, 2008 10:23 am
Posts: 359
Location: Glasgow, Scotland
If there is anything that you are not sure of in the code let me know and I can explain what it does. I keep meaning to redo that page and explain in more detail what the program actually does, but I can't seem to get around to doing it.

Kind regards,

Francis.


Top
 
PostPosted: Mon Jul 07, 2008 9:40 pm 
Offline
 Profile

Joined: Mon Jul 07, 2008 6:58 pm
Posts: 64
Ok I'll try :)
Quill is an adventure writing system.
When you have written an adventure in quill, you can save it as a database (to reopen it with quill and edit it) or save it as an standalone adventure, whitch can be rusn with a *RUN command.

Quill uses the memory of the beeb in parts. A part is for the database (the adventure itself) Another part is for all the objects and a part for messages that you can display when called.
One part is used for flags (user variables) this is in memory &500-&540
What I would like, is a small code where i can read a spicific flag (send by quill) and that it produces a message.
Like that i send from quill 20 to the code, and then the code sends back to display message 20.

How to do that I can explain, but its a quite long story and reading some quill manual parts and someone who would like to spend a little time to create that code for me/the adventure :)

Cheers

Koen


Top
 
PostPosted: Mon Jul 07, 2008 9:52 pm 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
How do you return the code to Quill, ie How do you pass '20' back to Quill?


Top
 
PostPosted: Mon Jul 07, 2008 10:25 pm 
Offline
 Profile

Joined: Mon Jul 07, 2008 6:58 pm
Posts: 64
The quill manual gives an example code.
This code gives the directions you can go in a room. (these are not give automatically by quill)
you call it by :
JSR 0 11 (where 0=LSB and 11=MSB)
The code then looks in to the memory for the directions and print them.

    10 FOR N%=0 TO 3 STEP 3
    20 P%=&B00
    30 [
    40 OPT N%
    50 .START:LDA &250A:STA &70:LDA &250B:STA &71:LDX #0
    51 \ &350A and &350B for Cassette version
    60 .START1:CPX &502:BEQ START2:LDY #0:LDA (&70),Y
    70 CLC:ADC &70:STA &70:LDA &71:ADC #0:STA &71:INX:JMP START1
    80 .START2:BRK
    90 EQUB 255:EQUB 13:EQUS "Visible Exits:":EQUB 13:EQUB 0
    100 LDY #1:STY &72
    110 .START3:LDY &72:LDA (&70),Y:CMP #255:BNE START0
    120 JSR &FFE7:JSR &FFE7:RTS
    130 .START0:CMP #0:BNE START5:BRK
    140 EQUB 255:EQUS "North,":EQUB 0
    150 .START4:INC &72:INC &72:JMP START3
    160 .START5:CMP #1:BNE START6:BRK
    170 EQUB 255:EQUS "South,":EQUB 0
    180 JMP START4
    190 .START6:CMP #2:BNE START7:BRK
    200 EQUB 255:EQUS "East,":EQUB 0
    210 JMP START4
    220 .START7:CMP #3:BNE START8:BRK
    230 EQUB 255:EQUS "West,":EQUB 0
    240 JMP START4
    250 .START8:CMP #4:BNE START9:BRK
    260 EQUB 255:EQUS "Up,":EQUB 0
    270 JMP START4
    280 .START9:CMP #5:BNE START4:BRK
    290 EQUB 255:EQUS "Down,":EQUB 0
    300 JMP START4
    310 ]
    320 NEXT
    330 PRINT"LSB=";START MOD 256
    340 PRINT"MSB=";START DIV 256


The manual says the following too :

    The program reveals several points that the user should note:
    1) Locations &70-&8F are available to the user,
    2) The Quill interpreter is restarted by RTS, and
    3) Messages can be sent using BRK, followed by a 255, the message, and a 0.

Looking t this twice (Actually 10th time :) ) The machine code should display the message instead of sending back 20 to Quill.
So The code also should read the right message from the memory and then display it and go back to quill to continue.

Hope this helps

Cheers

Koen


Top
 
PostPosted: Tue Jul 08, 2008 1:49 pm 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
OK

So if you have a flag at &500 you set to 1 or 0:

Code:
ORG &900

LDA &500
AND #1
BEQ flagNotSet
.flagSet
BRK
EQUB 255
EQUS "Flag is set"
EQUB 13
EQUB 0
RTS
.flagNotSet
BRK
EQUB 255
EQUS "Flag isn't set"
EQUB 13
EQUB 0
RTS


Then if you do JSR 0 9 from Quill does it do anything?

Sorry if this is complete guff, I've never loaded Quill... Not sure how it does things :)


Top
 
PostPosted: Tue Jul 08, 2008 7:55 pm 
Offline
 Profile

Joined: Mon Jul 07, 2008 6:58 pm
Posts: 64
Hi Dave,

I tried the code you gave me, only I placed it at B00.
But got an error at the line : BEQ flagNotSet (No Such variable)

Any hint on this?
(sry I'm a no no with assembly)

Cheers

Koen


Top
 
PostPosted: Tue Jul 08, 2008 8:32 pm 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
Can you list out what you've got and what you're assembling it with?

Cheers


Top
 
PostPosted: Tue Jul 08, 2008 8:37 pm 
Offline
 Profile

Joined: Mon Jul 07, 2008 6:58 pm
Posts: 64
Shure


Attachments:
Picture 2.png [8.02 KiB]
Downloaded 375 times
Top
 
PostPosted: Tue Jul 08, 2008 8:39 pm 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
Weird.. Looks OK. Perhaps the basic assembler is a bit crap with case.

Try changing references to "flagSet" as "FLAGSET" and "flagNotSet" as "FLAGNOTSET"

[EDIT]

Aha... You've forgot the [ OPT N%

You can also drop the MOD/DIV stuff as you know the MSB/LSB


Top
 
PostPosted: Tue Jul 08, 2008 10:00 pm 
Offline
 Profile

Joined: Mon Jul 07, 2008 6:58 pm
Posts: 64
It Works!!!
I have set the page to &B00 and made the flag number &514 (because that was a free one) and this works nicely.

No I have to figure out on what point of the memory the messages are placed. So that i t can read a flag and read the message in the memory somewhere that corresponds with the flag number.
Do you think this would also be possible to use SWR memory location instead of &B00?
And how?

Cheers and thanks so far.

Koen


Top
 
PostPosted: Wed Jul 09, 2008 8:51 am 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
Excellent!

I'm afraid I know nothing of sideways RAM, but I presume it wouldn't cause any problem to assemble/load it there and just call it as normal. I don't even know how sideways RAM is memory mapped so perhaps someone else could help here?


Top
 
PostPosted: Thu Jul 10, 2008 9:56 pm 
Offline
 Profile

Joined: Mon Jul 07, 2008 6:58 pm
Posts: 64
Hi Dave,

Took me a little while but have not mastered it yet what the address is t=of the messages to display.
The manual gives a memory map how it should be. But the place where all the messages are stored, are not fixed on one position.
If you want I can send you the memory map, along with a little adventure of 2 rooms to see if you can find something? (If you have the time)

Cheers

Koen

P.S. Anyone here who has an answer on the sideways ram option mentioned before?


Top
 
PostPosted: Fri Jul 11, 2008 8:35 am 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
Yeah I'd be happy to help out, although it'll have to be from July 21st onwards cos of other commitments.

If nobody else wants to help I can look into the sideways RAM stuff for you too. If it runs on an emulator anyway - my real BBC has no sideways RAM.

Cheers


Top
 
PostPosted: Sat Jul 12, 2008 1:21 pm 
Offline
 Profile

Joined: Mon Jul 07, 2008 6:58 pm
Posts: 64
Hi Dave,

Nice that you want to help to figure this all out.
I found someone else who can help us out with the SWR idea.
In this mesage I have 3 files included. The manual of Quill and a disc image with the adventure I have created for this case. I also included you little code so you can see that it works fine.

For your information, your util reads &514 (flag 20) and is placed in memory &B00.
In the manual at page 43 & 44 you can see the memory layout from quill.
To read the right memory locations you have to use the memory adress displayed in hte () characters. This because of the disc usage.

Let me know if you can find out how Quill knows where to look on what memory location a specific message is set.
I found out that when the vocabulary database grows the message table moves upward into the memory. And this goes aswell for the location table etc. etc.

In the adventure I have added the EXMON command. If Exmon II is installed you start up exmon and you can readout the memory.

Let me know if all works well.

Cheers

Koen


Attachments:
Quill-stuff.zip [45.98 KiB]
Downloaded 13 times
Top
 
PostPosted: Tue Jul 22, 2008 9:24 am 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
Hi Koen

Just had a very quick look at the manual. Are the messages not stored at the location pointed to by the "Message table vector" at &2502/&2503? There's also another address for this at &3502/&3503, not sure what that's about - is it the disc or Electron version?

Anyway, if you have a butcher's with EXMON at the address pointed at by those LO/HI addresses let me know how you get on.


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 141 posts ]  Go to page 1, 2, 3, 4, 5 ... 8  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron