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 Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Author Message
PostPosted: Mon Oct 13, 2008 7:02 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Hi again!

I think I'm being slow to get this but.....

Quote:
To display a text from SWR from the util you have written there are 2 flags needed (instead of 1 as before).
&50A has number that can be 11 to 25. The 11 to 25 are flag numbers that contain the number for the util to diplay the correct text.
Example :
&50A = 14 (14 is in my case Simon, a character in the Adventure)
14 is equal to flag location in the memory at &50E
&50E = 32 (32 is the text number to be displayed, so Simon says message 32 from the SWR)

You seem to be saying that $50A holds the character number (11-25) and that the flag for this character will hold the message to be displayed (or spoken). Thus, it still sounds as if we should use Message Number = Contents of : ($500 + (Contents of : $50A))

However, then you said...
Quote:
Martin:
Th &50A has a value. This could be 12.
When this number is read, message 12 from the SWR should be displayed.
So the content of &50A = SWR message number to be displayed
When you would read &50B you would get a different number. This number is related to something else in the adventure.

:?

Martin


Top
 
PostPosted: Mon Oct 13, 2008 7:23 pm 
Offline
User avatar
 WWW  Profile

Joined: Wed Jan 09, 2008 10:23 am
Posts: 359
Location: Glasgow, Scotland
It's not just you Martin, I'm not quite following that bit either! ;)

Kind regards,

Francis.


Top
 
PostPosted: Mon Oct 13, 2008 9:17 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Heh Heh, safety in numbers then!

Watch out Kohen, your engineers are revolting.... :lol:

Martin

(Sorry Kohen, that's an English joke and it may not travel well ;) )


Top
 
PostPosted: Mon Oct 13, 2008 10:31 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Hi Koen.

I'll leave the message utility 'tweak' until we sort the flag issue so I'm on with the utility calling routine. Here's the assembler code I'm proposing to use - I'll produce the usual Basic version later or tomorrow.

As this stands, I've located it in the same place as my message utility, taken a guess at Flag $30 ($0530) and used the same swr bank (4) as we used for the message database.

Therefore, before you use this in anger, we will have to decide on the location for this routine, the Quill flag number to hold the utility number (0..n) and the swr bank we are going to use. (Need to check what's available)

Code:
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\     Test code for calling Quill utility code    \
\           stored in Master 128 SWR              \
\              V1.0  M.P.Barr 2008                \
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\------------------------------------------------------------------------------
\Notes:

\1. Non-relocatable, must be re-assembled
\2. No zero page use
\3. Requires swr utility number as 0..n in Quill flag @ utilnum
\4. Registers not preserved
\5. Assumes all utils are max. 1 page long (256 bytes)
\6. Call 'start', NOT 'entry' (start = entry + 6)

\------------------------------------------------------------------------------
\Constants etc. defined here

qswrutil  EQU       $0380               \locate in CFS/RFS file buffer

utilnum   EQU       $0530               \utility number passed in Quill..
                                        \..Flag $0530 (0..n)
romsoft   EQU       $F4                 \software rom register
romhard   EQU       $FE30               \hardware rom register
swrblk    EQU       4                   \swr block number
basic     EQU       12                  \BASIC rom slot number

\end of constants

\------------------------------------------------------------------------------
          ORG       qswrutil

entry     DFB       $20                 \'JSR' opcode
utilL     DFB       $00                 \all utils on a page boundary
utilH     DFB       $80                 \self-modifying util page number

          JMP       return              \after calling util, graceful exit

start     LDA       utilnum             \prepare util address page number
          CLC
          ADC       #$80                \$80, $81, $82 ... etc.
          STA       utilH               \and set the util swr call address

                                        \page BASIC out and SWR in         
          SEI                           \kill IRQ during switch
          LDA       #swrblk             \select utils swr bank
          STA       romsoft
          STA       romhard
          CLI                           \restore IRQ
         
          JMP       entry               \and call the utility

return    SEI                           \all done, reselect BASIC
          LDA       #basic              \as swr select but rom = 12
          STA       romsoft
          STA       romhard
          CLI
         
          RTS                           and return

\------------------------------------------------------------------------------
\*** End of code ***


I'll also relocate Francis' original routine (using the BRK/Error print method) and send that as a swr image so that you can see if it works under Quill and then, if not, we will go with his later OSASCI version.

Later...

Martin


Last edited by MartinB on Tue Oct 14, 2008 10:03 am, edited 2 times in total.

Top
 
PostPosted: Mon Oct 13, 2008 10:33 pm 
Offline
 Profile

Joined: Mon Jul 07, 2008 6:58 pm
Posts: 64
oh, oh better watch my steps then :?

Hmmmm...
Let's see wat the book says....
ahhh.....
yes.......

Oh dear.....
oh dear oh dear oh dear....
I was wrong, and I thing you were right. :shock:

Let's summarize.
Quill uses memory locations &500 -> &540 to store numbers (flags)
For the conversation util you indeed need 2 flags to display the right message.
&50A = can hold 11 -> 25 (the one you are talking to)
And the right SWR message can be found in &500 + content of &50A

So let's say, that Simon should say his first SWR message (SWR message number 31)

The values are :
&50A=14
&50E=31

So indeed : when &50A=14 you are talking to Simon
14, that would be memory location &50E
The contence from &50E gives the message number from SWR
in this case &50E = holds 31 which is text message number from SWR to be displayed.

phew...

Hope this works a bit as anti(?)revolting or de-revolting or un-revolting ;)

Cheers

Koen


Top
 
PostPosted: Tue Oct 14, 2008 12:56 am 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
:lol:

S'ok, we are no longer revolting and will return to being polite and helpful ;)

Posted some stuff, then spotted an error!

Back later...

Martin


Top
 
PostPosted: Tue Oct 14, 2008 8:22 am 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
I have written the Basic version of the utility calling code I posted, CALLUTL, and created an object file QCUTIL. I have taken Francis' original direction printer plus the two edits you later posted to get it working and added the relocation info to locate it at $8000. The Basic source is DIRS and the object file is DIRECT. The last Basic program, EXAMPLE, * loads QCUTIL at $0380, * loads DIRECT into SWR Bank 4 at $8000 and then asks for a value for the Quill flag that I think is used by Francis' routine.

Therefore, just CHAIN"EXAMPLE", enter a value, press <Return> and watch how it crashes :o

I think (hope :) ) this is as I expected outside of Quill so you now need to figure out a way of testing it within the Quill environment to see if Quill adds it's own BRK/Error printing code. This is a bit of a tricky area we are in because I have to assume that I have made no errors and that the crash is because Basic is paged out. Note that the util to be called is set in the Flag at $0530 and in this case is always zero since this is the only one here. As I said, I have allowed a value for the direction Flag to be entered which is I think how Francis' routine works but you better check, I'm not too sure.

I'll leave it with you then :D

Martin


Attachments:
qutil.zip [1.95 KiB]
Downloaded 5 times
Top
 
PostPosted: Tue Oct 14, 2008 11:20 am 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Hi Francis.

Whilst waiting for our project manager to try your original BRK/Error routine with my SWR mods, I've had a play with your last two OSASCI versions. They both sort of work but seem to get stuck in a loop whereby, if I set the flag to give just North (lucky guess - haven't a clue how it works ;) ) then I see the 'visible exits' message flash past followed by an endless stream of 'North' messages, all back to back apart from a space or two. The second version, with the 255's, does the same thing but there's also a white block (Mode 7 $FF character) inserted between the 'North' messages.

Just thought I'd give you a heads up because I suspect we'll be using the OSASCI version.

Martin


Top
 
PostPosted: Tue Oct 14, 2008 11:53 am 
Offline
User avatar
 WWW  Profile

Joined: Wed Jan 09, 2008 10:23 am
Posts: 359
Location: Glasgow, Scotland
Hi Martin,

Thanks, I'll take a look at it.

Kind regards,

Francis.


Top
 
PostPosted: Tue Oct 14, 2008 12:09 pm 
Offline
User avatar
 WWW  Profile

Joined: Wed Jan 09, 2008 10:23 am
Posts: 359
Location: Glasgow, Scotland
Hi Martin,

Found the problem. I'll need to rewrite the routine to fix it.

Kind regards,

Francis.


Top
 
PostPosted: Tue Oct 14, 2008 12:44 pm 
Offline
User avatar
 WWW  Profile

Joined: Wed Jan 09, 2008 10:23 am
Posts: 359
Location: Glasgow, Scotland
Hi Martin,

I thought I had the problem, but now that I've had a closer look at the code I'm not so sure.

After a quick glance I had thought that the problem was with me overwriting the Y register interfering with the counter in line 100 (causing the endless loop), but looking at it further the contents of the Y register are being stored at &72 and being reloaded to the Y register before being used.

Does the problem only happen if North is the only available direction, or does it happen with other directions. Does the original BRK version do the same thing?

Also, I noticed that I have forgotten to add in a couple of bits. Line 330 should read:

Code:
  330.S2_TEXT:EQUB 13:EQUS "Visible exits : ":EQUB 13:EQUB 0


Kind regards,

Francis.


Top
 
PostPosted: Tue Oct 14, 2008 1:09 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Hi Francis.

I'm pretty sure it did it with other directions athough maybe I was only ever using one exit at a time - I'm just stabbing a number into $502 before calling since I haven't really looked into how it actually works. Can't say about the BRK etc. version because it just bombs out as I was expecting since I've relocated them all to SWR.

I have also written a small piece of test code to live in SWR which has allowed me to prove my calling routine so I don't think the SWR relocation is an issue for the OSASCI versions.

I'm at the wrong PC now so I'll have another look later.

Martin

(This adventure better be flippin' good... :lol: )


Top
 
PostPosted: Tue Oct 14, 2008 1:34 pm 
Offline
User avatar
 WWW  Profile

Joined: Wed Jan 09, 2008 10:23 am
Posts: 359
Location: Glasgow, Scotland
MartinB wrote:
(This adventure better be flippin' good... :lol: )

LOL! :lol:

I would be surprised if it doesn't do the same with the other directions as I can't see any major differences between them.

Kind regards,

Francis


Top
 
PostPosted: Tue Oct 14, 2008 2:12 pm 
Offline
 Profile

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

Quote:
MartinB wrote:
(This adventure better be flippin' good... :lol: )

LOL! :lol:

hmmm I almost don't dare to ask any more :( because it takes you guys a lot of time you don't have.

Busy testing the SWR version.
And indeed it crashed. I checked the DIRS application and set it to &B00 and te routine by itself is ok.
I also took the liberty to change the &380 to &B00 (in the CALLUT application)
And still crashed :(
What does the 'utilnum=&0530 do/says in the CALLUT? (hope this is not a too technical question for a no assembly brain ;) )

Donno if the code from francis is wrong. The loop Martin is describing is not happening when testing it in Quill.
I added the EQUB 13 aswel since it makes cursor jump to the next line before it is showing the north south etc.

Cheers

Koen


Top
 
PostPosted: Tue Oct 14, 2008 2:17 pm 
Offline
User avatar
 WWW  Profile

Joined: Wed Jan 09, 2008 10:23 am
Posts: 359
Location: Glasgow, Scotland
Yrrah2 wrote:
Hi guys,

Quote:
MartinB wrote:
(This adventure better be flippin' good... :lol: )

LOL! :lol:

hmmm I almost don't dare to ask any more :( because it takes you guys a lot of time you don't have.

Don't worry about it. As I said before it has been good practice for me to relearn my 6502 stuff.

I'm glad that the routine works okay under Quill. I've been scrutinising the code and I couldn't figure out what was going wrong.

Kind regards,

Francis.


Top
 
PostPosted: Tue Oct 14, 2008 2:23 pm 
Offline
 Profile

Joined: Mon Jul 07, 2008 6:58 pm
Posts: 64
Glad to hear that Francis :) bet Martin laughs his head of at the moment about us :D

Isn't it just possible to call the code in witch is in SWR just like a PROC command?
So let's say this :
The direction util is in &8000
In B00 we say the assembly words for 'PROCdirectionutil' to run it. (without any extra variables)
And after the util has run it returns back to the place where it left and then returns back to Quill because the &B00 program is ended.

Or is this thought to simple? (or is this what we are doing.........)

Cheers

Koen


Top
 
PostPosted: Tue Oct 14, 2008 2:53 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
My head hurts :(

Ok - what is working and what isn't, I'm not sure anymore? If the routine I sent you doesn't work under Quill, i.e. crashes, then that's for the reason I predicted - when we use a SWR bank, we temporarily switch out the Basic rom and switch in the SWR bank containing the utils. At this point, the BRK/Error print code, upon which Francis' first routine relies (part of Basic remember), is no longer available. Thus, we have to go for a version of the utility using OSASCI to do the printing.

Now, when I say I have tried these OSASCI routines, I am using them stand-alone and outside of Quill and I don't really know how the &502 flag works and I haven't got a clue what the locations &350A and &350B (or &250A/&250B) are supposed to be doing. Maybe then, when I have tried relocated versions of Francis' routines, the 'stuck-in-a-loop' I see is perhaps due to my trying to use them without Quill.

What I will therefore do is revise the disc I last sent and include Francis' OSASCI routines for you to test under Quill. One or both of these should then work fine assuming either/both work for you now.

Regarding calling the code in SWR, no, you can't just call it because normally it's not there, Basic is! You have to use code that pages in the SWR bank where the code to be executed is stored.

I will send another version of the disc with the OSASCI versions of the direction printer for you to try with Quill.

Martin ;)


Top
 
PostPosted: Tue Oct 14, 2008 3:15 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Ok Koen, over to you again!

On this disc is the calling routine and two SWR versions of Francis' OSASCI routines. Look at FR1TEST and FR2TEST to see how I've used them and if you run them you will see what I mean about the infinite loop. However, I think that if you run them under Quill, one or both should work.

Cheers,

Martin ;)

Added when I remembered your question :

The utilnum=$0530 is me picking a Quill flag to use to pass the required utility number to my calling routine. I understood that the Flags have these addresses so I just picked one at random - I do still need you to allocate one for this purpose.
When calling a utility from Quill, you will set the flag to the utility number (this one is 0 for the time being) and then call the routine which is, as I have written it, LSB=128 MSB=3 (for $0380)


Attachments:
fr.zip [1.56 KiB]
Downloaded 6 times
Top
 
PostPosted: Tue Oct 14, 2008 3:35 pm 
Offline
User avatar
 WWW  Profile

Joined: Wed Jan 09, 2008 10:23 am
Posts: 359
Location: Glasgow, Scotland
Hi Martin,

Now that I have had a bit more time to digest the code I think that where it is going wrong is that it is looking at a series of memory locations. If it finds a value of 255 then it returns from the subroutine (e.g back to Quill).

My assumption is that Quill puts in a value of 255 as an endstop to the list of possible locations and if it isn't there then the program will go through the loop that you described.

Kind regards,

Francis.


Top
 
PostPosted: Tue Oct 14, 2008 3:40 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Ah, nice one. Yeah, that's the sort of thing I had in mind but I just haven't got the time to ferret around in Quill at the moment to fill in my blanks.

Anyway, hopefully Koen will soon be the bearer of good news ;)

Martin


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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