; zxGammon: backgammon for the 48K ZX Spectrum. ; Copyright (C) 2026 Paul Hankin. Free software under the GNU General ; Public License, version 3 or later; see COPYING. ; ; Assemble with sjasmplus (https://github.com/z00m128/sjasmplus): ; ; sjasmplus zxgammon.asm ; ; which writes zxgammon.sna (a snapshot) and zxgammon.tap (a tape, with a ; BASIC loader). Every other file here is included from game.asm, or ; below: the loading screen (loading.scr), and the cube's table for ; matches (mettab.bin) with Gnubby's pictures (mascot) after it; and, from ; data.asm, the neural nets' weights. device zxspectrum48 include "game.asm" PROGLEN equ ENGINEEND-$5e00 org $4000 incbin "loading.scr" org METTAB MTAB: incbin "mettab.bin" incbin "mascot" ; Gnubby, after the table: MASC MTLEN equ $-MTAB savesna "zxgammon.sna",$5e00 ; The tape: a BASIC loader (BORDER 0: PAPER 0: INK 0: CLEAR 24063: ; LOAD "" SCREEN$: POKE 23739,111: LOAD "" CODE: LOAD "" CODE: ; RANDOMIZE USR 24064), the loading screen, the program and the table. ; The loader is put in memory only now, after the snapshot is saved. org $fd00 LOADER: db $00,$0a,$5c,$00,$e7,$30,$0e,$00,$00,$00,$00,$00,$3a,$da,$30,$0e db $00,$00,$00,$00,$00,$3a,$d9,$30,$0e,$00,$00,$00,$00,$00,$3a,$fd db $32,$34,$30,$36,$33,$0e,$00,$00,$ff,$5d,$00,$3a,$ef,$22,$22,$aa db $3a,$f4,$32,$33,$37,$33,$39,$0e,$00,$00,$bb,$5c,$00,$2c,$31,$31 db $31,$0e,$00,$00,$6f,$00,$00,$3a,$ef,$22,$22,$af,$3a,$ef,$22,$22 db $af,$3a,$f9,$c0,$32,$34,$30,$36,$34,$0e,$00,$00,$00,$5e,$00,$0d LOADLEN equ $-LOADER emptytap "zxgammon.tap" savetap "zxgammon.tap",basic,"zxGammon",LOADER,LOADLEN,10 savetap "zxgammon.tap",code,"zxGammon",$4000,6912 savetap "zxgammon.tap",code,"zxGammon",$5e00,PROGLEN savetap "zxgammon.tap",code,"zxGammon",METTAB,MTLEN