gbrg/.git
2 months agoupdated obj tiles
Lukas Krickl [Wed, 2 Jul 2025 07:33:57 +0000 (09:33 +0200)]
updated obj tiles

2 months agooam: Enabled 8x16 objects
Lukas Krickl [Wed, 2 Jul 2025 03:52:39 +0000 (05:52 +0200)]
oam: Enabled 8x16 objects

For this change I had to split up bank 8800 into 8800 and 8C00.
Updated the png converter script to convert 8800-8C00 into 8x16 object
compatible tiles.

Updated map loader to contain an additional pointer gfx.
Updated map generator to write the additional pointer to gfx.
Updated sprite index for player and demo actors.

2 months agobank8800: made player sprite 16x16
Lukas Krickl [Tue, 1 Jul 2025 15:13:16 +0000 (17:13 +0200)]
bank8800: made player sprite 16x16

2 months agoactor: unit_generic_draw now draws 2 objects per actor
Lukas Krickl [Tue, 1 Jul 2025 14:33:04 +0000 (16:33 +0200)]
actor: unit_generic_draw now draws 2 objects per actor

2 months agodefs: changed y viewport to 6 tiles
Lukas Krickl [Mon, 30 Jun 2025 15:32:21 +0000 (17:32 +0200)]
defs: changed y viewport to 6 tiles

2 months agomap: Maps are now 16x16 and have a tile size of 16x16
Lukas Krickl [Mon, 30 Jun 2025 14:36:45 +0000 (16:36 +0200)]
map: Maps are now 16x16 and have a tile size of 16x16

This mostly required reworking rendering as the actual game logic is
tile based anyway.

Drawing maps now happens in 2 steps.

Actors do not take into account the larger size yet. I will probably
switch to 8x16 objects eventually. This will however require a rework of
  the image converter

2 months agoadded new enemy sprite
Lukas Krickl [Mon, 30 Jun 2025 04:05:14 +0000 (06:05 +0200)]
added new enemy sprite

2 months agoTODO: Added some todo notes
Lukas Krickl [Mon, 30 Jun 2025 02:52:05 +0000 (04:52 +0200)]
TODO: Added some todo notes

2 months agodemo: fixed demo inputs
Lukas Krickl [Sat, 28 Jun 2025 17:02:34 +0000 (19:02 +0200)]
demo: fixed demo inputs

Demos can be used to play-back inputs

2 months agoactortable: The demo actor table was reading out of bounds
Lukas Krickl [Sat, 28 Jun 2025 16:55:28 +0000 (18:55 +0200)]
actortable: The demo actor table was reading out of bounds

The laoder code was behaving correctly, but the size value was
off-by-one

2 months agowip: demo inputs
Lukas Krickl [Sat, 28 Jun 2025 16:52:21 +0000 (18:52 +0200)]
wip: demo inputs

This is currently very broken due to a map actor loader out of bounds
read

2 months agoactor: fixed movement being slow when picking two directions
Lukas Krickl [Sat, 28 Jun 2025 10:11:39 +0000 (12:11 +0200)]
actor: fixed movement being slow when picking two directions

This was caused due to try_move_x destroying registers.
The fix was to simply push and pop de and hl.

2 months agoactor: fixed doc comment
Lukas Krickl [Sat, 28 Jun 2025 05:54:56 +0000 (07:54 +0200)]
actor: fixed doc comment

2 months agoactor: renamed def_draw to def_meta and added dialog options ptr
Lukas Krickl [Sat, 28 Jun 2025 05:54:11 +0000 (07:54 +0200)]
actor: renamed def_draw to def_meta and added dialog options ptr

2 months agoactor: Added semi-smooth sub tile animation
Lukas Krickl [Fri, 27 Jun 2025 15:57:51 +0000 (17:57 +0200)]
actor: Added semi-smooth sub tile animation

2 months agoactor: Added movement speed-based delay
Lukas Krickl [Thu, 26 Jun 2025 16:03:22 +0000 (18:03 +0200)]
actor: Added movement speed-based delay

This is simply done by having a writable version of
unit_delay_to_active in wram.
The timer can now be changed at will.
Also added st_custom for entierly custom runtime states :^)

2 months agounit: wip sub-tile animation
Lukas Krickl [Thu, 26 Jun 2025 11:00:45 +0000 (13:00 +0200)]
unit: wip sub-tile animation

2 months agoactor: removed sub-tile movement
Lukas Krickl [Wed, 25 Jun 2025 17:23:05 +0000 (19:23 +0200)]
actor: removed sub-tile movement

Instead it will be replaced by a delay state that will update
an offset for rendering.
This state will move faster or slower depending on movement speed.

2 months agoactor: rt variables are now in regular actor_def
Lukas Krickl [Wed, 25 Jun 2025 13:53:14 +0000 (15:53 +0200)]
actor: rt variables are now in regular actor_def

this saves a macro call.
units now move in sub-tiles in all directions.
Drawing still will need to take this into account.

2 months agoactors: Added sub-tile movement for up direction
Lukas Krickl [Wed, 25 Jun 2025 08:18:11 +0000 (10:18 +0200)]
actors: Added sub-tile movement for up direction

2 months agoactor: renamed attr to skill
Lukas Krickl [Wed, 25 Jun 2025 03:46:11 +0000 (05:46 +0200)]
actor: renamed attr to skill

2 months agounit: wip sub-tile movement
Lukas Krickl [Tue, 24 Jun 2025 17:09:54 +0000 (19:09 +0200)]
unit: wip sub-tile movement

2 months agounit: Added stub for sub-tile positions
Lukas Krickl [Sun, 22 Jun 2025 08:27:22 +0000 (10:27 +0200)]
unit: Added stub for sub-tile positions

2 months agounit: the player unit can now move in multiple directions on the same
Lukas Krickl [Sun, 22 Jun 2025 05:47:19 +0000 (07:47 +0200)]
unit: the player unit can now move in multiple directions on the same
frame

2 months agounit: obj reset is now in a sub routine
Lukas Krickl [Sun, 22 Jun 2025 03:49:31 +0000 (05:49 +0200)]
unit: obj reset is now in a sub routine

2 months agounit: units are now not displayed on top of the window area anymore
Lukas Krickl [Sat, 21 Jun 2025 15:58:10 +0000 (17:58 +0200)]
unit: units are now not displayed on top of the window area anymore

2 months agounit: removed dice display
Lukas Krickl [Sat, 21 Jun 2025 15:37:12 +0000 (17:37 +0200)]
unit: removed dice display

2 months agounit: fixed current actor comparison in unit->unit collision
Lukas Krickl [Sat, 21 Jun 2025 14:13:25 +0000 (16:13 +0200)]
unit: fixed current actor comparison in unit->unit collision

This check was just completely busted...

2 months agowram: removed unused variables
Lukas Krickl [Sat, 21 Jun 2025 14:08:58 +0000 (16:08 +0200)]
wram: removed unused variables

2 months agounit: removed turn-based code
Lukas Krickl [Sat, 21 Jun 2025 14:03:10 +0000 (16:03 +0200)]
unit: removed turn-based code

This change removes a lot of turn based code around moves, moves max
initiavite etc.
It also simply sets all units to active which effectively makes the game
real time.

2 months agounit: Fixed out of bounds reads and write in unit->unit collision
Lukas Krickl [Sat, 21 Jun 2025 13:49:56 +0000 (15:49 +0200)]
unit: Fixed out of bounds reads and write in unit->unit collision

This was caused by attempting to use a clobbered A value as the loop
index.

2 months agounit: removed debu BREAKs
Lukas Krickl [Sat, 21 Jun 2025 11:02:32 +0000 (13:02 +0200)]
unit: removed debu BREAKs

2 months agounit: Added unit to unit collision
Lukas Krickl [Sat, 21 Jun 2025 11:01:50 +0000 (13:01 +0200)]
unit: Added unit to unit collision

2 months agomaps: Added simple RLE to map converter and loader
Lukas Krickl [Sat, 21 Jun 2025 08:40:42 +0000 (10:40 +0200)]
maps: Added simple RLE to map converter and loader

2 months agomap: refactored map converter to split up bg and flags into 2 tables
Lukas Krickl [Sat, 21 Jun 2025 06:54:00 +0000 (08:54 +0200)]
map: refactored map converter to split up bg and flags into 2 tables

The map loader now also loads them in 2 steps.

2 months agovideo: removed deprecated scroll update code
Lukas Krickl [Sat, 21 Jun 2025 04:02:56 +0000 (06:02 +0200)]
video: removed deprecated scroll update code

2 months agomacros: Added mul16 and div16 macros
Lukas Krickl [Fri, 20 Jun 2025 19:26:22 +0000 (21:26 +0200)]
macros: Added mul16 and div16 macros

2 months agodefs: removed some magic numbers from scroll center
Lukas Krickl [Fri, 20 Jun 2025 19:15:31 +0000 (21:15 +0200)]
defs: removed some magic numbers from scroll center

2 months agovideo: removed deprecated copy-tiles routine
Lukas Krickl [Fri, 20 Jun 2025 18:15:57 +0000 (20:15 +0200)]
video: removed deprecated copy-tiles routine

2 months agomap: maps can now load tile banks dynamically
Lukas Krickl [Fri, 20 Jun 2025 18:15:00 +0000 (20:15 +0200)]
map: maps can now load tile banks dynamically

2 months agounit: code cleanup
Lukas Krickl [Fri, 20 Jun 2025 17:30:38 +0000 (19:30 +0200)]
unit: code cleanup

2 months agomap: Added actor table loader
Lukas Krickl [Fri, 20 Jun 2025 17:26:06 +0000 (19:26 +0200)]
map: Added actor table loader

2 months agomaps: Added more header values to map converter
Lukas Krickl [Fri, 20 Jun 2025 14:51:17 +0000 (16:51 +0200)]
maps: Added more header values to map converter

2 months agomap: refactoring map loader
Lukas Krickl [Fri, 20 Jun 2025 14:31:12 +0000 (16:31 +0200)]
map: refactoring map loader

2 months agotiles: Added docs for tile banking
Lukas Krickl [Fri, 20 Jun 2025 11:50:07 +0000 (13:50 +0200)]
tiles: Added docs for tile banking

2 months agostrings: removed objputs
Lukas Krickl [Fri, 20 Jun 2025 11:39:54 +0000 (13:39 +0200)]
strings: removed objputs

2 months agoTODO: Added notes about map saves
Lukas Krickl [Fri, 20 Jun 2025 04:34:51 +0000 (06:34 +0200)]
TODO: Added notes about map saves

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