MAKOTO V3 driver: Difference between revisions
Jump to navigation
Jump to 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...") |
No edit summary |
||
Line 7: | Line 7: | ||
*OUT ($C0),A = 1 | *OUT ($C0),A = 1 | ||
*stuff with timer A | *stuff with timer A | ||
*banks init: | |||
<pre> | |||
ld a,#1e | |||
in a,(#08) | |||
ld a,#0e | |||
in a,(#09) | |||
ld a,#06 | |||
in a,(#0a) | |||
ld a,#02 | |||
in a,(#0b) | |||
</pre> | |||
*Reset FM | *Reset FM | ||
*out | *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: ?