+karri Posted October 31, 2017 Share Posted October 31, 2017 My old tablet broke and I got a brand new Huawei tablet 8" with phone capabilities for €159. The OS is much more modern than in my old tablet so I decided to try if I could write Lynx code on it. To my surprise it worked with some small tuning required. 1) Get Termux from the Google Apps store. It is free! 2) Open termux and type pkg install git make clang The clang is a C compiler required for compiling the cc65 compiler. 3) Get the latest repository from bitbucket for Lynx tools git clone https://bitbucket.org/atarilynx/lynx.git 4) The automatic build script does not work as the tablet is not rooted. So we need to build and install all tools by hand. cd lynx/tools/cc65 make -f make/clang.mak install Congrats! You now have the C-tools installed needed for compiling your code. There is one difference for running the tools. The packages are installed in a different position than before as we cannot get root access. So you need some extra parameter on the command line when compiling. I create a file Common.mk with the following content: CC=cc65 AS=ca65 CL=cl65 SP=sp65 CP=cp RM=rm -f ECHO=echo TOUCH=touch CC65_HOME=$(PREFIX)/lib/cc65 CC65_INC=$(CC65_HOME)/include CC65_ASMINC=$(CC65_HOME)/asminc # Rule for making a *.o file out of a *.c file %.o: %.c $(CC) -t lynx -I $(CC65_INC) $(CFLAGS) $(SEGMENTS) -o $(patsubst %c, %s, $(notdir $<)) $< $(AS) -t lynx -I $(CC65_ASMINC) -o $@ $(AFLAGS) $(*).s $(RM) $*.s # Rule for making a *.o file out of a *.s file %.o: %.s $(AS) -t lynx -I $(CC65_ASMINC) -o $@ $(AFLAGS) $< # Rule for making a *.c file out of a *.pcx file %.c : %.pcx $(SP) -r $< -c lynx-sprite,mode=packed -w $*.c,ident=$*,bytesperline=8 In my Makefile I can now compile something by writing: include ../Common.mk thisdir=deck1f objects= \ heartsmallf.o \ spadesmallf.o \ diamondsmallf.o \ clubssmallf.o \ all: objlist objlist: $(objects) $(RM) objlist for obj in $(objects); do $(ECHO) ../$(thisdir)/$$obj >> objlist; done clean: $(RM) objlist $(objects) I still have to figure out how to pass the compiled *lnx game to RetroArch for playing if. But there is probably some user writable directory for RetroArch. 2 Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted November 11, 2017 Share Posted November 11, 2017 (edited) Thanks for the info, that's really nice! Now family men and other kinds of busy people types can even code Lynx on the cr*pp*er and secretly underneath the sheets at night etc. Reminded me of this: Edited November 11, 2017 by Turbo Laser Lynx Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted January 17, 2018 Share Posted January 17, 2018 I wanted to try this out but I'm unsure what this error means. Maybe Android 5.0.1 is too old? 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 /data/data/com.termux/files/usr/bin || exit $?; \ done install: can't stat 'src/ar65/ar65': No such file or directory make: *** [make/clang.mak:150: install-bins] Error 1 $ Quote Link to comment Share on other sites More sharing options...
+karri Posted January 18, 2018 Author Share Posted January 18, 2018 I wanted to try this out but I'm unsure what this error means. Maybe Android 5.0.1 is too old? 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 /data/data/com.termux/files/usr/bin || exit $?; \ done install: can't stat 'src/ar65/ar65': No such file or directory make: *** [make/clang.mak:150: install-bins] Error 1 $ could you do a cd lynx/tools/cc65/src/ar65 ls This should show several *.o files and also a green ar65 binary. Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted January 18, 2018 Share Posted January 18, 2018 (edited) It seems it didn't build, only c and h files there. I tried this again: cd lynx/tools/cc65 make -f make/clang.mak install It gives the same 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. mkdir -m 755 /data/data/com.termux/files/usr/lib/cc65/tgi for f in ar65 ca65 cc65 cl65 co65 da65 ld65 od65 grc65 sp65; \ do make/install-sh -c -m 755 -s src/$f/$f /data/data/com.termux/files/usr/bin || exit $?; \ done install: can't stat 'src/ar65/ar65': No such file or directory make: *** [make/clang.mak:150: install-bins] Error 1 $ I also tried the termux-setup-storage command, but that seems to be only for Android above v.6. I've been thinking about rooting my S4 for a long time, I think this would be a good reason (if it'd be needed). Just a pain to backup everything first I don't know how to check if it's some sort of path issue either since I don't have access to the data/data folder. Edited January 18, 2018 by Turbo Laser Lynx Quote Link to comment Share on other sites More sharing options...
+karri Posted January 18, 2018 Author Share Posted January 18, 2018 (edited) It seems it didn't build, only c and h files there. I tried this again: cd lynx/tools/cc65 make -f make/clang.mak install It gives the same 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. mkdir -m 755 /data/data/com.termux/files/usr/lib/cc65/tgi for f in ar65 ca65 cc65 cl65 co65 da65 ld65 od65 grc65 sp65; \ do make/install-sh -c -m 755 -s src/$f/$f /data/data/com.termux/files/usr/bin || exit $?; \ done install: can't stat 'src/ar65/ar65': No such file or directory make: *** [make/clang.mak:150: install-bins] Error 1 $ I also tried the termux-setup-storage command, but that seems to be only for Android above v.6. I've been thinking about rooting my S4 for a long time, I think this would be a good reason (if it'd be needed). Just a pain to backup everything first I don't know how to check if it's some sort of path issue either since I don't have access to the data/data folder. It may be that you tablet is too old. I am running Android 7 on a HUAWEI MediaPad T3. Before this I had a Samsung tablet that was stuck on some old Android. (Un)Fortunately I stepped on it one morning and it cracked. Installing cc65 on the old tablet turned out to be impossible even if rooted. What happened when you tried to install the clang compiler (we are noy using gcc here) pkg install git make clang If this part succeeded and you have working binaries then the problem is just in finding out how to set the PREFIX to store the stuff in some valid user space. Rooting is not important at all in this case. Is there a way to see the SD card or internal storage from Termux? like storage/downloads In the Wikipedia for Termux the old versions do only allow execution from your HOME directory - not SD or emulated storage. So you could make PREFIX point to your home directory and install everything there. Find out what your home directory is. cd pwd Then make an install directory for your cc65 stuff. mkdir cc65 point PREFIX= to your HOME/cc65 and then run the install script for cc65. Edited January 18, 2018 by karri Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted January 18, 2018 Share Posted January 18, 2018 (edited) It seems to me clang installed correctly, I didn't see any errors and it ended on a dollar sign, so that's weird. I couldn't find the SD card in Termux. If I understand this correctly there's problems with Termux, the SD card and Android 5.1 https://github.com/termux/termux-app/issues/205 If I can't get it to work I could think about rooting my phone with some android 7 lineage/cyanogen distribution. I've been thinking about doing that for a long time anyways. Edited January 18, 2018 by Turbo Laser Lynx Quote Link to comment Share on other sites More sharing options...
+karri Posted January 18, 2018 Author Share Posted January 18, 2018 If you just type clang what do you get? clang-5.0: error: no input files If you type pwd what do you get? /data/data/com.termux/files/home ? Also try gcc It should return the same as typing clang. Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted January 18, 2018 Share Posted January 18, 2018 Thanks for helping out! Yes I get exactly the stuff you describe. Quote Link to comment Share on other sites More sharing options...
+karri Posted January 18, 2018 Author Share Posted January 18, 2018 (edited) Could you then compile this by hand. cd lynx/tools/cc65 make -f make/clang.mak Once the compilation is done you should be able to install the stuff make -f make/clang.mak install Edited January 18, 2018 by karri Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted January 18, 2018 Share Posted January 18, 2018 Yay! It worked! I also cloned suomi 100 and it compiled. Now the last problem is (as in your first post) is how to test the cart or copy it somewhere where It can be seen / accessed. Quote Link to comment Share on other sites More sharing options...
+karri Posted January 18, 2018 Author Share Posted January 18, 2018 In my version there was a possibility to copy the cart directly to /data/data/com.termux/files/home/storage/downloads RetroArch can see the folder as /storage/emulated/0/Download Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted January 18, 2018 Share Posted January 18, 2018 That worked! Thanks so much for the help, now I,ve got it up and running, woohoo! Quote Link to comment Share on other sites More sharing options...
+karri Posted January 18, 2018 Author Share Posted January 18, 2018 Congrats! I actually coded a lot during my flight to Zagreb last week. All movement logic, floors, pickup objects it On Duty. Now I got invited to Sotchi for some dance events at the end of February. The flights are even longer to get there so I might have time to finish some other Lynx projects. Quote Link to comment Share on other sites More sharing options...
Turbo Laser Lynx Posted January 18, 2018 Share Posted January 18, 2018 (edited) Thanks! That sounds really great. Yeah you never know when you get a Lynx coding craving travelling the world! (Or just doing super comfy coding lying down in the sofa haha) ;D Lynx coding is really becoming more and more fun. Edited January 18, 2018 by Turbo Laser Lynx 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.