Create a 32 kb ROM in Assembly

By albs_br

Champion (456)

albs_br's picture

28-09-2022, 16:06

Hi guys, I'm trying to create a ROM from 0x4000 to 0xbfff using the code available here on MSX wiki:

; Typical routine to select the ROM on page 8000h-BFFFh from page 4000h-7BFFFh
	call	RSLREG
	rrca
	rrca
	and	3	;Keep bits corresponding to the page 4000h-7FFFh
	ld	c,a
	ld	b,0
	ld	hl,EXPTBL
	add	hl,bc
	ld	a,(hl)
	and	80h
	or	c
	ld	c,a
	inc	hl
	inc	hl
	inc	hl
	inc	hl
	ld	a,(hl)
	and	0Ch
	or	c
	ld	h,080h
	call	ENASLT		; Select the ROM on page 8000h-BFFFh

The data under 0x8000 is acesssible normally, but 0x8000 onwards is not.

Am I missing something obvious?

Login or register to post comments

By albs_br

Champion (456)

albs_br's picture

28-09-2022, 16:08

I tried to create an working example on MSX Pen, but it looks like it cannot be used to create ROMs.

By santiontanon

Paragon (1699)

santiontanon's picture

28-09-2022, 16:59

This is the way I usually create 32KB ROMs:
- Look at the "SETPAGES32K " function here: https://github.com/santiontanon/westen/blob/main/src/auxilia...
- And you can see where do I call it in the main file here: https://github.com/santiontanon/westen/blob/main/src/main.asm

Happy to help if that does not work :)

By albs_br

Champion (456)

albs_br's picture

28-09-2022, 17:43

Your code didn't work at first, but then I realized that my VS Code build task is preconfigured to run openMSX with -romtype ASCII16 parameter...

So, I removed it and it runs just fine now. My previous code also works perfectly.

Thanks a lot

By santiontanon

Paragon (1699)

santiontanon's picture

28-09-2022, 17:45

Oh, cool!! Glad it worked Smile