Jake In The Caves - Illegal Function Call in 4640

Page 2/3
1 | | 3

By Manuel

Ascended (19057)

Manuel's picture

15-09-2022, 17:02

Iirc it says you need to boot with Ctrl pressed to avoid issues on MSX 2 with disk drive.

By Hit-Biter

Master (163)

Hit-Biter's picture

16-09-2022, 15:46

Hydragon wrote:
Hit-Biter wrote:

Thanks guys, I suspected it was a DATA issue. Manuel or someone can you eleborate on the ICP Program ? I assume its some sort of checksum program as i see the checksum values on the side of the listing.

That ICP program:
"Invoer Controle Programma 4" can be found on page 8 Wink

Hi Hydra, Smile That ICP checksum listing, Can it only check the basic listings in real time as i type the lines in ? I have it working but was wondering if after loading the ICP there was then a way to load a previously saved game listing for it to check ?

By Manuel

Ascended (19057)

Manuel's picture

16-09-2022, 16:34

Load it and press enter on each line to check it.

By Hit-Biter

Master (163)

Hit-Biter's picture

17-09-2022, 00:46

Manuel wrote:

Load it and press enter on each line to check it.

Simple when you know how or can gesperk nederlands Smile Just gave it a go and its working a treat. I discovered an extra ,36 data value where the should be none in the very last line of the listing line 4810 ! sigh. Now its just crashing in a different place but this makes finding difficult errors easy. Thanks to you all for your advice and pointing me to this little gem of a program. I'm going to have to learn machine code now ofc just so i can figure out how it works but i suspect its just adding ascii values or something like that.

By Briqunullus

Hero (584)

Briqunullus's picture

17-09-2022, 08:34

Well, there's a bit of history to the program. The very first version in MCM 1 worked differently. But all ICP programs from ICP2 onward use the same algorithm. Machine code was introduced in ICP3, so if you take a look at ICP2 you can study its algorithm.

As you already expected, it's adding ascii values. It works on non-tokenized Basic, so just plain text. Each ascii value is multplied by its position in the string (first position is 1). And of course it's constantly trimmed to one byte.

290 CS%=(CS%+ASC(T$)*N)MOD256

CS% is the checksum, which starts at 0 for each line of code
N is for counting, starting at 1
T$ is the Nth character of the line of code

By Hit-Biter

Master (163)

Hit-Biter's picture

17-09-2022, 21:47

Ahhh i will definitely look into that further. Right now though im Bug Hunting Big smile Ive now got an error :-

Illegal Function Call in 2180.

2180 READ A$:S$=S$+CHR$(VAL("&h"+A$))

So once more I need your help. The line itself is correct. Its ICP Value is correct so the error is somewhere else which is referred to in the Statement. So I'm expecting it to be within either A$ or S$. Ive already checked most, if not all, of the DATA Statements, The Music was first to pass, so i have now got Music working and am getting past the Music On Music Off toggle screen and when the crash occurs the Screen is displaying graphical characters instead of some text characters. So I'm getting a 'vine' graphic instead of the letter i for instance.

I feel I'm getting very close now but right now am a bit tired/sick or had too much screen time and am now going to settle down to a film for the evening as i don't relish rechecking the ENTIRE program to find this bug. However I'm thinking i can narrow the search if i understood what A$ and S$ were for and how they work in the program. I've already corrected at least 12 bugs in fact its likely near to 20 bugs. Syntax errors are now becoming easy for me to spot, I have ICP for large DATA segments that are difficult to read but bugs like this where the error/bug is not on the line specified by the computer can still be a challenge for me as im not yet fluent in the BASIC language.

By Manuel

Ascended (19057)

Manuel's picture

18-09-2022, 00:46

Check the data lines referred to in the RESTORE instruction just before this line.

By Hit-Biter

Master (163)

Hit-Biter's picture

29-09-2022, 02:10

Hey Guys, It's been a few days but I've made some progress. Ive now managed to get the game to run and it seems playable. And a lot faster than spaceman, due to the machine code routine, i guess. However without translating ALL the instructions i don't fully understand the requirements to advance to the next level. My understanding is that there are 6 levels and that on each level you need to collect a certain number of eggs before you can go through the second doorway. If memory serves, on the first level, you need either 5 or 50 eggs but I still cant seem to advance. SO I've either got a bug which is tiresome as I've done the entire checksum listing thing and it ALL seems correct now or i misunderstand the instruction due to translation issues. So if you can advise regarding how to advance and what part of the program governs this , that would be great !

My second request is if someone can cast a little light on the print statements which form the level's ! There are 6 sets of print statements comprising the 6 levels in the game and I assume the letters in the print statements are variable associated with sprite/data in some way. I'm a bit unclear on how this works. I think some letters designate egg drop zones while others designate deadly green cactus ?. I think that the Letter i is for ladders ! So a brief insight into this would be helpful and if someone is willing please tell me how the program understands that ladders are climbable, why cactus are deadly, how your character can pick up eggs when these sprites intersect ! and why the brick levels support your character while ladders allow him to pass ! Eggs for instance fall through everything until they hit brick levels but even pass through brick so I'm assuming the level design specify egg location in the print statements ! ???

Kind Regards All and Happy MSX ing Big smile

By Manuel

Ascended (19057)

Manuel's picture

29-09-2022, 07:51

You need to pick up all chicks with a minimum number per level to advance.

Each character's appearance is changed, that's why he can use print to draw the level.

By Hit-Biter

Master (163)

Hit-Biter's picture

29-09-2022, 12:14

Thank you for the clarification Manuel, I think I did say that though in my previous post and I cant quite grasp why repeating my statement to answer my query's is helpful ! I appreciate any and all help off-course but in this instance I don't feel your replay was informative or helpful. Sorry. I did indicate i knew this in my previous post ! I need help with the details i mentioned and I'm sorry if I'm missing something obvious to you but I'm a bit of a newbie with programming so I ask for your patience and understanding and please make any replays as detailed and as informative as possible as there is much i do not know yet and even more i do not understand ! Can anyone else clarify for me please ?

I already knew that you need to pick up the chicks to advance, if i said eggs earlier its because i remember Chuckie Egg from when i was a child Big smile , but I'm not sure how many are required and only assume that i have to advance to the next level by going through the door on the top right corner of the screen ! I don't know what variable is 'controlling' the chick rescue score either !

Then while i realize the characters are edited to use sprite data i don't quite understand how they are then enabled for the character to walk on them, pick them up, climb them !

Page 2/3
1 | | 3