Category: dev


Gunfright Disassembly for ZX Spectrum

Gunfright Disassembly for ZX Spectrum

Here is a disassembly of Gunfright for zasm assembler which will assemble to a .tap file

https://dl.dropboxusercontent.com/u/17590589/gunfright-zasm.zip

The Skoolkit html output for the resulting .tap file can be found here.

There are also some BBEdit Applescripts in the archive folder that I use to convert the Hex Dump and Disassembler output from ZX Preview into source code that can be assembled in zasm as well as a hex dump perl script that I use to ensure that the disassembled source has not introduced errors into the .tap file compared to the original hex dump code.

zasm assembler is available here

SP ROM ZX BASIC Demo featuring Asynchronous Scheduling using the .RUN command

SP ROM ZX BASIC Demo featuring Asynchronous Scheduling using the .RUN command

SP ROM ZX BASIC Demo featuring Asynchronous Scheduling using the .RUN command.

A BASIC text file of the above is available here and an executable .p file compiled using zxtext2p is available here.

A version of the BASIC text file using labels is available here.

An Applescript BBEdit script to compile a text file to a .p file using zxtext2p can be found here.

Optionally add the –cpuspeed option in the ZEsarUX Emulator config file to reduce screen flicker when running the demo.

$ pico ~/.zesaruxrc
--zoom 4
--cpuspeed 400
# Set CPU speed in percentage

Please ensure you have the latest version of the SP ROM binary .rom file from the post below before running the above program.

Please see post below for details of how to load and run SP ROM Extended BASIC programs.

If you update a previously loaded .p file and want to re-run

Type

NEW
LOAD ""
RAND USR 8195
RUN

To re-run the program

SP ROM ZX BASIC HRTC Test Program Output

SP ROM ZX BASIC HRTC Test Program Output

SP ROM ZX BASIC Demo featuring the HiRes Text Control Language (HRTC) functions.

A BASIC text file of the above is available here and an executable .p file compiled using zxtext2p is available here.

Please ensure you have the latest version of the SP ROM binary .rom file from the post below before running the above program.

An Applescript BBEdit script to compile a text file to a .p file using zxtext2p can be found here.

Please see post below for details of how to load and run SP ROM Extended BASIC programs.

If you update a previously loaded .p file and want to re-run

Type

NEW
LOAD ""
RAND USR 8195
RUN

To re-run the program

Screen dump after loading binary to $6600 and typing

Screen dump after loading binary to $6600 and typing “this is a test of aszmic sp rom”

SP ROM programs can also be run in ZX ASZMIC debug mode Uncomment the –romfile option in the ZEsarUX Emulator config file to enable ASZMIC E07 ROM

$ pico ~/.zesaruxrc
--machine ZX81
--romfile alternaterom_aszmice07.rom
# Select custom ROM file

Leave other config file options (see post below for full config file) as they are.

A .zip file for the above example containing the .asm source with accompanying .lis listing file as well as a .bin object file is available here.

This is based on the example program in the ASZMIC SP ROM Manual pp16-17.

Launch ZEsarUX Emulator app and type

F5->Debugging->Load Binary Block (F5 e o for manual shortcut keys)

Select zx-aszmic-sp-rom-hires-test.bin

4000h

0 (for all)

This will load the .bin file as a binary file at 16384 ($4000) in the ZX ASZMIC memory map

Type

H :6600

to run Type  “this is a test of aszmic sp rom” to see text appear on the screen Press Shift-A to exit

Running ZX81 BASIC programs that use the SP ROM Extended commands can be achieved via the ZEsarUX Emulator for OS X, Linux and Windows

ZEsarUX Emulator is available here.

Install from the .dmg file (OS X)

Copy the SP ROM .ROM file sp-rom.rom (see Xcode Project in Disassembly post below) to

/Path/To/ZEsarUX-3.0/zesarux.app/Contents/Resources/alternaterom_sp_rom.rom

Edit ZEsarUX Emulator config file

$ pico ~/.zesaruxrc
--machine ZX81
#--romfile alternaterom_aszmice07.rom
# Select custom ROM file (commented out for now)
--zoom 4
--zx8081mem 16
# Emulate 1,2,...16 kb of memory on ZX80/ZX81
--zx8081ram8K2000
# Emulate 8K RAM in 2000H for ZX80/ZX81
--zx8081ram16K8000
# Emulate 16K RAM in 8000H for ZX80/ZX81
--zx8081ram16KC000 
# Emulate 16K RAM in C000H for ZX80/ZX81
--noautoload
# No autoload tape file on Spectrum (and ZX80/ZX81)
--smartloadpath "/Path/To/SP-ROM/Source/Files/"
--realvideo
--wrx
# Enable WRX mode on on ZX80/ZX81 (v3.0 and later)
--loadbinary ../Resources/alternaterom_sp_rom.rom 2000h 0
# Load binary file "file" at address "addr" with length "len" (v3.0 and later). Set len to 0 to load the entire file in memory (F5 e then o for manual shortcut)
--loadbinarypath "/Path/To/SP-ROM/Source/Files/"
# Select initial Load Binary path (v3.0 and later)

# :dbolli:20150704 17:05:18 Updated config file options for ZEsarUX v3.0

p17 of the SP ROM Manual has a sample BASIC program

Sample program from p17 of SP ROM Manual

Sample program from p17 of SP ROM Manual

A BASIC text file of the above is available here and an executable .p file compiled using zxtext2p is available here.

An Applescript BBEdit script to compile a text file to a .p file using zxtext2p can be found here.

Launch ZEsarUX Emulator app and type

F5->Smart Load

Select .p file

 Type

POKE 16389,102
NEW

This will lower RAMTOP to $6600 to allow room for the HiRes display file

Type

LOAD ""
RAND USR 8195
Comprocsys copyright Banner appears after RAND USR 8195

Comprocsys copyright Banner appears after RAND USR 8195

You should see the Comprocsys copyright Banner appear

Press Enter

You should see the BASIC listing appear with the Extended BASIC commands

ZX81 BASIC Listing with SP ROM Extended commands being edited

ZX81 BASIC Listing with SP ROM Extended commands being edited

This can be edited as required or re-LOADed from the .p file

Type

RUN
SP ROM BASIC Program executed via RUN command

SP ROM BASIC Program executed via RUN command

You should see the HiRes display being updated as above

The SP ROM by Comprocsys Ltd was an add-on card for the ZX81 that provided 256 x 192 bitmapped graphics, reading and writing of EPROMs and communication with peripherals through a Zilog 8255 PIA chip. It could be used in conjunction with the Comprocsys ASZMIC ROM or without (via ZX81 BASIC commands).

Comprocsys External Card Advert

Comprocsys External Card Advert

I have created a disassembly of the SP ROM from a scanned printout of a disassembly I created from the ZX81 to an Epson Dot Matrix printer in 1985.

It is available as a .zip file here which contains the binary sp-rom.rom file as well as the .asm source file and an Xcode project file.

(.zip file updated 2015-06-08)

ZX81 SP ROM Disassembly Xcode Project

ZX81 SP ROM Disassembly Xcode Project

The original manual has been scanned and is available as a .PDF file here.

SP ROM User Manual

SP ROM User Manual

Original scanned printouts from 1985 disassembly are available as a series of searchable .PDF files here.

SP ROM Disassembly Scanned Printouts

SP ROM Disassembly Scanned Printouts

zasm assembler can be found here.

See article Assembling Z80 Assembler .zasm source files with BBEdit and Zasm Z80 Assembler below for more information.

Ant Attack assembled and running in FUSE Emulator for OS X

Ant Attack assembled and running in FUSE Emulator for OS X

Here is a disassembly of Ant Attack for zasm assembler which will assemble to a .tap file

https://dl.dropboxusercontent.com/u/17590589/ant-attack-zasm.zip

The Skoolkit html output for the resulting .tap file can be found here.

There are also some BBEdit Applescripts in the archive folder that I use to convert the Hex Dump and Disassembler output from ZX Preview into source code that can be assembled in zasm as well as a hex dump perl script that I use to ensure that the disassembled source has not introduced errors into the .tap file compared to the original hex dump code.

zasm assembler is available here

Cybernoid assembled and running in FUSE Emulator for OS X

Cybernoid assembled and running in FUSE Emulator for OS X

As requested by the co-developer of Cybernoid Raffaele Cecco in the following worldofspectrum.org link

Here is a disassembly of Cybernoid for zasm assembler which will assemble to a .tap file

https://dl.dropboxusercontent.com/u/17590589/cybernoid-zasm.zip

(.zip file updated 2015-01-01)

The above disassembly is at the stage where the game code has been loaded and all the copy protection and byte shifting etc. has been run. The unshifted code with all the copy protection intact can be found in the archive folder in the .zip file

There are also some BBEdit Applescripts in the archive folder that I use to convert the Hex Dump and Disassembler output from ZX Preview into source code that can be assembled in zasm as well as a hex dump perl script that I use to ensure that the disassembled source has not introduced errors into the .tap file compared to the original hex dump code.

zasm assembler is available here

ZX Spectrum NIRVANA Engine z88dk Demo running on Spectaculator Emulator on iPad Air

IMG_0009 nirvana engine test on spectaculator ipad 20140412-154820

ZX Spectrum NIRVANA Engine z88dk Demo running on Spectaculator Emulator on iPad Air

I have added an initial debug screen to my version of the z88dk NIRVANA demo

IMG_0010 nirvana test debug info spectaculator iPad

ZX Spectrum NIRVANA Engine z88dk Demo with my start screen debug info

Info on NIRVANA Engine for ZX Spectrum by Einar Saukas can be found here http://www.zxshed.co.uk/sinclairfaq/index.php5?title=NIRVANA_Engine and here http://www.worldofspectrum.org/forums/showthread.php?t=45538

To run in Spectaculator iOS App, Save snapshot from Fuse as .szx file
Copy and rename as ~/Library/Mobile Documents/F4332SF2XY~com~spectaculator~Spectaculator/Documents/Saved Games/48K BASIC.tzx/Saved 48K BASIC (1).szx

~/Library/Mobile Documents is basically a local copy of your iCloud data. See http://macdailynews.com/2012/08/06/how-to-access-your-icloud-files-from-your-macs-finder/ for more info

# :dbolli:20150630 17:31:55 Update as of OS X 10.10.x ~/Library/Mobile Documents has been re-purposed as iCloud Drive but if you click on ~/Library in the Finder and search for Spectaculator, you will find that the folder above still exists.

Following on from the z88dk Xcode Project post below, the following steps describe how to set up an Xcode External Build Project to Edit and Compile Boriel ZX Basic .bas and .asm source files (Xcode version 5.1.1 is used below but should still work with earlier versions)

1. Launch Xcode
2. File->New Project
3. Select Other->External Build System
4. Click Next

Click Next

Click Next

5. Enter Project Name e.g. zxbasic-spectrum-test
6. Enter Build tool /bin/bash
7. Click Next

8. Choose a directory to create files in and click Create

9. Copy .bas and .asm files and zxbasic-zxspectrum-my-project-name-build.sh file to project directory created by Xcode

Example zxbasic-zxspectrum-my-project-name-build.sh file can be found here

10. Add files copied above to Xcode Project via Cmd-Opt-A

Add files copied above to Xcode Project via Cmd-Opt-A

Add files copied above to Xcode Project via Cmd-Opt-A

11. Change .bas files Type in Xcode sidebar to Pascal (or any of the other source code file types) to enable syntax highlighting

Change .bas files Type in Xcode sidebar to Pascal (or any of the other source code file types) to enable syntax highlighting

Change .bas files Type in Xcode sidebar to Pascal (or any of the other source code file types) to enable syntax highlighting

12. Edit zxbasic-zxspectrum-my-project-name-build.sh file and edit Exec Name

Z80EXECNAME=my-project-name

Note: PATH declaration is included as Xcode doesn’t pick up PATH from .bash_profile, .profile etc.

PATH declaration /usr/local/bin/ is added for tapmaker (part of z88dk distribution)

13. Save zxbasic-zxspectrum-my-project-name-build.sh

14. Click on Project in Xcode and Click Target->Info
15. Enter zxbasic-zxspectrum-$(PROJECT_NAME)-build.sh as Arguments
16. Enter $(SRCROOT) as Directory

Enter $(SRCROOT) as Directory

Enter $(SRCROOT) as Directory

17. Click Product->Build to run zxbasic-zxspectrum-my-project-name-build.sh

"Click

Build to run zxbasic-zxspectrum-my-project-name-build.sh” class /> Click Product->Build to run zxbasic-zxspectrum-my-project-name-build.sh

Follow

Get every new post delivered to your Inbox.