Jump to content
IGNORED

CC65 tgi_outtext problem


GadgetUK

Recommended Posts

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 by GadgetUK
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by GadgetUK
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by karri
Link to comment
Share on other sites

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 by GadgetUK
Link to comment
Share on other sites

!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)

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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 by GadgetUK
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...