Question: i have this project but it is not working as its supposed to be all i get is a green screen and then the two
i have this project but it is not working as its supposed to be all i get is a green screen and then the two sprites on a fixed postions here is my original description i have this project which is in assembly x86, ran on a platform made by our faculty. This is my last years project but this year i need to change it. I need your help to remake this one. My idea is instead of the board to have random ascii symbopls lets say hearts and circles that 2 of them(hearts) will fall vertically. and instead of the sprite circle make it a rectangle that will go left and right to catch the falling hearts. all three hearts drop after 3seconds, if you catch them alll win if not lose. also display the points in th keyboard section using keyboard intterupts. we are working in a x16 assebmmbly but platfrom is made by the university. here is a pic of the current img
JMP main JMP isr
;vars vsync: DW 0 stop_game: DW 0 move_left: DW 0 move_right: DW 0 catch: DW 0 score: DB 0
heart_x: DB 60 heart_y: DB 0 paddle_x: DB 60
;ir's isr: PUSH A IN 1 CMP A, 1 JE keyboard MOV [vsync], 1 JMP iret
keyboard: IN 6 CMPB AL, 'a' JNE check_d MOV [move_left], 1 JMP exit_keyboard
check_d: CMPB AL, 'd' JNE check_q MOV [move_right], 1 JMP exit_keyboard
check_q: CMPB AL, 'q' JNE iret MOV [stop_game], 1
exit_keyboard: MOV A, 1
iret: OUT 2 POP A IRET
; wait_next_frame wait_next_frame: PUSH A wait_loop: MOV A, [vsync] CMP A, 0 JE wait_loop MOV [vsync], 0 POP A RET
;draw_heart draw_heart: MOV A, 0xA306 OUT 8 MOV A, 0x0304 ; pink heart OUT 9
MOV A, 0xA308 OUT 8 MOV A, 0x5500 OUT 9 RET
;draw_paddle draw_paddle: MOV A, 0xA30A ; Paddle sprite ID OUT 8 MOV A, 0xFFF9 ; Blue paddle color OUT 9
MOV A, 0xA30C ; Paddle position register OUT 8 MOV A, 0x88F0 OUT 9 RET
;check_catch check_catch: ; Heart_y near 110 MOVB AL, [heart_y] CMPB AL, 110 JNE no_catch
; Heart_x within paddle_x 6 MOVB AH, [heart_x] MOVB BL, [paddle_x] SUBB BL, 6 CMPB AH, BL JB no_catch ADD B, 12 CMPB AH, BL JA no_catch
MOV B, [heart_y] INC B MOV [heart_y], B
no_catch: RET
main: MOV SP, 0x0FFF
; Set graphics mode MOV A, 1 OUT 7 MOV A, 0xA300 OUT 8 MOV A, 0x99 OUT 9
; Enable graphics interrupts MOV A, 5 OUT 0 STI
game_loop: ; Move paddle MOV B, [move_left] CMP B, 1 JNE check_right MOV B, [paddle_x] CMP B, 4 JBE reset_left SUB B, 4 MOV [paddle_x], B reset_left: MOV [move_left], 0
check_right: MOV B, [move_right] CMP B, 1 JNE move_heart MOV B, [paddle_x] CMP B, 116 JAE reset_right ADD B, 4 MOV [paddle_x], B reset_right: MOV [move_right], 0
move_heart: ; erase heart (optional: draw bg color over previous pos) ; Move heart down MOVB AL, [heart_y] ADDB AL, 4 MOVB [heart_y], AL CMPB AL, 120 JBE continue_fall
; Reset heart position MOV [heart_y], 0 MOVB AL, [heart_x] ADDB AL, 7 CMPB AL, 116 JBE keep_new MOVB AL, 20 keep_new: MOVB [heart_x], AL
; Check catch CALL check_catch
continue_fall: CALL draw_heart CALL draw_paddle CALL wait_next_frame
MOV A, [stop_game] CMP A, 1 JNE game_loop
game_over: HLT

Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
