Harry Potter Posted January 30, 2021 Share Posted January 30, 2021 How do I compile a program for the Atari using cc65 and run it on an emulator? I have DIR2ATR and Altirra. Quote Link to comment Share on other sites More sharing options...
zbyti Posted January 30, 2021 Share Posted January 30, 2021 (edited) cl65 -t atari -Osir -Cl --listing foo.c.lst --add-source -o foo.c.xex foo.c cl65 -t atari -Osir -Cl -o foo.xex foo.c Edited January 30, 2021 by zbyti Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 30, 2021 Author Share Posted January 30, 2021 Thank you. Now, how do I find out the used size of a memory area in cc65? Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted January 30, 2021 Share Posted January 30, 2021 Same as other targets, just include the outputting of the map file on the command line Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 30, 2021 Author Share Posted January 30, 2021 Thank you. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 30, 2021 Author Share Posted January 30, 2021 Okay. I built the file and ran it directly in the emulator. It didn't work. I used Dir2Atr to turn it into a disk image. The emulator kept rebooting. I added the DOS.SYS file, renamed the executable to AUTORUN.XEX and built the image as a DOS20 image. I now get a program error. Am I doing something wrong? Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted January 30, 2021 Share Posted January 30, 2021 Does the XEX run by itself fine in the emulator? XEX is not an extension that is know by DOS, that would be SYS Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 31, 2021 Author Share Posted January 31, 2021 No, it doesn't. I will try the renaming now. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted January 31, 2021 Share Posted January 31, 2021 run Altirra with debugger mode enabled and then load (e.g. drag/drop) your binary the console area should provide output on how it is being loaded either feed that back here or post a small example project of what you are doing Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 31, 2021 Author Share Posted January 31, 2021 I am working on an Atari port of my CBMSimpleIO library, which is a cc65 library that shortens code overhead if you only need basic console I/O by calling the ROM routines directly. Following is the main() function of the test code: void main() { //unsigned i; unsigned char c; char s[81]; writetitle ("Happy-Face!"); prints ("Testing, 1, 2, 3, testing!\n"); printcr (); printu (0); printcr(); printu (401); printcr(); printi(1); printc(','); printi(-1); printcr(); printscr("Press any key to continue..."); printc(getkey()); printscr ("\nNow type in a line:"); c=getline(s); prints ("\nLen: "); printu (c); prints ("\nLine: "); printscr (s); getkey(); taby=0; tabx=10; printrscr ("<--->"); tabx=9; printrscr ("<--->"); //goline (21); prints ("End!"); taby=20; prints ("End!"); //goline (0); } My printc code: _printc=$f6a4 My getkey code: _getkey=$f6e2 Both functions ae declared as __fastcall__, so that couldn't be the issue. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted January 31, 2021 Share Posted January 31, 2021 Probably a rabbit hole you don't want to go down as different A8 OS ROMS will have different entry points for these and different devices (S:, E: K:) handle these for you. You can use a trampoline vector and set the OS entry point by obtaining it from the device table, read here. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 31, 2021 Author Share Posted January 31, 2021 Okay, it works now. Just two problems: I still need to fix the keyboard handler, and the program beeps many times at start-up. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted January 31, 2021 Author Share Posted January 31, 2021 How do I get a key and a line from the user? 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.