Another handy Linux command for this is "showkey -a"bzt wrote: ↑Fri Jun 28, 2019 5:22 pmAn easy way to get the sequences is to use the Linux command "dialog" on a Raspberry Pi. Create a dialog box with it and redirect it's output into a file. Exit, and check out the file which sequences it contains. It is very likely that "dialog" will use Linux terminal specific sequences too, to avoid that, you must set the TERM environment variable to "vt100" first.
Erhm, not sure I follow you. Those were not options, but required steps. Also you can't connect a monitor to the GPIO pins, there's a HDMI port for that.
Code: Select all
RPi GPIO (pins 14 / 15) --------- RS232/USB (aka COM1, PC running minicom, PuTTY or other similar terminal emulator)
Your print routine does not have to do anything. The CSI sequences are printed just as any other characters. It is the terminal's duty to interpret them (and indeed they do).fm2606 wrote:3) This sounds more what I am looking for even though it would require writing my own print routines to take care of it, which is fine.
Above is what I meant about attaching a monitor. Just last week I saw a video of a guy cutting a co-workers mouse and creating the TTL cable and hooking it up to a laptop.bzt wrote: You should use a serial cable with 3 wires: DATA TRANSFER, DATA RECEIVE, GROUND. Or more likely an USB serial cable because recent PCs lack RS232 ports. There don't use red, green is transfer, white is receive, black is ground; and they have nice little endings to plug them into the GPIO header.
I was able to do the the above in LX Terminal but when I wrote out (ESC)[6n and the (ESC)[(Y);(X)R results where given, my program hung after the SVC 0 statement in the PRNT section.bzt wrote: Standard CSI sequences include VT-100 sequences (vt100.net), and some of them are also specified in ANSI (Wikipedia on ANSI escape sequences). A very good summary of the sequences can be found here: http://www.termsys.demon.co.uk/vtansi.htm.
To display a dialogue, you should do the following:
1) write (ESC)[2J to the UART to clear the terminal's screen on the other side
2) write (ESC)[999;999H to move cursor as far as possible
3) write (ESC)[6n to query the cursor position
4) read and parse (ESC)[(Y);(X)R, this will give you the terminal's dimensions
5) move your cursor where you want it with (ESC)[(Y);(X)H (probably at center of the terminal minus half of your dialog's size)
6) change color with (ESC)[(codes)m for example (ESC)[30;47m selects black text on white background
7) print what you want, probably lots of spaces to draw the dialog box
Code: Select all
ldr r1, =eoscr @ eoscr defined as (ESC)[999;999H item #2 above mov r2, #10 bl prnt ldr r1, =curpos @ curpos defined as (ESC)[6n item # 4 above mov r2, #4 bl prnt prnt: mov r0, #1 mov r7, #4 svc 0 bx lr
No worries, we figured it out after all The only confusing thing is, that you want to use Linux and this is the Bare metal section, but now I see there's no separate Assembly section.
Well done!fm2606 wrote:I was able to do the the above in LX Terminal but when I wrote out (ESC)[6n and the (ESC)[(Y);(X)R results where given, my program hung after the SVC 0 statement in the PRNT section.
Yes Only Linux is a "little bit" more complex than Commodore Basic was It has all the legacy of unices ever since the Multics in the '60s, which could be overwhelming sometimes. The termios interface is a good example. On the other hand, being an old interface, it's well tested and guaranteed to workfm2606 wrote:But it is a start. I have some work and a lot of learning still to do but enjoying it. Like I said in an earlier post it takes me back to days as a kid learning to program the C64!