Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; Name: PONG.ASM ;
- ; Use: DTI's version of the PONG game ;
- ;---------------------------------------------------;
- ; Copyright: (C)2012 DTI ;
- ; Dysfunctional Technologies, Inc. ;
- ; All Rights Reserved ;
- ;---------------------------------------------------;
- ; Author: Timothy S. Carlson ;
- ; Dysfunctional Technologies, Inc. ;
- ; Date: December 30, 2012 ;
- ; Version: V4.04 ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; WEBSITE: www.dysfunctionaltechnologies.com ;
- ; EMAIL: tscarlson@gmail.com ;
- ; ;
- ; You are welcome to use this code as you see fit, ;
- ; however - not to be used in for-profit products ;
- ; unless we have come to a monetary agreement. ;
- ; ;
- ; If this code is used, credit given is appreciated ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; VERSION LOG: ;
- ; V3.00: Modified characters, character placement, ;
- ; and field to look more like the real PONG ;
- ; V3.01: Renamed to PIC-PONG ;
- ; - Added 64x224 mode for copyright message ;
- ; - Added piezo speaker for sounds ;
- ; - Added ball 'slow-down' method ;
- ; - Added special dot as court divider ;
- ; V3.02: Fixed my program memory page issues. ;
- ; - Revamped _Draw_Scores. Cleaner, faster. ;
- ; - Redid title - "PONG FOR THE 12F1840" ;
- ; - Added _DEBUG_ turns on/off GP2 VSYNC Pulse;
- ; - Moved some procs to high page: ;
- ; - _Draw_Title ;
- ; - _Clear_Court ;
- ; - _Copyright ;
- ; - _Initialize_System ;
- ; - More comments ;
- ; - Modified comments discussing the number of;
- ; lines, what they do, and how long (in ms) ;
- ; for a complete video frame. ;
- ; 260 lines * 64us each = 16.64ms per frame ;
- ; The current timing is ~16.645ms per frame ;
- ; - General Cleanup ;
- ; - Added the software version number at the ;
- ; bottom right of the screen, in the copy- ;
- ; right strip. ;
- ; V3.03: Updated version number display to V3.03 ;
- ; - Adding more comments ;
- ; - Changed references to 'Half_Line' and ;
- ; 'Full_Line' in some proc titles to ;
- ; '30us_Line' and '60us_Line' respectively. ;
- ; (_Blank_Half_Line => _Blank_30us_Line) ;
- ; - Moved some line generation procs to high ;
- ; page, added PAGESELs, adjusted timings. ;
- ; - _Blank_60us_Line ;
- ; - _Blank_30us_Line ;
- ; - _Special_30us_Line ;
- ; - _Inverted_30us_Line ;
- ; - Everything possible has been moved to the ;
- ; high page of memory, with the exceptions: ;
- ; - _Update_Paddle_1 ;
- ; - _Update_Paddle_2 ;
- ; - _Update_Ball ;
- ; I am only using 655 words in the low page ;
- ; of program memory now (H'000'-H'28E') out ;
- ; of 4096 bytes (2048 words). The high page ;
- ; is packed - H'800'-H'D92'. I left the ;
- ; above procs in the low page as I will be ;
- ; making modifications / enhancements to ;
- ; these routines in the near future. ;
- ; - NOTE: If you see what appears to be stray ;
- ; NOPs strewn about in the code - DON'T ;
- ; REMOVE THEM. They are there for video ;
- ; timings purposes. Remove them and DOOM! ;
- ; V3.04: Updated version number display to V3.04 ;
- ; - Changed the use of Timer0 (8bit) from ;
- ; loading zero and waiting for count to ;
- ; loading (inverse) count and waiting for ;
- ; overflow flag (TMR0IF) in INTCON. ;
- ; - Created _Clear_Items and _Draw_Items. ;
- ; _Clear_Items clears ball, paddles, scores ;
- ; _Draw_Items draws ball, paddles, scores ;
- ; - Removed _Update_Scores, since one half ;
- ; went into _Clear_Items and the other half ;
- ; went into _Draw_Items. There was nothing ;
- ; left, except for 60us line generation, ;
- ; after that. ;
- ; V3.05: Updated verion number display to V3.05 ;
- ; - Changed field size from 32x56 to 32x48 ;
- ; - Changed VIDEO_BUFFER start from H'2010' to;
- ; H'2020' to recover 16 bytes of data memory;
- ; that are now available due to small field ;
- ; - Added dynamic creation of blank lines ;
- ; depending on screen size. This will keep ;
- ; the screen centered (vertically) in the ;
- ; viewable area of the video frame and keep ;
- ; the video frame at 60hz ;
- ; - Added court sidelines so that the limits ;
- ; of the court can be easily determined no ;
- ; matter the size of the field. ;
- ; - Added 'SERVICE' markers (arrows next to ;
- ; the scores) to easily determine who's turn;
- ; it is to serve. Last one scored serves. ;
- ; - Reduced size of title screen and changed ;
- ; title back to just 'PONG'. Title screen ;
- ; was too large and the time to draw (or ;
- ; clear) was blowing WAY past the 60us limit;
- ; - Changed wall collision detection so that ;
- ; Ball_Dir_Y can be something other that 1 ;
- ; or -1. This opens the door to implementing;
- ; 'english' on the ball ;
- ; - Service is now done from the paddle, not ;
- ; center court. And the beginning Ball_Y ;
- ; position is centered with the paddle ;
- ; - Ball angle on service (Ball_Dir_Y at 1 or ;
- ; for the left paddle, -1 or -2 for the ;
- ; right paddle) depends on paddle position ;
- ; - The starting position of the scores has ;
- ; been dropped one line to keep the score ;
- ; display from bumping against the court ;
- ; side line. ;
- ; - With a field of 32x48, PONG has been ;
- ; testing on a Sony PS1 LCD monitor, a small;
- ; PHILIPS LCD TV, and a regular CRT TV which;
- ; all work well. However, a 32" Chinese made;
- ; LCD TV does not work - maybe because it ;
- ; wants 50hz? Any feedback on various TVs ;
- ; used with PONG would be appreciated. ;
- ; - Added a check to see if the left or right ;
- ; button is being held - this keeps from ;
- ; holding the button down and continuously ;
- ; serving the ball. ;
- ; - Even MORE comments added. I sure hope I ;
- ; remove all of the old (irrelevent) ones. ;
- ; - Back to the large graphics to the title. ;
- ; I split it into two 60us lines. Also did ;
- ; a lot of tricks to reduce the instruction ;
- ; count. _Clear_Screen replaces _Clear_Items;
- ; and will clear the screen OR display the ;
- ; title at the appropriate time. ;
- ; - EVERYTHING uses TIMER0 now, except for ;
- ; generating a positive 2us sync pulse. Not ;
- ; enough cycles to incorporate the timer. ;
- ; - All loose code and commented out lines ;
- ; removed. All timings at spec. RELEASE! ;
- ; V3.06: Updated verion number display to V3.06 ;
- ; - Corrected a few bugs in ball/paddle ;
- ; collision detection. ;
- ; - Corrected a bug in _Clear_Screen ;
- ; - Moved all 30us stuff to a procedure called;
- ; _Vertical_Sync. ;
- ; - Split the code as evenly as I could ;
- ; between the low page and high page of ;
- ; program memory. Lots of room for editing ;
- ; now without worrying about bumping the ;
- ; ceilings. There's around 900 program words;
- ; free in each page. ;
- ; - I don't think there are any major bugs - ;
- ; just enhancements waiting in the wings. ;
- ; Time to final release and move on! ;
- ; V3.07: Updated version number display to V3.07 ;
- ; - Added a blank line and then two white ;
- ; lines just after the copyright lines. Just;
- ; because I like it better. ;
- ; - Fixed the 'shoot off in a horitontal angle;
- ; when hitting the upper sideline wall' bug.;
- ; If you saw the V3.06 demo video, it was ;
- ; occurring frequently and the OCD in me ;
- ; said "You gotta fix that". ;
- ; That's it for this version - RELEASE! ;
- ; V4.00: Updated version number display to V4.00 ;
- ; - Converting timings of video signal to ;
- ; TIMER0 Interrupt Service Routine. ;
- ; - Added a 'shake loose' of the PICKIT if ;
- ; attached. Without the 'shake loose', the ;
- ; PICKIT hold GPIO1 low, which is the RBUTT.;
- ; V4.01: Updated version number display to V4.01 ;
- ; - Added COMPUTER mode for player 2. Hold ;
- ; down the LEFT button when powering up. A ;
- ; large 'C' should display in the upper ;
- ; right corner. PLAYER 2 is now controlled ;
- ; by the computer. ;
- ; V4.02: Updated version number display to V4.02 ;
- ; V4.03: Updated version number display to V4.03 ;
- ; V4.04: Updated version number display to V4.04 ;
- ; - Split off the NTSC video generation into ;
- ; it's own module ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; Project Defines ;
- ;---------------------------------------------------;
- #DEFINE _PONG.ASM_ ;
- #DEFINE _MAIN_MODULE_ ;
- ;---------------------------------------------------;
- #DEFINE _USE_THUMBSTICKS_ TRUE ;
- #DEFINE _DISABLE_GAME_PROCESSING_ FALSE ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; Includes ;
- ;---------------------------------------------------;
- ; This file has some common defines (TRUE, FALSE, ;
- ; etc.) used throughout the program. It also has the;
- ; CONFIGURATION_BITS settings for the PIC, which are;
- ; only processed in the module that has the define ;
- ; _MAIN_MODULE_. ;
- ;---------------------------------------------------;
- #INCLUDE Common.INC ;
- #INCLUDE NTSC_Interface.INC ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; Macros ;
- ;---------------------------------------------------;
- DELAY MACRO DTIME ;
- ;-----------------------------------------------;
- ; The time munger used EVERYWHERE ;
- ;-----------------------------------------------;
- MOVLW DTIME ;
- MOVWF DTemp ;
- DECFSZ DTemp, F ;
- GOTO $-1 ;
- ;-----------------------------------------------;
- ENDM ;
- ;
- ;---------------------------------------------------;
- ; Defines ;
- ;---------------------------------------------------;
- ; You have to chose between using all buttons, ;
- ; or using a thumbstick with a button. I might ;
- ; be able to figure out a way to automatically ;
- ; determine which is connected, but for now you ;
- ; will just have to decide which you want, set ;
- ; _USE_THUMBSTICKS_ to either TRUE or FALSE, and;
- ; re-compile the project. ;
- ;-----------------------------------------------;
- #IF _USE_THUMBSTICKS_ ;
- #DEFINE RJOY H'01' ; Right THUMBSTICK
- #DEFINE RJOY_BIT 0 ; GPIO 0 - PIN 7
- #DEFINE RBUTT H'02' ; Right BUTTON when set to INPUT
- #DEFINE RBUTT_BIT 1 ; GPIO 1 - PIN 6
- #DEFINE LJOY H'04' ; Left THUMBSTICK
- #DEFINE LJOY_BIT 2 ; GPIO 2 - PIN 5
- #DEFINE LBUTT H'08' ; Left BUTTON
- #DEFINE LBUTT_BIT 3 ; GPIO 3 - PIN 4
- #ELSE ;!_USE_THUMBSTICKS_ ;
- #DEFINE RBUTT_1 H'01' ; Right BUTTON 1
- #DEFINE RBUTT_1_BIT 0 ; GPIO 0 - PIN 7
- #DEFINE RBUTT_2 H'02' ; Right BUTTON 2
- #DEFINE RBUTT_2_BIT 1 ; GPIO 1 - PIN 6
- #DEFINE LBUTT_2 H'04' ; Left BUTTON 2
- #DEFINE LBUTT_2_BIT 2 ; GPIO 2 - PIN 5
- #DEFINE LBUTT_1 H'08' ; Left BUTTON 1
- #DEFINE LBUTT_1_BIT 3 ; GPIO 3 - PIN 4
- #ENDIF ;_USE_THUMBSTICKS_ ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; This is my method of making the game easier or;
- ; harder - either I update and draw the ball ;
- ; every frame (fast ball), or every other frame ;
- ; (not as fast), or every 3rd frame (normal ;
- ; ball) or higher for slower. Set MAX_BALL_WAIT ;
- ; to the desired speed (1=fast, 2=not as fast, ;
- ; 3=normal, 4=slower, etc.). This is hardcoded ;
- ; right now, a change requires a recompile. I ;
- ; have plans to allocate another precious byte ;
- ; of data memory so that the ball speed can be ;
- ; changed by a menu item. ;
- ;-----------------------------------------------;
- #DEFINE DRAW_BALL_BIT 0 ;
- #DEFINE MAX_BALL_WAIT 3 ;
- ;
- ;-----------------------------------------------;
- ; Just a bunch of hardcoded starting points, ;
- ; sizes, and bit-munching stuff for the various ;
- ; graphics. ;
- ;-----------------------------------------------;
- ; I use the PIC's LINEAR MEMORY scheme to create;
- ; a contiguous video buffer. Grab the MicroChip ;
- ; documentation and read up. Then go search on ;
- ; the web for some docs that will really explain;
- ; it for you. ;
- ;-----------------------------------------------;
- #DEFINE FIELD_HEIGHT NUM_LINES ;
- #DEFINE FIELD_WIDTH 32 ;
- #DEFINE LEFT_SCORE_START H'01' ;
- #DEFINE RIGHT_SCORE_START H'02' ;
- #DEFINE LEFT_PADDLE_START H'00' ;
- #DEFINE LEFT_PADDLE_BIT H'40' ;
- #DEFINE LEFT_PADDLE_MASK H'BF' ;
- #DEFINE RIGHT_PADDLE_START H'03' ;
- #DEFINE RIGHT_PADDLE_BIT H'02' ;
- #DEFINE RIGHT_PADDLE_MASK H'FD' ;
- #DEFINE PADDLE_HEIGHT 9 ;
- #DEFINE BALL_HEIGHT 3 ;
- #DEFINE SERVICE_1_START H'00' ;
- #DEFINE SERVICE_2_START H'03' ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- USER_DATA_1 UDATA H'020' ;
- ;---------------------------------------------------;
- Temp1 res 1 ; 20
- Temp2 res 1 ; 21
- Ball_X res 1 ; 22
- Ball_Y res 1 ; 23
- Ball_Dir_X res 1 ; 24
- Ball_Dir_Y res 1 ; 25
- Paddle_1_Y res 1 ; 26
- Paddle_1_Dir_Y res 1 ; 27
- Paddle_2_Y res 1 ; 28
- Paddle_2_Dir_Y res 1 ; 29
- Score_1 res 1 ; 2A
- Score_2 res 1 ; 2B
- Ball_Wait res 1 ; 2C
- ;---------------------------------------------------;
- ; Bit definitions for System_Status ;
- ;---------------------------------------------------;
- #DEFINE P1_SERVICE H'01' ;
- #DEFINE P1_SERVICE_BIT 0 ;
- #DEFINE P1_PRESSED H'02' ;
- #DEFINE P1_PRESSED_BIT 1 ;
- #DEFINE P2_SERVICE H'04' ;
- #DEFINE P2_SERVICE_BIT 2 ;
- #DEFINE P2_PRESSED H'08' ;
- #DEFINE P2_PRESSED_BIT 3 ;
- #DEFINE P2_COMPUTER H'10' ;
- #DEFINE P2_COMPUTER_BIT 4 ;
- #DEFINE BANNER_SELECT H'20' ;
- #DEFINE BANNER_SELECT_BIT 5 ;
- ;---------------------------------------------------;
- System_Status res 1 ; 2D
- ;---------------------------------------------------;
- ; Banner display definitions and variables ;
- ;---------------------------------------------------;
- #DEFINE MAX_TBANNERS 5 ;
- #DEFINE MAX_BBANNERS 9 ;
- TB_Count res 1 ; 2E
- BB_Count res 1 ; 2F
- DTemp res 1 ; 30
- Line_Count res 1 ; 31
- Repeat_Count res 1 ; 32
- ;---------------------------------------------------;
- ; I've pushed the VIDEO_BUFFER to H'2030', since the;
- ; field has become smaller (32x48 vs 32x56). The ;
- ; required size of the VIDEO_BUFFER is also less, so;
- ; this will give up 32 more bytes of data memory for;
- ; use in game programming. ;
- ;---------------------------------------------------;
- ; We don't access the Video_BufferX arrays directly,;
- ; we use LINEAR PAGE memory through the FSR register;
- ; LINEAR PAGE memory groups the data memory at 0x20,;
- ; 0xA0, and Ox120 into a contiguous linear page. ;
- ; Note that the shared memory (at the top 16 bytes ;
- ; of each page) is NOT included in the LINEAR PAGE ;
- ; memory mapping. ;
- ;---------------------------------------------------;
- ; MEMORY MAP - LINEAR PAGE MEMORY - 240 bytes total ;
- ; 0x2000-0x204F - 0x020-0x06F 80 bytes ;
- ; 0x2050-0x20BF - 0x0A0-0x0EF 80 bytes ;
- ; 0x20A0-0x20EF - 0x120-0x16F 80 bytes ;
- ;---------------------------------------------------;
- ; Since out max lines (now) is 48, we need 48x8 ;
- ; (192) bytes of memory for the screen buffer. This ;
- ; leaves us with 48 bytes of data memory for program;
- ; variables, plus the 16 in shared memory for 64! ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; Reset Vector Code - Entry point from reset ;
- ;---------------------------------------------------;
- RESET_VECT CODE H'000' ;
- ;---------------------------------------------------;
- ; Initialize the hardware and memory elements. ;
- ; This is a FAR CALL to a proc in the high ;
- ; page of Program Memory, so it needs the ;
- ; PAGESEL before and after the CALL to properly ;
- ; set the upper 2 bits in the program counter. ;
- ; I am slowly converting ALL CALLs (and some ;
- ; GOTOs) to having PAGESEL before and after, but;
- ; the added instruction cycles mess up the video;
- ; timings in some spots. To be done slowly and ;
- ; surely. ;
- ;-----------------------------------------------;
- PAGESEL _Initialize_System ;
- GOTO _Initialize_System ;
- NOP ;
- NOP ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; User Code in the low page of Program Memory ;
- ; More user code (USER_CODE_2) can be found in the ;
- ; high page of Program Memory, starting at H'800' ;
- ;---------------------------------------------------;
- USER_CODE_1 CODE H'00A' ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Initialize_System: ;
- ;---;-----------------------------------------------;
- ; Initialize Hardware ;
- ;-----------------------------------------------;
- ; - Oscillator ;
- ;-----------------------------------------------;
- _IS_Init_Oscillator: ;
- BANKSEL OSCCON ;
- MOVLW B'11110000' ; 32Mhz
- MOVWF OSCCON ;
- ;
- BANKSEL OSCSTAT ; Wait for
- _IS_IO_Wait: ;
- MOVFW OSCSTAT ; high speed
- ANDLW H'79' ; oscillator
- XORLW H'59' ; to be
- BTFSS STATUS, Z ; stable and
- GOTO _IS_IO_Wait ; locked
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; - GPIOs ;
- ;-----------------------------------------------;
- _IS_Init_GPIOs: ;
- BANKSEL ANSELA ;
- CLRF ANSELA ; ALL I/O as digital
- #IF _USE_THUMBSTICKS_ ;
- BSF ANSELA, LJOY_BIT ;
- BSF ANSELA, RJOY_BIT ;
- #ENDIF ;_USE_THUMBSTICKS_ ;
- ;
- BANKSEL LATA ;
- CLRF LATA ;
- ;
- BANKSEL TRISA ;
- CLRF TRISA ;
- #IF _USE_THUMBSTICKS_ ;
- BSF TRISA, LJOY_BIT ; Set as INPUT
- BSF TRISA, LBUTT_BIT ; Set as INPUT
- BSF TRISA, RJOY_BIT ; Set as INPUT
- BSF TRISA, RBUTT_BIT ; Set as INPUT
- #ELSE ;!_USE_THUMBSTICKS_ ;
- BSF TRISA, LBUTT_1_BIT ; Set as INPUT
- BSF TRISA, LBUTT_2_BIT ; Set as INPUT
- BSF TRISA, RBUTT_1_BIT ; Set as INPUT
- BSF TRISA, RBUTT_2_BIT ; Set as INPUT
- #ENDIF ;_USE_THUMBSTICKS_ ;
- ;
- BANKSEL PORTA ;
- CLRF PORTA ;
- #IF _USE_THUMBSTICKS_ ;
- BSF PORTA, LJOY_BIT ; Set HIGH
- BSF PORTA, LBUTT_BIT ; Set HIGH
- BSF PORTA, RJOY_BIT ; Set HIGH
- BSF PORTA, RBUTT_BIT ; Set HIGH
- #ELSE ;!_USE_THUMBSTICKS_ ;
- BSF PORTA, LBUTT_1_BIT ; Set HIGH
- BSF PORTA, LBUTT_2_BIT ; Set HIGH
- BSF PORTA, RBUTT_1_BIT ; Set HIGH
- BSF PORTA, RBUTT_2_BIT ; Set HIGH
- #ENDIF ;_USE_THUMBSTICKS_ ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; - Miscellaneous ;
- ;-----------------------------------------------;
- _IS_Init_Misc: ;
- BANKSEL INTCON ;
- CLRF INTCON ;
- ;
- BANKSEL OPTION_REG ;
- CLRF OPTION_REG ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; - Memory ;
- ;-----------------------------------------------;
- _IS_Init_Memory: ;
- BANKSEL MEMORY ;
- CLRF System_Status ;
- BSF System_Status, P1_SERVICE_BIT ;
- BSF System_Status, P2_SERVICE_BIT ;
- MOVLW MAX_BALL_WAIT ;
- MOVWF Ball_Wait ;
- MOVLW 0 ;
- MOVWF Score_1 ;
- MOVLW 0 ;
- MOVWF Score_2 ;
- MOVLW 20 ;
- MOVWF Paddle_1_Y ;
- MOVLW 0 ;
- MOVWF Paddle_1_Dir_Y ;
- MOVLW 20 ;
- MOVWF Paddle_2_Y ;
- MOVLW 0 ;
- MOVWF Paddle_2_Dir_Y ;
- MOVLW 15 ;
- MOVWF Ball_X ;
- MOVLW 27 ;
- MOVWF Ball_Y ;
- MOVLW 0 ;
- MOVWF Ball_Dir_X ;
- MOVLW 0 ;
- MOVWF Ball_Dir_Y ;
- CLRF TB_Count ;
- CLRF BB_Count ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; - Other Subsystems ;
- ;-----------------------------------------------;
- PAGESEL _NTSC_Initialize_Subsystem ;
- CALL _NTSC_Initialize_Subsystem ;
- PAGESEL $ ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; This will 'shake loose' the PICKIT, if ;
- ; attached. By 'shake loose', I mean to get the ;
- ; the PICKIT3 to release control of the GPIO1 ;
- ; line and let it go HIGH. Otherwise, the GPIO1 ;
- ; line is held LOW and the system thinks player ;
- ; 2 is pressing the button, starting a game. ;
- ;-----------------------------------------------;
- _IS_Shake_Loose_PICKIT: ;
- BANKSEL TRISA ;
- BCF TRISA, RBUTT_BIT ;
- BANKSEL PORTA ;
- BSF PORTA, RBUTT_BIT ;
- _IS_SLP_Wait_For_Button: ;
- DELAY 255 ;
- BANKSEL TRISA ;
- BSF TRISA, RBUTT_BIT ;
- BANKSEL PORTA ;
- BTFSS PORTA, RBUTT_BIT ;
- GOTO _IS_SLP_Wait_For_Button ;
- BANKSEL TRISA ;
- BCF TRISA, RBUTT_BIT ;
- BANKSEL PORTA ;
- BSF PORTA, RBUTT_BIT ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; This will see if BUTTON 1 (left player) is ;
- ; being pressed at power up. If so, PLAYER 2 ;
- ; will be flagged as a COMPUTER PLAYER. ;
- ;-----------------------------------------------;
- _IS_Check_For_Computer_Option: ;
- BTFSC PORTA, LBUTT_BIT ;
- GOTO _IS_Exit ;
- BSF System_Status, P2_COMPUTER_BIT ;
- BSF System_Status, P1_PRESSED_BIT ;
- ;-----------------------------------------------;
- ;
- _IS_Exit: ;
- PAGESEL _NTSC_Video ;
- GOTO _NTSC_Video ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_10: ;
- ;---------------------------------------------------;
- ; This is a 2 60us line procedure, so comsume an ;
- ; additional line without generating a blank line ;
- ;---------------------------------------------------;
- PAGESEL _Clear_Screen ;
- CALL _Clear_Screen ;
- PAGESEL $ ;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_11: ;
- ;---------------------------------------------------;
- RETURN ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_12: ;
- ;---------------------------------------------------;
- ; This is a 2 60us line procedure, so comsume an ;
- ; additional line without generating a blank line ;
- ;---------------------------------------------------;
- PAGESEL _Update_Paddles ;
- CALL _Update_Paddles ;
- PAGESEL $ ;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_13: ;
- ;---------------------------------------------------;
- RETURN ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_14: ;
- ;---------------------------------------------------;
- PAGESEL _Update_Ball ;
- CALL _Update_Ball ;
- PAGESEL $ ;
- RETURN ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_15: ;
- ;---------------------------------------------------;
- ; This is a 3 60us line procedure, so comsume two ;
- ; additional lines without generating a blank line ;
- ;---------------------------------------------------;
- PAGESEL _Draw_Items ;
- CALL _Draw_Items ;
- PAGESEL $ ;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_16: ;
- _NTSC_Blank_Line_17: ;
- ;---------------------------------------------------;
- RETURN ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; This is for displaying the banners at the top and ;
- ; bottom of the playing field. ;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_34: ;
- ;---------------------------------------------------;
- PAGESEL _Banners ;
- BCF System_Status, BANNER_SELECT_BIT ;
- CALL _Banners ;
- PAGESEL $ ;
- RETURN ;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_241: ;
- ;---------------------------------------------------;
- PAGESEL _Banners ;
- BSF System_Status, BANNER_SELECT_BIT ;
- CALL _Banners ;
- PAGESEL $ ;
- RETURN ;
- ;---------------------------------------------------;
- ; Eight white lines, 2 each above and below each ;
- ; banner. ;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_31: ;
- _NTSC_Blank_Line_32: ;
- _NTSC_Blank_Line_42: ;
- _NTSC_Blank_Line_43: ;
- _NTSC_Blank_Line_238: ;
- _NTSC_Blank_Line_239: ;
- _NTSC_Blank_Line_249: ;
- _NTSC_Blank_Line_250: ;
- PAGESEL _WHITE_4us_SYNC_60us_LINE ;
- CALL _WHITE_4us_SYNC_60us_LINE ;
- PAGESEL $ ;
- RETURN ;
- ;---------------------------------------------------;
- ; Six black lines, 1 each above and below each ;
- ; banner as a spacer been the banners and the white ;
- ; lines. Also 1 black line AFTER the entire top ;
- ; banner and BEFORE the entire bottom banner as ;
- ; spacers between the banners and the game field ;
- ; Also note that the black line AFTER each banner ;
- ; (and before the white lines) consumes all of the ;
- ; CALLS/RETURNS to consumed lines. This keeps the ;
- ; video timing correct. ;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_33: ;
- _NTSC_Blank_Line_35: ;
- _NTSC_Blank_Line_44: ;
- _NTSC_Blank_Line_237: ;
- _NTSC_Blank_Line_240: ;
- _NTSC_Blank_Line_242: ;
- PAGESEL _BLACK_4us_SYNC_60us_LINE ;
- CALL _BLACK_4us_SYNC_60us_LINE ;
- PAGESEL $ ;
- RETURN ;
- ;---------------------------------------------------;
- ; These lines are 'consumed' elsewhere in the code. ;
- ; No need for scan line generation, just return ;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_36: ;
- _NTSC_Blank_Line_37: ;
- _NTSC_Blank_Line_38: ;
- _NTSC_Blank_Line_39: ;
- _NTSC_Blank_Line_40: ;
- _NTSC_Blank_Line_41: ;
- _NTSC_Blank_Line_243: ;
- _NTSC_Blank_Line_244: ;
- _NTSC_Blank_Line_245: ;
- _NTSC_Blank_Line_246: ;
- _NTSC_Blank_Line_247: ;
- _NTSC_Blank_Line_248: ;
- ;---------------------------------------------------;
- RETURN ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; Unused scan lines - they just do a blank line ;
- ;---------------------------------------------------;
- _NTSC_Blank_Line_18: ;
- _NTSC_Blank_Line_19: ;
- _NTSC_Blank_Line_20: ;
- _NTSC_Blank_Line_21: ;
- _NTSC_Blank_Line_22: ;
- _NTSC_Blank_Line_23: ;
- _NTSC_Blank_Line_24: ;
- _NTSC_Blank_Line_25: ;
- _NTSC_Blank_Line_26: ;
- _NTSC_Blank_Line_27: ;
- _NTSC_Blank_Line_28: ;
- _NTSC_Blank_Line_29: ;
- _NTSC_Blank_Line_30: ;
- _NTSC_Blank_Line_251: ;
- _NTSC_Blank_Line_252: ;
- _NTSC_Blank_Line_253: ;
- _NTSC_Blank_Line_254: ;
- _NTSC_Blank_Line_255: ;
- _NTSC_Blank_Line_256: ;
- _NTSC_Blank_Line_257: ;
- _NTSC_Blank_Line_258: ;
- _NTSC_Blank_Line_259: ;
- _NTSC_Blank_Line_260: ;
- _NTSC_Blank_Line_261: ;
- _NTSC_Blank_Line_262: ;
- ;---------------------------------------------------;
- PAGESEL _BLACK_4us_SYNC_60us_LINE ;
- CALL _BLACK_4us_SYNC_60us_LINE ;
- PAGESEL $ ;
- RETURN ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Update_Paddles: ;
- ;---------------------------------------------------;
- ; 60us BLACK line ;
- ;-----------------------------------------------;
- PAGESEL _BLACK_4us_SYNC_60us_LINE ;
- CALL _BLACK_4us_SYNC_60us_LINE ;
- PAGESEL $ ;
- ;-----------------------------------------------;
- #IF (_DISABLE_GAME_PROCESSING_ == TRUE) ;
- GOTO _UP1_Exit ;
- #ENDIF ;
- ;
- #IF _USE_THUMBSTICKS_ ;
- _UP1_Update: ;
- ;-----------------------------------------------;
- ; ADC Magic (Channel 0) ;
- ;-----------------------------------------------;
- BANKSEL ADCON1 ;
- MOVLW H'60' ; Left Justified
- MOVWF ADCON1 ; FOSC/64, VREF
- MOVLW B'00001011' ; AN2, ADC GO, ADC On
- MOVWF ADCON0 ;
- BTFSC ADCON0, GO ; Wait for conversion
- GOTO $-1 ;
- MOVFW ADRESH ; Get result
- BANKSEL MEMORY ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; The following code uses the joystick in a ;
- ; normal fashion - paddle position follows the ;
- ; joystick position. ;
- ;-----------------------------------------------;
- MOVWF Temp1 ;
- XORWF Paddle_1_Y, W ;
- BTFSS STATUS, Z ;
- GOTO $+3 ;
- CLRF Paddle_1_Dir_Y ;
- GOTO _UP1_U_Process_JS ;
- MOVFW Temp1 ;
- SUBWF Paddle_1_Y, W ;
- MOVLW 1 ;
- BTFSC STATUS, C ;
- MOVLW -1 ;
- MOVWF Paddle_1_Dir_Y ;
- ;-----------------------------------------------;
- _UP1_U_Process_JS: ;
- ;-----------------------------------------------;
- MOVFW Temp1 ;
- MOVWF Paddle_1_Y ;
- RRF Paddle_1_Y, F ;
- RRF Paddle_1_Y, F ;
- MOVLW H'3F' ;
- ANDWF Paddle_1_Y, F ;
- MOVLW 23 ;
- SUBWF Paddle_1_Y, F ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; The following code uses the joystick in a ;
- ; button fashion - once the joystick crosses a ;
- ; certain threshold (position), the joystick ;
- ; reading is treating as an UP or DOWN button ;
- ; press and either increments or decrements the ;
- ; paddle position. ;
- ;-----------------------------------------------;
- ; MOVWF Temp1 ;
- ; MOVLW H'90' ;
- ; SUBWF Temp1, W ;
- ; BTFSS STATUS, C ;
- ; DECF Paddle_1_Y, F ;
- ; MOVLW H'98' ;
- ; SUBWF Temp1, W ;
- ; BTFSC STATUS, C ;
- ; INCF Paddle_1_Y, F ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Make sure the paddle position stays within the;
- ; range of the field. ;
- ;-----------------------------------------------;
- _UP1_Limit_Paddle_Position: ;
- ;-----------------------------------------------;
- ; Lower Limit ;
- ;-----------------------------------------------;
- BTFSC Paddle_1_Y, MSB ;
- CLRF Paddle_1_Y ;
- ;-----------------------------------------------;
- ; Upper Limit ;
- ;-----------------------------------------------;
- MOVLW NUM_LINES - PADDLE_HEIGHT ;
- SUBWF Paddle_1_Y, W ;
- BTFSS STATUS, C ;
- GOTO _UP1_Update_Done ;
- MOVLW NUM_LINES - PADDLE_HEIGHT ;
- MOVWF Paddle_1_Y ;
- ;-----------------------------------------------;
- ;
- _UP1_Update_Done: ;
- #ELSE ;!_USE_THUMBSTICKS_ ;
- _UP1_Check_Up: ;
- CLRW ;
- XORWF Paddle_1_Y, W ;
- BTFSC STATUS, Z ;
- GOTO _UP1_Check_Down ;
- BTFSS PORTA, LBUTT_1_BIT ;
- DECF Paddle_1_Y, F ;
- _UP1_Check_Down: ;
- MOVLW NUM_LINES - PADDLE_HEIGHT ;
- XORWF Paddle_1_Y, W ;
- BTFSC STATUS, Z ;
- GOTO _UP1_Draw_Paddle ;
- BTFSS PORTA, LBUTT_2_BIT ;
- INCF Paddle_1_Y, F ;
- #ENDIF ;_USE_THUMBSTICKS_ ;
- ;-----------------------------------------------;
- ;
- _UP1_Exit: ;
- ;-----------------------------------------------;
- ; 60us BLACK line ;
- ;-----------------------------------------------;
- PAGESEL _BLACK_4us_SYNC_60us_LINE ;
- CALL _BLACK_4us_SYNC_60us_LINE ;
- PAGESEL $ ;
- ;-----------------------------------------------;
- #IF (_DISABLE_GAME_PROCESSING_ == TRUE) ;
- GOTO _UP2_Exit ;
- #ENDIF ;
- ;
- #IF _USE_THUMBSTICKS_ ;
- _UP2_Update: ;
- BTFSC System_Status, P2_COMPUTER_BIT ;
- GOTO _UP2_Computer ;
- ;
- ;-----------------------------------------------;
- ;-----------------------------------------------;
- _UP2_Human: ;
- ;-----------------------------------------------;
- ; ADC Magic (Channel 0) ;
- ;-----------------------------------------------;
- BANKSEL ADCON1 ;
- MOVLW H'60' ; Left Justified
- MOVWF ADCON1 ; FOSC/64, VREF
- MOVLW B'00000011' ; AN0, ADC GO, ADC On
- MOVWF ADCON0 ;
- BTFSC ADCON0, GO ; Wait for conversion
- GOTO $-1 ;
- MOVFW ADRESH ; Get result
- BANKSEL MEMORY ;
- ;-----------------------------------------------;
- ;
- MOVWF Temp1 ;
- MOVLW H'60' ;
- SUBWF Temp1, W ;
- BTFSS STATUS, C ;
- INCF Paddle_2_Y, F ;
- MOVLW H'9F' ;
- SUBWF Temp1, W ;
- BTFSC STATUS, C ;
- DECF Paddle_2_Y, F ;
- BTFSC Paddle_2_Y, MSB ;
- CLRF Paddle_2_Y ;
- MOVLW NUM_LINES - PADDLE_HEIGHT ;
- SUBWF Paddle_2_Y, W ;
- BTFSS STATUS, C ;
- GOTO _UP2_Human_Done ;
- MOVLW NUM_LINES - PADDLE_HEIGHT ;
- MOVWF Paddle_2_Y ;
- _UP2_Human_Done: ;
- GOTO _UP2_Exit ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ;-----------------------------------------------;
- _UP2_Computer: ;
- ;-----------------------------------------------;
- MOVLW (FIELD_WIDTH * 3) / 4 ;
- SUBWF Ball_X, W ;
- BTFSS STATUS, C ;
- GOTO _UP2_C_Done ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _UP2_C_Follow_Ball: ;
- ;-----------------------------------------------;
- CLRF Paddle_2_Dir_Y ;
- MOVFW Paddle_2_Y ;
- ADDLW PADDLE_HEIGHT / 2 ;
- SUBWF Ball_Y, W ;
- BTFSC STATUS, C ;
- GOTO $+4 ;
- DECF Paddle_2_Y, F ;
- MOVLW -1 ;
- MOVWF Paddle_2_Dir_Y ;
- ;-----------------------------------------------;
- MOVFW Paddle_2_Y ;
- ADDLW PADDLE_HEIGHT / 2 ;
- SUBWF Ball_Y, W ;
- BTFSS STATUS, C ;
- GOTO $+4 ;
- INCF Paddle_2_Y, F ;
- MOVLW 1 ;
- MOVWF Paddle_2_Dir_Y ;
- ;-----------------------------------------------;
- GOTO _UP2_C_Limit_Paddle ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _UP2_C_Follow_Paddle: ;
- ;-----------------------------------------------;
- MOVFW Paddle_2_Y ;
- ADDLW PADDLE_HEIGHT / 2 ;
- SUBWF Paddle_1_Y, W ;
- BTFSS STATUS, C ;
- DECF Paddle_2_Y, F ;
- ;-----------------------------------------------;
- MOVFW Paddle_2_Y ;
- ADDLW PADDLE_HEIGHT / 2 ;
- SUBWF Paddle_1_Y, W ;
- BTFSC STATUS, C ;
- INCF Paddle_2_Y, F ;
- ;-----------------------------------------------;
- GOTO _UP2_C_Limit_Paddle ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _UP2_C_Limit_Paddle: ;
- ;-----------------------------------------------;
- BTFSC Paddle_2_Y, MSB ;
- CLRF Paddle_2_Y ;
- MOVLW NUM_LINES - PADDLE_HEIGHT ;
- SUBWF Paddle_2_Y, W ;
- BTFSS STATUS, C ;
- GOTO _UP2_C_Done ;
- MOVLW NUM_LINES - PADDLE_HEIGHT ;
- MOVWF Paddle_2_Y ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _UP2_C_Done: ;
- ;-----------------------------------------------;
- GOTO _UP2_Exit ;
- ;-----------------------------------------------;
- ;
- #ELSE ;!_USE_THUMBSTICKS_ ;
- _UP2_Check_Up: ;
- CLRW ;
- XORWF Paddle_2_Y, W ;
- BTFSC STATUS, Z ;
- GOTO _UP2_Check_Down ;
- BTFSS PORTA, RBUTT_1_BIT ;
- DECF Paddle_2_Y, F ;
- _UP2_Check_Down: ;
- MOVLW NUM_LINES - PADDLE_HEIGHT ;
- XORWF Paddle_2_Y, W ;
- BTFSC STATUS, Z ;
- GOTO _UP2_Draw_Paddle ;
- BTFSS PORTA, RBUTT_2_BIT ;
- INCF Paddle_2_Y, F ;
- #ENDIF ;_USE_THUMBSTICKS_ ;
- ;
- _UP2_Exit: ;
- RETURN ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Update_Ball: ;
- ;---------------------------------------------------;
- ; 60us BLACK line ;
- ;-----------------------------------------------;
- PAGESEL _BLACK_4us_SYNC_60us_LINE ;
- CALL _BLACK_4us_SYNC_60us_LINE ;
- PAGESEL $ ;
- ;-----------------------------------------------;
- #IF (_DISABLE_GAME_PROCESSING_ == TRUE) ;
- GOTO _UB_Exit ;
- #ENDIF ;
- ;
- _UB_Check_Wait: ;
- ;-----------------------------------------------;
- ; This is the delay so the ball isn't so fast ;
- ;-----------------------------------------------;
- DECFSZ Ball_Wait, F ;
- GOTO _UB_Exit ;
- ;
- MOVLW MAX_BALL_WAIT ;
- MOVWF Ball_Wait ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Is the ball moving? (Ball_Dir_X or Ball_Dir_Y ;
- ; not equal to zero?) If so, update the ball ;
- ; position. Otherwise, check for serve. ;
- ;-----------------------------------------------;
- CLRW ;
- XORWF Ball_Dir_X, W ;
- BTFSS STATUS, Z ;
- GOTO _UB_Update_Ball_X ;
- CLRW ;
- XORWF Ball_Dir_Y, W ;
- BTFSS STATUS, Z ;
- GOTO _UB_Update_Ball_X ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Check if left player pushed button to serve ;
- ;-----------------------------------------------;
- _UB_Check_L_Serve: ;
- BTFSS System_Status, P1_SERVICE_BIT ;
- GOTO _UB_Check_R_Serve ;
- BTFSC PORTA, LBUTT_BIT ;
- GOTO _UB_Check_L_Unpressed ;
- BTFSC System_Status, P1_PRESSED_BIT ;
- GOTO _UB_Check_R_Serve ;
- BSF System_Status, P1_PRESSED_BIT ;
- BCF System_Status, P1_SERVICE_BIT ;
- BCF System_Status, P2_SERVICE_BIT ;
- MOVLW 1 ;
- MOVWF Ball_Dir_X ;
- MOVFW Paddle_1_Y ;
- ADDLW PADDLE_HEIGHT / 2 ;
- SUBLW NUM_LINES / 2 ;
- MOVLW -2 ;
- BTFSC STATUS, C ;
- MOVLW 1 ;
- MOVWF Ball_Dir_Y ;
- MOVLW 2 ;
- MOVWF Ball_X ;
- MOVFW Paddle_1_Y ;
- ADDLW PADDLE_HEIGHT / 2 ;
- MOVWF Ball_Y ;
- GOTO _UB_Service ;
- _UB_Check_L_Unpressed: ;
- BCF System_Status, P1_PRESSED_BIT ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Check if right player pushed button to serve ;
- ;-----------------------------------------------;
- _UB_Check_R_Serve: ;
- BTFSC System_Status, P2_COMPUTER_BIT ;
- GOTO _UB_CRS_Computer ;
- ;-----------------------------------------------;
- _UB_CRS_Human: ;
- BTFSS System_Status, P2_SERVICE_BIT ;
- GOTO _UB_Exit ;
- #IF (_AUDIO_ENABLED_ == TRUE) ;
- BTFSC Video_Status, AUDIO_ENABLED_BIT ;
- GOTO _UB_Exit ;
- BANKSEL TRISA ;
- BSF TRISA, RBUTT_BIT ; Set as input (for BUTTON)
- BANKSEL PORTA ;
- #ENDIF ; (_AUDIO_ENABLED_ == TRUE) ;
- BTFSC PORTA, RBUTT_BIT ;
- GOTO _UB_CRS_Unpressed ;
- #IF (_AUDIO_ENABLED_ == TRUE) ;
- BANKSEL TRISA ;
- BCF TRISA, RBUTT_BIT ; Set as output (for AUDIO)
- BANKSEL MEMORY ;
- #ENDIF ; (_AUDIO_ENABLED_ == TRUE) ;
- BTFSC System_Status, P2_PRESSED_BIT ;
- GOTO _UB_Exit ;
- #IF (_AUDIO_ENABLED_ == TRUE) ;
- BANKSEL TRISA ;
- BCF TRISA, RBUTT_BIT ; Set as output (for AUDIO)
- BANKSEL MEMORY ;
- #ENDIF ; (_AUDIO_ENABLED_ == TRUE) ;
- GOTO _UB_CRS_Init ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _UB_CRS_Computer: ;
- BTFSS System_Status, P1_SERVICE_BIT ;
- BTFSS System_Status, P2_SERVICE_BIT ;
- GOTO _UB_CRS_Unpressed ;
- BTFSC System_Status, P2_PRESSED_BIT ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _UB_CRS_Init: ;
- BSF System_Status, P2_PRESSED_BIT ;
- BCF System_Status, P1_SERVICE_BIT ;
- BCF System_Status, P2_SERVICE_BIT ;
- MOVLW -1 ;
- MOVWF Ball_Dir_X ;
- MOVFW Paddle_2_Y ;
- ADDLW PADDLE_HEIGHT / 2 ;
- SUBLW NUM_LINES / 2 ;
- MOVLW -1 ;
- BTFSC STATUS, C ;
- MOVLW 2 ;
- MOVWF Ball_Dir_Y ;
- MOVLW 29 ;
- MOVWF Ball_X ;
- MOVFW Paddle_2_Y ;
- ADDLW PADDLE_HEIGHT / 2 ;
- MOVWF Ball_Y ;
- GOTO _UB_Service ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _UB_CRS_Unpressed: ;
- BCF System_Status, P2_PRESSED_BIT ;
- GOTO _UB_Exit ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _UB_Service: ;
- MOVLW H'11' ;
- XORWF Score_1, W ;
- BTFSC STATUS, Z ;
- GOTO $+5 ;
- MOVLW H'11' ;
- XORWF Score_2, W ;
- BTFSS STATUS, Z ;
- GOTO _UB_Exit ;
- CLRF Score_1 ;
- CLRF Score_2 ;
- GOTO _UB_Exit ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _UB_Update_Ball_X: ;
- MOVFW Ball_Dir_X ; Update Ball X Position
- ADDWF Ball_X, F ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _UB_Update_Ball_X_Min: ;
- MOVLW 0 ;
- XORWF Ball_X, W ;
- BTFSS STATUS, Z ;
- GOTO _UB_Update_Ball_X_Max ;
- MOVLW 1 ;
- MOVWF Ball_Dir_X ;
- ;
- INCF Score_2, F ;
- #IF (_AUDIO_ENABLED_ == TRUE) ;
- ;-----------------------------------------------;
- ; Play the 'Ball Was Missed' sound ;
- ;-----------------------------------------------;
- PLAY_SOUND 24, H'017F' ; Frequency, Duration
- #ENDIF ; (_AUDIO_ENABLED_ == TRUE) ;
- BCF System_Status, P1_SERVICE_BIT ;
- BSF System_Status, P2_SERVICE_BIT ;
- MOVLW 0 ;
- MOVWF Ball_Dir_X ;
- MOVWF Ball_Dir_Y ;
- MOVLW 15 ;
- MOVWF Ball_X ;
- MOVLW 27 ;
- MOVWF Ball_Y ;
- MOVFW Score_2 ;
- ANDLW H'0F' ;
- XORLW H'0A' ;
- BTFSS STATUS, Z ;
- GOTO _UB_BXMin_Exit ;
- MOVFW Score_2 ;
- ANDLW H'F0' ;
- ADDLW H'10' ;
- MOVWF Score_2 ;
- MOVLW H'A0' ;
- XORWF Score_2, W ;
- BTFSC STATUS, Z ;
- CLRF Score_2 ;
- _UB_BXMin_Exit: ;
- MOVLW H'11' ;
- XORWF Score_2, W ;
- BTFSS STATUS, Z ;
- GOTO _UB_Exit ;
- BSF System_Status, P1_SERVICE_BIT ;
- BSF System_Status, P2_SERVICE_BIT ;
- GOTO _UB_Exit ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _UB_Update_Ball_X_Max: ;
- MOVLW 31 ;
- XORWF Ball_X, W ;
- BTFSS STATUS, Z ;
- GOTO _UB_Update_Ball_Y ;
- MOVLW -1 ;
- MOVWF Ball_Dir_X ;
- ;
- INCF Score_1, F ;
- #IF (_AUDIO_ENABLED_ == TRUE) ;
- ;-----------------------------------------------;
- ; Play the 'Ball Was Missed' sound ;
- ;-----------------------------------------------;
- PLAY_SOUND 24, H'017F' ; Frequency, Duration
- #ENDIF ; (_AUDIO_ENABLED_ == TRUE) ;
- BSF System_Status, P1_SERVICE_BIT ;
- BCF System_Status, P2_SERVICE_BIT ;
- MOVLW 0 ;
- MOVWF Ball_Dir_X ;
- MOVWF Ball_Dir_Y ;
- MOVLW 15 ;
- MOVWF Ball_X ;
- MOVLW 27 ;
- MOVWF Ball_Y ;
- MOVFW Score_1 ;
- ANDLW H'0F' ;
- XORLW H'0A' ;
- BTFSS STATUS, Z ;
- GOTO _UB_BXMax_Exit ;
- MOVFW Score_1 ;
- ANDLW H'F0' ;
- ADDLW H'10' ;
- MOVWF Score_1 ;
- MOVLW H'A0' ;
- XORWF Score_1, W ;
- BTFSC STATUS, Z ;
- CLRF Score_1 ;
- _UB_BXMax_Exit: ;
- MOVLW H'11' ;
- XORWF Score_1, W ;
- BTFSS STATUS, Z ;
- GOTO _UB_Exit ;
- BSF System_Status, P1_SERVICE_BIT ;
- BSF System_Status, P2_SERVICE_BIT ;
- GOTO _UB_Exit ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Update Ball_Y position ;
- ;-----------------------------------------------;
- _UB_Update_Ball_Y: ;
- MOVFW Ball_Dir_Y ;
- ADDWF Ball_Y, F ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Check for collision with upper sideline ;
- ;-----------------------------------------------;
- _UB_Update_Ball_Y_Min: ;
- BTFSS Ball_Y, MSB ;
- GOTO _UB_Update_Ball_Y_Max ;
- COMF Ball_Y, F ;
- COMF Ball_Dir_Y, F ;
- INCF Ball_Dir_Y, F ;
- #IF (_AUDIO_ENABLED_ == TRUE) ;
- ;-----------------------------------------------;
- ; Play the 'Ball Hit Sideline' sound ;
- ;-----------------------------------------------;
- PLAY_SOUND 6, H'017F' ; Frequency, Duration
- #ENDIF ; (_AUDIO_ENABLED_ == TRUE) ;
- GOTO _UB_Paddle_Detect_Left ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Check for collision with lower sideline ;
- ;-----------------------------------------------;
- _UB_Update_Ball_Y_Max: ;
- MOVLW NUM_LINES - 2 ;
- SUBWF Ball_Y, W ;
- BTFSS STATUS, C ;
- GOTO _UB_Paddle_Detect_Left ;
- MOVLW NUM_LINES - 2 ;
- MOVWF Ball_Y ;
- COMF Ball_Dir_Y, F ;
- INCF Ball_Dir_Y, F ;
- #IF (_AUDIO_ENABLED_ == TRUE) ;
- ;-----------------------------------------------;
- ; Play the 'Ball Hit Sideline' sound ;
- ;-----------------------------------------------;
- PLAY_SOUND 6, H'017F' ; Frequency, Duration
- ;-----------------------------------------------;
- #ENDIF ; (_AUDIO_ENABLED_ == TRUE) ;
- ;
- ;-----------------------------------------------;
- ; Check for collision with left paddle ;
- ;-----------------------------------------------;
- _UB_Paddle_Detect_Left: ;
- ;-----------------------------------------------;
- ; On the same vertical line as the left paddle? ;
- ;-----------------------------------------------;
- MOVLW 1 ;
- XORWF Ball_X, W ;
- BTFSS STATUS, Z ;
- GOTO _UB_Paddle_Detect_Right ;
- ;
- MOVFW Paddle_1_Y ;
- MOVWF Temp1 ;
- MOVFW Paddle_1_Dir_Y ;
- MOVWF Temp2 ;
- GOTO _UB_PD_Check_Hit ;
- ;
- ;-----------------------------------------------;
- ; Check for collision with right paddle ;
- ;-----------------------------------------------;
- _UB_Paddle_Detect_Right: ;
- ;-----------------------------------------------;
- ; On the same vertical line as the right paddle?;
- ;-----------------------------------------------;
- MOVLW 30 ;
- XORWF Ball_X, W ;
- BTFSS STATUS, Z ;
- GOTO _UB_Exit ;
- MOVFW Paddle_2_Y ;
- MOVWF Temp1 ;
- MOVFW Paddle_2_Dir_Y ;
- MOVWF Temp2 ;
- ;-----------------------------------------------;
- ;
- _UB_PD_Check_Hit: ;
- ;-----------------------------------------------;
- ; Are we on the save horizontal plane as the ;
- ; paddle? ;
- ;-----------------------------------------------;
- MOVFW Ball_Y ;
- ADDLW BALL_HEIGHT ;
- SUBWF Temp1, W ;
- BTFSC STATUS, C ;
- GOTO _UB_Exit ;
- ;
- MOVLW PADDLE_HEIGHT - 1 ;
- ADDWF Temp1, F ;
- MOVFW Ball_Y ;
- SUBWF Temp1, W ;
- BTFSS STATUS, C ;
- GOTO _UB_Exit ;
- ;
- _UB_PD_Its_A_Hit: ;
- ;-----------------------------------------------;
- ; Reverse the ball 'X' direction ;
- ;-----------------------------------------------;
- COMF Ball_Dir_X, F ;
- INCF Ball_Dir_X, F ;
- ;-----------------------------------------------;
- ; Adjust the ball 'X' position ;
- ;-----------------------------------------------;
- MOVFW Ball_Dir_X ;
- ADDWF Ball_X, F ;
- ;-----------------------------------------------;
- ; This is a crude form of 'english' ;
- ;-----------------------------------------------;
- MOVFW Temp2 ;
- ADDWF Ball_Dir_Y, F ;
- MOVLW -3 ;
- XORWF Ball_Dir_Y, W ;
- MOVLW -2 ;
- BTFSC STATUS, Z ;
- MOVWF Ball_Dir_Y ;
- MOVLW 3 ;
- XORWF Ball_Dir_Y, W ;
- MOVLW 2 ;
- BTFSC STATUS, Z ;
- MOVWF Ball_Dir_Y ;
- _UB_PD_IAH_Done: ;
- #IF (_AUDIO_ENABLED_ == TRUE) ;
- ;-----------------------------------------------;
- ; Play the 'Ball Hit Paddle' sound ;
- ;-----------------------------------------------;
- PLAY_SOUND 8, H'014F' ; Frequency, Duration
- ;-----------------------------------------------;
- #ENDIF ; (_AUDIO_ENABLED_ == TRUE) ;
- ;
- ;-----------------------------------------------;
- ; Ball update done. Restore RBUTT as an output ;
- ; for sound and wait for 60us to pass. ;
- ;-----------------------------------------------;
- _UB_Exit: ;
- #IF (_AUDIO_ENABLED_ == TRUE) ;
- BANKSEL TRISA ;
- BCF TRISA, RBUTT_BIT ; Set as OUTPUT (for AUDIO)
- BANKSEL MEMORY ;
- #ENDIF ; (_AUDIO_ENABLED_ == TRUE) ;
- ;
- RETURN ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Draw_Items: ;
- ;---------------------------------------------------;
- ;-----------------------------------------------;
- ; 60us BLACK Line ;
- ;-----------------------------------------------;
- PAGESEL _BLACK_4us_SYNC_60us_LINE ;
- CALL _BLACK_4us_SYNC_60us_LINE ;
- PAGESEL $ ;
- ;-----------------------------------------------;
- #IF (_DISABLE_GAME_PROCESSING_ == TRUE) ;
- GOTO _DI_Exit_1 ;
- #ENDIF ;
- ;
- ;-----------------------------------------------;
- _DI_Draw_Service_Player_1: ;
- ;-----------------------------------------------;
- MOVLW LOW VIDEO_BUFFER_START + SERVICE_1_START;
- MOVWF FSR1L ;
- MOVLW H'0F' ;
- BTFSS System_Status, P1_SERVICE_BIT ;
- CLRW ;
- BTFSC System_Status, P2_SERVICE_BIT ;
- CLRW ;
- CALL _DI_Draw_Service ;
- ;-----------------------------------------------;
- ;-----------------------------------------------;
- _DI_Draw_Service_Player_2: ;
- ;-----------------------------------------------;
- MOVLW LOW VIDEO_BUFFER_START + SERVICE_2_START;
- MOVWF FSR1L ;
- MOVLW H'F0' ;
- BTFSS System_Status, P2_SERVICE_BIT ;
- CLRW ;
- BTFSC System_Status, P1_SERVICE_BIT ;
- CLRW ;
- CALL _DI_Draw_Service ;
- ;
- GOTO _DI_DS_Done ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _DI_Draw_Service: ;
- ;-----------------------------------------------;
- MOVWF Temp1 ;
- MOVLW HIGH VIDEO_BUFFER_START ;
- MOVWF FSR1H ;
- MOVLW LOW SERVICE_ARROW_START ;
- MOVWF FSR0L ;
- MOVLW HIGH SERVICE_ARROW_START ;
- MOVWF FSR0H ;
- MOVLW (SERVICE_ARROW_END - SERVICE_ARROW_START)
- MOVWF Line_Count ;
- _DI_DS_Next_Byte: ;
- MOVFW INDF0 ;
- ANDWF Temp1, W ;
- MOVWF INDF1 ;
- ADDFSR FSR0, 1 ;
- ADDFSR FSR1, 4 ;
- DECFSZ Line_Count, F ;
- GOTO _DI_DS_Next_Byte ;
- RETURN ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _DI_DS_Done: ;
- ;-----------------------------------------------;
- ;
- _DI_Exit_1: ;
- ;-----------------------------------------------;
- ; 60us BLACK Line ;
- ;-----------------------------------------------;
- PAGESEL _BLACK_4us_SYNC_60us_LINE ;
- CALL _BLACK_4us_SYNC_60us_LINE ;
- PAGESEL $ ;
- ;-----------------------------------------------;
- #IF (_DISABLE_GAME_PROCESSING_ == TRUE) ;
- GOTO _DI_Exit_2 ;
- #ENDIF ;
- ;
- ;-----------------------------------------------;
- _DI_DSP1_Draw_Left_Char: ;
- ;-----------------------------------------------;
- SWAPF Score_1, W ;
- ANDLW H'0F' ;
- MOVWF Temp1 ;
- MOVLW H'E0' ;
- ;
- CALL _DI_DSP1_Draw_Character ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _DI_DSP1_Draw_Right_Char: ;
- ;-----------------------------------------------;
- MOVFW Score_1 ;
- ANDLW H'0F' ;
- MOVWF Temp1 ;
- MOVLW H'0E' ;
- ;
- CALL _DI_DSP1_Draw_Character ;
- ;
- GOTO _DI_DSP1_Done ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _DI_DSP1_Draw_Character: ;
- ;-----------------------------------------------;
- MOVWF Temp2 ;
- ;
- MOVLW LOW VIDEO_BUFFER_START + LEFT_SCORE_START
- MOVWF FSR1L ;
- ;
- MOVLW HIGH VIDEO_BUFFER_START ;
- MOVWF FSR1H ;
- ;
- MOVLW HIGH SCORE_FONT_START ;
- MOVWF FSR0H ;
- MOVLW LOW SCORE_FONT_START ;
- ADDWF Temp1, W ;
- BTFSC STATUS, C ;
- INCF FSR0H, F ;
- MOVWF FSR0L ;
- ;
- MOVLW 5 ;
- MOVWF Line_Count ;
- _DI_DSP1_DC_Next_Line: ;
- MOVFW INDF0 ;
- ANDWF Temp2, W ;
- IORWF INDF1, F ;
- ADDFSR FSR0, 10 ;
- ADDFSR FSR1, 4 ;
- DECFSZ Line_Count, F ;
- GOTO _DI_DSP1_DC_Next_Line ;
- ;
- RETURN ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _DI_DSP1_Done: ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _DI_DSP2_Draw_Left_Char: ;
- ;-----------------------------------------------;
- SWAPF Score_2, W ;
- ANDLW H'0F' ;
- MOVWF Temp1 ;
- MOVLW H'70' ;
- ;
- CALL _DI_DSP2_Draw_Character ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _DI_DSP2_Draw_Right_Char: ;
- ;-----------------------------------------------;
- MOVFW Score_2 ;
- ANDLW H'0F' ;
- MOVWF Temp1 ;
- MOVLW H'07' ;
- ;
- CALL _DI_DSP2_Draw_Character ;
- ;
- GOTO _DI_DSP2_Done ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _DI_DSP2_Draw_Character: ;
- ;-----------------------------------------------;
- MOVWF Temp2 ;
- ;
- MOVLW LOW VIDEO_BUFFER_START + RIGHT_SCORE_START
- MOVWF FSR1L ;
- ;
- MOVLW HIGH VIDEO_BUFFER_START ;
- MOVWF FSR1H ;
- ;
- MOVLW HIGH SCORE_FONT_START ;
- MOVWF FSR0H ;
- MOVLW LOW SCORE_FONT_START ;
- ADDWF Temp1, W ;
- BTFSC STATUS, C ;
- INCF FSR0H, F ;
- MOVWF FSR0L ;
- ;
- MOVLW 5 ;
- MOVWF Line_Count ;
- _DI_DSP2_DC_Next_Line: ;
- MOVFW INDF0 ;
- MOVWF DTemp ;
- RRF DTemp, W ;
- ANDWF Temp2, W ;
- IORWF INDF1, F ;
- ADDFSR FSR0, 10 ;
- ADDFSR FSR1, 4 ;
- DECFSZ Line_Count, F ;
- GOTO _DI_DSP2_DC_Next_Line ;
- ;
- RETURN ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _DI_DSP2_Done: ;
- ;-----------------------------------------------;
- ;
- _DI_Exit_2: ;
- ;-----------------------------------------------;
- ; 60us BLACK Line ;
- ;-----------------------------------------------;
- PAGESEL _BLACK_4us_SYNC_60us_LINE ;
- CALL _BLACK_4us_SYNC_60us_LINE ;
- PAGESEL $ ;
- ;-----------------------------------------------;
- #IF (_DISABLE_GAME_PROCESSING_ == TRUE) ;
- GOTO _DI_Exit_3 ;
- #ENDIF ;
- ;
- _DI_Draw_Paddle_1: ;
- MOVFW Paddle_1_Y ;
- ADDWF Paddle_1_Y, W ;
- ADDWF Paddle_1_Y, W ;
- ADDWF Paddle_1_Y, W ;
- ADDLW LOW VIDEO_BUFFER_START + LEFT_PADDLE_START
- MOVWF FSR1L ;
- MOVLW HIGH VIDEO_BUFFER_START ;
- MOVLW PADDLE_HEIGHT ;
- MOVWF Temp1 ;
- _DI_DP1_Next_Bit: ;
- MOVFW INDF1 ;
- IORLW LEFT_PADDLE_BIT ;
- MOVWF INDF1 ;
- ADDFSR FSR1, 4 ;
- DECFSZ Temp1, F ;
- GOTO _DI_DP1_Next_Bit ;
- ;
- _DI_Draw_Paddle_2: ;
- MOVFW Paddle_2_Y ;
- ADDWF Paddle_2_Y, W ;
- ADDWF Paddle_2_Y, W ;
- ADDWF Paddle_2_Y, W ;
- ADDLW LOW VIDEO_BUFFER_START + RIGHT_PADDLE_START;
- MOVWF FSR1L ;
- MOVLW HIGH VIDEO_BUFFER_START ;
- MOVWF FSR1H ;
- MOVLW PADDLE_HEIGHT ;
- MOVWF Temp1 ;
- _DI_DP2_Next_Bit: ;
- MOVFW INDF1 ;
- IORLW RIGHT_PADDLE_BIT ;
- MOVWF INDF1 ;
- ADDFSR FSR1, 4 ;
- DECFSZ Temp1, F ;
- GOTO _DI_DP2_Next_Bit ;
- ;
- _DI_Draw_Ball: ;
- ;-----------------------------------------------;
- ; Check to see if the ball has any movement. If ;
- ; not, we are either at the end of a game or ;
- ; waiting for service. In that case, don't draw ;
- ; the ball. ;
- ;-----------------------------------------------;
- CLRW ;
- XORWF Ball_Dir_X, W ;
- BTFSS STATUS, Z ;
- GOTO _DI_DB_Draw ;
- CLRW ;
- XORWF Ball_Dir_Y, W ;
- BTFSC STATUS, Z ;
- GOTO _DI_Exit_3 ;
- MOVLW 1 ;
- XORWF Ball_Wait, W ;
- BTFSS STATUS, Z ;
- GOTO _DI_Exit_3 ;
- ;
- _DI_DB_Draw: ;
- ;-----------------------------------------------;
- ; This is where we actually 'draw' the ball. ;
- ;-----------------------------------------------;
- MOVFW Ball_Y ;
- ADDWF Ball_Y, W ;
- ADDWF Ball_Y, W ;
- ADDWF Ball_Y, W ;
- ADDLW LOW VIDEO_BUFFER_START ;
- MOVWF FSR1L ;
- RRF Ball_X, W ;
- MOVWF Temp1 ;
- RRF Temp1, F ;
- RRF Temp1, W ;
- ANDLW H'1F' ;
- ADDWF FSR1L, F ;
- MOVLW HIGH VIDEO_BUFFER_START ;
- MOVWF FSR1H ;
- ;
- MOVFW Ball_X ;
- ANDLW H'07' ;
- MOVWF Temp1 ;
- MOVLW H'80' ;
- MOVWF DTemp ;
- MOVLW 0 ; ;
- XORWF Temp1, W ;
- BTFSC STATUS, Z ;
- GOTO $+5 ;
- DECF Temp1, F ;
- RRF DTemp, F ;
- BCF DTemp, MSB ;
- GOTO $-7 ;
- ;
- MOVLW BALL_HEIGHT ;
- MOVWF Temp1 ;
- MOVFW DTemp ;
- _DI_DB_D_Next_Pixel: ;
- XORWF INDF1, F ;
- ADDFSR FSR1, 4 ;
- DECFSZ Temp1, F ;
- GOTO _DI_DB_D_Next_Pixel ;
- ;
- _DI_Exit_3: ;
- RETURN ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Clear_Screen: ;
- ;---------------------------------------------------;
- ; This is a 2 60us BLACK lines routine ;
- ;---------------------------------------------------;
- ;-----------------------------------------------;
- ; 60us BLACK Line ;
- ;-----------------------------------------------;
- PAGESEL _BLACK_4us_SYNC_60us_LINE ;
- CALL _BLACK_4us_SYNC_60us_LINE ;
- PAGESEL $ ;
- ;-----------------------------------------------;
- #IF (_DISABLE_GAME_PROCESSING_ == TRUE) ;
- GOTO _CS_T_Exit ;
- #ENDIF ;
- ;
- _CS_Top: ;
- ;-----------------------------------------------;
- ; Set up the pointer to the video buffer ;
- ;-----------------------------------------------;
- MOVLW HIGH VIDEO_BUFFER_START ;
- MOVWF FSR1H ;
- MOVLW LOW VIDEO_BUFFER_START ;
- MOVWF FSR1L ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Set up the pointer to the title graphic ;
- ;-----------------------------------------------;
- MOVLW HIGH TITLE_GRAPHIC_START ;
- MOVWF FSR0H ;
- MOVLW LOW TITLE_GRAPHIC_START ;
- MOVWF FSR0L ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Set up the number of bytes to transfer ;
- ;-----------------------------------------------;
- MOVLW ((TITLE_GRAPHIC_END - TITLE_GRAPHIC_START) / 2) / 8
- MOVWF Temp1 ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Transfer the data from the title graphic to ;
- ; the video buffer, 8 bytes at a time. Doing it ;
- ; in groups of 8 in a loop, instead of 1 byte at;
- ; a time in a loop, speeds up the transfer as ;
- ; it cuts out a lot of the instruction cycles ;
- ; for the looping mechanism. ;
- ;-----------------------------------------------;
- _CS_T_Next_8_Bytes: ;
- MOVIW 0[INDF0] ;
- MOVWI 0[INDF1] ;
- MOVIW 1[INDF0] ;
- MOVWI 1[INDF1] ;
- MOVIW 2[INDF0] ;
- MOVWI 2[INDF1] ;
- MOVIW 3[INDF0] ;
- MOVWI 3[INDF1] ;
- MOVIW 4[INDF0] ;
- MOVWI 4[INDF1] ;
- MOVIW 5[INDF0] ;
- MOVWI 5[INDF1] ;
- MOVIW 6[INDF0] ;
- MOVWI 6[INDF1] ;
- MOVIW 7[INDF0] ;
- MOVWI 7[INDF1] ;
- _CS_T_Check_For_Title: ;
- BTFSC System_Status, P1_SERVICE_BIT ; If SERVICE is clear for both
- BTFSS System_Status, P2_SERVICE_BIT ; players, then it's the start
- GOTO $+2 ; of a game. Draw the title.
- ADDFSR FSR0, 8 ;
- ADDFSR FSR1, 8 ;
- DECFSZ Temp1, F ;
- GOTO _CS_T_Next_8_Bytes ;
- ;-----------------------------------------------;
- ;
- _CS_T_Exit: ;
- ;-----------------------------------------------;
- ; 60us BLACK Line ;
- ;-----------------------------------------------;
- PAGESEL _BLACK_4us_SYNC_60us_LINE ;
- CALL _BLACK_4us_SYNC_60us_LINE ;
- PAGESEL $ ;
- ;-----------------------------------------------;
- #IF (_DISABLE_GAME_PROCESSING_ == TRUE) ;
- GOTO _CS_B_Exit ;
- #ENDIF ;
- ;
- _CS_Bottom: ;
- ;-----------------------------------------------;
- ; Set up the pointer to the video buffer ;
- ;-----------------------------------------------;
- MOVLW HIGH VIDEO_BUFFER_START ;
- MOVWF FSR1H ;
- MOVLW LOW VIDEO_BUFFER_START ;
- ADDLW (NUM_LINES * 4) / 2 ;
- MOVWF FSR1L ;
- BTFSC STATUS, C ;
- INCF FSR1H, F ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Set up the pointer to the title graphic ;
- ;-----------------------------------------------;
- MOVLW HIGH TITLE_GRAPHIC_START ;
- MOVWF FSR0H ;
- MOVLW LOW TITLE_GRAPHIC_START ;
- _CS_B_Check_For_Title1: ;
- BTFSC System_Status, P1_SERVICE_BIT ; If SERVICE is clear for both
- BTFSS System_Status, P2_SERVICE_BIT ; players, then it's the start
- GOTO $+2 ; of a game. Draw the title.
- ADDLW (NUM_LINES * 4) / 2 ;
- MOVWF FSR0L ;
- BTFSC STATUS, C ;
- INCF FSR0H, F ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Set up the number of bytes to transfer ;
- ;-----------------------------------------------;
- MOVLW ((TITLE_GRAPHIC_END - TITLE_GRAPHIC_START) / 2) / 8
- MOVWF Temp1 ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Transfer the data from the title graphic to ;
- ; the video buffer, 8 bytes at a time. Doing it ;
- ; in groups of 8 in a loop, instead of 1 byte at;
- ; a time in a loop, speeds up the transfer as ;
- ; it cuts out a lot of the instruction cycles ;
- ; for the looping mechanism. ;
- ;-----------------------------------------------;
- _CS_B_Next_8_Bytes: ;
- MOVIW 0[INDF0] ;
- MOVWI 0[INDF1] ;
- MOVIW 1[INDF0] ;
- MOVWI 1[INDF1] ;
- MOVIW 2[INDF0] ;
- MOVWI 2[INDF1] ;
- MOVIW 3[INDF0] ;
- MOVWI 3[INDF1] ;
- MOVIW 4[INDF0] ;
- MOVWI 4[INDF1] ;
- MOVIW 5[INDF0] ;
- MOVWI 5[INDF1] ;
- MOVIW 6[INDF0] ;
- MOVWI 6[INDF1] ;
- MOVIW 7[INDF0] ;
- MOVWI 7[INDF1] ;
- _CS_B_Check_For_Title2: ;
- BTFSC System_Status, P1_SERVICE_BIT ; If SERVICE is clear for both
- BTFSS System_Status, P2_SERVICE_BIT ; players, then it's the start
- GOTO $+2 ; of a game. Draw the title.
- ADDFSR FSR0, 8 ;
- ADDFSR FSR1, 8 ;
- DECFSZ Temp1, F ;
- GOTO _CS_B_Next_8_Bytes ;
- ;-----------------------------------------------;
- ;
- _CS_B_Exit: ;
- RETURN ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banners: ;
- ;---------------------------------------------------;
- ; Note: This is a 60us line routine. It will ;
- ; generate 11 60us data lines. First, 1 BLACK line ;
- ; to space the banner from anything else. Then, the ;
- ; 8 DATA lines of banner information. Finally, 1 ;
- ; BLACK line for spacing and two WHITE lines. ;
- ;---------------------------------------------------;
- ;-----------------------------------------------;
- BTFSC System_Status, BANNER_SELECT_BIT ;
- GOTO _BB_Check_If_Time_To_Switch ;
- ;-----------------------------------------------;
- _TB_Check_If_Time_To_Switch: ;
- MOVLW 120 ; / 60 frames = 2 secs
- XORWF VSync_Count, W ;
- BTFSS STATUS, Z ;
- GOTO _TB_Do_Banner ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _TB_Switch_Banner: ;
- INCF TB_Count, F ;
- MOVLW MAX_TBANNERS ;
- XORWF TB_Count, W ;
- BTFSC STATUS, Z ;
- CLRF TB_Count ;
- ;
- ;-----------------------------------------------;
- _TB_Do_Banner: ;
- MOVFW TB_Count ;
- GOTO _B_Exit ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _BB_Check_If_Time_To_Switch: ;
- ;-----------------------------------------------;
- MOVLW 60 ;
- XORWF VSync_Count, W ;
- BTFSC STATUS, Z ;
- GOTO _BB_Switch_Banner ;
- MOVLW 120 ; / 60 frames = 2 secs
- XORWF VSync_Count, W ;
- BTFSS STATUS, Z ;
- GOTO _BB_Do_Banner ;
- ;-----------------------------------------------;
- ;
- CLRF VSync_Count ;
- ;-----------------------------------------------;
- _BB_Switch_Banner: ;
- ;-----------------------------------------------;
- INCF BB_Count, F ;
- MOVLW MAX_BBANNERS ;
- XORWF BB_Count, W ;
- BTFSC STATUS, Z ;
- CLRF BB_Count ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _BB_Do_Banner: ;
- ;-----------------------------------------------;
- MOVFW BB_Count ;
- ADDLW MAX_TBANNERS ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- _B_Exit: ;
- GOTO _Banner_Select ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Select: ;
- ;---------------------------------------------------;
- BRW ;
- GOTO _Banner_Copyright ;
- GOTO _Banner_Software1 ;
- GOTO _Banner_Software2 ;
- GOTO _Banner_Option1 ;
- GOTO _Banner_Option2 ;
- GOTO _Banner_Author1 ;
- GOTO _Banner_Author2 ;
- GOTO _Banner_Email1 ;
- GOTO _Banner_Email2 ;
- GOTO _Banner_Website1 ;
- GOTO _Banner_Website2 ;
- GOTO _Banner_Website3 ;
- GOTO _Banner_Website4 ;
- GOTO _Banner_Website5 ;
- ;---------------------------------------------------;
- ;
- ;---------------------------------------------------;
- _Banner_Copyright: ;
- ;---------------------------------------------------;
- MOVLW LOW COPYRIGHT_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH COPYRIGHT_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (COPYRIGHT_BANNER_END - COPYRIGHT_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Software1: ;
- ;---------------------------------------------------;
- MOVLW LOW SOFTWARE1_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH SOFTWARE1_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (SOFTWARE1_BANNER_END - SOFTWARE1_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Software2: ;
- ;---------------------------------------------------;
- MOVLW LOW SOFTWARE2_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH SOFTWARE2_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (SOFTWARE2_BANNER_END - SOFTWARE2_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Author1: ;
- ;---------------------------------------------------;
- MOVLW LOW AUTHOR1_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH AUTHOR1_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (AUTHOR1_BANNER_END - AUTHOR1_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Author2: ;
- ;---------------------------------------------------;
- MOVLW LOW AUTHOR2_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH AUTHOR2_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (AUTHOR2_BANNER_END - AUTHOR2_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Email1: ;
- MOVLW LOW EMAIL1_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH EMAIL1_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (EMAIL1_BANNER_END - EMAIL1_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Email2: ;
- ;---------------------------------------------------;
- MOVLW LOW EMAIL2_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH EMAIL2_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (EMAIL2_BANNER_END - EMAIL2_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Website1: ;
- ;---------------------------------------------------;
- MOVLW LOW WEBSITE1_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH WEBSITE1_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (WEBSITE1_BANNER_END - WEBSITE1_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Website2: ;
- ;---------------------------------------------------;
- MOVLW LOW WEBSITE2_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH WEBSITE2_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (WEBSITE2_BANNER_END - WEBSITE2_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Website3: ;
- ;---------------------------------------------------;
- MOVLW LOW WEBSITE3_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH WEBSITE3_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (WEBSITE3_BANNER_END - WEBSITE3_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Website4: ;
- ;---------------------------------------------------;
- MOVLW LOW WEBSITE4_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH WEBSITE4_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (WEBSITE4_BANNER_END - WEBSITE4_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Website5: ;
- ;---------------------------------------------------;
- MOVLW LOW WEBSITE5_BANNER_START ;
- MOVWF FSR1L ;
- MOVLW HIGH WEBSITE5_BANNER_START ;
- MOVWF FSR1H ;
- ; MOVLW (WEBSITE5_BANNER_END - WEBSITE5_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Option1: ;
- ;---------------------------------------------------;
- MOVLW HIGH OPTION1_BANNER_START ;
- MOVWF FSR1H ;
- MOVLW LOW OPTION1_BANNER_START ;
- MOVWF FSR1L ;
- ; MOVLW (OPTION1_BANNER_END - OPTION1_BANNER_START) / 8
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Banner_Option2: ;
- ;---------------------------------------------------;
- MOVLW HIGH OPTION2_BANNER_START ;
- MOVWF FSR1H ;
- MOVLW LOW OPTION2_BANNER_START ;
- MOVWF FSR1L ;
- CLRW ;
- BTFSC System_Status, P2_COMPUTER_BIT ;
- MOVLW (OPTION2_BANNER_END - OPTION2_BANNER_START) / 2
- ADDWF FSR1L, F ;
- BTFSC STATUS, C ;
- INCF FSR1H, F ;
- ; MOVLW (OPTION2_BANNER_END - OPTION2_BANNER_START) / 16
- PAGESEL _Draw_Banner ;
- GOTO _Draw_Banner ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- USER_CODE_2 CODE H'800' ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- _Draw_Banner: ;
- ;---------------------------------------------------;
- ; 8 60us Data Lines Generation ;
- ;-----------------------------------------------;
- MOVLW 8 ;
- MOVWF Line_Count ;
- ;
- _DB_Next_Line: ;
- MOVLW 1 ;
- MOVWF Repeat_Count ;
- ;
- _DB_Repeat_Line: ;
- ;-----------------------------------------------;
- ; 60us BLACK Line ;
- ;-----------------------------------------------;
- PAGESEL _BLACK_4us_SYNC_60us_LINE_BPorch ;
- CALL _BLACK_4us_SYNC_60us_LINE_BPorch ;
- PAGESEL $ ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Data Generation ;
- ;-----------------------------------------------;
- DO_BIT 7, 0 ;
- DO_BIT 6, 0 ;
- DO_BIT 5, 0 ;
- DO_BIT 4, 0 ;
- DO_BIT 3, 0 ;
- DO_BIT 2, 0 ;
- DO_BIT 1, 0 ;
- DO_BIT 0, 0 ;
- ;-----------------------------------------------;
- DO_BIT 7, 0 ;
- DO_BIT 6, 0 ;
- DO_BIT 5, 0 ;
- DO_BIT 4, 0 ;
- DO_BIT 3, 0 ;
- DO_BIT 2, 0 ;
- DO_BIT 1, 0 ;
- DO_BIT 0, 0 ;
- ;-----------------------------------------------;
- DO_BIT 7, 0 ;
- DO_BIT 6, 0 ;
- DO_BIT 5, 0 ;
- DO_BIT 4, 0 ;
- DO_BIT 3, 0 ;
- DO_BIT 2, 0 ;
- DO_BIT 1, 0 ;
- DO_BIT 0, 0 ;
- ;-----------------------------------------------;
- DO_BIT 7, 0 ;
- DO_BIT 6, 0 ;
- DO_BIT 5, 0 ;
- DO_BIT 4, 0 ;
- DO_BIT 3, 0 ;
- DO_BIT 2, 0 ;
- DO_BIT 1, 0 ;
- DO_BIT 0, 0 ;
- ;-----------------------------------------------;
- DO_BIT 7, 0 ;
- DO_BIT 6, 0 ;
- DO_BIT 5, 0 ;
- DO_BIT 4, 0 ;
- DO_BIT 3, 0 ;
- DO_BIT 2, 0 ;
- DO_BIT 1, 0 ;
- DO_BIT 0, 0 ;
- ;-----------------------------------------------;
- DO_BIT 7, 0 ;
- DO_BIT 6, 0 ;
- DO_BIT 5, 0 ;
- DO_BIT 4, 0 ;
- DO_BIT 3, 0 ;
- DO_BIT 2, 0 ;
- DO_BIT 1, 0 ;
- DO_BIT 0, 0 ;
- ;-----------------------------------------------;
- DO_BIT 7, 0 ;
- DO_BIT 6, 0 ;
- DO_BIT 5, 0 ;
- DO_BIT 4, 0 ;
- DO_BIT 3, 0 ;
- DO_BIT 2, 0 ;
- DO_BIT 1, 0 ;
- DO_BIT 0, 0 ;
- ;-----------------------------------------------;
- DO_BIT 7, 0 ;
- DO_BIT 6, 0 ;
- DO_BIT 5, 0 ;
- DO_BIT 4, 0 ;
- DO_BIT 3, 0 ;
- DO_BIT 2, 0 ;
- DO_BIT 1, 0 ;
- DO_BIT 0, 0 ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ; Xus Front Porch (Black Signal) Generation ;
- ;-----------------------------------------------;
- NOP
- SET_DAC2BIT COLOR_BLACK ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ADDFSR FSR1, -8 ;
- DECFSZ Repeat_Count, F ;
- GOTO _DB_Repeat_Line ;
- ;-----------------------------------------------;
- ;
- ;-----------------------------------------------;
- ADDFSR FSR1, 8 ;
- DECFSZ Line_Count, F ;
- GOTO _DB_Next_Line ;
- ;-----------------------------------------------;
- ;
- RETURN ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- SCORE_FONT_START: ;
- ;---------------------------------------------------;
- ; These are the bitmaps for the score characters;
- ; 0-9, 4x5 pixels ;
- ;-----------------------------------------------;
- DT B'11101110', B'01000100', B'11101110', B'11101110', B'10101010', B'11101110', B'11101110', B'11101110', B'11101110', B'11101110'
- DT B'10101010', B'11001100', B'00100010', B'00100010', B'10101010', B'10001000', B'10001000', B'00100010', B'10101010', B'10101010'
- DT B'10101010', B'01000100', B'11101110', B'11101110', B'11101110', B'11101110', B'11101110', B'00100010', B'11101110', B'11101110'
- DT B'10101010', B'01000100', B'10001000', B'00100010', B'00100010', B'00100010', B'10101010', B'00100010', B'10101010', B'00100010'
- DT B'11101110', B'01000100', B'11101110', B'11101110', B'00100010', B'11101110', B'11101110', B'00100010', B'11101110', B'00100010'
- ;-----------------------------------------------;
- ; I'm trying to compress the character table by ;
- ; 50%. So far - only the table, not the code ;
- ;-----------------------------------------------;
- ; DT B'11100100', B'11101110', B'10101110', B'11101110', B'11101110'
- ; DT B'10101100', B'00100010', B'10101000', B'10000010', B'10101010'
- ; DT B'10100100', B'11101110', B'11101110', B'11100010', B'11101110'
- ; DT B'10100100', B'10000010', B'00100010', B'10100010', B'10100010'
- ; DT B'11100100', B'11101110', B'00101110', B'11100010', B'11100010'
- ;---------------------------------------------------;
- SCORE_FONT_END: ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- SERVICE_ARROW_START: ;
- ;---------------------------------------------------;
- ; These are the bitmaps for the 'SERVICE' arrow ;
- ; that shows up next to a score. ;
- ;-----------------------------------------------;
- DT B'00011000' ;
- DT B'00100100' ;
- DT B'01000010' ;
- DT B'00100100' ;
- DT B'00011000' ;
- ;---------------------------------------------------;
- SERVICE_ARROW_END: ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; Title Graphic Scan Line Data ;
- ;---------------------------------------------------;
- TITLE_GRAPHIC_START: ;
- ;---------------------------------------------------;
- ; The first 6x4 lines should be 0 so that the ;
- ; title graphic does not merge with the scores, ;
- ; and for the screen to clear the title properly;
- ;-----------------------------------------------;
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- ;-----------------------------------------------;
- ; The next 42x4 lines contain the title graphic ;
- ;-----------------------------------------------;
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00001111', B'00000000', B'01110000', B'00000000'
- DT B'00001111', B'10000000', B'11111000', B'00000000'
- DT B'00001111', B'10000000', B'11111000', B'00000000'
- DT B'00001000', B'10000000', B'10001000', B'00000000'
- DT B'00001000', B'10000000', B'10001000', B'00000000'
- DT B'00001000', B'10011100', B'10001001', B'11000000'
- DT B'00001111', B'10111110', B'10001011', B'11100000'
- DT B'00001111', B'10111110', B'10001011', B'11100000'
- DT B'00001111', B'00100010', B'10001010', B'00100000'
- DT B'00001000', B'00100010', B'10001010', B'00000000'
- DT B'00001000', B'00100010', B'10001010', B'00000000'
- DT B'00001000', B'00100010', B'10001010', B'01100000'
- DT B'00001000', B'00100010', B'10001010', B'01100000'
- DT B'00001000', B'00100010', B'10001010', B'01100000'
- DT B'00001000', B'00100010', B'10001010', B'00100000'
- DT B'00000000', B'00100010', B'00000010', B'00100000'
- DT B'00000000', B'00100010', B'00000010', B'00100000'
- DT B'00000000', B'00111110', B'00000011', B'11100000'
- DT B'00000000', B'00111110', B'00000011', B'11100000'
- DT B'00000000', B'00011100', B'00000001', B'11000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00011101', B'11011100', B'01110101', B'01110000'
- DT B'00010001', B'01010100', B'00100101', B'01000000'
- DT B'00011001', B'01011000', B'00100111', B'01100000'
- DT B'00010001', B'01010100', B'00100101', B'01000000'
- DT B'00010001', B'11010100', B'00100101', B'01110000'
- DT B'00000000', B'00000000', B'00000000', B'00000000'
- DT B'00001011', B'10111010', B'11101010', B'11100000'
- DT B'00001000', B'10100010', B'10101010', B'10100000'
- DT B'00001011', B'10110010', B'11101110', B'10100000'
- DT B'00001010', B'00100010', B'10100010', B'10100000'
- DT B'00001011', B'10100010', B'11100010', B'11100000'
- ;---------------------------------------------------;
- TITLE_GRAPHIC_END: ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ; COPYRIGHT BANNER Scan Line Data ;
- ;---------------------------------------------------;
- COPYRIGHT_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the COPYRIGHT info ;
- ; "PONG (C)2012 DTI" ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00000111', B'00100010', B'00110000', B'10010010', B'01110011', B'00101110', B'00110011', B'10100000'
- DT B'00000111', B'01110101', B'01110001', B'10111011', B'01110111', B'01101110', B'00111011', B'10100000'
- DT B'00000101', B'01010101', B'01000001', B'00101001', B'00010101', B'01100010', B'00101001', B'00100000'
- DT B'00000111', B'01010101', B'01000001', B'00100001', B'01110101', B'00101110', B'00101001', B'00100000'
- DT B'00000110', B'01010101', B'01010001', B'00100001', B'01110101', B'00101110', B'00101001', B'00100000'
- DT B'00000100', B'01010101', B'01010001', B'00101001', B'01000101', B'00101000', B'00101001', B'00100000'
- DT B'00000100', B'01110101', B'01110001', B'10111011', B'01110111', B'00101110', B'00111001', B'00100000'
- DT B'00000100', B'00100101', B'00100000', B'10010010', B'01110010', B'00101110', B'00110001', B'00100000'
- ;---------------------------------------------------;
- COPYRIGHT_BANNER_END: ;
- ;---------------------------------------------------;
- SOFTWARE1_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the VERSION information;
- ; Part 1 - "SOFTWARE VERSION:" ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'01110010', B'01110111', B'01010100', B'10011001', B'11001010', B'11101100', B'11101001', B'00010000'
- DT B'01110111', B'01110111', B'01010101', B'11011101', B'11001010', B'11101110', B'11101011', B'10111010'
- DT B'01000101', B'01000010', B'01010101', B'01010101', B'00001010', B'10001010', B'10001010', B'10101010'
- DT B'01110101', B'01100010', B'01010101', B'11011001', B'10001010', B'11001100', B'11101010', B'10101000'
- DT B'01110101', B'01100010', B'01010101', B'11011101', B'10001010', B'11001110', B'11101010', B'10101000'
- DT B'00010101', B'01000010', B'01010101', B'01010101', B'00001010', B'10001010', B'00101010', B'10101010'
- DT B'01110111', B'01000010', B'01111101', B'01010101', B'11001110', B'11101010', B'11101011', B'10101010'
- DT B'01110010', B'01000010', B'00101001', B'01010101', B'11000100', B'11101010', B'11101001', B'00101000'
- ;---------------------------------------------------;
- SOFTWARE1_BANNER_END: ;
- ;---------------------------------------------------;
- SOFTWARE2_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the VERSION information;
- ; Part 2 - " V4.04 " ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00000000', B'00000000', B'00000001', B'01010100', B'00100101', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'01010100', B'01110101', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'01010100', B'01010101', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'01011100', B'01010111', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'01011100', B'01010111', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'01000100', B'01010001', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'11000101', B'01110001', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'10000101', B'00100001', B'00000000', B'00000000', B'00000000'
- ;---------------------------------------------------;
- SOFTWARE2_BANNER_END: ;
- ;---------------------------------------------------;
- AUTHOR1_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the AUTHOR information ;
- ; Part 1 - " WRITTEN BY: " ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00000000', B'00000101', B'01011001', B'01110111', B'01110010', B'00110010', B'10000000', B'00000000'
- DT B'00000000', B'00000101', B'01011101', B'01110111', B'01110111', B'00111010', B'10100000', B'00000000'
- DT B'00000000', B'00000101', B'01010101', B'00100010', B'01000101', B'00101010', B'10100000', B'00000000'
- DT B'00000000', B'00000101', B'01011001', B'00100010', B'01100101', B'00110011', B'10000000', B'00000000'
- DT B'00000000', B'00000101', B'01011101', B'00100010', B'01100101', B'00111011', B'10000000', B'00000000'
- DT B'00000000', B'00000101', B'01010101', B'00100010', B'01000101', B'00101001', B'00100000', B'00000000'
- DT B'00000000', B'00000111', B'11010101', B'00100010', B'01110101', B'00111001', B'00100000', B'00000000'
- DT B'00000000', B'00000010', B'10010101', B'00100010', B'01110101', B'00110001', B'00000000', B'00000000'
- ;---------------------------------------------------;
- AUTHOR1_BANNER_END: ;
- ;---------------------------------------------------;
- AUTHOR2_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the AUTHOR information ;
- ; Part 2 - "TIMOTHY S. CARLSON" ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'01110100', B'10100010', B'01110101', B'01010011', B'10000010', B'00100110', B'01001110', B'01000100'
- DT B'01110101', B'11110111', B'01110101', B'01010011', B'10000111', B'01110111', B'01001110', B'11101110'
- DT B'00100101', B'01010101', B'00100101', B'01010010', B'00000101', B'01010101', B'01001000', B'10101010'
- DT B'00100101', B'01010101', B'00100111', B'01110011', B'10000100', B'01110110', B'01001110', B'10101010'
- DT B'00100101', B'01010101', B'00100111', B'00100011', B'10000100', B'01110111', B'01001110', B'10101010'
- DT B'00100101', B'01010101', B'00100101', B'00100000', B'10000101', B'01010101', B'01000010', B'10101010'
- DT B'00100101', B'01010111', B'00100101', B'00100011', B'10100111', B'01010101', B'01101110', B'11101010'
- DT B'00100101', B'01010010', B'00100101', B'00100011', B'10100010', B'01010101', B'01101110', B'01001010'
- ;---------------------------------------------------;
- AUTHOR2_BANNER_END: ;
- ;---------------------------------------------------;
- EMAIL1_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the EMAIL information ;
- ; Part 1 - " EMAIL: " ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00000000', B'00000000', B'00000011', B'10010100', B'01001010', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000011', B'10111110', B'11101010', B'01000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000010', B'00101010', B'10101010', B'01000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000011', B'00101010', B'11101010', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000011', B'00101010', B'11101010', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000010', B'00101010', B'10101010', B'01000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000011', B'10101010', B'10101011', B'01000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000011', B'10101010', B'10101011', B'00000000', B'00000000', B'00000000'
- ;---------------------------------------------------;
- EMAIL1_BANNER_END: ;
- ;---------------------------------------------------;
- EMAIL2_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the EMAIL information ;
- ; Part 2 - "TSCARLSON AT GMAIL" ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'01110111', B'00100010', B'01100100', B'11100100', B'01000010', B'11100011', B'00101000', B'10010100'
- DT B'01110111', B'01110111', B'01110100', B'11101110', B'11100111', B'11100111', B'01111101', B'11010100'
- DT B'00100100', B'01010101', B'01010100', B'10001010', B'10100101', B'01000100', B'01010101', B'01010100'
- DT B'00100111', B'01000111', B'01100100', B'11101010', B'10100111', B'01000101', B'01010101', B'11010100'
- DT B'00100111', B'01000111', B'01110100', B'11101010', B'10100111', B'01000101', B'01010101', B'11010100'
- DT B'00100001', B'01010101', B'01010100', B'00101010', B'10100101', B'01000101', B'01010101', B'01010100'
- DT B'00100111', B'01110101', B'01010100', B'11101110', B'10100101', B'01000111', B'01010101', B'01010110'
- DT B'00100111', B'00100101', B'01010110', B'11100100', B'10100101', B'01000010', B'01010101', B'01010110'
- ;---------------------------------------------------;
- EMAIL2_BANNER_END: ;
- ;---------------------------------------------------;
- WEBSITE1_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the WEBSITE information;
- ; Part 1 - " WEBSITE: " ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00000000', B'00000000', B'01010101', B'11011001', B'11010111', B'01110000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'01010101', B'11011101', B'11010111', B'01110100', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'01010101', B'00010101', B'00010010', B'01000100', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'01010101', B'11011001', B'11010010', B'01100000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'01010101', B'11011101', B'11010010', B'01100000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'01010101', B'00010100', B'01010010', B'01000100', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'01111101', B'11011101', B'11010010', B'01110100', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00101001', B'11011001', B'11010010', B'01110000', B'00000000', B'00000000'
- ;---------------------------------------------------;
- WEBSITE1_BANNER_END: ;
- ;---------------------------------------------------;
- WEBSITE2_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the WEBSITE information;
- ; Part 2 - " WWW. " ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00000000', B'00000000', B'00000001', B'01010101', B'01010101', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'01010101', B'01010101', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'01010101', B'01010101', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'01010101', B'01010101', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'01010101', B'01010101', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'01010101', B'01010101', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000001', B'11110111', B'11011111', B'01000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'10100010', B'10001010', B'01000000', B'00000000', B'00000000'
- ;---------------------------------------------------;
- WEBSITE2_BANNER_END: ;
- ;---------------------------------------------------;
- WEBSITE3_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the WEBSITE information;
- ; Part 3 - " DYSFUNCTIONAL " ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00000000', B'11001010', B'11101110', B'10100100', B'01001110', B'10010001', B'00010010', B'00000000'
- DT B'00000000', B'11101010', B'11101110', B'10101110', B'11101110', B'10111011', B'10111010', B'00000000'
- DT B'00000000', B'10101010', B'10001000', B'10101010', B'10100100', B'10101010', B'10101010', B'00000000'
- DT B'00000000', B'10101110', B'11101100', B'10101010', B'10000100', B'10101010', B'10111010', B'00000000'
- DT B'00000000', B'10101110', B'11101100', B'10101010', B'10000100', B'10101010', B'10111010', B'00000000'
- DT B'00000000', B'10100100', B'00101000', B'10101010', B'10100100', B'10101010', B'10101010', B'00000000'
- DT B'00000000', B'11100100', B'11101000', B'11101010', B'11100100', B'10111010', B'10101011', B'00000000'
- DT B'00000000', B'11000100', B'11101000', B'01001010', B'01000100', B'10010010', B'10101011', B'00000000'
- ;---------------------------------------------------;
- WEBSITE3_BANNER_END: ;
- ;---------------------------------------------------;
- WEBSITE4_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the WEBSITE information;
- ; Part 4 - " TECHNOLOGIES " ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00000000', B'01110111', B'00100101', B'00100010', B'01000100', B'01101011', B'10111000', B'00000000'
- DT B'00000000', B'01110111', B'01110101', B'01110111', B'01001110', B'11101011', B'10111000', B'00000000'
- DT B'00000000', B'00100100', B'01010101', B'01010101', B'01001010', B'10001010', B'00100000', B'00000000'
- DT B'00000000', B'00100110', B'01000111', B'01010101', B'01001010', B'10001011', B'00111000', B'00000000'
- DT B'00000000', B'00100110', B'01000111', B'01010101', B'01001010', B'10101011', B'00111000', B'00000000'
- DT B'00000000', B'00100100', B'01010101', B'01010101', B'01001010', B'10101010', B'00001000', B'00000000'
- DT B'00000000', B'00100111', B'01110101', B'01010111', B'01101110', B'11101011', B'10111000', B'00000000'
- DT B'00000000', B'00100111', B'00100101', B'01010010', B'01100100', B'01001011', B'10111000', B'00000000'
- ;---------------------------------------------------;
- WEBSITE4_BANNER_END: ;
- ;---------------------------------------------------;
- WEBSITE5_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the WEBSITE information;
- ; Part 5 - " .COM " ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00000000', B'00000000', B'00000000', B'00010001', B'00010100', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00111011', B'10111110', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00101010', B'10101010', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00100010', B'10101010', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00100010', B'10101010', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'00101010', B'10101010', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'10111011', B'10101010', B'00000000', B'00000000', B'00000000'
- DT B'00000000', B'00000000', B'00000000', B'10010001', B'00101010', B'00000000', B'00000000', B'00000000'
- ;---------------------------------------------------;
- WEBSITE5_BANNER_END: ;
- ;---------------------------------------------------;
- OPTION1_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the OPTION information ;
- ; Part 1 - " GAMEPLAY OPTIONS:" ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00110010', B'00101001', B'11011001', B'00010010', B'10001001', B'10011101', B'00100010', B'01110000'
- DT B'01110111', B'01111101', B'11011101', B'00111010', B'10011101', B'11011101', B'01110111', B'01110100'
- DT B'01000101', B'01010101', B'00010101', B'00101010', B'10010101', B'01001001', B'01010101', B'01000100'
- DT B'01010111', B'01010101', B'10011101', B'00111011', B'10010101', B'11001001', B'01010101', B'01110000'
- DT B'01010111', B'01010101', B'10011001', B'00111011', B'10010101', B'10001001', B'01010101', B'01110000'
- DT B'01010101', B'01010101', B'00010001', B'00101001', B'00010101', B'00001001', B'01010101', B'00010100'
- DT B'01110101', B'01010101', B'11010001', B'10101001', B'00011101', B'00001001', B'01110101', B'01110100'
- DT B'00100101', B'01010101', B'11010001', B'10101001', B'00001001', B'00001001', B'00100101', B'01110000'
- ;---------------------------------------------------;
- OPTION1_BANNER_END: ;
- ;---------------------------------------------------;
- OPTION2_BANNER_START: ;
- ;---------------------------------------------------;
- ; this is the bitmap for the OPTION information ;
- ; Part 2 - Option 1 - " HUMAN VS. HUMAN " ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00001010', B'10100101', B'00010001', B'00010101', B'11000010', B'10101001', B'01000100', B'01000000'
- DT B'00001010', B'10101111', B'10111011', B'10010101', B'11000010', B'10101011', B'11101110', B'11100000'
- DT B'00001010', B'10101010', B'10101010', B'10010101', B'00000010', B'10101010', B'10101010', B'10100000'
- DT B'00001110', B'10101010', B'10111010', B'10010101', B'11000011', B'10101010', B'10101110', B'10100000'
- DT B'00001110', B'10101010', B'10111010', B'10010101', B'11000011', B'10101010', B'10101110', B'10100000'
- DT B'00001010', B'10101010', B'10101010', B'10010100', B'01000010', B'10101010', B'10101010', B'10100000'
- DT B'00001010', B'11101010', B'10101010', B'10011101', B'11010010', B'10111010', B'10101010', B'10100000'
- DT B'00001010', B'11101010', B'10101010', B'10001001', B'11010010', B'10111010', B'10101010', B'10100000'
- ;-----------------------------------------------;
- ; this is the bitmap for the OPTION information ;
- ; Part 2 - Option 2 - "HUMAN VS. 12F1840 " ;
- ; 64x8 pixels ;
- ;-----------------------------------------------;
- DT B'00001010', B'10100101', B'00010001', B'00010101', B'11000010', B'11101110', B'10010010', B'10010000'
- DT B'00001010', B'10101111', B'10111011', B'10010101', B'11000010', B'11101110', B'10111010', B'10111000'
- DT B'00001010', B'10101010', B'10101010', B'10010101', B'00000010', B'00101000', B'10101010', B'10101000'
- DT B'00001110', B'10101010', B'10111010', B'10010101', B'11000010', B'11101100', B'10010011', B'10101000'
- DT B'00001110', B'10101010', B'10111010', B'10010101', B'11000010', B'11101100', B'10111011', B'10101000'
- DT B'00001010', B'10101010', B'10101010', B'10010100', B'01000010', B'10001000', B'10101000', B'10101000'
- DT B'00001010', B'11101010', B'10101010', B'10011101', B'11010010', B'11101000', B'10111000', B'10111000'
- DT B'00001010', B'11101010', B'10101010', B'10001001', B'11010010', B'11101000', B'10010000', B'10010000'
- ;---------------------------------------------------;
- OPTION2_BANNER_END: ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
- END ;
- ;---------------------------------------------------;
- ;---------------------------------------------------;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement