Popful Mail

Ask anything your want about Mega/SegaCD programming.

Moderator: Mask of Destiny

Post Reply
byuu
Very interested
Posts: 94
Joined: Thu Feb 28, 2008 4:45 pm

Popful Mail

Post by byuu » Sat Aug 24, 2019 1:58 am

Having a lot of trouble getting this game to boot. It's hanging at the Sega logo, pretty much immediately after the main CPU starts executing code that wasn't from the BIOS. It goes pretty quickly into a trap instruction, which I feel is a sign that things have gone off the rails immediately.

Unfortunately I am incredibly lost without another emulator with trace logging to compare results against here ... so as a long shot, would anyone here be able to help with getting a trace log of the two 68Ks during boot-up for this game from a working emulator, or looking for any issues in this small amount of 68K code that I can execute? :/

Sorry to be a bother v_v;

I'll keep at it on my end as well, of course ..

Code: Select all

/* MCD */

l_3a26:
  bsr     l_0039f4
  rts

l_3f94:
  move.l  (a7)+,($005b26)
  rts

l_0562:
  move.w  #$0009,d0
  bsr     l_5f1c

l_3c52:
  bcs     l_3a26
  bclr.b  #$03,($005b24)
  bra     l_3a26

l_056c:
  bra     l_0528

l_0528:
  bra     l_0530

l_0530:
  bra     l_0410

l_062c:
  moveq   #$00,d0
  move.l  d0,($ff8020)
  move.l  d0,($ff8028)
  move.l  d0,($ff802c)
  move.l  #$532d4f4b,($ff8020)
l_6056:
  move.l  ($ff8010),d0
  cmp.l   ($ff8010),d0
  bne     l_6056
  cmpi.l  #$4d2d4f4b,d0
  bne     l_6056
l_6072:
  move.l  ($ff8010),d0
  cmp.l   ($ff8010),d0
  bne     l_6072
  tst.l   d0
  bne     l_6072
  bra     l_6d20

l_6d20:
  btst.b  #$00,($ff800e)
  beq     l_6d20
  movem.l ($ff8010),d0,d1,d2
  jsr     l_6d5e
  movem.l d0,d1,d2,($ff8020)
  bset.b  #$00,($ff800f)
l_6d46:
  btst.b  #$00,($ff800e)
  bne     l_6d46
  bclr.b  #$00,($ff800f)
  bra     l_6d20

l_6d5e:
  bra     l_7498

l_7498:
  move.w  ($0074d0),($005f7c)
  move.w  ($0074d0),($005f82)
  move.l  #$00006e4a,($005f7e)
  move.l  #$00006f02,($005f84)
  move.w  ($0074d2),($005f7c)
  move.w  ($0074d2),($005f82)
  bset.b  #$03,($ff8033)
  st      ($ff8031)
  rts

Code: Select all

/* CPU */

l_ff0000:
  move.l  #$00000280,($fffd02)
  lea     $a12001,a5
l_ff000e:
  bset.b  #$01,(a5)
  beq     l_ff000e
  move.w  ($ff0154),($020528)
l_ff001c:
  bclr.b  #$01,(a5)
  bne     l_ff001c
  lea     $ff002e,a1
  jsr     ($000364)
  bra     l_ff0156

l_ff0156:
  lea     $ffff00,a0
  moveq   #$1f,d7
l_ff051e:
  clr.l   (a0)+
  dbf     d7,l_ff015e
  move.w  #$0024,($ffff00)
  move.w  #$0000,($ffff02)
  bra     l_ff0300

l_ff0300:
  bsr     l_ff0c5a

l_ff0c5a:
  move.w  #$0100,($a11100)
  moveq   #$00,d0
  move.b  d0,($a1200e)
  move.l  d0,($a12010)
  move.l  d0,($a12014)
  move.l  d0,($a12018)
  move.l  d0,($a1201c)
l_ff0c82:
  move.l  ($a12020),d0
  cmp.l   ($a12020),d0
  bne     l_ff0c82
  move.l  #$4d2d4f4b,($a12010)
l_ff0ca2:
  move.l  ($a12020),d0
  cmp.l   ($a12020),d0
  bne     l_ff0ca2
  tst.l   d0
  bne     l_ff0ca2
  move.l  ($a12020),d0
  cmp.l   ($a12020),d0
  bne     l_ff0ca2
  clr.l   ($a12010)
  move.l  #$00000288,($fffd02)
  move.l  #$00ff03ac,($fffd1a)
  move.l  #$00ff051a,($fffd20)
  move.l  #$00ff0568,($fffd26)
  move.l  #$00ff09fe,($fffd2c)
  move.l  #$00ff0a1e,d0
  move.l  d0,($fffd7a)
  move.l  d0,($fffd80)
  move.l  d0,($fffd86)
  move.l  d0,($fffd8c)
  move.l  d0,($fffd92)
  move.l  d0,($fffd98)
  move.l  d0,($fffd9e)
  move.l  d0,($fffda4)
  move    sr,-(a7)
  move    #$2700,sr
  move.w  #$0004,d0
l_ff0d12:
  trap    #0

l_fffd18:  //trap #0
  jmp     l_ff03ac

l_ff03ac:
  movem.l d0,d1,d2,($a12010)
  jsr     l_fe03c6
  movem.l ($a12020),d0,d1,d2
  rte

l_fe03c6:
  bra     l_ff04b2

l_ff04b2:
  bset.b  #$00,($a1200e)
  btst.b  #$00,($a1200f)
  beq     l_ff04ba

l_ff04ba:
  btst.b  #$00,($a1200f)
  beq     l_ff04ba
  bclr.b  #$00,($a1200e)
l_ff04cc:
  btst.b  #$00,($a1200f)
  bne     l_ff04cc
  rts
Here's an interleaved, masked (as in each instruction is only logged the first time it's executed) trace log.
Format: <CPU ID> <# of unique instructions executed thus far since boot, excluding opcodes from the BIOS> <PC> <opcode word> <disassembly> <D registers> <flags> <A registers>

Code: Select all

/* Trace */

MCD     2791  00054e  4eb8  jsr     ($005f22)                                                   00000081 0000007f 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvznX 00005b3c 00005ad2 00000000 00000000 00000000 00000000 00000000 00005e7c 00000000
MCD     2792  000552  303c  move.w  #$0001,d0                                                   00023401 0000007f 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvznx 00005e80 00005ad2 00000000 00000000 00000000 00000000 00000000 00005e7c 00000000
MCD     2793  000556  6100  bsr     $005f1c                                                     00020001 0000007f 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvznx 00005e80 00005ad2 00000000 00000000 00000000 00000000 00000000 00005e7c 00000000
MCD     2794  00055a  0838  btst.b  #$07,($005e80)                                              00028001 0000007f 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvznx 00003cd4 00005ad2 00000000 00000000 00000000 00000000 00000000 00005e7c 00000000
MCD     2795  000560  66e4  bne     $000546                                                     00028001 0000007f 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvznx 00003cd4 00005ad2 00000000 00000000 00000000 00000000 00000000 00005e7c 00000000
CPU        2  ff0000  21fc  move.l  #$00000280,($fffd02)                                        00000014 ffffffff 00000008 0000447a 0000ffff 00004537 0000ffff 0000ffff tS0cvznx fffffdda ffff8000 0023f818 00000000 00a1200f 00c00000 fffffdf0 fffffcfc 00000000
CPU        3  ff0008  4bf9  lea     $a12001,a5                                                  00000014 ffffffff 00000008 0000447a 0000ffff 00004537 0000ffff 0000ffff tS0cvznx fffffdda ffff8000 0023f818 00000000 00a1200f 00c00000 fffffdf0 fffffcfc 00000000
CPU        4  ff000e  08d5  bset.b  #$01,(a5)                                                   00000014 ffffffff 00000008 0000447a 0000ffff 00004537 0000ffff 0000ffff tS0cvznx fffffdda ffff8000 0023f818 00000000 00a1200f 00a12001 fffffdf0 fffffcfc 00000000
CPU        5  ff0012  67fa  beq     $ff000e                                                     00000014 ffffffff 00000008 0000447a 0000ffff 00004537 0000ffff 0000ffff tS0cvZnx fffffdda ffff8000 0023f818 00000000 00a1200f 00a12001 fffffdf0 fffffcfc 00000000
CPU        6  ff0014  33fa  move.w  ($ff0154),($020528)                                         00000014 ffffffff 00000008 0000447a 0000ffff 00004537 0000ffff 0000ffff tS0cvznx fffffdda ffff8000 0023f818 00000000 00a1200f 00a12001 fffffdf0 fffffcfc 00000000
CPU        7  ff001c  0895  bclr.b  #$01,(a5)                                                   00000014 ffffffff 00000008 0000447a 0000ffff 00004537 0000ffff 0000ffff tS0cvznx fffffdda ffff8000 0023f818 00000000 00a1200f 00a12001 fffffdf0 fffffcfc 00000000
CPU        8  ff0020  66fa  bne     $ff001c                                                     00000014 ffffffff 00000008 0000447a 0000ffff 00004537 0000ffff 0000ffff tS0cvznx fffffdda ffff8000 0023f818 00000000 00a1200f 00a12001 fffffdf0 fffffcfc 00000000
CPU        9  ff0022  43fa  lea     $ff002e,a1                                                  00000014 ffffffff 00000008 0000447a 0000ffff 00004537 0000ffff 0000ffff tS0cvZnx fffffdda ffff8000 0023f818 00000000 00a1200f 00a12001 fffffdf0 fffffcfc 00000000
CPU       10  ff0026  4eb8  jsr     ($000364)                                                   00000014 ffffffff 00000008 0000447a 0000ffff 00004537 0000ffff 0000ffff tS0cvZnx fffffdda ffff002e 0023f818 00000000 00a1200f 00a12001 fffffdf0 fffffcfc 00000000
MCD     2796  000562  303c  move.w  #$0009,d0                                                   00020001 0000007f 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00003cd4 00005ad2 00000000 00000000 00000000 00000000 00000000 00005e7c 00000000
MCD     2797  000566  6100  bsr     $005f1c                                                     00020009 0000007f 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvznx 00003cd4 00005ad2 00000000 00000000 00000000 00000000 00000000 00005e7c 00000000
MCD     2798  003c52  6500  bcs     $003a26                                                     00020034 00000001 00000000 00000000 00000000 00000000 00000000 00000006 tS0cvznx 00003c52 00005b52 00000000 00000000 00000000 00000000 00000000 00005e68 00000000
MCD     2799  003c56  08ad  bclr.b  #$03,($005b24)                                              00020034 00000001 00000000 00000000 00000000 00000000 00000000 00000006 tS0cvznx 00003c52 00005b52 00000000 00000000 00000000 00000000 00000000 00005e68 00000000
MCD     2800  003c5c  6000  bra     $003a26                                                     00020034 00000001 00000000 00000000 00000000 00000000 00000000 00000006 tS0cvznx 00003c52 00005b52 00000000 00000000 00000000 00000000 00000000 00005e68 00000000
MCD     2801  00056c  60ba  bra     $000528                                                     00020004 00000000 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00003c52 00005b52 00000000 00000000 00000000 00000000 00000000 00005e7c 00000000
MCD     2802  000528  6006  bra     $000530                                                     00020004 00000000 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00003c52 00005b52 00000000 00000000 00000000 00000000 00000000 00005e7c 00000000
MCD     2803  000530  6000  bra     $000410                                                     00020004 00000000 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00003c52 00005b52 00000000 00000000 00000000 00000000 00000000 00005e7c 00000000
MCD     2804  00602c  7000  moveq   #$00,d0                                                     00000000 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
MCD     2805  006034  23c0  move.l  d0,($ff8020)                                                00000000 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
MCD     2806  006040  23c0  move.l  d0,($ff8028)                                                00000000 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
MCD     2807  006046  23c0  move.l  d0,($ff802c)                                                00000000 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
MCD     2808  00604c  23fc  move.l  #$532d4f4b,($ff8020)                                        00000000 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
MCD     2809  006062  66f2  bne     $006056                                                     00000000 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
MCD     2810  00606a  66ea  bne     $006056                                                     00000000 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0CvzNx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
CPU       11  ff002a  6000  bra     $ff0156                                                     f2fe08a2 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 000000b4 tS0cvznx fffffdda ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcfc 00000000
CPU       12  ff0156  41f9  lea     $ffff00,a0                                                  f2fe08a2 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 000000b4 tS0cvznx fffffdda ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcfc 00000000
CPU       13  ff015c  7e1f  moveq   #$1f,d7                                                     f2fe08a2 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 000000b4 tS0cvznx 00ffff00 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcfc 00000000
CPU       14  ff015e  4298  clr.l   (a0)+                                                       f2fe08a2 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000001f tS0cvznx 00ffff00 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcfc 00000000
CPU       15  ff0160  51cf  dbf     d7,$ff015e                                                  f2fe08a2 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000001f tS0cvZnx 00ffff04 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcfc 00000000
CPU       16  ff0164  31fc  move.w  #$0024,($ffff00)                                            f2fe08a2 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcfc 00000000
CPU       17  ff016a  31fc  move.w  #$0000,($ffff02)                                            f2fe08a2 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcfc 00000000
CPU       18  ff0170  6000  bra     $ff0300                                                     f2fe08a2 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcfc 00000000
CPU       19  ff0300  6100  bsr     $ff0c5a                                                     f2fe08a2 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcfc 00000000
CPU       20  ff0c5a  33fc  move.w  #$0100,($a11100)                                            f2fe08a2 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       21  ff0c62  7000  moveq   #$00,d0                                                     f2fe08a2 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       22  ff0c64  13c0  move.b  d0,($a1200e)                                                00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       23  ff0c6a  23c0  move.l  d0,($a12010)                                                00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       24  ff0c70  23c0  move.l  d0,($a12014)                                                00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       25  ff0c76  23c0  move.l  d0,($a12018)                                                00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       26  ff0c7c  23c0  move.l  d0,($a1201c)                                                00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       27  ff0c82  2039  move.l  ($a12020),d0                                                00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       28  ff0c88  b0b9  cmp.l   ($a12020),d0                                                532d4f4b 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       29  ff0c8e  66f2  bne     $ff0c82                                                     532d4f4b 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       30  ff0c90  0c80  cmpi.l  #$532d4f4b,d0                                               532d4f4b 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       31  ff0c96  66ea  bne     $ff0c82                                                     532d4f4b 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       32  ff0c98  23fc  move.l  #$4d2d4f4b,($a12010)                                        532d4f4b 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       33  ff0ca2  2039  move.l  ($a12020),d0                                                532d4f4b 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       34  ff0ca8  b0b9  cmp.l   ($a12020),d0                                                532d4f4b 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       35  ff0cae  66f2  bne     $ff0ca2                                                     532d4f4b 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       36  ff0cb0  4a80  tst.l   d0                                                          532d4f4b 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       37  ff0cb2  66ee  bne     $ff0ca2                                                     532d4f4b 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
MCD     2811  006072  2039  move.l  ($ff8010),d0                                                4d2d4f4b 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
MCD     2812  006078  b0b9  cmp.l   ($ff8010),d0                                                4d2d4f4b 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvznx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
MCD     2813  00607e  66f2  bne     $006072                                                     4d2d4f4b 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
MCD     2814  006082  66ee  bne     $006072                                                     4d2d4f4b 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvznx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
CPU       38  ff0cb4  42b9  clr.l   ($a12010)                                                   00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       39  ff0cba  21fc  move.l  #$00000288,($fffd02)                                        00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvZnx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       40  ff0cc2  21fc  move.l  #$00ff03ac,($fffd1a)                                        00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
MCD     2815  006d20  0839  btst.b  #$00,($ff800e)                                              00000000 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
CPU       41  ff0cca  21fc  move.l  #$00ff051a,($fffd20)                                        00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
MCD     2816  006d28  67f6  beq     $006d20                                                     00000000 00006020 00000000 00000000 00000000 00000000 00000000 00000000 tS0cvZnx 00005f40 00006000 00000000 00000000 00000000 00000000 00000000 00005e78 00000000
CPU       42  ff0cd2  21fc  move.l  #$00ff0568,($fffd26)                                        00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       43  ff0cda  21fc  move.l  #$00ff09fe,($fffd2c)                                        00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       44  ff0ce2  203c  move.l  #$00ff0a1e,d0                                               00000000 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       45  ff0ce8  21c0  move.l  d0,($fffd7a)                                                00ff0a1e 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       46  ff0cec  21c0  move.l  d0,($fffd80)                                                00ff0a1e 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       47  ff0cf0  21c0  move.l  d0,($fffd86)                                                00ff0a1e 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       48  ff0cf4  21c0  move.l  d0,($fffd8c)                                                00ff0a1e 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       49  ff0cf8  21c0  move.l  d0,($fffd92)                                                00ff0a1e 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       50  ff0cfc  21c0  move.l  d0,($fffd98)                                                00ff0a1e 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       51  ff0d00  21c0  move.l  d0,($fffd9e)                                                00ff0a1e 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       52  ff0d04  21c0  move.l  d0,($fffda4)                                                00ff0a1e 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       53  ff0d08  40e7  move    sr,-(a7)                                                    00ff0a1e 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf8 00000000
CPU       54  ff0d0a  46fc  move    #$2700,sr                                                   00ff0a1e 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS0cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf6 00000000
CPU       55  ff0d0e  303c  move.w  #$0004,d0                                                   00ff0a1e 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS7cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf6 00000000
CPU       56  ff0d12  4e40  trap    #0                                                          00ff0004 00000008 0000ffff 0000011b 0000ffff 00004537 00000113 0000ffff tS7cvznx 00ffff80 ffff0154 fffffdb4 00000000 fffffb86 000061ba 0000611e fffffcf6 00000000

TascoDLX
Very interested
Posts: 256
Joined: Tue Feb 06, 2007 8:18 pm

Re: Popful Mail

Post by TascoDLX » Sat Aug 24, 2019 9:09 am

Traps are being used as normal function calls on the main CPU side to signal the sub CPU. Parameters are passed via the comm regs to tell the sub to execute certain functions, then main waits to sync up with sub on completion.

Would need to look at trace past the first trap call to know what's going wrong. You should see:
- main writes function params to comm and raise its comm flag
- sub picks it up and executes while main spins
- once done, sub raises its own flag to acknowledge
- main resets its flag in response to sync back
- finally, sub resets its flag then returns to idle

byuu
Very interested
Posts: 94
Joined: Thu Feb 28, 2008 4:45 pm

Re: Popful Mail

Post by byuu » Sat Aug 24, 2019 1:46 pm

Ah shoot, so I was going down the wrong tangent looking at what was causing the trap when that was actually valid.

Okay, that helps, thank you very much. I will disassemble everything until the actual stall and see where that gets me to.

Chilly Willy
Very interested
Posts: 2791
Joined: Fri Aug 17, 2007 9:33 pm

Re: Popful Mail

Post by Chilly Willy » Sat Aug 24, 2019 6:38 pm

Remember this table in MD work ram...

Code: Select all

;  OS system RAM assignments
;  jump table
;  vector table is 6 bytes each, but an address only needs 4 bytes.
;  Each table entry contains 2 bytes of table data and 4 bytes of 
;  address.  In other code, when you see these vectors accessed, they
;  will always be accessed with a +2, and that is why.

os_sys_ram      equ     $fffd00
_reset          equ     os_sys_ram      ;fffd00 -reset jump table
_mlevel6        equ     _reset+6        ;fffd06 -V interrupt
_mlevel4        equ     _mlevel6+6      ;fffd0c -H interrupt
_mlevel2        equ     _mlevel4+6      ;fffd12 -external interrupt
_mtrap00        equ     _mlevel2+6      ;fffd18 -TRAP #00
_mtrap01        equ     _mtrap00+6      ;fffd1e
_mtrap02        equ     _mtrap01+6      ;fffd24
_mtrap03        equ     _mtrap02+6      ;fffd2a
_mtrap04        equ     _mtrap03+6      ;fffd30
_mtrap05        equ     _mtrap04+6      ;fffd36
_mtrap06        equ     _mtrap05+6      ;fffd3c
_mtrap07        equ     _mtrap06+6      ;fffd42
_mtrap08        equ     _mtrap07+6      ;fffd48
_mtrap09        equ     _mtrap08+6      ;fffd4e
_mtrap10        equ     _mtrap09+6      ;fffd54
_mtrap11        equ     _mtrap10+6      ;fffd5a
_mtrap12        equ     _mtrap11+6      ;fffd60
_mtrap13        equ     _mtrap12+6      ;fffd66
_mtrap14        equ     _mtrap13+6      ;fffd6c
_mtrap15        equ     _mtrap14+6      ;fffd72
_monkerr        equ     _mtrap15+6      ;fffd78 -onk
_madrerr        equ     _monkerr+6      ;fffd7e -address error
_mcoderr        equ     _monkerr+6      ;fffd7e -undefined code
_mdiverr        equ     _mcoderr+6      ;fffd84 -divide error
_mtrperr        equ     _mdiverr+6      ;fffd8e
_mnocod0        equ     _mtrperr+6      ;fffd90
_mnocod1        equ     _mnocod0+6      ;fffd96
_mspverr        equ     _mnocod1+6      ;fffd9c
_mtrace         equ     _mspverr+6      ;fffda2
_vint_ex        equ     _mtrace+6       ;fffda8
The startup code for the MD side sets a bunch of those vectors, including the TRAP #0.

Post Reply