From: Lukas Krickl Date: Sun, 4 May 2025 13:25:41 +0000 (+0200) Subject: defs: Added new actor tables X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=345ed8f87084ace7c515d8ed592b2b9a982c35d8;p=gbrg%2F.git defs: Added new actor tables Also removed more dead code --- diff --git a/src/defs.s b/src/defs.s index 4f43bbd..63080d5 100644 --- a/src/defs.s +++ b/src/defs.s @@ -7,8 +7,7 @@ #define WRAM 0xC000 #define WRAMLEN 0xFFF - ; max update calls per frame -#define SIM_UPDATE_MAX 8 +#define UNITS_MAX 8 #define STACK_BEGIN 0xDFFF diff --git a/src/player.s b/src/player.s index 3be7e8f..bec7b87 100644 --- a/src/player.s +++ b/src/player.s @@ -54,25 +54,6 @@ player_draw_cursor: ld a, CURSOR_TILE ld [hl+], a - xor a, a - ld [hl+], a - - ; preview tile - ld hl, PLAYER_SPRITE1+oamsize - - ld a, [cursor_y] - add a, OBJ_OFF_Y - sub a, b - ld [hl+], a - - ld a, [cursor_x] - add a, OBJ_OFF_X - sub a, c - ld [hl+], a - - ld a, [cursor_preview_tile] - ld [hl+], a - xor a, a ld [hl+], a diff --git a/src/wram.s b/src/wram.s index b629f86..fb71539 100644 --- a/src/wram.s +++ b/src/wram.s @@ -11,21 +11,13 @@ curr_inputs: .adv 1 ; previous frame's inputs prev_inputs: .adv 1 - ; ui index -ui_cursor_pos: .adv 1 - game_mode: .adv st_size - ; cursor state -cursor_state: .adv st_size -cursor_preview_tile: .adv 1 - - ; selected building state -building_state: .adv st_size - ; actors ; actors are state machines ; they get updated once a frame + ; actor player is a simple cursor + ; that has deploymnet control actor_player: .adv act_size ; offset into bg_update_queue @@ -61,16 +53,12 @@ scroll_x: .adv 1 ; initiative resource ; allows deployment or special moves -r_init: .adv 1 - - ; current cell index - ; for cell update loop - ; big endian -sim_cell_ptr: .adv 2 - - ; cell screen ptr - ; points to tile that this cell owns -sim_cell_screen_ptr: .adv 2 +r_p0_init: .adv 1 +r_p1_init: .adv 1 + +; units for p0 and p1 +p0_units: .adv act_size * UNITS_MAX +p1_units: .adv act_size * UNITS_MAX state_cells: .adv c_size * MAP_SIZE state_cells_end: