Chibi Akumas Episode 2: Confrontation! [game for CPC then MSX2]

Página 3/9
1 | 2 | | 4 | 5 | 6 | 7 | 8

Por ARTRAG

Enlighted (6846)

Imagen del ARTRAG

24-09-2017, 12:50

If you only need disk and 64KB of ram, as this is your first msx game, maybe minimize the interactions with slot and mappers will make things easier. Msxdos in this case is a good option
You can have a look the sources of of the last example pointed by sd_snatcher here (msx2 scrolling with parallax):
https://github.com/artrag/Parallax_scrolling_MSX2/releases

PS
IIRC the CPC has the same AY8910, so a direct port of the audio code is just a matter of adjusting the frequencies in the data and replacing the I/O ports. I'm among those telling that using BIOS for accessing to the PSG is an unreasonable overhead.
PPS
About the VDP ports, as your code will work in RAM, keep note in the sources of where you use I/O ports. In this way you can do a simple patch system at boot time to replace the 98h/99h etc ports with 88h/89h etc if you detect an MA-20 expansion and you decide to support it.

Por AxelStone

Prophet (3121)

Imagen del AxelStone

24-09-2017, 23:00

Wow it works on Amstrad mode 1, really impresive for arcade games Cool

Por Grauw

Ascended (10605)

Imagen del Grauw

25-09-2017, 01:12

keith56 wrote:

Also, I don't think the question I asked before was quite answered - if the ram banks can be in different slots on different MSX models, how do I detect where they are so I can use them in a compatible way?

You have to search for it. But if a DiskROM is present (which it is for a disk game) there is an easier way; the BDOS has found them for you already and stored the slot IDs in system memory addresses F341H-F344H.

But I'd still recommend the DOS environment. 'snice Smile. Just need MSXDOS.SYS and COMMAND.COM on your disk, and I believe you can even hex-edit the name of your executable into MSXDOS.SYS to bypass COMMAND.COM entirely. Tho maybe save that for later.

Por keith56

Master (162)

Imagen del keith56

25-09-2017, 10:11

AxelStone wrote:

Wow it works on Amstrad mode 1, really impresive for arcade games Cool

If you ask me Mode 1 was very poorly used on the CPC! I wanted to see what I could make it do... unfortunately, Mode 1 is 320x200 on the CPC, so I will have to do some redesign for the MSX/Spectrum version due to the 256 pixel width - it's no biggie though, the game's internal co-ordinates work on a virtual screen of 160x200 with 24 pixel border on all sides for sprite clipping.

Grauw wrote:

You have to search for it. But if a DiskROM is present (which it is for a disk game) there is an easier way; the BDOS has found them for you already and stored the slot IDs in system memory addresses F341H-F344H.

Thanks! I found out about this yesterday, I've written some test code and it seems to work OK, even with all the MSX nasties mentioned in the compatability document and Acid test VMS... I'm going to start off trying to do things without DOS, but I will consider it if I get stuck.

ARTRAG wrote:

IIRC the CPC has the same AY8910, so a direct port of the audio code is just a matter of adjusting the frequencies in the data and replacing the I/O ports. I'm among those telling that using BIOS for accessing to the PSG is an unreasonable overhead.
PPS

ChibiAkumas uses a cut down version of ArkosPlayer - unfortunately part of the 'cutting down' was me taking out all the MSX code! so I'll have to put it back in! it was the impressive work done by Arkos and Symbos support of MSX that lead me to look at the system as a future platform for ChibiAkumas!

Por Grauw

Ascended (10605)

Imagen del Grauw

25-09-2017, 11:12

keith56 wrote:

Thanks! I found out about this yesterday, I've written some test code and it seems to work OK, even with all the MSX nasties mentioned in the compatability document and Acid test VMS... I'm going to start off trying to do things without DOS, but I will consider it if I get stuck.

Can I ask why you want to do it without DOS? DOS is really not a big OS or anything, it’s part of the DiskROM (= why it sets up F341H-F344H), MSXDOS.SYS is just a small bootstrap. RAM in all pages, slot routines and interrupt set up correctly, disk functions accessed via 5H, BIOS via interslot calls... That’s all it is, and it seems to match exactly the environment you’re looking for.

Por keith56

Master (162)

Imagen del keith56

25-09-2017, 13:48

Grauw wrote:

Can I ask why you want to do it without DOS? DOS is really not a big OS or anything, it’s part of the DiskROM (= why it sets up F341H-F344H), MSXDOS.SYS is just a small bootstrap. RAM in all pages, slot routines and interrupt set up correctly, disk functions accessed via 5H, BIOS via interslot calls... That’s all it is, and it seems to match exactly the environment you’re looking for.

The amstrad CPC interrupt routines were 10%-20% slower than the ones I wrote, and locked up the shadow registers limiting the optimizations I could make.

BDOS can do the disk loading I want so I don't see the need for MSX-DOS as well
I don't plan to do any slot switching - I now have usable Memory swap routines to bring the ram pages in, and restore for BDOS to work again
I'll be doing my own Graphics routines and sound routines - I won't be using bios for this - any overhead on the graphics routines will be a killer - the MSX is already twice the graphics bitdepth - and accessing the graphics via OUT rather than using the stack for fast fill like I do on the CPC is already a major slowdown I have to work around .

Put simply, anything I rely on that I didn't write is another thing I have to learn about. the reason I am confident I can port Chibi Akumas to another system is because I made no use of the CPC bios except for disk loading - and that is also the reason it is so fast.

Por Grauw

Ascended (10605)

Imagen del Grauw

25-09-2017, 14:59

None of that has anything to do with MSX-DOS Big smile.

I’m not saying, don’t hook up your own interrupt routine, or access everything via the BIOS, or code things slowly, or anything like that. Simply saying that, MSX-DOS environment is easier and better suited for your approach, with less hackiness, less likely to cause compatibility issues in the environment setup. Basically, the whole memory swap and restore thing is not needed in the MSX-DOS environment. You can spend the bytes you used on that code on something more useful.

p.s. The MSX ISR doesn’t touch shadow registers, so you are free to use them any way you like. Also, mind that the MSX Z80 is slower than the CPC’s because it runs at 3.58 MHz and has an M1 wait on every instruction (see 2nd column here).

Por AxelStone

Prophet (3121)

Imagen del AxelStone

25-09-2017, 14:33

@keith56 I'll be expecting CPC version of this Cotton game for CPC Wink . Who needs PC Engine / Mega Drive! Cool

Por ARTRAG

Enlighted (6846)

Imagen del ARTRAG

25-09-2017, 16:54

keith56, the sources for the parallax scrolling I linked above generate an msxdos program that loads from disk binary files for graphics and level data. Try to download the dsk file to see it at work.
The sources can be compiled using sjasm, the relevant files are already in the dsk file, but you can navigate them on github

Por DarkSchneider

Paladin (944)

Imagen del DarkSchneider

26-09-2017, 10:27

I recomend you at least to put your sound code at ISR and use the BIOS for PSG handling. On DOS, while ISR the BIOS is already set into page 0 so no need for inter-slot calls, very fast. If you don't use DOS you'll have to do it manually.

For graphics, 2 options:
- Using BIOS: it has many handy blitter functions doing the work for you. But if you have to call many in a frame, each one inter-slot, it can be slow. So you can enable BIOS at page 0 and when finished restore RAM. On DOS this can be done as mentioned here. If not using DOS is not a good idea to modify manually the slots, and ENASLT is not available as when changing the page 0 it will crash. In DOS this function is a jump to the routine in page 3 so it works fine.

- Using ports: in this case read the VDP ports and then patch the code as mentioned, or put them into some place in RAM, and when needed first read the value and use it with the Z80 OUT (C) instruction.

I only see advantages using DOS instead reinventing the wheel. Working for an OS is much more productive, as you can focus on your program.

Página 3/9
1 | 2 | | 4 | 5 | 6 | 7 | 8