+karri Posted February 25, 2017 Share Posted February 25, 2017 (edited) Hi guys. Today I again got questions of how to set up stuff for Windows. As I found an old laptop I decided to give it a try. 1) Run http://www.cygwin.com/setup-x86_64.exe This is because the Windows was a 64 bit version. For a 32 bit version you have to install setup-x86.exe instead. During installation I just clicked "Next" to everything except to the screen "Select packages". Here I added the first versions of gcc core git make 2) Open a Cygwin shell by clicking on the Cygwin icon on the desktop. Type: git clone https://bitbucket.org/atarilynx/lynx.git This will fetch the C-compiler cc65 sources from the net. Then we need to compile and install everything. Type: cd lynx/tools/cc65 make -f make/gcc.mak make -f make/gcc.mak install Now we are ready to develop the first Lynx program. Create a file called main.c and save it to C:/cygwin86/home/user/ #include <lynx.h> #include <tgi.h> #include <joystick.h> #include <6502.h> int main() { joy_install(&lynx_stdjoy); tgi_install(&lynx_160_102_16); tgi_init(); CLI(); while (tgi_busy()) ; tgi_setcolor(COLOR_GREEN); tgi_outtextxy(10, 10, "Hello World!"); tgi_updatedisplay(); while (1) ; return 1; } Compile it by typing this: cl65 -t lynx -o main.lnx main.c You should now have a game called main.lnx in C:/cygwin86/home/user/ Edited March 5, 2017 by karri 3 Quote Link to comment Share on other sites More sharing options...
peekb Posted February 25, 2017 Share Posted February 25, 2017 If you're on Windows 10, you could also do this with Bash on Windows -> https://msdn.microsoft.com/en-us/commandline/wsl/install_guide That said, I've been using the "real" cc65 located on github, built for Windows myself, and I'm having zero problems with Lynx dev...why is there a separate repo/branch that you're maintaining? I'm sure there's some history I'm missing. Quote Link to comment Share on other sites More sharing options...
+karri Posted February 25, 2017 Author Share Posted February 25, 2017 If you're on Windows 10, you could also do this with Bash on Windows -> https://msdn.microsoft.com/en-us/commandline/wsl/install_guide That said, I've been using the "real" cc65 located on github, built for Windows myself, and I'm having zero problems with Lynx dev...why is there a separate repo/branch that you're maintaining? I'm sure there's some history I'm missing. My repo is just a few years old, frozen in time. The reason why it exists is that I never got the segments to work correctly on the new version of the cc65. Once it works ok I could update. Quote Link to comment Share on other sites More sharing options...
peekb Posted February 25, 2017 Share Posted February 25, 2017 My repo is just a few years old, frozen in time. The reason why it exists is that I never got the segments to work correctly on the new version of the cc65. Once it works ok I could update. Interesting. I'm just using the default segment config, but perhaps if I were to do something more complex I'll run into it. Good to know, thanks for the info! Quote Link to comment Share on other sites More sharing options...
+karri Posted February 25, 2017 Author Share Posted February 25, 2017 Interesting. I'm just using the default segment config, but perhaps if I were to do something more complex I'll run into it. Good to know, thanks for the info! I had problems with the 7DRL competition. "Shaken, not stirred" had mysterious crashes with the latest cc65. When I rolled back to older compilers the newest working one is the one I have been using since. The old compiler also created tighter code than the new one. Some of my old games did not fit in the rom with the newer compiler anymore. Quote Link to comment Share on other sites More sharing options...
+karri Posted February 26, 2017 Author Share Posted February 26, 2017 There is another detail in my version too. In most development chains you need sprpck.exe to turn a bitmap to a sprite. In my version there is a native tool for the cc65 chain called sp65. It will turn a bitmap into a sprite as a C-file. bd000001.o : bd.pcx $(SP) -r $< --slice 10,0,10,10 -c lynx-sprite,mode=packed,ax=4,ay=0 -w $*.c,ident=$* $(CC) -o $*.s $*.c $(AS) -o $*.o $*.s $(RM) $*.c $(RM) $*.s It also supports the modes literal, packed and shaped. The shaped mode can use all 16 colours while still having a form. No transparent pixels required. This is not supported by sprpck.exe. It also supports an anchor point ax=0,ay=0 and you can slice a bit of the bitmap for the sprite --slice x,y,w,h The reason for not using sprpck.exe is that it requires a lot of extra libraries and the license is not flexible enough to have it as a cc65 tool. So after some discussions with the cc65 core developers we decided to create sp65. It works on other machine architectures also like Apple. Quote Link to comment Share on other sites More sharing options...
LX.NET Posted March 2, 2017 Share Posted March 2, 2017 Tried following this Karri, but got stuck at the line make -f make/gcc.mak install which gave me the following error: If you are denied permission to install or uninstall this package, then you will need to do "make/gcc.mak install" or "make/gcc.mak uninstall" as either the root user or an administrator. for f in ar65 ca65 cc65 cl65 co65 da65 ld65 od65 grc65 sp65; \ do make/install-sh -c -m 755 -s src/$f/$f.exe /usr/local/bin || exit $?; \ done install: cannot stat 'src/ar65/ar65.exe': No such file or directory make: *** [make/gcc.mak:151: install-bins] Error 1 Any advice here? Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted March 2, 2017 Share Posted March 2, 2017 I got stuck at the same place, I googled it and it seems it might have to do with line breaks, I found some tools for converting the files but I'm not sure using those is the best approach, Quote Link to comment Share on other sites More sharing options...
Songbird Posted March 3, 2017 Share Posted March 3, 2017 Karri, thanks for writing this up! It's been so long since I worked on a Lynx game in C that there was no TGI lib when I used CC65. I would really like to do a Lynx game again, and when I'm ready, this will be a great reference. Quote Link to comment Share on other sites More sharing options...
+karri Posted March 3, 2017 Author Share Posted March 3, 2017 (edited) Tried following this Karri, but got stuck at the line make -f make/gcc.mak install which gave me the following error: If you are denied permission to install or uninstall this package, then you will need to do "make/gcc.mak install" or "make/gcc.mak uninstall" as either the root user or an administrator. for f in ar65 ca65 cc65 cl65 co65 da65 ld65 od65 grc65 sp65; \ do make/install-sh -c -m 755 -s src/$f/$f.exe /usr/local/bin || exit $?; \ done install: cannot stat 'src/ar65/ar65.exe': No such file or directory make: *** [make/gcc.mak:151: install-bins] Error 1 Any advice here? What I did was to 1st run this as a user make -f make/gcc.mak and after it has compiled sudo make -f make/gcc.mak install I did not need to do anything to line breaks. It just worked on Window 8.1. Edited March 5, 2017 by karri Quote Link to comment Share on other sites More sharing options...
+karri Posted March 3, 2017 Author Share Posted March 3, 2017 I did write a small template for using segments, chipper sounds, tgi, joystick and eeproms on a small game. But I am in Munich right now working with dancing for the week-end. So it has to wait. Quote Link to comment Share on other sites More sharing options...
LX.NET Posted March 3, 2017 Share Posted March 3, 2017 sudo does not seem to be recognized from the setup above Quote Link to comment Share on other sites More sharing options...
+karri Posted March 4, 2017 Author Share Posted March 4, 2017 sudo does not seem to be recognized from the setup above Sorry my error. I do not have sudo on my setup either. Forget about the sudo. But I did run the make and make install separately. I also ran the stuff as a user - not as admin. But perhaps my user has more rights than a guest? I feel so stupid when I have not run Windows for years... Quote Link to comment Share on other sites More sharing options...
LX.NET Posted March 4, 2017 Share Posted March 4, 2017 Running: make -f make/gcc.mak and then make -f make/gcc.mak install seems to work. Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted March 4, 2017 Share Posted March 4, 2017 (edited) Hmm, I wasn't able to get it to work tonight. I guess the command not found might just be some path issue or missing dependency. If someone sees something really apparent, please point me in the correct direction: Sampo@Rintanen ~/lynx/tools/cc65 $ make -f make/gcc.mak make[1]: Entering directory '/home/Sampo/lynx/tools/cc65/src' make -C common -f make/gcc.mak make[2]: Entering directory '/home/Sampo/lynx/tools/cc65/src/common' Creating dependency information gcc -g -O2 -Wall -W -std=c89 -MM abend.c addrsize.c alignment.c assertion.c bito ps.c chartype.c check.c cmdline.c coll.c cpu.c debugflag.c exprdefs.c fileid.c f ilepos.c filestat.c filetime.c filetype.c fname.c fp.c gentype.c hashfunc.c hash tab.c intstack.c matchpat.c mmodel.c print.c searchpath.c segnames.c shift.c str buf.c strpool.c strstack.c strutil.c target.c tgttrans.c version.c xmalloc.c xsp rintf.c > .depend /bin/sh: gcc: command not found make[2]: *** [make/gcc.mak:86: depend] Error 127 make[2]: Leaving directory '/home/Sampo/lynx/tools/cc65/src/common' make[1]: *** [make/gcc.mak:26: common] Error 2 make[1]: Leaving directory '/home/Sampo/lynx/tools/cc65/src' make: *** [make/gcc.mak:65: bins] Error 2 Sampo@Rintanen ~/lynx/tools/cc65 $ make -f make/gcc.mak install If you are denied permission to install or uninstall this package, then you will need to do "make/gcc.mak install" or "make/gcc.mak uninstall" as either the root user or an administrator. mkdir -m 755 -p /usr/local/share || mkdir -m 755 /usr/local/share mkdir -m 755 -p /usr/local/share/doc || mkdir -m 755 /usr/local/share/doc mkdir -m 755 -p /usr/local/share/doc/cc65 || mkdir -m 755 /usr/local/share/doc/cc65 mkdir -m 755 -p /usr/local/lib/cc65 || mkdir -m 755 /usr/local/lib/cc65 mkdir -m 755 -p /usr/local/lib/cc65/asminc || mkdir -m 755 /usr/local/lib/cc65/asminc mkdir -m 755 -p /usr/local/lib/cc65/include || mkdir -m 755 /usr/local/lib/cc65/include mkdir -m 755 /usr/local/lib/cc65/include/em mkdir -m 755 /usr/local/lib/cc65/include/geos mkdir -m 755 /usr/local/lib/cc65/include/joystick mkdir -m 755 /usr/local/lib/cc65/include/mouse mkdir -m 755 /usr/local/lib/cc65/include/sys mkdir -m 755 /usr/local/lib/cc65/include/tgi mkdir -m 755 -p /usr/local/lib/cc65/cfg || mkdir -m 755 /usr/local/lib/cc65/cfg mkdir -m 755 -p /usr/local/lib/cc65/lib || mkdir -m 755 /usr/local/lib/cc65/lib mkdir -m 755 -p /usr/local/lib/cc65/obj || mkdir -m 755 /usr/local/lib/cc65/obj mkdir -m 755 /usr/local/lib/cc65/emd mkdir -m 755 /usr/local/lib/cc65/joy mkdir -m 755 /usr/local/lib/cc65/mou mkdir -m 755 /usr/local/lib/cc65/ser for f in ar65 ca65 cc65 cl65 co65 da65 ld65 od65 grc65 sp65; \ do make/install-sh -c -m 755 -s src/$f/$f.exe /usr/local/bin || exit $?; \ done install: cannot stat 'src/ar65/ar65.exe': No such file or directory make: *** [make/gcc.mak:151: install-bins] Error 1 Sampo@Rintanen ~/lynx/tools/cc65 Edited March 4, 2017 by Turbo Laser Lynx Quote Link to comment Share on other sites More sharing options...
LX.NET Posted March 4, 2017 Share Posted March 4, 2017 Did you install gcc core? Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted March 5, 2017 Share Posted March 5, 2017 (edited) the cygwin installer/setup says I have 'djgpp-gcc-core: GCC for DJGPP toolchain ( C )' installed, but there's four other gcc cores here on the list with bigger file-size. The one I installed was just furthest up the list when I searched for pakages, maybe I should just try with some other one. Edited March 5, 2017 by Turbo Laser Lynx Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted March 5, 2017 Share Posted March 5, 2017 (edited) I installed another gcc core but it still complains about gcc: Command not found. I googled it and it seems to be some path problems since gcc is installed and I see all the gcc exe files. http://askubuntu.com/questions/428220/cant-run-make-gcc-command-not-found I have to look at it later. Sampo@Rintanen ~/lynx/tools/cc65 $ make -f make/gcc.mak make[1]: Entering directory '/home/Sampo/lynx/tools/cc65/src' make -C common -f make/gcc.mak make[2]: Entering directory '/home/Sampo/lynx/tools/cc65/src/common' gcc -g -O2 -Wall -W -std=c89 -c -o abend.o abend.c make[2]: gcc: Command not found make[2]: *** [<builtin>: abend.o] Error 127 make[2]: Leaving directory '/home/Sampo/lynx/tools/cc65/src/common' make[1]: *** [make/gcc.mak:26: common] Error 2 make[1]: Leaving directory '/home/Sampo/lynx/tools/cc65/src' make: *** [make/gcc.mak:65: bins] Error 2 Sampo@Rintanen ~/lynx/tools/cc65 $ Edited March 5, 2017 by Turbo Laser Lynx Quote Link to comment Share on other sites More sharing options...
sage Posted March 5, 2017 Share Posted March 5, 2017 echo $PATH ? Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted March 6, 2017 Share Posted March 6, 2017 Sry I'm still a linux noob so I have to google almost every step. The paths are wrong and I've been trying to change them in etc/profile and etc/defaults/etc/profiles like I found somewhere when I googled, but that didn't help. I also tried adding some windows environment variables but that didn't help either. I only had limited time to put on this on the weekend but was not able to solve it :/ gcc --version doesn't work but ls /usr/bin | grep gcc shows a list of all the different gcc exe files Quote Link to comment Share on other sites More sharing options...
LX.NET Posted March 6, 2017 Share Posted March 6, 2017 Turbo, if you are on Windows and want to get the cc65 development environment running there, feel free to reach out. I use Windows as my main dev setup. Also, part 2 of the tutorial takes you through the steps to set it up. Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted March 7, 2017 Share Posted March 7, 2017 (edited) I was just going to try this cygwin thing as it seemed so easy and it might have made my workflow a bit less silly, but I'm really happy with my raspberry pi setup since at least it's working! I don't want to waste my precious spare time fighting tools when I have one working setup. I have so many important Lynx and non-Lynx projects, and I'm spread so thin time-wise at the moment. Thanks so much for offering help though, that's very kind! By the way, I've read all of your tutorials many times and they're really great! I never got around trying your Visual Studio setup since I was not sure if it's 100% compatible with Karri's stuff (which I would need it to be). Edited March 7, 2017 by Turbo Laser Lynx Quote Link to comment Share on other sites More sharing options...
LX.NET Posted March 7, 2017 Share Posted March 7, 2017 Let me work on the Karri compatibility for a Visual Studio setup. I think I can make that work. Quote Link to comment Share on other sites More sharing options...
Positron5 Posted March 12, 2017 Share Posted March 12, 2017 Hi Karri. I followed your instructions and I managed to install cc65 for Windows8.1. I hope to play around with the Shakennotstirred game code a little. p.s I put main.c in c:\cygwin64\home\user instead of c:\cygwin86\user -possible typo?. Cheers Quote Link to comment Share on other sites More sharing options...
+karri Posted March 12, 2017 Author Share Posted March 12, 2017 Shaken not stirred... You could pick an older variant to get it going. The trunk is now under development. 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.