Shop OBEX P1 Docs P2 Docs Learn Events
Sphinx and VGA? — Parallax Forums

Sphinx and VGA?

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2013-01-31 17:15 in Propeller 1
Ive looked around a bit and havent really found an answer to this.

Im putting together some stuff for a sphinx system and I was wondering if there was an easy way to use a VGA driver instead of NTSC. A tv just doesn't have a high enough resolution to be useful, and dragging one out from the garage is pretty inconvienet.

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2013-01-30 00:06
    You would need to slightly modify the VGA driver to work with the hub mailbox and provide a minimal VT100 emulation. I don't know of anyone who has done this. We could always say it is impossible ;)
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2013-01-30 01:03
    LOL, this is a bit over my head at the moment... and Ive got a lot on my plate to learn and accomplish the next few months, without modifying VGA drivers, and sphinx. So I shall deem this impossible since it hasn't been done, seems like if it were possible someone would have done it by now.

    Whats that it can be done? OK ill buy that, if you prove me wrong!!! :tongue:

    Seriously it's really strange no one else has wanted to see sphinx on a usable display for editing, Im surprised NTSC was the chosen route in the first place!! I mean there's people who have ported NTSC games over to VGA, so this cant be that hard for someone with the right skill set. I hope to get there one day but anything video related without a driver isn't on my list of to do's until iv'e thoroughly mastered spin, and gotten in to PASM. Alas im still a mediocre prop programmer striving for better skills, learning how to deal with hardware while wrapping my mind around the propeller paradigm at the same time. Toto, were not in MS-VC anymore, I kept calling createwindowex but my propeller didn't do anything!
  • LeonLeon Posts: 7,620
    edited 2013-01-30 01:03
    Sphinx system?
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2013-01-30 02:22
    I just meant a compact set up to run sphinx, basically a micro computer. I was hoping to intergrate a propeller in to a keyboard. With an sd slot and vga dsub on the back cut in to the case, along with a port for the i/o pins.

    The more I think about it it though, having a 4x40 serial display built in the keyboard may be even better. Nothing spectacular just something compact i can write code on and interface to new chips easily, kind of a propeller exploration tool for those times when a laptop with cables and boards dangling from it isnt a real option.
  • LeonLeon Posts: 7,620
    edited 2013-01-30 02:37
    What is Sphinx?
  • RaymanRayman Posts: 14,665
    edited 2013-01-30 02:44
    Sphinx is on-chip Spin compiler, written in Spin. Here's a page of it:
    http://www.parallax.com/Sphinx/tabid/850/Default.aspx

    BTW: I happen to be working on a VGA text editor for Sphinx right now...
  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-30 08:05
    The TV driver in Sphinx was designed to have as small a hub RAM footprint as possible to make maximum hub memory available for use by the compiler. As a result, it uses part of cog RAM for the display buffer and has a very limited control capability. Only a newline character and backspace are supported. This driver is turned off and another TV driver is used for the text editor. The TV driver would have to be rewritten to work with VGA and the display buffer would still need to be kept in cog RAM for the compiler to handle reasonably large programs.
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-01-30 08:17
    Rayman, that is excellent news!

    Knowing you, the editor will be easy to modify for a wide range of display settings (rows, columns) and different drivers :-)

    I have been running Sphinx on PropCade with a TV output in the past, but would love to use my 80x30 VGA single cog driver instead.

    My favorite small text mode editor under Linux is still "joe" - some of the old Wordstar key bindings are still hard wired in my fingers.
    Rayman wrote: »
    Sphinx is on-chip Spin compiler, written in Spin. Here's a page of it:
    http://www.parallax.com/Sphinx/tabid/850/Default.aspx

    BTW: I happen to be working on a VGA text editor for Sphinx right now...
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-01-30 08:20
    Hmm... or perhaps the VGA driver could have a "screen saver" mode where it displays a blank screen while compiling (releasing the text buffer etc), and be re-enabled when back in the editor or the shell?
    Mike Green wrote: »
    The TV driver in Sphinx was designed to have as small a hub RAM footprint as possible to make maximum hub memory available for use by the compiler. As a result, it uses part of cog RAM for the display buffer and has a very limited control capability. Only a newline character and backspace are supported. This driver is turned off and another TV driver is used for the text editor. The TV driver would have to be rewritten to work with VGA and the display buffer would still need to be kept in cog RAM for the compiler to handle reasonably large programs.
  • RaymanRayman Posts: 14,665
    edited 2013-01-30 08:26
    Bill,

    I'm sure it could be modified for other display drivers. But, my main goal is to be able to edit .spin files and show the special characters.
    To that extend, I'm current using a driver that supports the ROM font.

    First wanted to use VgaHiResText (or drivers like yours or kuroneko), but I think it only supports characters 0..127
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-01-30 08:36
    Ray,

    Using the rom fonts for the editor makes perfect sense, and is worth the additional cog for the schematic etc symbols, so using VgaHiResText is the right choice.

    Currently I only support characters 0-127 as I use bit 7 to indicate "inverse", however it would be easy to allow for 256 characers at the expense of more hub memory. I have to store my fonts in the hub, and unfortunately my drivers cannot use the rom fonts as I had to go to an unusual interleaved scan line format for the fonts to get the cycle count low enough to do single cog drivers.
    Rayman wrote: »
    Bill,

    I'm sure it could be modified for other display drivers. But, my main goal is to be able to edit .spin files and show the special characters.
    To that extend, I'm current using a driver that supports the ROM font.

    First wanted to use VgaHiResText (or drivers like yours or kuroneko), but I think it only supports characters 0..127
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2013-01-30 08:46
    This is great!! Im glad I brought this up!!

    Its especially nice that your doing it Ray, that means it will most likely get done, and be pretty quality stuff! How far a long are you with this editor? How much RAM do you estimate we will have to sacrifice to use VGA?

    @Bill, Ive been wondering about Largos ever since I got in to the propeller. There doesn't seem to be much on your site about it, is this project still active?
  • RaymanRayman Posts: 14,665
    edited 2013-01-30 08:58
    It turns out that writing your own text editor is hard :)

    I had some ideas about how to do it, but those all turned out to take up too much memory.
    So, I'm trying out different ideas.
    Starting with Spin viewer with the idea of adding editing later...
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2013-01-30 09:00
    @Ray, I forgot to tell you I think you are doing a huge service to the community!! I wanted this for my own reasons at the moment, but I can really see sphinx being used alot (as long as more people are informed about it) now that there is this Human Interface board to mate with a quick start, which everyone seems to own now. I cant see anyone with a HIB rejecting the idea of an on board compiler!
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-01-30 09:04
    Short answer:

    I expect that Largos will wake up from his coma after the P2 is released :)

    Long answer:

    It really is a much better fit for the P2. I can make it work on a P1 (and eventually intend to) however it will run much better/faster on the P2.

    Basically what happened is that I did not have as much spare time as I'd have liked in the last few years; for some strange reason wifey insists that I prioritize my time in the following order:

    - consulting work
    - product development for mikronauts
    - wifey/family time (basically any non-snoring time after 50hr-60hr per week)
    - fun side projects (while wifey is cooking or reading)

    One problem was that the available C compilers for the Prop ended up going down a different path than what I would have needed for Largos, and I did not have time to port a compiler myself. With the P2 having far more resources in terms of memory and processor speed, that should not matter as much.
    This is great!! Im glad I brought this up!!

    Its especially nice that your doing it Ray, that means it will most likely get done, and be pretty quality stuff! How far a long are you with this editor? How much RAM do you estimate we will have to sacrifice to use VGA?

    @Bill, Ive been wondering about Largos ever since I got in to the propeller. There doesn't seem to be much on your site about it, is this project still active?
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-01-30 09:18
    Cheat!

    The following was how I was going to write an editor, but I don't have time to do it. I am leaving out minor details.

    1. Keep a virtual buffer on disk, pre-initialized to spaces.
    2. Size it for MAXLINES * MAXLINESIZE (say 4000 * 256)
    3. have a one-dimensional word array in the hub, for example 'map[MAXLINES]'
    4. pre-initialize map so that map[0..MAXLINES-1] = 0..MAXLINES-1
    5. have a one line edit buffer used when a line is modified
    6. you need a few variables: numlines, currline, topscreen, botscreen, and later add regiontop, regionbottom to support moves, cuts, pastes etc

    - to load a file, load the text.vm file with the file you want to edit, or just have the clear file with one active line.
    - all edits happen to a line buffer, which is flushed to text.vm when the cursor leaves that line
    - line inserts, deletions etc only effect the map[] array until the file is saved
    - cut/paste/delete of regions also only effect the map[] array until the file is saved
    - when the file is saved, the map[] is re-initialized as per (4) above

    I was going to use an SPI ram for the text buffer, but SD should be fast enough (with the line mapping array) in terms of response time.
    Rayman wrote: »
    It turns out that writing your own text editor is hard :)

    I had some ideas about how to do it, but those all turned out to take up too much memory.
    So, I'm trying out different ideas.
    Starting with Spin viewer with the idea of adding editing later...
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-01-31 17:15
    You should also look at the PropOS that I am (slowly) working on. It's based on a mix of Sphinx, PropDOS/PropCMD, KyeDos, others, and my own mashup. It's running and I continue to add to it when I get time. All that it requires is an SD/microSD card and a prop plus I/O - I usually use the propplug but the design basics are from Sphinx where any peripheral driver could be swapped in/out even on the fly.

    Here is the link
    http://forums.parallax.com/showthread.php/138251-A-Propeller-OS-that-can-run-on-multiple-hardware...?highlight=propeller%20os
Sign In or Register to comment.