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: 56
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: 473
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: 1714
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
Scooby/G★P/Light
Freddie
Matt
Guests online: 169
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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