GadgetUK Posted November 24, 2012 Share Posted November 24, 2012 (edited) Hi, I've been playing around with some of the samples on here and whilst I can compile and run it all in Handy I get some odd things going on with the text positioning functions. For example on the previous page of the tutorial there are calls to tgi_outtext(text); which all bunch up on one spot, like the positioning is not working. The same thing happens if I run the show_palette example on the page below. I get 'Default Palette' at the correct location on screen, then a bunch of pixels and text mixed up on the next line for the width of the D character under 'Default Palette'. And the line below is roughtly 2 characters long white block?!? I can only assume I am using a buggy version of CC65 or something, has anyone seen this before? http://atarilynxdeve...l-part-6colors/ Edited November 24, 2012 by GadgetUK Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted November 24, 2012 Author Share Posted November 24, 2012 Also getting:- >NMAKE : fatal error U1073: don't know how to make 'rm' Not sure if because this rm (remove?) is failing its not re-creating the .o, .s or .tgi files - is this the reason? Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted November 25, 2012 Author Share Posted November 25, 2012 (edited) Here's what I see:- When it shoud look like this:- Edited November 25, 2012 by GadgetUK Quote Link to comment Share on other sites More sharing options...
LX.NET Posted November 25, 2012 Share Posted November 25, 2012 Also getting:- >NMAKE : fatal error U1073: don't know how to make 'rm' Not sure if because this rm (remove?) is failing its not re-creating the .o, .s or .tgi files - is this the reason? Did you install the unix tools and include the folder (e.g. C:\Program Files\CC65\wbin) in your PATH environment variable? I've updated part 2 of my tutorial to reflect this. When rm (remove command) is missing it will not do a proper clean when you use the Clean Solution or Clean Project command from VS. Also, the default rule for .bmp.o will remove all intermediary files, which fails when rm is missing. You might be experiencing the bug in CC65 I've discovered earlier. Check one of the older posts on tgi_outtext in this forum. The newer ones have this fixed. I am not using the very latest snapshot at this moment, so it might have been broken again. Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted November 25, 2012 Author Share Posted November 25, 2012 I used the latest snapshot build and it's working fine now. Thanks, I should have just searched the forum and I would have found your old post discussing the issue with karri. Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted November 25, 2012 Author Share Posted November 25, 2012 (edited) Did you install the unix tools and include the folder (e.g. C:\Program Files\CC65\wbin) in your PATH environment variable? I've updated part 2 of my tutorial to reflect this. When rm (remove command) is missing it will not do a proper clean when you use the Clean Solution or Clean Project command from VS. Also, the default rule for .bmp.o will remove all intermediary files, which fails when rm is missing. You might be experiencing the bug in CC65 I've discovered earlier. Check one of the older posts on tgi_outtext in this forum. The newer ones have this fixed. I am not using the very latest snapshot at this moment, so it might have been broken again. I've fixed the text out issue but after setting path correctly and copying rm and copy into \CC65\wbin I get this error now?:- 1>NMAKE : fatal error U1073: don't know how to make 'rm' Edited November 25, 2012 by GadgetUK Quote Link to comment Share on other sites More sharing options...
LX.NET Posted November 25, 2012 Share Posted November 25, 2012 Might be a problem with your make file, as it seems that somehow nmake thinks that rm needs to be build. You can send me your .mak file(s) and I will have a quick look at it. Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted November 26, 2012 Author Share Posted November 26, 2012 !INCLUDE <lynxcc65.mak> target = game.lnx objects = lynx-160-102-16.o lynx-stdjoy.o game.o $(target) : $(objects) $(CL) -t $(SYS) -o $@ $(objects) lynx.lib $(CP) $@ .\$(BUILD)\$@ all: $(target) clean: $(RM) *.tgi $(RM) *.s $(RM) *.joy $(RM) *.o $(RM) *.lnx Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted November 26, 2012 Author Share Posted November 26, 2012 And the lynxcc65.mak:- CC65="E:\CC65" CC65_BIN=$(CC65)\bin CC65_INC=$(CC65)\include CC65_ASMINC=$(CC65)\asminc CC65_TOOLS=$(CC65)\wbin BUILDDIR=$(MAKEDIR)\$(BUILD) ODIR=$(MAKEDIR)\obj .SUFFIXES : .c .s .o .asm .bmp .pal .spr .SOURCE : # Compiling for Atari Lynx system SYS=lynx # Names of tools CO=co65 CC=cc65 AS=ca65 AR=ar65 CL=cl65 SPRPCK=sprpck CP=copy RM=rm ECHO=echo TOUCH=touch CODE_SEGMENT=CODE DATA_SEGMENT=DATA RODATA_SEGMENT=RODATA BSS_SEGMENT=BSS SEGMENTS=--code-name $(CODE_SEGMENT) \ --rodata-name $(RODATA_SEGMENT) \ --bss-name $(BSS_SEGMENT) \ --data-name $(DATA_SEGMENT) # Flag for assembler AFLAGS= # Flags for C-code compiler CFLAGS=-I . -t $(SYS) --add-source -O -Or -Cl -Os # Rule for making a *.o file out of a *.s file .s.o: $(AS) -t $(SYS) -I $(CC65_ASMINC) -o $@ $(AFLAGS) $< # Rule for making a *.o file out of a *.c file .c.o: $(CC) $(SEGMENTS) $(CFLAGS) $< $(AS) -o $@ $(AFLAGS) $(*).s lynx-stdjoy.o: $(CP) $(CC65_INC)\..\joy\$*.joy . $(CO) --code-label _lynxjoy $*.joy $(AS) -t lynx -o $@ $(AFLAGS) $*.s $(RM) $*.joy $(RM) $*.s lynx-160-102-16.o: $(CP) $(CC65_INC)\..\tgi\$*.tgi . $(CO) --code-label _lynxtgi $*.tgi $(AS) -t lynx -o $@ $(AFLAGS) $*.s $(RM) $*.tgi $(RM) $*.s # Rule for making a *.o file out of a *.bmp file .bmp.o: $(SPRPCK) -t6 -p2 $< $(ECHO) .global _$(*B) > $*.s $(ECHO) .segment "$(RODATA_SEGMENT)" >> $*.s $(ECHO) _$(*B): .incbin "$*.spr" >> $*.s $(AS) -t lynx -o $@ $(AFLAGS) $*.s $(RM) $*.s $(RM) $*.pal $(RM) $*.spr Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted November 26, 2012 Author Share Posted November 26, 2012 I've looked at this until I am blue in the face lol. I cannot understand why nmake is trying to make rm... Is it something to do with me using Visual Studio 2008? Quote Link to comment Share on other sites More sharing options...
+karri Posted November 27, 2012 Share Posted November 27, 2012 (edited) The first thing that catches my eye is that there is nothing to build in your makefile. I am not so familiar with nmake. But I assume that it needs to declare stuff in a top-down fashion. RM = rm all: game.lnx game.lnx: game.obj game.obj: game.s and so on... I would also try to debug what it is doing by issuing printouts at critical places. In normal Makefile's you can use $(warning The value of TARGETS = $TARGETS) I assume that nmake has a similar command "print" Like: all: $(TARGETS) print TARGETS = $(TARGETS) Edited November 27, 2012 by karri Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted November 28, 2012 Author Share Posted November 28, 2012 (edited) Thanks, this was my solution:- !INCLUDE <lynxcc65.mak> target = game.lnx objects = lynx-160-102-16.o lynx-stdjoy.o game.o $(target) : $(objects) $(CL) -t $(SYS) -o $@ $(objects) lynx.lib $(CP) $@ .\$(BUILD)\$@ all: $(target) clean: del /f /q *.tgi del /f /q *.s del /f /q *.joy del /f /q *.o del /f /q *.lnx On Windows using Visual Studio 2008 nmake. It's something to do with rm being GNU makefile related when NMAKE doesnt support it. Edited November 28, 2012 by GadgetUK Quote Link to comment Share on other sites More sharing options...
LX.NET Posted November 29, 2012 Share Posted November 29, 2012 !INCLUDE <lynxcc65.mak> target = game.lnx objects = lynx-160-102-16.o lynx-stdjoy.o game.o $(target) : $(objects) $(CL) -t $(SYS) -o $@ $(objects) lynx.lib $(CP) $@ .\$(BUILD)\$@ all: $(target) clean: $(RM) *.tgi $(RM) *.s $(RM) *.joy $(RM) *.o $(RM) *.lnx Did you really have the items on the same line? Because if you do, it is treated as a dependency for that rule. So, in case you do a clean, it will think that it depends on $(RM), which evaluates to rm. It will then try to build that file (and doesn't know how). The commands you need to run should be on the next line and on each line for every command. I have noticed that under circumstances you might need $(RM) -f *.tgi to force the delete (by the -f parameter) Quote Link to comment Share on other sites More sharing options...
LX.NET Posted November 29, 2012 Share Posted November 29, 2012 clean: del /f /q *.tgi del /f /q *.s del /f /q *.joy del /f /q *.o del /f /q *.lnx On Windows using Visual Studio 2008 nmake. It's something to do with rm being GNU makefile related when NMAKE doesnt support it. For a Windows machine this is equally good. Less portable for non-Windows machines, but hey, ... so is the makefile. No problem I would think. I doubt it is the GNU tooling vs Visual Studio (see previous comment) Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted November 29, 2012 Author Share Posted November 29, 2012 (edited) For a Windows machine this is equally good. Less portable for non-Windows machines, but hey, ... so is the makefile. No problem I would think. I doubt it is the GNU tooling vs Visual Studio (see previous comment) You are totally right! This works also:- clean: $(RM) -f *.tgi $(RM) -f *.s $(RM) -f *.joy $(RM) -f *.o $(RM) -f *.lnx I don't know how it ended up on one line, I am sure it was like that on your tutorial website? EDIT: I remove the rule to delete .pal files as i've been using them to set the palette. Edited November 29, 2012 by GadgetUK Quote Link to comment Share on other sites More sharing options...
LX.NET Posted November 29, 2012 Share Posted November 29, 2012 You are totally right! This works also:- I don't know how it ended up on one line, I am sure it was like that on your tutorial website? You are absolutely right as well. It was like that in the tutorial. I found that in more than one place the formatting gets messed up and multiple statements end up on a single line. I will correct these as I find them. This one (including the -f ) has been corrected. Thanks for reporting it. Quote Link to comment Share on other sites More sharing options...
+karri Posted November 30, 2012 Share Posted November 30, 2012 A small thing about the RM's and commands on a line. The basic idea to use $RM instead of rm directly is to hide OS dependent stuff. Linux: RM = rm -rf Windows: RM = del /f /q Usage: $(RM) *.o If you want to give many command on a line use ; like $(RM) *.o; $(ECHO) Hi there; $(RM) *.s; -- Karri Quote Link to comment Share on other sites More sharing options...
GadgetUK Posted December 1, 2012 Author Share Posted December 1, 2012 Thanks!! Its all making sense now. 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.