ASCII 8 mapper does not work

By Metalion

Paragon (1130)

Metalion's picture

05-01-2020, 18:10

Hello,

I have trouble making the ASCII 8 mapper work.
The pages are defined (I have 5 pages defined) :

	defpage x,08000h,2000h
	page	x
	...

And I have put this code at some point at the beginning to facilitate the automatic recognition :

	ld	a,0
	ld	(6000h),a
	ld	a,1
	ld	(6800h),a
	ld	a,2
	ld	(7000h),a
	ld	a,3
	ld	(7800h),a

But whenever I select another page, the memory page does not switch.
This code does not work :

	ld	a,4
	ld	(6800h),a

It does not work both on BlueMSX and OpenMSX.
Even when I force BlueMSX to ASCII8 mapper, it does not work !!
I really do not understand why ........

What's worse, I have another program where it works ! And it's the same code.
Only this one has 9 pages defined.

Login or register to post comments

By ARTRAG

Enlighted (6359)

ARTRAG's picture

05-01-2020, 18:23

Automatic recognition can fail. Try to override it by manually selecting ASCII-8 mapper in the rom selection menu of bluemsx or in catapult.

By Metalion

Paragon (1130)

Metalion's picture

05-01-2020, 18:36

Even if I force BlueMSX, it does not work ......
I can see in the debugger that the memory seen by the Z80 does not change.

It's really frustrating, because it seems to me that it works at random.
Sometime it works, sometimes it don't !! Evil

By ARTRAG

Enlighted (6359)

ARTRAG's picture

05-01-2020, 18:38

Try in open msx. Use its debugger, make sure to select manually the mapper and look at 8000h area when you write in 6800h

If it is still failing, make sure that the page at 8000h is set on the slot where your megarom is (it is a common error to look at the wrong slot). The openmsx debugger is handy for this as it shows you all slots for each page

By Metalion

Paragon (1130)

Metalion's picture

05-01-2020, 18:44

How can I force ASCII8 in Catapult ?
And where in the debugger can I see the slots ?

The page at 8000h is correctly set (I think), because I use the 'search_rom' code at initialization:

	call	138h
[2]	rrca
	and	03h
	ld	c,a
	ld	hl,0FCC1h
	add	a,l
	ld	l,a
	ld	a,(hl)
	and	80h
	or	c
	ld	c,a
[4]	inc	l
	ld	a,(hl)
	and	0Ch
	or	c
	ld	h,80h
	jp	24h

What I do not understand, is that it works in one program and not in the other !

By Metalion

Paragon (1130)

Metalion's picture

05-01-2020, 19:00

Now it works.
But I had to add 11 empty pages (1 'nop' in each) to make a 'standard' size megarom.

I already had that problem in BlueMSX a few years back, and I remember that dvik said it would be fixed (as no standard is written that says that a megarom HAS to have 2^n pages). Maybe I've got a old version of BlueMSX.

As for OpenMSX, it works with my other program that has 9 pages, but doesn't with 5 pages. And it works with 16 pages, of course. So maybe there's also a update to make there.

Thanks Arturo.

EDIT : it works with 16 pages in OpenMSX but not in BlueMSX ... It somehow returns to BASIC, even if I force the ASCII mapper. WTF ???

By Grauw

Ascended (9048)

Grauw's picture

05-01-2020, 21:04

Metalion wrote:

Maybe I've got a old version of BlueMSX.

You must have, because it hasn’t been updated since 2009 Tongue.

OpenMSX Debugger is a separate download on their website.

By hit9918

Prophet (2891)

hit9918's picture

05-01-2020, 22:10

you use the slot bits of page 1 while meaning the page 2
it should be done as a function, not as inlined code
getslt2

edit: oh wait, or maybe you did mean page 1. to copy it to page 2
still an argument against inlined slot code

By Manuel

Ascended (16619)

Manuel's picture

05-01-2020, 23:53

You can check which mapper type openMSX detected, if you insist on using auto-detection. Easiest is to enable the "info panel" in the OSD menu -> Advanced... -> Toys and Utilities menu.

To force the mapper type in Catapult, use the "Cart A" button as described here: http://openmsx.org/catapult-manual/user.html#software and select the mapper type there. You can confirm with the above.

By sdsnatcher73

Paladin (927)

sdsnatcher73's picture

06-01-2020, 07:00

Metalion wrote:

as no standard is written that says that a megarom HAS to have 2^n pages

Although not a written standard but actual chips of course are usually made with this principle. It is why there are 1kB, 2kB, 4kB, 8kB, etc. chips but no 3kB, 5kB and so on. So when designing megaROMs no one made a 80kB megaROM. Of course it would have been possible with 2 chips (64kB plus 16kB), but it was probably cheaper and easier with 1 chip (128kB, 256kB).

So adding the empty pages seems logical for both emulation but also for use in real hardware with flash devices (either through native tools or SofaRun).