home *** CD-ROM | disk | FTP | other *** search
- ; ***************************************
- ; *** ***
- ; *** PPPP t ***
- ; *** P P t ***
- ; *** P P eee n nn ttt eee ***
- ; *** PPPP e e nn n t e e ***
- ; *** P eeeee n n t eeeee ***
- ; *** P e n n t t e ***
- ; *** P eee n n tt eee ***
- ; *** ***
- ; *** v1.0b by Nick Blizard ***
- ; *** 11/14/97 ***
- ; *** Usgard v1.1+ ***
- ; *** ***
- ; ***************************************
- ;
- ;Here is the source to Pente v0.10b, remember to give me credit for anything you use.
- ;Any problems contact me at nblizard@bellsouth.net
- ;
- ;Goals : AI , Link Play , Clean up Code , Add more comments
-
-
- #include "usgard.h"
-
-
- CURX1 = TEXT_MEM ;cursor's x position in pixels : 1 byte
- CURY1 = TEXT_MEM+1 ;cursor's y position in pixels : 1 byte
- PTURN = TEXT_MEM+2 ;determines which player's turn it is , 0=P1 , 1=P2 : 1 byte
- BOARD = TEXT_MEM2 ;game board : 160 bytes
- CURX2 = TEXT_MEM+3 ;cursor's x position relative to board : 1 byte
- CURY2 = TEXT_MEM+4 ;cursor's y position relative to board : 1 byte
- TEMP1 = TEXT_MEM+5 ;temporary variable #1 : 1 byte
- TEMP2 = TEXT_MEM+6 ; " " #2 : 1 byte
- TEMP3 = TEXT_MEM+18 ; " " #3 : 1 byte
- PTURN2 = TEXT_MEM+7 ;player's turn in game peice fashion(see below)
- LPTURN = TEXT_MEM+8 ;last player's turn in game peice fashion , 1=P1 , 2=P2 : 1 byte
- CC = TEXT_MEM+9 ;round of check capture your on : 1 byte
- QPOS1X = TEXT_MEM+10 ;position one queud to capture X : 1 byte
- QPOS1Y = TEXT_MEM+11 ;position one queud to capture Y : 1 byte
- QPOSONE = TEXT_MEM+12 ;position one queud to capture : 1 byte
- QPOS2X = TEXT_MEM+13 ;position two queud to capture X : 1 byte
- QPOS2Y = TEXT_MEM+14 ;position two queud to capture Y : 1 byte
- QPOSTWO = TEXT_MEM+15 ;position twp queud to capture : 1 byte
- CAPPOS1 = TEXT_MEM+16 ;start position of where captured peices go for player 1 : 1 byte
- CAPPOS2 = TEXT_MEM+17 ; " " " " " " " " " 2 : 1 byte
-
-
- .org 0
- .db "v1.0b by Nick Blizard",0
-
-
- Init:
- call CLEARLCD
- ld a,4
- out (5),a
- ld a,44
- ld (CURX1),a
- ld a,26
- ld (CURY1),a
- ld a,7
- ld (CURX2),a
- ld a,4
- ld (CURY2),a
- ld a,20
- ld (CAPPOS1),a
- ld (CAPPOS2),a
- ld a,r
- and %00000001
- ld (PTURN),a
- Start:
- call CLEARLCD
- call &OpeningScreen1
- call CLEARLCD
- call &OpeningScreen2
- call CLEARLCD
- call &ClearBoardMem
- call &DrawBoard
- StartLoop1:
- call &Turn
- call &CursorMain
- jp &CheckDuplicate
- CDLoop:
- call &GamePeice
- jp &CheckCapture
- CCLoop:
- jp &CheckWin
- CWRet:
- jp &StartLoop1
-
-
- ;*** Subroutine to make board mem all zeros ***
- ClearBoardMem:
- ld a,0
- CBMLoop1:
- ld hl,BOARD
- ld c,a
- ld b,0
- add hl,bc
- ld b,h
- ld c,l
- push af
- ld a,0
- ld (bc),a
- pop af
- inc a
- ld b,160
- cp b
- ret z
- jp &CBMLoop1
-
- ;*** Subroutine to draw the playing board and the other pics on the main screen ***
- ;--- draw vertical lines ---
- DrawBoard:
- ld d,-4
- ld e,2
- ld h,-4
- ld l,56
- BoardLoop1:
- ld a,d
- add a,6
- ld d,a
- ld a,h
- add a,6
- ld h,a
- #fncall fline
- ld a,d
- ld b,a
- ld a,92
- cp b
- jp nz,&BoardLoop1
- ;--- draw horizontal lines ---
- ld d,2
- ld e,-4
- ld h,92
- ld l,-4
- BoardLoop2:
- ld a,e
- add a,6
- ld e,a
- ld a,l
- add a,6
- ld l,a
- #fncall fline
- ld a,e
- ld b,a
- ld a,56
- cp b
- jp nz,&BoardLoop2
- ;--- draw other lines ---
- ld d,95
- ld e,0
- ld h,95
- ld l,63
- #fncall fline
- ld d,96
- ld e,50
- ld h,127
- ld l,50
- #fncall fline
- ld d,97
- ld e,1
- ld h,126
- ld l,1
- #fncall fline
- ld h,97
- ld l,9
- #fncall fline
- ld d,97
- ld e,9
- ld h,126
- ld l,9
- #fncall fline
- ld d,126
- ld e,1
- ld h,126
- ld l,9
- #fncall fline
- ld d,97
- ld e,18
- ld h,107
- ld l,18
- #fncall fline
- ld d,116
- ld e,18
- ld h,126
- ld l,18
- #fncall fline
- ;--- draw other pics and words ---
- ld hl,&BoardSprite
- ld b,99
- ld c,4
- #fncall pspr_nr
- ld hl,&BoardSprite
- ld b,123
- ld c,4
- #fncall pspr_nr
- ld a,102
- ld (CURSOR_X),a
- ld a,2 ;subtract 1 from Y, don't know why
- ld (CURSOR_Y),a
- ld hl,&BoardText1
- call D_ZM_STR
- ld a,99
- ld (CURSOR_X),a
- ld a,11 ;subtract 1 from Y, don't know why
- ld (CURSOR_Y),a
- ld hl,&BoardText2
- call D_ZM_STR
- ld a,118
- ld (CURSOR_X),a
- ld a,11 ;subtract 1 from Y, don't know why
- ld (CURSOR_Y),a
- ld hl,&BoardText3
- call D_ZM_STR
- ret
-
-
- ;*** Subroutine to show who goes next ***
- Turn:
- ld a,(PTURN)
- ld b,0
- cp b
- jp z,&Turn1
- Turn2:
- ld hl,&TurnText1
- ld a,101
- ld (CURSOR_X),a
- ld a,51
- ld (CURSOR_Y),a
- call D_ZM_STR
- ld hl,&TurnText22
- ld a,99
- ld (CURSOR_X),a
- ld a,57
- ld (CURSOR_Y),a
- call D_ZM_STR
- ret
- Turn1:
- ld hl,&TurnText1
- ld a,101
- ld (CURSOR_X),a
- ld a,51
- ld (CURSOR_Y),a
- call D_ZM_STR
- ld hl,&TurnText21
- ld a,99
- ld (CURSOR_X),a
- ld a,57
- ld (CURSOR_Y),a
- call D_ZM_STR
- ret
-
-
- ;*** Subroutine to use a cursor to place a game peice ***
- ;--- place the two cursor sprites ---
- CursorMain:
- CursorLoop1:
- ld a,(CURX1)
- ld b,a
- ld a,(CURY1)
- ld c,a
- ld hl,&CursorSprite1
- call &PlaceCursor
- ld b,1
- push bc
- jp &CursorDelay
- CursorLoop2:
- ld a,(CURX1)
- ld b,a
- ld a,(CURY1)
- ld c,a
- ld hl,&CursorSprite2
- call &PlaceCursor
- ld b,0
- push bc
- jp &CursorDelay
- ;--- delay and key check for cursor ---
- CursorDelay:
- ld b, 0
- ld c, 0
- CursorDelay1:
- call GET_KEY
- cp K_LEFT
- jp z,&CursorLeft
- cp K_RIGHT
- jp z,&CursorRight
- cp K_DOWN
- jp z,&CursorDown
- cp K_UP
- jp z,&CursorUp
- cp K_SECOND
- jp z,&CursorPlacePeice
- cp K_EXIT
- jp z,&ExitProgram
- cp K_F1
- jp z,&TeacherKey
- cp K_MORE
- call z,&Controls
- cp K_CLEAR
- jp z,&Init
- ld a,255
- inc b
- cp b
- jp z,&CursorDelayLoop1
- jp &CursorDelay1
- CursorDelayLoop1:
- ld a,35
- inc c
- cp c
- jp z,&CursorDelay2
- ld b,0
- jp &CursorDelay1
- CursorDelay2:
- pop bc
- ld a,0
- cp b
- jp z,&CursorLoop1
- jp &CursorLoop2
- ;--- move cursor and check if it goes off screen or exists from an existing peice ---
- CursorLeft:
- pop bc
- ld a,(CURX1)
- ld b,2
- cp b
- jp z,&CursorEnd
- ld (TEMP1),a
- call &CursorFixBoard
- ld a,(TEMP1)
- sub 6
- ld (CURX1),a
- ld a,(CURX2)
- dec a
- ld (CURX2),a
- jp &CursorEnd
- CursorRight:
- pop bc
- ld a,(CURX1)
- ld b,92
- cp b
- jp z,&CursorEnd
- ld (TEMP1),a
- call &CursorFixBoard
- ld a,(TEMP1)
- add a,6
- ld (CURX1),a
- ld a,(CURX2)
- inc a
- ld (CURX2),a
- jp &CursorEnd
- CursorUp:
- pop bc
- ld a,(CURY1)
- ld b,2
- cp b
- jp z,&CursorEnd
- ld (TEMP1),a
- call &CursorFixBoard
- ld a,(TEMP1)
- sub 6
- ld (CURY1),a
- ld a,(CURY2)
- dec a
- ld (CURY2),a
- jp &CursorEnd
- CursorDown:
- pop bc
- ld a,(CURY1)
- ld b,56
- cp b
- jp z,&CursorEnd
- ld (TEMP1),a
- call &CursorFixBoard
- ld a,(TEMP1)
- add a,6
- ld (CURY1),a
- ld a,(CURY2)
- inc a
- ld (CURY2),a
- jp &CursorEnd
- CursorPlacePeice:
- pop bc
- ret
- ;--- fix board after cursor move ---
- CursorFixBoard:
- ld a,(CURX1)
- ld b,a
- ld a,(CURY1)
- ld c,a
- push bc
- dec b
- dec c
- ld hl,&FixSprite1
- #fncall pspr_nr
- ld a,(CURY2)
- ld b,a
- ld c,16
- call &Multiply
- ld a,(CURX2)
- add a,d
- ld c,a
- ld b,0
- ld hl,BOARD
- add hl,bc
- ld b,h
- ld c,l
- ld a,(bc)
- ld b,a
- ld a,1
- cp b
- jp z,&CursorFixPeice1
- ld a,2
- cp b
- jp z,&CursorFixPeice2
- pop bc
- ld a,2
- cp b
- call z,&CursorFixBoard1
- ld a,92
- cp b
- call z,&CursorFixBoard2
- ld a,2
- cp c
- call z,&CursorFixBoard3
- ld a,56
- cp c
- call z,&CursorFixBoard4
- ret
- CursorFixBoard1:
- push bc
- dec b
- call &RemovePixel
- pop bc
- ret
- CursorFixBoard2:
- push bc
- inc b
- call &RemovePixel
- pop bc
- ret
- CursorFixBoard3:
- push bc
- dec c
- call &RemovePixel
- pop bc
- ret
- CursorFixBoard4:
- push bc
- inc c
- call &RemovePixel
- pop bc
- ret
- CursorFixPeice1:
- pop bc
- ld hl,&GameSprite1
- call &PlacePeice
- ret
- CursorFixPeice2:
- pop bc
- ld hl,&GameSprite2
- call &PlacePeice
- ret
- CursorEnd:
- jp &CursorMain
-
-
- ;*** Subroutine to place the proper game peice and write to the correct mem location ***
- GamePeice:
- ld a,(CURX1)
- ld b,a
- ld a,(CURY1)
- ld c,a
- ld a,(PTURN)
- ld d,1
- cp d
- jp z,&GPPlayer2
- GPPlayer1:
- ld hl,&GameSprite1
- call &PlacePeice
- call &GPMemLoc
- ld a,1
- ld (bc),a
- ld a,1
- ld (PTURN),a
- ld (LPTURN),a
- ld a,2
- ld (PTURN2),a
- ret
- GPPlayer2:
- ld hl,&GameSprite2
- call &PlacePeice
- call &GPMemLoc
- ld a,2
- ld (bc),a
- ld a,0
- ld (PTURN),a
- ld a,2
- ld (LPTURN),a
- ld a,1
- ld (PTURN2),a
- ret
- GPMemLoc:
- ld a,(CURY2)
- ld b,a
- ld c,16
- call &Multiply
- ld a,(CURX2)
- add a,d
- ld c,a
- ld b,0
- ld hl,BOARD
- add hl,bc
- ld b,h
- ld c,l
- ret
-
-
- ;*** Subroutine to check and see if someone tries to place a peice on an existing peice ***
- CheckDuplicate:
- ld a,(CURY2)
- ld b,a
- ld c,16
- call &Multiply
- ld a,(CURX2)
- add a,d
- ld c,a
- ld b,0
- ld hl,BOARD
- add hl,bc
- ld b,h
- ld c,l
- ld a,(bc)
- ld b,0
- cp b
- jp z,&CDLoop
- jp &StartLoop1
-
-
- ;*** Subroutine to check if a capture has occured ***
- CheckCapture:
- ld a,1
- ld (CC),a
- CheckCLoop:
- ld a,(CURX2)
- ld (TEMP1),a
- ld a,(CURY2)
- ld (TEMP2),a
- call &CheckC1
- ld a,(PTURN2)
- cp b
- jp nz,&CheckCNext
- ld a,(TEMP1)
- ld (QPOS1X),a
- ld a,(TEMP2)
- ld (QPOS1Y),a
- ld a,e
- ld (QPOSONE),a
- call &CheckC1
- ld a,(PTURN2)
- cp b
- jp nz,&CheckCNext
- ld a,(TEMP1)
- ld (QPOS2X),a
- ld a,(TEMP2)
- ld (QPOS2Y),a
- ld a,e
- ld (QPOSTWO),a
- call &CheckC1
- ld a,(LPTURN)
- cp b
- jp nz,&CheckCNext
- call &CapturePeice
- ld a,(CAPPOS1)
- ld b,50
- cp b
- jp z,&PlayerWin
- ld a,(CAPPOS2)
- ld b,50
- cp b
- jp z,&PlayerWin
- jp &CheckCNext
- CheckC1:
- ld a,(TEMP1)
- ld b,a
- ld a,(TEMP2)
- ld c,a
- call &CheckC2
- push bc
- ld b,16
- call &Multiply
- pop bc
- ld a,c
- ld (TEMP2),a
- ld a,b
- ld (TEMP1),a
- add a,d
- ld e,a
- ld c,a
- ld b,0
- ld hl,BOARD
- add hl,bc
- ld b,h
- ld c,l
- ld a,(bc)
- ld b,a
- ret
- CheckC2:
- ld a,(CC)
- ld d,a
- ld a,1
- cp d
- call z,&CCUL
- ld a,2
- cp d
- call z,&CCU
- ld a,3
- cp d
- call z,&CCUR
- ld a,4
- cp d
- call z,&CCL
- ld a,5
- cp d
- call z,&CCR
- ld a,6
- cp d
- call z,&CCDL
- ld a,7
- cp d
- call z,&CCD
- ld a,8
- cp d
- call z,&CCDR
- ret
- CCUL:
- dec b
- dec c
- ret
- CCU:
- dec c
- ret
- CCUR:
- inc b
- dec c
- ret
- CCL:
- dec b
- ret
- CCR:
- inc b
- ret
- CCDL:
- dec b
- inc c
- ret
- CCD:
- inc c
- ret
- CCDR:
- inc b
- inc c
- ret
- CheckCNext:
- ld a,(CC)
- ld b,a
- ld a,8
- cp b
- jp z,&CCLoop
- inc b
- ld a,b
- ld (CC),a
- jp &CheckCLoop
- CapturePeice:
- ld a,(QPOS1X)
- call &CapPecLoop
- ld a,d
- ld (TEMP1),a
- ld a,(QPOS1Y)
- call &CapPecLoop
- ld c,d
- ld a,(TEMP1)
- ld b,a
- ld hl,&FixSprite2
- #fncall pspr_nr
- ld a,(QPOSONE)
- call &CapPecLoop2
- ld a,(QPOS2X)
- call &CapPecLoop
- ld a,d
- ld (TEMP1),a
- ld a,(QPOS2Y)
- call &CapPecLoop
- ld c,d
- ld a,(TEMP1)
- ld b,a
- ld hl,&FixSprite2
- #fncall pspr_nr
- ld a,(QPOSTWO)
- call &CapPecLoop2
- call &TallyPeice
- ret
- CapPecLoop:
- ld b,a
- ld c,6
- call &Multiply
- ret
- CapPecLoop2:
- ld c,a
- ld b,0
- ld hl,Board
- add hl,bc
- ld b,h
- ld c,l
- ld a,0
- ld (bc),a
- ret
- TallyPeice:
- ld a,(LPTURN)
- ld b,2
- cp b
- jp z,&TPeice2
- ld a,(CAPPOS1)
- ld c,a
- ld b,97
- ld hl,&GameSprite2
- #fncall pspr_nr
- ld a,b
- add a,6
- ld b,a
- ld hl,&GameSprite2
- #fncall pspr_nr
- ld a,(CAPPOS1)
- add a,6
- ld (CAPPOS1),a
- ret
- TPeice2:
- ld a,(CAPPOS2)
- ld c,a
- ld b,116
- ld hl,&GameSprite1
- #fncall pspr_nr
- ld a,b
- add a,6
- ld b,a
- ld hl,&GameSprite1
- #fncall pspr_nr
- ld a,(CAPPOS2)
- add a,6
- ld (CAPPOS2),a
- ret
-
-
- ;*** Subroutine to check if a win has occured ***
- CheckWin:
- ld a,1
- ld (CC),a
- ld a,0
- ld (TEMP1),a
- CWLoop1:
- ld a,(CURX2)
- ld b,a
- ld a,(CURY2)
- ld c,a
- CWLoop5:
- call &CWLoop2
- call &CWLoop3
- cp b
- jp z,&TallyMark
- ld a,(CC)
- inc a
- ld (CC),a
- call &CWLoop4
- ld a,(CC)
- ld b,9
- cp b
- jp z,&CWRet
- jp &CWLoop1
- CWLoop2:
- ld a,(CC)
- ld d,1
- cp d
- call z,&CCL
- ld d,2
- cp d
- call z,&CCR
- ld d,3
- cp d
- call z,&CCUL
- ld d,4
- cp d
- call z,&CCDR
- ld d,5
- cp d
- call z,&CCU
- ld d,6
- cp d
- call z,&CCD
- ld d,7
- cp d
- call z,&CCUR
- ld d,8
- cp d
- call z,&CCDL
- ret
- CWLoop3:
- ld a,b
- ld (TEMP2),a
- ld a,c
- ld (TEMP3),a
- push bc
- ld b,16
- call &Multiply
- pop bc
- ld a,b
- add a,d
- ld c,a
- ld b,0
- ld hl,Board
- add hl,bc
- ld b,h
- ld c,l
- ld a,(bc)
- ld b,a
- ld a,(LPTURN)
- ret
- TallyMark:
- ld a,(TEMP1)
- inc a
- ld (TEMP1),a
- ld b,4
- cp b
- jp z,&PlayerWin
- call &TMLoop
- jp &CWLoop5
- CWLoop4:
- ld b,3
- cp b
- call z,&CWL42
- ld b,5
- cp b
- call z,&CWL42
- ld b,7
- cp b
- call z,&CWL42
- ret
- CWL42:
- ld a,0
- ld (TEMP1),a
- ret
- TMLoop:
- ld a,(TEMP2)
- ld b,a
- ld a,(TEMP3)
- ld c,a
- ret
-
-
- ;*** Subroutine to display who wins and wait for keypress ***
- PlayerWin:
- ld a,3
- ld (CURSOR_ROW),a
- ld a,3
- ld (CURSOR_COL),a
- set 3,(IY+05)
- ld a,(PTURN2)
- ld b,1
- cp b
- call z,&PlWLoop2
- ld b,2
- cp b
- call z,&PlWLoop1
- call D_ZT_STR
- res 3,(IY+05)
- ld d,18
- ld e,23
- ld h,101
- ld l,23
- #fncall fline
- PlWLoop3:
- call GET_KEY
- cp K_EXIT
- jp z,&ExitProgram
- cp K_F1
- jp z,&TeacherKey
- cp K_ENTER
- jp z,&Init
- jp &PlWLoop3
- PlWLoop2:
- ld hl,&WinText2
- ret
- PlWLoop1:
- ld hl,&WinText1
- ret
-
-
- ;*** Subroutine to crash back to TI-OS (in case of teacher :) ) ***
- TeacherKey:
- ld a,3
- ld (USG_BITS),a
- ld hl,DELC_LEN
- ld (HL),0
- inc hl
- inc hl
- ld (hl),0
- set 0,(iy+3)
- jp OTH_EXIT
-
-
- ;*** Subroutine to display the opening screen 1 ***
- OpeningScreen1:
- ld hl,&TitlePic
- ld de,VIDEO_MEM
- ld bc,720
- ldir
- ld a,18
- ld (CURSOR_X),a
- ld a,47
- ld (CURSOR_Y),a
- ld hl,&OScreen1Text1
- call D_ZM_STR
- OS1Loop1:
- call GET_KEY
- cp K_F1
- jp z,&TeacherKey
- cp 0
- jp z,&OS1Loop1
- ret
-
-
- ;*** Subroutine to display the opening screen 2 ***
- OpeningScreen2:
- ld a,18
- ld (CURSOR_X),a
- ld a,11
- ld (CURSOR_Y),a
- ld hl,&OScreen2Text1
- call D_ZM_STR
- jp &OS2Loop2
- OS2Loop1:
- call GET_KEY
- cp K_F1
- jp z,&TeacherKey
- cp 0
- jp z,&OS2Loop1
- call &Controls
- ret
- OS2Loop2:
- call &OS2Loop3
- call D_ZM_STR
- ld b,39
- cp b
- jp z,&OS2Loop1
- jp &OS2Loop2
- OS2Loop3:
- ld a,18
- ld (CURSOR_X),a
- ld a,(CURSOR_Y)
- add a,7
- ld (CURSOR_Y),a
- ret
-
-
- ;*** Subroutine to show the controls ***
- Controls:
- push af
- push bc
- ld hl,VIDEO_MEM
- ld de,GRAPH_MEM
- ld bc,1024
- ldir
- call CLEARLCD
- ld a,0
- ld (CURSOR_ROW),a
- ld a,4
- ld (CURSOR_COL),a
- ld hl,&ControlsText1
- call D_ZT_STR
- ld a,0
- ld (CURSOR_X),a
- ld a,14
- ld (CURSOR_Y),a
- ld hl,&ControlsText2
- call D_ZM_STR
- jp &ConLoop2
- ConLoop1:
- call GET_KEY
- cp K_F1
- jp z,&TeacherKey
- cp 0
- jp z,&ConLoop1
- ld hl,GRAPH_MEM
- ld de,VIDEO_MEM
- ld bc,1024
- ldir
- pop af
- pop bc
- ret
- ConLoop2:
- call &ConLoop3
- call D_ZM_STR
- ld b,49
- cp b
- jp z,&ConLoop1
- jp &ConLoop2
- ConLoop3:
- ld a,0
- ld (CURSOR_X),a
- ld a,(CURSOR_Y)
- add a,7
- ld (CURSOR_Y),a
- ret
-
-
- ;*** Subroutine to exit the program ***
- ExitProgram:
- call OTH_EXIT
-
-
- ;*** Subroutine to Multiply B and C and store answer in D by: Nick Blizard (nblizard@bellsouth.net) ***
- Multiply:
- ld d,0
- ld a,b
- ld e,0
- cp e
- ret z
- ld a,c
- cp e
- ret z
- ld e,1
- cp e
- jp z,&Multiply3
- ld a,b
- cp e
- jp z,&Multiply4
- ld a,b
- Multiply2:
- add a,b
- dec c
- ld d,a
- ld a,c
- ld e,1
- cp e
- ret z
- ld a,d
- jp &Multiply2
- Multiply3:
- ld a,b
- ld d,a
- ret
- Multiply4:
- ld a,c
- ld d,a
- ret
-
-
- ;*** Subroutine to place the cursor at B,C ***
- PlaceCursor:
- dec b
- dec c
- #fncall pspr_nr
- ret
-
-
- ;*** Subroutine to place a game peice at B,C ***
- PlacePeice:
- dec b
- dec b
- dec c
- dec c
- #fncall pspr_nr
- ret
-
-
- ;*** Subroutine to put a pixel at (B,C), by: Jimmy Mardell ***
- PutPixel:
- ld a,63
- sub c
- ld c,a
- ROM_CALL(FIND_PIXEL)
- ld de,$FC00
- add hl,de
- or (hl)
- ld (hl),a
- ret
-
-
- ;*** Subroutine to remove a pixel at (B,C), by: Jimmy Mardell ***
- RemovePixel:
- ld a,63
- sub c
- ld c,a
- ROM_CALL(FIND_PIXEL)
- ld de,$FC00
- add hl,de
- cpl
- and (hl)
- ld (hl),a
- ret
-
-
- ;*** Title Picture ***
- TitlePic:
- .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$02,$E0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$05,$F8,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$0B,$FE,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$17,$FF,$80,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$17,$FF,$C0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$0B,$FF,$E0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$05,$EF,$F0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$05,$F7,$F8,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$02,$FB,$FC,$00,$00,$00,$00,$00,$02,$80,$00,$00,$00,$00
- .db $00,$00,$02,$F8,$FC,$00,$00,$00,$00,$00,$05,$80,$00,$00,$00,$00
- .db $00,$00,$05,$FA,$FE,$00,$00,$00,$00,$00,$05,$C0,$00,$00,$00,$00
- .db $00,$00,$05,$F9,$7E,$00,$00,$00,$00,$00,$03,$C0,$00,$00,$00,$00
- .db $00,$00,$05,$F8,$BF,$00,$00,$00,$00,$00,$0F,$C0,$00,$00,$00,$00
- .db $00,$00,$05,$F0,$BF,$00,$00,$00,$00,$00,$7F,$E0,$00,$00,$00,$00
- .db $00,$00,$0B,$F0,$BF,$00,$00,$00,$00,$01,$FF,$E0,$00,$00,$00,$00
- .db $00,$00,$0B,$F0,$5F,$00,$00,$00,$00,$03,$FF,$E0,$00,$00,$00,$00
- .db $00,$00,$0B,$E0,$5F,$05,$E0,$00,$00,$00,$0F,$81,$78,$00,$00,$00
- .db $00,$00,$0B,$E0,$5F,$0B,$F0,$00,$00,$00,$2F,$82,$FC,$00,$00,$00
- .db $00,$00,$0B,$E0,$5F,$17,$F0,$00,$00,$00,$5F,$85,$FC,$00,$00,$00
- .db $00,$00,$0B,$E0,$5F,$2E,$70,$17,$C0,$00,$5F,$0B,$9C,$00,$00,$00
- .db $00,$00,$17,$E0,$BE,$2E,$F0,$2F,$C0,$00,$BF,$0B,$BC,$00,$00,$00
- .db $00,$00,$17,$C1,$7E,$5F,$E0,$5F,$C0,$00,$BF,$17,$F8,$00,$00,$00
- .db $00,$00,$17,$C4,$FC,$5F,$E0,$BF,$C0,$01,$7F,$17,$F8,$00,$00,$00
- .db $00,$00,$17,$CB,$F0,$BF,$C1,$7F,$87,$82,$FE,$2F,$F0,$00,$00,$00
- .db $00,$00,$17,$C7,$E0,$BF,$82,$FF,$9F,$85,$FE,$2F,$E0,$00,$00,$00
- .db $00,$00,$17,$DF,$80,$BF,$05,$FF,$3F,$CB,$FE,$2F,$C0,$00,$00,$00
- .db $00,$00,$17,$FC,$01,$7E,$0B,$EF,$7F,$C7,$BE,$5F,$80,$00,$00,$00
- .db $00,$00,$2F,$F0,$02,$FE,$27,$DF,$FF,$E7,$3C,$BF,$80,$00,$00,$00
- .db $00,$00,$5F,$80,$02,$FF,$1F,$9F,$F7,$FF,$3C,$3F,$C6,$00,$00,$00
- .db $00,$00,$07,$80,$00,$1F,$FF,$3F,$EB,$FE,$3D,$E7,$FF,$00,$00,$00
- .db $00,$00,$17,$80,$00,$5F,$FC,$3F,$85,$F9,$7F,$E7,$FF,$00,$00,$00
- .db $00,$00,$17,$80,$00,$5F,$F0,$BF,$05,$F1,$7F,$C7,$FC,$00,$00,$00
- .db $00,$00,$17,$80,$00,$2F,$E1,$7E,$00,$01,$7F,$03,$F8,$00,$00,$00
- .db $00,$00,$17,$80,$00,$00,$01,$7C,$00,$01,$7F,$00,$00,$00,$00,$00
- .db $00,$00,$17,$C0,$00,$00,$01,$78,$00,$01,$7E,$00,$00,$00,$00,$00
- .db $00,$00,$17,$C0,$00,$00,$00,$00,$00,$00,$BC,$00,$00,$00,$00,$00
- .db $00,$00,$17,$80,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$0B,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
- .db $00,$00,$00,$00,$00,$03,$FF,$FF,$FF,$FF,$FE,$00,$00,$00,$00,$00
- .db $00,$00,$00,$00,$1F,$FC,$00,$00,$00,$00,$01,$FF,$00,$00,$00,$00
- .db $00,$00,$03,$FF,$E0,$00,$00,$00,$00,$00,$00,$00,$FE,$00,$00,$00
- .db $00,$03,$FC,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$C0,$00,$00
-
- ;*** Text for the program ***
- ;--- text for the game board ---
- BoardText1:
- .db "PENTE",0
- BoardText2:
- .db "P1",0
- BoardText3:
- .db "P2",0
-
- ;--- text for the player's turn ---
- TurnText21:
- .db "1",39,"s Turn",0
- TurnText1:
- .db "Player",0
- TurnText22:
- .db "2",39,"s Turn",0
-
- ;--- text for winning ---
- WinText1:
- .db "Player 1 Wins!",0
- WinText2:
- .db "Player 2 Wins!",0
-
- ;--- text for opening screen 1 ---
- OScreen1Text1:
- .db "The Classic Game of Skill",0
-
- ;--- text for opening screen 2 ---
- OScreen2Text1:
- .db "Pente v1.0b",0
- .db "Nick Blizard",0
- .db "NBlizard@Bellsouth.net",0
- .db "B|izzard Productions Inc.",0
- .db "(c) Nov. 14 , 1997",0
-
- ;--- text for controls screen ---
- ControlsText1:
- .db "- Controls -",0
- ControlsText2:
- .db " Arrow Keys - "
- .db "Move Cursor",0
- .db " [2nd] - "
- .db "Place Game Peice",0
- .db " [Exit] - "
- .db "Exit Game",0
- .db " [F1] - "
- .db "Teacher Key"
- .db " ( no save )",0
- .db " [More] - "
- .db "Show Controls",0
- .db " [Clear] - "
- .db "New Game",0
-
-
- ;*** Sprites for the program ***
- BoardSprite:
- .db 3,3
- .db %11000000
- .db %11000000
- .db %11000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
-
- CursorSprite1:
- .db 3,3
- .db %11100000
- .db %11100000
- .db %11100000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
-
- CursorSprite2:
- .db 3,3
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
-
- FixSprite1:
- .db 3,3
- .db %01000000
- .db %11100000
- .db %01000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
-
- FixSprite2:
- .db 5,5
- .db %00100000
- .db %00100000
- .db %11111000
- .db %00100000
- .db %00100000
- .db %00000000
- .db %00000000
- .db %00000000
-
- GameSprite1:
- .db 5,5
- .db %01110000
- .db %11111000
- .db %11111000
- .db %11111000
- .db %01110000
- .db %00000000
- .db %00000000
- .db %00000000
-
- GameSprite2:
- .db 5,5
- .db %01110000
- .db %10001000
- .db %10001000
- .db %10001000
- .db %01110000
- .db %00000000
- .db %00000000
- .db %00000000
-
-
- .end
-