Preppie Posted September 7, 2019 Share Posted September 7, 2019 I have the cc65 folder on my desktop and a small textfile with a C program in the cc65 folder, the question is how do I run it? I have absolutely no idea how to use the command line, I've spent an hour reading the documentation but it assume you have knowledge of command line and I'm no further forward. I'm used to clicking an icon and getting a result I'd be very grateful if someone could tell me what to type into that black screen. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 7, 2019 Share Posted September 7, 2019 Take a look at Yaron's tutorials he has posted here and here, that should be enough to get you started 1 1 Quote Link to comment Share on other sites More sharing options...
Preppie Posted September 7, 2019 Author Share Posted September 7, 2019 1 hour ago, Wrathchild said: Take a look at Yaron's tutorials he has posted here and here, that should be enough to get you started Thanks, but they assume you know what you're doing, the only thing I know about the command line is if you type 'dir' u get a directory list - all I can do is point and click. 1 Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 7, 2019 Share Posted September 7, 2019 assuming you've navigated to folder where your source is in (*) and its in, say, a single C file, then use: cl65 -t atari -O -o <filename>.xex <filename>.c The '-t' tell us the system we are targeting, '-O' is optional but good to have, it tells the toolset to use the optimzer. We can specify the output filename with '-o', useful to have the xex extension so it can be opened in Altirra by association. Finally the files to build from are listed, so in this case just "<filename>.c" (*) A useful tip for windows command boxes is to type "CD" then a space and if you have your source folder opened in an explorer window, you can drag-drop the folder into the command box and it will paste the path onto the command line. Hit 'Enter/Return' to effect the change of directory. Note, if your source is on a different drive you'll need to change to that before/after the CD. Do that by, for example, typing "D:" and return. 2 3 Quote Link to comment Share on other sites More sharing options...
Preppie Posted September 7, 2019 Author Share Posted September 7, 2019 (edited) Ok, after some searching through the cc65 folder I found the cl65.exe in the bin folder. Moved my C txt file to the bin folder then used the newly discovered cd command to move to the bin folder and execute the command you gave me. This may be totally obvious to you guys but not to a complete novice, or maybe I've done it all wrong but somehow it worked anyway lol Thanks wrathchild for holding my hand Edited September 7, 2019 by Preppie Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 7, 2019 Share Posted September 7, 2019 (edited) Happy to help. Another tip then. In the cc65 folder I'd have batch file that sets up the environment. Leave your sources in its own folder, e.g. "C:\CC65\PROJECTS\MY_TEST" After the command window is opened, 'cd' to "C:\CC65" and then run the batch file "CC65VARS". This adds CC65's binary folder to the set of folders searched when you run an program. CC65 also needs a could of environment variables so these are set too. (though I think more recent versions may take care of that for you but its not going to hurt to set these anyway) now you can "CD PROJECTS\MY_TEST" and just run cl65 from the command line. Good luck! @echo off rem echo Setting environment for using CC65 tools. rem set PATH=c:\cc65\bin;%PATH% set CC65_INC=c:\cc65\include set CC65_LIB=c:\cc65\lib CC65VARS.BAT Edited September 7, 2019 by Wrathchild attached file was for D: drive, replace with one for C: Quote Link to comment Share on other sites More sharing options...
Preppie Posted September 7, 2019 Author Share Posted September 7, 2019 I couldn't get that bat file thing working but no worries, as long as I can compile the C files I don't mind having them in the bin folder. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 7, 2019 Share Posted September 7, 2019 (edited) try the replaced version, the first one I posted referred to the D drive, not C Edited September 7, 2019 by Wrathchild first comma in wrong place Quote Link to comment Share on other sites More sharing options...
Preppie Posted September 7, 2019 Author Share Posted September 7, 2019 That didn't work either then I realised cc65 was on desktop so I moved it to be directly on the C drive and that solved it Thanks again, now all I have to do is learn how to code C. Quote Link to comment Share on other sites More sharing options...
devwebcl Posted September 8, 2019 Share Posted September 8, 2019 4 hours ago, Wrathchild said: Happy to help. Another tip then. In the cc65 folder I'd have batch file that sets up the environment. Leave your sources in its own folder, e.g. "C:\CC65\PROJECTS\MY_TEST" After the command window is opened, 'cd' to "C:\CC65" and then run the batch file "CC65VARS". This adds CC65's binary folder to the set of folders searched when you run an program. CC65 also needs a could of environment variables so these are set too. (though I think more recent versions may take care of that for you but its not going to hurt to set these anyway) now you can "CD PROJECTS\MY_TEST" and just run cl65 from the command line. Good luck! @echo off rem echo Setting environment for using CC65 tools. rem set PATH=c:\cc65\bin;%PATH% set CC65_INC=c:\cc65\include set CC65_LIB=c:\cc65\lib CC65VARS.BAT 152 B · 1 download for newer cc65 version the environment variable is CC65_HOME i.e.: set CC65_HOME=C:\CC65 Quote Link to comment Share on other sites More sharing options...
baktra Posted September 8, 2019 Share Posted September 8, 2019 Once you feel more confident with the command line, you can try installing MSYS2 or any similar environment to get full Unix-like command line. However, PowerShell could be also good option to control your CC65. And there are other goodies... https://github.com/cc65/wiki/wiki/Using-cc65-with-Visual-Studio-Code which will get you a decent IDE for CC65/CA65. 1 Quote Link to comment Share on other sites More sharing options...
baktra Posted September 8, 2019 Share Posted September 8, 2019 10 hours ago, Preppie said: That didn't work either then I realised cc65 was on desktop so I moved it to be directly on the C drive and that solved it Thanks again, now all I have to do is learn how to code C. Good luck with that. My experience with CC65 was the following (I knew C before): 1. Wow, now I can create high performance games in a language other than assembler! 2. Where are libraries for platform-dependent functions (graphics, sound, controls, PMG, DLIST, DLI, VBI)? 3. Eh, I have to write them myself, and at least partially in assembler! 4. How do I mix assembler and c code? It seems impossible! 5. No, no, no, it is pretty easy to do it, if you know how LD65 works. 6. Ooops, the LD65 has so steep learning curve! The atari.cfg file is so cryptic! 7. I have it, assembler, display list, graphics data, character sets included with LD65. And all loaded to proper addresses. 8. Engine for BAHA Software's TRAIN game is born. A joy! 1 Quote Link to comment Share on other sites More sharing options...
Preppie Posted September 8, 2019 Author Share Posted September 8, 2019 Having not written in C before I have no expectations, and I don't mind spending a bit of time and effort learning a new language, I just think having to learn something just to run a program is a bit crazy when point and click has been around for decades. I don't mind doing a bit of assembler. My current game is in FastBasic with an assembler VBI to display the graphics, but writting a full assembler program is a bit daunting so I thought C might get me a bit of extra speed for when I need it. It would be cool to be able to code in VS or notepad++ and press a button to get the program to run but looking at this page https://marketplace.visualstudio.com/items?itemName=SharpNinja.cc65 with it's talk of extension setting and config files just sounds like gobbledygook to me. On top of that, pressing the install button does nothing anyway. The main thing is that I can now run a C program so I can do some speed tests and see how much faster it is than FastBasic (if at all, i have no idea atm) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.