Shop OBEX P1 Docs P2 Docs Learn Events
TAQOZ - Tachyon Forth for the P2 BOOT ROM - Page 29 — Parallax Forums

TAQOZ - Tachyon Forth for the P2 BOOT ROM

1262729313238

Comments

  • MJBMJB Posts: 1,235
    @"Peter Jakacki"
    in ES2.SPIN2
    I see CLKMHZ defined, but not in dictionary.
    Then again defined in Taqos.fth
    ...
  • @msrobots - I kinda know what you are asking, but at the same time, I'm not sure how you would like it to operate.

    TAQOZ has been upgraded to V2.2 with everything except VGA buffers in the first 64K. The VGA has been upgraded to 640x360 8bpp VGA over 1080p timing. The lines are triple scanned with a little trick to fill the 1080 lines of a 16:9 monitor. So this means that VGA only uses 226k for screen and palette and headers and standard VGA text is 106 characters by 36 rows (45 max). There were also a few weird bugs I tracked down that have probably been causing problems for a while now. Let's see how that goes.
  • @MJB - CLKMHZ is a vey simple word and a few bytes didn't really matter but I've added it to the kernel dictionary now and removed it from TAQOZ.FTH.
  • MJBMJB Posts: 1,235
    @MJB - CLKMHZ is a vey simple word and a few bytes didn't really matter but I've added it to the kernel dictionary now and removed it from TAQOZ.FTH.
    Sure was thinking the same....
    Just to show you I am watching closely ;-)
  • @msrobots - I kinda know what you are asking, but at the same time, I'm not sure how you would like it to operate.

    TAQOZ has been upgraded to V2.2 with everything except VGA buffers in the first 64K. The VGA has been upgraded to 640x360 8bpp VGA over 1080p timing. The lines are triple scanned with a little trick to fill the 1080 lines of a 16:9 monitor. So this means that VGA only uses 226k for screen and palette and headers and standard VGA text is 106 characters by 36 rows (45 max). There were also a few weird bugs I tracked down that have probably been causing problems for a while now. Let's see how that goes.

    Nice,.

    I try to explain how I operate. The way I use the P2 is alike I use the P1. The common workflow there is to develop on a PC, load your Program into RAM, test it, rinse repeat. Once ready for deployment the created binary can be written to EEPROM on the P1 and to FLASH on the P2 (I guess, never tried) or you copy your binary to SD on the P2 as you wish. But this is more for deployment not while programming.

    So usually I am not booting from SD at all but would like to keep it inserted instead of removing it all the time to load to RAM. Thus my wish to not write any BOOT files on a BACKUP or to be able to remove the boot files created at BACKUP /after loading TAQOZ.FTP / DECOMP.FTH / my start words.

    I will download your newest version now and embed it with the new memory regions. Lets see how it goes.

    Mike
  • msrobotsmsrobots Posts: 3,709
    edited 2019-07-25 22:27
    oh cool, you have bmporg right at $10000 - compact edition,wonderful

    compiles with FastSpin w/o problems - 60192 bytes

    Mike
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-07-25 22:29
    msrobots wrote: »
    oh cool, you have bmporg right at $10000 - compact edition,wonderful

    Mike

    Actually moved that down to $FF00 because the vga cog continually updates some variables right at the start of that and that would cause problems if you tried to use $1.0000 for something else, which is not a problem now.
    Otherwise $1.0000 = palette and $1.0400 = screen
    2.2 uses vga-640x360.inc for 1080p timing.

  • msrobotsmsrobots Posts: 3,709
    edited 2019-07-25 23:50
    msrobots wrote: »
    oh cool, you have bmporg right at $10000 - compact edition,wonderful

    Mike

    Actually moved that down to $FF00 because the vga cog continually updates some variables right at the start of that and that would cause problems if you tried to use $1.0000 for something else, which is not a problem now.
    Otherwise $1.0000 = palette and $1.0400 = screen
    2.2 uses vga-640x360.inc for 1080p timing.

    yes I just ran into that and reverted to $40000, there I survived and it is working proper. So W/O VGA $10000 is now save and with VGA $48800? And yes I found out I need to change _VGACFG to 0

    two questions

    do you have some simple CLEAN MBR code for me, I do not really need to disable things, the file I can handle by myself, just removing the MBR BACKUP would be needed.

    and is the exact command BACKUP filne.ame or BACKUP "filne.ame" or BACKUP <filne.ame> or what I do need to type to simply write a BACKUP to a named file on SD?

    Mike
  • Moment. So if I let VGA running and load my program to $10000 the first part is palette and the rest is bitmap for the running VGA? Interesting.

    I need to get some more space on my desk to squeeze some other monitor in.

    Mike
  • I may make the vga remappable at runtime with the default at $ff00. Maybe setting it to zero at runtime can signal that it disables vga but leaves the cog running.
  • msrobotsmsrobots Posts: 3,709
    edited 2019-07-26 00:22
    Yeah I also would like to use your VGA stuff, it is tempting. At least while developing, not so sure when deployed.

    But the way I handle this right now with FastSpin, changing the start address in quite simple. So will build 2 binaries, one with VGA and start at $448800 and one w/o VGA and start at $10000.

    Let the user decide. And if I set VGA pins to 0 for the 64k w/o VGA version even the COG is free, else we have the buffer exactly where he should be, between TAQOZ HUB and other programs HUB, perfect.

    So I will download the ES.SPIN2 and the FORTH folder again and start another sd-jockey journey...

    Mike
  • hm - looks like you have not updated yet.

    Mike
  • Yes, VGA memory ends at $4.8800 leaving a massive 227338 bytes, although that might not be enough for microPython.

    What do you mean by "not updated yet"? Whcih part? Just in case, I reassembled P2ES as P2ES.spin2 etc (just to standardize). I've been testing on the P2D2 but I try it out now on the P2 EVAL.
  • msrobotsmsrobots Posts: 3,709
    edited 2019-07-26 02:46
    no, my fault. I still hung at $10000 now I start at $48800 with the mailbox and then my program. Shrinking it down to NO VGA when needed is possible else I like having VGA, but both of my available VGA Monitors do not sync to your VGA output. Too old for 10xxp or whatever.

    But it runs so far.

    Mike
  • microphython has its own VGA, so you are not out of the race

    Mike
  • I can't seem to find any monitors that don't handle 1080p timing, but I will check. I always run the P2D2 at 200MHz or more and I noticed that if I left the P2ES at 160MHz, that it didn't manage the timing very well, so I cranked it up to 200MHz like the P2D2. Because the P2 EVAL board heatsinking and power supply are "huge", there is no problem running the P2 at 300MHz even.
  • But the VGA on microPython is only text based, correct?
  • I can't seem to find any monitors that don't handle 1080p timing, but I will check. I always run the P2D2 at 200MHz or more and I noticed that if I left the P2ES at 160MHz, that it didn't manage the timing very well, so I cranked it up to 200MHz like the P2D2. Because the P2 EVAL board heatsinking and power supply are "huge", there is no problem running the P2 at 300MHz even.

    no that does not help I need to stay at current 160Mhz at start. Don't change anything, Its just some old monitors, you know, those NOT flat ones...

    Mike
  • But the VGA on microPython is only text based, correct?
    yes, that is my understanding, but I know nothing I am German.

    Mike
  • will try my TV that should do 1080p

    Mike
  • Just curious as to what requires 160MHz?
  • currently I load
    TAQOZ.FTH
    DEOMP.FTH
    AV.FTH
    something missing? How do I output something on VGA and switch back to CON?
    TV does not complain but does not show anything.
    Do I need
    PS2KEYB.FTH?

    I try without VGA next again, I hope I made a mistake last round and it will work this time.

    Mike
  • Just curious as to what requires 160MHz?

    The standard settings of Spin2Gui/FastSpin or Eric's Compiler Collection where I want to integrate TAQOZ as a usable Member.

    I personally can live with anything, but I try to make this simple

    Mike
  • OK, mailbox+code at $10000 does not work even with COG 7 not started.

    will try mailbox+code at $10400 behind Palette. $48800 works.

    Mike
  • The tv should just work if it is switched to vga source. However I decided I could probably use 720p so I did another VGA driver that doubled up each line and spread 640 pixels over 1280 and it seems to work well too. Can you try that?
    But there shouldn't be any problems with using $1.0000 since this is simply the palette and doesn't get updated by the driver. Maybe you can try the BMP header area which is mainly unused, so maybe BMP+$20 ?
  • msrobotsmsrobots Posts: 3,709
    edited 2019-07-26 10:00
    Yeah, I do not understand that either, just running from $48800 now and automating things in Spin2Gui to make it stupid proof, then I will try to create a NO VGA binary again.
    my 'with VGA TAQOZ' has TAQOZ.FTH DECOMP.FTH and AV.FTH loaded. The w/o VGA just TAQOZ.FTH DECOMP.FTH.

    else they are equal.

    Right now I try to understand Spin2gui's TCL? and adding buttons to 'compile for TAQOZVGA' (working) and 'compile & run with TAQOZVGA' (not working yet)

    Mike
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-07-26 15:32
    I decided that I wanted to be able to configure the VGA parameters at runtime so I have made the driver programmable in terms of frequency, timings, resolution, scaling, memory area, etc. The default is 640x360 with palette and screen from $1.0000.
    Now it is very quick to read and change these parameters using the @VGA word to index a long in the VGA driver's binary image, then using 0 @VGA 7 COGINIT to restart it with the new parameters. I'm still putting some finishing touches on this but it seems to work well.

    So an application can decide if it wants to change to 320x240 or 640x480 or even 1920x1080 mono. If a BACKUP is done after changing it, then it will start up automatically in that mode, so this is also suitable for changing from the "command line".

    Here's a simple example of changing the default resolution from 640x360 to 640x720. We don't need to change any frequencies and timings.
    	720 2 @VGA !		--- set 720 rows
    	1 3 @VGA !		--- reduce vertical scaling to1
    	0 @VGA 7 COGINIT	--- restart VGA driver
    

    btw, the high level words that draw text and graphics and view BMPs etc are being modified to read this table at runtime.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-07-27 16:57
    Being able to switch my screen resolutions interactively is a lot of fun and unlike the old CRT monitors of old, the LCD screens seem to switch instantly. I am still using 256 color mode so I will need to make the mode programmable so I can switch down to mono etc. The high level routines that draw and display graphics and text on the screen read the parameter table and adjust automatically. Of course there isn't enough memory for 1920x1080x8 mode but all it does is run into unused memory before wrapping around but I can run a console in it provided I don't try to write text that ends up wrapping to address 0.

    Seeing that I can switch to a 512x384 mode means I could create my own original Mac desktop!

    These are the definitions for the modes at present, but I will probably refine and simplify these as I go:
    pub 240p		320 240 2 VRES 25,175,000 VFREQ 	16 96 47 HSYN 10 2 33 VSYN !VGA ;
    pub 384p		512 384 2 VRES 65,000,000 VFREQ 	24 136 160 HSYN 3 6 29 VSYN !VGA ;
    pub 480p		640 480 1 VRES 25,175,000 VFREQ 	16 96 48 HSYN 10 2 33 VSYN !VGA ;
    pub 600p		800 600 1 VRES 40,000,000 VFREQ 	40 128 88 HSYN 1 4 23 VSYN !VGA ;
    pub 768p		1024 768 1 VRES 65,000,000 VFREQ 	24 136 160 HSYN 3 6 29 VSYN !VGA ;
    
    ( 16:9 )
    pub 360p		640 360 2 VRES 74,250,000 VFREQ 	72 80 216 HSYN 3 5 22 VSYN !VGA ;
    pub 720p		1280 720 1 VRES 74,250,000 VFREQ 	72 80 216 HSYN 3 5 22 VSYN !VGA ;
    pub 1080p		1920 1080 1 VRES 148,500,000 VFREQ 	88 44 148 HSYN 4 5 36 VSYN !VGA ;
    
    

    This might be good to switch to hires mode for when I edit text files and back again with color graphics.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-07-28 02:16
    Well if you have a P2 board just compile P2ES.spin2 to your board and the VGA is active on the P0 group by default and you may want to edit the default baud rate from 3Mbd on line 6.
    Then copy and paste the TAQOZ.FTH file without any line delays and AV.FTH for all the high level video routines. MOUNT the SD card and type BU to backup to the MBR by default.
    Now type VGA -C64 CLS and your console output will be redirected to VGA with a white on blue C64 theme and the screen will be cleared except for console output from then on.

    Type 240p and watch it drop down to 320x240 and then try 720p etc.

    You could also try loading MANDELBROT.FTH and watch it draw at different resolutions that you set.


    However even if you just compile P2ES.spin2 you can talk to the TAQOZ kernel as is and simply paste in this bit of code to play with video resolution modes and try them out. I may post some screen grabs later on. This is fun!
    		*** VIDEO PARAMETER ACCESS ***
    
    pub V!		@VGA ! ;
    pub VW!		@VGA W! ;
    pub V@		@VGA @ ;
    pub VW@		@VGA W@ ;
    
    		*** VIDEO PARAMETER "CONSTANTS" ***
    
    pub cols ( -- n )	1 V@ ;
    pub rows ( -- n )	2 V@ ;
    pub PALETTE ( -- addr )	6 V@ ;
    pub SCR ( -- addr )	7 V@ ;
    
    		*** VIDEO TIMING ROUTINES ***
    
    pub V/					3 V@ U/ 1 MAX ;
    pub VRES ( x y scale -- )		3 V! 2 V! 1 V! ;
    pub VCLK ( freq --- )			V/ 4 V! ;
    pub HSYN ( front width back -- )	V/ 10 VW! V/ 9 VW! V/ 8 VW! ;
    
    pub VSYN ( front width back -- )	3 V@ 8<< OR 8<< OR 8<< OR 3 V! ---
    --- Calculate NCO value from pixel frequency and start/restart VGA cog
    pub !VGA	4 V@ $4000.0000 CLKHZ 2/ U*/ 5 V! 0 @VGA 7 COGINIT ;
    
    pub .VREGS		1 14 ADO CRLF I . 9 EMIT I V@ DUP .L 3 SPACES . LOOP ;
    
    pub V/2			1 V@ 2/ 2 V@ 2/ 3 V@ 2* VRES		8 VW@ 9 VW@ 10 VW@ HSYN !VGA ;
    
    		*** VIDEO TIMING MODES ***
    ( 4:3 )
    pub 120p		160 120 4 VRES : =VGA 25,175,000 VCLK	16 96 48 HSYN 10 2 31 VSYN ;
    pub 240p		320 240 2 VRES =VGA ;
    pub 480p		640 480 1 VRES =VGA ;
    pub 600p		800 600 1 VRES 40,000,000 VCLK 		40 128 88 HSYN 1 4 23 VSYN ;
    pub 384p		512 384 2 VRES : =V65 65,000,000 VCLK	24 136 160 HSYN 3 6 29 VSYN ;
    pub 768p		1024 768 1 VRES =V65 ;
    
    ( 16:9 )
    pub 360p		640 360 2 VRES : =HD 74,250,000 VCLK 	72 80 216 HSYN 3 5 22 VSYN  ;
    pub 720p		1280 720 1 VRES =HD ;
    pub 1080p		1920 1080 1 VRES 148,500,000 VCLK 	88 44 148 HSYN 4 5 36 VSYN ;
    
    pub 1368x768p		1368 768 1 VRES 85,860,000 VCLK		72 144 216 HSYN 1 3 23 VSYN ;
    pub 1440x900p		1440 900 1 VRES 106,470,000 VCLK	80 152 232 HSYN 1 3 28 VSYN ;
    

    BTW, TAQOZ routines can flow into the next routine if there is no explicit EXIT or ; so I combined that in one-line as in the case of 360p which flows into a new routine =HD which is also callable from 720p and 1080p.
  • MJBMJB Posts: 1,235
    edited 2019-07-28 08:22
    ...
    ( 16:9 )
    pub 360p	          640 360 2 VRES : =HD 74,250,000 VCLK 	72 80 216 HSYN 3 5 22 VSYN  ;
    pub 720p	        1280 720 1 VRES =HD ;
    pub 1080p     1920 1080 1 VRES 148,500,000 VCLK 	88 44 148 HSYN 4 5 36 VSYN ;
    

    BTW, TAQOZ routines can flow into the next routine if there is no explicit EXIT or ; so I combined that in one-line as in the case of 360p which flows into a new routine =HD which is also callable from 720p and 1080p.

    @"Peter Jakacki"
    I really love Tachyon/Taqos and admire the way you write code.

    But this is TOO MUCH - this really contributes to the impression obviously some people have about write only code.
    Sure in this case it looks nice with all the parameters - more or less - nicely lined up below each other.

    But the same reason you usually write PRINT instead of a mere . which is easily overlooked,
    here the inline : instead of a pri on the start of a line which it probably should have been, makes the code really obscure.
    ...
    pub 360p           640 360 2 VRES 
       pri =HD                                    74,250,000 VCLK    72 80 216 HSYN 3 5 22 VSYN  ;
    pub 720p         1280  720 1 VRES =HD ;
    pub 1080p        1920 1080 1 VRES            148,500,000 VCLK    88 44 148 HSYN 4 5 36 VSYN ;
    

    or even
    ...
       pri =HD                                    74,250,000 VCLK    72 80 216 HSYN 3 5 22 VSYN  ;
    pub 360p           640 360 2 VRES =HD ;
    pub 720p         1280  720 1 VRES =HD ;
    pub 1080p        1920 1080 1 VRES            148,500,000 VCLK    88 44 148 HSYN 4 5 36 VSYN ;
    

    And the 13 or so word codes you save are partly offset by the dictionary entry anyhow also taking a word from the namespace, so just copying the line might also do the job ;-) - in this case.
    ...
    pub 360p      640 360 2 VRES        74,250,000 VCLK     72 80 216 HSYN 3 5 22 VSYN  ;
    pub 720p     1280 720 1 VRES        74,250,000 VCLK     72 80 216 HSYN 3 5 22 VSYN  ;
    pub 1080p   1920 1080 1 VRES       148,500,000 VCLK     88 44 148 HSYN 4 5 36 VSYN  ;
    

    and it is useful in many cases that definitions can flow into each other !!

    ;-) sorry master criticizing your coding style - just couldn't hold it back ;-) ;-)
Sign In or Register to comment.