Writing / Reading VRAM - noob questions

Page 7/9
1 | 2 | 3 | 4 | 5 | 6 | | 8 | 9

Par ARTRAG

Enlighted (6976)

Portrait de ARTRAG

24-12-2021, 19:07

About 48kb roms, for games on msx1 there is no real compatibility issue in switching off the bios as all existing msx machines have at least a vdp, a ppi and a psg at the same ports. Even if this is not standard if you need only these components you will get a working rom on all msx machines.

Par siudym

Resident (39)

Portrait de siudym

25-12-2021, 12:15

I heard about something like ASCII mapper for MSX1 and roms have 128KB - what is this device?

Par thegeps

Paragon (1249)

Portrait de thegeps

25-12-2021, 12:49

A mapper is the way data are stored and reachable in memory and/or in a cartridge. The ASCII16 mapper is a megarom cartridge mapper. You usually have a 16KB page at 4000h and can instantly switch 16KB pages (up to 256 pages!) at 8000h, plus (almost) 16KB RAM at c000h. I said usually because I think it is possible (and I'll try it some of next days) to have also a page at 0000h (kicking out the BIOS and adding at 38h my own ISR routine): so 32KB of fixed code and a switchable page (plus, obviously, 16KB RAM)

Par ARTRAG

Enlighted (6976)

Portrait de ARTRAG

25-12-2021, 13:33

You can find more details here
https://www.msx.org/wiki/MegaROM_Mappers

Par siudym

Resident (39)

Portrait de siudym

28-12-2021, 11:48

I checked WYZTracker and its ASMPlayer - everything works great and very simple. I just don't know if asm player has the ability to use more than one SONG in the code?

Update demo, I wrote a simple melody:
https://dl.dropboxusercontent.com/s/djvb13lhhfgpdns/msxbombe...

Par ARTRAG

Enlighted (6976)

Portrait de ARTRAG

28-12-2021, 13:27

Use A to tell which song number you want to start

		LD	A,0			;REPRODUCIR LA CANCION Nº 0
		CALL	CARGA_CANCION

Load the MUS files in ROM and generate a table with their addresses named TABLA_SONG

TABLA_SONG:	DW	SONG_0,SONG_1,SONG_2


SONG_0:		.INCBIN	"EXTERNAL0.MUS" ;
SONG_1:		.INCBIN	"EXTERNAL1.MUS" ;
SONG_2:		.INCBIN	"EXTERNAL2.MUS" ;

Reference code is here
https://github.com/AugustoRuiz/WYZTracker/blob/master/AsmPla...

The player where you can find CARGA_CANCION is here

https://github.com/AugustoRuiz/WYZTracker/blob/master/AsmPla...

Par jltursan

Prophet (2619)

Portrait de jltursan

28-12-2021, 13:45

Quote:

Update demo, I wrote a simple melody:

Cool, sounds good...and you're fast!.

Just out of curiosity and thinking in bomb SFX, is the WYZTracker player compatible with ayFX replay routine?, I mean if both can be interleaved without issues...

Par gdx

Enlighted (6425)

Portrait de gdx

28-12-2021, 14:50

thegeps wrote:

I said usually because I think it is possible (and I'll try it some of next days) to have also a page at 0000h (kicking out the BIOS and adding at 38h my own ISR routine): so 32KB of fixed code and a switchable page (plus, obviously, 16KB RAM)

You can do it with a usual mapper if make the cartridge with mirrors as Konami cartridges.

Par siudym

Resident (39)

Portrait de siudym

28-12-2021, 17:53

Great, thanks @ARTRAG. I changed the code and put in a different melody when we put the bomb. Works great.

Par ARTRAG

Enlighted (6976)

Portrait de ARTRAG

29-12-2021, 11:50

For SFX, the usual strategy is to overwrite the music data in the PSG registers, sacrificing a given channel (e.g. the one used for basses or drums). In detail, on the same call of the ISR:
- run the music player, BUT you save in RAM the values of the PSG registers without actually updating the AY8910.
- run the SFX player, overwriting the copy of the PSG registers, take care of register 7 (the mixer) by AND and OR
- update the AY8910 by coping the RAM data to its registers

This avoids audible glitches due to updating twice in the same interrupt the PSG registers.

If you look at the player (and its editor) here
https://github.com/Threetwosevensixseven/ayfxedit-improved
you will note that it will not mute the channel after the effect ends.
The reason is that the sfx player relies on the fact the channel is used by the music player

Page 7/9
1 | 2 | 3 | 4 | 5 | 6 | | 8 | 9