Closed devmiyax closed 6 years ago
When it is 60fps, 0x02 is written to PTMR @ 0x06026dd8
0x06026DD6: stc sr, r3
0x06026DD4: mov.w @(0x0F6, pc), r1 ; 0x06026ECA
0x06026DD2: mov r4, r0
0x06026DD0: ldc r0, sr
0x06026DCE: or #0xF0, r0
0x06026DCC: and r3, r0
0x06026DCA: stc sr, r0
0x06026DC8: mov r0, r4
0x06026DC6: and #0x0F, r0
0x06026DC4: shlr2 r0
0x06026DC2: shlr2 r0
0x06026DC0: mov.w @(0x10A, pc), r3 ; 0x06026ECA
0x06026DBE: stc sr, r0
0x06026DBC: mov #0x01, r5
0x06026DBA: bt/s 0x06026E0C
0x06026DB8: mov #0x02, r7
0x06026DB6: tst r4, r4
0x06026DB4: mov.l @(0x118, pc), r6 ; 0x06026ECC
0x060244F0: mov #0x01, r4
0x060244EE: jsr @r14
0x060244EC: mov.w r0, @(0x01A, r4)
0x060244EA: mov.w @r6, r0
0x060244E8: mov.w r0, @(0x018, r4)
0x060244E6: mov.w @r5, r0
0x060244E4: mov.w r0, @(0x016, r4)
0x060244E2: mov.w @r6, r0
0x060244E0: mov.l @(0x05C, pc), r6 ; 0x0602453C
0x060244DE: mov.w r0, @(0x014, r4)
0x060244DC: mov.w @r6, r0
0x060244DA: mov.w r0, @(0x012, r4)
0x060244D8: mov.w @r7, r0
0x060244D6: mov.w r0, @(0x010, r4)
0x060244D4: mov.w @r6, r0
0x060244D2: mov.w r0, @(0x00E, r4)
0x060244D0: mov.w @r7, r0
0x060244CE: mov.w r0, @(0x00C, r4)
0x060244CC: mov.l @(0x06C, pc), r6 ; 0x06024538
0x060244CA: mov.w @r5, r0
0x060244C8: mov.l @(0x068, pc), r5 ; 0x06024530
0x060244C6: mov.w r0, @(0x006, r4)
0x060244C4: mov.w @r3, r0
0x060244C2: mov.w r0, @(0x004, r4)
0x060244C0: mov.l @(0x058, pc), r3 ; 0x06024518
0x060244BE: mov.w @(0x058, pc), r0 ; 0x06024516
0x060244BC: mov.w r0, @(0x002, r4)
0x060244BA: mov.w r3, @r4
0x060244B8: mov.l @(0x07C, pc), r7 ; 0x06024534
0x060244B6: mov r5, r0
0x060244B4: mov.w @(0x060, pc), r3 ; 0x06024514
0x060244B2: bt 0x060244F6
0x060244B0: tst r2, r2
0x060244AE: mov.w @r0, r2
0x060244AC: mov.l @(0x080, pc), r0 ; 0x0602452C
0x06024450: bt 0x060244AC
0x0602444E: tst r1, r7
0x0602444C: mov #0x02, r1
0x06024406: add #0x20, r4
0x06024404: bf/s 0x0602444C
0x06024402: tst r1, r1
0x06024400: mov.l @r15, r1
0x060243FE: mov.l @(0x04C, pc), r14 ; 0x06024448
0x060243FC: mov.w r0, @(0x00E, r4)
0x060243FA: mov.w r0, @(0x00C, r4)
0x060243F8: mov.w @(0x020, pc), r6 ; 0x06024418
0x060243F6: mov r14, r0
0x060243F4: mov.w r1, @r4
0x060243F2: mov.w r0, @(0x016, r6)
0x060243F0: mov.w @r3, r0
0x060243EE: mov.w r0, @(0x014, r6)
0x060243EC: mov.l @(0x058, pc), r3 ; 0x06024444
0x060243EA: mov.w @r2, r0
0x060243E8: mov.w r3, @r6
0x060243E6: add #0x20, r4
0x060243E4: mov #0x09, r3
0x060243E2: mov r6, r4
0x060243E0: shlr r5
0x060243DE: mov #0x0A, r1
0x060243DC: mov.l @(0x064, pc), r2 ; 0x06024440
0x060243DA: shlr2 r5
0x060243D8: add #0x60, r5
0x060243D6: mov r14, r5
0x060243D4: mov.l r4, @r5
0x060243D2: add r6, r4
0x060243D0: add r2, r4
0x060243CE: add #0x60, r2
0x060243CC: mov r14, r2
0x060243BA: bf 0x060243CC
0x060243B8: tst #0x02, r0
0x060243B6: extu.w r0, r0
0x060243B4: mov.w @r13, r0
0x060243B2: mov.l @(0x08C, pc), r6 ; 0x0602443C
0x060243B0: mov.w @(0x066, pc), r4 ; 0x06024416
0x060243AE: mov.l @(0x08C, pc), r5 ; 0x06024438
0x060243AC: mov.w r0, @r13
0x060243AA: xor #0x02, r0
0x060243A8: mov.w @r13, r0
0x060243A2: bt 0x060243A8
0x060243A0: tst r7, r3
0x0602439E: mov #0x01, r3
0x0602439C: mov r0, r7
30fps
***** VOUT 2183 *****
Write VBE=0 line = 0
frame_change_plot 1
***** VOUT(T) 1,1*****
YglEraseWriteVDP1xx: clear 1
YglFrameChangeVDP1: swap drawframe =1 readframe = 0
[VDP1] Displayed framebuffer changed. EDSR=01
[VDP1] frame_change_plot == 1 start drawing immidiatly
Vdp1Draw
YglRenderVDP1: drawframe =1
Vdp1Draw end at 30 line EDSR=03
Write PTMR 0 line = 31
***** VIN *****
YglRenderFrameBuffer: fb 0
Write PTMR 1 line = 237
VDP1: VDPEV_DIRECT_DRAW
Vdp1Draw
YglRenderVDP1: drawframe =1
***** VOUT 2184 *****
Write VBE=0 line = 0
frame_change_plot 0
60fps
***** VOUT 2178 *****
Write VBE=0 line = 0
frame_change_plot 1
***** VOUT(T) 1,1*****
YglEraseWriteVDP1xx: clear 0
YglFrameChangeVDP1: swap drawframe =0 readframe = 1
[VDP1] Displayed framebuffer changed. EDSR=01
[VDP1] frame_change_plot == 1 start drawing immidiatly
Vdp1Draw
YglRenderVDP1: drawframe =0
Vdp1Draw end at 30 line EDSR=03
Write PTMR 0 line = 31
Write PTMR 2 line = 40
***** VIN *****
YglRenderFrameBuffer: fb 1
Write VBE=1 line = 225
Write FCM=1 FCT=1 VBE=1 line = 225
manual change
I do not see this issue on my port. I changed a bit the way to handle PTMR , FCM and FCT. Maybe you can have a look... I did this to better fit the documentation of VDPx. And then I had some bugs hidden that were revealed, like static image in ManxTT and I also fixed this... Hope it can help you or provide some hints...
write PTMR 1 history
0x06026E1E: ldc r0, sr
0x06026E1C: or #0xF0, r0
0x06026E1A: and r3, r0
0x06026E18: stc sr, r0
0x06026E16: mov r0, r4
0x06026E14: and #0x0F, r0
0x06026E12: shlr2 r0
0x06026E10: shlr2 r0
0x06026E0E: stc sr, r0
0x06026E0C: mov.w @(0x0BE, pc), r3 ; 0x06026ECA
0x06026DBC: mov #0x01, r5
0x06026DBA: bt/s 0x06026E0C
0x06026DB8: mov #0x02, r7
0x06026DB6: tst r4, r4
0x06026DB4: mov.l @(0x118, pc), r6 ; 0x06026ECC
0x060244A6: mov #0x00, r4
0x060244A4: jsr @r14
0x060244A2: mov.w r0, @(0x01A, r4)
0x060244A0: add #0xFF, r0
0x0602449E: add r3, r0
0x0602449C: mov.w @r6, r0
0x0602449A: mov.w @r7, r3
0x06024498: mov.w r0, @(0x018, r4)
0x06024496: mov.w @r5, r0
0x06024494: mov.w r0, @(0x016, r4)
0x06024492: add #0xFF, r0
0x06024490: add r3, r0
0x0602448E: mov.w @r6, r0
0x0602448C: mov.w @r7, r3
0x0602448A: mov.w r0, @(0x014, r4)
0x06024488: add #0xFF, r0
0x06024486: add r3, r0
0x06024484: mov.l @(0x0A4, pc), r7 ; 0x06024528
0x06024482: mov.w @r5, r0
0x06024480: mov.w @r7, r3
0x0602447E: mov.w r0, @(0x012, r4)
0x0602447C: mov.w @r6, r0
0x0602447A: mov.w r0, @(0x010, r4)
0x06024478: add #0xFF, r0
0x06024476: add r3, r0
0x06024474: mov.w @r5, r0
0x06024472: mov.w @r7, r3
0x06024470: mov.l @(0x0B4, pc), r7 ; 0x06024524
0x0602446E: mov.w r0, @(0x00E, r4)
0x0602446C: mov.w @r6, r0
0x0602446A: mov.w r0, @(0x00C, r4)
0x06024468: mov.w @r5, r0
0x06024466: mov.w r0, @(0x006, r4)
0x06024464: mov.w @r2, r0
0x06024462: mov.w r0, @(0x004, r4)
0x06024460: mov.l @(0x0B8, pc), r2 ; 0x06024518
0x0602445E: mov.w @(0x0B8, pc), r0 ; 0x06024516
0x0602445C: mov.w r0, @(0x002, r4)
0x0602445A: mov.w r2, @r4
0x06024458: mov.l @(0x0C4, pc), r5 ; 0x0602451C
0x06024456: mov.w @(0x0BE, pc), r2 ; 0x06024514
0x06024454: mov.l @(0x0CC, pc), r6 ; 0x06024520
0x06024452: mov r5, r0
0x06024450: bt 0x060244AC
0x0602444E: tst r1, r7
0x0602444C: mov #0x02, r1
0x06024406: add #0x20, r4
0x06024404: bf/s 0x0602444C
0x06024402: tst r1, r1
0x06024400: mov.l @r15, r1
0x060243FE: mov.l @(0x04C, pc), r14 ; 0x06024448
0x060243FC: mov.w r0, @(0x00E, r4)
0x060243FA: mov.w r0, @(0x00C, r4)
0x060243F8: mov.w @(0x020, pc), r6 ; 0x06024418
0x060243F6: mov r14, r0
0x060243F4: mov.w r1, @r4
0x060243F2: mov.w r0, @(0x016, r6)
0x060243F0: mov.w @r3, r0
0x060243EE: mov.w r0, @(0x014, r6)
0x060243EC: mov.l @(0x058, pc), r3 ; 0x06024444
0x060243EA: mov.w @r2, r0
0x060243E8: mov.w r3, @r6
0x060243E6: add #0x20, r4
0x060243E4: mov #0x09, r3
0x060243E2: mov r6, r4
0x060243E0: shlr r5
0x060243DE: mov #0x0A, r1
0x060243DC: mov.l @(0x064, pc), r2 ; 0x06024440
0x060243DA: shlr2 r5
0x060243CA: add r4, r5
0x060243C8: bra 0x060243DA
0x060243C6: add #0x60, r5
0x060243C4: mov r14, r5
0x060243C2: mov.l r3, @r5
0x060243C0: add r6, r3
0x060243BE: add #0x60, r3
0x060243BC: mov r14, r3
0x060243BA: bf 0x060243CC
0x060243B8: tst #0x02, r0
0x060243B6: extu.w r0, r0
0x060243B4: mov.w @r13, r0
0x060243B2: mov.l @(0x08C, pc), r6 ; 0x0602443C
0x060243B0: mov.w @(0x066, pc), r4 ; 0x06024416
0x060243AE: mov.l @(0x08C, pc), r5 ; 0x06024438
0x060243AC: mov.w r0, @r13
0x060243AA: xor #0x02, r0
0x060243A8: mov.w @r13, r0
0x060243A2: bt 0x060243A8
0x060243A0: tst r7, r3
0x0602439E: mov #0x01, r3
0x0602439C: mov r0, r7
0x06026F94: mov.l @r15+, r14
0x06026F92: rts
0x06026F90: mov.l @r15+, r13
0x06026F8E: mov.l @r15+, r12
0x06026F8C: mov.l @r15+, r11
0x06026F8A: mov.l @r15+, r10
0x06026F88: mov.l @r15+, r9
0x06026F86: mov.l @r15+, r8
0x06026F84: lds.l @r15+, pr
0x06026F82: add #0x04, r15
0x06026F80: mov.b r14, @r3
0x06026F7E: mov r11, r0
0x06026F7C: mov.l @(0x13C, pc), r3 ; 0x060270B8
0x06026F52: mov.l r6, @r9
0x06026F50: bra 0x06026F7C
0x06026F4E: bf 0x06026F26
0x06026F4C: tst r2, r2
0x06026F4A: mov.b @r3, r2
0x06026F48: mov.l @(0x174, pc), r3 ; 0x060270BC
0x06026F24: mov r14, r6
0x06026F22: bra 0x06026F48
0x06026F20: mov.l @(0x194, pc), r7 ; 0x060270B4
0x06026F1E: bt 0x06026F54
0x06026F1C: tst r12, r1
0x06026F1A: mov.l @r15, r1
0x06026F18: mov.b r14, @r2
0x06026F16: mov.b r14, @r3
0x06026F14: mov.l @(0x19C, pc), r2 ; 0x060270B0
0x06026F12: mov.l @(0x19C, pc), r3 ; 0x060270AC
0x06026F10: mov r5, r11
0x06026F0E: mov #0x02, r5
0x06026F0C: bt/s 0x06026F12
0x06026F0A: tst r3, r3
0x06026F08: mov.b @r2, r3
0x06026F06: mov.l @(0x1A8, pc), r2 ; 0x060270AC
0x06026F04: mov.b r12, @r2
0x06026F02: mov.b r14, @r3
0x06026F00: mov.l @(0x1A8, pc), r2 ; 0x060270A8
0x06026EFE: mov.l @(0x1A8, pc), r3 ; 0x060270A4
0x06026EC8: mov.l r2, @r7
0x06026EC6: bra 0x06026EFE
0x06026EC4: or r8, r2
0x06026EC2: mov.l @(0x008, r4), r2
0x06026EC0: mov.l r3, @r6
0x06026EBE: mov.l @(0x004, r4), r3
0x06026EBC: mov.l r1, @r5
0x06026EBA: mov.l @r4, r1
0x06026EA8: add #0x08, r7
0x06026EA6: bf/s 0x06026EBA
0x06026EA4: cmp/hi r12, r10
0x06026EA2: mov r5, r7
0x06026EA0: add #0x04, r6
0x06026E9E: mov r5, r6
0x06026EFC: add #0x0C, r4
0x06026EFA: bra 0x06026E9E
0x06026EF8: add #0x0C, r5
0x06026EB8: mov.l r2, @r7
0x06026EB6: bra 0x06026EF8
0x06026EB4: mov.l @(0x008, r4), r2
0x06026EB2: mov.l r3, @r6
0x06026EB0: mov.l @(0x004, r4), r3
0x06026EAE: mov.l r2, @r5
0x06026EAC: mov.l @r4, r2
0x06026EAA: add #0xFF, r10
0x06026EA8: add #0x08, r7
0x06026EA6: bf/s 0x06026EBA
0x06026EA4: cmp/hi r12, r10
0x06026EA2: mov r5, r7
0x06026EA0: add #0x04, r6
0x06026E9E: mov r5, r6
0x06026EFC: add #0x0C, r4
0x06026EFA: bra 0x06026E9E
0x06026EF8: add #0x0C, r5
0x06026EB8: mov.l r2, @r7
0x06026EB6: bra 0x06026EF8
0x06026EB4: mov.l @(0x008, r4), r2
0x06026EB2: mov.l r3, @r6
0x06026EB0: mov.l @(0x004, r4), r3
0x06026EAE: mov.l r2, @r5
0x06026EAC: mov.l @r4, r2
0x06026EAA: add #0xFF, r10
0x06026EA8: add #0x08, r7
0x06026EA6: bf/s 0x06026EBA
0x06026EA4: cmp/hi r12, r10
0x06026EA2: mov r5, r7
0x06026EA0: add #0x04, r6
0x06026E9E: mov r5, r6
0x06026EFC: add #0x0C, r4
0x06026EFA: bra 0x06026E9E
0x06026EF8: add #0x0C, r5
0x06026EB8: mov.l r2, @r7
0x06026EB6: bra 0x06026EF8
0x06026EB4: mov.l @(0x008, r4), r2
0x06026EB2: mov.l r3, @r6
0x06026EB0: mov.l @(0x004, r4), r3
0x06026EAE: mov.l r2, @r5
0x06026EAC: mov.l @r4, r2
0x06026EAA: add #0xFF, r10
0x06026EA8: add #0x08, r7
0x06026EA6: bf/s 0x06026EBA
0x06026EA4: cmp/hi r12, r10
0x06026EA2: mov r5, r7
0x06026EA0: add #0x04, r6
0x06026E9E: mov r5, r6
0x06026EFC: add #0x0C, r4
0x06026EFA: bra 0x06026E9E
0x06026EF8: add #0x0C, r5
0x06026EB8: mov.l r2, @r7
0x06026EB6: bra 0x06026EF8
0x06026EB4: mov.l @(0x008, r4), r2
0x06026EB2: mov.l r3, @r6
0x06026EB0: mov.l @(0x004, r4), r3
0x06026EAE: mov.l r2, @r5
0x06026EAC: mov.l @r4, r2
0x06026EAA: add #0xFF, r10
0x06026EA8: add #0x08, r7
0x06026EA6: bf/s 0x06026EBA
0x06026EA4: cmp/hi r12, r10
0x06026EA2: mov r5, r7
0x06026EA0: add #0x04, r6
0x06026E9E: mov r5, r6
0x06026E9C: mov.l @(0x058, pc), r8 ; 0x06026EF4
0x06026E9A: extu.b r10, r10
0x06026E98: mov.b @r3, r10
0x06026E96: mov.l @(0x05C, pc), r5 ; 0x06026EF0
0x06026E94: mov.l @(0x058, pc), r4 ; 0x06026EEC
0x06026E92: mov #0x01, r12
0x06026E90: bf/s 0x06026F06
0x06026E8E: cmp/pl r2
0x06026E8C: extu.b r2, r2
0x06026E8A: mov.b @r3, r2
0x06026E88: mov.l @(0x060, pc), r3 ; 0x06026EE8
0x06026E86: mov.b r14, @r3
0x06026E84: mov.l @(0x058, pc), r3 ; 0x06026EDC
0x06027FE0: mov.l r5, @r2
0x06027FDE: rts
0x06027FDC: mov.l @(0x044, pc), r2 ; 0x06028020
0x06027FDA: bf 0x06027FCA
0x06027FD8: tst r0, r0
0x06027FD6: mov.l @r3, r0 r3=2608b2b0
0x06027FD4: or r6, r3
0x06027FD2: mov.l @(0x03C, pc), r3 ; 0x0602800C
0x06027FC8: mov #0x10, r7
0x06027FC6: bra 0x06027FD2
0x06027FC4: mov.l @(0x058, pc), r6 ; 0x0602801C
0x06027FC2: mov #0x00, r5
0x06026E82: nop
0x06026E80: jsr @r1
0x06026E7E: mov.l @(0x068, pc), r1 ; 0x06026EE4
Branch here
0x06024450: bt 0x060244AC 0x0602444E: tst r1, r7 0x0602444C: mov #0x02, r1
0x06026F94: mov.l @r15+, r14 0x06026F92: rts 0x06026F90: mov.l @r15+, r13 0x06026F8E: mov.l @r15+, r12 0x06026F8C: mov.l @r15+, r11 0x06026F8A: mov.l @r15+, r10 0x06026F88: mov.l @r15+, r9 0x06026F86: mov.l @r15+, r8 0x06026F84: lds.l @r15+, pr 0x06026F82: add #0x04, r15 0x06026F80: mov.b r14, @r3 0x06026F7E: mov r11, r0 // R7 comes from here 0x06026F7C: mov.l @(0x13C, pc), r3 ; 0x060270B8
Sync to SCSP is case of this problem.
![Uploading image.png…]()
Sync mode
VOUT(T) 1,1 YglEraseWriteVDP1xx: clear 1 YglFrameChangeVDP1: swap drawframe =1 readframe = 0 [VDP1] Displayed framebuffer changed. EDSR=01 [VDP1] frame_change_plot == 1 start drawing immidiatly Vdp1Draw comand count = 61 YglRenderVDP1: drawframe =1 SoundRamWriteWord 00000700:0900 line=23 SoundRamWriteWord 00000710:0900 line=23 SoundRamWriteWord 00000720:0900 line=23 Vdp1Draw end at 30 line EDSR=01 [VDP1] Write PTMR 0 line = 31 @ 0602AB7E SoundRamWriteWord 00000700:0900 line=37 SoundRamWriteWord 00000710:0900 line=37 SoundRamWriteWord 00000720:0900 line=37 Vdp1RamWriteWord @ 0604C808 [VDP1] Write PTMR 2 line = 49 @ 0604C808 VIN
Async mode
***** VOUT(T) 1,1*****
YglEraseWriteVDP1xx: clear 1
YglFrameChangeVDP1: swap drawframe =1 readframe = 0
[VDP1] Displayed framebuffer changed. EDSR=01
[VDP1] frame_change_plot == 1 start drawing immidiatly
Vdp1Draw
comand count = 47
YglRenderVDP1: drawframe =1
SoundRamWriteWord 00000700:0900 line=22
SoundRamWriteWord 00000710:0900 line=22
SoundRamWriteWord 00000720:0900 line=22
Vdp1Draw end at 30 line EDSR=01
[VDP1] Write PTMR 0 line = 31 @ 0602AB7E
***** VIN *****
YglRenderFrameBuffer: fb 0
SoundRamWriteWord 00000700:0900 line=225 <- this should be down at line 37
SoundRamWriteWord 00000710:0900 line=225
SoundRamWriteWord 00000720:0900 line=225
Vdp1RamWriteWord @ 06020522
[VDP1] Write PTMR 1 line = 237 @ 06020522
VDP1: VDPEV_DIRECT_DRAW