OTHER CONTRIBUTIONS: PETSCII MAZE

This example is inspired by an example posted in some groups, which compares the execution speed of BASIC 2.0, BASIC 2.0 compiled with BasicBoss, and, finally, directly from ugBASIC. This code is specific to ugBASIC and serves to provide benchmarks of achievable performance.

Click here for more informations.

source compile sandbox issues? back to examples

SOURCE CODE ()

PROCEDURE example ON C128, C64, C64REU, VIC20

	endAddress = TEXTADDRESS + ROWS*COLUMNS
	
	INK WHITE
	PAPER BLACK
	CLS
	POKE &HD018, &H15
	
	slash1# = 77
	slash2# = 78
	b1# = 1

	t0 = TIME
	
	t = TEXTADDRESS
	DO
		a# = RANDOM BYTE AND b1#
		POKE t, slash1#+a#
		INC t
		EXIT IF t = endAddress
	LOOP

	t1 = TIME
	
	jiffys = (t1 - t0)
	dauer = jiffys * 1000 / TPS
	
	BOTTOM: CLINE: PRINT "elapsed: ";dauer;" ms (";jiffys;" j)";
	
END PROCEDURE

example[] ON C128, C64, C64REU, VIC20
	

How to compile and run the example

The instructions here refer to compiling the example from the command line. For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile each single example with just one click.



Are instructions for your specific home computer / console missing? First of all, check if your computer is supported by clicking here. If so, since ugBASIC is a language which does not provide abstractions, it is possible that this example will not work on your target. If you think this is an issue, please click here.

Commodore 128 (CPU 8502)

In order to compile the example, type this command on the command line:

Linux

ugbc.c128 -O prg -o contrib_petscii_maze.prg contrib_petscii_maze.bas

Windows

ugbc.c128.exe -O prg -o contrib_petscii_maze.prg contrib_petscii_maze.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

Commodore 64, Commodore Executive 64

In order to compile the example, type this command on the command line:

Linux

ugbc.c64 -O prg -o contrib_petscii_maze.prg contrib_petscii_maze.bas

Windows

ugbc.c64.exe -O prg -o contrib_petscii_maze.prg contrib_petscii_maze.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

Commodore 64 + REU

In order to compile the example, type this command on the command line:

Linux

ugbc.c64reu -O d64 -o contrib_petscii_maze.d64 contrib_petscii_maze.bas

Windows

ugbc.c64reu.exe -O d64 -o contrib_petscii_maze.d64 contrib_petscii_maze.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

VIC-20

In order to compile the example, type this command on the command line:

Linux

ugbc.vic20 -O prg -o contrib_petscii_maze.prg contrib_petscii_maze.bas

Windows

ugbc.vic20.exe -O prg -o contrib_petscii_maze.prg contrib_petscii_maze.bas

For Microsoft Windows users we suggest using UGBASIC-IDE, which allows you to download and compile this example with just one click.

Any problem?

If you have found a problem trying to run this example, if you think there is a bug or, more simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!

open an issue BACK TO EXAMPLES