Post by Pinacolada on Oct 11, 2006 14:09:18 GMT -5
Well, I did it. I came up with an INSTRing routine that mostly works! I don't have the source with me (will post it my next trip to the library... I'm on my mom's laptop which she let me borrow, and using my wireless network card... yay!)... it took me a while to get to where it worked... takes the form of:
I% integer variable has to be defined before the call (holds match result)
SYS 49152,<source expression>,<match expression>
PRINT I%
So for my adventure game, this is an example call:
SYS 49152,"M.3XDRAGON!|<<.-","|"
That'd search for the | delimiter within the first string. Works great, except if there's a multiple-character match, it returns the LAST position of the match instead of the first. So I've got some INC statements goofed up somewhere. But I've really learned a lot so far. I'm using Jim Butterfield's SUPERMON+64, and (for now) assembling code using Craig Bruce's ACEssembler. Pretty handy. I guess I could download Turbo Assembler, but there's so many versions out there, you guys have any ideas which one's best for a beginner? I have to admit the "load ACE, edit source, assemble, reboot back into C64 mode (the top of memory or application space pointer is messed up on the C64 side of things, and so there's never enough room to assemble the entire program in C64 mode), load the BASIC test program, load the ML segment" gets pretty repetitive and tiresome... heh
But it's a good learning experience... that's for sure. It's good to use BRKs and examine memory, make sure things are getting put where you want, two-byte addresses in the right high/low byte format, etc...
Next I might work on a word wrap routine... that might be a bit harder... I know stuff like this is in DotBASIC, but I could use the practice and the "from the ground up" experience writing the code... it's kind of fun
- Ryan
Works fine
I% integer variable has to be defined before the call (holds match result)
SYS 49152,<source expression>,<match expression>
PRINT I%
So for my adventure game, this is an example call:
SYS 49152,"M.3XDRAGON!|<<.-","|"
That'd search for the | delimiter within the first string. Works great, except if there's a multiple-character match, it returns the LAST position of the match instead of the first. So I've got some INC statements goofed up somewhere. But I've really learned a lot so far. I'm using Jim Butterfield's SUPERMON+64, and (for now) assembling code using Craig Bruce's ACEssembler. Pretty handy. I guess I could download Turbo Assembler, but there's so many versions out there, you guys have any ideas which one's best for a beginner? I have to admit the "load ACE, edit source, assemble, reboot back into C64 mode (the top of memory or application space pointer is messed up on the C64 side of things, and so there's never enough room to assemble the entire program in C64 mode), load the BASIC test program, load the ML segment" gets pretty repetitive and tiresome... heh
But it's a good learning experience... that's for sure. It's good to use BRKs and examine memory, make sure things are getting put where you want, two-byte addresses in the right high/low byte format, etc...
Next I might work on a word wrap routine... that might be a bit harder... I know stuff like this is in DotBASIC, but I could use the practice and the "from the ground up" experience writing the code... it's kind of fun
- Ryan
Works fine