Charmap directive equivalent in ASM6

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
arcangeldemerida
Posts: 21
Joined: Wed Jun 22, 2022 7:00 am

Charmap directive equivalent in ASM6

Post by arcangeldemerida »

As it says in the title, I need an equivalent of this directive in ASM6, maybe it doesn't exist because I already did a test creating a table of characters followed by the "=" directive with the hexadecimal values of the custom map tiles, but it didn't work.

Code: Select all

"[END]" = $00
"[LINE]" = $01
"[P_OVR]" = $02
"[WAIT]" = $03
"[SKIP1]" = $05

" " = $A0
"!" = $A1
"?" = $A2
"…" = $A3
"$" = $A4
"•" = $A5
"['']" = $A6
"'" = $A7
"(" = $A8
")" = $A9
":" = $AA
";" = $AB
"," = $AC
"-" = $AD
"." = $AE
"/" = $AF
"0" = $B0
"1" = $B1
"2" = $B2
"3" = $B3
"4" = $B4
"5" = $B5
"6" = $B6
"7" = $B7
"8" = $B8
"9" = $B9
"°°" = $BA
"@" = $C0
"A" = $C1
"B" = $C2
"C" = $C3
"D" = $C4
"E" = $C5
"F" = $C6
"G" = $C7
"H" = $C8
"I" = $C9
"J" = $CA
"K" = $CB
"L" = $CC
"M" = $CD
"N" = $CE
"O" = $CF
"P" = $D0
"Q" = $D1
"R" = $D2
"S" = $D3
"T" = $D4
"U" = $D5
"V" = $D6
"W" = $D7
"X" = $D8
"Y" = $D9
"Z" = $DA
"╔" = $DB
"═" = $DC
"╗" = $DD
"║_" = $DE
"_║" = $DF
"→" = $E0
"a" = $E1
"b" = $E2
"c" = $E3
"d" = $E4
"e" = $E5
"f" = $E6
"g" = $E7
"h" = $E8
"i" = $E9
"j" = $EA
"k" = $EB
"l" = $EC
"m" = $ED
"n" = $EE
"o" = $EF
"p" = $F0
"q" = $F1
"r" = $F2
"s" = $F3
"t" = $F4
"u" = $F5
"v" = $F6
"w" = $F7
"x" = $F8
"y" = $F9
"z" = $FA
Has anyone created a fork of ASM6 with this directive or its equivalent?
In case no one has, could anyone give me some instructions to create my own fork with this directive?
I have some knowledge of C language, but I barely know how to do very basic things.
For now I don't want to migrate to CA65.
User avatar
Cyneprepou4uk
Posts: 24
Joined: Fri Jun 21, 2019 12:20 am
Location: Belarus

Re: Charmap directive equivalent in ASM6

Post by Cyneprepou4uk »

I use ca65, though I don't use charmap, because it supports latin letters only.

I make a script which creates a temporary copy of asm file and replaces characters with corresponding bytes from a config table. For example, my script searches for lines like .text "ABC" and replaces it with .byte $41, $42, $43.

Then I assemble this copy instead of original one.
arcangeldemerida
Posts: 21
Joined: Wed Jun 22, 2022 7:00 am

Re: Charmap directive equivalent in ASM6

Post by arcangeldemerida »

Cyneprepou4uk wrote: Sun Apr 30, 2023 3:37 am I use ca65, though I don't use charmap, because it supports latin letters only.

I make a script which creates a temporary copy of asm file and replaces characters with corresponding bytes from a config table. For example, my script searches for lines like .text "ABC" and replaces it with .byte $41, $42, $43.

Then I assemble this copy instead of original one.
Ok, could you please PM me your script (do you use the lua language?) along with some pseudocode or algorithm so I can understand how it works and try to make a fork of ASM6 with directives that fulfill the same function as your script.
User avatar
Cyneprepou4uk
Posts: 24
Joined: Fri Jun 21, 2019 12:20 am
Location: Belarus

Re: Charmap directive equivalent in ASM6

Post by Cyneprepou4uk »

https://github.com/cyneprepou4uk/Captai ... ranslation

This repository of mine does that, the script is inside preparations.lua
Post Reply