mirror of
https://github.com/holub/mame
synced 2025-07-03 09:06:08 +03:00
jalmah.cpp: wrote a snippet for sound banking in Urashima Mahjong/Mahjong Channel Zoom In/Mahjong Daireikai [Angelo Salese]
This commit is contained in:
parent
a717977ad6
commit
a845a6c4fa
@ -368,7 +368,7 @@ uint32_t urashima_state::screen_update_urashima(screen_device &screen, bitmap_in
|
|||||||
|
|
||||||
bitmap.fill(m_palette->pen(0x1ff), cliprect); //selectable by a ram address?
|
bitmap.fill(m_palette->pen(0x1ff), cliprect); //selectable by a ram address?
|
||||||
|
|
||||||
for(int y = cliprect.min_y; y < cliprect.max_y; y++)
|
for(int y = cliprect.min_y; y < cliprect.max_y+1; y++)
|
||||||
{
|
{
|
||||||
clip.min_y = clip.max_y = y;
|
clip.min_y = clip.max_y = y;
|
||||||
|
|
||||||
@ -725,7 +725,7 @@ void jalmah_state::jalmah_map(address_map &map)
|
|||||||
// 0x080004, 0x080005 MCU read, different for each game
|
// 0x080004, 0x080005 MCU read, different for each game
|
||||||
map(0x080010, 0x080011).w(FUNC(jalmah_state::flip_screen_w));
|
map(0x080010, 0x080011).w(FUNC(jalmah_state::flip_screen_w));
|
||||||
// 0x080012, 0x080013 MCU write related,same for each game
|
// 0x080012, 0x080013 MCU write related,same for each game
|
||||||
// 0x080014, 0x080015 MCU write related (handshake), same for each game
|
map(0x080014, 0x080015).noprw(); // MCU handshake
|
||||||
map(0x080016, 0x080017).w(FUNC(jalmah_state::tilebank_w)).umask16(0x00ff);
|
map(0x080016, 0x080017).w(FUNC(jalmah_state::tilebank_w)).umask16(0x00ff);
|
||||||
map(0x080018, 0x080019).w(FUNC(jalmah_state::okibank_w));
|
map(0x080018, 0x080019).w(FUNC(jalmah_state::okibank_w));
|
||||||
map(0x08001a, 0x08001b).w(FUNC(jalmah_state::okirom_w));
|
map(0x08001a, 0x08001b).w(FUNC(jalmah_state::okirom_w));
|
||||||
@ -1201,10 +1201,10 @@ MACHINE_CONFIG_END
|
|||||||
|
|
||||||
// fake ROM containing 68k snippets
|
// fake ROM containing 68k snippets
|
||||||
// the original MCU actually uploads these into shared work ram area
|
// the original MCU actually uploads these into shared work ram area
|
||||||
//
|
// we actually compile it using EASy68k tool
|
||||||
#define LOAD_FAKE_MCU_ROM \
|
#define LOAD_FAKE_MCU_ROM \
|
||||||
ROM_REGION( 0x10000, "jmcu_rom", 0 ) \
|
ROM_REGION( 0x10000, "jmcu_rom", 0 ) \
|
||||||
ROM_LOAD16_WORD_SWAP( "mcu.bin", 0, 0x10000, BAD_DUMP CRC(43100728) SHA1(96ad65cd30026f7b58e8d3637b3109a221cafa4f)) \
|
ROM_LOAD16_WORD_SWAP( "mcu.bin", 0, 0x10000, BAD_DUMP CRC(35425d2f) SHA1(9a9914d4e50a665d4eb0efb80552f357fc719e7e)) \
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -31,9 +31,62 @@ UploadPaletteChunk:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
ORG $0800 ; sound code snippet
|
ORG $0800 ; sound code snippet
|
||||||
|
; move.w #$0, $8001a.l
|
||||||
|
; move.w $f0b80.l, $80018.l
|
||||||
|
; move.w $100ffc.l, $80018.l
|
||||||
|
; move.w $100ffe.l, $8001a.l
|
||||||
|
movem.l D1, -(A7)
|
||||||
|
move.w D0, D1
|
||||||
|
ror.w #$8, D1
|
||||||
|
and.w #$f, D1
|
||||||
|
bsr CheckSoundZA
|
||||||
|
bsr CheckSoundBank
|
||||||
|
move.w #$8, $80040.l
|
||||||
|
bsr SoundStatus
|
||||||
|
andi.w #$3f, D0
|
||||||
ori.w #$80, D0
|
ori.w #$80, D0
|
||||||
move.w D0, $80040.l
|
move.w D0, $80040.l
|
||||||
|
bsr SoundStatus
|
||||||
move.w #$10, $80040.l
|
move.w #$10, $80040.l
|
||||||
|
movem.l (A7)+, D1
|
||||||
|
rts
|
||||||
|
SoundStatus:
|
||||||
|
movem.l D0, -(A7)
|
||||||
|
ReadStatus:
|
||||||
|
move.w $80040.l, D0
|
||||||
|
andi.w #$1,D0
|
||||||
|
bne ReadStatus
|
||||||
|
movem.l (A7)+, D0
|
||||||
|
rts
|
||||||
|
; guess: special bits set in register D0 affect banking (oki can play up to 64 samples so bits 6 and 7 cannot be used)
|
||||||
|
CheckSoundZA:
|
||||||
|
btst #$6, D0 ;urashima BGM at start of game
|
||||||
|
beq NoZA1
|
||||||
|
ror.w #$1, D1
|
||||||
|
rts
|
||||||
|
NoZA1:
|
||||||
|
btst #$07, D0 ;mjzoomin BGM at start of game
|
||||||
|
beq NoZA2
|
||||||
|
move.w #$8, D1
|
||||||
|
NoZA2:
|
||||||
|
rts
|
||||||
|
CheckSoundBank:
|
||||||
|
cmpi.w #$1, D1
|
||||||
|
beq SetBank0
|
||||||
|
cmpi.w #$2, D1
|
||||||
|
beq SetBank1
|
||||||
|
cmpi.w #$4, D1
|
||||||
|
beq SetBank2
|
||||||
|
move.w #$3, $80018.l
|
||||||
|
rts
|
||||||
|
SetBank0:
|
||||||
|
move.w #$0, $80018.l
|
||||||
|
rts
|
||||||
|
SetBank1:
|
||||||
|
move.w #$1, $80018.l
|
||||||
|
rts
|
||||||
|
SetBank2:
|
||||||
|
move.w #$2, $80018.l
|
||||||
rts
|
rts
|
||||||
|
|
||||||
ORG $1000 ; tile upload snippet
|
ORG $1000 ; tile upload snippet
|
||||||
@ -89,6 +142,7 @@ ClearLayer:
|
|||||||
ORG $fffe ; extend binary ROM to 0x10000 in size
|
ORG $fffe ; extend binary ROM to 0x10000 in size
|
||||||
dc.w $ffff
|
dc.w $ffff
|
||||||
END START
|
END START
|
||||||
|
|
||||||
*~Font name~Courier New~
|
*~Font name~Courier New~
|
||||||
*~Font size~10~
|
*~Font size~10~
|
||||||
*~Tab type~1~
|
*~Tab type~1~
|
||||||
|
Loading…
Reference in New Issue
Block a user