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

Developing a text adventure
http://www.retrosoftware.co.uk/forum/viewtopic.php?f=19&t=129
Page 2 of 8

Author:  Yrrah2 [ Mon Sep 01, 2008 1:05 pm ]
Post subject:  Developing a text adventure part 2

Hi all,

It has been a while since I have posted her with questions.
But here I go.

Can someone help me out to create some utils for me and the text adventure I'm creating?
The basic text adventure is made in Quill, but I would like to have some extra machine code utils to make it all look prettier and smooth :)
The idea is to make a view utils, put them in SWR and call them when needed.

The thing is that I can create basic applications but I am a no no with machine code/assembly.
So what I can do to make it easier is create a BASIC application to show what the idea is (of a util) and then from that point to continue.

The text adventure is going to be a free application so I, unfortunately, have nothing to pay, but can mention people during the preroll of the game.

Anyone interested?

Cheers

Koen

Author:  ParasS [ Mon Sep 01, 2008 1:18 pm ]
Post subject:  Re: Developing a text adventure

Hi Koen

If I were you I'd post specific stuff here and then anyone who is able to/has time will help you out. It'll be a bit difficult to get a response when it's unclear what you actually want the code to do!

Just my suggestion! :)

Author:  Yrrah2 [ Mon Sep 01, 2008 1:36 pm ]
Post subject:  Re: Developing a text adventure

Ok.

What has to be done is to make one SWR image that contains several utils.
And these utils should be called from Quill. Quill can not call a util from SWR directly. So what as to be done is a little machine code at &B00 has to be made that recognizes what util is called and then calles the util from SWR.

The utils that should be together in the SWR are :


    - A screen effect to fade in and fade out the screen
    (I can make an example in basic for that)

    - A util to set the colour to black and to white again. (not the basic colour so that all colours go to black, but a singe line)
    (I can make an example in basic for that)

    - Quill comes with a little util that displays the direction you can go during the game (like north, south etc.)
    I would like to expand this with a view extra directions (up, down, northwest etc.)
    (I can provide the code that's allready there so that it can be extended

Already I have an util (martin made for me) that has to be combined together with the other utils.
So all these little utils has to but together in one SWR file.

Hope this helps

Cheers

Koen

Author:  ParasS [ Mon Sep 01, 2008 2:18 pm ]
Post subject:  Re: Developing a text adventure

Whilst I don't have the time myself, 1 should be a doddle, 2 soudns simple, though 3 I don't understand myself. You should zip-up an SSD with the Basic code and upload it assuming there's no copyright issue.

Why do you need this to run in SWR? That'll make it complicated if your plan is ro run it as * commands, for example - certainly the first two would fit into a couple of hundred bytes that you could stick into the tape or UDG buffers

Author:  MartinB [ Tue Sep 02, 2008 5:25 pm ]
Post subject:  Re: Developing a text adventure

When using something like Quill (with which I am not an expert), there is certainly no harm in using the Master's SWR because it both keeps the user's extended adventure features clear of Quill's memory map and relieves some of the pressure on the author's memory constraints.

I have been helping Koen with some of this and I provided the code for a facility which allows 16k of text messages to be stored in one of the Master's SWR banks and then permits a given message to retrieved and displayed using a unique message ident number.
On this subject Koen - It is important to note that the message retrieve & display routine CANNOT be relocated to a second SWR (or Rom) bank. Since this routine has to page in (to &8000-BFFF) the SWR bank in which the messages are stored, if this utility were itself located in SWR (or Rom) then it would effectively page itself out and cause a crash. Thus, this routine, as with any code which pages ROM/SWR, must remain in ram and in this case it is quite safely tucked out of the way at $0380.

With regard to your other list of utilities, and since you are looking to others for help code them, it would possibly be easiest to pre-allocate one or two pages of SWR code space to each routine and give each an absolute start address in the second SWR bank. This would make it much easier for several individuals to help you code each utility in isolation without any one person having to co-ordinate a re-assembly of the combined utilities. Also, if each of the utilities are only to be called separately and do not need to store data between calls then there is also no complication with allocating zero page data memory.

So, for example, let’s assume there are three short(ish) utilities to consider, A, B and C. Locate A at $8000, B at $8200 and C at $8400. You have 16k to play with so over-allocation is not a problem and it also allows for a given routine to grow if necessary without moving all the others.
Then, using two consecutive modifiable memory locations AL, AH you only need to use Quill to set AL and AH to the address of the required utility and then Call a small piece of handling code at say $0Bxx as you suggest. This code would be very similar to the routine I wrote in that it would page out BASIC, page in the second SWR block and then call the routine at AL, AH which would itself end with an RTS. On return, BASIC would be paged back in an Quill resumed. In pseudo terms, it may look something like this :

0B00 JSR
0B01 AL
0B02 AH
0B03 JMP return

0B06 Start of utility call selector…

Page BASIC out and page in utility SWR

JMP 0B00

.return

Page utility SWR out and BASIC in

RTS


Now, to call say utility B from Quill you would set AL=$00, set AH=$82 and call $0B06. Can’t remember the Quill syntax but it does support these actions.

I recognise that this is not the 6502 purists way to handle multiple utility calling but it will allow anyone willing to help Koen to code one or more of his wishlist routines whilst knowing in advance where it is to be located and that it simply ends with an RTS.
Does anyone have any thoughts on this approach and, more importantly, has anybody got some spare capacity to do some of the coding for him? I have been helping but am a bit behind now with some of my harware follies :)

Martin

Author:  Yrrah2 [ Sat Sep 06, 2008 5:57 am ]
Post subject:  Re: Developing a text adventure

Hi Martin,

Sorry I could not answer sooner on this post, was a way to much from my house and have time to look at the forum.
But what you describe sounds as a good plan.
Ill make some .ssd images wihe the sample utils, so people can reply on that and send it back.
There will be some other problems though, how much memory space is needed between A and B (ir is that not a problem).

I'll start writing as soon as I can and post the images.

Chees :D

Koen

Author:  Yrrah2 [ Sun Sep 07, 2008 9:02 pm ]
Post subject:  Re: Developing a text adventure

On request of ParaS I have got a disc image here with a sample how the fade routine should go. (one of the utils)
Can anyone help me out to convert this basic application to a machine code SWR version?
The method Martin suggested above would be cool!

The other examples are coming soon

Cheers

Koen

Attachments:
fade.dsd.zip [25.88 KiB]
Downloaded 9 times

Author:  FrancisL [ Mon Sep 08, 2008 12:44 pm ]
Post subject:  Re: Developing a text adventure

I've had a look at the fade effect and in itself should be fairly straightforward to do in assembler. The bit I'm not too sure of is the sideways RAM bit.

It is possible to get a smoother fade transition than the method you have used, although it would entail a bit of extra work.

Kind regards,

Francis.

Author:  Yrrah2 [ Mon Sep 08, 2008 5:03 pm ]
Post subject:  Re: Developing a text adventure

Hi Francis

How much bit of extra work are you talking about?
Have you read the part from Martin above my message for the SWR part? This sounds very logical to me (although I'm a none at assembly)

You know a sample of the fade you talk about in an existing program? (maybe in a stairway to hell game)

Cheers

Koen

Author:  FrancisL [ Mon Sep 08, 2008 9:39 pm ]
Post subject:  Re: Developing a text adventure

Hi Koen,

The extra work I'm talking about is more about the design part rather than the programming part. The actual programming would more or less be what you already have, but with a few extra bits added.

I don't know of any examples of the type of fade I am talking about. If I get a chance I'll knock something up for you to demonstrate it.

I had a quick read of Martin's post, but I'll need to look at it properly when I get a chance.

Kind regards,

Francis.

Author:  MartinB [ Mon Sep 08, 2008 10:34 pm ]
Post subject:  Re: Developing a text adventure

Hi again.

Essentially, since I'm not as handy with graphics stuff as others here obviously are, I was trying to free any willing programmers from the vaguries of SWR and Quill and just offer a blank coding sheet :)

For example, if someone is prepared to do the fade routine, just assemble the final tested code to reside at $8000, finish it with an RTS and I'll do the rest. Koen would need to check the Quill manual to see what zero page and other data areas are available but thus far I've only used one zp at $0070.

I've nominally suggested that the next routine would live at $8200 (i.e. allowing 512 bytes per routine) but that was just off the cuff and could easily be doubled.

I was assuming that all the routines would be stand-alone 'single-shot and return' but if they need repetitive calls with a time delay then I'm not sure how this would be implemented in Quill?

Anyway, bottom line is that if people can supply the coded routines, I would be able to find the time to integrate them into Quill as single SWR image and could code up the calling routine along the lines of my previous post. To minimise that task, I was hoping for ready to run object code pre-located at $8000, $8200, $8400 etc. (or even $8000, $8400, $8800 etc. if necessary!) I could, if absolutely necessary, just take all the source(s) and assemble it myself but I'd prefer object code since I'm a bit busy at the moment.

Martin

Author:  FrancisL [ Mon Sep 08, 2008 10:49 pm ]
Post subject:  Re: Developing a text adventure

Hi Koen,

I've attached my (albeit rough) version of a fader routine in BASIC. Just type in CHAIN "FADE2". It works best in B&W.

Attachment:
fade.zip [26.16 KiB]
Downloaded 8 times


Try it and tell me what you think.

Kind regards,

Francis.

Author:  FrancisL [ Mon Sep 08, 2008 10:52 pm ]
Post subject:  Re: Developing a text adventure

@MartinB

That makes it sound nice and simple! :D

Kind regards,

Francis

Author:  Yrrah2 [ Tue Sep 09, 2008 1:26 pm ]
Post subject:  Re: Developing a text adventure

Hi Francis.

The fade looks really fine.
If you have time to assembly this, would be lovely :)

What does the *FX19 do?

Cheers

Koen

Author:  ParasS [ Tue Sep 09, 2008 1:55 pm ]
Post subject:  Re: Developing a text adventure

*FX19 waits for the vertical blank signal so that you use the time between the bottom of the screen being refreshed and the start of the next cycle to actually update the screen.

That way, you don't see different stages of your effect kicking in part-way through the screen.

Games typically use this to update the screen so that as it gets output to the monitor on the next cycle in a new state, thereby giving you smooth scrolling and flicker free animation, etc.

Author:  FrancisL [ Tue Sep 09, 2008 3:04 pm ]
Post subject:  Re: Developing a text adventure

Yrrah2 wrote:
If you have time to assembly this, would be lovely :)

I should be able to do this for you, although my one query would be is how do you pass the colour information of the screen in question to the routine?

Kind regards,

Francis.

Author:  Yrrah2 [ Tue Sep 09, 2008 3:44 pm ]
Post subject:  Re: Developing a text adventure

Hi Francis,

The way that Quill can call routines is using a JSR command qithin Quiil.
Quill gives an example routine that is set at &B00. (there is memory left from &B00 to &CFF) when compiled the the example application has an LSB and a MSB. (LSB=0 and MSB=11)
In quill I call this routine by typing JSR 0 11.

But in this case it is a little different. The actual routine is in the SWR and to call the routine I need a small application that is set at &B00 (or a little higher when calling a different routine) that when is called upon it wil run the routine at SWR and returns to somewhere at &B00 ending with BRK (if I'm correct)

Martin will help to set the right things to be used with the SWR.
Is this what you mean?

Cheers

Koen

Author:  FrancisL [ Tue Sep 09, 2008 4:05 pm ]
Post subject:  Re: Developing a text adventure

My issue was how does the routine know what colour palette it would be fading to, but I may have thought of a way around that without having to pass any parameters.

Kind regards,

Francis.

Author:  Yrrah2 [ Tue Sep 09, 2008 6:22 pm ]
Post subject:  Re: Developing a text adventure

Ah, sorry my mistake
I can make that very simple for you. I keep the standard mode1 palette.
But if you know a trick so that the colour palette can change it would be lovly :D

Can you send it to me before you address it to 8000, so I can test it with quill?
So that the routine is set at B00?
Or is that difficult?

Cheers

Koen

Author:  MartinB [ Tue Sep 09, 2008 10:37 pm ]
Post subject:  Re: Developing a text adventure

Regarding zero page and data memory, Quill allocates zp $70-$8F (same as BASIC) and $B00-$CFF to the user. I was going to suggest that parameters could be passed via this memory but it sounds like Francis has thought of a better solution.

Although, on the subject of memory addressing, I thought you (Koen) told me that there is a Quill statement to put values into, an read from, real memory locations? I can't myself see anything in the Quill manual though :? Did I get this wrong? I hope not because the message retrieve & display routine I wrote assumes that the message number will be passed from Quill in zp $70.

If I have misunderstood then my routine will need a 'tweak' to pass the message number via one of the Quill 'Flags' provided we can work out where these are stored.

Any thoughts Koen? (or other Quill experts if there are any out there?)

Martin

(Just seen your PM Koen so I hope this answers your question?)

Page 2 of 8 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/