Hawk Wars for MSX

Page 1/2
| 2

By NYYRIKKI

Enlighted (6067)

NYYRIKKI's picture

02-04-2023, 13:33

Hello,

I stumbled in to a MTX SHMUP source called "Hawk Wars" and after taking a peek I realized that the game could be ported to MSX in about one hour... Well... at least I thought so... Ok, I was able to to successfully test play it in about 1 hour, but for some reason the sound was missing. It turned out that I had no idea, how to enable SN76489AN in Musical Memory mapper. In the time I used to fight trough the initialization routine problems I could have adapted the sounds few times already to PSG as this "1 hour project" turned in to 10-hour nightmare.

How ever now that I finally learned to enable the I/O port for this purpose, I'm happy as it is. Feel free to play with MMM or without sounds. The game is not that great that I would like to put even this much effort in it, but I'm happy that now I know how to navigate trough MMM initialization.

Here is the game for you to enjoy

Ps. If you know the original, you might notice that it is a tiny bit slower, but that is no accident... I'm very sure you will die even on this speed. :) If you protest enough I can send you super fast version as well.

Login or register to post comments

By tfh

Prophet (3346)

tfh's picture

02-04-2023, 13:57

I like dying fast! Can you send me a copy?
And now you know everything about the game's audio routines, how about an PSG or SCC version?

By NYYRIKKI

Enlighted (6067)

NYYRIKKI's picture

02-04-2023, 14:15

tfh wrote:

I like dying fast! Can you send me a copy?
And now you know everything about the game's audio routines, how about an PSG or SCC version?

Well, that didn't take long Smile

I'm not going to calculate exact speed as the CPUs work differently, but maybe this is closer to original?

By NYYRIKKI

Enlighted (6067)

NYYRIKKI's picture

02-04-2023, 14:41

I also now updated the "fast version" with Muffie's SN76489AN emulator that is selected if the real chip is not found... Especially explosions seem to sound quite random, but maybe better than silence anyway. (Just download again to test)

By Manuel

Ascended (19462)

Manuel's picture

02-04-2023, 19:00

REminds me a bit of Maxima from PSS. Nice! Any (more) gems from that platform that are worth it?

By Wlcracks

Hero (565)

Wlcracks's picture

03-04-2023, 16:07

Well i though i knew something about MSX. But no way i can get this file working on a MSX1.

By NYYRIKKI

Enlighted (6067)

NYYRIKKI's picture

03-04-2023, 16:35

Well... It turned out that the Musical Memory mapper activation routine is still broken and so you can't get sound unless you are using openMSX... I need to look it again, when I find some time.

By Wlcracks

Hero (565)

Wlcracks's picture

03-04-2023, 16:49

ok, thanks for the fb

By hbarcellos

Hero (645)

hbarcellos's picture

17-05-2023, 04:51

NYYRIKKI wrote:

I also now updated the "fast version" with Muffie's SN76489AN emulator that is selected if the real chip is not found... Especially explosions seem to sound quite random, but maybe better than silence anyway. (Just download again to test)

I have an unfinished emulator with noise support that I used in a Gyruss conversion. I'll try to host it somewhere when I find it.

https://www.youtube.com/watch?v=RjYcCODa8FU

BTW, isn't that the computer used at the "Weird Science" movie?

By gdx

Enlighted (6208)

gdx's picture

17-05-2023, 09:26

The method to enable the SN76489AN of the MMM is indicated in the documentation.

First you have to detect the MMM slot.

Here is the example of detection routine from the documentation:

; Musical Memory Mapper detection
;
; Input: HL = address bank (8000h~BFFFh)
; Output: A = Slot number (0FFh if not found)
; Moditfy: AF, BC, DE, HL

MMM_Srch:
	ld	l,0FFh
	ld	b,16

MMM_Srch_Loop:
	push	hl

	ld	a,b
	dec	a
	and	3

	ld	hl,EXPTBL
	add	a,l
	ld	l,a

	ld	a,b
	dec	a
	or	(hl)

	pop    hl

	jp	m,Sec_SLT	; Jump if secondary Slot

	and	%00001111
	cp	4
	jr	nc,NextMMM_Srch ; Jump if 3-3 Slot

Sec_SLT:
	ld	c,a

	push	bc
	push	hl
	call	ENASLT		; Slot to search
	pop	hl
	pop	bc

	di

	ld	a,080h
	out	(03Ch),a	; Enable acces to registers by address mode

	ld	a,(hl)
	and	%00011111
	inc	a

	out	(0FFh),a

	or	%11000000
	cp	(hl)		; Same value?

	ld	a,0
	out	(03Ch),a
	out	(0FFh),a	; Restore initial mapper page on bank 0C000H~0FFFFH 

	ei

	ld	a,c		; A = Found Slot Number (F000SSPP)
	jr	z,MMM_Found

NextMMM_Srch:
	djnz	MMM_Srch_Loop	; Jump if MMM is not found

	ld	a,0FFh		; MMM not found value
	ret

MMM_Found:
	dec	b
	ret

This example is not easy to use from a binary file. It's better to create a more suitable one.

When the slot is known, enable the SN76489 by writing 40h at 0803Ch in this slot.

	ld	a,080h
	out	(03Ch),a	; Enable acces to registers by address mode
	ld	a,MMMSlt	; Slot Number
	ld	e,040h		; value to Enable the SN76489AN port of the MMM
	ld	hl,0803Ch	; Address to access the MMM register
	call	WRSLT

Just after the SN76489AN is enabled, set the volumes to 0 because this chip doesn't do that.

Volume0:
	ld	b,4
	ld	a,09Fh
Vol_Bcl:
	out	(03Fh),a	; Set the
	add	a,020h		; volume of SN76489AN
	djnz	Vol_Bcl		; to zero

By gdx

Enlighted (6208)

gdx's picture

18-05-2023, 15:59

It seems that OpenMSX doesn't correctly emulate access to segment change registers via addresses 40FCh-40FFh. Maybe it ignores the P3 bit to moves the addresses 803Ch, 80FCh-80FFh to 403Ch, 40FCh-40FFh.

Page 1/2
| 2