Mode 72 development
Re: Mode 72 development
I did an update to the mode, no significant functional changes (some added options for m72_bull_cnt), but it involved large rewrites in sprite modes. This was for that I discovered some possible optimizations in ROM sourced sprites which I decided to introduce all over, mostly to have a cleaner setup for introducing any further sprite mode. I tested the results fairly well, there shouldn't be any problem to experience, but if there is, you know who to blame!
So please test (just check it out and compile the game with it, if all went well, it will just keep working).
So please test (just check it out and compile the game with it, if all went well, it will just keep working).
Re: Mode 72 development
So far so good with the new update! I appreciate you working away optimising/rewriting stuff like that.Jubatian wrote: ↑Fri Mar 23, 2018 5:44 pm I did an update to the mode, no significant functional changes (some added options for m72_bull_cnt), but it involved large rewrites in sprite modes. This was for that I discovered some possible optimizations in ROM sourced sprites which I decided to introduce all over, mostly to have a cleaner setup for introducing any further sprite mode. I tested the results fairly well, there shouldn't be any problem to experience, but if there is, you know who to blame!
So please test (just check it out and compile the game with it, if all went well, it will just keep working).
Re: Mode 72 development
Another modification came: I unified the text mode with that of Mode 40/41/42, so these modes can share character sets now. Mode 72 no longer contains a generator.
You should check your game, if you keep it as-is, the characters of the character set will show up mirrored. To fix it, delete the character set file and modify the Makefile to use M40_C64_GRAPHICS instead (which is the same charset like the example contained), look in the example's Makefile for details, particularly Line 19 where the inclusion is added. For an own character set, you can use Mode 40's generator from now.
With this modification I guess Mode 72 is good to go, that is, I think I will merge it into the Master soon. And with that, you may also easier apply my VSync mixer modification on top of it which saves approximately 256 bytes of RAM.
You should check your game, if you keep it as-is, the characters of the character set will show up mirrored. To fix it, delete the character set file and modify the Makefile to use M40_C64_GRAPHICS instead (which is the same charset like the example contained), look in the example's Makefile for details, particularly Line 19 where the inclusion is added. For an own character set, you can use Mode 40's generator from now.
With this modification I guess Mode 72 is good to go, that is, I think I will merge it into the Master soon. And with that, you may also easier apply my VSync mixer modification on top of it which saves approximately 256 bytes of RAM.
Re: Mode 72 development
done! thanksJubatian wrote: ↑Mon Mar 26, 2018 5:30 pm Another modification came: I unified the text mode with that of Mode 40/41/42, so these modes can share character sets now. Mode 72 no longer contains a generator.
You should check your game, if you keep it as-is, the characters of the character set will show up mirrored. To fix it, delete the character set file and modify the Makefile to use M40_C64_GRAPHICS instead (which is the same charset like the example contained), look in the example's Makefile for details, particularly Line 19 where the inclusion is added. For an own character set, you can use Mode 40's generator from now.
With this modification I guess Mode 72 is good to go, that is, I think I will merge it into the Master soon. And with that, you may also easier apply my VSync mixer modification on top of it which saves approximately 256 bytes of RAM.
Re: Mode 72 development
Hey Jubatian, I tried adding -DM72_USE_XPOS to the kernel flags and using m72_xpos but it doesn't seem to update/scroll the tiles. How do I use it? I tried incrementing and decrementing it by 1 and by 8.
Re: Mode 72 development
When you set M72_USE_XPOS nonzero (you need to actually set it nonzero!), the m72_xpos variable takes over the role of the upper bits of the elements of the m72_rowoff array. So you just write VRAM pointers into m72_rowoff, and use m72_xpos for fine scrolling (0 - 7 pixels). I checked it now, it seems to work all right as far as I perceive (although sure it could be that you are excepting a particular behavior which I am just not aware of).
Re: Mode 72 development
Oh I see it is for fine scrolling. I misunderstood and didn't realize I still had to set m72_rowoff. I'll try again with this new knowledge, thanks.Jubatian wrote: ↑Wed Mar 28, 2018 10:44 amWhen you set M72_USE_XPOS nonzero (you need to actually set it nonzero!), the m72_xpos variable takes over the role of the upper bits of the elements of the m72_rowoff array. So you just write VRAM pointers into m72_rowoff, and use m72_xpos for fine scrolling (0 - 7 pixels). I checked it now, it seems to work all right as far as I perceive (although sure it could be that you are excepting a particular behavior which I am just not aware of).
Re: Mode 72 development
Just a bit of clarification then on possible use-cases:
It is intended for situations where you want to use a fixed VRAM (21 tiles width) to minimize RAM footprint, so you can fill m72_rowoff in advance, then forget about it. It is good for games where the level data is in ROM, and you copy it into VRAM as you scroll (moving around VRAM contents as needed by memmove, the AVR is fast, it can easily do that. Flight of a Dragon also works this way for free-directional scrolling).
Re: Mode 72 development
Ah I see. So in my case I am just going to try and use m72_rowoff. But I can't notice any visual difference with the following code I adapted from the sample, not sure why.Jubatian wrote: ↑Thu Mar 29, 2018 5:14 amJust a bit of clarification then on possible use-cases:
It is intended for situations where you want to use a fixed VRAM (21 tiles width) to minimize RAM footprint, so you can fill m72_rowoff in advance, then forget about it. It is good for games where the level data is in ROM, and you copy it into VRAM as you scroll (moving around VRAM contents as needed by memmove, the AVR is fast, it can easily do that. Flight of a Dragon also works this way for free-directional scrolling).
Code: Select all
void UpdateScroll() {
x_offset++;
if (x_offset == 160) x_offset = 0;
for (u8 i = 0; i < BG_HEIGHT; i++) {
m72_rowoff[i] = (u16)&main_vram[i][(x_offset >> 3)] + ((x_offset & 7) << 12);
}
}
EDIT: I can see the vram scrolling in the emulator debug, but the tiles don't change on the display ?
Re: Mode 72 development
If you are just doing a full-screen horizontal scroll, there shouldn't be a visual difference (both methods are equally capable of doing it, it is just that with the default method, you can scroll each tile row independently for parallax effects). The code you posted should work all right for the default configuration (M72_USE_XPOS zero or not set).
I don't understand what do you mean here (what is exactly happening and what are you expecting). Could you send some sample in PM? (I know that these features work correctly the way I intended them to work as I tested them, however I can't know how are you expecting it to work. Maybe resolving this will be good source for clarifying documentations then)