C programming • Re: Launch c program with parameters
Defence Force » C programming
by waskol
3w ago
May be I am wrong but I think there's no use to pass parameters to C program with an Oric. Just write your parameters in a specific memory area from the "calling program" and read them back from the c program. PEEK/POKE way (in ORIC.H) : #define peek(a) mem[a] #define deek(a) (* (int *)(mem+a)) #define poke(a,x) (mem[a]=(x)) #define doke(a,x) (* (int *)(mem+a) = (x)) Statistics: Posted by waskol — Sun Mar 31, 2024 6:20 am ..read more
Visit website
C programming • Re: Launch c program with parameters
Defence Force » C programming
by iss
1M ago
Hi, @jacqu! Passing parameters to a program turned to be a real challenge! Dbug's idea is the only way for an universal solution and (after lot hours ) I have it working ! Reading CC65 docs is really helpful, take a look also in the sources of the CC65 standard library. I need some time to polish the code and update my openOricLibrary - I hope to do it this week! The problem is really very interesting for hacking, don't hesitate to dive into it. So far I found 3 hidden traps!!! Statistics: Posted by iss — Mon Mar 18, 2024 9:46 pm ..read more
Visit website
C programming • Re: Launch c program with parameters
Defence Force » C programming
by jacqu
1M ago
Hi ibisum, Seems that I did not read the doc until the end: CC65 already implements some main() function args parsing method based on the very same idea than Dbug’s one. Though, Dbug’s approach of using ‘ instead of REM seems to be more compact and elegant. I’m planning to write a wysiwyg text editor for Oric with encryption feature. With such an app, I might have finally found some serious usefulness for this old machine in 2024 (this does not mean that I don’t appreciate the fun part of the hobby. For example, I’m really looking forward to playing Dbug’s new game in gestation). I’m still ..read more
Visit website
C programming • Re: Launch c program with parameters
Defence Force » C programming
by ibisum
1M ago
jacqu, if you figure this out, perhaps we could do a C implementation that could be plonked into the OSDK, as well? Its something I've often thought about, but never considered there wouldn't be a std arg parser in the C lib .. Statistics: Posted by ibisum — Mon Mar 18, 2024 5:34 pm ..read more
Visit website
C programming • Re: Launch c program with parameters
Defence Force » C programming
by jacqu
1M ago
Thanks for the tip Dbug ! I'd never have thought of doing it that way. Statistics: Posted by jacqu — Sat Mar 16, 2024 5:30 pm ..read more
Visit website
C programming • Re: Launch c program with parameters
Defence Force » C programming
by Dbug
1M ago
As far as I know, neither SEDORIC or TDOS have a way to pass parameters to executables when they are launched. That being said, I did a quick test using a comment after the command, and it seems to still be present in the command buffer in page zero. As you can see both my 'WHATEVER and 'DBUG TEST are still visible at offset $5A, I'm not sure these are guaranteed to be valid, but that could possibly be a way worth exploring: Launch whatever command you want, and have the parameters as a comment. Now, does that work if a command is passed from a script or other program, no idea. Statistics ..read more
Visit website
C programming • Launch c program with parameters
Defence Force » C programming
by jacqu
1M ago
Hi! Is there a way to launch a CC65 compiled program with parameters ? For example, suppose I compiled a program called "ED" to edit some text file on the disk. If I want to call "ED" with a parameter giving the name of the text file to be loaded, like "ED README.TXT", is it possible to pass the parameter "README.TXT" to the program "ED" ? If was thinking about using the basic "!" command, but I don't know how it could interact with a cc65 compiled program. Thanks for your feedbacks, Jacques Statistics: Posted by jacqu — Fri Mar 15, 2024 9:28 pm ..read more
Visit website
C programming • Re: Multi-Key Handling
Defence Force » C programming
by Dbug
2M ago
Yeah, we basically get the benefit of having both proper "typing" and also multi-touch testing at the same time, so technically (assuming the keyboard itself accepts it) you can do things like CTRL+SHIFT+key, mixing message sending and "action controls" if we wanted Statistics: Posted by Dbug — Mon Feb 19, 2024 11:27 am ..read more
Visit website
C programming • Re: Multi-Key Handling
Defence Force » C programming
by Chema
2M ago
Great article Dbug! You suggested me this method years ago and it works so well I've been using it since I even had a demo, but was not as nice as this one, which showed just a matrix of 0s and 1s (1s for the keys being pressed). It was indeed a smart idea! Statistics: Posted by Chema — Mon Feb 19, 2024 9:50 am ..read more
Visit website
C programming • Re: Multi-Key Handling
Defence Force » C programming
by Dbug
2M ago
Awesome tutorial, Dbug! .TAP link at the end doesn't work .. but sure is great to have the sources to understand this better. THANKS for doing this! Try again, it was a typo in the filename when I renamed it. Statistics: Posted by Dbug — Mon Feb 19, 2024 7:53 am ..read more
Visit website

Follow Defence Force » C programming on FeedSpot

Continue with Google
Continue with Apple
OR