English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 09 October 2018, 11:50   #1
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,187
SMC detection

I have just tried to use the WinUAE debugger to find some SMC and it doesn't appear to work for me. I made some simple test code and the debugger didn't break with "smc 1". I have used the following code for testing (using a standard 68000/A500 config):
Code:
START    lea    SMC(pc),a0

.LMB    btst    #6,$bfe001
    bne.b    .LMB


    move.w    #$4e71,(a0)
    ;rts
    tst.w    d0
    clr.w    d1


SMC    rts
    rts
I have added the bogus tst/clr dx instructions after the first test to make sure the short distance to the modified instruction isn't the problem but it didn't change anything.


What am I missing here?
StingRay is offline  
Old 09 October 2018, 13:55   #2
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 47
Posts: 2,799
I remember having such problems. But have you turned off JIT? because with JIT it's guaranteed that it DOESN'T work.

My whdload setup as some magical winuae start/stop command to turn on/off JIT & turn off/on MMU when running whload.

that would be super-cool if it worked, because whdload protectSMC is fairly limited, and there are a lot of SMC games out there...
jotd is offline  
Old 09 October 2018, 13:58   #3
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,187
JIT is of course turned off (68000/A500 config as mentioned). When doing WHDLoad stuff I always have JIT turned off as well. It would indeed be nice if the SMC detection worked, could save quite a bit of time.
StingRay is offline  
Old 09 October 2018, 14:05   #4
musashi5150
move.w #$4489,$dff07e
musashi5150's Avatar
 
Join Date: Sep 2005
Location: Norfolk, UK
Age: 37
Posts: 2,297
I think oldskool debuggers used to put ILLEGAL (or something) to trap breakpointed code through a vector. I wonder if UAE is doing something similar (with some clever slight-of-hand-magic so the Amiga can't see the value) rather than watching the PC - and you lose the magic when you SMC.

But I'm just guessing and quite possibly talking sausages
musashi5150 is offline  
Old 09 October 2018, 20:20   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,223
Memwatch point handling changed many releases ago and it affected smc (and few other debugger options).

You need to add "dummy" memwatch range, for example "w 0 0 80000 none" if code is in chip ram. (I guess some shortcut to add all ram regions would be nice to have..)

"More compatible" CPU option also must be ticked.
Toni Wilen is offline  
Old 09 October 2018, 21:19   #6
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,187
That does indeed work, thanks! And yes, a shortcut to add all the ram regions would be incredibly useful indeed.

Last edited by StingRay; 09 October 2018 at 21:25. Reason: typo
StingRay is offline  
Old 09 October 2018, 21:52   #7
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 47
Posts: 2,799
Some day I'll have to read the WinUAE reference manual, well, better read Toni's mind
jotd is offline  
Old 14 October 2018, 17:37   #8
Paradroid
Rock Lobster
 
Join Date: Nov 2012
Location: Macclesfield
Age: 44
Posts: 39
I've tried looking and failed to find any info/notes about memwatch changes, so what happened with it?

I ask as my usual method of triggering a breakpoint in my code is to add "clr.w $80000" at the point I want to break, then use "w1 80000" in the debugger. This has worked fine until I tried it today, so I started installing older versions of winua and found that it stopped working as of version 3.6.0

The "More Compatible" option is ticked in my config, although it's greyed out.


Do I need to type something different in the debugger now?
Paradroid is offline  
Old 14 October 2018, 18:30   #9
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,223
w has always needed size parameter (w <num> <address> <length> [optional stuff]>. It probably was accidental side effect if it worked without it previously.
Toni Wilen is offline  
Old 14 October 2018, 18:48   #10
Paradroid
Rock Lobster
 
Join Date: Nov 2012
Location: Macclesfield
Age: 44
Posts: 39
Quote:
Originally Posted by Toni Wilen View Post
w has always needed size parameter (w <num> <address> <length> [optional stuff]>. It probably was accidental side effect if it worked without it previously.
It would use a size of 1 if not specified, but I've just tried again using "w1 80000 2" to be sure and it's still not working in 3.6.0 ~ 4.0.1

However, I should have mentioned that I'm using the GUI debugger, and I've just been reading the "UAE debugger updates" thread and noticed your "Don't mention anything about GUI." comment. Does this mean the GUI debugger is now effectively dead?

EDIT: I just tried "w0 80000" and it works.
Paradroid is offline  
Old 14 October 2018, 21:54   #11
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 47
Posts: 2,799
I noticed that if you don't have watchpoint 0 active then the others don't work.

Also the trainer feature (C command) doesn't work anymore (deep trainer works). And yes, the GUI version is not maintained anymore. I got used to the text mode, with proper colors & quick edit mode it's good enough
jotd is offline  
Old 16 October 2018, 20:41   #12
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,223
Memwatch checking was optimized and it accidentally required that first slot is in use. Fixed.
Toni Wilen is offline  
Old 07 January 2019, 00:18   #13
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 47
Posts: 2,799
It works but a little too well. In fact, it seems to "prefetch" the next instruction.

Code:
>g
SMC at 00011118 - 0001111A (2) from 00011094
Cycles: 9767 Chip, 156272 CPU. (V=152 H=213 -> V=195 H=219)
  D0 00000000   D1 0000F800   D2 0007F800   D3 0000FFFF
  D4 00000000   D5 FFFF0000   D6 00000FF8   D7 00000009
  A0 000536C0   A1 00063296   A2 00030AB2   A3 00072536
  A4 00031A6A   A5 0003142A   A6 00000000   A7 000005A4
USP  0007FC00 ISP  000005A4 SFC  00000005 DFC  00000005
CACR 80008000 TC   00008000 ITT0 00000000 ITT1 00000000
DTT0 00000000 DTT1 00000000 VBR  483F6000 MSP  0007F800
MMUS 00000000 URP  483EA000 SRP  483EA000
T=00 S=1 M=0 X=0 N=0 Z=0 V=0 C=0 IMASK=3 STP=0
00011100 23c8 00df f04c           MOVE.L A0,$00dff04c
00011106 23c8 00df f054           MOVE.L A0,$00dff054
Next PC: 0001110c
>d $11094
00011094 23c5 0001 1116           MOVE.L D5,$00011116 [ffff0000]
0001109A 5489                     ADDA.L #$02,A1

>d $11114
00011114 4e75                     RTS
00011116 ffff                     ILLEGAL
00011118 0000 48a7                OR.B #$a7,D0
0001111C f000 0640                [ MMUOP030 D0,#$0640 ]
The error clearly points in a data zone (just after & before some code). Badly written as data should be in another area, but that's life. But SMC detector trips a lot on single long/word data surrounded by actual code.

Also, be aware that you need to reduce WinUAE memory (I've set 2mb chip & 4mb fast) or the PC freezes when entering "SMC 1". Strange, as the memory watched is always 0->80000.
jotd is offline  
Old 07 January 2019, 17:57   #14
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,223
It detects any instruction fetch access which includes prefetches, it does not (and can't) know if CPU "uses" the fetched opcode word.

68000 + more compatible mode has extra checks to detect some branch-like instructions (mainly RTS/RTD/RTE/RTR and BRA.B). It possible to add same support for 68020+ more compatible. If more compatible is off, it should also disable prefetch emulation.

Memory size shouldn't make any difference as long as all memory is inside first 16M (24-bit addressing).
Toni Wilen is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Collision Detection sandruzzo Coders. General 5 10 June 2016 13:50
Joypad detection TuKo support.WinUAE 6 14 March 2015 16:12
Better gamepad detection Maren request.UAE Wishlist 8 25 November 2009 19:03
M.I.D.I. in detection bug GROSDAMS support.WinUAE 2 13 September 2008 02:05
HRTMon configuration options and SMC detector jotd request.UAE Wishlist 1 23 October 2006 23:38

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:40.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.07753 seconds with 13 queries