TFORTH and HRG-Grafik...

Discussion about ZX80 / ZX81 Software
Post Reply
dh1pba
Posts: 7
Joined: Thu Nov 30, 2017 8:34 am

TFORTH and HRG-Grafik...

Post by dh1pba »

Hi good afternoon.
Now my TForth is running with the HRG graphic.

The translated commands (read HRG.PDF):
------------------------------------------
HROFF
HRON
HRBANK : Seite HRBANK

HRPIX : x y HRPIX
HRUNPIX
HRXPIX

HRLINE : x y x1 y1 HRLINE
HRUNLINE
HRXLINE

HRLINETO : x y HRLINETO
HRUNLINETO
HRXLINETO

HRCIRCLE : x y r HRCIRCLE
HRUNCIRCLE
HRXCIRCLE

HRBOX : x y x1 y1 HRBOX
HRUNBOX
HRXBOX

HRINVERT

HRHCOPY

HRCLR
----------------------------------------------

Have now brought together the zx81.rom with the hrg-64k.p as it was shown here in the forum.
HRGROM.ROM.

The hrgfth.fth file contains all the above HRG commands as inline code.
For EightyOne load as usual under "Load Memory Block" with address 32768 and read
(after TFORTH starts) with "32768 LOAD" who is not the finished HRGTFORTH.P
would like to use.

I do it like this:
- Insert HRGROM.ROM in the EightyOne
- Start
- SHIFT + S key, then appears on the screen HRG and then Return,
then Space and NEW (A key on the PC), the HRG is started.
- Start HRGTFORTH.P
and off you go with the graphic commands.

Here's a routine in TFORTH with sine / cosine to draw a star.
As usual invite the file GRAFIK.FTH to TFORTH (see above).

Start under TFORTH with:
4 HRBANK HRON HRCLR STERN or
CSTERN (with 2 Grafikscreen)

With HRG64.p you can use Bank 4-7.
Right is a printercopy with HRHCOPY

Greeting
Attachments
Bild2.jpg
(105.31 KiB) Downloaded 368 times
hrg-tforth.zip
(28.16 KiB) Downloaded 247 times
RWAP
Posts: 1348
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: TFORTH and HRG-Grafik...

Post by RWAP »

Great to see a new version of Forth - have you considered whether this would work with the UDG 4 ZXpand?
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: TFORTH and HRG-Grafik...

Post by Moggy »

RWAP wrote: Thu Nov 30, 2017 10:10 pm Great to see a new version of Forth - have you considered whether this would work with the UDG 4 ZXpand?
Not a new version, Rich it's Toddy with hi-res additions IE it uses an hi-res ROM so emulator only I would have thought unless anyone else knows different.
dh1pba
Posts: 7
Joined: Thu Nov 30, 2017 8:34 am

Re: TFORTH and HRG-Grafik...

Post by dh1pba »

here the code for STERN and CSTERN

Code: Select all

DECIMAL

CREATE SINTAB 
0000 ,  0175 ,  0349 ,  0523 ,  0698 ,  0872 ,  
1045 ,  1219 ,  1392 ,  1564 ,  1736 ,  1908 , 
2079 ,  2250 ,  2419 ,  2588 ,  2756 ,  2924 ,  
3090 ,  3256 ,  3420 ,  3584 ,  3746 ,  3907 ,  
4067 ,  4226 ,  4384 ,  4540 ,  4695 ,  4848 ,  
5000 ,  5150 ,  5299 ,  5446 ,  5592 ,  5736 ,  
5878 ,  6018 ,  6157 ,  6293 ,  6428 ,  6561 ,  
6691 ,  6820 ,  6947 ,  7071 ,  7193 ,  7314 ,  
7431 ,  7547 ,  7660 ,  7771 ,  7880 ,  7986 ,  
8090 ,  8192 ,  8290 ,  8387 ,  8480 ,  8572 ,  
8660 ,  8746 ,  8829 ,  8910 ,  8988 ,  9063 ,  
9135 ,  9205 ,  9272 ,  9336 ,  9397 ,  9455 ,  
9511 ,  9563 ,  9613 ,  9659 ,  9703 ,  9744 , 
9781 ,  9816 ,  9848 ,  9877 ,  9903 ,  9925 ,  
9945 ,  9962 ,  9976 ,  9986 ,  9994 ,  9998 ,  
10000 , 

: NIP  ( x1 x2 -- x2)            
  SWAP DROP ;
  
: REVEAL  ( -- )
   LATEST DUP C@ 127 AND SWAP C!
;

: MOD  ( N1 N2 -- N3 )
   /MOD DROP
;

: */MOD  ( N1 N2 N3 -- N4 N5 )
   ROT >R R@ ABS ROT DUP R> XOR >R ABS UM* 
   BRANCH [ ' /MOD 15 + ,          
   REVEAL                         

: */  ( N1 N2 N3 -- N4 )
   */MOD NIP
;

: SINUS@   
	2 * SINTAB + @ ;
	
: SIN       
    DUP 0< >R ABS
    360 MOD 
    DUP 180 > 
	IF 180 - 1 >R 
	ELSE 0 >R THEN 
    DUP  90 > 
	IF 180 SWAP - THEN  
    SINUS@  
    R> IF NEGATE THEN 
    R> IF NEGATE THEN ;
	
: COS           
	90 + SIN ;

: STERN 
	360 0 DO 
	128 100 HRPIX 
	I SIN 50 10000 */ 128 + 
	I COS 50 10000 */ 100 + 
	HRLINETO 
	LOOP  ;
	
: CSTERN 
    4 HRBANK HRON HRCLR
	5 HRBANK HRCLR
	360 0 DO 
	128 100 HRPIX 
	I SIN 50 10000 */ 128 + 
	I COS 50 10000 */ 100 + 
	HRLINETO 
	42976 34784 6144 CMOVE
	LOOP  ;	
  


greeting
dh1pba
Posts: 7
Joined: Thu Nov 30, 2017 8:34 am

Re: TFORTH and HRG-Grafik...

Post by dh1pba »

The TForth12 is the old TForth.
The HRG chart was only included.

Here is how to integrate the HRG into Rom:
http://forum.tlienhard.com/phpBB3/viewt ... e&start=25

The HRG is generally not running with ZXPand.
The TForth itself runs with ZXPand.

I can not speak English . I am old german with 69 years.
greeting

Greeting
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: TFORTH and HRG-Grafik...

Post by Moggy »

dh1pba wrote: Fri Dec 01, 2017 1:30 pm The TForth12 is the old TForth.
The HRG chart was only included.

Here is how to integrate the HRG into Rom:
http://forum.tlienhard.com/phpBB3/viewt ... e&start=25

The HRG is generally not running with ZXPand.
The TForth itself runs with ZXPand.

I can not speak English . I am old german with 69 years.
greeting

Greeting
Keine Sorge, wir tun unser Bestes, um es zu verstehen. :D

Welcome aboard.

Regards.

Moggy.
Post Reply