Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
an additional label in <library-asm/print.asm>
#2
programandala.net Wrote:Mi wish is easy to satisfy: I need one label after CP 80h in <print.asm>:

Code:
ex af, af'

        cp 80h  ; Is the char an UDG, a block character or a token?
JUMP_IF_GREATER_THAN_80H:
        ; XXX label needed to hack the printing system
        jp c, __SRCADDR ; if not, jump

(That is an extract from my hacked version of <print.asm>, with additional comments of my own; the actual name of the label doesn't matter.)

The reason I need a label there is I have written a module that provides a sub to switch on an off the ZX Spectrum legacy printing mode (that treats ASCII chars, block chars and UDG chars apart). When the legacy mode is off, all chars 32-255 are taken from the same charset. This makes it possible to write source code with a modern 8-bit encoding, e.g. Latin1. This is very useful for programs that print a lot of text in other languages than English.

I tinkered with this idea four years ago, and hacked <print.asm>, but I had to redo the changes after every new version of ZX BASIC. The new approach is simpler and better: The sub modifies the code of <print.asm> in two locations, and the legacy printing mode can be restored at any time by the program. It works great. So far I have tried it with a modified version of <print.asm>. That's why I need that single label.

I will publish the module as soon as it can be used with a new version of ZX BASIC, unless someone requires it sooner.

Thank you.
This can be done by modifying the print routine. ZX Basic does not use the ROM print routine but its own (faster and more featured) one. If you need a print system that does not use UDG but all chars this can be achieved by patching the print.asm library with an #ifdef directive (you can specify special Defines from the command line with zxb -D TAG).
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)