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 > ASCII in KickAss
2014-06-30 10:43
JAC

Registered: Aug 2002
Posts: 57
ASCII in KickAss

I'd like to use KickAss for another platform (here an Apple II example program) but failed with the ".text" directive as it seems to create PETSCII only.

What would be the best way to put ASCII texts (optionally with bit 7 set) in the source?

In MADS I can write:
text .by +$80 'Hello, Nick, Brendan and Sean!',13

which is nice and expressive. How can I do that in KickAss?

- Peter.
2014-06-30 14:26
soci

Registered: Sep 2003
Posts: 486
I think this is sort of usage is not it's strength, or I missed something. You could still try to write a custom function/macro for text conversion.
2014-06-30 17:09
tlr

Registered: Sep 2003
Posts: 1814
I've used something like this...
.function char2ascii(c)
{
        .return c + [c < $20 ? $60 : $00]
}       
.macro ascii(str) {
        .fill   str.size(), char2ascii(str.charAt(i))
}


.macro sid_b(v) {
        .byte   v
}
.macro sid_w(v) {
        .byte   >v,<v
}
.macro sid_l(v) {
        .byte   v>>24, [v>>16]&$ff, [v>>8]&$ff, v&$ff
}
.macro sid_str(str) {
        /* conversion necessary because KickAssembler doesn't seem
           to support ascii output, only a loosly defined conversion
           to petscii/screencodes. */
        :ascii(str)
        .fill   $20 - str.size(), 0
}
.if (cmdLineVars.get("RSID") == true) {
        .pc = start_addr-$7c
/**************************************************************************
 *
 * RSID header
 *
 ******/
        .text   "PSID"
        :sid_w(2)               // version 2
        :sid_w($7c)
        :sid_w(pl_startcode)
        :sid_w(pl_init)
        :sid_w(pl_play)
        :sid_w(1)               // 1 song
        :sid_w(1)               // start with song 1
        :sid_l(0)               // raster speed 
        :sid_str("Crackpot")    // song name
        :sid_str("Daniel Kahlin (TLR)") // author
        :sid_str("2013 Daniel Kahlin")  // released
        :sid_w(%100110)         // 8580/PAL/C64
        :sid_b(0)               // start page
        :sid_b(0)               // page length
        :sid_w(0)               // reserved
}

... but it should really be handled in a cleaner way by the language.
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
ΛΛdZ
lA-sTYLe/Quantum
JEZ
Sulevi/Virtual Dreams
MWR/Visdom
Acidchild/Padua
cobbpg
Guests online: 294
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Performers  (9.3)
4 Oxyron  (9.3)
5 Censor Design  (9.3)
Top Logo Graphicians
1 t0m3000  (10)
2 Sander  (9.8)
3 Shine  (9.5)
4 Mermaid  (9.5)
5 Pal  (9.4)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.036 sec.