Commit Graph

135 Commits

Author SHA1 Message Date
Lucas Scharenbroich
23f3626293 Fix issues preventing BG1 per-line offsets from working 2022-07-16 16:42:41 -05:00
Lucas Scharenbroich
0ab7fa9d81 Two layer demos 2022-07-16 15:22:23 -05:00
Lucas Scharenbroich
182ebfd566 Set dirty render to the correct direct page and several small cleanups 2022-07-06 14:55:27 -05:00
Lucas Scharenbroich
a51c973865 Fix addressing bug in SCB binding 2022-06-27 00:41:02 -05:00
Lucas Scharenbroich
78ee683ba8 Stub in a lot of the remaining functions 2022-06-25 11:17:50 -05:00
Lucas Scharenbroich
4c1dba0f68 Complete Dynamic Tile renderer 2022-06-21 23:13:28 -05:00
Lucas Scharenbroich
76a9710114 Add dynamic rendering functions 2022-06-21 15:28:58 -05:00
Lucas Scharenbroich
a91f39aab8 Remove dead code and implement Slow tile renderers in terms of the Fast once to avoid code bloat 2022-06-21 13:33:17 -05:00
Lucas Scharenbroich
553fd3c02a Tweaking updated sprite dispatch flow 2022-06-21 07:29:18 -05:00
Lucas Scharenbroich
4ea3033b5e Get minimal tiles and sprites rendering without a crash 2022-06-20 17:57:19 -05:00
Lucas Scharenbroich
1f9c9b3f5b Checkpoint of final tile proc reorg for generalize new infrastructure for different engine modes 2022-06-20 15:55:09 -05:00
Lucas Scharenbroich
12b05139c2 Move to tables of dispatch tuples to set tile rendering information 2022-06-14 14:21:51 -05:00
Lucas Scharenbroich
d3da96a834 Add in the special Tile 0 render routines 2022-06-14 08:12:33 -05:00
Lucas Scharenbroich
7af4a216a0 Add modular dispatch for copy routines; add initial support for tile priority bit 2022-06-12 05:28:12 -05:00
Lucas Scharenbroich
e5938cb3c7 Change the entry points based on the engine mode 2022-06-08 23:34:15 -05:00
Lucas Scharenbroich
dec50bc6fc Fix several bugs; biggest one in the SpriteStamp routine 2022-05-31 22:53:33 -05:00
Lucas Scharenbroich
78d7dafe14 Another checkpoint; converging on the working implementation 2022-05-31 08:43:26 -05:00
Lucas Scharenbroich
9da3616c1d Start working to bring sprites rendering back into the pipeline 2022-05-22 23:54:47 -05:00
Lucas Scharenbroich
8582ecb320 Fix weird search/replace bug 2022-05-22 21:57:52 -05:00
Lucas Scharenbroich
9ac9ea623e More banking fixes 2022-05-19 23:40:45 -05:00
Lucas Scharenbroich
fd07ead8ed Get tile data to display from code field 2022-05-18 21:39:39 -05:00
Lucas Scharenbroich
755ac3fbfd Move most data storage to separate bank; fix many banking bugs 2022-05-18 21:00:06 -05:00
Lucas Scharenbroich
01e92a7b62 Update; tool is compiling while referencing new rederer pipeline 2022-05-18 00:34:25 -05:00
Lucas Scharenbroich
7f6e5d1b1f Work checkpoint 2022-04-29 12:38:04 -05:00
Lucas Scharenbroich
e5da3991cd Start to split the tiles into high-level and low-level code 2022-04-25 16:34:54 -05:00
Lucas Scharenbroich
d107365d79 Break up large source code files to help with dependency ordering 2022-04-25 11:32:06 -05:00
Lucas Scharenbroich
29d70dc567 Break up large source code files to help with dependency ordering 2022-04-25 11:30:24 -05:00
Lucas Scharenbroich
e2710ace85 Refactor to support building a tool and new demo to try and use it [not working] 2022-04-23 00:47:13 -05:00
Lucas Scharenbroich
8bb17895a9 Rough outline of streamlined sprite subsystem
* Split the creation of the sprite stamps from adding the
  sprites themselves.  This allows for 48 stamps that can
  be pre-rendered and quickly reassigned to sprites for
  animations.

* Inlined all calls to PushDirtyTile.  This both removed
  significant overhead from calling the small function and,
  since almost all callers we checking multiple tiles, we
  were able to avoid incrementing the count each time and
  just add a single incrments at the end.

* Switched from recording each tile that a sprite intersects
  with each from to only recording the top-left tile and the
  overlap size.  This reduced overhead for larger sprites
  and removed the needs for an end-of-list marker.

* Much more aggressive caching of Sprite and Tile Store
  values in order to streamline the inner tile dispatch
  routines.

* Moving TileStore and Sprites (and other supporting
  data structures) into a separate data bank.  Needed just
  for size purposes and provide micro-optimizations by
  opening up the use of abs,y addressing modes.

* Revamped multi-sprite rendering code to avoid the need to
  copy any masks and all stacked sprites can be drawn
  via a sequence of and [addrX],y; ora (addrX),y where
  addrX is set once per tile.

* General streamlining to reduct overhead. This work was
  focused on removing as much per-tile overhead as possible.
2022-04-20 07:43:16 -05:00
Lucas Scharenbroich
df0d0ccada Commit to a huge unrolled loop to do bitfield -> render function 2022-02-25 17:05:32 -06:00
Lucas Scharenbroich
2507724a49 More sprite streamlining
* Added a TS_LAST_VBUFF cached value in the tile store
* Added a fast path for single sprite w/fast test
* Improved raster timing granularity for visual profiling

All of the code paths are generally good.  Both the _RenderSprites
and _ApplyDirtyTiles functions take a fair bit of raster time. Will
continue to try and streamline the data structures and code to
reduce overhead.`
2022-02-22 02:35:21 -06:00
Lucas Scharenbroich
e0912c8956 More tweaks and fixes
* Adjusted tile calculation when drawing sprites
* Fixed incorred draw order in 16x16 sprite
* Added more early-out checks to save work
2022-02-21 15:45:11 -06:00
Lucas Scharenbroich
8b9415a7a5 Working through integration bugs
* Gave active list dedicated direct page space
* Change active list bit test from ror to asl to avoid barrel shift
* Various address fixes
2022-02-21 10:31:35 -06:00
Lucas Scharenbroich
bb83e7f7c5 Background rendering again 2022-02-18 20:43:55 -06:00
Lucas Scharenbroich
260b2097c2 Continue fixing code issues; strange relocation error happening 2022-02-18 13:42:37 -06:00
Lucas Scharenbroich
95058fb969 Checkpoint for sprite rewrite
All of the sprite rendering has been deferred down to the level of
the tile drawing. Sprites are no longer drawn/erased, but instead
a sprite sheet is generated in AddSprite and referenced by the
renderer.

Because there is no longer a single off-screen buffer that holds
a copy of all the rendered sprites, the TileStore size must be
expanded to hold a reference to the sprite data address fo each
tile.  This increase in data structure size require the TileStore
to be put into its own bank and appropriate code restructuring.

The benefits to the rewrite are significant:

  1. Sprites are never drawn/erased off-screen.  They are only
     ever drawn directly to the screen or play field.
  2. The concept of "damaged" sprites is gone.  Every dirty tile
     automatically renders just to portion of a sprite that it
     intersects.

These two properties result in a substantial increase in throughput.
2022-02-18 12:12:32 -06:00
Lucas Scharenbroich
397df074ac Sprite state rework; have run out of bank space 2022-02-07 01:19:31 -06:00
Lucas Scharenbroich
89ea425043 Start work on sprite attribute caching 2022-02-04 12:37:05 -06:00
Lucas Scharenbroich
8b852485ac Fix dirty sprite renderer when StartX and StartY are not zero 2022-02-03 23:44:46 -06:00
Lucas Scharenbroich
d3b61f8de6 Merge branch 'toolbox-conversion' 2022-02-03 08:51:49 -06:00
Lucas Scharenbroich
1b9425b620 Streamline sprite functions; untested conceptual changes 2022-02-03 08:50:11 -06:00
Lucas Scharenbroich
16a3a385a9 Update some comments 2022-02-02 17:24:27 -06:00
Lucas Scharenbroich
5f492fd557 Save 1 cycle per line in the PEA fast-path for odd-aligned blits 2022-02-02 14:30:48 -06:00
Lucas Scharenbroich
1fe02e035c Checkpoint 2022-02-02 10:21:31 -06:00
Lucas Scharenbroich
027f9746ec Checkpoint of work 2022-01-19 20:58:57 -06:00
Lucas Scharenbroich
7d76089215 Remove some dead code 2021-11-22 16:53:47 -06:00
Lucas Scharenbroich
140126afd8 Optimize odd-aligned case in the blitter
The SEP/REP pairs that are used to move in and out
of 8-bit mode to do the single-byte pushed on the left
and right edges of the screen can also be used to clear
the necessary carry and overflow flags.
2021-11-22 16:13:29 -06:00
Lucas Scharenbroich
76801c0e5e Simplify all of the remaining tile blitters 2021-11-20 13:58:24 -06:00
Lucas Scharenbroich
cd5de05d74 Most of the horizontal flip routines are not needed since the _GetTileAddr function returns the correct tile address. Need to finish auditing other Tile blitters 2021-11-20 13:54:19 -06:00
Lucas Scharenbroich
0cc28f9e6e Generalize _DrawSprite to handle all sizes and flip bits. 2021-11-20 12:00:21 -06:00