.db 0 option1string: ;Difficulty Levels .text "Beginner" .text "Amateur" option2string: ;Players .text "1 Pl." .text "2 Pl." .text "2 CPU" option3string: ;CPU color .text "Black" .text "White" option4string: ;CPU thinking .text "Defensive" .text "Neutral" .text "Offensive" option5string: ;Chess Set .text "Figurine" .text "Alphabet" .text "Staunton" option6string: ;Illegal Move Detection .text "On" .text "Off" options: ;Da Options .text " Difficulty" .text " Players" .text " CPU Color" .text " CPU Priority" .text " Chess Set" .text " Show Thinking" .text " Let's Play!" .text " New Game" optionstring: .text "Options" OptionScreen: call _runindicoff call closegrey OptionScreen2: call ClearScreen ld hl, optionstring ld de, $0000 call drawstring ld hl, $fc80 ld b, 16 ld a, 255 drawhlineloop: ld (hl), a inc hl djnz drawhlineloop ld hl, option1string-1 ld de, $0a40 ld a, (difficulty) call drawseries ld d, $10 ld a, (players) ld hl, option2string-1 call drawseries ld d, $16 ld a, (cpucolor) ld hl, option3string-1 call drawseries ld d, $1c ld a, (cpupriority) ld hl, option4string-1 call drawseries ld d, $22 ld a, (graphics) ld hl, option5string-1 call drawseries ld d, $28 ld a, (showthinking) ld hl, option6string-1 call drawseries menuloop: ld c, 1 ld hl, options ld de, $0a04 ld b, 8 menudrawloop call drawmenuopt ld a, d add a, 6 ld d, a djnz menudrawloop call getkey ld a, (keyvar) ld b, 8 ld hl, selector cp 1 call z, changeme cp 4 call z, keymenudown cp 6 jr nz, menuloop ld a, (selector) ld hl, difficulty ld b, 2 cp 1 call z, changeme inc b inc hl cp 2 call z, changeme inc hl dec b cp 3 call z, changeme inc hl inc b cp 4 call z, changeme inc hl cp 5 call z, changeme inc hl dec b cp 6 call z, changeme cp 8 jr z, newgameload cp 7 jp nz, OptionScreen2 gobackfromoptions: call loadgreyscale ret newgameload: ld hl, newgame ld de, Board ld bc, 64 ldir ld hl, 0 ld (whitescore), hl ld (curturn), hl ld (moves), hl jr gobackfromoptions changeme: ld a, (hl) cp b jr z, make1 inc (hl) xor a ret make1: ld a, 1 ld (hl), a xor a ret keymenudown: ld a, (hl) cp 1 ret z dec (hl) xor a ret drawmenuopt: ld a, (selector) cp c jr z, thisisselection inc c jp drawstring thisisselection: set textInverse, (iy+textflags) call drawstring res textInverse, (iy+textflags) inc c ret selector: .db 1 drawseries: ld b, a ditemloop2 push bc ld b, 1 xor a cpir pop bc djnz ditemloop2 jp drawstring .end