[MSX-C] Q&A official thread

Pagina 57/57
50 | 51 | 52 | 53 | 54 | 55 | 56 |

Van ~mk~

Champion (303)

afbeelding van ~mk~

10-04-2021, 02:00

Van rolandve

Master (254)

afbeelding van rolandve

10-04-2021, 09:56

Ok, that explains a lot. Thanks.

Van rolandve

Master (254)

afbeelding van rolandve

10-04-2021, 10:23

That would at least tell me whether it is MSX 1 or Two. Not MSX2+ or Turbo. I just scanned the MSX-C library and found that the documentation talks about a wrtslt() function but it has no rdslt() function. Weird.

Van ToriHino

Paladin (727)

afbeelding van ToriHino

10-04-2021, 12:32

For MSX-C it is mentioned on page 63, but my Japanese is a bit rusty ;)

Van AxelStone

Prophet (3055)

afbeelding van AxelStone

19-04-2021, 12:21

Hello, the translated documentation doesn't provide so much info:

https://www.fvue.nl/wiki/MSX-C_manual

Van CodeIndigo

Supporter (16)

afbeelding van CodeIndigo

16-08-2021, 22:47

I asked this in the Fusion-C thread but figured I'd ask here, too-- my understanding of the docs indicates that I should be able to change the palette used in Screen 4, but I'm having trouble figuring out how to do it in C. Is this going to have to be a wrapper for an asm call or is this already solved?

Van AxelStone

Prophet (3055)

afbeelding van AxelStone

17-08-2021, 07:59

CodeIndigo wrote:

I asked this in the Fusion-C thread but figured I'd ask here, too-- my understanding of the docs indicates that I should be able to change the palette used in Screen 4, but I'm having trouble figuring out how to do it in C. Is this going to have to be a wrapper for an asm call or is this already solved?

Hello, in SC4 the address where palete is stored is different from SC5, you only need to write the new palette in the right address. Here goes a sample function in MSX-C to change palette in SC4 and SC5:

/* Carga la paleta a partir de un fichero de paleta. Parametros:
	- char *pal: nombre del fichero de paleta */
VOID ldpltf(pal) 
char *pal;
{
	FILE *fp;
	NAT paladr,palori[16];
	if(c_screen==(BYTE)4) {
		 paladr = 0x1B80;
	 } else if(c_screen==(BYTE)5) {
		 paladr = 0x7680;
	 } else {
		 screen(SCREEN0);
		 printf("Screen %d no soportado para paleta",(int)c_screen);
		 exit(0);
	 }
	 fp=fopen(pal,"rb");
	 if(fp!=NULL) {
		 fread(palori,sizeof(char),7,fp);
		 fread(palori,sizeof(NAT),16,fp);
		 ldirvm(paladr,palori,sizeof(NAT)*16);
		 fclose(fp);
		 rstplt();
	 } else {
		 screen(SCREEN0);
		 printf("Error restaurando el archivo de paleta %s\n",pal);
	 }
}

Van CodeIndigo

Supporter (16)

afbeelding van CodeIndigo

25-08-2021, 16:20

Thank you for the help. I ended up realizing that MSX-C is significantly different from Fusion-C, but this did spur me to write an implementation in Fusion-C.

Pagina 57/57
50 | 51 | 52 | 53 | 54 | 55 | 56 |