;; Emacs Mode Selection Info: -*-mode: ASM; coding: iso-latin-1-dos;-*- * ;; ******************************************************************************************** ;; File Name: DisDataP3.inc ;; Auther: John L. Weinrich ;; Date: 04/17/03 ;; Useage 4004 TIC-TAC-TOE Game ;; Description: ;; ;; This is an include file that contains the display data routine. ;; ;; ;; See "4004 FPGA Design" and "4004 Software Design " documents for more detail information. ;; ;; Registers used: ARRAY_PTR_P, UTILITY_1_P, SCRATCH_1_L, SCRATCH_1_H, SCRATCH_1_P ;; Memory used: None. ;; Entrance parameters: None. ;; Exit parameters: Accumulator, success, failure ;; Labels used: Continue1, LowerEOS1, NotEOS1, NoRollover1, EndOfString1, DisString1, ;; Continue2, LowerEOS2, NotEOS2, NoRollover2, EndOfString2, DisString2, D_ModeP1, ;; D_ModeP2, D_ModeP3, D_BIT, D_KeyPress, NoRollover2, EndOfString2, D_Player_Name, ;; D_Player12, D_Player_Enter, D_Player22, D_Welcome1, D_Welcome2, D_PageError, ;; DisPageError, DisPlayer1, DisPlayer12, DisPlayer3, DisPlayer22, DisWelcome1, ;; DisWelcome2, DisModePrompt1, DisModePrompt2, DisModePrompt3, DisKeyPress, ;; D_Player_Name, D_Player12, D_Player_Enter, D_Player22, D_Welcome1, D_Welcome2, ;; D_PageError ;; Routines used: DisSetLineCol, DisplayModeCMND, DisplayModeData, WaitForDisplay ;; ******************************************************************************************** ;; ******************************************************************************************** ;; This subroutine displays canned strings ;; DisSkillPrompt1 jms DisSetLine1 ; Set display to line 1 & column 1 fim ARRAY_PTR_P,lo(D_SkillPrompt1) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisSkillPrompt2 jms DisSetLine2 ; Set display to line 2 & column 1 fim ARRAY_PTR_P,lo(D_SkillPrompt2) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisSkillPrompt3 jms DisSetLine3 ; Set display to line 3 & column 1 fim ARRAY_PTR_P,lo(D_SkillPrompt3) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisPageError fim UTILITY_1_P,L1C1 ; Set the display to line 1 & column 1 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_PageError) ; Get pinter to the string to be displayed jun DisString2 ; Go to routine to display the string DisPlayer1 jms DisSetLine1 ; Set display to line 1 & column 1 fim ARRAY_PTR_P,lo(D_Player_Name) ; Get pinter to the string to be displayed jun DisString2 ; Go to routine to display the string DisPlayer12 jms DisSetLine2 ; Set display to line 2 & column 1 fim ARRAY_PTR_P,lo(D_Player12) ; Get pinter to the string to be displayed jun DisString2 ; Go to routine to display the string DisPlayer3 jms DisSetLine4 ; Set display to line 4 & column 1 fim ARRAY_PTR_P,lo(D_Player_Enter) ; Get pinter to the string to be displayed jun DisString2 ; Go to routine to display the string DisPlayer22 jms DisSetLine2 ; Set display to line 2 & column 1 fim ARRAY_PTR_P,lo(D_Player22) ; Get pinter to the string to be displayed jun DisString2 ; Go to routine to display the string DisWelcome1 jms DisSetLine1 ; Set display to line 1 & column 1 fim ARRAY_PTR_P,lo(D_Welcome1) ; Get pinter to the string to be displayed jun DisString2 ; Go to routine to display the string DisWelcome2 jms DisSetLine2 ; Set display to line 2 & column 1 fim ARRAY_PTR_P,lo(D_Welcome2) ; Get pinter to the string to be displayed jun DisString2 ; Go to routine to display the string DisModePrompt1 jms DisSetLine1 ; Set display to line 1 & column 1 fim ARRAY_PTR_P,lo(D_ModeP1) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisModePrompt2 jms DisSetLine2 ; Set display to line 2 & column 1 fim ARRAY_PTR_P,lo(D_ModeP2) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisModePrompt3 jms DisSetLine3 ; Set display to line 3 & column 1 fim ARRAY_PTR_P,lo(D_ModeP3) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string DisKeyPress fim UTILITY_1_P,L4C10 ; Set the display to line 4 & column 11 jms DisSetLineCol ; Call the routine to set the display cursor fim ARRAY_PTR_P,lo(D_KeyPress) ; Get pinter to the string to be displayed jun DisString1 ; Go to routine to display the string org DISDATA_LOCATION + 0100H ; Start the routine & data on a page boundary DisString2 jms DisplayModeCMND jms WaitForDisplay ; Wait for display jms DisplayModeData ; Set display to data mode Continue2 fin SCRATCH_1_P ; Get a byte of the string xch SCRATCH_1_L ; Get the lower nibble into accumulator jcn Z,LowerEOS2 ; Check if lower nibble is zero jun NotEOS2 ; Lower nibble not zero, then display it LowerEOS2 xch SCRATCH_1_H ; Lower nibble is zero, now check upper nibble jcn Z,EndOfString2 ; Upper nibble zero, go to return NotEOS2 fin SCRATCH_1_P ; Upper nibble not zero, get byte again xch SCRATCH_1_H ; Get the upper nibble into accumulator fim SRC_P,DISPLAY_HIGH_PORT ; Get address to display upper nibble port src SRC_P ; Send out display upper nibble address wrr ; Write the display upper nibble to display xch SCRATCH_1_L ; Get the lower nibble into accumulator fim SRC_P,DISPLAY_LOW_PORT ; Get address to display lower nibble port src SRC_P ; Send out display lower nibble address wrr ; Write the display lower nibble to display isz ARRAY_PTR_L,NoRollover2 ; Increment string pointer & check for roll over inc ARRAY_PTR_H ; String pointer rolled over, increment upper nibble NoRollover2 jun Continue2 ; Continue to out more bytes to display EndOfString2 bbl REPORT_SUCCESS ; All done, go back D_Player_Name data "Enter name for",0 ; Display Player #1 message1 D_Player12 data "player #1: ",0 ; Display Player #1 message2 D_Player_Enter data "'ENTER'=done, '<='BS",0 ; Display Player #1 message3 D_Player22 data "player #2: ",0 ; Display Player #2 message2 D_Welcome1 data "Welcome to --",0 ; Display Welcome message1 D_Welcome2 data " 'TIC-TAC-TOE 4004'",0 ; Display Welcome message1 D_PageError data "PAGE ERROR!!!",0 ; Display page error org DISDATA_LOCATION + 0200H ; Start the routine & data on a page boundary DisString1 jms DisplayModeCMND jms WaitForDisplay ; Wait for display jms DisplayModeData ; Set display to data mode Continue1 fin SCRATCH_1_P ; Get a byte of the string xch SCRATCH_1_L ; Get the lower nibble into accumulator jcn Z,LowerEOS1 ; Check if lower nibble is zero jun NotEOS1 ; Lower nibble not zero, then display it LowerEOS1 xch SCRATCH_1_H ; Lower nibble is zero, now check upper nibble jcn Z,EndOfString1 ; Upper nibble zero, go to return NotEOS1 fin SCRATCH_1_P ; Upper nibble not zero, get byte again xch SCRATCH_1_H ; Get the upper nibble into accumulator fim SRC_P,DISPLAY_HIGH_PORT ; Get address to display upper nibble port src SRC_P ; Send out display upper nibble address wrr ; Write the display upper nibble to display xch SCRATCH_1_L ; Get the lower nibble into accumulator fim SRC_P,DISPLAY_LOW_PORT ; Get address to display lower nibble port src SRC_P ; Send out display lower nibble address wrr ; Write the display lower nibble to display isz ARRAY_PTR_L,NoRollover1 ; Increment string pointer & check for roll over inc ARRAY_PTR_H ; String pointer rolled over, increment upper nibble NoRollover1 jun Continue1 ; Continue to out more bytes to display EndOfString1 bbl REPORT_SUCCESS ; All done, go back D_ModeP1 data "Select Game Mode:",0 ; Display Game mode prompt1 D_ModeP2 data "(1) 4004 vs Player",0 ; Display Game mode prompt2 D_ModeP3 data "(2) Player vs Player",0 ; Display Game mode prompt2 D_BIT data "BUILTIN TEST RESULTS",0 ; Display BIT Test title D_KeyPress data "",0 ; Display keypress to continue D_SkillPrompt1 data "Enter 1-4 to set",0 ; Display skill level prompt 1 D_SkillPrompt2 data "skill level",0 ; Display skill level prompt 2 D_SkillPrompt3 data "1=easy, 4=difficult",0 ; Display skill level prompt 3