From: Lukas Krickl Date: Thu, 10 Apr 2025 11:05:04 +0000 (+0200) Subject: player: stub for building buildigs X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=9518d4ee5ee49876d5672a4f01cd024389958cf0;p=gbrg%2F.git player: stub for building buildigs --- diff --git a/src/player.s b/src/player.s index aa75cb0..3330c89 100644 --- a/src/player.s +++ b/src/player.s @@ -151,6 +151,16 @@ handle_inputs: ld bc, st_ui_building_selector ret @not_select: + + input_just BTNA + jr z, @not_a REL + + ; place tile at cursor position + call cursor_place_tile + + ldnull bc + ret +@not_a: @done: ldnull bc ret @@ -203,3 +213,10 @@ try_abort_move_at: ld a, [hl] cp a, b ret + + ; places the current selection + ; at cursor_y/x + ; aborts if the tiel will not fit +cursor_place_tile: + + ret diff --git a/src/simulation.s b/src/simulation.s index fb84203..eb0d470 100644 --- a/src/simulation.s +++ b/src/simulation.s @@ -6,14 +6,6 @@ ; increments cell_idx every iteration ; resets cell_idx to 0 when end of cells is reached sim_update: - ld a, 0 ; max loop counter - - ; load back cell ptr from last iteration - ld a, [cell_ptr] - ld e, a - ld a, [cell_ptr+1] - ld d, a - ; TODO ; for now we just iterate all ; cells in a single go @@ -31,11 +23,5 @@ sim_update: ld a, state_cells_end HI cp a, d jp nz, @loop - - ; finally store cell ptr - ld e, a - ld [cell_ptr], a - ld d, a - ld [cell_ptr+1], a ret