Difference between revisions of "MAKOTO V3 driver"

From NeoGeo Development Wiki
Jump to: navigation, search
m (Created page with "==Cold boot process== *DI, SP at $FFFC, IM=1 *Clear $F800~$FFFF *Clear the command buffer (128 bytes) and pointers *Silences FM, PCM and SSG *OUT ($C0),A = 1 *stuff with timer A...")
 
 
Line 7: Line 7:
 
*OUT ($C0),A = 1
 
*OUT ($C0),A = 1
 
*stuff with timer A
 
*stuff with timer A
0174  3e1e      ld      a,#1e
+
*banks init:
0176  db08      in      a,(#08)
+
<pre>
0178  3e0e      ld      a,#0e
+
ld      a,#1e
017a  db09      in      a,(#09)
+
in      a,(#08)
017c  3e06      ld      a,#06
+
ld      a,#0e
017e  db0a      in      a,(#0a)
+
in      a,(#09)
0180  3e02      ld      a,#02
+
ld      a,#06
0182  db0b      in      a,(#0b)
+
in      a,(#0a)
 +
ld      a,#02
 +
in      a,(#0b)
 +
</pre>
 
*Reset FM
 
*Reset FM
*out     (#08),a
+
*out (#08),a
 
*EI
 
*EI
 
*loop while buffer read index = buffer in index
 
*loop while buffer read index = buffer in index

Latest revision as of 15:49, 25 December 2011

Cold boot process

  • DI, SP at $FFFC, IM=1
  • Clear $F800~$FFFF
  • Clear the command buffer (128 bytes) and pointers
  • Silences FM, PCM and SSG
  • OUT ($C0),A = 1
  • stuff with timer A
  • banks init:
ld      a,#1e
in      a,(#08)
ld      a,#0e
in      a,(#09)
ld      a,#06
in      a,(#0a)
ld      a,#02
in      a,(#0b)
  • Reset FM
  • out (#08),a
  • EI
  • loop while buffer read index = buffer in index
  • inc buffer read index
  • AND index with $3F (keeps it under 64)
  • Reads buffer, clears entry to 0
  • If command = 0, read R, out (#0c),a and loop back to EI
  • If command != 0:
  • Translate command by LUT, ret if =0, can be anything 1~5.
  • LUT is something like 0,1...,2...,0...,5...,0...4...,0...,3,3
  • 1:Special command, uses a jump table (0~27)
    • 0:RET, should not happen
    • 1:DI,reset banks,out (#0c),a=0, wait,out (#0c),a=0 again, init YM2610, out (#0c),a=1

Has a 2*64 byte command FIFO.

  • Command 5: Stop music (pause ?)
  • Command 7: Play music in following byte
  • Command A: Fade, speed in following byte
  • Command E: Set music speed

Command type translation table at $4FAF.

  • 0: Ignore
  • 1: Special command
  • 2: ?
  • 3: ?
  • 4: ?
  • 5: ?