mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
swp30d: Small advances to the disassembler
This commit is contained in:
parent
1998db9f5d
commit
463846ee3b
@ -1488,9 +1488,11 @@ void swp30_device::execute_run()
|
||||
const std::array<u16, 3> &vol = m_mixer[mix].vol;
|
||||
|
||||
// It looks like this could be turned into something generic, but not 100% clear
|
||||
// routes 000100010001, 000200020002 etc seem to target the melo ports
|
||||
switch(route) {
|
||||
case 0x000000000000:
|
||||
// Incorrect, the program writes the outputs to m30/m31
|
||||
// Incorrect, the program writes the outputs to
|
||||
// m30/m31, but right now the program doesn't run.
|
||||
m_meg_output[0] += meg_att(input, (vol[0] >> 8) + (vol[1] >> 8));
|
||||
m_meg_output[1] += meg_att(input, (vol[0] & 0xff) + (vol[1] >> 8));
|
||||
break;
|
||||
|
@ -7,6 +7,49 @@
|
||||
//
|
||||
// Disassembler
|
||||
|
||||
// Known problems with the mu100 bios0 uploaded programs:
|
||||
//
|
||||
// At address 94 & 97, there's a missing r78 = p / r79 = p
|
||||
// respectively. Those are places where is both a rnn = p and mnn = p
|
||||
//
|
||||
// insertion1 rooms, at addresses cd, cf, d0, d2, d4, d5, dc, e3, e7
|
||||
// the r slots have data but are not used. No idea how they should be
|
||||
// used.
|
||||
//
|
||||
// Same for insertion2 rooms, addresses fd+
|
||||
//
|
||||
// Insertion 1/2 aural have a bunch of instructions (c7-ce, f7-fe)
|
||||
// using r02-r09 and r28/r3a which are not understood.
|
||||
//
|
||||
|
||||
// Amplitude lfo is missing something. For instance variation delay
|
||||
// m34 is loaded at 120 and used at 13c, but the way it is used is not
|
||||
// decoded. In practice, we do not yet have a way to multiply two
|
||||
// registers together, only with a constant.
|
||||
|
||||
// insertion phaser
|
||||
|
||||
// y0 = x1 + (y1 - x0) * lfo
|
||||
|
||||
// x = r4a
|
||||
// y = r4b
|
||||
|
||||
// 14f:
|
||||
// 66665555 55555544 44444444 33333333 33222222 22221111 11111100 00000000
|
||||
// 32109876 54321098 76543210 98765432 10987654 32109876 54321098 76543210
|
||||
|
||||
// XLB--ttt -rrrrrrr -xlmmmmm m-MM---- -P----** *--T-Arr rrrrrsmm mmmm----
|
||||
// 0000000003c25000 ........ ........ ........ ........ ......11 11....1. .1.1.... ........ p = 0 * x1
|
||||
// 0100000004925800 .......1 ........ ........ ........ .....1.. 1..1..1. .1.11... ........ p += 0 * y1
|
||||
// 014b000044925400 .......1 .1..1.11 ........ ........ .1...1.. 1..1..1. .1.1.1.. ........ p += 0 * x0 ; y0 = p
|
||||
|
||||
// 0000000000805800 ........ ........ ........ ........ ........ 1....... .1.11... ........ p += fp48a * r0b;
|
||||
// 0000000003822800 ........ ........ ........ ........ ......11 1.....1. ..1.1... ........ p = f1_2_c1 * r45;
|
||||
|
||||
// Important detail: the writes to register (rnn and mnn) seem to be
|
||||
// delayed by 2 cycles. That makes the filter computation work out.
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
#include "swp30d.h"
|
||||
|
||||
@ -49,15 +92,16 @@ void swp30_disassembler::append(std::string &r, const std::string &e)
|
||||
|
||||
// 66665555 55555544 44444444 33333333 33222222 22221111 11111100 00000000
|
||||
// 32109876 54321098 76543210 98765432 10987654 32109876 54321098 76543210
|
||||
// XLB----- -rrrrrrr rxlmmmmm m-MM---- -P-----* -----Arr rrrrrrmm mmmm----
|
||||
// XLB----- -rrrrrrr -xlmmmmm m-MM---- -P----** *c---Arr rrrrrsmm mmmm----
|
||||
|
||||
// m = low is read port, high is write port, memory register
|
||||
// r = low is read port, high is write port, rotating register
|
||||
|
||||
// X = used for lo-fi variation only
|
||||
// L = lfo read for memory offset
|
||||
// * = compute mul
|
||||
// * = compute mul + mode
|
||||
// A = mul input = m or r
|
||||
// s = substract to p instead of adding
|
||||
// P = P sent for register write
|
||||
// B = register write to mbuf
|
||||
// M = memory mode, none/read/write/read+1
|
||||
@ -77,21 +121,21 @@ offs_t swp30_disassembler::disassemble(std::ostream &stream, offs_t pc, const da
|
||||
switch(b(opc, 24, 2)) {
|
||||
case 0:
|
||||
if(b(opc, 18, 1))
|
||||
append(r, util::string_format("p += %s*m%02x", gconst(pc), b(opc, 4, 6)));
|
||||
append(r, util::string_format("p %c= %s*m%02x", b(opc, 10, 1) ? '-' : '+', gconst(pc), b(opc, 4, 6)));
|
||||
else
|
||||
append(r, util::string_format("p += %s*r%02x", gconst(pc), b(opc, 10, 8)));
|
||||
append(r, util::string_format("p %c= %s*r%02x", b(opc, 10, 1) ? '-' : '+', gconst(pc), b(opc, 11, 7)));
|
||||
break;
|
||||
case 1:
|
||||
append(r, util::string_format("p = %s*(r%02x+m%02x)", gconst(pc), b(opc, 10, 8), b(opc, 4, 6)));
|
||||
append(r, util::string_format("p %c= %s*(r%02x+m%02x)", b(opc, 10, 1) ? '-' : '+', gconst(pc), b(opc, 11, 7), b(opc, 4, 6)));
|
||||
break;
|
||||
case 2:
|
||||
append(r, util::string_format("p ?= %s*(r%02x+m%02x)", gconst(pc), b(opc, 10, 8), b(opc, 4, 6)));
|
||||
append(r, util::string_format("p = %s*(r%02x+m%02x)", gconst(pc), b(opc, 11, 7), b(opc, 4, 6)));
|
||||
break;
|
||||
case 3:
|
||||
if(b(opc, 18, 1))
|
||||
append(r, util::string_format("p = %s*m%02x", gconst(pc), b(opc, 4, 6)));
|
||||
else
|
||||
append(r, util::string_format("p = %s*r%02x", gconst(pc), b(opc, 10, 8)));
|
||||
append(r, util::string_format("p = %s*r%02x", gconst(pc), b(opc, 11, 7)));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -105,13 +149,13 @@ offs_t swp30_disassembler::disassemble(std::ostream &stream, offs_t pc, const da
|
||||
append(r, util::string_format("m%02x = p", b(opc, 39, 6)));
|
||||
|
||||
if(b(opc, 30, 1) == 1 && b(opc, 61, 1) == 0 && b(opc, 46, 1) == 0)
|
||||
append(r, util::string_format("r%02x = p", b(opc, 47, 8)));
|
||||
append(r, util::string_format("r%02x = p", b(opc, 48, 7)));
|
||||
|
||||
if(b(opc, 30, 1) == 0 && b(opc, 45, 2) == 2)
|
||||
append(r, util::string_format("m%02x = lfo.%02x", b(opc, 39, 6), pc >> 4));
|
||||
|
||||
if(b(opc, 30, 1) == 0 && b(opc, 45, 2) == 3)
|
||||
append(r, util::string_format("m%02x = unk", b(opc, 39, 6)));
|
||||
append(r, util::string_format("m%02x = m%02x", b(opc, 39, 6), b(opc, 4, 6)));
|
||||
|
||||
if(b(opc, 46, 2) == 2)
|
||||
append(r, util::string_format("m%02x = mr", b(opc, 39, 6)));
|
||||
|
Loading…
Reference in New Issue
Block a user