With huge thanks to turboxray, I was able to use the under-utilized "CONST_BANK" to store extra sprites. This freed up the ~6k that I wasn't able to use, while still leaving some extra space for more actual constants. To put this in perspective, I was able to move 46x 16x16 sprite tiles worth of graphics into this space. For Catastrophy, that's an entire enemy's worth of animation frames. Data goes quick in the 256kB limited size of an overlay, so every (literal) bit helps.
#asm .data .bank CONST_BANK #endasm
A few notes - you have to manage this on your own - if you write beyond it, it will overwrite the "USER PROGRAM" bank. I'm not even entirely sure what the User Program bank does. it's only 200 bytes long, but things break if you overwrite it. Meanwhile... don't do it.
Further, this has to be right after your #include "huc.h" so that it goes in the right place. HuC will just overwrite what it's already written. I've learned that the hard way.
So, I completely ran out of space in the final area. I needed more space to add another attack pattern to the final boss, but I only had 945 bytes left for code, and the final sprite bank was at ~7k used.
Time to crunch more.
First, I edited HuC to start the code of Bank 2 at $AE60 instead of $A600
.data .bank LIB2_BANK,"Base Library 2/Font" .org $6000 .include "font.inc" .code .bank LIB2_BANK .org $AE60 Then, since the default font is just a waste of space, I overwrote it. Note, when using this technique, you have to make sure that the $AE60 never changes - or you're using too much space!
Further, squirrel takes to till the end of a Bank, regardless of how much data it actually uses. Thus, I edited squirrel's output, and changed the start location. To figure out where the maximum value of .org was, I just kept increasing until it stopped compiling due to Overlay overflow. That indicated that the required data actually passed the size of the bank. I was also able to delete a lot of SFX that have been replaced by ADPCM.
Then, before I call squirrel, I add my graphics into that bank:
#asm .data .bank $3 .org $80C9 #endasm While I don't know if anyone else is ever going to be pushing HuC to the extent I do, this may save someone else in the future. For those who are curious, this is how the breakdown of space is used
No errors PC Engine Assembler (v 3.24-ff0c326-dirty, 2020-04-1
BANK 0 Base Library 1 7567/ 625 CODE $C000-$C024 [ 37] CODE $402F-$406E [ 64] CODE $4070-$412A [ 187] CODE $C130-$DD9E  BANK 1 Base Library 2/Font 7739/ 453 DATA $6000-$6C9F  CODE $AE60-$BFFA  BANK 2 Constants 7821/ 371 DATA $4000-$5E8C  BANK 3 User Program 8136/ 56 DATA $6000-$60C7 [ 200] DATA $80C9-$8EC8  DATA $8F00-$9FFF  BANK 4 8192/ 0 DATA $8000-$9FFF  BANK 5 8192/ 0 DATA $8000-$9FFF  BANK 6 8192/ 0 DATA $8000-$9FFF  BANK 7 8192/ 0 DATA $8000-$9FFF  BANK 8 8192/ 0 DATA $8000-$9FFF  BANK 9 8181/ 11 DATA $8000-$9FF4  BANK A 8184/ 8 CODE $A000-$BFF7  BANK B 8184/ 8 CODE $A000-$BFF7  BANK C 8189/ 3 CODE $A000-$BFFC  BANK D 8189/ 3 CODE $A000-$BFFC  BANK E 8168/ 24 CODE $A000-$BFE7  BANK F 8190/ 2 CODE $A000-$BFFD  BANK 10 8191/ 1 CODE $A000-$BFFE  BANK 11 8189/ 3 CODE $A000-$BFFC  BANK 12 8191/ 1 CODE $A000-$BFFE  BANK 13 8188/ 4 CODE $A000-$BFFB  BANK 14 8190/ 2 CODE $A000-$BFFD  BANK 15 8191/ 1 CODE $A000-$BFFE  BANK 16 8169/ 23 CODE $A000-$BFE8  BANK 17 8171/ 21 CODE $A000-$BFEA  BANK 18 8191/ 1 CODE $A000-$BFFE  BANK 19 8190/ 2 CODE $A000-$BFFD  BANK 1A 8174/ 18 CODE $A000-$BFED  BANK 1B 8178/ 14 CODE $A000-$BFF1  BANK 1C 8191/ 1 CODE $A000-$BFFE  BANK 1D 7238/ 954 CODE $A000-$BC45  BANK 1E 2106/6086 CODE $8000-$8839  ---- ---- 240K 8K
TOTAL SIZE = 248K The only space that we'll apparently never reclaim is the 6kB in the final bank. You'll see how much I am pushing this, if you compare this to a non-pushed compile of the first banks:
No errors PC Engine Assembler (v 3.24-ff0c326-dirty, 2020-04-
BANK 0 Base Library 1 7567/ 625 CODE $C000-$C024 [ 37] CODE $402F-$406E [ 64] CODE $4070-$412A [ 187] CODE $C130-$DD9E  BANK 1 Base Library 2/Font 6043/2149 DATA $6000-$65FF  CODE $A600-$B79A  BANK 2 Constants 373/7819 DATA $4000-$4174 [ 373] BANK 3 User Program 8136/ 56 DATA $6000-$60C7 [ 200] DATA $8100-$9FFF  Anyway, even if you don't code, maybe you'll find my trials and tribulations interesting.
Neat stuff! Definitely will need to keep some of these tricks in mind if I start to run low on space; haven't hit that yet (fingers crossed).
I'm curious, are you storing your graphics alongside your code in the same overlay? I have a separate data overlay for graphics at the moment and am wondering if there's a downside to that approach.
It depends on how you are doing your graphics - if you're able to store all your animation and background tiles in the available VRAM, then you have a lot of space for code. However, you won't be able to load in new graphics fast. Even small loads will take abysmal amounts of time. It'd be important to burn the occasional CD to make sure that you aren't relying on emulator speeds of CD loads. Bizhawk makes things that take 30 seconds happen instantaneously.
spenoza: So Power Golf and Lords of Thunder are too laggy to be much fun, but most of the other shooters are pretty sound, owing to being pretty damn responsive in their original form.
Jun 1, 2020 16:59:44 GMT
sunteam_paul: Looks like Amazon UK are finally starting to send out Minis now
Jun 5, 2020 8:10:57 GMT
sunteam_paul: Mini arrived, Fantasy Zone is sooo much better in the new version.
Jun 6, 2020 13:53:47 GMT
tron: Finished ys 1&2 again recently.Since i got ys memories of celecta for ps4 recently,time for that game.
Jun 11, 2020 8:23:39 GMT
sunteam_paul: I've just finished Memories of Celceta on PC, great game
Jun 11, 2020 12:06:22 GMT
sunteam_paul: Nice to hear remixes of some of the Ys IV music in it
Jun 11, 2020 12:06:50 GMT
bigusschmuck: Hope everyone is well, still trying to adjust working from home.
Jun 27, 2020 14:37:26 GMT
sunteam_paul: Not working at all at the moment...awaiting
Jun 28, 2020 21:29:46 GMT
spenoza: I have been working from home quite a while, but have begun alternating furloughs due to financial constraints.
Jun 30, 2020 20:21:05 GMT
spenoza: All retro prices are up. Something about people being stuck at home and desperately needing stuff to do. It's why Netflix viewership is up and why Disney+ accidentally stumbled into the perfect launch window.
Jul 20, 2020 18:49:55 GMT
bigusschmuck: I suppose so. So much for a price crash lol
Jul 22, 2020 18:13:45 GMT
tron: yup same thing for blazing lazers/gunhed,digipiggy etc.It's getting rather insane for the sega saturn as well even commons for the console have skyrocketed in price.
Jul 24, 2020 8:09:11 GMT
tron: Speaking of retro i got a refurbish snes classic recently.I heard nintendo was selling ones again so i snag it finally,neat little plug'n'play gonna have to hack it since i hear it's easy to do.
Jul 24, 2020 8:13:52 GMT