Strumenti Utente

Strumenti Sito


it:ugbasic:user:example:contrib_bad_apple
Traduzioni di questa pagina:


ugBASIC Manuale Utente

VARI ALTRI CONTRIBUTI BAD APPLE

SCOPO

Questo esempio mostra come sfruttare una espansione di memoria di grandi dimensioni (la demo occupa circa 160 KB). Il meccanismo di caricamento dei fotogrammi è svolto direttamente da ugBASIC, mentre quello che vedete qui è un semplice player.

SORGENTE

 
 PROCEDURE example ON MO5
 
     SCREEN #0
     CLS
     
 	CONST centerX = ( SCREEN WIDTH - 120 ) / 2
 	CONST centerY = ( SCREEN HEIGHT - 100 ) / 2
 	
     atlas0  := LOAD IMAGES("badapple-atlas16-0.png" ) FRAME SIZE (120,100) BANKED
     atlas1  := LOAD IMAGES("badapple-atlas16-1.png" ) FRAME SIZE (120,100) BANKED
     atlas2  := LOAD IMAGES("badapple-atlas16-2.png" ) FRAME SIZE (120,100) BANKED
     atlas3  := LOAD IMAGES("badapple-atlas16-3.png" ) FRAME SIZE (120,100) BANKED
     atlas4  := LOAD IMAGES("badapple-atlas16-4.png" ) FRAME SIZE (120,100) BANKED
     atlas5  := LOAD IMAGES("badapple-atlas16-5.png" ) FRAME SIZE (120,100) BANKED
     atlas6  := LOAD IMAGES("badapple-atlas16-6.png" ) FRAME SIZE (120,100) BANKED
     atlas7  := LOAD IMAGES("badapple-atlas16-7.png" ) FRAME SIZE (120,100) BANKED
     atlas8  := LOAD IMAGES("badapple-atlas16-8.png" ) FRAME SIZE (120,100) BANKED
     atlas9  := LOAD IMAGES("badapple-atlas16-9.png" ) FRAME SIZE (120,100) BANKED
     atlas10 := LOAD IMAGES("badapple-atlas16-10.png" ) FRAME SIZE (120,100) BANKED
     atlas11 := LOAD IMAGES("badapple-atlas16-11.png" ) FRAME SIZE (120,100) BANKED
     atlas12 := LOAD IMAGES("badapple-atlas16-12.png" ) FRAME SIZE (120,100) BANKED
     atlas13 := LOAD IMAGES("badapple-atlas16-13.png" ) FRAME SIZE (120,100) BANKED
     atlas14 := LOAD IMAGES("badapple-atlas16-14.png" ) FRAME SIZE (120,100) BANKED
     atlas15 := LOAD IMAGES("badapple-atlas16-15.png" ) FRAME SIZE (120,100) BANKED
     atlas16 := LOAD IMAGES("badapple-atlas16-16.png" ) FRAME SIZE (120,100) BANKED
     atlas17 := LOAD IMAGES("badapple-atlas16-17.png" ) FRAME SIZE (120,100) BANKED
     atlas18 := LOAD IMAGES("badapple-atlas16-18.png" ) FRAME SIZE (120,100) BANKED
     atlas19 := LOAD IMAGES("badapple-atlas16-19.png" ) FRAME SIZE (120,100) BANKED
 
     frame = (BYTE) 0
     seq = (BYTE) 0
 
     DO
 		WAIT VBL
     	SELECT CASE seq
     		CASE 0
 		        PUT IMAGE atlas0 FRAME frame AT centerX, centerY
     		CASE 1
 		        PUT IMAGE atlas1 FRAME frame AT centerX, centerY
     		CASE 2
 		        PUT IMAGE atlas2 FRAME frame AT centerX, centerY
     		CASE 3
 		        PUT IMAGE atlas3 FRAME frame AT centerX, centerY
     		CASE 4
 		        PUT IMAGE atlas4 FRAME frame AT centerX, centerY
     		CASE 5
 		        PUT IMAGE atlas5 FRAME frame AT centerX, centerY
     		CASE 6
 		        PUT IMAGE atlas6 FRAME frame AT centerX, centerY
     		CASE 7
 		        PUT IMAGE atlas7 FRAME frame AT centerX, centerY
     		CASE 8
 		        PUT IMAGE atlas8 FRAME frame AT centerX, centerY
     		CASE 9
 		        PUT IMAGE atlas9 FRAME frame AT centerX, centerY
     		CASE 10
 		        PUT IMAGE atlas10 FRAME frame AT centerX, centerY
     		CASE 11
 		        PUT IMAGE atlas11 FRAME frame AT centerX, centerY
     		CASE 12
 		        PUT IMAGE atlas12 FRAME frame AT centerX, centerY
     		CASE 13
 		        PUT IMAGE atlas13 FRAME frame AT centerX, centerY
     		CASE 14
 		        PUT IMAGE atlas14 FRAME frame AT centerX, centerY
     		CASE 15
 		        PUT IMAGE atlas15 FRAME frame AT centerX, centerY
     		CASE 16
 		        PUT IMAGE atlas16 FRAME frame AT centerX, centerY
     		CASE 17
 		        PUT IMAGE atlas17 FRAME frame AT centerX, centerY
     		CASE 18
 		        PUT IMAGE atlas18 FRAME frame AT centerX, centerY
     		CASE 19
 		        PUT IMAGE atlas19 FRAME frame AT centerX, centerY
     	ENDSELECT
         INC frame
         IF frame = 4 THEN
         	frame = 0
         	INC seq
         	IF seq = 20 THEN
         		seq = 0
         	ENDIF
         ENDIF
     LOOP
 
 END PROC
 
 	example[] ON MO5
 	
 

FILE

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 contrib_bad_apple.bas -o example.xex
 altirra example.xex
 
 # Windows 
 ugbc.atari.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.xex
 altirra example.xex
 
 # Windows 
 ugbc.atarixl.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.prg
 x64sc example.prg
 
 # Windows 
 ugbc.c64.exe contrib_bad_apple.bas -o example.prg
 x64sc example.prg

Commodore 64+REU

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.c64reu contrib_bad_apple.bas -o example.prg
 x64sc -reu example.prg
 
 # Windows 
 ugbc.c64reu.exe contrib_bad_apple.bas -o example.prg
 x64sc -reu 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 contrib_bad_apple.bas -o example.prg
 yape example.prg
 
 # Windows 
 ugbc.plus4.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.prg
 xplus4 example.prg
 
 # Windows 
 ugbc.plus4.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.bin
 xroar -rompath (percorso ROM) example.bin
 
 # Windows 
 ugbc.d32.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.bin
 xroar -rompath (percorso ROM) example.bin
 
 # Windows 
 ugbc.d64.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.bin
 dcmoto example.bin
 (scegliere example.bin)
 (scegliere BASIC 128)
 CLEAR,&H2FFF: LOADM"CASS:",R: EXEC
 
 # Windows 
 ugbc.pc128op.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.bin
 dcmoto example.bin
 (scegliere example.bin)
 (scegliere BASIC 128)
 CLEAR,&H2FFF: LOADM"CASS:",R: EXEC
 
 # Windows 
 ugbc.mo5.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.prg
 xvic --memory 24k example.prg
 
 # Windows 
 ugbc.vic20.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.tap
 Speccy example.tap
 
 # Windows 
 ugbc.zx.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.rom
 openmsx -machine \"COL - ColecoVision\" -cart example.rom
 
 # Windows 
 ugbc.coleco.exe contrib_bad_apple.bas -o example.rom
 bluemsx -machine \"COL - ColecoVision\" example.rom
blueMSX
 # Linux 
 ugbc.coleco contrib_bad_apple.bas -o example.rom
 bluemsx /machine \"COL - ColecoVision\" /rom1 example.rom
 
 # Windows 
 ugbc.coleco.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.rom
 bluemsx /machine \"SEGA - SC-3000\" /rom1 example.rom
 
 # Windows 
 ugbc.sc3000.exe contrib_bad_apple.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 contrib_bad_apple.bas -o example.rom
 bluemsx /machine \"SEGA - SG-1000\" /rom1 example.rom
 
 # Windows 
 ugbc.sg1000.exe contrib_bad_apple.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, apri una segnalazione su GitHub per questo specifico esempio. Grazie!

POWERED BY