| |
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 ?:¬ |
|
| |
Angel of Death
Registered: Apr 2008 Posts: 211 |
Don't know that application. Can you tell me what it is and/or where to take a look at it... |
| |
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. |
| |
Angel of Death
Registered: Apr 2008 Posts: 211 |
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. |
| |
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. |
| |
Angel of Death
Registered: Apr 2008 Posts: 211 |
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. |
| |
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..
|
| |
WVL
Registered: Mar 2002 Posts: 902 |
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 :) |
| |
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. |
| |
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. |
| |
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
|