Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > TAsm and .text tables
2009-09-19 03:37
clonK
Account closed

Registered: Aug 2008
Posts: 65
TAsm and .text tables

Hi.
I use Soundemon's version of TAsm on my 1541U and I've been trying to work out the best way to enter '.text' tables in it. They don't seem to convert into screen codes which line up with the char set. I've tried various things, like subtracting #$40 from each character I pull from the table, but that just inverts the background colour. I've spent the past 4 hours trying to work it out :P I'm wondering the best way for this to be done. This is a total noob question because, well, I'm a total noob when it comes to C64 programming, but I've been dabbling recently. I made an SDI tune that I've written (fudged together) a very simple interrupt player for but I'm trying to add text to the screen and came accross this problem. I noticed that other assemblers use '.scr' which, apparently, converts correctly and I was wondering how I should do it with TAsm.
Thanks for any help.

p.s. quick question... when is a player a player? I mean... I assembled my tune using the SDI player code, but now I have a simple interrupt program which calls the tune at $1000, $1009, etc... So, which is the player... technically speaking?
i'm confused ?:¬
2009-09-19 06:31
Angel of Death

Registered: Apr 2008
Posts: 210
Don't know that application. Can you tell me what it is and/or where to take a look at it...
2009-09-19 06:33
Radiant

Registered: Sep 2004
Posts: 639
I don't remember ever having used .text for anything working. Usually when I coded on the real machine I just entered the text directly in the monitor, or put in the screencodes by hand using the C64 manual.

The player is basically the code you call at $1000 et al.
2009-09-19 06:56
Angel of Death

Registered: Apr 2008
Posts: 210
Found it. (should log in more often and actually read something :))
Ever tried to type something on screen and look in a monitor what the actual values are and then comparing to what TAsm outputs are. Maybe then you can work it out.
But I think lies in the fact that TAsm (the versions I know) set the chars in Locase and when it (auto)starts your code it doesn't reset that reg.
.text works also peculiar (also the <- a mode) characters typed in as 'a' ($01) will assemble as 'A' ($41) Characters typed as 'A' ($41) will, oddly, not compile as $81 (shifted $40 as capitals should) but as $c1 (reverse).
So, I think the only solution is to subtract $40 from every character (in the assembled text) <$c0 and to subtract $80 from every char >$c0. That should at least put all the normal letters and capitals in place.
(there is probably a simpler way but this is the only thing I can think of this quick.
2009-09-19 07:05
Radiant

Registered: Sep 2004
Posts: 639
Angel of Death: .text puts in the text as ASCII characters, not screencodes. To convert between the two is not completely trivial.
2009-09-19 07:12
Angel of Death

Registered: Apr 2008
Posts: 210
That is true. I forgot. A lot of apps in those days did that.
But to be honest. I necer used the .text function either. I typed the text (or whatever) on screen. then transferred it to mem and inserted it using <- 6 ...
But there should be a nice geeky coders way to help this guy out. Wasn't there a Kernal function for that.
2009-09-19 09:01
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
Clonk: enter your text somewhere, like:

.text "music by Clonk..."
and compile it.

Then in monitor, go to there with I* and enter the text regularly. Yeah, double work, but it fixes the prob, and you dont have to code a petscii->screencode converter, which can suck ass..
2009-09-19 10:11
WVL

Registered: Mar 2002
Posts: 887
Warning! don't read further ;) I thought you were crosscompiling :P

;---------------------------

Not sure what version you're using, but please read the manual carefully!

1) there's the -a compiler option :

-a, --ascii Convert ASCII to PETASCII

Normally no conversion takes place, this is for backwards compatibility with a
DOS based Turbo Assembler editor, which could create petscii files for
6502tass. (with control characters also of course)

Using this option will convert 'a'-'z' and 'A'-'Z' into the correct petscii
range of $41-$5A and $C1-$DA, which is more suitable for an ascii editor.

Example:

64tass a.asm
lda #"a"        -> result: $A9, $61
.text "1aA"     -> result: $31, $61, $41

64tass --ascii a.asm
lda #"a"        -> result: $A9, $41
.text "1aA"     -> result: $31, $41, $C1


2) There's the .enc directive in your source files :

.enc
    Text encoding, "none" or "screen" (screen code)

            .enc screen     ;screencode mode
            .text "text with screencodes"
            cmp #"u"        ;compare screencode
            .enc none       ;normal again mode
            cmp #"u"        ;compare ascii


Hope that helps :)
2009-09-19 10:58
clonK
Account closed

Registered: Aug 2008
Posts: 65
Quote: Clonk: enter your text somewhere, like:

.text "music by Clonk..."
and compile it.

Then in monitor, go to there with I* and enter the text regularly. Yeah, double work, but it fixes the prob, and you dont have to code a petscii->screencode converter, which can suck ass..


Yeah.. this is what I've been doing, but I was wondering whether I was missing some other method in which to place the text directly in the assembler, besides inputting byte codes ofc.

Cheers all for ur help. I'm now aware that this isn't a trivial task and I can reside myself to inputting text using the monitor.
2009-09-19 17:36
raven
Account closed

Registered: Jan 2002
Posts: 137
This is how its done in C64 TASM:

When typing the letters inside a .text statement, use CTRL + letter.

For example, to get the screen-code for A, type CTRL+A.
In TASM you will see the letter reversed, but it will compile to the correct screen-code.

I've been using this method for scroll-texts since forever, should work on any TASM version I assume.
2009-09-20 14:09
clonK
Account closed

Registered: Aug 2008
Posts: 65
Quote: This is how its done in C64 TASM:

When typing the letters inside a .text statement, use CTRL + letter.

For example, to get the screen-code for A, type CTRL+A.
In TASM you will see the letter reversed, but it will compile to the correct screen-code.

I've been using this method for scroll-texts since forever, should work on any TASM version I assume.


maaaaan :P
Thanks a lot raven!
haha.. exactly what I was after.
Can't believe I hadn't already tried that -.-
Works a treat, except for lower case 'm' which seems to be a TAsm command (ctrl+m).
Cheers much
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
hedning/G★P
Sam/Beyond Force
Mason/Unicess
Guests online: 82
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Aliens in Wonderland  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Daah, Those Acid Pil..  (9.5)
9 Birth of a Flower  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Offence  (9.3)
Top Diskmag Editors
1 Magic  (9.4)
2 Jazzcat  (9.4)
3 hedning  (9.2)
4 Elwix  (9.1)
5 Remix  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.04 sec.