English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 14 June 2015, 22:32   #1
quahappy
Born again WinUAE user
 
quahappy's Avatar
 
Join Date: Mar 2006
Location: South Yorkshire, UK
Age: 56
Posts: 1,667
Program hangs and not sure why

Hi all,

As already mentioned elsewhere, Graham Humphrey recently ADF-ed several of my disks which contain among various stuff; AMOS Pro programs I did and of course Poker Mania (PD). Anyhow, one I was working on but never finished/released was a Wordsearch program. I wanted to prove to myself that I could make an uncompiled version of my program that could take a list of 20+ words and insert them into a grid within 10 seconds or less. Eventually achieved that - no worries there. So now I want to set about actually finishing this game (would eventually include an editor and huge array of Wordsearch lists built in). That's the theory anyway.

The problem is now, I'm a little rusty with AMOS Pro and when I run my Wordsearch program, after about ten seconds, AMOS hangs. No errors at all. The system restarts showing no Guru errors.

One thing to note here; I'm doing all this under WinUAE (latest version) and using AMOS Pro version V2.

I've Zoned my ADF (file is called: EAB_Wordsearch_HR.adf) with the AMOS Worsearch program on it. I would be eternally grateful if any AMOS coders out there could possibly take a look at my code and tell me what could be causing AMOS to "hang". I can't find anything sinister but like I said, I'm a little rusty and it's been a long time.

Appreciate any answers/help!
quahappy is offline  
Old 14 June 2015, 23:29   #2
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
A likely cause could be you Doking/Loking/Deeking/Leeking into odd addresses on a 68000 CPU, or accidentally messing up the ROM area of memory.

I will download the ADF tonight and have a look at it tomorrow.
Lonewolf10 is offline  
Old 14 June 2015, 23:38   #3
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
i also tested using winuae:
kick workbench 3.0 A1200 setup AGA chipset 64 MB z3 fast mem
running from harddrive installed workbench, so i changed 2 lines:
line 20: 'Dir$ ....
line 21: assign "Fonts:" to "sys:fonts"

i can test and run the program from within amos. no problems, no errors, no hang/freeze of AMOS.
i admit I dont understrand the game rules, but i can scroll the word-list on the left side and click around,
in the matrix some words/letters gets marked - but not the corresponding words from the list, more random highlighted chars.
this might be a font problem?
to quit the program, i use ctrl-c ( amos offers me direct mode or editor)
using both-mouse-buttons at same time, i can start a new round.

hope this helps a bit.
emufan is offline  
Old 15 June 2015, 00:00   #4
quahappy
Born again WinUAE user
 
quahappy's Avatar
 
Join Date: Mar 2006
Location: South Yorkshire, UK
Age: 56
Posts: 1,667
Heh. Admittedly I'm still trying to decipher my own code (how bad is that?!) recalling what all the variables were, etc, etc. It is quite possible font related. Something I realise I've omitted from the ADF so will check my disk contents and see if there is a fonts directory which could explain the random characters.

emufan - thanks for checking! Appreciate it. From memory I think you had to select a word from the list on the left you've found in the grid and then find the first letter in the grid and drag your mouse to highlight the word then let go. Then again, I also realise I seem to have several different Wordsearch programs on my original ADF disk in various stages so need to check for definite WHAT one is the latest "working" version. D'oh me. I'll get there.

Lonewolf10 - appreciate you going to take a look.

I really appreciate the feedback! It doesn't help that I'm out of touch with AMOS.

Curiously, my version of AMOS Pro doesn't seem to want to load under Quickstart A500 mode yet I thought there wasn't a A1200 specific version? Or have I got that wrong.


*EDIT*

Removed adf from The Zone and uploaded another that includes font directory and file. New file is: Wordsearch_V2.adf

Last edited by quahappy; 15 June 2015 at 00:20.
quahappy is offline  
Old 15 June 2015, 01:55   #5
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
I for myself forgot too much from the past aswell, so your not alone with this
I'm into AMOS for some days only, just compiling some things, no clue about the language itself. so I cannot help to verify the code.
What i heard there was no A1200 version - no AGA chipset support ( but there was a hack with direct programing the chipset to enable AGA support ).
Quickstart A500 - maybe you should configure 1MB chip and 8MB fast memory. this may help.

edit:Wordsearch_V2.adf i copied the font to my hardrive. changed the two lines as above.
maybe you can write the code like that:
Code:
´Load FONTS
Assign "Wordsearch_v2:" To "DF0:"
Dir$="Wordsearch_V2:"
Assign "Fonts:" To "Wordsearch_V2:Fonts"
the game plays as seen before. still i do not understand how to play, but thats ok.

I hope Lonewolf is more of a help. but i keep testing , if you have something new

Last edited by emufan; 15 June 2015 at 02:12.
emufan is offline  
Old 15 June 2015, 19:09   #6
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
I also had font problems, so removed font related lines. Things worked, but cursor failed to highlight the correct letters - I doubt this is font related as there is a border surrounding the crossword. A partial fix is to change the following lines (lines 292 and 293):

Code:
X=X Screen(X Mouse)
Y=Y Screen(Y mouse)
to...

Code:
X=X Mouse-136
Y=Y Mouse-42
However, moving the cursor too fast can throw off the highlighting!


I'll download the updated ADF too.


Edit: I haven't crashed it yet, but another likely cause of crashing is that you accidentally Poke outside a bank - either after it, or poke/doke/loke directly into the lower part of RAM that contains the copy of the ROM.


Edit2: Using the latest ADF (Wordsearch_V2) the fonts mean that the above correction to the Y coordinate is no longer necessary, but the X coordinate still needs changing so that the mouse highlights the correct letter (most of the time - again quick movement throws it off!)

Clicking on the letters in the wordsearch grid can cause an "illegal function call at line 441" error. I tracked it down to the fact that once NEW_WORD$ exceeds 20 characters in length, it causes the error. The fix is to add the highlighted line at (or around) line 445:

Code:
   Ink 13,0
   Set Font 4
   NW$=" "+NEW_WORD$+Space$(19-Len(NEW_WORD$))
   NEW_WORD$="": Rem this is new line <<<<<<<<<<<<<<<<<<
   Text 180,254,NW$
   Set Font 3
End If

Once this is done, I can see (by printing variable NW$ at coords 0,0) that NW$ doesn't appear to do any direction detection - another words, it always contains the highlighted letter, followed by a sequence of letters that appear to be from a random direction...

Last edited by Lonewolf10; 15 June 2015 at 20:52.
Lonewolf10 is offline  
Old 15 June 2015, 21:34   #7
quahappy
Born again WinUAE user
 
quahappy's Avatar
 
Join Date: Mar 2006
Location: South Yorkshire, UK
Age: 56
Posts: 1,667
You've certainly been busy Lonewolf10 and emufan! Can't tell you how much I appreciate this - thank you.

Been a tad manic today so not had time to figure out if indeed the AMOS program in The Zone is the most recent one I worked on 20+ years ago. The other versions I have appear to be in lo-res with a completely different font (and out of line too) but the fact remains I had abandoned everything which would had been the year when I lost four members of my family all months apart. Think that's one reason why my memory is so hazy when it comes to AMOS now. I am determined to get back into it again.

Anyhow, I'm waffling! I will implement what you have done and further digest my code and other programs and fathom out what's what. I was convinced that the Zoned program was the completed one (at least for finding all the words in the grid) - how wrong could I be lol.

I will of course give a progress report as and when I get round to it.
quahappy is offline  
Old 16 June 2015, 02:18   #8
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
hard times you had, sorry to read this.

and as a thought, lonewolf is of a good help. maybe on the next version I will understand how to play
emufan is offline  
Old 22 June 2015, 21:54   #9
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
quahappy, any luck finding better versions???


Meanwhile... I have fixed a few more bugs:

- The 'random direction' issue was because I fixed one mouse issue and missed another later in the code!
- Text overwriting on the crossword has also been fixed (a maths issue with the X coord, possibly due to a miscalculation or more likely a different font being used originally for the crossword).

Rather than document the changes, I have uploaded an .ADF to The Zone. It contains the original version, plus my updated version ("For_EAB_LW10.AMOS" or something similar). Most of my changes are flagged with a Rem statement afterwards stating "Added by LW10".
Lonewolf10 is offline  
Old 22 June 2015, 22:22   #10
quahappy
Born again WinUAE user
 
quahappy's Avatar
 
Join Date: Mar 2006
Location: South Yorkshire, UK
Age: 56
Posts: 1,667
Quote:
Originally Posted by Lonewolf10 View Post
quahappy, any luck finding better versions???
I've been completing 20+ years old artwork in DPaint (thread elsewhere).

The other versions on my WordsearchV2 adf disk seem to contain older versions plus A word editor (input title and words), a load/save section and a low-res version that appears to be well messed up. Curse my memory - gets me frustrated not recalling what I actually had done.

Quote:
Originally Posted by Lonewolf10 View Post
Meanwhile... I have fixed a few more bugs:

- The 'random direction' issue was because I fixed one mouse issue and missed another later in the code!
- Text overwriting on the crossword has also been fixed (a maths issue with the X coord, possibly due to a miscalculation or more likely a different font being used originally for the crossword).

Rather than document the changes, I have uploaded an .ADF to The Zone. It contains the original version, plus my updated version ("For_EAB_LW10.AMOS" or something similar). Most of my changes are flagged with a Rem statement afterwards stating "Added by LW10".
Thanks for this - really appreciated!

I will eventually get round to working on this again. I think chances are I may have to start again. I was impressed with my original code back then whereby a grid was quickly compiled. It seems the actual "gameplay" section is what I seem to have screwed up on.

I will indeed download your file from The Zone and take a look though. Thanks again for your time in debugging my code though.
quahappy is offline  
Old 22 June 2015, 23:10   #11
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
I wouldn't start again just yet. It isn't that far away from working properly

Oh, the text overwriting will be in a different colour... this was deliberate on my part to help me work out the new from the old... but I forgot to change the colour back before uploading...
Lonewolf10 is offline  
Old 22 June 2015, 23:35   #12
quahappy
Born again WinUAE user
 
quahappy's Avatar
 
Join Date: Mar 2006
Location: South Yorkshire, UK
Age: 56
Posts: 1,667
Heh heh. Just checked and the font is indeed wrong at the mo.

Sadly though - I still seem to be experiencing the same problem where AMOS Pro freezes and the system restarts about 10 seconds after the grid is compiled.

May I ask what WinUAE version/configuration you are using and the AMOS Pro version, Lonewolf10? My current config in WinUAE (latest stable release) is Quickstart A1200 (have tried with extra RAM too) and AMOS Pro V2.0.
quahappy is offline  
Old 23 June 2015, 22:05   #13
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
The latest version is uploaded to The Zone (and I pulled yesterdays version).

Everything is working now... except highlighting words found on the wordsearch (I simply got it to do black text on white background) - this is gonna be the trickiest to get working.

The list of words fully works. Hold down left mouse button to make list scrollable (black text / highlighting turns red), move mouse over words to find out which ones haven't been found - ones with black background / highlighting need to be found.

To select words on the wordsearch press left mouse button, and drag (at any speed - yup, fixed that bug - dodgy calculation!) the mouse to the end of the word. Top left NW$ is displayed to show how much of the word is picked up. Press left mouse button again to mark end of word


I haven't had any issues in WinUAE. I am using an *old* version though (2.0.1) with an A600 configuration. FYI, AMOS was always stable on my real A600 unless I corrupted system memory etc.
Lonewolf10 is offline  
Old 26 June 2015, 22:47   #14
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Ok, complete fully working version is now in the zone. New features include:

- letters highlighted when selecting words
- words highlighted in the grid when found
- no bugs!

The file you want is called "Fir_EAB_LW10v2a.AMOS" (or similar).


quahappy, I left some comments in the code at the start about what the main issues were. The original bad code is left in and has been commented out (with `s), along with the print and text statements I used to help me debug your code.

I am now leaving any further development entirely up to you, quahappy. I enjoyed the break from working on my own projects
Lonewolf10 is offline  
Old 27 June 2015, 22:49   #15
quahappy
Born again WinUAE user
 
quahappy's Avatar
 
Join Date: Mar 2006
Location: South Yorkshire, UK
Age: 56
Posts: 1,667
Wowsers, Lonewolf10! Can't even begin to tell you how thankful I am.

Been stupidly busy the past two days (completely unplanned) but I'm hoping tomorrow will grace me with time to myself - that's the theory!

Have downloaded the file from The Zone. I'm glad you enjoyed doing this and my code wasn't all that bad LOL. Like I mentioned before and as you already know, this Wordsearch project is an abandoned WIP (for reasons mentioned in another post) so if circumstances were different back then, chances are, I probably would have completed the project with the appropriate bug-fixes*. Your input and help is certainly invaluable while I re-jig my programming memory!

Thanks again.


*When I programmed Poker Mania, I believe I must had re-written it about three times - reducing lines of code and condensing commands and arrays, etc. even though the outputted results were still the same I think it was more of a test to myself to reduce lines of code lol.
quahappy is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
External windows program communicating with program running inside WinUAE xxxxx support.WinUAE 10 19 February 2013 09:27
Paint program or program....... amigagenie request.Apps 2 29 January 2013 19:56
For a beginner what Program and Program language would you recommend? amigang New to Emulation or Amiga scene 5 27 March 2012 13:06
X-Out strange hangs haynor666 project.WHDLoad 2 30 August 2008 11:44
Calling another program from a compiled Amos program...? andyr support.Apps 3 24 October 2004 23:47

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:40.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10590 seconds with 15 queries