{{htmlmetatags>metatag-robots=() metatag-title=( | ugBASIC User Manual) metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum) metatag-description=(An isomorphic language for retrocomputers) metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png) metatag-og:title=( | ugBASIC User Manual) metatag-og:description=(An isomorphic language for retrocomputers) }} ====== ugBASIC Manuale Utente ====== ===== ===== ==== SCOPO ==== ==== SORGENTE ==== Bm En(16):C#a0=4:C# a1 = 2: C# a2 = Sc Hg / 16 C# a3 = ( Sc Hg - 16 ) C# a4 = ( Sc Wd - 16 ) C# a5 = (Sc Wd / a0) Di x(a0), y(a0), dx(a0), dy(a0), d(a0), m(a0) Gb x, y, f, dx, dy, d, m Gb a6, a7, a8, b9 a6 = 16*8 a7 = 16*2+6 Gb b0, b1, bgb0 Gb b3, bgb3 Prcd b5 bgb0 := Nw Ims(a0,16,10) bgb3 := Nw Im(8,10) Cl Bl Ik GREY Br 0,0 To 15,3 Ik Bu Dr"L16R2U3L2R16L2D3L4U3L3D3" b1 := Nw Im(16,4) Ge Im b1 Fm 0, 0 Cl Ik GREY Br 2,2 To 6,9 Ik Bu Dr"BL1U8L1D8" b3 := Nw Im(8,10) Ge Im b3 Fm 0, 0 Cl Ik Re Ci 4,4,4 P#(4,4) Ik Wht Dr"BU2L1D1L1D1" b0 := Nw Im(16,10) Ge Im b0 Fm 0, 0 Cl i = 0 ty = 3 Rpt tx = (i * a5) + a1 x(i) = tx y(i) = ty dx(i) = a1 dy(i) = 0 Ge Im bgb0 Fr i Fm tx, ty INC i Un i = a0 Fil d Wi 1 Fil m Wi 0 Ee Prcd Gb bx, by Prcd b6 bx = 0 i = 0: j = RND(255) Rpt If (j An 1) = 0 Th Pu Im b1 At bx, by Ei j = j \ 2 Ad bx, 16 INC i Un bx > a4 Ee Prcd Prcd b6s by = 16 Rpt b6[] Ad by, 16 Un by > a3 Ee Prcd Pr Prcd c8 Rpt Wt Wh [d] [m] = 1 If Pt([x]+3,[y]+9) = Bl Th [dy] = a1 [dx] = 0 El [dy] = 0 If [dx] = 0 Th If RND(100) > 50 Th [dx] = a1 El [dx] = -a1 Ei Ei If [x] >= a4 Th [dx] = -[dx] Eif [x] < a1 Th [dx] = -[dx] Eif Pt([x]+9,[y]+4) <> Bl Th [dx] = -[dx] El If Pt([x]-3,[y]+4) <> Bl Th [dx] = -[dx] Ei Ei [m] = 0 [d] = 1 Un [y] > Sc Hg Ee Prcd Pr Prcd c9 Do c0 = 0 i = a0-1 Rpt If c0 < y(i) Th c0 = y(i) + 15 Ei DEC i Un i < 0 Wh Rst Ln < c0 We FORBID If a6 <> a8 OR a7 <> b9 Th Pu Im bgb3 At a8, b9 Ge Im bgb3 Fm a6, a7 Pu Im b3 At a6, a7 Wi Trs a8 = a6: b9 = a7 Ei i = a0-1: Rpt d(i) = 1 Pu Im bgb0 Fr i At x(i),y(i) DEC i Un i < 0 i = 0: Rpt Ad x(i), dx(i) Ad y(i), dy(i) Ge Im bgb0 Fr i Fm x(i),y(i) Pu Im b0 At x(i), y(i) Wi Trs INC i Un i = a0 Fil d Wi 0 ALLOW Lp Ee Prcd 'Pr Prcd c1 ' ' Do ' Wh c2: DEC c2: We ' If Ju(0) An a7 > 0 An Pt(a6 + 4, a7 - 16) = Bl Th ' Ad a7, -16 ' c2 = 10 ' Ei ' If Jd(0) An a7 < a3 An Pt(a6 + 4, a7 + 16) = Bl Th ' Ad a7, 16 ' c2 = 10 ' Ei ' If Jl(0) An a6 > 16 An Pt(a6 - a1, a7) = Bl Th ' Ad a6, -a1 ' c2 = 10 ' Ei ' If Jr(0) An a6 < a3 An Pt(a6 + 8 + a1, a7) = Bl Th ' Ad a6, a1 ' c2 = 10 ' Ei ' Lp ' 'Ee Prb b5[] b6s[] Fo k=0 To a0-1 Sw c8 Nx k Sw c9 'Sw c1 ' balls -> a0 ' step -> a1 ' levels -> a2 ' screenLimitH -> a3 ' screenLimitW -> a4 ' ballStep -> a5 ' plx -> a6 ' ply -> a7 ' pvx -> a8 ' pvy -> b9 ' ball -> b0 ' bar -> b1 ' bgball -> b2 ' paddle -> b3 ' bgpaddle -> b4 ' prepareGraphics -> b5 ' drawBarrier -> b6 ' drawBarriers -> b7 ' moveBall -> c8 ' drawBallsAndPaddle -> c9 ' maxy -> c0 ' movePlayer -> c1 ' pdelay -> c2 ==== FILE ==== * ''[[https://github.com/spotlessmind1975/ugbasic/tree/main/examples/x.bas|x.bas]]'' ==== COME ESEGUIRLO ==== === Atari 400/800 === Per poter eseguire l'esempio, è necessario disporre dell'emulatore Altirra, e in particolare che l'eseguibile ''x64sc'' sia accessibile. Digitare quindi il seguente comando: # Linux ugbc.atari x.bas -o example.xex altirra example.xex # Windows ugbc.atari.exe x.bas -o example.xex altirra example.xex === Atari 600XL/800XL/1200XL/XG(SE) === Per poter eseguire l'esempio, è necessario disporre dell'emulatore Altirra, e in particolare che l'eseguibile ''x64sc'' sia accessibile. Digitare quindi il seguente comando: # Linux ugbc.atarixl x.bas -o example.xex altirra example.xex # Windows ugbc.atarixl.exe x.bas -o example.xex altirra example.xex === Commodore 64 === Per poter eseguire l'esempio, è necessario disporre dell'emulatore VICE, e in particolare che l'eseguibile ''x64sc'' sia accessibile. Digitare quindi il seguente comando: # Linux ugbc.c64 x.bas -o example.prg x64sc example.prg # Windows ugbc.c64.exe x.bas -o example.prg x64sc example.prg === Commodore PLUS/4 === == Usando YAPE == Per poter eseguire l'esempio, è necessario disporre dell'emulatore YAPE, e in particolare che l'eseguibile ''yape'' sia accessibile. Digitare quindi il seguente comando: # Linux ugbc.plus4 x.bas -o example.prg yape example.prg # Windows ugbc.plus4.exe x.bas -o example.prg yape example.prg == Usando VICE == Per poter eseguire l'esempio, è necessario disporre dell'emulatore VICE, e in particolare che l'eseguibile ''xplus4'' sia accessibile. Digitare quindi il seguente comando: # Linux ugbc.plus4 x.bas -o example.prg xplus4 example.prg # Windows ugbc.plus4.exe x.bas -o example.prg xplus4 example.prg === Dragon 32 === Per poter eseguire l'esempio, è necessario disporre dell'emulatore XROAR, e in particolare che l'eseguibile ''x64sc'' sia accessibile. Digitare quindi il seguente comando: # Linux ugbc.d32 x.bas -o example.bin xroar -rompath (percorso ROM) example.bin # Windows ugbc.d32.exe x.bas -o example.bin xroar.exe -rompath (percorso ROM) example.bin === Dragon 64 === Per poter eseguire l'esempio, è necessario disporre dell'emulatore XROAR, e in particolare che l'eseguibile ''x64sc'' sia accessibile. Digitare quindi il seguente comando: # Linux ugbc.d64 x.bas -o example.bin xroar -rompath (percorso ROM) example.bin # Windows ugbc.d64.exe x.bas -o example.bin xroar.exe -rompath (percorso ROM) example.bin === PC128 Olivetti Prodest === Per poter eseguire l'esempio, è necessario disporre dell'emulatore DCMOTO, e in particolare che l'eseguibile ''x64sc'' sia accessibile. Digitare quindi i seguenti comandi: # Linux ugbc.pc128op x.bas -o example.bin dcmoto example.bin (scegliere example.bin) (scegliere BASIC 128) CLEAR,&H2FFF: LOADM"CASS:",R: EXEC # Windows ugbc.pc128op.exe x.bas -o example.bin dcmoto example.bin (scegliere BASIC 128) CLEAR,&H2FFF: LOADM"CASS:",R: EXEC === Thomson MO5 === Per poter eseguire l'esempio, è necessario disporre dell'emulatore DCMOTO, e in particolare che l'eseguibile ''x64sc'' sia accessibile. Digitare quindi i seguenti comandi: # Linux ugbc.mo5 x.bas -o example.bin dcmoto example.bin (scegliere example.bin) (scegliere BASIC 128) CLEAR,&H2FFF: LOADM"CASS:",R: EXEC # Windows ugbc.mo5.exe x.bas -o example.bin dcmoto example.bin (scegliere BASIC 128) CLEAR,&H2FFF: LOADM"CASS:",R: EXEC === Commodore VIC-20 === Per poter eseguire l'esempio, è necessario disporre dell'emulatore XEMU, e in particolare che l'eseguibile ''xmega65'' sia accessibile. Digitare quindi il seguente comando: # Linux ugbc.vic20 x.bas -o example.prg xvic --memory 24k example.prg # Windows ugbc.vic20.exe x.bas -o example.prg xvic --memory 24k example.prg === ZX Spectrum === Per poter eseguire l'esempio, è necessario disporre dell'emulatore Speccy, e in particolare che l'eseguibile ''speccy'' sia accessibile. Digitare quindi il seguente comando: # Linux ugbc.zx x.bas -o example.tap Speccy example.tap # Windows ugbc.zx.exe x.bas -o example.tap Speccy example.tap === ColecoVision === Per compilare e mandare in esecuzione l'esempio, hai bisogno di avere l'emulatore openMsx oppure il BlueMSX, e in particolare che il suo eseguibile sia accessibile. Dopo di che, digita questo comando sulla linea di comando: == openMSX == # Linux ugbc.coleco x.bas -o example.rom openmsx -machine \"COL - ColecoVision\" -cart example.rom # Windows ugbc.coleco.exe x.bas -o example.rom bluemsx -machine \"COL - ColecoVision\" example.rom == blueMSX == # Linux ugbc.coleco x.bas -o example.rom bluemsx /machine \"COL - ColecoVision\" /rom1 example.rom # Windows ugbc.coleco.exe x.bas -o example.rom bluemsx /machine \"COL - ColecoVision\" /rom1 example.rom === SEGA SC-3000 === Per compilare e mandare in esecuzione l'esempio, hai bisogno di avere l'emulatore BlueMSX, e in particolare che il suo eseguibile sia accessibile. Dopo di che, digita questo comando sulla linea di comando: # Linux ugbc.sc3000 x.bas -o example.rom bluemsx /machine \"SEGA - SC-3000\" /rom1 example.rom # Windows ugbc.sc3000.exe x.bas -o example.rom bluemsx /machine \"SEGA - SC-3000\" /rom1 example.rom === SEGA SG-1000 === Per compilare e mandare in esecuzione l'esempio, hai bisogno di avere l'emulatore BlueMSX, e in particolare che il suo eseguibile sia accessibile. Dopo di che, digita questo comando sulla linea di comando: # Linux ugbc.sg1000 x.bas -o example.rom bluemsx /machine \"SEGA - SG-1000\" /rom1 example.rom # Windows ugbc.sg1000.exe x.bas -o example.rom bluemsx /machine \"SEGA - SG-1000\" /rom1 example.rom ==== PROBLEMI? ==== Se hai trovato un problema nel cercare di eseguire questo esempio, se pensi che ci sia un bug o, più semplicemente, vorresti che fosse migliorato, [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=MIGLIORARE |apri una segnalazione]] su GitHub per questo specifico esempio. Grazie!===== POWERED BY ===== [[:it:ugbasic:user:examples|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]