-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for SCR3 #3
Comments
Hello, is there any chance of implementing this? I am trying to port a small demo to this platform, I've got all the sprites working as I want them to, but whatever I tried so far didn't mange to turn on the SCROLL3 layer (or any other layer in fact!) So far I've tried the following in a project derived from
(I also set OBJ as first layer, then SCROLL3 as second layer)
Unfortunately, this still leaves me with... darkness. Only the sprite layer is visible. I am not sure if I am setting the correct palette, or the format I use for Thanks in advance! I also wrote a palette fader, if you are interested I can share it with you so you can add it as a utility function. |
I am not actively working on scr3 but I am delighted to see you seem to be
99% there and I will help as much as I can with the time I have.
When I was working on the sprites, I found three categories of reason for
darkness.
1/ The data is not in gfxrom as expected.
To solve this, I suggest to add some logs in `ccps` to make sure the
background assets are picked up.
There is also the `dumpgfx` capability of `ccps` that should let you see if
the scr3 data is there
2/ The gfxram describing the screen is not picked up by the cps-a.
For this I recompile mame with my custom printf in the Capcom cps1 video
driver. If you are using Linux that should be easy to do.
3/ The scr3 palette page contains only black.
Again for this, I would have a printf to dump the palettes in mame and
verify it is there.
Hope this helps. Please let me know if you have any questions.
Also, when you inevitably solve this problem, post a link to your demo. I
would love to advertise what you created.
…On Wed, Feb 15, 2023, 9:01 AM ggnkua ***@***.***> wrote:
Hello, is there any chance of implementing this? I am trying to port a
small demo to this platform, I've got all the sprites working as I want
them to, but whatever I tried so far didn't mange to turn on the SCROLL3
layer (or any other layer in fact!)
So far I've tried the following in a project derived from post (by mostly
reading the book):
- I've put the background I want to use in the project's gfx/scr3
folder. (actually I have 2 and put them both inside the folder but I think
that should be ok)
- I've set up a struct for the SCROLL3 layer:
#define MAXSCROLL 64*64
typedef struct {
WORD tile; // Sprite tile
// 0..2 CB[0..3] Palette ID used to render the tile
// 3 X Flip Mirrored horizontally
// 4 Y Flip Mirrored vertically
// 5-6 Priority group (See priority mask)
// 7 Unused
WORD attributes; // Sprite attribute
} Scroll3;
GFXRAM Scroll3 scroll3 [MAXSCROLL] __attribute__ ((aligned (0x100))) = {};
- I defined the layer control define:
#define CPSA_REG_SCROLL3_BASE (0x6 / 2)
// Layer control
// bit 3: Enable SCROLL1
// bit 4: Enable SCROLL2
// bit 5: Enable SCROLL3
// Cannot control STAR1
// Cannot control STAR2
// Bit 6-7: Layer to draw first
// Bit 8-9: Layer to draw second
// Bit 10-11: Layer to draw third
// Bit 12-13: Layer to draw last
// Layer IDs : OBJ=0 , SCROLL1=1 , SCROLL2=2 , SRCOLL3=3
- In OnVsync() I added a line that (at least from what I gather from
the book) should turn SCROLL3 on:
cpsb_reg[CPSB_REG_LAYER_CONTROL] = (1 << 5) | (0 << 6) | (3 << 8);
(I also set OBJ as first layer, then SCROLL3 as second layer)
- Then inside Draw() I added something like:
setPalette(8, 2, &pdeka);
int i = 0;
for (; i < deka.numTiles; i++) {
Scroll3* s = &scroll3[i];
GFXShapeTile* t = &(deka.tiles[i]);
//s->x = 196 + t->x * 16;
//s->y = 100 + t->y * 16;
s->tile = t->id;
s->attributes = 2;//| 0x7 << 1 | 0x3 << 1; // Use palette 2 dim 5+1x3+1 = 6x4 tiles
}
scroll3[i].attributes = 0xFF00; // Last sprite marker
- Lastly, I modified setPalette to actually use the page parameter:
void setPalette(int page, int paletteID, const Palette* palette) {
for (int j = 0 ; j < 16 ; j++) {
palettes[paletteID].colors[j] = (*palette).colors[j];
}
// Request upload palette page to sprites
cpsb_reg[CPSB_REG_PALETTE_CONTROL] = page;
// Set palette base
cpsa_reg[CPSA_REG_PALETTE_BASE] = (WORD)(((DWORD)palettes) >> 8);
}
Unfortunately, this still leaves me with... darkness. Only the sprite
layer is visible. I am not sure if I am setting the correct palette, or the
format I use for palette3 is correct, or anything other really.
Thanks in advance! I also wrote a palette fader, if you are interested I
can share it with you so you can add it as a utility function.
—
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJJXEFCKY6XNAJH2QMJ5OTWXURXTANCNFSM5TU7I6YQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi again, I made a few more experiments, so this is where I got so far:
This is where I'm at right now and I'm out of ideas. I suppose that the next thing to try would be to manually fill the rom files with junk, see if I can get it to show anything at all on screen. |
Since Once you have a |
Hi, As suggested, I tried to modify the
I also tried various other things like changing the tiles attributes, writing to the hardware registers as addresses, etc. I still didn't get far. I'm attaching the modified main.c here in hopes of someone picking up where I left it and try to fix it (or learn from my mistakes): main.zip. Otherwise, I'm afraid I'm stumped here (and don't have the time to start fiddling with the mame source code to debug this). Thanks. |
No description provided.
The text was updated successfully, but these errors were encountered: