Skip to content

Chaotix prototypes 1994‐12

Federico Berti edited this page Oct 18, 2023 · 2 revisions

knuckles 1994-12 protos

Just wanted to point out that this as well as the other Dec protos I tested, run on real 32X hardware. Although, sometimes they either, don't boot at all, have no PWM, have high pitched PWM beeps at title like in fusion (Sega screen works fine though), or the PWM will play just fine except for a few glitches at the start and end of zone.

knuckles 1994-12-27 proto

SLAVE
S 0000019e	e028	mov H'28, R0 [NEW]
S 000001a0	e101	mov H'01, R1 [NEW]
S 000001a2	3018	sub R1, R0 [NEW]  
S 000001a4	8800	cmp/eq H'00, R0 [NEW]
S 000001a6	8bfc	bf H'000001a2 [NEW] ///at most (1+1+3)*28 = 140 cycles
S 000001a8	c608	mov.l @(8, GBR), R0 [NEW] //0x20004020
S 000001aa	d102	mov.l @(H'000001b4), R1 [NEW] //0x4D5F4F4B "M_OK"
S 000001ac	3100	cmp/eq R0, R1 [NEW]
S 000001ae	8bf6	bf H'0000019e [NEW]

MASTER
M 06000360	6212	mov.l @R1, R2 [NEW] //R1 = 0x6005750, R0 = 0x52454459 "REDY"
M 06000362	3200	cmp/eq R0, R2 [NEW] //R2 = 0xF7F7F7F7
M 06000364	8bfc	bf H'06000360 [NEW]

M68K
008809a0   0cb9 535f4f4b 00a15124  cmpi.l   #$535f4f4b,$00a15124 [NEW] //"S_OK"
008809aa   66f4                    bne.s    $008809a0 [NEW]

issue #1

a. MASTER set COMM0 to "M_OK"
b. works a little bit
c. and then sets COMM_0 to -1

SLAVE has <140 cycles between COMM0 checks, with the current setup slave takes ~100 cycles between check,
long enough for Master to reach (c) -> SLAVE is stuck

fix: after a reset, do not start master and slave at the same time

case SH2_RESET_OFF -> {
    setNextCycle(MASTER, cycleCounter + 1);
    setNextCycle(SLAVE, cycleCounter + 50);               

issue #2

008809f0   321f                    move.w   (a7)+,d1
008809f2   41f8 ffc0               lea      $ffc0,a0 //A0: ffffffc0
008809f6   0c90 53454741           cmpi.l   #$53454741,(a0)
008809fc   6618                    bne.s    $00880a16
00880a16   31c1 ffcc               move.w   d1,$ffcc
00880a1a   7200                    moveq    #$00,d1
00880a1c   2081                    move.l   d1,(a0)
00880a1e   43e8 000e               lea      $000e(a0),a1 //A1: ffffffce
00880a22   700d                    moveq    #$0d,d0
00880a24   22c1                    move.l   d1,(a1)+  //gets all the way to fffffffe when d0 = 2
00880a26   51c8 fffc               dbra     d0,$00880a24


D0: 0000000d   D4: 00000000   A0: ffffffc0   A4: 00000000     PC:  00880a26
D1: 00000000   D5: 00000000   A1: ffffffd2   A5: 00000000     SR:  2704 --Z--
D2: 0000e857   D6: 00000000   A2: 00ff0000   A6: 00000000     USP: 00000000
D3: 00000000   D7: 00000000   A3: 00000000   A7: 00ff0200     SSP: 00ff0200

fix: loop 0xA times instead of 0xD

//emu fix

if(currentPC == 0x00880a24){
            if(m68k.getDataRegisterLong(0) == 0xd){
               m68k.setDataRegisterLong(0,0xa);
            }
 }

//rom fix

The following patch fixes the issue, apply to the 1994-12-07 rom with sha1 hash:

150dace1482ebf38a0f6242be6d8b7ea19f8a737

ips contents:

50 41 54 43 48 00 07 CE 00 02 4E 71 00 0A 23 00 01 0A 45 4F 46
Clone this wiki locally