TAQOZ - Tachyon Forth for the P2 BOOT ROM - Page 34 — Parallax Forums

# TAQOZ - Tachyon Forth for the P2 BOOT ROM

## Comments

• Posts: 1,760
Peter,
Did you ever create a driver for the nrfl024+ in TAQOZ?

Jim
• Posts: 1,252
I think I found a bug in TAQOZ. When going through Starting Forth Quizzie 2-b I noticed the following problem. I would have expected zero (because of integer math) where fraction math would have put it at -1/3), but I got -3 instead. Is this a bug, or am I doing something wrong?

TAQOZ# : 2B5 SWAP - / ; --- ok
TAQOZ# 3 2 1 2B5 --- ok
TAQOZ# . --- -3 ok
TAQOZ#
• Posts: 10,193
edited 2020-12-29 23:01
@hinv
I'm not sure what you are doing with such a short operation and then naming it with what could be a hex number? Anyway it is so easy to debug in so many ways but it should be obvious that you are dividing 3 by -1 not -1 by 3.
```TAQOZ# 3 2 1 SWAP - .S ---
DATA STACK (2)
1   \$FFFF_FFFF   -1
2   \$0000_0003   3 ok
TAQOZ# / . --- -3  ok
```

Alternatively you can use the trace feature if running the RELOADED version, being careful to turn it back off again.
```TAQOZ# : DIFF/    SWAP - / ; ---  ok
TAQOZ# TRACE 3 2 1 DIFF/ UNTRACE ---
07470 :  1803
07472 :  1802                  1( 00000003 )
07474 :  1801                  2( 00000002  00000003 )
07476 :  7468 DIFF/            3( 00000001  00000002  00000003 )
07468 :   008E SWAP            3( 00000001  00000002  00000003 )
0746A :   009B -               3( 00000002  00000001  00000003 )
0746C :   20F3                 2( FFFFFFFF  00000003 )
020F2 :   0086 OVER            2( FFFFFFFF  00000003 )
020F4 :   00DC ABS             3( 00000003  FFFFFFFF  00000003 )
020F6 :   0086 OVER            3( 00000003  FFFFFFFF  00000003 )
020F8 :   00DC ABS             4( FFFFFFFF  00000003  FFFFFFFF  00000003 )
020FA :   111C U/              4( 00000001  00000003  FFFFFFFF  00000003 )
020FC :   0091 -ROT            3( 00000003  FFFFFFFF  00000003 )
020FE :   00AA XOR             3( FFFFFFFF  00000003  00000003 )
02100 :   009E -NEGATE         2( FFFFFFFC  00000003 )
02102 :   005D EXIT            1( FFFFFFFD )
07478 :  0430 UNTRACE          1( FFFFFFFD  ok
```

btw, you are working with integers, not floating point. You will need to scale your numbers if you want a fractional result.
```TAQOZ# -1 3 / . --- 0  ok
TAQOZ# -1 1000 3 */ . --- -333  ok
```
Where -1 is scaled by 1000 with a 64-bit intermediate result and then divided by 3 back to a 32-bit result, in this case the result would be interpreted as having 3 decimal places or -0.333.
• Posts: 222
@"Peter Jakacki"
I miss in the documentation (https://docs.google.com/document/d/1TgkY8WBOzIlQca1pXsuInmEeOqT5w0pIJlaFY1qfvco/edit#) a (more detailed) description for the following keywords:

a) "DUPC@"
It says 'Push the internal fx register onto the datastack', but what is 'fx register' ?

b) "BIT!"

c) "GOTO"
I know what "GOTO" means. But how would I use it?

d) "T"
H is for pin high, L for pin low, F before pin float, R for pin input, but T?

e) "NONE"
Maybe to disable terminal output? How to use it?

f) "SEROUT"
Serial output? How, what, where?

g) ".AS"
What is the difference to '.AS"'?

h) ASM
It says 'Execute following code as hubexec assembly code'. Following? How to use?

i) "[" and "]"

j) "!SX"

k) "CMD"

l) "ACMD

m) "cid

o) "AUTO"
With "BACKUP" I can save newly created words and restore them manually with "RESTORE" after restart. But how does "AUTO" work.

At the top of your document there is the link to EXTEND.FTH is broken. What was in it?
• Posts: 1,252
@hinv
I'm not sure what you are doing with such a short operation and then naming it with what could be a hex number? Anyway it is so easy to debug in so many ways but it should be obvious that you are dividing 3 by -1 not -1 by 3.

...

Where -1 is scaled by 1000 with a 64-bit intermediate result and then divided by 3 back to a 32-bit result, in this case the result would be interpreted as having 3 decimal places or -0.333.

Yep, you're right. I should have put another swap in my program. Thanks!
• Posts: 10,193
edited 2021-01-01 23:47
@dnalor - Most of these replies are simply from the sources, both taqoz.spin and TAQOZ.FTH
a) "DUPC@"
It says 'Push the internal fx register onto the datastack', but what is 'fx register' ?
```' DUPC@ ( addr -- addr data )
013a0     fac01820 DUPCFT		rdbyte  X,a
013a4     fd800070 		jmp     #PUSHX                  ' Push the internal X register onto the datastack
```
b) "BIT!"
```BIT! ( mask addr flg -- )
```
Will SET or CLR a bit mask in memmory. true will SET, false will CLR
c) "GOTO"
I know what "GOTO" means. But how would I use it?
'' compile a dummy NOP/GO to be replacd later with a goto (addr+ex)
This is only used internally by IF and ELSE etc where the forward address can't be known until later
It leave a \$1E MARK + the current address on the stack which is used later.
d) "T"
H is for pin high, L for pin low, F before pin float, R for pin input, but T?
```' T - toggle the pinreg PIN '
00b4c 164 0d60145f _T      _ret_   drvnot  pinreg
```
e) "NONE"
Maybe to disable terminal output? How to use it?
NONE PRINT" this is going nowhere"
f) "SEROUT"
Serial output? How, what, where?
```pub SEROUT ( data pin -- )	pIN WAITPIN WYPIN ;
```
Transmit a character through the smartpin that is normally configured for asynch
g) ".AS"
What is the difference to '.AS"'?
The .AS" must compile a literal format string whereas .AS expects the pointer to the string on the stack.
```1234 .AS" #.###ms"
1234 " #.###ms" .AS
```
h) ASM
It says 'Execute following code as hubexec assembly code'. Following? How to use?
Simply switches to the assembler input and vocabulary. This would only be used within
a Forth definition when you want to switch to inline assembly. I will see if I can paste in an example later on.
i) "[" and "]"
[ Stop permanent compiling (as in a new word) and switch back to temporary compilation (as in interactive)
] Resume permanent compiling.
These words are handy if you need to perform some operation at compile time inside of a new word.
j) "!SX"

k) "CMD"

l) "ACMD

m) "cid
All these are SD card routines that are exposed but not normally needed.
You can however check a card is responding with a 0 0 CMD for instance.
o) "AUTO"
With "BACKUP" I can save newly created words and restore them manually with "RESTORE" after restart. But how does "AUTO" work.
AUTO MAIN
Make MAIN the autostart routine (requires a backup)
At the top of your document there is the link to EXTEND.FTH is broken. What was in it?
EXTEND.FTH in Tachyon is simply called TAQOZ.FTH in TAQOZ with all the standard high-level stuff
I will check the links
• Posts: 10,193
edited 2021-01-16 02:29
I've made some changes to the boot report since the I2C bus activity seemed to be upsetting the RTC sometimes (but only at boot when it is interrogating the devices etc). All is stable now but I will enable the password lock on the RTC to prevent inadvertent corruption as it seems to be a bit sensitive to the volume of high-speed traffic with the UB3. The I2C driver enables strong pullups on the selected I2C pins so there is no need to have external pullups.

The binaries have been updated on Dropbox and SF accordingly and I have changed the names of the source files since I was getting confused with my own naming system

EXTEND.FTH - the main extensions added to the kernel by the kernel.
FILE.FTH - all the SD FAT32 file system add-ons etc and the backup utilities

Those two are the minimum that needs to be added for a bootable system.
The standard extras are:
P2ASM.FTH - the interactive assembler.
MEDIA.FTH - VGA text and graphics, WAV audio, BMP viewer and BMV video player etc.

A zip file containing the current TAQOZ and Tachyon binaries etc is attached.

The boot report for the current version (along with some updated UB3 firmware)
```BOOTING....  CARD: SANDISK   SD SC64G REV\$80 #35190404 DATE:2018/10
KERNEL            Parallax P2  *TAQOZ RELOADED sIDE*  V2.7 'CHIP' Prop_Ver G 200MHz 201123-1000
MODULES:
1508 *TEXT*          VGA BMP TEXT 190800-0000
1260 *BMV*           BMV VIDEO PLAYER 190800-0000
766 *WAVE*          WAVE AUDIO FILE PLAYER 190800-0000
430 *BMP*           BMP FILE VIEWER 190800-0000
1938 *MEDIA*         TAQOZ INTERACTIVE MEDIA - AUDIO, TEXT, IMAGE & VIDEO DRIVERS 200403-1200
4868 *P2ASM*         TAQOZ INTERACTIVE ASSEMBLER for the PARALLAX P2 - 200713-1000
2562 *DISK*          SD DISK REPORTING & FORMATTING TOOLS 190800-0000
4798 *FILE*          TAQOZ FAT32 FILE SYSTEM for SD CARD plus VIRTUAL MEMORY  210115-1400
1502 *SPIRAM*        LY68L6400 8MB SPI RAM ACCESS 191020-0000
1774 *DECOMPILER*    A decompiler for TAQOZ 190825-0000
1324 *RTC*           RV-3028 RTC DATE and TIME 190800-0000
828 *SMARTPINS*     SMARTPIN FUNCTIONS and drive modes 190800-0000
400 *P2CLOCK*       P2 CLOCK CONTROL 190800-0000
2258 *ANSI*          ANSI TERMINAL SUPPORT 200410-0000
406 *EXTEND*        Primary kernel extensions for TAQOZ 210115-0030
5754 *SPIFLASH*
MEMORY MAP
CODE:         09EDA  40,666 bytes
WORDS:        1C0EB  16,012 bytes
DATA:         00496  1,174 bytes
ROOM:                74,257 bytes
HARDWARE
PCB           P2      (P2D2)
CLOCK IN      20.000000MHZ
DEVICES
SD CARD       63 GB  SANDISK   SD SC64G REV\$80 #35190404 DATE:2018/10
SPI FLASH     16MB WINBOND \$EF40_1800 #4837448895114529879
USB           Silicon Labs EFM8UB3 uPORT SERIAL WATCHDOG UB3_2.5.8B 0005
I2C DEVICES
\$36           P2D2 UB USB+SUPPORT  UUID:669BAD5834DEE811A8D742B1A51F80DA
\$A4           RV-3028 RTC  2021/01/16 SAT 12:01:54
\$C4           Si5351A CLOCK GEN
STATS           18 RESETS  Temp= 40.35'C   Vdd=1.833V
-------------------------------------------------------------------------------
TAQOZ#
```

My minicom status line:
```CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7.1 | VT102 | Online 1:6 | ttyUSB0
```
• Posts: 10,193
edited 2021-01-19 11:11
If debugging is the art of removing bugs from programs, then programming must be the art of putting them in.
I'm fixing a bug that affects _BOOT_P2.BIX that I modified last week, so don't be surprised if that version didn't boot. I will update it today. It was actually to do with the way the open file directory space is handled, but this ended up overwriting the first sector of the boot file !@\$\$@!

TAQOZ BYTES anyone?
I mentioned that I could do a version of Quick Bytes for TAQOZ, simply called TAQOZ BYTES. What would that look like. I've attached a tentative version of a PDF lesson on handling I2C. It's incomplete but I'm just getting a feel for the format, the material, and the layout. Even though I already have numerous online documents and also the wiki pages on my SourceForge account, this may complement it and would be suitable for compiling into a book form too. I just felt too that this should have its own logo to dress it up.

This is done with Google docs and I download it as a PDF but I also "publish" the document as a web document that doesn't require any sign-in etc and automatically refreshes from the original, although it loses some of its formatting in the process.

EDIT: revised PDF
• Posts: 18,069
Yes please Peter. TAQOZ needs to be used a lot more!

BTW I don't like the logo. Need the ByTes changing to Bytes because I read it as TAQOZ By Tes - who's Tes
• Posts: 10,193
@Cluso99 - yes, my wife read the same thing (who's Tes) but I was trying to balance the logo but if that's what you see too, then I need to change it.
• Posts: 670
If debugging is the art of removing bugs from programs, then programming must be the art of putting them in....

TAQOZ BYTES anyone?
I mentioned that I could do a version of Quick Bytes for TAQOZ, simply called TAQOZ BYTES. ....

That part on programming is a killer !

And a huge YES to TAQOZ BYTES, or whatever it's eventually called.
• Posts: 670
Anyone, ask yourself this: will the P2 give a boost to any flavor of C or Basic or Python of sorts or vice versa ? Maybe.

But I think P2 and TAQOZ are an excellent combo. Each one giving the other one a boost in popularity and usability. No need for an external tools like compilers/debuggers and interactive. Instant feedback and extendable. Perfect, and getting even better.
• Posts: 401
Taqoz Bytes - good idea. Each article takes a small amount of time to do, unlike a complete manual. We can all contribute them according to our knowledge and interests. If they're all stored in one place, then the knowledge to help the newcomer use the language is easily found.
• Posts: 375
@"Peter Jakacki"
I boot TAQOZ from SD Card and I cannot "SEE" I2CPINS.

I'm trying to set the pins for I2C to 0,1 and thought that instruction was just the thing.
```---  ok
TAQOZ# .ver ---   Parallax P2  *TAQOZ* Extensible Firmware  V2.5 'CHIP' 300MHz 200504-1430
ok
TAQOZ#
KERNEL            Parallax P2  *TAQOZ* Extensible Firmware  V2.5 'CHIP' 300MHz 200504-1430
MODULES:
*C2*    1518          C2 Debug Interface for Silabs Microcontrollers - 200424.0000
*SPLAT*    2324       SPLAT - Serial Propeller Logic Analyzer Terminal  200417-0000
*SIM65*    2880       A SIMULATOR FOR THE 65C02 - 200217.0000
*PLEXLED*     350     CharliePlexing LED device driver 190714.0000
*MORSE*     444       Morse code keyer 200126-0000
*LIFE*    1172        Conway's Game of Life for TAQOZ in the P2 ROM V1.0 190226.0000
*BREAKOUT*    1506    BREAKOUT FOR THE P2 - 190606
*MANDELBROT*     518  MANDELBROT VGA DEMO 190800-0000
*CLKGEN*     654      Si5351 Clock generator 190800-0000
*EASYNET*    3736     WIZnet NETWORK SERVERS 160707.1500
*W5500*    2292       WIZNET W5500 driver for TAQOZ V1.0 191007
*PS2*     654         PS/2 KEYBOARD
*TEXT*    1508        VGA BMP TEXT 190800-0000
*BMV*    1260         BMV VIDEO PLAYER 190800-0000
*WAVE*     772        WAVE AUDIO FILE PLAYER 190800-0000
*BMP*     430         BMP FILE VIEWER 190800-0000
*TIM*    1942         TAQOZ INTERACTIVE MEDIA - AUDIO, TEXT, IMAGE & VIDEO DRIVERS 200403-1200
*TIA*    4866         TAQOZ INTERACTIVE ASSEMBLER for the PARALLAX P2 - 200327-2300
*SPIRAM*    1248      LY68L6400 8MB SPI RAM ACCESS 191020-0000
*DECOMPILER*    1762  A decompiler for TAQOZ 190825-0000
*RTC*     434         RV-3028 RTC DATE and TIME 190800-0000
*DISK*    2562        SD DISK REPORTING & FORMATTING TOOLS 190800-0000
*EASYFILE*    4658    SD CARD and FAT32 with VIRTUAL MEMORY  190800-0000
*SMARTPINS*     374   SMARTPIN FUNCTIONS and drive modes 190800-0000
*P2CLOCK*     384     P2 CLOCK CONTROL 190800-0000
*ANSI*    2286        ANSI TERMINAL SUPPORT 200410-0000
*EXTEND*     390      Primary kernel extensions 200426-1000
*SPIFLASH*    5746
MEMORY MAP
CODE:         0DE78  56,952 bytes
WORDS:        1A592  22,984 bytes
DATA:         7E2B1  689 bytes
ROOM:                50,970 bytes
HARDWARE
PCB           P2
CLOCK IN      20MHZ
DEVICES
SD CARD       3 GB  SANDISK   SD SU04G REV\$80 #27348993 DATE:2002 /12
I2C DEVICES
-------------------------------------------------------------------------------
TAQOZ#
```

It says I have ver 2.5. Is that the latest?

• Posts: 401
Peter,

Thanks for the link to the Taqoz Bytes folder. Is it a good idea to identify the version of Taqoz the Byte was written for?

Cheers, Bob
• Posts: 10,193
bob_g4bby wrote: »
Peter,

Thanks for the link to the Taqoz Bytes folder. Is it a good idea to identify the version of Taqoz the Byte was written for?

Cheers, Bob

Yes, the latest! There's all that extra little stuff I still need to add to the document with the links and references and author etc. The folder will also be the repository for those files that are linked to, just to keep everything all together in one place.

@DaveJenson - Hey Dave! Where did you get that old old version from? Just click on "The LOT" in my sig then P2/TAQOZ/binaries and grab the _BOOT_P2.BIX file. Here's a quick link to it which I may add to my sig which has to be short these days.
• Posts: 375
@DaveJenson - Hey Dave! Where did you get that old old version from? Just click on "The LOT" in my sig then P2/TAQOZ/binaries and grab the _BOOT_P2.BIX file. Here's a quick link to it which I may add to my sig which has to be short these days.

About five times now, I downloaded that _BOOT_P2.BIX file and copied it to my SD card.

I have even reformatted the card each time with windows Disk Format.
It still comes up "V2.5" on my Terminal screen and no I2CPINS found.

What am I doing wrong?
• Posts: 375
edited 2021-01-21 22:22
@"Peter Jakacki"
OK, I got it!

I formatted my sd card with SD Card Formatter and copied _BOOT_P2.BIX and it seems to be all there. V2.7.

And I2CPINS is there.

And apparently TAQOZ does not like using pins 0 and 1 for I2C bus.
It works when I use pins 10 and 11...

Thanks. I'm ready for MORE TAQOZ Bytes!!
• Posts: 10,193
edited 2021-01-22 01:31
@DaveJenson
VGA on P0..P4 is enabled by default, that's why it doesn't "like" P0 You can change or disable the VGA config registers in page 0 (first 256 bytes). Once you use I2CPINS it will setup the pins with internal pullups and bus speed of 400kHz and then issues a restart followed by a stop.

Maybe your card had a backup on the MBR which overrides the BIX version. To disable the MBR version just type BACKUP DISABLE

I still have to finish off the first TAQOZ BYTES document but most of it is there now. It will be good to see it hosted on Parallax then.

If you want your card formatted properly and with larger clusters then please format the card in TAQOZ like this, after which you can backup again.
Grant RW and system permissions (for safety), then format which can take a little while but the cursor spins while it is busy.
```RWS FORMAT
```
Once it is done it will test and display a long .DISK report.

Then backup TAQOZ again.
```BACKUP BIX
```

• Posts: 10,193
edited 2021-01-22 02:27
There's an update to the TAQOZ binary and includes support for time-stamping files automatically now plus lots of other little things under the hood. Besides the DIR command remember that there is the DIRW, ls, ls -l, and now DIR+ and DIR++ with stacks of useful info being report. Renaming files is now working too and you can even rename by index rather than name. Basically anything that had to do with directories has been brought up-to-date.

If you want to format your SD card then I'd recommend using the maximum cluster size that FAT32 supports of 64KB which is much better suited for embedded systems. Even if you had one thousand small files (really!?), that's still only 64MB which is barely noticed even in the smallest SD cards. I've made that the default now although you can specify the cluster size and also set permissions (for safety) before a FORMAT like this:
```RWS FORMAT
```

After it's done it will spit out a long disk report covering the card's registers, the MBR, the FAT32, and also speed and latency reports.
If you do a BACKUP BIX and it doesn't exist, it will now correctly create the file etc before backing up.

I want to do a version now that backs up and boots from Flash so I can have it preinstalled when I ship the P2D2s.

In the meantime I hooked up a piezo transducer/speaker directly to 2 I/O pins set as left and right audio but complementary analog drive for mono audio. I then switched over to the WAV directory on my old test board and this is what I typed, and you can hear it here. The WAV player has been there since 2019 at least but I did add the complementary drive some time ago too.
```TAQOZ# DIRW ---
P2 CARD
_BOOT_P2.BIX  [BMP    ]     [BMV    ]     [FTH    ]     [HTM    ]     [PDF    ]     [PNG    ]     [TXT    ]
[WAV    ]     _BOOT_P2.LZ4  FAVICON.ICO   IMAGE         IMAGE1        IMAGE2        IMAGE3        P8CPU.JPG
SPIDEY.GIF    TIGER.GIF     TIGER.JPG     FISH2.VT       ok
TAQOZ# CD WAV Opened @ \$007B_8396 ---  ok
TAQOZ# DIRW ---
P2 CARD
[.    ]       [..    ]      LOVE.WAV      POPCORN.WAV   LOVE.MP3      POPCORN.MP3   MANICMON.WAV  MOUTH.WAV
500MILES.WAV  ABOTTLE.WAV   ALABAMA.WAV   AMORE.WAV     AVATAR.WAV    BABYLON.WAV   BASS.WAV      BELIEVER.WAV
BOOTS.WAV     BROWNEYE.WAV  CANON.WAV     COMEAWAY.WAV  COSMIC.WAV    CRASHES.WAV   CRUSH.WAV     DANNY.WAV
DAYO.WAV      DREAMIN.WAV   DRIFT.WAV     DRUM.WAV      EATWORLD.WAV  EYEJOE.WAV    FALLLOVE.WAV  FASTCAR.WAV
FLOWERS.WAV   FOURWIND.WAV  FRIENDS.WAV   GAS.WAV       GEORGIA.WAV   GRASS.WAV     GUANTAN.WAV   GUNDI.WAV
HERDOOR.WAV   HOMEWARD.WAV  HORIZON.WAV   INLOVE.WAV    ISLAND.WAV    ISTANBUL.WAV  JANE.WAV      KELLYST.WAV
LION.WAV      LOVEISIN.WAV  MOONLIGH.WAV  MOONRIVR.WAV  MORNING.WAV   PERHAPS.WAV   PODCAST.WAV   REET.WAV
ROCKROLL.WAV  SHARONA.WAV   SHINE.WAV     SOFTLY.WAV    STANDBY.WAV   SUMMER.WAV    SUMMER69.WAV  SUNSHINE.WAV
TEQUILA.WAV   THISKISS.WAV  TONIGHT.WAV   TRULY.WAV     TWIST.WAV     WAYWARD.WAV   WISHIN.WAV    WONDER.WAV     ok
TAQOZ# PLAY REET ---  ok
TAQOZ# 20 PITCH ---  ok
TAQOZ# 100 PITCH ---  ok
TAQOZ# 120 PITCH ---  ok
TAQOZ# 90 PITCH ---  ok
TAQOZ# 100 PITCH ---  ok
TAQOZ# PAUSE ---  ok
TAQOZ# PAUSE ---  ok
TAQOZ# PLAY ALABAMA ---  ok
TAQOZ# 2 REW ---  ok
TAQOZ# 2 REW ---  ok
TAQOZ# 5 REW ---  ok
TAQOZ# PLAY PODCAST ---  ok
TAQOZ# 120 PITCH ---  ok
TAQOZ# PLAY TWIST ---  ok
TAQOZ# STOP ---  ok
TAQOZ#  ---  ok
```

Here's one of the newer directory commands too, this one just lists out the maximum size allocated and a bit of the file header.
```NAME           ATR 1ST SECTOR   MODIFIED             FILE SIZE       MAX SIZE     HEADER
```
```TAQOZ# DIR+ ---
P2 CARD
[.    ]         10 \$007B_8396   2021-01-21 22:19              0 /        65,536   .Xt.5R5R
[..    ]        10 \$0000_BA96   2021-01-21 22:19              0 /        65,536
LOVE.WAV        20 \$007B_8416   2015-02-16 08:06     14,630,692 /    14,680,064   RIFF?.WAVEfmt
POPCORN.WAV     20 \$007B_F416   2012-11-07 13:26      3,242,394 /     3,276,800   RIFF.y1WAVEfmt
LOVE.MP3        20 \$007C_0D16   2012-02-12 14:26      3,981,374 /     3,997,696   ID3TXXX
POPCORN.MP3     20 \$007C_2B96   2015-02-26 06:22      1,177,881 /     1,179,648   ID3@?Z
MANICMON.WAV    20 \$007C_3496   2019-04-03 05:00     16,063,604 /    16,121,856   RIFFl.WAVEfmt
MOUTH.WAV       20 \$007C_AF96   2019-04-03 05:00     18,146,434 /    18,153,472   RIFFz.WAVEfmt
500MILES.WAV    20 \$007D_3A16   2019-04-03 05:00     17,892,994 /    17,956,864   RIFFzWAVEfmt
ABOTTLE.WAV     20 \$007D_C316   2019-04-03 05:00     12,872,642 /    12,910,592   RIFF.k.WAVEfmt
ALABAMA.WAV     20 \$007E_2596   2019-04-03 05:00     26,440,884 /    26,476,544   RIFF.t.WAVEfmt
AMORE.WAV       20 \$007E_EF96   2019-04-03 05:00     16,658,054 /    16,711,680   RIFF~..WAVEfmt
AVATAR.WAV      20 \$007F_6F16   2019-04-02 05:37    139,198,622 /   139,264,000   RIFF.LWAVEfmt
BABYLON.WAV     20 \$0083_9596   2019-04-03 05:00     23,422,578 /    23,461,888   RIFFjfeWAVEfmt
BASS.WAV        20 \$0084_4896   2019-04-03 05:00     20,885,882 /    20,905,984   RIFFr.>WAVEfmt
BELIEVER.WAV    20 \$0084_E816   2019-04-03 05:00     14,706,652 /    14,745,600   RIFF.g.WAVEfmt
BOOTS.WAV       20 \$0085_5896   2019-04-03 05:00     14,720,334 /    14,745,600   RIFFF..WAVEfmt
BROWNEYE.WAV    20 \$0085_C916   2019-04-03 05:00     16,370,106 /    16,384,000   RIFF...WAVEfmt
CANON.WAV       20 \$0086_4616   2019-04-03 05:00     26,544,496 /    26,607,616   RIFFh.WAVEfmt
COMEAWAY.WAV    20 \$0087_1116   2019-04-03 05:00     17,487,590 /    17,498,112   RIFF..WAVEfmt
COSMIC.WAV      20 \$0087_9696   2019-04-03 05:00     21,503,364 /    21,561,344   RIFF|HWAVEfmt
CRASHES.WAV     20 \$0088_3B16   2019-04-03 05:00     28,697,206 /    28,704,768   RIFFn..WAVEfmt
CRUSH.WAV       20 \$0089_1616   2019-04-03 05:00     17,697,140 /    17,760,256   RIFFlWAVEfmt
DANNY.WAV       20 \$0089_9D96   2019-04-03 04:01     28,818,708 /    28,835,840   RIFF..WAVEfmt
DAYO.WAV        20 \$008A_7996   2019-04-03 05:00     16,204,282 /    16,252,928   RIFF.A.WAVEfmt
DREAMIN.WAV     20 \$008A_F596   2019-04-03 05:00     14,402,542 /    14,417,920   RIFF...WAVEfmt
DRIFT.WAV       20 \$008B_6396   2019-04-03 05:00     20,823,748 /    20,840,448   RIFF..=WAVEfmt
DRUM.WAV        20 \$008C_0296   2019-04-03 05:00     14,139,774 /    14,155,776   RIFFv..WAVEfmt
EATWORLD.WAV    20 \$008C_6E96   2019-04-03 05:00     14,635,198 /    14,680,064   RIFF.P.WAVEfmt
EYEJOE.WAV      20 \$008C_DE96   2019-04-03 05:00     22,392,694 /    22,413,312   RIFFn.UWAVEfmt
FALLLOVE.WAV    20 \$008D_8996   2019-04-03 05:00     16,874,686 /    16,908,288   RIFF.|WAVEfmt
FASTCAR.WAV     20 \$008E_0A96   2019-04-03 05:00     26,187,428 /    26,214,400   RIFF...WAVEfmt
FLOWERS.WAV     20 \$008E_D296   2019-04-03 05:00     16,169,640 /    16,187,392   RIFF...WAVEfmt
FOURWIND.WAV    20 \$008F_4E16   2019-04-03 05:00     21,643,996 /    21,692,416   RIFF.BJWAVEfmt
FRIENDS.WAV     20 \$008F_F396   2019-04-03 05:00     30,000,518 /    30,015,488   RIFF~..WAVEfmt
GAS.WAV         20 \$0090_D896   2019-04-03 05:00     16,229,602 /    16,252,928   RIFF...WAVEfmt
GEORGIA.WAV     20 \$0091_5496   2019-04-03 05:00     24,544,720 /    24,576,000   RIFF..vWAVEfmt
GRASS.WAV       20 \$0092_1016   2019-04-03 05:00     16,416,234 /    16,449,536   RIFF.}.WAVEfmt
GUANTAN.WAV     20 \$0092_8D96   2019-04-03 05:00     17,072,760 /    17,104,896   RIFFp.WAVEfmt
GUNDI.WAV       20 \$0093_1016   2019-04-03 05:00     20,763,726 /    20,774,912   RIFFF.<WAVEfmt
HERDOOR.WAV     20 \$0093_AE96   2019-04-03 05:00     17,381,532 /    17,432,576   RIFF.8WAVEfmt
HOMEWARD.WAV    20 \$0094_3396   2019-04-03 05:00     12,939,446 /    12,976,128   RIFF.p.WAVEfmt
HORIZON.WAV     20 \$0094_9696   2019-04-03 05:00     13,561,528 /    13,565,952   RIFF...WAVEfmt
INLOVE.WAV      20 \$0094_FE16   2019-04-03 05:00     15,616,750 /    15,663,104   RIFF.J.WAVEfmt
ISLAND.WAV      20 \$0095_7596   2019-04-03 05:00     18,531,272 /    18,546,688   RIFF..WAVEfmt
ISTANBUL.WAV    20 \$0096_0316   2019-04-03 05:00     12,386,476 /    12,451,840   RIFF..WAVEfmt
JANE.WAV        20 \$0096_6216   2021-01-21 22:49     51,380,224 /    92,274,688   RIFFVtR!WAVEfmt
KELLYST.WAV     20 \$0099_2216   2019-04-03 05:00     17,611,902 /    17,629,184   RIFFv.WAVEfmt
LION.WAV        20 \$0099_A896   2019-04-03 05:00     14,006,246 /    14,024,704   RIFF...WAVEfmt
LOVEISIN.WAV    20 \$009A_1396   2019-04-03 05:00     18,425,274 /    18,481,152   RIFF.%WAVEfmt
MOONLIGH.WAV    20 \$009A_A096   2019-04-03 05:00     19,008,202 /    19,070,976   RIFF."WAVEfmt
MOONRIVR.WAV    20 \$009B_3216   2019-04-03 05:00     14,112,222 /    14,155,776   RIFF.U.WAVEfmt
MORNING.WAV     20 \$009B_9E16   2019-04-03 05:00     19,897,462 /    19,922,944   RIFFn./WAVEfmt
PERHAPS.WAV     20 \$009C_3616   2019-04-03 05:00     15,858,572 /    15,859,712   RIFF...WAVEfmt
PODCAST.WAV     20 \$009C_AF16   2019-04-04 05:45    413,911,440 /   413,925,376   RIFF...WAVEfmt
REET.WAV        20 \$00A9_0516   2019-04-03 05:00     14,280,432 /    14,286,848   RIFF...WAVEfmt
ROCKROLL.WAV    20 \$00A9_7216   2019-04-03 05:00     13,656,036 /    13,697,024   RIFF._.WAVEfmt
SHARONA.WAV     20 \$00A9_DA96   2019-04-03 05:00     26,141,362 /    26,148,864   RIFF...WAVEfmt
SHINE.WAV       20 \$00AA_A216   2019-04-03 05:00     20,710,814 /    20,774,912   RIFF.<WAVEfmt
SOFTLY.WAV      20 \$00AB_4096   2019-04-03 05:00     25,411,012 /    25,427,968   RIFF...WAVEfmt
STANDBY.WAV     20 \$00AC_0296   2019-04-03 05:00     15,386,332 /    15,400,960   RIFF...WAVEfmt
SUMMER.WAV      20 \$00AC_7816   2019-04-03 05:00     12,792,042 /    12,845,056   RIFF.0.WAVEfmt
SUMMER69.WAV    20 \$00AC_DA16   2019-04-03 05:00     18,911,376 /    18,939,904   RIFF..WAVEfmt
SUNSHINE.WAV    20 \$00AD_6A96   2019-04-03 05:00     20,973,520 /    21,037,056   RIFF.@WAVEfmt
TEQUILA.WAV     20 \$00AE_0B16   2019-04-03 04:01     11,654,044 /    11,665,408   RIFF...WAVEfmt
THISKISS.WAV    20 \$00AE_6416   2019-04-03 05:00     17,323,896 /    17,367,040   RIFFpWWAVEfmt
TONIGHT.WAV     20 \$00AE_E896   2019-04-03 05:00     21,111,630 /    21,168,128   RIFFF#BWAVEfmt
TRULY.WAV       20 \$00AF_8A16   2019-04-03 05:00     24,551,612 /    24,576,000   RIFF..vWAVEfmt
TWIST.WAV       20 \$00B0_4596   2019-04-03 05:00     13,713,630 /    13,762,560   RIFF.@.WAVEfmt
WAYWARD.WAV     20 \$00B0_AE96   2019-04-03 05:00     15,644,386 /    15,663,104   RIFF...WAVEfmt
WISHIN.WAV      20 \$00B1_2616   2019-04-03 05:00     15,443,946 /    15,466,496   RIFF...WAVEfmt
WONDER.WAV      20 \$00B1_9C16   2019-04-03 05:00     22,577,076 /    22,609,920   RIFF..XWAVEfmt ok
TAQOZ#
```

• Posts: 375
@"Peter Jakacki"
Thanks for all your help and ALL your efforts for TAQOZ and everything!

I am currently running on @Cluso99's RetroBlade2, and having mostly success.

I found a typo (I think) in lsi2c.
It lists a device as "I/O EXPLANDER". Should that be "EXPANDER"?
• Posts: 10,193
edited 2021-01-24 02:52
TAQOZ P2ASM TIPS:

The P2ASM module allows standard syntax code files to be assembled interactively or mixed with source. If you want a word that works like any other Forth word but is defined purely in assembler then you can use the CODE word instead of pub or : and TAQOZ will switch to the assembler mode and create a CODE <name> in the dictionary as normal. But what happens when you start off as a normal pub Forth word, write some Forth code, but then you really need to insert some inline code. Well, here's one way to do it.

Use ASM: and if you want a listing then use ON LISTING or list. The assembler automatically indents to allow for labels and conditions so you ideally want to tab one more to allow for this since it is a single-pass assembler that can resolve forward references and symbols, but obviously not amend the single pass listing.

Here's an example that plots a point on a mono screen which is also used by the text font generator for 1080p.
```--- Plot a point on a 1bpp screen (called from PLOT)
TAQOZ# pub PLOT1 ( c:pen b:x a:y ) ---
cols W* 3 >> SCR +      --- dynamic row calculation in screen memory
ASM:
list
0A0C4 F600_1821         mov     xx,b        ' x '
0A0C8 F044_1803         shr     xx,#3       ' x >>3'
0A0CC F100_400C         add     a,xx        ' a = scrptr
0A0D0 FAC0_1820         rdbyte  xx,a        ' read byte'
0A0D4 F504_4207         and     b,#7        ' bit position in byte '
0A0D8 F608_4422         mov     c,c wz
0A0DC F4A0_1821         bitnz   xx,b
0A0E0 FC40_1820         wrbyte  xx,a
0A0E4 FD80_0EB4         3DROP;              ' shortcut to return and drop the 3 parameters
---  ok                end
```
The top 4 registers of the data stack are a b c d and in the TAQOZ cog there are internal working registers xx yy zz and r0 r1 r2 r3 and acc. The reason for xx yy zz instead of x y z is simply to avoid confusion with the graphics words x y w h which are used to set co-ordinates and width and height etc (i.e. 100 x 40 y 150 w 150 h PANEL)

@DaveJenson - EXPLANDER a typo? Maybe it's a new word
• Posts: 10,193
edited 2021-01-24 08:35
Testing the new forum for uploads. A 2MB file limit is a bit 2010'ish, isn't it?
I had a 37MB file that I passed through WinFF and ended up with 2.7MB. I had to crop the frame further to squeeze into the 2MB limit.

Here is TAQOZ booting up and checking to see if it has a VGA monitor connected and then setting the screen up for 640x360x8 (16:9) then searching the SD card for a splash screen and/or a startup sound. I will have to make a more appropriate sound TAQOZ, but it's a quick test and then TAQOZ prints up a short report.
• Posts: 10,193
edited 2021-01-24 15:05
Found a better splash screen and some music, and add a touch of image modulation. Much better!

I just changed the method for splash and startup to read a config file which points to the files to use etc rather than copying and renaming (which btw we can do in TAQOZ itself).
```16 bytes configs
16 bytes splash
16 bytes startup
pub !MEDIA
8 BPP 360p VGA
---	READ CONFIGS          and copy to configs       splash screen  startup sound + effects + match text
" BOOT.CFG" FOPEN\$ IF 0 SDADR configs \$30 CMOVE splash VIEW\$ startup PLAY\$ MODULATE black PEN 255 PAPER THEN
VHOME CRLF SYSINFO CON
;
--- patch this in to the INIT code that is run at boot
AT !MEDIA +INIT
```

and the config file itself:
```TAQOZ# FOPEN BOOT.CFG Opened @ \$00B2_A816 ---  ok
TAQOZ# 0 \$30 SD DUMP ---
00000: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00     '................'
00010: 4D 49 4E 49  4F 4E 00 00  00 00 00 00  00 00 00 00     'MINION..........'
00020: 54 41 51 4F  5A 55 50 00  00 00 00 00  00 00 00 00     'TAQOZUP.........' ok
```
• Posts: 10,193
edited 2021-01-24 23:41

I've updated Dropbox and cleaned up any clutter on Source Forge pages but here is a zip of those files to make this work and tested on a P2 EVAL with VGA hooked to P0 and sound on P6,7 and baud rate set to 921600.

• Posts: 10,193
edited 2021-01-26 05:56

On the way to adding stand-alone text editing to TAQOZ I decided that I could implement something similar to the old Forth block editor. I never really used these old block editors but something like that is all that I would need for config files etc. Normally these blocks are 64x16 or 1kB but I decided that I would just work with a 512 byte sector at a time and 64 wide or 128 wide if it detects a CR in that position. This would make it editable with trailing spaces on a PC editor but the fixed width is useful for config files etc.

This will work very nicely with my built-in VGA modes too and I will tie this in with the PS/2 keyboard functions. Once it is useful I can then start dressing it up to display and edit larger blocks although SED already pages to the next sector when it has too. Just keeping it simple for now. So SED is a Simple Editor (or sector editor) in 570 code bytes (at present).

NOTE: I've been able to use this not only for my files but also to edit headers in media files and even directly edit other sectors. For this reason I am adding a hex edit mode and a backup sector for a revert option even though I've made it only save if you type ^S anyway.

• Posts: 670
edited 2021-01-26 11:58

This SED looks to be super useful. I've given it a shot and it's fun. Need some more practice to use it effectively.

BTW, I've noticed the ^J and ^Z do the same thing or maybe I'm missing something (I know it's not polished yet so maybe this is intentional. A placeholder for something else perhaps ?)

• Posts: 10,193
edited 2021-01-26 13:05

A lot of these controls and escape commands are not final but I know that the only way to test it is to make it functional first. So I'm trying to make it easy to edit without requiring interpreting ANSI key sequences like \$1B \$5B \$42 for the right arrow etc However \$1B \$5B could be a command to read another key so I could add this function easily. I'll do it right now!

I actually had changed ^J to an ignore but this editor is only a few hours old, there's still plenty to do but I'm even editing source code files with it too. The hex mode hasn't been implemented yet but I think I know how I want to display that now.

I've avoided writing any kind of editor before this simply because I wanted it to handle regular variable length line text files, but really, most of the time that is not required anyway. SED keeps it simple and surprisingly useful.

edit: yep, cursor keys work fine. Now to add some more sequence keys.

• Posts: 10,193
edited 2021-01-27 14:11

QUICK RTC FUNCTIONS

Reading time and date is combined into one quick 7 byte read from the RTC and so to read the time and/or date takes 290us over the I2C bus at 400kHz. That's good but sometimes we don't want to waste too much time doing this. Is there a faster way? Yes, if the time and date is read at boot time and latched along with the P2's 64-bit counter using GETMS, then whenever we want the current time we can do a GETMS for an elapsed time and then calculate the current time.

For this I have added QTIME@ and QDATE@ to quickly work this out and now it takes only 15us to get the current time. I might change the method later and store the boot time in seconds rather then hhmmss to speed it up a bit more, but still, 15us aint' bad.

Here is the quick&dirty test code - yet to be improved.

```--- Calculate the current time quickly (15us) by using the latched boot time and ms plus the curent GETMS

pub QTIME@ ( --- hhmmss )

btime @ HMS ( s m h ) --- get time at booter and split into hours mins secs

GETMS bms @ - 1000 / 60 U// 60 U// ( s m h ) --- GETMS since booter and split into hours mins secs

ROT4 + -ROT ROT4 + -ROT ROT4 + ( m h s ) --- add the two sets of hours mins secs

60 U// ROT4 + ( h s m ) 60 U// ROT4 + ( s m h ) --- wrap and carry seconds and minutes into hours mins secs

100 * + 100 * + --- recombine into hhmmss ;

;

```

{ Test timing of methods and check output

TAQOZ# LAP TIME@ LAP .LAP TAB PRINT --- 58,057 cycles= 290,285ns @200MHz 234017 ok

TAQOZ# LAP QTIME@ LAP .LAP TAB PRINT --- 3,089 cycles= 15,445ns @200MHz 234024 ok

}

• Posts: 10,193
edited 2021-01-28 02:05

Here is the updated routine for Quick Time which relies on the P2's 64-bit systick counter and the associated GETMS function to calculate the time of day using the RTC time which was read and latched at boot. The SECS@ function is also useful for timestamps.

Software needn't be slowed down performing I2C routines just to get the current time, and this QTIME function takes only 10us. No doubt a hubexec function could be a bit faster.

```--- return with seconds of the day

pub SECS@ ( -- seconds ) btime @ GETMS bms @ - 1000 / + ;

--- Quick TIME@ (10us) using the boot time plus the curent GETMS

pub QTIME@ ( --- hhmmss ) SECS@ 60 U// 60 U// ( s m h ) >HMS ;
```

In Australia we used to have stones, pounds and ounces, and also pounds, shillings and pence before we changed over to the metric system in the 60's and 70's. The US has dollars and sense but are still weighed down by imperial British weights! (as well as feet and inches)

Calculating in straight decimal is so much easier but it makes me think about how hours, minutes, and seconds are so "imperial" and awkward. I can't see any country changing to metric time though :) Sumerian time is deeply embedded in society and history.

BTW - the RV-3028 has UNIX time as well but that's a bit harder to convert to standard date and time notation.

Sign In or Register to comment.