Search found 92 matches

by GManiac
Wed Jul 26, 2017 8:21 am
Forum: Blabla
Topic: Faster x mod 384 (x%384)?
Replies: 10
Views: 13568

Re: Faster x mod 384 (x%384)?

To simplify the explanation I imply the operation is with (16bit) integers. But instead is with 16:16 fixed points. So really the operation is something like: x mod 384<<16 where x can range from 0 to 4096<<16. (Meaning it uses signed 32 bit integers) As I understand, integer part of your 16.16 num...
by GManiac
Tue Jul 25, 2017 9:21 am
Forum: Blabla
Topic: Faster x mod 384 (x%384)?
Replies: 10
Views: 13568

Re: Faster x mod 384 (x%384)?

Great formula.
a = 56959
d1 = 21
d2 = 17
# d1 and d2 are random divisors
a % (d1*d2) == a // d1 % d2 * d1 + a % d1

a % 320 == a // 64 % 5 * 64 + a % 64
a % 320 == (((a >> 6) % 5) << 6) + (a & 0x3F)

r57shell, there's no need in "|" in next line, just use "+".

Code: Select all

| (a & 0x3F);
by GManiac
Mon Jul 24, 2017 9:02 pm
Forum: Blabla
Topic: Faster x mod 384 (x%384)?
Replies: 10
Views: 13568

Re: Faster x mod 384 (x%384)?

All code below is in Python A key formula is the "general rule" in the article you linked earlier Example: a = 123 m = 5 b = 16 # equal results print( a % m ) print( ( (b % m) * (a // b) + (a % b) ) % m ) To find residue of dividing by 320 you can find residues of 5 and 64 and then convert them to u...
by GManiac
Mon Jul 24, 2017 7:21 pm
Forum: Blabla
Topic: Faster x mod 384 (x%384)?
Replies: 10
Views: 13568

Re: Faster x mod 384 (x%384)?

Miquel, this C-written mod3 function has about 20 arithmetic operations. I'm afraid, in terms of M68k they will consume more cycles in total than one DIVU :D Fast version will require pre-computed array. Straightforward method is (don't be confused with different meaning of 'x'): x mod 320 = x - x d...
by GManiac
Wed Apr 19, 2017 8:22 pm
Forum: Megadrive/Genesis
Topic: 68000 programming optimization tips? (for speed)
Replies: 28
Views: 37021

Re: 68000 programming optimization tips? (for speed)

By the way, a lot of people ignore Scc commands (ST, SF, Sxx), but they are pretty useful to calculate complex boolean expressions (with addition of NOT, AND, OR, EOR) rather than doing a massive branching.
by GManiac
Tue Apr 18, 2017 7:27 pm
Forum: Megadrive/Genesis
Topic: 68000 programming optimization tips? (for speed)
Replies: 28
Views: 37021

Re: 68000 programming optimization tips? (for speed)

You say you know basic optimization techniques. In most cases "advanced" optimization tricks will be a compromise between performance and code size or, which is worse, between performance and code complexity and readability. I think it will be better to give us some samples you want to optimize. Not...
by GManiac
Sat Aug 13, 2016 10:48 am
Forum: Sound
Topic: New Documentation: An authoritative reference on the YM2612
Replies: 865
Views: 2142989

Re: New Documentation: An authoritative reference on the YM2612

Hi all! I haven't read this topic for many years. Maybe, this info was discussed earlier, maybe I'm repeating myself, if so, pardon me. The subject is "ladder effect". Eke gave link to my old post about DAC output, where I say operators are shifted arithmetically (not logically) by 5 bits Ladder eff...
by GManiac
Wed Mar 05, 2014 12:55 pm
Forum: Sound
Topic: Extreme High Quality Sound Emulation
Replies: 24
Views: 22060

Блин, два грамотея ведут диалог на ломаном английском на импортном форуме. Ты уверен, что знаешь, что вызывает зеркалирование? Я тебе говорю, это выходит при расчёте матрицы ДПФ над вещественными числами. Эту хрень ты и видишь на картинках и слышишь в ушах. Возьми посчитай ДПФ руками, чтобы понять, ...
by GManiac
Tue Mar 04, 2014 8:38 pm
Forum: Sound
Topic: Extreme High Quality Sound Emulation
Replies: 24
Views: 22060

Sorry, didn't notice your new message. This is new part for my first message: Points 1 and 2 make very notable difference on quiet sound making it sound louder. It's all because operators use ariphmetic shift, not logical. Let me show it on example. Copy-paste this text to Excel, delimiter = whitesp...
by GManiac
Tue Mar 04, 2014 7:40 pm
Forum: Sound
Topic: Extreme High Quality Sound Emulation
Replies: 24
Views: 22060

The most important difference between "digitally ideal" emulated sound and real sound is in analogue output: 1) 9-bit DAC 2) ladder effect from DAC level -1 to level 0 3) other analogue and mixing effects. Changing multiplexion method won't give you too much, AFAIR I've said this some years ago on t...
by GManiac
Thu Jul 11, 2013 10:19 am
Forum: Blabla
Topic: 64206 riddle...
Replies: 5
Views: 5323

I've got only
9ASK5N30
J4004L26
N7EIGN25
by GManiac
Wed Jul 10, 2013 1:22 pm
Forum: Blabla
Topic: 64206 riddle...
Replies: 5
Views: 5323

It's $FACE. There is also $DEAD BEEF :)
Also, OSRAM 64206 :)
by GManiac
Fri Jun 28, 2013 10:28 am
Forum: Sound
Topic: PCM maximum Hz
Replies: 15
Views: 12470

It would be nice to have a test program which actually loop in waiting for busy flag and feeding the dac then we can read number of sent sample per second and somehow estimate the accepted PCM rate on each system :) I'd already done this program, it's somewhere on my hard disk :) Comparing original...
by GManiac
Wed Jun 26, 2013 8:25 pm
Forum: Sound
Topic: PCM maximum Hz
Replies: 15
Views: 12470

I'll say more, different consoles give you different results. You can get maximum rate from 18k to 28k. To calculate the real rate you need to read from YM2612 busy flag (I don't remember exactly), check YM is not busy and only then write next sample.
by GManiac
Wed Jun 19, 2013 5:59 pm
Forum: Megadrive/Genesis
Topic: Help figuring out some logic in Flicky - new challenge #3!
Replies: 19
Views: 18952

matt wrote:Whilst it is not the kind of answer I was hoping for to be able to exploit the logic for high scores
Mmmm, what do you mean? :)
I will post a summary of your findings on my Flicky blog, if this is OK with you?
Yeah, it's OK.