про это нужно написать в инструкции
это крайне большие грабли
к примеру у меня все метки и переменные вида some_code_blah_blah_blah
пока заменил название define на СИЛЬНО унинальное чтоб работало
Вид для печати
Yes, indeed. It was one of the first thing I reported to the sjasmplus guys before I started contributing to the project:
https://github.com/z00m128/sjasmplus/issues/37
Then I "fixed" it, actually in the wrong way, it has kinda funny history...
There was some patch done by some guy with Russian-like nickname, to allow sub-word substitutions (I think around v1.04 or v1.07).
Then somebody added test to verify the sub-word substitutions are working (doing like `call aaa_bbb` in the test)
Then I asked about missing docs, because the code did contain some "this can't be correct" parts, and nobody could give me more info, so I fixed it.
About month later I finally understood the original idea of the patch author, it was meant to replace inside-word only strings starting with underscore (i.e. your "define aaa ...." would be safe in his original idea). But he didn't document it, didn't add test, and he had bug in the code, so sometimes it did replace even "aaa" inside strings like "call aaa_bbb").
And actually the old existing test was testing precisely the bug-state, which made it even harder to find+understand the original idea.
Unfortunately I fixed it in the completely opposite way, "aaa" now does substitute inside-words reliably (not only when bug is triggered), and to prevent inside substitution you have to add underscore.
lesson to take:
- send patches only with idea description, and tests showing correct behaviour
- or send patches without bugs
I think I will rewrite this part completely for v2.x, but I don't want to mess with it for v1.x ... consider using `define _aaa "abc"` instead of `define aaa ...`?
Собственно вот:
https://s.micp.ru/77Zi3.jpg
Строки 636,637. Не компиилит :(
Код из диз-асма IDA
справа тот же код в Unreal-дебагере. с минусом - компилит, как ни странно
в дебагере Спекулятора так:
так то жЕ не компилит. Это нормально?Код:ld (ix-$ffffff80), a
ld (iy-$ffffff80), a
ну это кривизна иды
она чота не детектит отрицательные смещения... :v2_dizzy_facepalm:
- - - Добавлено - - -
Ped7g, а можно в emptytrd добавить установку названия диска?
указывается в байтах 245-252 8 сектора
сейчас при создании там пустота...
типа так
EMPTYTRD "test.trd","FCKNDSCK"
- - - Добавлено - - -
так же напрягает вот это сообщение
расширение у файла может быть любымЦитата:
warning: zx.trdimage_add_file: invalid file extension, TRDOS
extensions are B, C, D and #.:
так же сильно не хватает функции добавление в TRD hobeta файлов
Z80: "(ix+imm8)" and similar process the constant as `int8_t` (signed 8bit value), i.e. the valid range is (ix-128) to (ix+127).
(ix+128) is invalid instruction.
I guess the IDA does think the constant is `uint8_t` and disassembles like that -> needs fix on the IDA side.
`ld (ix-$ffffff80), a` ... well... I can imagine how this happens (-128 in `int32_t` is encoded as $ff'ff'ff'80), but I really fail to see why assembler should support this, IMO it's disassembler bug too.
The Unreal displays it correctly (in Zilog syntax), and sjasmplus does understand that too.
I.e. "vsjo normalno" as far as I am concerned, I don't see anything ill about this.
I will take a look, sounds good to me, and EMPTYTRD has currently only single argument, so I could extend it without big syntax change. But... see the following point...
I'm pretty sure I have seen some docs where those extensions were specified as valid ones (i.e. others are invalid).
But... the main issue is, that I'm totally unfamiliar with TRD/hobeta, and pretty much all disk systems for ZX (I have been using back in 199x era only TAP files and Didaktik D40 (D80), and I have seen Busy's MB-02 with BDOS). I have never seen TRD/beta/esxdos/... machines before I returned a bit to ZX world due to Next. And the Next itself has NextZXOS based on +3DOS ("+3e") with esxdos compatibility layer and I think all of this is somewhat divMMC inspired/partially compatible? I don't understand this either.
All of these systems are considerably complex (not a 10min read to become expert on them), plus all of them seem to be closed source, and technically not very impressive (compared to MB-02), so I'm learning about them only very slowly and reluctantly, mostly trying to avoid them as much as possible. And it doesn't help the best docs seems to be often in Russian language, slowing my progress further.
So, don't expect miracles from me - if you want TRD/hobeta support improved in sjasmplus, better provide really very detailed and precise info (like the info about disk name), ideally with some links to official system documentation, so I can double-check everything... or even better, prepare pull request with code changes and tests.
I'm always afraid to touch this part of sjasmplus, as I don't know how to test final result (like using the TRD image on real machine or emulator) and the code is not even well covered with automated tests.
So, if you give me simple and precise info, how to fix/improve something, or even write the code, I will try to help you. But outside of that these disk systems are not interesting for me.
ошибка ошибкой и ее нужно сообщать
но компилировать нужно при этом правильно $80...$FF
правда я не проверял как такое компилирует sjasm
- - - Добавлено - - -
это окаменевшие документы
злые русские используют и .J для jpg
и .H и .P и .S и .M
ну и я использую .S для SID-ов
вместо каких то документов вот скриншоты
https://jpegshare.net/images/a8/5c/a...58f00794ef.png
а тут видно более активное использование расширений
https://jpegshare.net/images/4a/42/4...1b38ac6e1d.png
конечно их нельзя копировать средствами примитивного интерфейса tr-dos
но кому этот каменный век нужен?
когда можно так
https://jpegshare.net/images/07/ab/0...b6a5c19744.png
https://jpegshare.net/images/a1/76/a...932ffa72f1.png
Код:Main.asm(11): error: Offset out of range (+128)
11 6000 DD 77 80 ld (ix+128),a
Main.asm(12): error: Offset out of range (+255)
12 6003 DD 77 FF ld (ix+255),a
If they are the only available documents, then it's maybe good time for somebody to do some grooming, and update some public docs. If the implementation is not open, at least docs should be kept up to date.
Of course I didn't hunt too hard for most-current correct docs, so maybe I just missed the correct place for them. Or maybe you are just using the TRD outside of its specs (that would sound a bit stupid if it would be like modern system, but as I guess the TRD world is petrified "as is", there's not much downside to exploit, except risking error message from sjasmplus which tends to go by docs instead of reality :P ).
I will take a look on the bad-extension message, if it's error, I will turn it down to warning and make it suppress-able by "; ok" comment then. I added it as issue #101 https://github.com/z00m128/sjasmplus/issues/101 ... when it's closed, it's done in source (and will be in next release).
но так не сохраняются сообщения от lua
и все таки при компиляции
постоянно нужна пауза для отладки
в lua тоже
крайне тяжело отлаживать генерацию таблиц
когда выводимые значения постоянно проскакивают
большая их часть потом теряется
в log это не выводиться
куча посторонних сообщений
нужна пауза во время компиляции
которую ставить прямо в коде
чтоб можно было в пошагов режиме проверять вот такое
https://jpegshare.net/images/51/81/5...9a29ff7e62.png
- - - Добавлено - - -
в принципе полез
и изменил размер буфера для командной строки
но все равно пошаговый режим постоянно нужен
тк нужно ждать по 17 секунд пока закончиться компиляция
перед тем как лог можно будет начать смотреть
https://jpegshare.net/images/58/7a/5...3a04182048.png
? Hm, works for me?
(obviously you must write to STDERR, if you are capturing STDERR)Код:LUA PASS3
io.stderr:write(string.format("write to stderr %d\n", 123))
ENDLUA
But I still completely don't understand why you "debug" the tables by looking at assembler output, I find that really cumbersome and difficult to do, I would personally never do that...
I would just emit data file with the values (maybe having simple switch in code to emit either binary or ASCII data) and then use the hexa editor or diff to compare the data with expected results, after the assembling is done. How often do you need to debug table generator? I would expect to do it once correctly, and never look back, until some bug happens.
Also if you are interested into the stdout output for lua printouts, you can still capture the regular ">" stdout along with stderr "2>", just use different file, or `tee` command to copy it both to file and to output.
But I mostly think you should move your "debugging" from assembling time to checking the actual results.
About 19s compilation ... and checking logs.... but that looks like you are building whole disk image, why don't you split that task to two, building just player + tables, quickly, then adding hundreds of sid files using the output from previous step, if you want to make full-build.
Overall I don't know enough details about your projects to fully understand what you are doing, and if I understand you correctly, but I believe it should be possible to break your tasks a bit more and have better times...
The "invalid extension" warning will be suppress-able in next v1.15.0 with the "; ok" comment.
а как делать по другому?
смотреть на результат нет смысла
так как видно только факт наличия ошибки
но не видно где и как она возникает
а так я вывожу в строку все переменные
и смотрю на каком этапе все идет не так как задумано
- - - Добавлено - - -
я часто так отлаживаю таблицы
+ часто у меня таблицы с параметризацией
и могут меняться в зависимости от других настроек
я стараюсь рассчитывать все таблицы средствами sjasm
чтоб при необходимости их корректировать
не было необходимости пересчитывать их сторонними средствами
- - - Добавлено - - -
я делаю релиз в несколько шагов
но для отладки образ должен быть получен максимально быстро
поэтому я сразу добавляются все нужные файлы
выглядит так
я что то меняю
компилирую
и сразу смотрю как это работает
а не так
меняю
компилирую
открываю редактор трд
перекидываю файлы
и только потом смотрю
при этом забыв что я и для чего я менял до этого
конечно добавление файлов в trd можно автоматизировать
но у меня нет на примете такой программы
- - - Добавлено - - -
а я вывожу простым print()
такое нельзя выводить в лог?
чтоб не расписывать длинное io.stderr:write
- - - Добавлено - - -
например в начале исходника у меня часто такое
и часто в больших количествахКод:border = 254 ; Bits 5 and 3-0 hold border colour (output)
keyboard = 254 ; Main keyboard matrix (input)
lua allpass
ay_frq = 1750000 -- 1750000 pentagon
-- 1773450 128
zx_int_frq = 50
endlua