.nolist #define EQU .equ #include "ti83asm.inc" #include "tokens.inc" #define xcoord 8270h #define ycoord 8271h #define oldxcoord 8272h #define oldycoord 8273h #define tub_index 8275h .list .org 9327h START: ; Turn the indicator to off and clear screen call RINDOFF ; Turn off runindicator call BUFCLR call TITLE_INIT call TITLE_PRINT ; Le menu ecran_de_selection: call MENU_INIT call MENU_PRINT call INIT call PLAYER_INIT call fastCopy call WAITKEY ; Le jeu loop: call SCROLLSTEP call MOVE_SCAN_KEY call PLAYER_PRINT call fastCopy call CHECK_COLLISION ; Tester si on a perdu ld a, (perdu) or a jp nz, transition_perdu ; Tester si on a gagne ld a, (duree_level) or a jp z, transition_gagne jp loop fin_jeu: ret .end end ; Ce qu'il se passe lorsqu'on arrive à la fin d'un niveau ou qu'on perd transition_gagne: ld a, 00000000b call SCROLL_BYTE_EFFECT ld l,10 ld h,30 ld (pencol),hl ld hl, tu_as_gagne call _vputs tg_attendre: ld a,$FF ; Before any action, reset the keyport out (1),a ; ...by sending to the port 1 the value 255 (FF ld a,$FD ; select the keyboard group to scan (here the arrow keys) out (1),a ; ...by sending to the keyboard port (1) the value FE. in a,(1) ; Get the port value, which says wich keys was pressed cp 254 ;\ jp nz, tg_attendre ;| jp ecran_de_selection transition_perdu: ld a, 11111111b call SCROLL_BYTE_EFFECT ld a, 00000000b call SCROLL_BYTE_EFFECT ld l,10 ld h,30 ld (pencol),hl ld hl, tu_as_perdu call _vputs tp_attendre: ld a,$FF ; Before any action, reset the keyport out (1),a ; ...by sending to the port 1 the value 255 (FF ld a,$FD ; select the keyboard group to scan (here the arrow keys) out (1),a ; ...by sending to the keyboard port (1) the value FE. in a,(1) ; Get the port value, which says wich keys was pressed cp 254 ;\ jp nz, tp_attendre ;| jp ecran_de_selection tu_as_gagne: .db " Well done... Press enter ", 0 tu_as_perdu: .db " You lose... Press enter ", 0 #include "title.asm" #include "menu.asm" #include "level.asm" #include "drawspr.asm" #include "scroll.asm" #include "move.asm"