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: 480
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: 1790
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
goto80/HT
csabanw
DanPhillips
Peacemaker/CENSOR/Hi..
Holy Moses/Role
Guests online: 101
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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