handle multi-line comments
This commit is contained in:
109
src/main.asm
109
src/main.asm
@@ -10,9 +10,9 @@ include init
|
||||
|
||||
call drawing.draw_whole_map
|
||||
|
||||
;
|
||||
; State initialization
|
||||
;
|
||||
/*
|
||||
State initialization
|
||||
*/
|
||||
; Robot
|
||||
const robot_initial_x = 1
|
||||
const robot_initial_y = 1
|
||||
@@ -51,9 +51,9 @@ mov r3, sprites.rotation_0
|
||||
mov r4, sprites.ghost
|
||||
call drawing.draw_sprite_at_map_coord
|
||||
|
||||
;
|
||||
; Time initialization
|
||||
;
|
||||
/*
|
||||
Time initialization
|
||||
*/
|
||||
add r1, zr, ptr.tick_duration_low
|
||||
load_32 r2, [r1]
|
||||
add r1, zr, ptr.tick_duration_high
|
||||
@@ -74,13 +74,13 @@ add r1, zr, ptr.next_tick_high
|
||||
store_32 [r1], r5
|
||||
|
||||
game_loop:
|
||||
;
|
||||
; Event handling
|
||||
;
|
||||
; r1 = keyboard event+key / direction
|
||||
; r2 = keyboard key / direction address
|
||||
; r3 = keyboard event
|
||||
; r4 = jump address
|
||||
/* Event handling
|
||||
|
||||
r1 = keyboard event+key / direction
|
||||
r2 = keyboard key / direction address
|
||||
r3 = keyboard event
|
||||
r4 = jump address
|
||||
*/
|
||||
keyboard r1
|
||||
and r2, r1, keyboard.mask_key
|
||||
and r3, r1, keyboard.mask_event
|
||||
@@ -109,7 +109,7 @@ game_loop:
|
||||
jmp game_loop_event_handling_store_direction
|
||||
; key_left:
|
||||
mov r1, game.direction_left
|
||||
; jmp game_loop_event_handling_end
|
||||
;jmp game_loop_event_handling_end
|
||||
|
||||
game_loop_event_handling_store_direction:
|
||||
add r2, zr, ptr.state_robot
|
||||
@@ -118,15 +118,14 @@ game_loop:
|
||||
|
||||
game_loop_event_handling_end:
|
||||
|
||||
;
|
||||
; Elapsed time check
|
||||
;
|
||||
; r1: address
|
||||
; r2: now low / delay low
|
||||
; r3: now high / delay high
|
||||
; r4: next tick low
|
||||
; r5: next tick high
|
||||
;
|
||||
/* Elapsed time check
|
||||
|
||||
r1: address
|
||||
r2: now low / delay low
|
||||
r3: now high / delay high
|
||||
r4: next tick low
|
||||
r5: next tick high
|
||||
*/
|
||||
time_0 r2
|
||||
time_1 r3
|
||||
|
||||
@@ -159,18 +158,18 @@ game_loop:
|
||||
store_32 [r1], r5
|
||||
|
||||
|
||||
;
|
||||
; Robot movement
|
||||
;
|
||||
; r1 = robot's state address
|
||||
; r2 = x
|
||||
; r3 = y
|
||||
; r4 = direction
|
||||
; r5 = new x
|
||||
; r6 = new y
|
||||
; r7 = new position address
|
||||
; r8 = new position content
|
||||
; r9 = jump address
|
||||
/* Robot movement
|
||||
|
||||
r1 = robot's state address
|
||||
r2 = x
|
||||
r3 = y
|
||||
r4 = direction
|
||||
r5 = new x
|
||||
r6 = new y
|
||||
r7 = new position address
|
||||
r8 = new position content
|
||||
r9 = jump address
|
||||
*/
|
||||
add r1, zr, ptr.state_robot
|
||||
load_8 r2, [r1]
|
||||
add r1, r1, 1
|
||||
@@ -209,9 +208,9 @@ game_loop:
|
||||
mov r7, r13
|
||||
pop r2
|
||||
|
||||
;
|
||||
; Collision handling
|
||||
;
|
||||
/*
|
||||
Collision handling
|
||||
*/
|
||||
load_8 r8, [r7]
|
||||
cmp r8, map.tiles.wall
|
||||
jne game_loop_robot_movement_some
|
||||
@@ -249,20 +248,20 @@ game_loop:
|
||||
|
||||
game_loop_robot_movement_none:
|
||||
|
||||
;
|
||||
; Ghost movement
|
||||
;
|
||||
; r1: ghost's state address
|
||||
; r2: x
|
||||
; r3: y
|
||||
; r4: direction
|
||||
; r5: x increment
|
||||
; r6: y increment
|
||||
; r7: new x
|
||||
; r8: new y
|
||||
; r9: new position address
|
||||
; r10: new position content
|
||||
; r11: jump address
|
||||
/* Ghost movement
|
||||
|
||||
r1: ghost's state address
|
||||
r2: x
|
||||
r3: y
|
||||
r4: direction
|
||||
r5: x increment
|
||||
r6: y increment
|
||||
r7: new x
|
||||
r8: new y
|
||||
r9: new position address
|
||||
r10: new position content
|
||||
r11: jump address
|
||||
*/
|
||||
add r1, zr, ptr.state_ghost
|
||||
load_8 r2, [r1]
|
||||
add r1, r1, 1
|
||||
@@ -331,9 +330,9 @@ game_loop:
|
||||
mov r4, sprites.ghost
|
||||
call drawing.draw_sprite_at_map_coord
|
||||
|
||||
;
|
||||
; Check ahead for direction change
|
||||
;
|
||||
/*
|
||||
Check ahead for direction change
|
||||
*/
|
||||
add r1, r7, r5
|
||||
add r2, r8, r6
|
||||
call game.get_tile_address_from_map_coord
|
||||
|
||||
Reference in New Issue
Block a user