Skip to content

sinclair/tsconf.cpp: Changed default ram data to 0x00; cram full init #13823

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

Merged
merged 2 commits into from
Jun 16, 2025

Conversation

holub
Copy link
Contributor

@holub holub commented Jun 13, 2025

No description provided.

Comment on lines 235 to 254
const u16 cram_init[0x100] = {
0x0000, 0x0008, 0x0010, 0x0018, 0x2000, 0x2008, 0x2010, 0x2018, 0x4000, 0x4008, 0x4010, 0x4018, 0x6000, 0x6008, 0x6010, 0x6018,
0x0100, 0x0108, 0x0110, 0x0118, 0x2100, 0x2108, 0x2110, 0x2118, 0x4100, 0x4108, 0x4110, 0x4118, 0x6100, 0x6108, 0x6110, 0x6118,
0x0200, 0x0208, 0x0210, 0x0218, 0x2200, 0x2208, 0x2210, 0x2218, 0x4200, 0x4208, 0x4210, 0x4218, 0x6200, 0x6208, 0x6210, 0x6218,
0x0300, 0x0308, 0x0310, 0x0318, 0x2300, 0x2308, 0x2310, 0x2318, 0x4300, 0x4308, 0x4310, 0x4318, 0x6300, 0x6308, 0x6310, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x2108, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x0000, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x2108, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x0000, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x2108, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x0000, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x2108, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x0000, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x2108, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x0000, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x2108, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318,
0x0000, 0x0010, 0x4000, 0x4010, 0x0200, 0x0210, 0x4200, 0x4210, 0x0000, 0x0018, 0x6000, 0x6018, 0x0300, 0x0318, 0x6300, 0x6318
};
for (auto i = 0; i < 0x100; i++)
cram_write16(i << 1, (cram_init[i] >> 8) | (cram_init[i] << 8)); // init color RAM
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this come from? Can you load it as a “ROM” rather than having it in an array here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/tslabs/zx-evo/blob/master/pentevo/fpga/current/video/mem/video_cram.mif

I'm planning to load it as a ROM eventually, but that requires entire cram refactoring and change it to proper 16bit data size. For now it just patches what we have.

Copy link
Member

@cuavas cuavas Jun 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don’t need to change the RAM width to load it as a ROM, you could load it as a 16-bit ROM region, and then just do the same thing here, like:

	u16 const *const cram_init = &memregion("cram_init")->as_u16();
	for (auto i = 0; i < 0x100; i++)
		cram_write16(i << 1, (cram_init[i] >> 8) | (cram_init[i] << 8)); // init color RAM

or something similar.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edited the code fragment in the previous comment. Commenting on three PRs at once is a bad idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine, I'll figure out. It is only required for spg. For regular boot BIOS update palette.

@holub
Copy link
Contributor Author

holub commented Jun 14, 2025

here you go

@cuavas cuavas merged commit d2610ee into mamedev:master Jun 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants