Skip to content

Commit

Permalink
Add support for Thomson TO8 #752
Browse files Browse the repository at this point in the history
  • Loading branch information
spotlessmind1975 committed Apr 27, 2024
1 parent 78fe0ad commit 102dfa6
Show file tree
Hide file tree
Showing 39 changed files with 59 additions and 58 deletions.
2 changes: 1 addition & 1 deletion examples/arrays_examples_01.bas
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ REM Questo piccolo esempio mostra la sintassi base per definire un array e per
REM accedervi. Da notare come gli array, in ugBASIC, partono da zero. Quindi se dimensioniamo
REM un array con il numero 2 stiamo intendendo un array di due elementi: l'elemento 0 e l'elemento 1.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,to8,sg1000,sc3000,cpc,vic20,zx
CLS
Expand Down
2 changes: 1 addition & 1 deletion examples/arrays_examples_02.bas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REM accedervi. In questo caso stiamo definendo un array la cui dimensione è
REM definita per mezzo di una costante. Le costanti non occupano spazio, e
REM rendono più leggibile il sorgente.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,to8,sg1000,sc3000,cpc,vic20,zx
CLS
Expand Down
24 changes: 12 additions & 12 deletions examples/arrays_examples_03.bas
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ REM dimensioni, inizializzato con una costante (3). Inoltre, si mostra come
REM permettere l'accesso ad un array sul programma principale da parte di una
REM procedura parametrica.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,to8,sg1000,sc3000,cpc,vic20,zx
CLS
CONST a = 6
CONST b = 7
CONST c = ( a*b ) / 2
CONST first = 6
CONST second = 7
CONST third = ( first*second ) / 2
DIM ax AS BYTE WITH (3) (a,b)
DIM ay AS BYTE WITH (3) (c)
DIM az AS BYTE WITH (3) (c)
DIM firstx AS BYTE WITH (3) (first,second)
DIM firsty AS BYTE WITH (3) (third)
DIM firstz AS BYTE WITH (3) (third)
PROCEDURE execute[t]
SHARED ax, ay, az
SHARED firstx, firsty, firstz
ax(ay(t),az(t)) = 0
az(t) = az(t) + 1
ax(ay(t),az(t)) = 1
firstx(firsty(t),firstz(t)) = 0
firstz(t) = firstz(t) + 1
firstx(firsty(t),firstz(t)) = 1
END PROCEDURE
Expand All @@ -42,7 +42,7 @@ REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,
FOR y = 0 TO a-1
FOR x = 0 TO b-1
LOCATE x+1,y+1
PRINT ax(x,y)
PRINT firstx(x,y)
NEXT
PRINT
NEXT
Expand Down
2 changes: 1 addition & 1 deletion examples/arrays_examples_04.bas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REM dell'array. Questo programma mostra sia come definire un array
REM bidimensionale che come accedere agli elementi iniziali e finali
REM della matrice.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,to8,sg1000,sc3000,cpc,vic20,zx
CLS
Expand Down
2 changes: 1 addition & 1 deletion examples/arrays_examples_05.bas
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ REM Questo piccolo esempio mostra come inizializzare ogni elemento di
REM un array, al momento della compilazione. Questo riduce l'ingombro
REM in termini di tempo e spazio.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,to8,sg1000,sc3000,cpc,vic20,zx
CLS
Expand Down
4 changes: 2 additions & 2 deletions examples/arrays_examples_06.bas
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ REM
REM Questo piccolo esempio mostra come recuperare
REM i limiti degli array.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,to8,sg1000,sc3000,cpc,vic20,zx
DIM number(5,4,3)
PRINT "UBOUND(number) should be 5: "; UBOUND(number)
PRINT "UBOUND(number,0) should be 5: "; UBOUND(number,0)
PRINT "UBOUND(number,2) should be 3: "; UBOUND(number,2)
PRINT "UBOUND(number,2) should be 3: "; UBOUND(number,2)
4 changes: 2 additions & 2 deletions examples/arrays_examples_07.bas
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ REM
REM Questo piccolo esempio mostra come definire array
REM con differenti tipi di dato, e come inizializzarli.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,to8,sg1000,sc3000,cpc,vic20,zx
DIM integers(4) WITH 42
PRINT "integers(1) should be 42: ";integers(1)
Expand All @@ -19,4 +19,4 @@ PRINT "integers2(1,0) should be 30: ";integers2(1,0)
DIM integers3(3,2) = #[0010002000030004000500060]
PRINT "integers3(1,0) should be 48: ";integers3(1,0)

4 changes: 2 additions & 2 deletions examples/assembly_example_01.bas
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ REM
REM Questo piccolo esempio spiega come integrare l'assembly
REM in solo una linea di codice
REM
REM @include atari,atarixl,c128,c128z,c64,coco,coco3,coleco,cpc,d32,d64,mo5,msx1,pc128op,plus4,sc3000,sg1000,vg5000,vic20,zx
REM @include atari,atarixl,c128,c128z,c64,coco,coco3,coleco,cpc,d32,d64,mo5,msx1,pc128op,plus4,sc3000,sg1000,to8,vg5000,vic20,zx
CLS
Expand All @@ -28,4 +28,4 @@ REM @include atari,atarixl,c128,c128z,c64,coco,coco3,coleco,cpc,d32,d64,mo5,msx1
ELSE
PRINT "bad!"
ENDIF

4 changes: 2 additions & 2 deletions examples/assembly_example_02.bas
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ REM
REM Questo piccolo esempio spiega come integrare l'assembly
REM con più righe di assembly.
REM
REM @include atari,atarixl,c128,c128z,c64,coco,coco3,coleco,cpc,d32,d64,mo5,msx1,pc128op,plus4,sc3000,sg1000,vg5000,vic20,zx
REM @include atari,atarixl,c128,c128z,c64,coco,coco3,coleco,cpc,d32,d64,mo5,msx1,pc128op,plus4,sc3000,sg1000,to8,vg5000,vic20,zx
CLS
Expand Down Expand Up @@ -59,4 +59,4 @@ REM @include atari,atarixl,c128,c128z,c64,coco,coco3,coleco,cpc,d32,d64,mo5,msx1
ELSE
PRINT "bad!"
ENDIF

2 changes: 1 addition & 1 deletion examples/buffers_definition_01.bas
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ REM
REM Questo piccolo esempio mostra la sintassi base per definire un buffer.
REM Un buffer è un'area di memoria definita staticamente e usata "così com'è".
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,sg1000,sc3000,to8,vic20,zx
CLS
Expand Down
2 changes: 1 addition & 1 deletion examples/buffers_definition_02.bas
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ REM
REM Questo piccolo esempio mostra la sintassi per caricare un file in un buffer.
REM Il file è caricato al momento della compilazione, e incluso nell'eseguibile.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,sg1000,sc3000,to8,vic20,zx
CLS
Expand Down
2 changes: 1 addition & 1 deletion examples/buffers_definition_03.bas
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ REM Questo piccolo esempio mostra come viene gestito l'aliasing, cioè
REM quando viene chiesto di caricare lo stesso file (viene caricata una sola copia,
REM dato che il nome del file è lo stesso).
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,sg1000,sc3000,to8,vic20,zx
CLS
Expand Down
2 changes: 1 addition & 1 deletion examples/buffers_print_01.bas
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ REM Da notare che la parola chiave BUFFER addizionale è necessaria,
REM per spiegare a ugBASIC che si vuole la stampa del contenuto del buffer
REM e non del tipo della variabile.
REM
REM @include atari,atarixl,c128,c64,coco,d32,d64,coleco,sg1000,sc3000,vic20,zx
REM @include atari,atarixl,c128,c64,coco,d32,d64,coleco,pc128op,sg1000,sc3000,to8,vic20,zx
CLS
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_ascii.bas
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ REM VARI ALTRI CONTRIBUTI CARATTERI STAMPABILI
REM
REM Questo piccolo esempio mostra la tabella dei codici ASCII (stampabili) sullo schermo.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,to8,vic20,zx
CLS
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_ascii2.bas
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ REM
REM Questo piccolo esempio mostra la tabella dei codici ASCII (stampabili) sullo schermo.
REM Il buffer carwicato sarà compresso con l'algoritmo MSC1, per risparmiare spazio.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,to8,zx
CLS
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_asm_motorola6809.bas
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ REM di inserire codice assembly in linea. Accedendo, chiaramente, a
REM tutte le caratteristiche del BASIC. Questo programma mostra come
REM si opera una somma a 16 bit (2 x 8 bit) con il processore MOTOROLA 6809.
REM
REM @include coco,coco3,d32,d64
REM @include coco,coco3,d32,d64,pc128op,to8

DIM x AS INTEGER, y AS INTEGER, z AS INTEGER

Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_calibration.bas
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ REM di 10 secondi esatti. Come valore aggiunto, questo codice sorgente
REM spiega come rilevare se il computer sta funzionando in PAL
REM oppure in NTSC.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,sg1000,sc3000,cpc,vic20,to8,zx

CLS BLACK

Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_cube.bas
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ REM Questo piccolo esempio mostra come si può disegnare un cubo rotante in BASI
REM Mutilizzando lo stesso sorgente BASIC. Nonostante il fatto che la rotazione sembri abbastanza veloce, il
REM tutto non è stato minimamente ottimizzato. Vi sono larghe possibiità di ottimizzazione del codice.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,cpc,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,cpc,zx,pc128op,to8

BITMAP ENABLE(16) : CLS BLACK

Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_cube2.bas
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ REM Questo piccolo esempio mostra come si può disegnare un cubo rotante in BASI
REM Mutilizzando lo stesso sorgente BASIC. È stata effettuata una piccola ottimizzazione sulla cancellazione
REM solo della bitmap occupata dal cubo.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,cpc,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,cpc,zx,pc128op,to8

BITMAP ENABLE(16) : CLS BLACK
DIM t AS SIGNED BYTE : DIM z AS SIGNED BYTE
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_fibonacci.bas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REM classico. La sequenza Fibonacci è definita dalle seguenti regole: i primi d
REM 1 e 1; ciascun valore successivo è calcolato sommando i due valori che lo precedono. Il sorgente
REM limita la ricerca a un massimo di un valore pari a 5.000.
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,pc128op,sg1000,sc3000,cpc,vic20,to8,zx

10 CLS : HOME : max% = 5000
20 x% = 1 : y% = 1
Expand Down
4 changes: 2 additions & 2 deletions examples/contrib_for_next_bp.bas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REM Gary Luckenbaugh sulle best practice nell'uso del FOR...NEXT.
REM
REM @url https://garyluckenbaugh.substack.com/p/basic-for-next-best-practices
REM
REM @include atari,atarixl,c128,c128z,c64,coco,coco3,coleco,cpc,d32,d64,mo5,msx1,pc128op,plus4,sc3000,sg1000,vg5000,vic20,zx
REM @include atari,atarixl,c128,c128z,c64,coco,coco3,coleco,cpc,d32,d64,mo5,msx1,pc128op,plus4,sc3000,sg1000,vg5000,vic20,zx,pc128op,to8
CLS
Expand Down Expand Up @@ -144,4 +144,4 @@ PRINT
'+-------next j
'
' Also ugBASIC respects this rule.

4 changes: 2 additions & 2 deletions examples/contrib_for_next_bp2.bas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REM Gary Luckenbaugh sulle best practice nell'uso del FOR...NEXT.
REM
REM @url https://garyluckenbaugh.substack.com/p/basic-for-next-best-practices
REM
REM @include atari,atarixl,c128,c128z,c64,coco,coco3,coleco,cpc,d32,d64,mo5,msx1,pc128op,plus4,sc3000,sg1000,vg5000,vic20,zx
REM @include atari,atarixl,c128,c128z,c64,coco,coco3,coleco,cpc,d32,d64,mo5,msx1,pc128op,plus4,sc3000,sg1000,vg5000,vic20,zx,pc128op,to8

1 CLS
10 i=5
Expand All @@ -23,4 +23,4 @@ REM @include atari,atarixl,c128,c128z,c64,coco,coco3,coleco,cpc,d32,d64,mo5,msx1
40 PRINT i
50 NEXT i
60 PRINT "Done"
70 END
70 END
5 changes: 3 additions & 2 deletions examples/contrib_get_put_performances.bas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REM ridisegno delle primitive ''GET IMAGE'' e ''PUT IMAGE''.
REM L'esempio è configurabile per individuare il peso di vari
REM fattori nelle operazioni.
REM
REM @include coco3
REM @include coco3,pc128op,to8
CONST width = 16
CONST height = 16
Expand All @@ -23,7 +23,7 @@ DIM timeLimit AS INTEGER
timeLimit = (TICKS PER SECOND) * 10
BITMAP ENABLE ( 320, 192, 16 )
BITMAP ENABLE (16)
COLOR BORDER BLACK
CLS BLACK
Expand Down Expand Up @@ -60,3 +60,4 @@ pixels = px * frames
PRINT PEN(WHITE);" FRAMES : "; frames
PRINT PEN(WHITE);" PIXELS : "; pixels
PRINT PEN(WHITE);" FRAMES/S : "; PEN(YELLOW); INT( frames / time )
2 changes: 1 addition & 1 deletion examples/contrib_if_test_speed.bas
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ REM Questo esempio ha lo scopo di illustrare la velocità con cui vengono esegui
REM logici all'interno degli IF. Quale soluzione è la più veloce?
REM
REM @url https://www.facebook.com/groups/2057165187928233/posts/3451955151782556/
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx,pc128op,to8

CLS

Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_naboo_n1.bas
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ REM l'array. Questo esempio renderizza "Naboo N1 Starfighter".
REM
REM @url http://patsos.de/New_Weblog/?p=671
REM
REM @include c128,coleco,sg1000,sc3000,zx
REM @include c128,coleco,sg1000,sc3000,zx,pc128op,to8

PROCEDURE example ON ALL BUT VIC20

Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_naboo_n1_resolution.bas
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ REM per garantire the l'immagine sia disegnata all'interno di uno "schermo virtu
REM
REM @url http://patsos.de/New_Weblog/?p=671
REM
REM @include atari,atarixl,c128,c64,coco,d32,d64,coleco,sg1000,sc3000
REM @include atari,atarixl,c128,c64,coco,d32,d64,coleco,sg1000,sc3000,pc128op,to8

PROCEDURE example ON ALL BUT VIC20

Expand Down
4 changes: 2 additions & 2 deletions examples/contrib_parabola.bas
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ REM Questo codice disegnerà una parabola e un'iperbole
REM
REM @link https://www.facebook.com/groups/2057165187928233/posts/3517753575202713/
REM
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc
REM @include atari,atarixl,c128,c64,coco,coco3,d32,d64,coleco,sg1000,sc3000,cpc,pc128op,to8

0 CLS:a=5:FORj=-5TO4:a=a+j:PRINTSPC(ABS(a))"*":NEXT
1 a=5:FORj=-5TO4:a=a+j:PRINTSPC(ABS(a));"*";SPC(21+a*2)"*":NEXT


2 changes: 1 addition & 1 deletion examples/contrib_primes.bas
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ REM
REM Questo piccolo esempio estrarrà i numeri primi fra 2 e 400.
REM L'algoritmo è abbastanza semplice e, di conseguenza, molto lento.
REM
REM @include atari,atarixl,c128,c64,coco,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx,pc128op,to8
CLS
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_primes2.bas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REM di RetroProgramming Italia.
REM
REM @url https://www.facebook.com/groups/retroprogramming/posts/793835291296728/|RetroProgramming%20Italia
REM
REM @include atari,atarixl,c128,c64,coco,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx,pc128op,to8

10 CLS:c%=400:t=TI:m%=0:b%=2:PRINT" 2", " 3", " 5", " 7",
20 FOR i=11 TO c% STEP 2
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_primes3.bas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REM di RetroProgramming Italia.
REM
REM @url https://www.facebook.com/groups/retroprogramming/posts/793835291296728/|RetroProgramming%20Italia
REM
REM @include atari,atarixl,c128,c64,coco,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,d32,d64,coleco,sg1000,sc3000,cpc,vic20,zx,pc128op,to8

0 CLS
1 c%=400:t=TI:m%=0:b%=3:PRINT " 2", " 3", " 5",
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib_primes4.bas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REM di RetroProgramming Italia.
REM
REM @url https://www.linkedin.com/pulse/ottimizzazione-del-codice-massimo-sanna/|"Ottimizzazione%20del%20codice"
REM
REM @include atari,atarixl,c128,c64,coco,d32,d64,cpc,vic20,zx
REM @include atari,atarixl,c128,c64,coco,d32,d64,cpc,vic20,zx,pc128op,to8

4 CLS
5 REM inizializzo limite massimo e array di flag
Expand Down
Loading

0 comments on commit 102dfa6

Please sign in to comment.