mirror of
https://github.com/libretro/xmil-libretro.git
synced 2024-11-23 08:09:42 +00:00
fix...
This commit is contained in:
parent
3587784504
commit
b0af4960b8
@ -16,7 +16,7 @@ enum {
|
||||
#if defined(SIZE_QVGA)
|
||||
static const MENUPRM res_about[] = {
|
||||
{DLGTYPE_ICON, DID_ICON, 0,
|
||||
(void *)MICON_NP2, 7, 7, 24, 24},
|
||||
(void *)MICON_XMIL, 7, 7, 24, 24},
|
||||
{DLGTYPE_LTEXT, DID_VER, 0,
|
||||
NULL, 40, 14, 128, 11},
|
||||
{DLGTYPE_BUTTON, DID_OK, MENU_TABSTOP,
|
||||
@ -24,7 +24,7 @@ static const MENUPRM res_about[] = {
|
||||
#else
|
||||
static const MENUPRM res_about[] = {
|
||||
{DLGTYPE_ICON, DID_ICON, 0,
|
||||
(void *)MICON_NP2, 14, 12, 32, 32},
|
||||
(void *)MICON_XMIL, 14, 12, 32, 32},
|
||||
{DLGTYPE_LTEXT, DID_VER, 0,
|
||||
NULL, 64, 24, 180, 13},
|
||||
{DLGTYPE_BUTTON, DID_OK, MENU_TABSTOP,
|
||||
|
@ -55,17 +55,17 @@ static const MENUPRM res_cfg[] = {
|
||||
{DLGTYPE_RADIO, DID_Z80H, MENU_GRAY,
|
||||
str_z80h, 16, 48, 120, 11},
|
||||
{DLGTYPE_FRAME, DID_STATIC, 0,
|
||||
"Sound", 6, 70, 244, 52},
|
||||
str_sound, 6, 70, 244, 52},
|
||||
{DLGTYPE_LTEXT, DID_STATIC, 0,
|
||||
"Rate", 16, 86, 40, 11},
|
||||
str_rate, 16, 86, 40, 11},
|
||||
{DLGTYPE_RADIO, DID_RATE11, MENU_TABSTOP,
|
||||
"11KHz", 60, 86, 60, 11},
|
||||
str_11khz, 60, 86, 60, 11},
|
||||
{DLGTYPE_RADIO, DID_RATE22, 0,
|
||||
"22KHz", 120, 86, 60, 11},
|
||||
str_22khz, 120, 86, 60, 11},
|
||||
{DLGTYPE_RADIO, DID_RATE44, 0,
|
||||
"44KHz", 180, 86, 60, 11},
|
||||
str_44khz, 180, 86, 60, 11},
|
||||
{DLGTYPE_LTEXT, DID_STATIC, 0,
|
||||
"Buffer", 16, 105, 40, 11},
|
||||
str_buffer, 16, 105, 40, 11},
|
||||
{DLGTYPE_SLIDER, DID_BUFFER, MSS_BOTH | MENU_TABSTOP,
|
||||
(void *)SLIDERPOS(100, 1000), 60, 104, 140, 13},
|
||||
{DLGTYPE_RTEXT, DID_BUFSTR, 0,
|
||||
|
@ -12,34 +12,45 @@ const OEMCHAR mstr_about[] = OEMTEXT("About");
|
||||
|
||||
// ----
|
||||
|
||||
static const UINT8 np2icondat[210] = { // 32x32
|
||||
0x06,0x6f,0x00,0x00,0x3f,0x00,0x2d,0xff,0x00,0x0a,0x0d,0x7f,0x09,
|
||||
0x9c,0x0c,0xa3,0xf8,0x0b,0xf8,0x0f,0x94,0x16,0x5a,0x0f,0x94,0x23,
|
||||
0xdd,0xc0,0xc0,0xc0,0xc7,0x28,0x5a,0x17,0x0e,0x80,0x80,0x80,0x0b,
|
||||
0xc2,0x17,0xe9,0x0b,0x05,0xff,0x18,0xa3,0x17,0x11,0x0d,0x45,0x18,
|
||||
0xa6,0x17,0xe6,0x00,0x02,0x85,0x66,0x17,0x2c,0xff,0x14,0x08,0x47,
|
||||
0x23,0x68,0xd1,0x17,0x23,0x18,0x8e,0x47,0x1d,0x9c,0x9d,0x03,0x9a,
|
||||
0xff,0x00,0x08,0x4a,0x02,0xcb,0x2c,0x17,0xef,0xe3,0x2f,0x17,0xec,
|
||||
0x47,0x20,0x17,0xda,0xff,0x70,0x4b,0x03,0x91,0x17,0xff,0x00,0x25,
|
||||
0x5f,0x23,0x1c,0x5a,0x03,0x88,0xbb,0x48,0xff,0x13,0x75,0x6e,0xe0,
|
||||
0x47,0x3b,0xdd,0xe0,0x17,0x08,0x13,0x7b,0x61,0x6f,0x2f,0x3f,0xff,
|
||||
0xdd,0x19,0x31,0x7f,0x8c,0xe2,0x8d,0xb8,0x18,0xa3,0x30,0x3f,0xa4,
|
||||
0xd0,0xba,0xbe,0xff,0xf4,0x6c,0x20,0x11,0x1d,0xf2,0x8d,0xa6,0x92,
|
||||
0x35,0x77,0xe3,0x2f,0xc8,0x17,0x02,0xff,0x2f,0xef,0xbf,0x23,0x5e,
|
||||
0x7f,0x17,0xe2,0xf5,0xc5,0x00,0x05,0x12,0xa0,0x2f,0xfe,0xff,0x35,
|
||||
0x1a,0x0e,0xd4,0x02,0x0e,0x05,0xdd,0x4c,0x60,0x17,0xd7,0x14,0xd7,
|
||||
0x0c,0x94,0xfc,0x5d,0xa9,0x53,0xc5,0x4d,0xd7,0x5e,0x48,0x7a,0x3f,
|
||||
0x00,0x3a};
|
||||
static const UINT8 xmilicondat[385] = { // 32x32
|
||||
0x06,0x7a,0x00,0x00,0x3f,0x00,0x3f,0x00,0x3f,0x00,0x1f,0x84,0x00,
|
||||
0x04,0xc6,0x2f,0xc6,0xc6,0x0a,0x78,0x84,0x06,0x42,0x00,0x96,0x0e,
|
||||
0xcb,0x18,0x9d,0xed,0x17,0x05,0x05,0xd2,0x11,0x03,0xff,0x01,0xc3,
|
||||
0x01,0x55,0x00,0x15,0x82,0xff,0x0e,0x05,0x18,0x88,0x03,0x88,0x01,
|
||||
0x4b,0x08,0xce,0x17,0xcd,0x1d,0xd2,0x2e,0x51,0xfd,0x11,0x05,0x00,
|
||||
0x08,0x04,0x54,0x0a,0x42,0x17,0xd3,0x29,0xc3,0xff,0x00,0x04,0xfe,
|
||||
0x09,0xc5,0x00,0x8b,0x11,0xd1,0x17,0xd7,0x5f,0x17,0x11,0x85,0x17,
|
||||
0x08,0xff,0x5f,0xff,0x1c,0x84,0xff,0x02,0x06,0x11,0xd1,0x4c,0x4e,
|
||||
0x1d,0xd1,0x2f,0xd4,0xff,0x2e,0x51,0x2f,0xd1,0x32,0xe3,0x2f,0xd7,
|
||||
0x01,0x85,0x2f,0x1a,0x38,0xc5,0x5d,0x94,0xff,0x05,0xce,0x2f,0xd5,
|
||||
0x2d,0x90,0x9e,0xd7,0x45,0x88,0x4a,0x08,0xa8,0x9a,0x2f,0xd1,0xff,
|
||||
0x2f,0x08,0x25,0x04,0x25,0x52,0x17,0xdd,0x2f,0xe6,0x8f,0x14,0x0c,
|
||||
0x85,0x74,0xcb,0xff,0x8c,0x08,0x78,0x97,0x5f,0xd7,0xfe,0xd7,0x00,
|
||||
0x02,0x5b,0x42,0x01,0x4e,0x1c,0x48,0xff,0xef,0xd9,0x2f,0xde,0x11,
|
||||
0x05,0x14,0x05,0x14,0xc5,0x32,0x05,0x03,0x88,0x19,0x57,0xff,0x2f,
|
||||
0xca,0x06,0x02,0x00,0x8c,0x3d,0x4b,0x17,0x08,0x02,0xc2,0x14,0xc5,
|
||||
0xe4,0x8b,0xff,0x18,0x9a,0x2f,0xc7,0x01,0x54,0x2f,0x0f,0x0f,0x8b,
|
||||
0x30,0x85,0x08,0x1a,0x00,0x23,0xff,0x2f,0xce,0x5c,0x0b,0x04,0x54,
|
||||
0x79,0x54,0x46,0x51,0x47,0x14,0x74,0xcb,0x00,0x0b,0xff,0x1d,0x11,
|
||||
0x17,0xcb,0x5f,0xc7,0x47,0x21,0x74,0x0b,0x18,0x91,0x07,0x45,0x17,
|
||||
0xd6,0xff,0x14,0x03,0x08,0xc4,0x01,0x4b,0x17,0xcf,0xbf,0xcb,0x17,
|
||||
0x0b,0xdd,0x0b,0x49,0x4e,0xff,0x2f,0xce,0x18,0x8b,0x0c,0x8e,0x0e,
|
||||
0x08,0x1e,0x85,0x17,0x0b,0x05,0xc8,0x48,0x94,0xff,0x2f,0xdd,0xbd,
|
||||
0x8e,0x42,0x88,0x17,0xcb,0xc0,0x8e,0x17,0xd3,0x5f,0xd8,0x76,0x4e,
|
||||
0xff,0x42,0x85,0x5f,0x0e,0x4d,0x0b,0x2f,0xda,0x01,0x50,0x5f,0xcc,
|
||||
0x75,0x94,0x79,0x51,0xff,0xc0,0x93,0xc2,0xd8,0xa7,0xd4,0x16,0x5d,
|
||||
0x77,0x0e,0x11,0x86,0x00,0x96,0x18,0x8e,0xff,0x71,0x11,0x7e,0x91,
|
||||
0xd7,0x11,0x2f,0xc4,0x00,0x97,0x32,0xd2,0x00,0x1d,0x42,0x97,0xff,
|
||||
0x00,0x14,0x53,0x13,0x00,0x1e,0x53,0xcb,0x0b,0x26,0x24,0xac,0x0e,
|
||||
0x3e,0x00,0x3f,0xc0,0x00,0x3f,0x00,0x12};
|
||||
|
||||
static const UINT8 np2iconmask[95] = { // 32x32
|
||||
0x06,0x5f,0x00,0x00,0x03,0xff,0x00,0x02,0x02,0x04,0x00,0x08,0x04,
|
||||
0x4c,0x03,0x03,0xff,0x04,0x0b,0x03,0xce,0x03,0x87,0x04,0x46,0x03,
|
||||
0x8e,0x04,0x0c,0x00,0x0e,0x07,0xff,0xff,0x20,0x11,0x07,0x93,0x07,
|
||||
0xff,0x07,0xe0,0x08,0x16,0x53,0x4d,0x07,0xff,0x1f,0xb0,0xff,0x10,
|
||||
0x1f,0x7b,0x8f,0x17,0xb0,0x10,0x8c,0x17,0x6f,0x9c,0x90,0x06,0x9a,
|
||||
0x08,0x50,0xff,0x03,0x05,0x07,0xdb,0x11,0x12,0x17,0x8c,0x1f,0xdf,
|
||||
0x07,0xe3,0x06,0x4a,0x50,0x9b,0xf8,0x4f,0x99,0x08,0x20,0x9f,0xff,
|
||||
0x2f,0x51,0xef,0x10};
|
||||
static const UINT8 xmiliconmask[74] = { // 32x32
|
||||
0x07,0x47,0x00,0x00,0x29,0xff,0xff,0xff,0x06,0x98,0x08,0x05,0x09,
|
||||
0x0a,0xff,0x06,0x88,0x04,0x04,0x00,0x09,0x0c,0x06,0x06,0x06,0x0f,
|
||||
0x10,0x16,0x0e,0x0f,0xbd,0xff,0x3f,0x12,0x0f,0xcc,0x4f,0xa0,0x74,
|
||||
0x08,0x6f,0xd5,0x2f,0xc0,0x10,0x02,0x0f,0x9f,0xff,0x20,0x3f,0x5f,
|
||||
0xbc,0x00,0x7f,0x5f,0xc0,0xaf,0xa2,0x00,0x06,0x10,0x1f,0x17,0x8f,
|
||||
0xf0,0x08,0x10,0x0e,0x0c,0x09,0x18,0x00,0x10};
|
||||
|
||||
const MENURES np2icon = {32, 32, np2icondat, np2iconmask};
|
||||
const MENURES xmilicon = {32, 32, xmilicondat, xmiliconmask};
|
||||
|
||||
|
@ -7,7 +7,7 @@ extern const OEMCHAR mstr_cfg[];
|
||||
extern const OEMCHAR mstr_scropt[];
|
||||
extern const OEMCHAR mstr_about[];
|
||||
|
||||
extern const MENURES np2icon;
|
||||
extern const MENURES xmilicon;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -8,8 +8,13 @@ enum {
|
||||
FMVOL_SFTBIT = 5
|
||||
};
|
||||
|
||||
#if !defined(_WIN32_WCE)
|
||||
#define SIN_BITS 10
|
||||
#define EVC_BITS 10
|
||||
#else
|
||||
#define SIN_BITS 8
|
||||
#define EVC_BITS 7
|
||||
#endif
|
||||
#define ENV_BITS 16
|
||||
#define KF_BITS 6
|
||||
#define FREQ_BITS 20
|
||||
|
322
wince/arm/opmgeng.s
Normal file
322
wince/arm/opmgeng.s
Normal file
@ -0,0 +1,322 @@
|
||||
|
||||
FMDIV_BITS equ 9
|
||||
FMDIV_ENT equ (1 << FMDIV_BITS)
|
||||
FMVOL_SFTBIT equ 5
|
||||
|
||||
SIN_BITS equ 8
|
||||
EVC_BITS equ 7
|
||||
ENV_BITS equ 16
|
||||
KF_BITS equ 6
|
||||
FREQ_BITS equ 20
|
||||
ENVTBL_BIT equ 14
|
||||
SINTBL_BIT equ 14
|
||||
|
||||
TL_BITS equ (FREQ_BITS + 2)
|
||||
OPM_OUTSB equ (TL_BITS + 2 - 16)
|
||||
|
||||
SIN_ENT equ (1 << SIN_BITS)
|
||||
EVC_ENT equ (1 << EVC_BITS)
|
||||
|
||||
EC_ATTACK equ 0
|
||||
EC_DECAY equ (EVC_ENT << ENV_BITS)
|
||||
EC_OFF equ ((2 * EVC_ENT) << ENV_BITS)
|
||||
|
||||
EM_ATTACK equ 4
|
||||
EM_DECAY1 equ 3
|
||||
EM_DECAY2 equ 2
|
||||
EM_RELEASE equ 1
|
||||
EM_OFF equ 0
|
||||
|
||||
|
||||
; s_detune1 equ 0
|
||||
; s_detune2 equ 4
|
||||
S1_TOTALLEVEL equ 8
|
||||
S1_DECAYLEVEL equ 12
|
||||
; s_attack equ 16
|
||||
; s_decay1 equ 20
|
||||
; s_decay2 equ 24
|
||||
; s_release equ 28
|
||||
S1_FREQ_CNT equ 32
|
||||
S1_FREQ_INC equ 36
|
||||
; s_keyscale equ 40
|
||||
; s_multiple equ 41
|
||||
S1_ENV_MODE equ 42
|
||||
; s_envraito equ 43
|
||||
S1_ENV_CNT equ 44
|
||||
S1_ENV_END equ 48
|
||||
S1_ENV_INC equ 52
|
||||
; s_env_inc_attack equ 56
|
||||
S1_ENVINCDECAY1 equ 60
|
||||
S1_ENVINCDECAY2 equ 64
|
||||
; s_env_inc_release equ 68
|
||||
S_SIZE equ 72
|
||||
|
||||
; c_algorithm equ (S_SIZE * 4 + 0)
|
||||
C_FEEDBACK equ (S_SIZE * 4 + 1)
|
||||
C_PLAYING equ (S_SIZE * 4 + 2)
|
||||
C_OUTSLOT equ (S_SIZE * 4 + 3)
|
||||
C_OP1FB equ (S_SIZE * 4 + 4)
|
||||
C_CONNECT1 equ (S_SIZE * 4 + 8)
|
||||
C_CONNECT3 equ (S_SIZE * 4 + 12)
|
||||
C_CONNECT2 equ (S_SIZE * 4 + 16)
|
||||
C_CONNECT4 equ (S_SIZE * 4 + 20)
|
||||
; c_keynote equ (S_SIZE * 4 + 24)
|
||||
; c_keyfunc equ (S_SIZE * 4 + 28)
|
||||
; c_kcode equ (S_SIZE * 4 + 29)
|
||||
; c_pan equ (S_SIZE * 4 + 30)
|
||||
; c_padding1 equ (S_SIZE * 4 + 31)
|
||||
C_SIZE equ (S_SIZE * 4 + 32)
|
||||
|
||||
G_PLAYING equ 0
|
||||
; G_mode equ 4
|
||||
G_FEEDBACK2 equ 8
|
||||
G_FEEDBACK3 equ 12
|
||||
G_FEEDBACK4 equ 16
|
||||
G_OUTDL equ 20
|
||||
G_OUTDC equ 24
|
||||
G_OUTDR equ 28
|
||||
G_CALCREMAIN equ 32
|
||||
; G_keyreg equ 36
|
||||
|
||||
T_ORG equ 8
|
||||
T_CALC1024 equ (0 - T_ORG)
|
||||
T_FMVOL equ (4 - T_ORG)
|
||||
T_sintable equ (8 - T_ORG)
|
||||
T_envtable equ (8 - T_ORG + SIN_ENT * 4)
|
||||
T_envcurve equ (8 - T_ORG + SIN_ENT * 4 + EVC_ENT * 4)
|
||||
|
||||
IMPORT opmch
|
||||
IMPORT opmgen
|
||||
IMPORT opmcfg
|
||||
|
||||
EXPORT opmgen_getpcm
|
||||
|
||||
AREA .text, CODE, READONLY
|
||||
|
||||
; r0 Temporary Register
|
||||
; r1 Offset
|
||||
; r2 Counter
|
||||
; r3 Temporary Register
|
||||
; r4 Temporary Register
|
||||
; r5 channel counter
|
||||
; r6 OPMCH
|
||||
; r7 OPMCH base
|
||||
; r8 L
|
||||
; r9 R
|
||||
; r10 opmgen Fix
|
||||
; r11 opmcfg Fix
|
||||
; r12 Temporary Register
|
||||
|
||||
MACRO
|
||||
$label SLTFREQ $o, $upd
|
||||
$label ldr r3, [r6, #($o + S1_ENV_INC)] ; calc env
|
||||
ldr r4, [r6, #($o + S1_ENV_CNT)]
|
||||
ldr r12, [r6, #($o + S1_ENV_END)]
|
||||
;
|
||||
add r3, r3, r4
|
||||
cmp r3, r12
|
||||
bcs $upd
|
||||
MEND
|
||||
|
||||
MACRO
|
||||
$label SLTOUT $o, $fd, $cn
|
||||
$label mov r4, r3 lsr #ENV_BITS
|
||||
subs r12, r4, #EVC_ENT
|
||||
addcc r12, r11, #T_envcurve ; r12 = opmtbl.envcurve
|
||||
ldr r0, [r6, #($o + S1_TOTALLEVEL)]
|
||||
ldrcc r12, [r12, r4 lsl #2]
|
||||
str r3, [r6, #($o + S1_ENV_CNT)]
|
||||
ldr r4, [r6, #($o + S1_FREQ_CNT)]
|
||||
ldr r3, [r6, #($o + S1_FREQ_INC)] ; freq
|
||||
subs r0, r0, r12
|
||||
ldr r12, [r10, $fd]
|
||||
add r3, r3, r4
|
||||
str r3, [r6, #($o + S1_FREQ_CNT)]
|
||||
bls $label.ed
|
||||
add r3, r3, r12
|
||||
add r0, r11, r0 lsl #2
|
||||
mov r3, r3 lsl #(32 - FREQ_BITS)
|
||||
add r12, r11, #T_sintable ; r12 = opmtbl.sintable
|
||||
mov r3, r3 lsr #(32 - SIN_BITS)
|
||||
ldr r4, [r6, $cn]
|
||||
ldr r0, [r0, #T_envtable]
|
||||
ldr r3, [r12, r3 lsl #2]
|
||||
ldr r12, [r4]
|
||||
mul r0, r3, r0
|
||||
;
|
||||
add r12, r12, r0 asr #(ENVTBL_BIT + SINTBL_BIT - TL_BITS)
|
||||
str r12, [r4]
|
||||
$label.ed
|
||||
MEND
|
||||
|
||||
|
||||
MACRO
|
||||
$label SLTUPD $r, $o, $m
|
||||
$label ldrb r3, [r6, #($o + S1_ENV_MODE)]
|
||||
;
|
||||
;
|
||||
sub r3, r3, #1
|
||||
cmp r3, #EM_ATTACK
|
||||
addcc pc, pc, r3 lsl #2
|
||||
b $label.off ; EM_OFF
|
||||
b $label.rel ; EM_RELEASE
|
||||
b $label.dc2 ; EM_DECAY2
|
||||
b $label.dc1 ; EM_DECAY1
|
||||
$label.att strb r3, [r6, #($o + S1_ENV_MODE)]
|
||||
ldr r0, [r6, #($o + S1_DECAYLEVEL)]
|
||||
ldr r4, [r6, #($o + S1_ENVINCDECAY1)]
|
||||
mov r3, #EC_DECAY
|
||||
str r0, [r6, #($o + S1_ENV_END)]
|
||||
str r4, [r6, #($o + S1_ENV_INC)]
|
||||
b $r
|
||||
$label.dc1 strb r3, [r6, #($o + S1_ENV_MODE)]
|
||||
mov r0, #EC_OFF
|
||||
ldr r4, [r6, #($o + S1_ENVINCDECAY2)]
|
||||
ldr r3, [r6, #($o + S1_DECAYLEVEL)]
|
||||
str r0, [r6, #($o + S1_ENV_END)]
|
||||
str r4, [r6, #($o + S1_ENV_INC)]
|
||||
b $r
|
||||
$label.rel strb r3, [r6, #($o + S1_ENV_MODE)]
|
||||
$label.dc2 add r3, r12, #1
|
||||
ldrb r4, [r6, #C_PLAYING]
|
||||
mov r0, #0
|
||||
str r3, [r6, #($o + S1_ENV_END)]
|
||||
str r0, [r6, #($o + S1_ENV_INC)]
|
||||
and r4, r4, $m
|
||||
strb r4, [r6, #C_PLAYING]
|
||||
$label.off mov r3, #EC_OFF
|
||||
b $r
|
||||
MEND
|
||||
|
||||
|
||||
opmgen_getpcm
|
||||
cmp r2, #0
|
||||
moveq pc, lr
|
||||
ldr r12, dcd_opmgen
|
||||
ldr r3, [r12, #G_PLAYING]
|
||||
cmp r3, #0
|
||||
moveq pc, lr
|
||||
|
||||
stmdb sp!, {r4 - r11, lr}
|
||||
ldr r7, dcd_opmch
|
||||
mov r10, r12
|
||||
ldr r11, dcd_opmcfg
|
||||
ldr lr, [r10, #G_CALCREMAIN]
|
||||
ldr r3, [r10, #G_OUTDL]
|
||||
ldr r4, [r10, #G_OUTDR]
|
||||
getpcm_lp rsb r0, lr, #0
|
||||
mul r8, r0, r3
|
||||
mul r9, r0, r4
|
||||
add lr, lr, #FMDIV_ENT
|
||||
mksmp_lp mov r12, #0
|
||||
mov r6, r7
|
||||
str r12, [r10, #G_OUTDL]
|
||||
str r12, [r10, #G_OUTDC]
|
||||
str r12, [r10, #G_OUTDR]
|
||||
mov r5, #(0 - (8 << 24))
|
||||
; ldr r5, [r10, #G_PLAYCHANNELS]
|
||||
; sub r5, r12, r5 lsl #24
|
||||
slotcalc_lp ldrb r0, [r6, #C_PLAYING]
|
||||
ldrb r12, [r6, #C_OUTSLOT]
|
||||
tst r0, r12
|
||||
beq slot5calc
|
||||
add r5, r5, #1
|
||||
|
||||
mov r12, #0
|
||||
str r12, [r10, #G_FEEDBACK2]
|
||||
str r12, [r10, #G_FEEDBACK3]
|
||||
str r12, [r10, #G_FEEDBACK4]
|
||||
|
||||
slot1calc SLTFREQ 0, slot1update
|
||||
s1calcenv mov r12, r3, lsr #ENV_BITS
|
||||
subs r4, r12, #EVC_ENT
|
||||
addcc r4, r11, #T_envcurve ; r4 = opmtbl.envcurve
|
||||
ldr r0, [r6, #S1_TOTALLEVEL]
|
||||
ldrcc r4, [r4, r12 lsl #2]
|
||||
str r3, [r6, #S1_ENV_CNT]
|
||||
ldr r12, [r6, #S1_FREQ_CNT]
|
||||
ldr r3, [r6, #S1_FREQ_INC] ; freq
|
||||
subs r0, r0, r4
|
||||
ldrb r4, [r6, #C_FEEDBACK]
|
||||
add r3, r3, r12
|
||||
str r3, [r6, #S1_FREQ_CNT]
|
||||
bls slot2calc
|
||||
ldr r12, [r6, #C_OP1FB]
|
||||
cmp r4, #0
|
||||
addne r3, r3, r12 asr r4 ; back!
|
||||
add r4, r11, #T_sintable ; r1 = opmtbl.sintable
|
||||
mov r3, r3 lsl #(32 - FREQ_BITS)
|
||||
add r0, r11, r0 lsl #2
|
||||
mov r3, r3 lsr #(32 - SIN_BITS)
|
||||
ldr r0, [r0, #T_envtable]
|
||||
ldr r3, [r4, r3 lsl #2]
|
||||
ldr r4, [r6, #C_CONNECT1]
|
||||
mul r0, r3, r0
|
||||
mov r3, r0 asr #(ENVTBL_BIT + SINTBL_BIT - TL_BITS)
|
||||
strne r3, [r6, #C_OP1FB]
|
||||
addne r3, r3, r12
|
||||
subne r3, r3, r3 asr #31 ; adjust....
|
||||
movne r3, r3 asr #1
|
||||
cmp r4, #0
|
||||
ldrne r0, [r4]
|
||||
streq r3, [r10, #G_FEEDBACK2]
|
||||
streq r3, [r10, #G_FEEDBACK3]
|
||||
streq r3, [r10, #G_FEEDBACK4]
|
||||
addne r0, r0, r3
|
||||
strne r0, [r4]
|
||||
|
||||
slot2calc SLTFREQ (S_SIZE * 1), slot2update
|
||||
s2calcenv SLTOUT (S_SIZE * 1), #G_FEEDBACK2, #C_CONNECT2
|
||||
|
||||
slot3calc SLTFREQ (S_SIZE * 2), slot3update
|
||||
s3calcenv SLTOUT (S_SIZE * 2), #G_FEEDBACK3, #C_CONNECT3
|
||||
|
||||
slot4calc SLTFREQ (S_SIZE * 3), slot4update
|
||||
s4calcenv SLTOUT (S_SIZE * 3), #G_FEEDBACK4, #C_CONNECT4
|
||||
|
||||
slot5calc add r6, r6, #C_SIZE
|
||||
adds r5, r5, #(1 << 24)
|
||||
bcc slotcalc_lp
|
||||
ldr r0, [r10, #G_OUTDC]
|
||||
ldr r3, [r10, #G_OUTDL]
|
||||
ldr r4, [r10, #G_OUTDR]
|
||||
ldr r12, [r11, #T_CALC1024]
|
||||
add r3, r3, r0
|
||||
add r4, r4, r0
|
||||
mov r3, r3, asr #FMVOL_SFTBIT
|
||||
mov r4, r4, asr #FMVOL_SFTBIT
|
||||
subs lr, lr, r12
|
||||
addle r12, lr, r12
|
||||
mla r8, r12, r3, r8
|
||||
mla r9, r12, r4, r9
|
||||
bgt mksmp_lp
|
||||
ldr r0, [r11, #T_FMVOL]
|
||||
mov r8, r8 asr #FMDIV_BITS
|
||||
mov r9, r9 asr #FMDIV_BITS
|
||||
mul r8, r0, r8
|
||||
ldr r12, [r1]
|
||||
mul r9, r0, r9
|
||||
ldr r0, [r1, #4]
|
||||
add r12, r12, r8 asr #(OPM_OUTSB + FMDIV_BITS + 1 + 6 - FMVOL_SFTBIT - 8)
|
||||
str r12, [r1], #4
|
||||
add r0, r0, r9 asr #(OPM_OUTSB + FMDIV_BITS + 1 + 6 - FMVOL_SFTBIT - 8)
|
||||
str r0, [r1], #4
|
||||
subs r2, r2, #1
|
||||
bne getpcm_lp
|
||||
str r3, [r10, #G_OUTDL]
|
||||
str r4, [r10, #G_OUTDR]
|
||||
str lr, [r10, #G_CALCREMAIN]
|
||||
strb r5, [r10, #G_PLAYING]
|
||||
ldmia sp!, {r4 - r11, pc}
|
||||
|
||||
dcd_opmgen dcd opmgen
|
||||
dcd_opmch dcd opmch
|
||||
dcd_opmcfg dcd opmcfg + T_ORG
|
||||
|
||||
slot1update SLTUPD s1calcenv, (S_SIZE * 0), #&fe
|
||||
slot2update SLTUPD s2calcenv, (S_SIZE * 1), #&fd
|
||||
slot3update SLTUPD s3calcenv, (S_SIZE * 2), #&fb
|
||||
slot4update SLTUPD s4calcenv, (S_SIZE * 3), #&f7
|
||||
|
||||
END
|
||||
|
132
wince/arm/parts.s
Normal file
132
wince/arm/parts.s
Normal file
@ -0,0 +1,132 @@
|
||||
|
||||
EXPORT __randseed
|
||||
EXPORT rand_setseed
|
||||
EXPORT rand_get
|
||||
EXPORT AdjustAfterMultiply
|
||||
EXPORT AdjustBeforeDivision
|
||||
EXPORT sjis2jis
|
||||
EXPORT jis2sjis
|
||||
EXPORT satuation_s16
|
||||
EXPORT satuation_s16x
|
||||
|
||||
|
||||
AREA .data, DATA, READWRITE
|
||||
|
||||
__randseed dcd 1
|
||||
|
||||
|
||||
AREA .text, CODE, READONLY
|
||||
|
||||
rand_setseed ldr r1, prandseed
|
||||
str r0, [r1]
|
||||
mov pc, lr
|
||||
rand_get ldr r1, prandseed
|
||||
ldr r2, randdcd1
|
||||
ldr r3, randdcd2
|
||||
ldr r0, [r1]
|
||||
mla r2, r0, r2, r3
|
||||
mov r0, r2, asr #16
|
||||
str r2, [r1]
|
||||
mov pc, lr
|
||||
prandseed dcd __randseed
|
||||
randdcd1 dcd &343fd
|
||||
randdcd2 dcd &269ec3
|
||||
|
||||
AdjustAfterMultiply
|
||||
and r0, r0, #255
|
||||
mov r1, #205 ; ”͈͂ª0-255‚È‚Ì‚Å<E2809A>¸“x’Ⴕ
|
||||
mul r1, r0, r1
|
||||
mov r1, r1, lsr #11
|
||||
sub r0, r0, r1, lsl #1
|
||||
if 1
|
||||
add r0, r0, r1, lsl #3
|
||||
else
|
||||
sub r0, r0, r1, lsl #3
|
||||
add r0, r0, r1, lsl #4
|
||||
endif
|
||||
mov pc, lr
|
||||
|
||||
AdjustBeforeDivision
|
||||
and r1, r0, #&f0
|
||||
and r0, r0, #15
|
||||
add r0, r0, r1, lsr #3
|
||||
add r0, r0, r1, lsr #1
|
||||
mov pc, lr
|
||||
|
||||
sjis2jis and r1, r0, #255
|
||||
sub r1, r1, r1, lsr #7
|
||||
mov r1, r1, lsl #23
|
||||
adds r1, r1, #(&62 << 23)
|
||||
subpl r1, r1, #(&a2 << 23)
|
||||
mov r2, #&1f00
|
||||
orr r2, r2, #&21
|
||||
add r1, r2, r1, lsr #23
|
||||
and r0, r0, #&3f00
|
||||
add r0, r1, r0, lsl #1
|
||||
mov pc, lr
|
||||
|
||||
jis2sjis and r1, r0, #&7f00
|
||||
and r0, r0, #&7f
|
||||
tst r1, #&100
|
||||
addeq r0, r0, #&5e
|
||||
cmp r0, #&60
|
||||
addcs r0, r0, #1
|
||||
add r0, r0, #&1f
|
||||
add r1, r1, #&2100
|
||||
mov r1, r1, lsr #1
|
||||
and r1, r1, #&ff00
|
||||
eor r1, r1, #&a000
|
||||
orr r0, r0, r1
|
||||
mov pc, lr
|
||||
|
||||
satuation_s16 movs r2, r2 lsr #2
|
||||
moveq pc, lr
|
||||
stmdb sp!, {r4, lr}
|
||||
ldr lr, dcd_ffff8000
|
||||
mov r12, #&7f00
|
||||
orr r12, r12, #&7f
|
||||
ss16_lp ldr r3, [r1], #4
|
||||
ldr r4, [r1], #4
|
||||
cmp r3, r12
|
||||
movgt r3, r12
|
||||
cmple r3, lr
|
||||
movlt r3, lr
|
||||
mov r3, r3, lsl #16
|
||||
cmp r4, r12
|
||||
movgt r4, r12
|
||||
cmple r4, lr
|
||||
movlt r4, lr
|
||||
mov r4, r4, lsl #16
|
||||
add r3, r4, r3 lsr #16
|
||||
str r3, [r0], #4
|
||||
subs r2, r2, #1
|
||||
bne ss16_lp
|
||||
ldmia sp!, {r4, pc}
|
||||
dcd_ffff8000 dcd &ffff8000
|
||||
|
||||
satuation_s16x movs r2, r2 lsr #2
|
||||
moveq pc, lr
|
||||
stmdb sp!, {r4, lr}
|
||||
ldr lr, dcd_ffff8000
|
||||
mov r12, #&7f00
|
||||
orr r12, r12, #&7f
|
||||
ss16x_lp ldr r3, [r1], #4
|
||||
ldr r4, [r1], #4
|
||||
cmp r3, r12
|
||||
movgt r3, r12
|
||||
cmple r3, lr
|
||||
movlt r3, lr
|
||||
mov r3, r3, lsl #16
|
||||
cmp r4, r12
|
||||
movgt r4, r12
|
||||
cmple r4, lr
|
||||
movlt r4, lr
|
||||
mov r4, r4, lsl #16
|
||||
subs r2, r2, #1
|
||||
add r3, r3, r4 lsr #16
|
||||
str r3, [r0], #4
|
||||
bne ss16x_lp
|
||||
ldmia sp!, {r4, pc}
|
||||
|
||||
END
|
||||
|
@ -244,8 +244,8 @@ BRESULT sysmenu_create(void) {
|
||||
if (menubase_create() != SUCCESS) {
|
||||
goto smcre_err;
|
||||
}
|
||||
menuicon_regist(MICON_NP2, &np2icon);
|
||||
if (menusys_create(s_main, sys_cmd, MICON_NP2, str_xmil)) {
|
||||
menuicon_regist(MICON_XMIL, &xmilicon);
|
||||
if (menusys_create(s_main, sys_cmd, MICON_XMIL, str_xmil)) {
|
||||
goto smcre_err;
|
||||
}
|
||||
#if defined(SUPPORT_SOFTKBD)
|
||||
|
@ -66,6 +66,6 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
MICON_NP2 = MICON_USER
|
||||
MICON_XMIL = MICON_USER
|
||||
};
|
||||
|
||||
|
@ -366,6 +366,7 @@ DEP_CPP_PARTS=\
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmilppc - Win32 (WCE ARM) Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
DEP_CPP_PARTS=\
|
||||
"..\common.h"\
|
||||
"..\COMMON\_memory.h"\
|
||||
@ -378,6 +379,33 @@ DEP_CPP_PARTS=\
|
||||
".\wce\compiler.h"\
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ARM\PARTS.S
|
||||
|
||||
!IF "$(CFG)" == "xmilppc - Win32 (WCE MIPS) Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmilppc - Win32 (WCE SH3) Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmilppc - Win32 (WCE ARM) Release"
|
||||
|
||||
# Begin Custom Build - Assembling... $(InputPath)
|
||||
IntDir=.\..\obj\evc\xmilppc\ARM
|
||||
InputPath=.\ARM\PARTS.S
|
||||
InputName=PARTS
|
||||
|
||||
"$(IntDir)\$(InputName)_arm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
armasm -32 $(InputPath) $(IntDir)\$(InputName)_arm.obj
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
@ -3963,6 +3991,7 @@ DEP_CPP_OPMGEN=\
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmilppc - Win32 (WCE ARM) Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
DEP_CPP_OPMGEN=\
|
||||
"..\common.h"\
|
||||
"..\COMMON\_memory.h"\
|
||||
@ -3978,6 +4007,33 @@ DEP_CPP_OPMGEN=\
|
||||
".\wce\compiler.h"\
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ARM\OPMGENG.S
|
||||
|
||||
!IF "$(CFG)" == "xmilppc - Win32 (WCE MIPS) Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmilppc - Win32 (WCE SH3) Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmilppc - Win32 (WCE ARM) Release"
|
||||
|
||||
# Begin Custom Build - Assembling... $(InputPath)
|
||||
IntDir=.\..\obj\evc\xmilppc\ARM
|
||||
InputPath=.\ARM\OPMGENG.S
|
||||
InputName=OPMGENG
|
||||
|
||||
"$(IntDir)\$(InputName)_arm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
armasm -32 $(InputPath) $(IntDir)\$(InputName)_arm.obj
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
@ -6665,7 +6721,9 @@ DEP_CPP_SCRNM=\
|
||||
".\scrnmng.h"\
|
||||
".\wce\compiler.h"\
|
||||
".\xmilbmp.res"\
|
||||
{$(INCLUDE)}"gx.h"\
|
||||
|
||||
NODEP_CPP_SCRNM=\
|
||||
".\x.h"\
|
||||
|
||||
|
||||
!ENDIF
|
||||
@ -7102,7 +7160,9 @@ DEP_CPP_WINKB=\
|
||||
".\oemtext.h"\
|
||||
".\wce\compiler.h"\
|
||||
".\winkbd.h"\
|
||||
{$(INCLUDE)}"gx.h"\
|
||||
|
||||
NODEP_CPP_WINKB=\
|
||||
".\x.h"\
|
||||
|
||||
|
||||
!ENDIF
|
||||
@ -7287,7 +7347,9 @@ DEP_CPP_XMIL_=\
|
||||
".\wce\compiler.h"\
|
||||
".\winkbd.h"\
|
||||
".\xmil.h"\
|
||||
{$(INCLUDE)}"gx.h"\
|
||||
|
||||
NODEP_CPP_XMIL_=\
|
||||
".\x.h"\
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
@ -174,6 +174,38 @@ DEP_CPP_PARTS=\
|
||||
".\oemtext.h"\
|
||||
".\wce\compiler.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "xmilsig3 - Win32 (WCE ARMV4I) Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmilsig3 - Win32 (WCE ARMV4I) Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ARM\PARTS.S
|
||||
|
||||
!IF "$(CFG)" == "xmilsig3 - Win32 (WCE ARMV4I) Release"
|
||||
|
||||
# Begin Custom Build - Assembling... $(InputPath)
|
||||
IntDir=.\..\obj\evc\xmilsig3\Rel
|
||||
InputPath=.\ARM\PARTS.S
|
||||
InputName=PARTS
|
||||
|
||||
"$(IntDir)\$(InputName)_arm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
armasm -32 $(InputPath) $(IntDir)\$(InputName)_arm.obj
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmilsig3 - Win32 (WCE ARMV4I) Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@ -1331,6 +1363,38 @@ DEP_CPP_OPMGEN=\
|
||||
".\oemtext.h"\
|
||||
".\wce\compiler.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "xmilsig3 - Win32 (WCE ARMV4I) Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmilsig3 - Win32 (WCE ARMV4I) Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ARM\OPMGENG.S
|
||||
|
||||
!IF "$(CFG)" == "xmilsig3 - Win32 (WCE ARMV4I) Release"
|
||||
|
||||
# Begin Custom Build - Assembling... $(InputPath)
|
||||
IntDir=.\..\obj\evc\xmilsig3\Rel
|
||||
InputPath=.\ARM\OPMGENG.S
|
||||
InputName=OPMGENG
|
||||
|
||||
"$(IntDir)\$(InputName)_arm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
armasm -32 $(InputPath) $(IntDir)\$(InputName)_arm.obj
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "xmilsig3 - Win32 (WCE ARMV4I) Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user