gbrg/.git
2 months agomap: fixed map_get_tile
Lukas Krickl [Wed, 18 Jun 2025 12:22:07 +0000 (14:22 +0200)]
map: fixed map_get_tile

This function incorrectly added y-offsets for y=0.

2 months agounit: Added a new _fast version of delay to active
Lukas Krickl [Tue, 17 Jun 2025 03:30:21 +0000 (05:30 +0200)]
unit: Added a new _fast version of delay to active

This state is intended for CPU units because they do not need an input
delay to make gameplay feel better.

2 months agorefactor: Removed legacy cursor code
Lukas Krickl [Tue, 17 Jun 2025 03:26:55 +0000 (05:26 +0200)]
refactor: Removed legacy cursor code

This code was mostly deprecated.
This includes all old cursor code in player.s as well as the update
states and game modes related to cursors.

For testing purposes the base map with demo actors loads directly now.
The cursor code luckily was not used outside its own module anymore.

2 months agounit display: removed cursor around active unit
Lukas Krickl [Tue, 17 Jun 2025 03:16:03 +0000 (05:16 +0200)]
unit display: removed cursor around active unit

Player units are not drawn with x-flip.

2 months agoui: fixed moves max still being read from memory in ui update
Lukas Krickl [Tue, 17 Jun 2025 02:40:02 +0000 (04:40 +0200)]
ui: fixed moves max still being read from memory in ui update

3 months agounit: reworked moves stat to have the max calculated
Lukas Krickl [Mon, 16 Jun 2025 04:49:23 +0000 (06:49 +0200)]
unit: reworked moves stat to have the max calculated

removed initiative stat. This stat will be calculated entierly based on
other stats in the future

3 months agoTODO: updated todo
Lukas Krickl [Sun, 15 Jun 2025 10:51:41 +0000 (12:51 +0200)]
TODO: updated todo

3 months agoTODO: Added todo note
Lukas Krickl [Sat, 14 Jun 2025 02:12:11 +0000 (04:12 +0200)]
TODO: Added todo note

3 months agounit: Added docs for equipment and inventory
Lukas Krickl [Fri, 13 Jun 2025 11:42:32 +0000 (13:42 +0200)]
unit: Added docs for equipment and inventory

3 months agostats: reworked stats to save memory
Lukas Krickl [Fri, 13 Jun 2025 04:03:45 +0000 (06:03 +0200)]
stats: reworked stats to save memory

3 months agounit: Added new stats
Lukas Krickl [Tue, 10 Jun 2025 18:41:11 +0000 (20:41 +0200)]
unit: Added new stats

3 months agounit: Added stub for attributes
Lukas Krickl [Sun, 8 Jun 2025 20:09:08 +0000 (22:09 +0200)]
unit: Added stub for attributes

Attributes will be additions to stats such as weapon skills

3 months agounit: added basic random move cpu state
Lukas Krickl [Sun, 8 Jun 2025 15:09:08 +0000 (17:09 +0200)]
unit: added basic random move cpu state

3 months agounits: removed p1 units. All units are now kept in the same table
Lukas Krickl [Sun, 8 Jun 2025 08:58:16 +0000 (10:58 +0200)]
units: removed p1 units. All units are now kept in the same table

3 months agounit: Added individual dice display to each unit
Lukas Krickl [Sun, 8 Jun 2025 05:52:52 +0000 (07:52 +0200)]
unit: Added individual dice display to each unit

3 months agounit: Added level and placeholders for dice display
Lukas Krickl [Fri, 6 Jun 2025 04:06:30 +0000 (06:06 +0200)]
unit: Added level and placeholders for dice display

3 months agoUpdated TODO
Lukas Krickl [Fri, 6 Jun 2025 03:19:49 +0000 (05:19 +0200)]
Updated TODO

3 months agoUpdted todo
Lukas Krickl [Thu, 5 Jun 2025 16:32:30 +0000 (18:32 +0200)]
Updted todo

3 months agodice display: Added dice display for units
Lukas Krickl [Thu, 5 Jun 2025 16:25:12 +0000 (18:25 +0200)]
dice display: Added dice display for units

This change exposed a bug in the UI update code. UI updats need to draw
tiles which should actually happen in vblank.
UI updates where they are now should simply schedule a vblank update in
the future.

3 months agodice: wip dice display
Lukas Krickl [Thu, 5 Jun 2025 07:18:09 +0000 (09:18 +0200)]
dice: wip dice display

3 months agobank8800: Added dice assets
Lukas Krickl [Wed, 4 Jun 2025 13:41:12 +0000 (15:41 +0200)]
bank8800: Added dice assets

3 months agoTODO: updated todo list
Lukas Krickl [Sun, 1 Jun 2025 14:09:50 +0000 (16:09 +0200)]
TODO: updated todo list

3 months agotext: added status text stub
Lukas Krickl [Sun, 1 Jun 2025 09:51:16 +0000 (11:51 +0200)]
text: added status text stub

3 months agounit: Added a roll to initiative.
Lukas Krickl [Sun, 1 Jun 2025 06:40:15 +0000 (08:40 +0200)]
unit: Added a roll to initiative.

3 months agorand: Added helper for d16 rolls
Lukas Krickl [Sun, 1 Jun 2025 06:16:21 +0000 (08:16 +0200)]
rand: Added helper for d16 rolls

3 months agounit: Added basic collision check to move code
Lukas Krickl [Sat, 31 May 2025 16:11:40 +0000 (18:11 +0200)]
unit: Added basic collision check to move code

This change introduces a bug that prevents a unit from moving to the
very last tile of a map :^)

3 months agoeffect: added effect definition for all units
Lukas Krickl [Sat, 31 May 2025 03:39:17 +0000 (05:39 +0200)]
effect: added effect definition for all units

3 months agodefs: Added placeholder macros for unit inventory equipment and effects
Lukas Krickl [Fri, 30 May 2025 12:51:32 +0000 (14:51 +0200)]
defs: Added placeholder macros for unit inventory equipment and effects

3 months agounit: added more stats to each unit
Lukas Krickl [Fri, 30 May 2025 12:39:37 +0000 (14:39 +0200)]
unit: added more stats to each unit

3 months agomap: wip get tile sub routine
Lukas Krickl [Tue, 27 May 2025 17:57:06 +0000 (19:57 +0200)]
map: wip get tile sub routine

3 months agomap: added unit_get_tile subroutine
Lukas Krickl [Sun, 25 May 2025 16:49:09 +0000 (18:49 +0200)]
map: added unit_get_tile subroutine

This commit also reverts some of the map script changes made in the last
commit

3 months agomap: added ptr to map tile flags to map converter
Lukas Krickl [Sun, 25 May 2025 15:37:03 +0000 (17:37 +0200)]
map: added ptr to map tile flags to map converter

3 months agoSTORY: Added basic plot
Lukas Krickl [Sun, 25 May 2025 10:56:26 +0000 (12:56 +0200)]
STORY: Added basic plot

3 months agounit: Refactored act def macros to allow for more future stats
Lukas Krickl [Sun, 25 May 2025 06:22:24 +0000 (08:22 +0200)]
unit: Refactored act def macros to allow for more future stats

3 months agounit: Added oam flag setter to idle/active
Lukas Krickl [Sat, 24 May 2025 16:24:21 +0000 (18:24 +0200)]
unit: Added oam flag setter to idle/active

3 months agosys: Added farcall sys call
Lukas Krickl [Sat, 24 May 2025 15:29:59 +0000 (17:29 +0200)]
sys: Added farcall sys call

3 months agounit: draw now uses actor's tile and oam flags
Lukas Krickl [Sat, 24 May 2025 15:26:23 +0000 (17:26 +0200)]
unit: draw now uses actor's tile and oam flags

3 months agounit: Added tile and oam flags to default actor model
Lukas Krickl [Sat, 24 May 2025 06:56:43 +0000 (08:56 +0200)]
unit: Added tile and oam flags to default actor model

3 months agoupdated tileset
Lukas Krickl [Sat, 24 May 2025 06:40:44 +0000 (08:40 +0200)]
updated tileset

3 months agoupdated default unit tile
Lukas Krickl [Sat, 24 May 2025 05:28:13 +0000 (07:28 +0200)]
updated default unit tile

3 months agounit: fixed end turn being delayed if inputs are held
Lukas Krickl [Fri, 23 May 2025 03:57:45 +0000 (05:57 +0200)]
unit: fixed end turn being delayed if inputs are held

3 months agounits: Draw calls are not done outside of the state machine
Lukas Krickl [Thu, 22 May 2025 03:25:27 +0000 (05:25 +0200)]
units: Draw calls are not done outside of the state machine

This allows drawing to continue even if the unit state is awaiting
an idle state.
It also allows states to be shared between units more easily.

3 months agounit: implemented a temporary fix for unit redrawing failing
Lukas Krickl [Wed, 21 May 2025 16:23:22 +0000 (18:23 +0200)]
unit: implemented a temporary fix for unit redrawing failing

This fix currently pauses all obj updates while a unit is moving.
This is not a great solution and will need to be addressed properly
later.

State machine transitions are causing unit redraws to not happen.
Maybe a proper solution would be to have a few sprites for units in
motion that are not affected by the regular unit updates.

3 months agounit: working on fixing sprite flickering when moving
Lukas Krickl [Wed, 21 May 2025 15:58:02 +0000 (17:58 +0200)]
unit: working on fixing sprite flickering when moving

3 months agounit: Fixed unit switching interrupting the last move
Lukas Krickl [Wed, 21 May 2025 03:41:26 +0000 (05:41 +0200)]
unit: Fixed unit switching interrupting the last move

Unit switching is now requrested by the idle state

3 months agounit: made unit switching more user friendly
Lukas Krickl [Tue, 20 May 2025 16:32:01 +0000 (18:32 +0200)]
unit: made unit switching more user friendly

This change simply delays the switch for a few frames

3 months agounit: unit swapping now seems to work correctly
Lukas Krickl [Tue, 20 May 2025 16:10:37 +0000 (18:10 +0200)]
unit: unit swapping now seems to work correctly

Unit moves were not being reset correctly

3 months agounit: improved unit switching
Lukas Krickl [Tue, 20 May 2025 16:03:11 +0000 (18:03 +0200)]
unit: improved unit switching

Unit switching now forces the current unti to sleep and the new unit to
wake up.

Unit switching now is controlled by a flag and done in the gameplay
update loop.

3 months agounit: units now mark the correct unit as active
Lukas Krickl [Tue, 20 May 2025 13:16:27 +0000 (15:16 +0200)]
unit: units now mark the correct unit as active

3 months agowip: unit switching bugfixing
Lukas Krickl [Tue, 20 May 2025 12:53:22 +0000 (14:53 +0200)]
wip: unit switching bugfixing

The switching code is still broken, but now at least the correct init
value and actor ptr are stored by the end :^)

3 months agounit: wip unit selector
Lukas Krickl [Tue, 20 May 2025 03:57:52 +0000 (05:57 +0200)]
unit: wip unit selector

3 months agounit: wip unit switching
Lukas Krickl [Mon, 19 May 2025 16:09:26 +0000 (18:09 +0200)]
unit: wip unit switching

This still has very broken side effects.

Unit switching breaks the camera and the active actor.
The second actor should be switched to but it is not moving at all.

3 months agounit: Added move reset function
Lukas Krickl [Sun, 18 May 2025 18:29:55 +0000 (20:29 +0200)]
unit: Added move reset function

3 months agounit: added retry code for next unit selector
Lukas Krickl [Sun, 18 May 2025 08:49:59 +0000 (10:49 +0200)]
unit: added retry code for next unit selector

3 months agounit: wip actor switching
Lukas Krickl [Sun, 18 May 2025 05:33:37 +0000 (07:33 +0200)]
unit: wip actor switching

3 months agounit: wip for unit switching
Lukas Krickl [Sun, 18 May 2025 04:31:02 +0000 (06:31 +0200)]
unit: wip for unit switching

4 months agounit: Added ui redraw when using moves
Lukas Krickl [Wed, 14 May 2025 16:34:08 +0000 (18:34 +0200)]
unit: Added ui redraw when using moves

4 months agoui: Added used moves indicator to UI
Lukas Krickl [Wed, 14 May 2025 15:27:00 +0000 (17:27 +0200)]
ui: Added used moves indicator to UI

4 months agoui: Added basic ui element for remaining moves
Lukas Krickl [Tue, 13 May 2025 18:09:40 +0000 (20:09 +0200)]
ui: Added basic ui element for remaining moves

4 months agounit: wip unit switching
Lukas Krickl [Tue, 13 May 2025 03:41:35 +0000 (05:41 +0200)]
unit: wip unit switching

4 months agounit: Added camera scroll code
Lukas Krickl [Mon, 12 May 2025 19:47:51 +0000 (21:47 +0200)]
unit: Added camera scroll code

4 months agounit: camera now ceners on selected unit
Lukas Krickl [Mon, 12 May 2025 16:31:18 +0000 (18:31 +0200)]
unit: camera now ceners on selected unit

4 months agounit: Added unit scroll update
Lukas Krickl [Mon, 12 May 2025 15:41:45 +0000 (17:41 +0200)]
unit: Added unit scroll update

4 months agounit: Added basic movement and state transitions
Lukas Krickl [Mon, 12 May 2025 15:06:44 +0000 (17:06 +0200)]
unit: Added basic movement and state transitions

4 months agoactors: Added states to actor templates
Lukas Krickl [Mon, 12 May 2025 14:37:38 +0000 (16:37 +0200)]
actors: Added states to actor templates

4 months agounit: Added stubs for movement code and scroll adjustmnets
Lukas Krickl [Mon, 12 May 2025 10:09:13 +0000 (12:09 +0200)]
unit: Added stubs for movement code and scroll adjustmnets

4 months agounit: working on input handling
Lukas Krickl [Mon, 12 May 2025 08:10:20 +0000 (10:10 +0200)]
unit: working on input handling

4 months agomap: Added map header for future expansion purposes
Lukas Krickl [Mon, 12 May 2025 05:12:14 +0000 (07:12 +0200)]
map: Added map header for future expansion purposes

4 months agounit: fixed scroll offset calculation
Lukas Krickl [Sun, 11 May 2025 15:47:05 +0000 (17:47 +0200)]
unit: fixed scroll offset calculation

4 months agounit: Added basic drawing rotuine for demo_1 unit
Lukas Krickl [Sun, 11 May 2025 15:31:43 +0000 (17:31 +0200)]
unit: Added basic drawing rotuine for demo_1 unit

4 months agocursor: Renamed cursor rotuines to reflect their actual use
Lukas Krickl [Sun, 11 May 2025 04:18:34 +0000 (06:18 +0200)]
cursor: Renamed cursor rotuines to reflect their actual use

This is effectively just a namespace change

4 months agomap: the map converter can now add flags
Lukas Krickl [Sat, 10 May 2025 18:38:12 +0000 (20:38 +0200)]
map: the map converter can now add flags

The map loader loads flags from maps correctly

4 months agosys: moved call_hl to rst 0x08
Lukas Krickl [Sat, 10 May 2025 16:53:39 +0000 (18:53 +0200)]
sys: moved call_hl to rst 0x08

4 months agoAdded flags to actor struct
Lukas Krickl [Thu, 8 May 2025 06:56:01 +0000 (08:56 +0200)]
Added flags to actor struct

4 months agoactors: Added tile position to actor def
Lukas Krickl [Wed, 7 May 2025 18:17:35 +0000 (20:17 +0200)]
actors: Added tile position to actor def

4 months agounit: Added unit demo code
Lukas Krickl [Tue, 6 May 2025 18:22:17 +0000 (20:22 +0200)]
unit: Added unit demo code

This code simply sets up a unit update state for testing purposes

4 months agotiles: Added test unit tiles
Lukas Krickl [Tue, 6 May 2025 15:33:37 +0000 (17:33 +0200)]
tiles: Added test unit tiles

4 months agogame: Added new unit placement state
Lukas Krickl [Tue, 6 May 2025 15:04:23 +0000 (17:04 +0200)]
game: Added new unit placement state

4 months agounit: Added act_def macro
Lukas Krickl [Tue, 6 May 2025 14:34:44 +0000 (16:34 +0200)]
unit: Added act_def macro

4 months agoTiles: update tileset
Lukas Krickl [Sun, 4 May 2025 17:25:22 +0000 (19:25 +0200)]
Tiles: update tileset

4 months agoactors: Added actor table state machine code
Lukas Krickl [Sun, 4 May 2025 14:35:12 +0000 (16:35 +0200)]
actors: Added actor table state machine code

4 months agounits: Added stub for unit update
Lukas Krickl [Sun, 4 May 2025 13:35:45 +0000 (15:35 +0200)]
units: Added stub for unit update

4 months agodefs: Added new actor tables
Lukas Krickl [Sun, 4 May 2025 13:25:41 +0000 (15:25 +0200)]
defs: Added new actor tables

Also removed more dead code

4 months agodefs: Added new actor def
Lukas Krickl [Sun, 4 May 2025 07:51:33 +0000 (09:51 +0200)]
defs: Added new actor def

4 months agocleanup: Removed dead code
Lukas Krickl [Sun, 4 May 2025 07:42:16 +0000 (09:42 +0200)]
cleanup: Removed dead code

4 months agoTODO: Updated notes on tiles
Lukas Krickl [Sun, 4 May 2025 06:14:20 +0000 (08:14 +0200)]
TODO: Updated notes on tiles

4 months agoTODO: added more notes
Lukas Krickl [Sun, 4 May 2025 05:36:30 +0000 (07:36 +0200)]
TODO: added more notes

4 months agoAdded more todo items
Lukas Krickl [Sun, 4 May 2025 05:23:46 +0000 (07:23 +0200)]
Added more todo items

4 months agoAdded TODO
Lukas Krickl [Sun, 4 May 2025 04:31:27 +0000 (06:31 +0200)]
Added TODO

4 months agoReworked TODO
Lukas Krickl [Sun, 4 May 2025 03:58:11 +0000 (05:58 +0200)]
Reworked TODO

4 months agobuildings: Added docs for buildings
Lukas Krickl [Fri, 2 May 2025 16:47:10 +0000 (18:47 +0200)]
buildings: Added docs for buildings

4 months agoadded todo notes
Lukas Krickl [Sun, 27 Apr 2025 06:09:19 +0000 (08:09 +0200)]
added todo notes

4 months agobuilding: Added under construction tile
Lukas Krickl [Thu, 24 Apr 2025 18:55:18 +0000 (20:55 +0200)]
building: Added under construction tile

4 months agobg: fixed issue where the bg update queue would incorrectly process
Lukas Krickl [Thu, 24 Apr 2025 16:10:04 +0000 (18:10 +0200)]
bg: fixed issue where the bg update queue would incorrectly process
every byte as a single update call

This caused out of bounds writes to seemingly random addresses.

4 months agocells: wip debugging cell out of bounds write
Lukas Krickl [Thu, 24 Apr 2025 03:54:19 +0000 (05:54 +0200)]
cells: wip debugging cell out of bounds write

4 months agoassert: added new parameter to assert macro
Lukas Krickl [Thu, 24 Apr 2025 03:24:59 +0000 (05:24 +0200)]
assert: added new parameter to assert macro

4 months agoBUGS: Added cell write crash bug
Lukas Krickl [Wed, 23 Apr 2025 19:42:11 +0000 (21:42 +0200)]
BUGS: Added cell write crash bug

4 months agomap: Added note for eventual map loader rewrite
Lukas Krickl [Wed, 23 Apr 2025 19:25:29 +0000 (21:25 +0200)]
map: Added note for eventual map loader rewrite

4 months agocells: cells now have a timer just like states
Lukas Krickl [Wed, 23 Apr 2025 19:20:29 +0000 (21:20 +0200)]
cells: cells now have a timer just like states

This allows easier scheduling e.g. for build timers

4 months agosimulation: simulation updates now happen in a fixed interval per frame
Lukas Krickl [Wed, 23 Apr 2025 16:01:51 +0000 (18:01 +0200)]
simulation: simulation updates now happen in a fixed interval per frame

This makes the game hit its 60fps target.
Currently inputs still get eaten if a frame drops though.