Enhancement - AGA Support.#268
Conversation
UNTESTED but I loaded a 256 colour bitmap or 4.
Fixed bitshift for AGA Palette.
finished my comment...
This reverts commit 4468737.
Allocate the ram for the palette depending on the Depth, AGA and ECS use different palette types. Now Germz shows the correct colours again. Free's the palette memory when the view gets destroyed.
removed union, use the two varibles. Added a feof to mini_std. worked for my little test, probs not optimised.
Creating the View, you now need to specify if your using the AGA chipset. Now you can use 24bit colours on all bit plane counts. (in theory)
Added KILLEHB if viewport has AGA enabled and is 6 bpp.
Removed Extra AGA Palette field.
… to setup the display. AGA needs more time so the value needs to be smaller.
This commit refactors the code in palette.cpp to support AGA Palette. Specifically, it adds a new else block that writes alpha and color values for AGA Palette.
The commit fixes a bug where the wrong variable was being passed to logWrite function. The variable name has been corrected to match the intended value.
This commit updates the value of s_pCopperWaitXByBitplanes[8] from 0xC6 to 0xA0. This change is made to optimize fetchmodes for AGA in 8bpp mode.
Enhance README.md to include information about AGA support and its setup. Add AGA support link in docs/README.md and provide build instructions for enabling AGA features in docs/installing/ace.md. Update docs/programming/view.md with details on AGA tags for view/viewport creation.
|
Great! I'll check if my games are breaking on this branch, and if not then we're more or less ready to go. I also encourage all bystanders to do the same. |
|
I want this PR to be merged so badly :D Thanks for adding it!! |
Well you can grab my fork of ACE and do some testing so we know it is stable enough to merge. More testing faster merging. |
|
The thing is, that I don't have anything to test yet ;) I was wondering if I should rewrite my game using ACE, as I'm struggling to make my scroller working without occasional glitches - however, the game uses AGA features. Up until now I didn't consider ACE, but with that PR I'd need to re-thing it. Out of curiosity
|
|
Well, ACE has a working scroller we have a channel on a discord server if
you want any help and advice.
https://discord.gg/nuN7wdKEC
Edited to remove all the stuff added via replying via email lol.
|
In FMODE 3: Even though priority says: With everything Amiga there is always a compromise. I normally think if you want fmode 3, then you might as well think you've lost the last two sprites. But as with anything mileage may vary. Btw, I haven't really tested fmode 1, just mode 3. |
|
Thanks for the response. Based on my experience, even with fmode = 1 I'm only able to use up to 5 slots on both FS-UAE and real Amiga. The remaining ones don't get the DMA cycles due to the early DDF and pre-fetch. Thanks for sharing the link to the Discord. I'm a real boomer and never managed to use it. I'll take a look. |
…e UWORD Change the parameter types from UBYTE to UWORD for maximum color length in paletteLoadFromPath, paletteLoadFromFd, paletteDim, and paletteDump functions. This improves consistency and allows for a broader range of color counts. Update related logic to accommodate the new types.
|
Hey @Vairn . I tried using the |
Awesome, I'll have a look later once I get to Work. |
Fix fmode 1 and 2
Fix aga bplcon0 bpu3
Added a new function to calculate DDF step based on the viewport's bitplane mode. Updated scroll buffer processing and reset logic to accommodate AGA features, ensuring correct handling for FMODE 1 and 2. Cleaned up whitespace in simple buffer initialization.
Updated the viewLoad function to streamline AGA feature support. Simplified the logic for setting bplcon0 and bplcon2 based on the viewport's bit depth, ensuring correct handling for 64-color modes. Removed redundant conditions and improved code clarity.
Refined the logic for setting bplcon0 and bplcon2 in the viewLoad function to improve AGA feature support. Added checks for VP_FLAG_HIRES and VP_FLAG_AGA to ensure correct configuration based on viewport flags and bit depth. This update enhances clarity and correctness in handling 64-color modes and AGA-specific settings.
…unctions Updated the calculation for colour banks in viewUpdateGlobalPalette to ensure correct handling of bit depth. Enhanced comments in viewLoad to clarify the configuration of bplcon0 and bplcon2, specifically regarding VP_FLAG_HIRES and VP_FLAG_AGA. This improves the clarity and correctness of AGA feature support.
I was testing with AGA enabled, which also enabled ECS.
tehKaiN
left a comment
There was a problem hiding this comment.
first minor and non-exhaustive review - I'd get rid of palette v1 support completely and at most leave detection of v1 and print the error on debug targets. User is expected to use latest convert tools at all times.
Not sure if we even need to document the old format. Having docs for new one is a nice to have.
…ures - Removed support for legacy (v1) `.plt` files; users must reconvert assets to v2 format. - Updated documentation to reflect changes in palette loading and saving functions. - Enhanced AGA palette handling in `palette_conv` and related functions to ensure compatibility with v2 formats only. - Improved error handling for unsupported legacy formats in the palette loading process.
- Updated documentation for spriteSetOddColourPaletteBank and spriteSetEvenColourPaletteBank to improve clarity. - Refined the logic for setting the palette banks in sprite functions to ensure correct handling of AGA features. - Improved logging in viewCreate to include AGA-related flags for better debugging and visibility of feature usage. - Fixed the deletion of the palette to check the views AGA flag, not the first VPORT.
tehKaiN
left a comment
There was a problem hiding this comment.
Code looks kinda okay, now needs testing in my games.
The diff would be way way smaller if you haven't wrecked the formatting. Please fix it - extra spaces near parentheses are okay if you feel attached to them, other stuff must go.
| print("\tplt\tACE palette (default)\n"); | ||
| print("\tpng\tPalette preview\n"); | ||
| print("extraOpts:\n"); | ||
| print("\t-cc\tConvert colors. Truncate non-OCS colors to OCS precision if necessary\n"); |
There was a problem hiding this comment.
That's required to stay. The intended behavior is that palette_conv for ocs catches bad colors in input palette and only if you don't care about them you add a switch that will auto-downgrade colors to 12-bit.
This is due to bitmap_conv not auto-fitting the images to palette, and you want to catch bad colors where they really are - with auto-fixed palette bitmap_conv will complain about palette-image color mismatch even though the image might be correctly 12-bit rgb.
| print("\t-cc\tConvert colors. Truncate non-OCS colors to OCS precision if necessary\n"); | ||
| } | ||
|
|
||
| int main(int lArgCount, const char *pArgs[]) |
There was a problem hiding this comment.
I really need to create a clangformat thingy. Plz minimize the diff. Extra whitespace is okay but "stickiness" of ptr/ref should be the same.
| tools/*/*.png | ||
| tools/*/*.bm | ||
| tools/*/*.plt | ||
|
|
| /** First byte of .plt v2: ECS/OCS packed entries (2 bytes per colour). */ | ||
| #define PLT_NEW_ECS 0 | ||
| /** First byte of .plt v2: AGA entries (4 bytes per colour, alpha+R+G+B). */ | ||
| #define PLT_NEW_AGA 1 |
There was a problem hiding this comment.
does it need to be in .h file and visible in other files that include them? or can we just have it in palette.c?
| * @brief Saves ECS/OCS palette into .plt v2 file (PLT_NEW_ECS + BE count + packed colours). | ||
| */ | ||
| void paletteSave(UWORD *pPalette, UBYTE ubColorCnt, char *szPath); | ||
| void paletteSave(const UWORD *pPalette, UWORD uwColorCnt, char *szPath); |
There was a problem hiding this comment.
| void paletteSave(const UWORD *pPalette, UWORD uwColorCnt, char *szPath); | |
| void paletteSaveOcs(const UWORD *pPalette, UWORD uwColorCnt, char *szPath); |
| @@ -92,7 +92,17 @@ long ftell(FILE *pStream) { | |||
|
|
|||
| int feof(UNUSED_ARG FILE *pStream) { | |||
| // FIXME: implement | |||
There was a problem hiding this comment.
it's fixme'd, you can now remove this comment.
Have you confirmed that it returns true only after the last byte was read?
| LONG lPos = Seek((BPTR)pStream, 0L, OFFSET_CURRENT); | ||
| Seek((BPTR)pStream, 0L, OFFSET_END); | ||
|
|
||
| LONG lEnd = Seek((BPTR)pStream, 0L, OFFSET_CURRENT); |
There was a problem hiding this comment.
Ain't Seek() return the current position at all times?
| LONG lPos = Seek((BPTR)pStream, 0L, OFFSET_CURRENT); | |
| Seek((BPTR)pStream, 0L, OFFSET_END); | |
| LONG lEnd = Seek((BPTR)pStream, 0L, OFFSET_CURRENT); | |
| LONG lPos = Seek((BPTR)pStream, 0L, OFFSET_END); | |
| LONG lEnd = Seek((BPTR)pStream, 0L, OFFSET_CURRENT); |
| if (lPos == lEnd) | ||
| return 1; | ||
|
|
||
| return 0; |
There was a problem hiding this comment.
| if (lPos == lEnd) | |
| return 1; | |
| return 0; | |
| return lPos == lEnd; |
| constexpr std::uint8_t PLT_NEW_ECS = 0; | ||
| constexpr std::uint8_t PLT_NEW_AGA = 1; | ||
|
|
||
| static void writeUwordBE(std::ofstream &Dest, std::uint16_t uwValue) { |
There was a problem hiding this comment.
same as in main ace code - how about reading/writing a 2-byte thingy and using endian.h fns to swap them?
American spelling of Color where I use the Colour version. Fixes for badly formatted code.
Description
This PR merges the AGA branch back into
main.It brings in:
AGA support is enabled by configuring CMake with
-DACE_USE_AGA_FEATURES=ON.Closes #151.
Motivation and Context
The AGA work is now broad enough that keeping it separate is slowing everything down.
Merging now keeps development on one branch and prevents further drift/conflicts.
How Has This Been Tested?
sprite,advancedsprite,viewport,camera,palette,extview)-DACE_USE_AGA_FEATURES=ON, including 8bpp screen supportTypes of changes
Checklist