Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 259
» Latest member: DonaldDeade
» Forum threads: 1,074
» Forum posts: 6,434

Full Statistics

Online Users
There are currently 182 online users.
» 0 Member(s) | 180 Guest(s)
Bing, Google

Latest Threads
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 324
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 300
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,601
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 557
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 893
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 330
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,066
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,887
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 419
ZXodus][Engine
Forum: ZX Basic Compiler
Last Post: boriel
02-19-2025, 11:43 PM
» Replies: 69
» Views: 213,811

 
  Learning ASM and ZX Basic Compiler
Posted by: oblo - 08-22-2011, 01:57 PM - Forum: Help & Support - Replies (4)

Hi all

I know it's a bit odd to ask this, because the compiler doesn't ask us to learn ASM but...
I'm starting to learn some ASM and besides read some books, I'm trying to get some examples from <!-- m --><a class="postlink" href="http://stu.pido.us/wiki/retrogames:index">http://stu.pido.us/wiki/retrogames:index</a><!-- m --> and <!-- m --><a class="postlink" href="http://members.fortunecity.com/jonathan6/egghead/id2.html">http://members.fortunecity.com/jonathan ... d/id2.html</a><!-- m -->, but every piece of code I try to compile between ASM and END ASM, end with a compiler error, for instance:

Code:
ASM
       ld a,2              ; upper screen
       call 5633           ; open channel
loop   ld de,string        ; address of string
       ld bc,eostr-string  ; length of string to print
       call 8252           ; print our string
       jp loop             ; repeat until screen is full

string defb '(your name) is cool'
eostr  equ $
END ASM

...ends with "temp.bor:11: Error: illegal preprocessor character '$'. Compilation failed" And:

Code:
ASM
; scroll izquierda
;
        ld hl, 22527
        ld c, 192
buc_2   ld b, 32
        and a
buc_1   rl (hl)
        dec hl
        djnz buc_1
        jr nc, noca_1
        ld (var), hl
        ld ix, (var)
        set o, (ix+32)
noca_1  dec c
        jr nz, buc_2
        ret
;
; scroll derecha
;
        ld hl, 16384
        ld c, 192
buc_4   ld b, 32
        and a
buc_3   rr (hl)
        inc hl
        djnz buc_3
        jr nc, noca_2
        ld (var), hl
        ld ix, (var)
        set 7, (ix-32)
noca_2  dec c
        jr nz, buc_4
        ret
var     equ 23728
END ASM

...ends with "temp.bor:3: Error: Syntax error. Unexpected token 'LD' [LD]. Compilation failed"

Is there any consideration to use ASM code in the compiler, the code examples are wrong... or have I to use another compiler, like PASMO, to compile ASM?

Thanks in advance and cheers

EDIT: I've just found this post (<!-- l --><a class="postlink-local" href="http://www.boriel.com/forum/bug-reports/illegal-preprocessor-errors-on-some-files-solved-t603.html">bug-reports/illegal-preprocessor-errors-on-some-files-solved-t603.html</a><!-- l -->) but I can't manage to solve it Sad

Print this item

  O-Cman
Posted by: oblo - 08-21-2011, 07:59 PM - Forum: Gallery - Replies (11)

Hi All

After a month of developing, I'm proud to release O-Cman, a Pacman clone for the ZX Spectrum. Their main features are:

- A nearly clone of the original arcade.
- Smooth animations
- Each ghost has its own IA
- Sounds, high score and several minor details regarding the original game.

Things that I think can improve the game (but I'm a bit 'lazy' to do them right now)

- Better IA for all the ghost
- Smooth animation for the eyes (I realize it too late)
- Different graphics for 'eatables' ghosts (I realize it too late too)

I hope you enjoy it as much I enjoyed making it. Please, feel free to send any comments, bugs, etc... I'll be grateful to see them Smile

Cheers



Attached Files
.rar   O-Cman_v1.0.rar (Size: 20.19 KB / Downloads: 275)
Print this item

  Initialising an array of addresses
Posted by: LTee - 08-10-2011, 11:25 AM - Forum: Help & Support - Replies (2)

I was trying to keep a list of memory addresses (pointing to tile data) in an array to use as a cheap lookup table. I tried to do something like this:

Code:
'data
Data:
asm
defb 0, 0, 191, 191, 191, 191, 191, 191, 0, 0, 253, 253, 253, 253, 253, 253
end asm

'array of addresses
dim tsAddress(TSMAXTILES) as uinteger => {@Data}

... which doesn't work, because @Data isn't a constant so I get an "Initializer expression is not constant" compiler error.

I could write and call a method which loads the array with the correct information on startup, but I just wanted to check that I wasn't missing an obvious trick which would allow me to avoid that? Thanks for any tips! Smile

Print this item

  Using Beepola with ZX BASIC
Posted by: LTee - 08-09-2011, 09:09 AM - Forum: How-To & Tutorials - Replies (15)

Using Beepola to add tunes to your ZX BASIC projects is actually pretty easy. Beepola is able to export its players and songs as .TAP files, which you can then merge in with your own code and call from ZX BASIC using standard RANDOMIZE USR calls.

Here's a quick how-to:

1. Make your tune. I can't help much with this bit, but I've successfully managed to integrate the Music Box, Phaser1 and Special FX engines into ZX BASIC, so I surmise they will all work. You can download Beepola from here: http://freestuff.grok.co.uk/beepola/

2. Now you need to compile your tune so that it's useful from ZX BASIC. You do this by selecting 'Compile' from Beepola's 'Tools' menu, which pops up a window with some options. The most important thing here is to make sure you set the player and song to use an area of memory which won't interfere with your own program. I tend to set this high in memory (64000 and up), but bear in mind that each player uses a different amount of memory and you'll also need to leave room for your song data. Each player has a different set of options, but basically it's all up to you here - choose whatever's best for your tune and situation.

3. The easiest way to integrate the song and player is to choose to export from Beepola as a .TAP file. I usually choose the 'code block only' option because you're not going to need the BASIC loader. Once that's saved, you need to load your game AND the player into memory at the same time. It's actually pretty easy to automate all of this using batch files (or their equivalent if you're non-Windows), because .TAP files are remarkably easy to join together. During Dex development, I created a BASIC loader which loaded my game code and the music code and saved that as a .TAP file. Then I used a batch 'make' file like this to build and assemble the game into a single .TAP.

e.g. BASIC LOADER (saved as loader.tap)

Code:
10 CLEAR 29999: LOAD "" CODE: LOAD "" CODE: RANDOMIZE USR 30000

e.g. BATCH FILE (saved as make.bat)
Code:
"\program files\zxbasic\zxb.py" dex.bas --output=dexgame.tap --org=30000 -t -Z
copy /b loader.tap + dexgame.tap + DexJingle.tap Dex.tap

The first line of the batch file compiles the game. Once done, the 'copy' command takes the loader, game code and tune and merges them all together into one large .TAP file (called Dex.tap) that I can just double-click and run. Don't forget the /b switch on the copy operation, otherwise the files will be copied as text rather than binary and probably won't work.

4. If your game is to have multiple tunes, you only need to have one copy of the player - you don't need a separate copy of the player for each tune. Each Beepola engine has a couple of POKEable memory addresses near the start of the player code which points to the tune to be played. If you make more than one tune, export those from Beepola as 'song data only' .TAP files. Make sure that you choose the same settings as for your main tune and that you place the song data at a memory location that is away from both your game code AND the first tune's code.

5. During all of these steps, remember to keep track of the memory addresses that you have compiled the music data to. This is rather important as without the addresses you won't know what to call from your game. Including the address in your filenames as a reminder might be a good idea! Smile

6. Once you have everything ready to go, all that's left to do is to call the player from within your own ZX BASIC code. This is actually very simple - just a standard RANDOMIZE USR xxxxx call (where xxxxx is the address you compiled the player to) will do the trick. However, if you're making this call from within a ZX BASIC sub or function block, be aware that you need to preserve the IX register or the Spectrum is likely to crash - more details on this below. If you wish to play one of the 'extra' tunes described in point 4, you'll first need to POKE the relevant memory addresses with the location of the new song data - Beepola's documentation will tell you how to calculate what these addresses are for each individual engine.

7. This all sounds a bit complicated, but it really isn't. It's probably easier to show in an example, so I'll show you how I created my music playing subroutine for Dex. See the code fragment below:

Code:
'some constants
const TUNESON as UBYTE = 1
const TUNEPLAYERADDR as UINTEGER = 64000
const TUNE1 as UINTEGER = 64798
const TUNE2 as UINTEGER = 64850
const TUNE3 as UINTEGER = 64900

const TUNEMAIN as UBYTE = 1
const TUNELEVELSTART as UBYTE = 2
const TUNELEVELEND as UBYTE = 3
const TUNEGAMEOVER as UBYTE = 4

'plays a piece of music
SUB playMusic(tune as UBYTE)
    DIM SongAddr as UINTEGER = 0
    
    'select the correct tune
    if tune = TUNEMAIN then
        SongAddr = TUNE3
    elseif tune = TUNELEVELSTART then
        SongAddr = TUNE1
    elseif tune = TUNELEVELEND then
        SongAddr = TUNE3
    elseif tune = TUNEGAMEOVER then
        SongAddr = TUNE2
    end if
    
    'call the music player
    if TUNESON = 1 and SongAddr > 0 then
        
        'poke the values for the tune start
        poke TUNEPLAYERADDR + 1, SongAddr - 256 * INT(SongAddr / 256)
        poke TUNEPLAYERADDR + 2, INT(SongAddr / 256)
        
        'and play the tune (remember to preserve IX register or it'll crash)
        asm
            push ix
        end asm
        randomize usr TUNEPLAYERADDR
        asm
            pop ix
        end asm
        
    end if
    
END SUB

This routine is basically all of the stuff I described above squashed into a single sub. The main music player was compiled and loaded to 64000, which I've put into a constant. The three tunes I use also have their memory locations described by constants. To play a tune, I call 'playMusic(TUNEMAIN)' (or whatever) and the SUB does all the rest.

You'll see that the address of the tune is determined by the constant I pass - this address is then POKEd into the player engine as described in Beepola's docs. Because we're calling from a SUB, the IX register needs to be preserved - this is easily done with a simple 'push ix' in an ASM block. Once we've done that, it's safe to call the player with 'RANDOMIZE USR'. Once the player returns control to us, we 'pop' the value of IX to allow us to return safely from the subroutine.

Job done!


I hope this is clear, it seems a lot more complicated to write down than it is in my head. If anyone has further questions, please feel free to ask! Smile

Print this item

  IndexError: list index out of range (*solved*)
Posted by: oblo - 08-05-2011, 10:34 PM - Forum: Bug Reports - Replies (6)

Hi all

I'm trying to compile a piece of code but I get the following output:

zxb.exe my_program.bor --org=27000 --heap-size=1024 -t -B -
Traceback (most recent call last):
File "zxb.py", line 312, in <module>
File "zxb.py", line 246, in main
File "zxbtrad.pyc", line 316, in traverse
File "zxbtrad.pyc", line 1035, in traverse
File "zxbtrad.pyc", line 316, in traverse
File "zxbtrad.pyc", line 1040, in traverse
File "zxbtrad.pyc", line 316, in traverse
File "zxbtrad.pyc", line 1035, in traverse
File "zxbtrad.pyc", line 316, in traverse
File "zxbtrad.pyc", line 1035, in traverse
File "zxbtrad.pyc", line 316, in traverse
File "zxbtrad.pyc", line 1035, in traverse
IndexError: list index out of range

What does it means? I'm using 1.2.8s715 version

Cheers

Print this item

  Unexpected end of file error
Posted by: oblo - 07-31-2011, 01:45 PM - Forum: Help & Support - Replies (7)

Hi all

Sorry to bother you twice in the same day :? I'm falling back to the safe land of BASIC but I'm still struggling with problems. I'm getting an "Unexpected end of file. Compilation failed" error. I'm searching for a lost bracket, lost END IF or similar (another post suggests that could be a lost parenthesis but I can't find any). What others symbols/codes/etc must I look for?

I'm compiling with tha last version and with the following options:
zxb.exe oc_UTF8.bor -S 27000 -t -B -a -o oc_UTF8.tap -O 0 --heap-size=1024

Thanks and regards



Attached Files
.rar   oc_UTF8.rar (Size: 3.66 KB / Downloads: 167)
Print this item

  BorIDE ASM compilation error
Posted by: oblo - 07-31-2011, 02:00 AM - Forum: ZX Basic Compiler - Replies (4)

Hi all

I'm trying to compile a piece os ASM in BorIDE. The code is:

ASM
[2746 lines of ASM]
END ASM

When I try to compile it, I always have the same error (check image) The point is that no matter if I add or remove lines from the code, the error is always the same and always in the same line (1917) Anybody know if it's a bug? Maybe there are too many lines of code?

Thanks and regards

EDIT: the error is not generated by BorIDE but the zxb.exe compiler, sorry.



Attached Files
.jpg   Clipboard01.jpg (Size: 33.45 KB / Downloads: 15485)
Print this item

  Dex
Posted by: LTee - 07-21-2011, 12:42 PM - Forum: Gallery - Replies (15)

Thought I'd post a few shots of the game that I've been working on practically forever. It's 99% done, I'd say. Just need that final push to finish the last few things off.

It's a bog-standard 1982-style 'paint the maze' game in an arcade style. Avoid the monsters or sacrifice some of your bonus to make them vanish for a few seconds. Ten different mazes (played out in a random order, in a variety of colour schemes), high score table, three difficulty levels, yada yada yada. Smile

Hope it looks interesting. Smile

[Image: ip5zeu.png] [Image: 5fetj9.png] [Image: euqyv6.png]

Edit: The game is now out! Grab it from WOS: http://www.worldofspectrum.org/infoseeki...id=0026574

Print this item

  New beta release 1.2.8s706
Posted by: boriel - 07-20-2011, 10:49 PM - Forum: Bug Reports - Replies (4)

Okay, a new beta release with an *important* fixes :!:

  • ! Some operations with arrays leaded to corruption and program crash. Fixed. (thks. to Darkstar)
  • ! Fixed a print bug discovered by Compiuter (thks). This also simplifies PRINT routines (shorted and slightly faster).
  • ! Block comments (multiline comments) might crash the compiler and were being incorrectly parsed. Fixed.
  • + Little assembler optimization under some circumstances.
You can download (as always) from <!-- m --><a class="postlink" href="http://www.boriel.com/files/zxb">http://www.boriel.com/files/zxb</a><!-- m -->

Print this item

  Chessboard Attack + Source code
Posted by: LCD - 07-17-2011, 07:48 PM - Forum: Gallery - Replies (3)

"Chessboard Attack" is finally out. You can download it from my website or WOS now.
[Image: cba_shot.png]
<!-- m --><a class="postlink" href="http://www.worldofspectrum.org/infoseekid.cgi?id=0026121">http://www.worldofspectrum.org/infoseek ... id=0026121</a><!-- m -->
If someone want to peek at the code:
(Please note, song was linked externaly, so it os not included here)

Code:
' Chessboard Attack (c) 2011 By LCD, written using BorIDE, Retro-X and ZXBC
' Based on my "Blind King" unfinished game
dim x,y,x1,y1,col,a,scan,posx,posy,xpos,ypos,white,black,px,py,orgx,orgy,won,sets as ubyte
dim counter,figures,lives,oldtime,maxtime,multiplier as integer
dim key$ as string
dim scr,adr,score,actual as uinteger

function Lset(strg$ as string,fill$ as string,length as Ubyte) as string
    while len(strg$)<length
        strg$=fill$+strg$
    wend
    return strg$
end function
FUNCTION attrAddress(x as uByte, y as uByte) as uInteger              
';; This function returns the memory address of the Character Position
';; x,y in the attribute screen memory.
';; Adapted from code by Jonathan Cauldwell - Adapted for ZX BASiC by Britlion from Na_TH_AN's fourspriter
asm
    ld      a,(IX+7)        ;ypos
    rrca
    rrca
    rrca               ;' Multiply by 32
    ld      l,a        ;' Pass to L
    and     3          ;' Mask with 00000011
    add     a,88       ;' 88 * 256 = 22528 - start of attributes.
    ld      h,a        ;' Put it in the High Byte
    ld      a,l        ;' We get y value *32
    and     224        ;' Mask with 11100000
    ld      l,a        ;' Put it in L
    ld      a,(IX+5)   ;' xpos
    add     a,l        ;' Add it to the Low byte
    ld      l,a        ;' Put it back in L, and we're done. HL=Address.
end asm
    y=y
    x=x
END FUNCTION
FUNCTION scrAddress(x as uByte, y as uByte) as Uinteger
asm
;' This fn returns the address into HL of the screen address
;' x,y in character grid notation.
;' Original code was extracted by BloodBaz - Adapted for ZX BASiC by Britlion from Na_TH_AN's fourspriter

         ; x Arrives in A, y is in stack.
         and     31
         ld      l,a
         ld      a,(IX+7) ; Y value
         ld      d,a
         and     24
         add     a,64
         ld      h,a
         ld      a,d
         and     7
         rrca
         rrca
         rrca
         or      l
         ld      l,a
              
end asm
    y=y:x=x
END FUNCTION
sub putblock(x as Ubyte,y as ubyte,wid as ubyte,hgt as ubyte,adr as Uinteger)
    dim scr,attribute as Uinteger
    dim y1 as Ubyte
    dim a as Ubyte
    poke uinteger @putblock1+7,wid
    poke uinteger @putblock2+7,wid
    for y1=0 to hgt-1
        scr=scrAddress(x,y+y1)
        for a=0 to 7
            poke uinteger @putblock1+1,adr
            poke uinteger @putblock1+4,scr
            putblock1:
            asm
                ld hl,1
                ld de,2
                ld bc,3
                ldir
            end asm
            adr=adr+wid
            scr=scr+256
        next a
    next y1
    attribute=attrAddress(x,y)
    for y1=0 to hgt-1
        poke uinteger @putblock2+1,adr
        poke uinteger @putblock2+4,attribute
        adr=adr+wid
        attribute=attribute+32
        putblock2:
        asm
            ld hl,4
            ld de,5
            ld bc,6
            ldir
        end asm
    next y1
End sub
function ScanField(x as integer,y as integer,mask as ubyte) as ubyte
    dim result as ubyte
    dim adr as uinteger
    if x>=0 and x<8 and y>=0 and y<8 then
        adr=@chessboard+(y*8)+x
        result=peek adr&mask
    end if
    return result
end function
sub SetField(x as uinteger,y as uinteger,fig as ubyte)
    dim adr as uinteger
    adr=@chessboard+(y<<3)+x
    poke adr,(peek adr)|fig
end sub
sub PutField(x as uinteger,y as uinteger,fig as ubyte) 'Not BORedwith figure
    poke @chessboard+x+(y<<3),fig
end sub

function ScanDiagonal(x as integer,y as integer) as ubyte
'This scans diagonal fields from x,y until figure or end of field for queen or bishop
    dim dist,f1,f2,f3,f4,d as Integer
    dim hidden,result as ubyte
  dist=1:f1=0:hidden=0:result=0
    while dist<8 and hidden=0
        d=ScanField(x-dist,y-dist,7)
        if d=0 then
            dist=dist+1
        elseif d=5 then
            f1=16:hidden=1
        elseif d=4 then
            f1=8:hidden=1
        else
            hidden=1
        end If
    wend
    result=result bor f1
    dist=1:f2=0:hidden=0
    while dist<8 and hidden=0
        d=ScanField(x+dist,y+dist,7)
        if d=0 then
            dist=dist+1
        elseif d=5 then
            f2=16:hidden=1
        elseif d=4 then
            f2=8:hidden=1
        else
            hidden=1
        end If
    wend
    result=result bor f2
    dist=1:f3=0:hidden=0
    while dist<8 and hidden=0
        d=ScanField(x+dist,y-dist,7)
        if d=0 then
            dist=dist+1
        elseif d=5 then
            f3=16:hidden=1
        elseif d=4 then
            f3=8:hidden=1
        else
            hidden=1
        end If
    wend
    result=result bor f3
    dist=1:f4=0:hidden=0
    while dist<8 and hidden=0
        d=ScanField(x-dist,y+dist,7)
        if d=0 then
            dist=dist+1
        elseif d=5 then
            f4=16:hidden=1
        elseif d=4 then
            f4=8:hidden=1
        else
            hidden=1
        end If
    wend
    result=result bor f4
    return result
end Function
function ScanStraight(x as integer,y as integer) as ubyte
'This scans straight fields until figure or end of field for queen or rook
  dim dist,f1,f2,f3,f4,d as integer
    dim hidden,result as ubyte
  dist=1:f1=0:hidden=0:result=0
    while dist<8 and hidden=0
        d=ScanField(x-dist,y,7)
        if d=0 then
            dist=dist+1
        elseif d=5 then
            f1=16:hidden=1
        elseif d=2 then
            f1=2:hidden=1
        else
            hidden=1
        end If
    wend
    result=result bor f1
    dist=1:f2=0:hidden=0
    while dist<8 and hidden=0
        d=ScanField(x+dist,y,7)
        if d=0 then
            dist=dist+1
        elseif d=5 then
            f2=16:hidden=1
        elseif d=2 then
            f2=2:hidden=1
        else
            hidden=1
        end If
    wend
    result=result bor f2
    dist=1:f3=0:hidden=0
    while dist<8 and hidden=0
        d=ScanField(x,y-dist,7)
        if d=0 then
            dist=dist+1
        elseif d=5 then
            f3=16:hidden=1
        elseif d=2 then
            f3=2:hidden=1
        else
            hidden=1
        end If
    wend
    result=result bor f3
    dist=1:f4=0:hidden=0
    while dist<8 and hidden=0
        d=ScanField(x,y+dist,7)
        if d=0 then
            dist=dist+1
        elseif d=5 then
            f4=16:hidden=1
        elseif d=2 then
            f4=2:hidden=1
        else
            hidden=1
        end If
    wend
    result=result bor f4
    return result
end Function
function ScanNear(x as ubyte,y as ubyte) as ubyte
'This scans next fields of x,y until figure for king or pawn
  dim result as ubyte
  if ScanField(x-1,y-1,7)=1 or ScanField(x+1,y-1,7)=1 then result=1:end if
    if ScanField(x-1,y-1,7)=6 or ScanField(x,y-1,7)=6 or ScanField(x+1,y-1,7)=6 or ScanField(x-1,y,7)=6 or ScanField(x+1,y,7)=6 or ScanField(x-1,y+1,7)=6 or ScanField(x,y+1,7)=6 or ScanField(x+1,y+1,7)=6 then result=result bor 32:end if
    return result
end Function
function ScanKnight(x as ubyte,y as ubyte) as ubyte
'This scans field x,y if attacked by knight
    dim result as ubyte
    if ScanField(x-1,y-2,7)=3 or ScanField(x+1,y-2,7)=3    or ScanField(x-1,y+2,7)=3 or ScanField(x+1,y+2,7)=3    or ScanField(x-2,y-1,7)=3 or ScanField(x+2,y-1,7)=3    or ScanField(x-2,y+1,7)=3 or ScanField(x+2,y+1,7)=3 then result=4:end if
    return result    
end Function
function ScanFields(x as ubyte,y as ubyte) as ubyte
    dim scan,fig1,fig2,fig3,fig4,fig5,fig6 as ubyte
    scan=ScanNear(x,y)
    fig1=scan band 1
    fig6=scan band 32
    scan=ScanKnight(x,y)
    fig3=scan band 4
    scan=ScanStraight(x,y)|ScanDiagonal(x,y)
    fig2=scan band 2
    fig4=scan band 8
    fig5=scan band 16

    if fig1 then print at 2,25;"\APawn";:else print at 2,25;"       ";:end If
    if fig2 then print at 3,25;"\BRook";:else print at 3,25;"       ";:end If
    if fig3 then print at 4,25;"\CKnight";:else print at 4,25;"       ";:end If
    if fig4 then print at 5,25;"\DBishop";:else print at 5,25;"       ";:end If
    if fig5 then print at 6,25;"\EQueen";:else print at 6,25;"       ";:end If
    if fig6 then print at 7,25;"\FKing";:else print at 7,25;"       ";:end If
end Function
sub ScoreBoard()
    print at 0,24;"\{p1}\{b1}\{i7}Attacked";
    print at 8,24;"\{p2}\{i7}\{b1}Pieces: ";
    print at 11,24;"\{p4}\{i7}\{b1} Lifes: ";
    print at 14,24;"\{p6}\{i0}\{b1} Time:  ";
    print at 17,24;"\{p3}\{i7}\{b1} Score: ";
end sub
sub waitnokey()
    while inkey$<>""
    wend
end sub
sub DisplaySinglePiece(x as ubyte,y as ubyte)
    dim scan,a,x1,y1,white,black as ubyte
    scan=ScanField(x,y,255)
    a=scan band 7
    x1=x*3
    y1=y*3
    white=scan band 32
    black=scan band 64
    if scan band 128 then putblock(x1,y1,3,3,@HiddenGFX)
    elseif a=1 and white then putblock(x1,y1,3,3,@PawnGFX1)
    elseif a=1 and black then putblock(x1,y1,3,3,@PawnGFX2)
    elseif a=2 and white then putblock(x1,y1,3,3,@TowerGFX1)
    elseif a=2 and black then putblock(x1,y1,3,3,@TowerGFX2)
    elseif a=3 and white then putblock(x1,y1,3,3,@KnightGFX1)
    elseif a=3 and black then putblock(x1,y1,3,3,@KnightGFX2)
    elseif a=4 and white then putblock(x1,y1,3,3,@LaeuferGFX1)
    elseif a=4 and black then putblock(x1,y1,3,3,@LaeuferGFX2)
    elseif a=5 and white then putblock(x1,y1,3,3,@QueenGFX1)
    elseif a=5 and black then putblock(x1,y1,3,3,@QueenGFX2)
    elseif a=6 and white then putblock(x1,y1,3,3,@KingGFX1)
    elseif a=6 and black then putblock(x1,y1,3,3,@KingGFX2)
    end if
end sub
sub ShowPieces()
    dim x,y as ubyte
    for y=0 to 7
        for x=0 to 7
            DisplaySinglePiece(x,y)
        next x
    next y
end sub
sub AttrSquare(x as ubyte,y as ubyte,col as ubyte)
    dim adr as uinteger
    adr=attrAddress(x*3,y*3)
    poke adr,col:poke adr+1,col:poke adr+2,col
    poke adr+32,col:poke adr+33,col:poke adr+34,col
    poke adr+64,col:poke adr+65,col:poke adr+66,col
end sub
sub StoreAttr(x as ubyte,y as ubyte)
    dim adr,adr1 as uinteger
    adr=attrAddress(x*3,y*3)
    adr1=@Attrbuffer
    poke adr1,peek adr:poke uinteger adr1+1,peek (uinteger,adr+1)
    poke adr1+3,peek (adr+32):poke uinteger adr1+4,peek (uinteger,adr+33)
    poke adr1+6,peek (adr+64):poke uinteger adr1+7,peek (uinteger,adr+65)
end sub
sub RestoreAttr(x as ubyte,y as ubyte)
    dim adr,adr1 as uinteger
    adr=@Attrbuffer
    adr1=attrAddress(x*3,y*3)
    poke adr1,peek adr:poke uinteger adr1+1,peek (uinteger,adr+1)
    poke adr1+32,peek (adr+3):poke uinteger adr1+33,peek (uinteger,adr+4)
    poke adr1+64,peek (adr+6):poke uinteger adr1+65,peek (uinteger,adr+7)
end sub

sub EmptyField(x as ubyte,y as ubyte)
    dim scan as ubyte
    dim adr as uinteger
    scan=ScanField(x,y,127)
    if scan & 32 then adr=@EmptyGFX1
    elseif scan & 64 then adr=@EmptyGFX2
    end if
    putblock(x*3,y*3,3,3,adr)
    PutField(x,y,ScanField(x,y,scan))
end sub

function Clock(tim as uinteger) as String
    dim mins,sec,secs as uinteger
    dim s$,m$,f$ as String
    secs=int(tim/50)
    if secs<16 then
        f$="\{f1}"
    Else
        f$="\{f0}"
    end if
    mins=int(secs/60)
    sec=secs mod 60
    m$=str(mins)
    if len(m$)=1 then
        m$="0"+m$
    end if
    s$=str(sec)
    if len(s$)=1 then
        s$="0"+s$
    end if
    return f$+m$+":"+s$
    'return str(int(tim/50))+" "
end function
function timer(limit as uinteger) as uinteger
    dim time1 as uinteger
    time=limit-peek(uinteger,23672)
    time1=int(time/50)
    if time1<>int(oldtime/50) then
        print ink 7;at 15,25;Clock(time)
    end if
    oldtime=time
    return time1
end Function
sub SetFigures(counter as byte,figure as ubyte)
    while counter>0
        x=int(rnd*7.9999):y=int(rnd*6.9999)
        if ScanField(x,y,7)=0 then
            SetField(x,y,figure):counter=counter-1
        end If
    end while
end sub

sets=1
' randomize usr 24576 'Init Sound (not included in this source code)
' randomize usr 33026 'Start interrupts (not included in this source code)



beginn:
' Copy reseted board to board work-buffer
for a=0 to 63
    poke @chessboard+a,peek (@chessboard1+a)
next a

'Init screen, prepare fonts and UDG
paper 0:ink 6:bright 1:flash 0:border 0:cls
Dim font (767) As uByte => { _
      0,0,  0,  0,  0,  0,  0,  0,  0, _
     16, 16, 16, 16, 16,  0, 16,  0, _
     40, 40, 40,  0,  0,  0,  0,  0, _
     40, 40,254, 40,254, 40, 40,  0, _
     16,124,144,124, 18,252, 16,  0, _
     66,164, 72, 16, 36, 74,132,  0, _
     32, 80, 32, 82,148,136,118,  0, _
     32, 64,  0,  0,  0,  0,  0,  0, _
      8, 16, 32, 32, 32, 16,  8,  0, _
     32, 16,  8,  8,  8, 16, 32,  0, _
     16, 84, 56,254, 56, 84, 16,  0, _
     16, 16, 16,254, 16, 16, 16,  0, _
      0,  0,  0,  0, 32, 32, 64,  0, _
      0,  0,  0,254,  0,  0,  0,  0, _
      0,  0,  0,  0,  0, 96, 96,  0, _
      2,  4,  8, 16, 32, 64,128,  0, _
    124,134,138,146,162,194,124,  0, _
     16, 16,112, 16, 16, 16,124,  0, _
    124,130,  2,124,128,130,254,  0, _
    124,130,  2, 60,  2,130,124,  0, _
      8, 24, 40, 72,136,254,  8,  0, _
    254,128,128,252,  2,130,124,  0, _
    124,130,128,252,130,130,124,  0, _
    254,130,  2,  4,  8, 16, 16,  0, _
    124,130,130,124,130,130,124,  0, _
    124,130,130,126,  2,130,124,  0, _
      0, 32, 32,  0,  0, 32, 32,  0, _
      0, 32, 32,  0, 32, 32, 64,  0, _
     12, 16, 32, 64, 32, 16, 12,  0, _
      0,  0,254,  0,254,  0,  0,  0, _
     96, 16,  8,  4,  8, 16, 96,  0, _
    124,130,  4,  8, 16,  0, 16,  0, _
    124,130,154,170,158,128,124,  0, _
     56, 68,130,254,130,130,130,  0, _
    252, 34, 34, 60, 34, 34,252,  0, _
     60, 66,128,128,128, 66, 60,  0, _
    248, 36, 34, 34, 34, 36,248,  0, _
    254, 34, 40, 56, 40, 34,254,  0, _
    254, 34, 40, 56, 40, 32,112,  0, _
     60, 66,128,128,142, 66, 60,  0, _
    238, 68, 68,124, 68, 68,238,  0, _
    254, 16, 16, 16, 16, 16,254,  0, _
     14,  4,  4,  4,132,132,120,  0, _
    238, 68, 72,112, 72, 68,238,  0, _
    112, 32, 32, 32, 32, 34,254,  0, _
    198,108, 84, 84, 84, 68,238,  0, _
    238, 68,100, 84, 76, 68,238,  0, _
     56, 68,130,130,130, 68, 56,  0, _
    252, 34, 34, 60, 32, 32,112,  0, _
     56, 68,130,146,138, 68, 58,  0, _
    252, 34, 34, 60, 40, 36,114,  0, _
    124,130,128,124,  2,130,124,  0, _
    254,146, 16, 16, 16, 16, 56,  0, _
    238, 68, 68, 68, 68, 68, 56,  0, _
    238, 68, 68, 68, 68, 40, 16,  0, _
    238, 68, 68, 84, 84, 84, 40,  0, _
    238, 68, 40, 16, 40, 68,238,  0, _
    238, 68, 40, 16, 16, 16, 56,  0, _
    254,132,  8, 16, 32, 66,254,  0, _
     56, 32, 32, 32, 32, 32, 56,  0, _
    128, 64, 32, 16,  8,  4,  2,  0, _
     56,  8,  8,  8,  8,  8, 56,  0, _
     16, 56, 84,146, 16, 16, 16,  0, _
      0,  0,  0,  0,  0,  0,255,  0, _
     28, 34, 32,120, 32, 34,254,  0, _
      0,112,  8,120,136,136,124,  0, _
    224, 64, 64,120, 68, 68,248,  0, _
      0, 56, 68,128,128, 68, 56,  0, _
     28,  8,  8,120,136,136,124,  0, _
      0,120,132,132,248,128,124,  0, _
     24, 32, 32,112, 32, 32,112,  0, _
      0,120,132,132,124,  4,120,  0, _
    224, 64, 64,120, 68, 68,238,  0, _
      0, 16,  0, 48, 16, 16,124,  0, _
      8,  0, 24,  8,  8, 72, 48,  0, _
    224, 72, 80, 96, 80, 72,228,  0, _
     64, 64, 64, 64, 64, 72, 48,  0, _
      0,104, 84, 84, 84, 68,238,  0, _
      0,120, 68, 68, 68, 68,238,  0, _
      0, 48, 72,132,132, 72, 48,  0, _
      0,248, 68, 68,120, 64,224,  0, _
      0,124,136,136,120,  8, 28,  0, _
      0,248, 68, 68, 64, 64,224,  0, _
      0,120,128,120,  4,132,120,  0, _
    192, 64,112, 64, 68, 68, 56,  0, _
      0,238, 68, 68, 68, 68, 56,  0, _
      0,238, 68, 68, 68, 40, 16,  0, _
      0,238, 68, 84, 84, 84, 40,  0, _
      0,204, 72, 48, 48, 72,204,  0, _
      0,238, 68, 68, 60,  4,120,  0, _
      0,252,136, 16, 32, 68,252,  0, _
     60, 32, 32,192, 32, 32, 60,  0, _
     16, 16, 16, 16, 16, 16, 16,  0, _
    240, 16, 16, 12, 16, 16,240,  0, _
    136, 84, 34,  0,  0,  0,  0, 60, _
     66,153,161,161,153, 66, 60 _
}
Poke uInteger 23606, (@font (0)) - 256 'Pointer to Font
Poke uInteger 23675,@UDGs 'Pointer to UDG

print at 0,0;"\{i7}\{p1}\{b1} Chessboard Attack 2011 by LCD ";
print at 2,1;"Software used:";
print at 3,2;"*) ZX BASIC Compiler (Boriel)";
print at 4,2;"*) Retro-X";
print at 5,2;"*) BorIDE";
print at 6,2;"*) ZX Spin Emulator";
print at 9,1;"Setup:";
print at 10,1;"[1] 2-Minutes game (profi)";
print at 11,1;"[2] 5-Minutes game (normal)";
print at 12,1;"[3] 10-Minutes game (easy)";
print at 13,1;"[D] Double chess pieces";

print at 15,1;"Use keys: Q,A,O,P,M/Space & H";
print at 16,1;"or Sinclair Joystick";
print at 18,1;"Written for Scene+ Disczine";
print at 19,1;"Code&GFX by Leszek Chmielewski"
print at 20,1;"Music by Kriss"

print at 22,1;"Press S to Start the game";
a=0
waitnokey()

'Set Maximal time until game over, in frames
maxtime=30050
multiplier=1 'Bonus Multiplicator
print at 12,2;"\{f1}3"
if sets=1 then
    print at 13,2;"\{f0}D";
Else
    print at 13,2;"\{f1}D";
end If

while a=0
    key$=inkey$
    if key$="3" then maxtime=30050:multiplier=1:print at 10,2;"\{f0}1";at 11,2;"\{f0}2";at 12,2;"\{f1}3";:end If
    if key$="2" then maxtime=15050:multiplier=2:print at 10,2;"\{f0}1";at 11,2;"\{f1}2";at 12,2;"\{f0}3";:end If
    if key$="1" then maxtime=6050:multiplier=5:print at 10,2;"\{f1}1";at 11,2;"\{f0}2";at 12,2;"\{f0}3";:end If
    if key$="s" then a=1:end if
    if key$="d" and sets=1 then
        sets=2
        print at 13,2;"\{f1}D";
        waitnokey()
    elseif key$="d" and sets=2 then
        sets=1
        print at 13,2;"\{f0}D";
        waitnokey()
    end If
wend

'Set random seed and reset timer
randomize
cls
score=0
poke Uinteger 23672,0 'Reset the Seed system variable
ScoreBoard()

'Setup pieces on field
SetFigures(8*sets,1) 'Pawn
SetFigures(2*sets,2) 'Rook
SetFigures(2*sets,3) 'Knight
SetFigures(2*sets,4) 'Bishop
SetFigures(1*sets,5) 'Queen
SetFigures(1*sets,6) 'King

'Set variables
figures=16*sets 'figures to find
lives=5 'how often you can point an unoccupied field
won=0 'Win-condition flag
ShowPieces() 'Display the pieces

posx=7:posy=7 'Position of my king piece
ScanFields(posx,posy) 'Scan which pieces are in attacking position

print at 12,26;lives;" ";
print at 9,25;figures;" ";
print at 18,25;"\{p0}\{i2}\{b1}000000";
Mainloop:
x1=posx*3+1:y1=posy*3+1
gosub DisplayMyKing
KeyLoop:
'Check controls keys and move my king around

key$=inkey$
if (key$="o" or key$="6") and posx>0 then EmptyField(posx,posy):posx=posx-1:goto move:end if
if (key$="p" or key$="7") and posx<7 then EmptyField(posx,posy):posx=posx+1:goto move:end if
if (key$="q" or key$="9") and posy>0 then EmptyField(posx,posy):posy=posy-1:goto move:end if
if (key$="a" or key$="8") and posy<7 then EmptyField(posx,posy):posy=posy+1:goto move:end if
'Check for fire key
if key$=" " or key$="m" or key$="0" then waitnokey():gosub search:waitnokey():end if
if key$="h" then gosub hold:end if
'If moved into the field occupied by another chess piece, it is game over. All lifes are lost and display where the figures are
if ScanField(posx,posy,7) or lives=0 then
    goto PlayerLoss
end if
if won then
    goto PlayerWins
end If
gosub Checktime
goto KeyLoop
End

move:
ScanFields(posx,posy):gosub DisplayMyKing:waitnokey():goto Mainloop
move1:
StoreAttr(px,py):AttrSquare(px,py,24):waitnokey():return

search:
'Cursor movement
px=posx
py=posy
orgx=px
orgy=py
StoreAttr(px,py)
AttrSquare(px,py,24)
do
    key$=inkey$
    if (key$="o" or key$="6") and px>0 then RestoreAttr(px,py):px=px-1:gosub move1:end If
    if (key$="p" or key$="7") and px<7 then RestoreAttr(px,py):px=px+1:gosub move1:end If
    if (key$="q" or key$="9") and py>0 then RestoreAttr(px,py):py=py-1:gosub move1:end If
    if (key$="a" or key$="8") and py<7 then RestoreAttr(px,py):py=py+1:gosub move1:end If
    if key$="h" then gosub hold:end if
    gosub Checktime
loop until key$=" " or key$="m" or key$="0"
RestoreAttr(px,py)
scan=ScanField(px,py,255)
if (px=orgx and py=orgy) or (scan band 128)=0 then
    goto searchEnd
end if
if (scan band 15)=0 then
    EmptyField(px,py)
    lives=lives-1
    print at 12,26;lives;" ";
else
    PutField(px,py,scan band 127)
    DisplaySinglePiece(px,py)
    for a=0 to 15 'Flashing square
        AttrSquare(px,py,23)
        pause 2
        AttrSquare(px,py,55)
        pause 2
    next a
    PutField(px,py,scan band 96)
    EmptyField(px,py)
    ScanFields(orgx,orgy)
    figures=figures-1
    if figures=0 then won=1:end if
    print at 9,25;figures;" ";
    restzeit=int((maxtime-peek(uinteger,23672))/500)
    score=score+(sets*multiplier*restzeit)
    print at 18,25;"\{p0}\{i2}\{b1}"+Lset(str(score),"0",6);
end if
searchEnd:
key$=""
return

DisplayMyKing:
scan=ScanField(posx,posy,255)
white=scan&32
black=scan&64
if white then adr=@OKingGFX1
elseif black then adr=@OKingGFX2
end if
putblock(posx*3,posy*3,3,3,adr)
return

PlayerWins:
cls
score=score+1000
print at 10,7;"\{f1}Yess! Yes! Yeeees!!!";
print at 12,1;"\{f1}Congratulations, you did it!!!";
print at 14,1;"\{f1}Score: ";score;" Points";
while inkey$<>" ":wend
waitnokey()
goto beginn
PlayerLoss:
adr=@chessboard
for a=0 to 63
poke adr+a,peek(adr+a) band 127
next a
ShowPieces()
print at 10,9;"\{f1}Oh noooooo!!!";
print at 12,1;"\{f1}Sorry, but it is not your day!";
print at 14,1;"\{f1}Score: ";score;" Points";
while inkey$<>" ":wend
waitnokey()
goto beginn
Checktime:
    if timer(maxtime)=0 then
        goto PlayerLoss
    end if
    return

hold:
    actual=peek(uinteger,23672)
    waitnokey()
    print ink 7;flash 1;at 15,25;"Pause"
    while inkey$="":wend
    poke uinteger 23672,actual
    return
    

chessboard:
asm
    defb 0,0,0,0,0,0,0,0
    defb 0,0,0,0,0,0,0,0
    defb 0,0,0,0,0,0,0,0
    defb 0,0,0,0,0,0,0,0
    defb 0,0,0,0,0,0,0,0
    defb 0,0,0,0,0,0,0,0
    defb 0,0,0,0,0,0,0,0
    defb 0,0,0,0,0,0,0,0
end asm
chessboard1:
asm
    defb 160,192,160,192,160,192,160,192
    defb 192,160,192,160,192,160,192,160
    defb 160,192,160,192,160,192,160,192
    defb 192,160,192,160,192,160,192,160
    defb 160,192,160,192,160,192,160,192
    defb 192,160,192,160,192,160,192,160
    defb 160,192,160,192,160,192,160,192
    defb 192,160,192,160,192,160,192,32
end asm

overlay:
'0=Leer
'1=Bauer (1)
'2=Turm (2)
'3=Springer (4)
'4=Läufer (8)
'5=Königin (16)
'6=König (32)

'+128=hidden
'+64=White field
'+32=Black field
asm
    defb 111,079,111,079,111,079,111,079
    defb 079,111,079,111,079,111,079,111
    defb 111,079,111,079,111,079,111,079
    defb 079,111,079,111,079,111,079,111
    defb 111,079,111,079,111,079,111,079
    defb 079,111,079,111,079,111,079,111
    defb 111,079,111,079,111,079,111,079
    defb 079,111,079,111,079,111,079,111
end asm
' Graphics:
UDGs:
asm
    DEFB    000,000,016,056,056,016,124,000
    DEFB    000,084,124,056,056,124,124,000
    DEFB    000,016,056,120,024,056,124,000
    DEFB    000,016,048,108,124,056,124,000
    DEFB    000,084,040,016,108,124,124,000
    DEFB    000,016,056,016,056,068,124,000
end asm
Attrbuffer:
asm
    defb 0,0,0,0,0,0,0,0,0
end asm

PawnGFX1:
asm
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,060,000,000,126,000,000
    DEFB    255,000,000,255,000,000,255,000
    DEFB    000,255,000,000,126,000,001,255
    DEFB    128,000,126,000,000,060,000,000
    DEFB    060,000,000,060,000,000,126,000
    DEFB    000,126,000,000,126,000,000,255
    DEFB    000,003,129,192,007,255,224,007
    DEFB    255,224,003,255,192,000,000,000
    DEFB    111,111,111,111,111,111,111,111
    DEFB    111
end asm
PawnGFX2:
asm
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,060,000,000,126,000,000
    DEFB    255,000,000,255,000,000,255,000
    DEFB    000,255,000,000,126,000,001,255
    DEFB    128,000,126,000,000,060,000,000
    DEFB    060,000,000,060,000,000,126,000
    DEFB    000,126,000,000,126,000,000,255
    DEFB    000,003,129,192,007,255,224,007
    DEFB    255,224,003,255,192,000,000,000
    DEFB    079,079,079,079,079,079,079,079
    DEFB    079
end asm

TowerGFX1:
asm
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,015,060,240,015,060,240,015
    DEFB    060,240,015,255,240,015,255,240
    DEFB    007,255,224,002,000,064,003,255
    DEFB    192,003,255,192,003,255,192,003
    DEFB    255,192,003,255,192,003,255,192
    DEFB    003,255,192,003,255,192,007,255
    DEFB    224,014,000,112,031,255,248,031
    DEFB    255,248,015,255,240,000,000,000
    DEFB    111,111,111,111,111,111,111,111
    DEFB    111
end asm
TowerGFX2:
asm
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,015,060,240,015,060,240,015
    DEFB    060,240,015,255,240,015,255,240
    DEFB    007,255,224,002,000,064,003,255
    DEFB    192,003,255,192,003,255,192,003
    DEFB    255,192,003,255,192,003,255,192
    DEFB    003,255,192,003,255,192,007,255
    DEFB    224,014,000,112,031,255,248,031
    DEFB    255,248,015,255,240,000,000,000
    DEFB    079,079,079,079,079,079,079,079
    DEFB    079
end asm

KnightGFX1:
asm
    DEFB    000,000,000,000,003,128,000,031
    DEFB    128,000,127,000,001,191,000,007
    DEFB    255,128,031,255,128,031,255,128
    DEFB    007,255,192,015,191,192,000,127
    DEFB    192,000,255,224,001,255,224,003
    DEFB    255,224,007,255,224,007,255,224
    DEFB    003,255,192,000,255,000,001,255
    DEFB    128,003,000,192,015,255,240,015
    DEFB    255,240,007,255,224,000,000,000
    DEFB    111,111,111,111,111,111,111,111
    DEFB    111
end asm
KnightGFX2:
asm
    DEFB    000,000,000,000,003,128,000,031
    DEFB    128,000,127,000,001,191,000,007
    DEFB    255,128,031,255,128,031,255,128
    DEFB    007,255,192,015,191,192,000,127
    DEFB    192,000,255,224,001,255,224,003
    DEFB    255,224,007,255,224,007,255,224
    DEFB    003,255,192,000,255,000,001,255
    DEFB    128,003,000,192,015,255,240,015
    DEFB    255,240,007,255,224,000,000,000
    DEFB    079,079,079,079,079,079,079,079
    DEFB    079
end asm

LaeuferGFX1:
asm
    DEFB    000,000,000,000,024,000,000,060
    DEFB    000,000,060,000,000,038,000,000
    DEFB    159,000,001,207,128,003,231,192
    DEFB    003,247,192,007,255,224,007,255
    DEFB    224,007,255,224,007,255,224,003
    DEFB    255,192,001,255,128,000,255,000
    DEFB    000,255,000,001,255,128,003,255
    DEFB    192,007,000,224,015,255,240,015
    DEFB    255,240,007,255,224,000,000,000
    DEFB    111,111,111,111,111,111,111,111
    DEFB    111
end asm
LaeuferGFX2:
asm
    DEFB    000,000,000,000,024,000,000,060
    DEFB    000,000,060,000,000,038,000,000
    DEFB    159,000,001,207,128,003,231,192
    DEFB    003,247,192,007,255,224,007,255
    DEFB    224,007,255,224,007,255,224,003
    DEFB    255,192,001,255,128,000,255,000
    DEFB    000,255,000,001,255,128,003,255
    DEFB    192,007,000,224,015,255,240,015
    DEFB    255,240,007,255,224,000,000,000
    DEFB    079,079,079,079,079,079,079,079
    DEFB    079
end asm

QueenGFX1:
asm
    DEFB    000,000,000,000,024,000,000,060
    DEFB    000,000,060,000,000,102,000,001
    DEFB    255,128,071,126,226,094,060,122
    DEFB    076,153,050,097,195,134,063,255
    DEFB    252,031,255,248,015,255,240,007
    DEFB    255,224,003,255,192,002,000,064
    DEFB    015,255,240,011,102,208,031,255
    DEFB    248,024,000,024,063,255,252,063
    DEFB    255,252,031,255,248,000,000,000
    DEFB    111,111,111,111,111,111,111,111
    DEFB    111
end asm
QueenGFX2:
asm
    DEFB    000,000,000,000,024,000,000,060
    DEFB    000,000,060,000,000,102,000,001
    DEFB    255,128,071,126,226,094,060,122
    DEFB    076,153,050,097,195,134,063,255
    DEFB    252,031,255,248,015,255,240,007
    DEFB    255,224,003,255,192,002,000,064
    DEFB    015,255,240,011,102,208,031,255
    DEFB    248,024,000,024,063,255,252,063
    DEFB    255,252,031,255,248,000,000,000
    DEFB    079,079,079,079,079,079,079,079
    DEFB    079
end asm

KingGFX1:
asm
    DEFB    000,000,000,000,126,000,000,102
    DEFB    000,000,090,000,030,090,120,051
    DEFB    102,204,097,255,134,076,102,050
    DEFB    095,102,250,095,060,250,079,153
    DEFB    242,103,219,230,055,219,236,019
    DEFB    219,200,027,219,216,008,000,016
    DEFB    015,255,240,011,102,208,031,255
    DEFB    248,024,000,024,063,255,252,063
    DEFB    255,252,031,255,248,000,000,000
    DEFB    111,111,111,111,111,111,111,111
    DEFB    111
end asm
KingGFX2:
asm
    DEFB    000,000,000,000,126,000,000,102
    DEFB    000,000,090,000,030,090,120,051
    DEFB    102,204,097,255,134,076,102,050
    DEFB    095,102,250,095,060,250,079,153
    DEFB    242,103,219,230,055,219,236,019
    DEFB    219,200,027,219,216,008,000,016
    DEFB    015,255,240,011,102,208,031,255
    DEFB    248,024,000,024,063,255,252,063
    DEFB    255,252,031,255,248,000,000,000
    DEFB    079,079,079,079,079,079,079,079
    DEFB    079
end asm

OKingGFX1:
asm
    DEFB    000,000,000,000,126,000,000,102
    DEFB    000,000,090,000,030,090,120,051
    DEFB    102,204,097,255,134,076,102,050
    DEFB    095,102,250,095,060,250,079,153
    DEFB    242,103,219,230,055,219,236,019
    DEFB    219,200,027,219,216,008,000,016
    DEFB    015,255,240,011,102,208,031,255
    DEFB    248,024,000,024,063,255,252,063
    DEFB    255,252,031,255,248,000,000,000
    DEFB    110,106,104,110,106,104,110,106
    DEFB    104
end asm
OKingGFX2:
asm
    DEFB    000,000,000,000,126,000,000,102
    DEFB    000,000,090,000,030,090,120,051
    DEFB    102,204,097,255,134,076,102,050
    DEFB    095,102,250,095,060,250,079,153
    DEFB    242,103,219,230,055,219,236,019
    DEFB    219,200,027,219,216,008,000,016
    DEFB    015,255,240,011,102,208,031,255
    DEFB    248,024,000,024,063,255,252,063
    DEFB    255,252,031,255,248,000,000,000
    DEFB    078,074,072,078,074,072,078,074
    DEFB    072
end asm

EmptyGFX1:
asm
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    104,104,104,104,104,104,104,104
    DEFB    104
end asm
EmptyGFX2:
asm
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    000,000,000,000,000,000,000,000
    DEFB    072,072,072,072,072,072,072,072
    DEFB    072
end asm

HiddenGFX:
asm
    DEFB    255,255,254,213,085,084,170,190
    DEFB    170,213,097,084,170,128,170,213
    DEFB    028,084,171,042,106,214,086,084
    DEFB    170,108,106,213,216,212,170,177
    DEFB    170,213,099,084,170,198,170,213
    DEFB    077,084,170,250,170,213,085,084
    DEFB    170,186,170,213,069,084,170,198
    DEFB    170,213,069,084,170,186,170,213
    DEFB    085,084,170,170,170,000,000,000
    DEFB    087,087,087,087,087,087,087,087
    DEFB    087
end asm

Print this item