Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Break Vice at certain opcode
2024-03-11 10:23
Gordian

Registered: May 2022
Posts: 35
Break Vice at certain opcode

Hello,
is there any possibility to create condition for breaking Vice monitor at certain opcode?
2024-03-11 10:31
JackAsser

Registered: Jun 2002
Posts: 1989
Quote: Hello,
is there any possibility to create condition for breaking Vice monitor at certain opcode?


VICE has the option to automatically launch the monitor and break when you get a CPU JAM (Opcode $02)
2024-03-11 10:40
Gordian

Registered: May 2022
Posts: 35
Thanks, JackAsser. I would like to stop at $58 opcode. Any ideas?
2024-03-11 11:34
chatGPZ

Registered: Dec 2001
Posts: 11136
I don't think that is possible at this point. What are you trying to do? :)
2024-03-11 11:48
Gordian

Registered: May 2022
Posts: 35
Quote: I don't think that is possible at this point. What are you trying to do? :)

I'm trying to find out why or rather when routine at $AB1E clears interrupts flag. I'm too lazy to trace ROM dissasembled code;)
2024-03-11 13:59
ChristopherJam

Registered: Aug 2004
Posts: 1380
Is that a flag that's set on entry, or are you wondering why it interferes with an interrupt routine setting the flag when it returns?

(just looking suspiciously at the PLP at B6C0)
2024-03-11 14:22
Gordian

Registered: May 2022
Posts: 35
Quote: Is that a flag that's set on entry, or are you wondering why it interferes with an interrupt routine setting the flag when it returns?

(just looking suspiciously at the PLP at B6C0)


ChristopherJam,
you hit a bull's eye:)
I was wondering why it interferes with my interrupt routine.

Putting PHP before $AB1E call solves problem.

Thank you!

chatGPZ
I think that condition would be nice improvement.

P.S. Thanks you all for your time.
2024-03-11 15:47
ChristopherJam

Registered: Aug 2004
Posts: 1380
Glad we could help!

Personally I owe a debt of gratitude to Ninja for All about Your 64 V0.64 - I just went clicking through the multi-file html version to see what I could find (much as I had my suspicions it might be a PLP somewhere).
2024-03-11 15:57
chatGPZ

Registered: Dec 2001
Posts: 11136
Funky, under what conditions does it do that?

And talking about conditions - you can actually do what was requested, like:

break exec $a000 $bfff if @cpu:(pc) == $58

edit: tested and fixed
2024-03-11 17:50
Gordian

Registered: May 2022
Posts: 35
Quote: Funky, under what conditions does it do that?

And talking about conditions - you can actually do what was requested, like:

break exec $a000 $bfff if @cpu:(pc) == $58

edit: tested and fixed


chatGPZ
Just check flags after SEI and after return from $AB1E:
   sei 
   
   lda #<loadingString
   ldy #>loadingString
   jsr $ab1e
  
   jmp *
   
loadingString
!scr "some string",0


ChristopherJam
Personally I use:
http://www.unusedino.de/ec64/technical/misc/c64/romlisting.html
and
https://skoolkid.github.io/sk6502/c64rom/index.html
The second map shows by what routines $AB1E is used. I've made quick view, but haven't find any PHP in calling routines...:)
2024-03-11 21:03
chatGPZ

Registered: Dec 2001
Posts: 11136
But it must push the status too when it pulls it, no? else stack will be misaligned? or what am i missing there?

That said, chrout ($ffd2) also has a CLI in it somewhere.
2024-03-11 21:13
JackAsser

Registered: Jun 2002
Posts: 1989
Quote: But it must push the status too when it pulls it, no? else stack will be misaligned? or what am i missing there?

That said, chrout ($ffd2) also has a CLI in it somewhere.


I suppose the kernel developers always assumed that interrupts should be enabled after a critical section and just did a CLI regardless of state before. *shrugs*

It would save some bytes having that assumption.

SEI/CLI vs PHP/SEI/PLP (also return values in carry would need special treatments if PLP is to be used)
2024-03-12 12:12
Gordian

Registered: May 2022
Posts: 35
Ok, so the reason is not PLP...
It is just CLI at $E6B4, which is part of routine at $E6A8, which is used not directly by $FFD2, which is used by...

Tested via setting break before JSR $AB1E, then setting: break exec $a000 $bfff if (FL & 4) == $0
2024-03-12 13:39
ChristopherJam

Registered: Aug 2004
Posts: 1380
Sorry about the red herring in that case :D
2024-03-12 14:50
Gordian

Registered: May 2022
Posts: 35
That's fine!
My solution of course is not solution. Calling PHP before/SEI after could be until custom IRQ vector is not set.
2024-03-13 00:09
Krill

Registered: Apr 2002
Posts: 2852
Quoting Gordian
That's fine!
My solution of course is not solution. Calling PHP before/SEI after could be until custom IRQ vector is not set.
What do you actually want to achieve?

And would simply disabling all IRQ sources (and then temporarily re-enabling those that you need) be an option?
2024-03-13 11:00
Gordian

Registered: May 2022
Posts: 35
Quote: Quoting Gordian
That's fine!
My solution of course is not solution. Calling PHP before/SEI after could be until custom IRQ vector is not set.
What do you actually want to achieve?

And would simply disabling all IRQ sources (and then temporarily re-enabling those that you need) be an option?


Krill,
I'm not looking for a solution at this moment. Thanks.
As you said, disabling IRQs could be an option.
2024-03-18 12:38
wacek

Registered: Nov 2007
Posts: 501
Gordian, I assume you do not use RetroDebugger for such things? :)
2024-03-18 13:21
chatGPZ

Registered: Dec 2001
Posts: 11136
Does that really work differently in it? It is VICE afterall :) (actually not sure if this stuff actually works in the VICE release it uses)
2024-03-19 10:54
wacek

Registered: Nov 2007
Posts: 501
AFAIR it has more advanced ways for breaking (it actually might have breaking as Gordian wanted originally, didn't check), but there is also not so much need for breaking when you can go cycle by cycle, command by command or rasterline by rasterline + rewind ;) it really does best what is in the name - help debug. I have traced strange things with it many times. Especially if you are very much still in the learning phase like myself, it helps a lot.
Once I remembered placing label in a wrong place and accidentally setting decimal mode for example ;) yeah, RD rulez.
2024-03-19 12:41
chatGPZ

Registered: Dec 2001
Posts: 11136
Uh. So you don't know, and what you suggest doesn't solve the original request either. OK >_<

It is VICE, as said. And those more advanced conditions were only added recently.
2024-03-19 13:08
wacek

Registered: Nov 2007
Posts: 501
Quoting chatGPZ
Uh. So you don't know, and what you suggest doesn't solve the original request either. OK >_<


You confused AFAIK with AFAIR, LOL. And my comment was on general usability of RD for debugging, hence "such things", not "this thing". It was a general advice to use RD for debugging, and wondering that precise solution MIGHT be there.

I checked, and it's not there, the possibilities are:

1. VIC / CIA / NMI - stops when selected interruption occurs
2. CPU PC - the code will stop as the processor will start to perform instruction from selected address
3. MEMORY - stops when there will be attempt to write to the memory of the set value, for example: 4FFF <= 3F will stop code when there will be attempt to write to the cells 4FFF value less or equal to 3F. To break at any write access you can use <= FF
4. RASTER - stops when raster reaches the set line value.

According to Vice manual, it has 2 & 3 - correct?
2024-03-19 13:10
chatGPZ

Registered: Dec 2001
Posts: 11136
VICE monitor can do all of that, of course. And more :) You'll have to understand and use the breakpoint conditions.
2024-03-19 19:50
wacek

Registered: Nov 2007
Posts: 501
Yeah sure, some things easily done in RD can be also done in a complicated way in vice monitor ;) no idea why sane people would choose that route, but hey dude, whatever rocks your boat...
2024-03-19 20:14
chatGPZ

Registered: Dec 2001
Posts: 11136
It's really not that complicated if you know what you are doing. And if you do, it can do much much more than just those few things that the Retro Debugger frontend makes a little bit easier to do. I'd rather have up to date emulation and features, but whatever rocks your boat, indeed :)
2024-03-20 06:44
Gordian

Registered: May 2022
Posts: 35
Quote: Gordian, I assume you do not use RetroDebugger for such things? :)

Wacek,
the most used and my favorite tool is INC/DEC$D020/21 "debugger", but in this case VICE worked better;)
Now when I know how to debug in such situations, it can be done easily, quickly and efficiently.
2024-03-20 11:21
wacek

Registered: Nov 2007
Posts: 501
Quoting chatGPZ
It's really not that complicated if you know what you are doing.

Please show me the rewinding or mem usage dumps done in Vice.
Bashing other tools that are obviously done to serve the community and should be appreciated in the same way your work with Vice is appreciated, is just damn childish, don't you think?
RD is a great tool and admitting that does not take anything away from Vice, sheesh.
2024-03-20 11:22
wacek

Registered: Nov 2007
Posts: 501
Quoting Gordian
Wacek,the most used and my favorite tool is INC/DEC$D020/21

Same here. But believe me, for serious debugging, you should give RD a try ;)
2024-03-20 11:25
wacek

Registered: Nov 2007
Posts: 501
Quoting chatGPZ
It's really not that complicated if you know what you are doing.

Well, I know you love to patronize, but I do know what I'm doing with Vice, thanks.
Quote:
I'd rather have up to date emulation and features

Thinking that THIS and using RD is mutually exclusive is retarded.
2024-03-20 11:47
Gordian

Registered: May 2022
Posts: 35
Quote: Quoting Gordian
Wacek,the most used and my favorite tool is INC/DEC$D020/21

Same here. But believe me, for serious debugging, you should give RD a try ;)


I believe! And debugging is always serious thing for me:)
2024-03-20 13:11
chatGPZ

Registered: Dec 2001
Posts: 11136
Quote:
Please show me the rewinding or mem usage dumps done in Vice.

The only feature RD actually adds is the rewinding. memory usage dump has been in the monitor since forever (mmap). As said before, RD is a frontend - no more no less. It provides alternative ways to use VICE - but doesn't actually add features (Also the rewinding is "many snapshots" basically).
Quote:
Bashing other tools that are obviously done to serve the community and should be appreciated in the same way your work with Vice is appreciated, is just damn childish, don't you think?

I am not bashing anything. I am just mentioning facts.
Quote:
RD is a great tool and admitting that does not take anything away from Vice, sheesh.

Yes it is. I never said it is not.
Quote:
but I do know what I'm doing with Vice

Strange that you don't know these features then, or how to use them :)
Quote:
Thinking that THIS and using RD is mutually exclusive is retarded.

How? RD is stuck at a 5 year old VICE version, contains all bugs that were fixed since then, and lacks all features added since then. And it probably won't get updated either, due to the hacks added to make RD work. That's just how it is. (I still don't understand why it was never updated to use the remote protocol for that matter - THAT would be seriously cool indeed).
2024-03-20 21:39
wacek

Registered: Nov 2007
Posts: 501
Quoting chatGPZ
The only feature RD actually adds is the rewinding.[...]doesn't actually add features

Vice memmap without the chip access is useless for some of my needs. This and 'just many snapshots' are just 2 of many features that make all the difference in the world to some users.

Quote:
Strange that you don't know these features then, or how to use them :)

Not strange at all - having different tool options to choose from, sometimes users choose other option than the one the dev considers 'superior'. One of the reasons might be Slajerek's attitude towards users. Just a thought.

Quote:
How? RD is stuck at a 5 year old VICE version

You do know that people use multiple versions of Vice on same system for different things? :)
2024-03-20 21:56
chatGPZ

Registered: Dec 2001
Posts: 11136
Quote:
Not strange at all

Claiming to know it when you don't is not strange at all? OK :)
Quote:
You do know that people use multiple versions of Vice on same system for different things?

Sure. And all i said is that i prefer the most up to date one, no more no less.
2024-03-21 07:22
Martin Piper

Registered: Nov 2007
Posts: 644
In Vice monitor, I sometimes use the conditional to break at certain raster or cycle in a raster. The syntax is not that bad.
2024-03-21 08:59
wacek

Registered: Nov 2007
Posts: 501
Quoting chatGPZ
Claiming to know it when you don't is not strange at all? OK :)

No, it's not strange at all I knew there is breakpoints functionality in Vice and I decided not to go deeper into what is possible and instead used something else for the same purpose. I don't think you will ever get it why, because you just don't have that user-oriented mentality.

By the way you skipped the important points I mentioned and laser focused on the one that has no real merit, but OK, nihil novi here, your normal "discussion" tactics ;)
2024-03-21 09:03
wacek

Registered: Nov 2007
Posts: 501
GPZ, as long as we are talking, and I do not follow the development of Vice so closely, what were the reasons behind changing the interface and keyboard shortcuts so many times in Vice?
2024-03-21 13:57
chatGPZ

Registered: Dec 2001
Posts: 11136
Quote:
No, it's not strange at all I knew there is breakpoints functionality in Vice and I decided not to go deeper into what is possible and instead used something else for the same purpose. I don't think you will ever get it why, because you just don't have that user-oriented mentality.

I totally do get why you do it, i do the same with eg git - i use a frontend for many things, because i don't want to learn tons of weird command line options.
That's totally unrelated to what the point was though - maybe reread the discussion.
Quote:
By the way you skipped the important points I mentioned and laser focused on the one that has no real merit, but OK, nihil novi here, your normal "discussion" tactics

Aha. Perhaps the fact that none of your assertion addresses what the OP asked for was the whole point. And the fact that RD can't help with what the OP asked for. And that everything you said can be summarized to "OH JESUS VICE MONITOR IS SO MUCH HARDER TO USE NO SANE PERSON USES THIS USE RD INSTEAD", which doesn't help with what asked at all. We weren't discussing whats a better debugger. We weren't discussing how terrible VICE monitor is. We were discussing how to solve a certain problem - in the VICE monitor.
Just an idea :)
Quote:
what were the reasons behind changing the interface and keyboard shortcuts so many times in Vice?

That has been explained so many times it becomes a bit silly, but here it is again: The interface was changed, because using a portable library (GTK) for all targets is much more maintainable than dealing with different APIs and code for each target (RD does exactly the same thing for the exact same reason). We basically reduced the amount of time and developers needed by a factor of 3. The alternative would have been to drop the Windows port completely - because in 5 or so years not a single person stepped up to maintain it.

As for the keyboard shortcuts - it was a hand full (like 5 or so) that were different between the Windows port and every other port (for some reason beyond my knowledge), it was just natural to use those that have been in use in every other port since forever. You can always use the provided legacy mapping file if you prefer the old windows shortcuts. (And it wasn't "so many times". It was once.)
2024-03-21 15:47
ChristopherJam

Registered: Aug 2004
Posts: 1380
The shortcut changes are coming from inside the house!

Wacek, configure all of your VICE instances the same way, then the churn will stop.
2024-03-22 08:58
wacek

Registered: Nov 2007
Posts: 501
Quoting chatGPZ
I totally do get why you do it, i do the same with eg git - i use a frontend for many things, because i don't want to learn tons of weird command line options.
That's totally unrelated to what the point was though - maybe reread the discussion.

My view of that is different but I don't really have the time and energy anymore to continue with that. The main point was I found your comments on RD offensive towards the developer of that tool.

Quote:
And that everything you said can be summarized to "OH JESUS VICE MONITOR IS SO MUCH HARDER TO USE NO SANE PERSON USES THIS USE RD INSTEAD"

I never said this LOL :) I use the vice monitor all the time for simple tasks during development, but for critical debugging when something seriously strange fucks up it's much more effective to use RD with its "just many snapshots" ;) and stepping features. That is all. And RD still could use some popularization among people, which vice honestly does not need :) get over it, will ya.

Quote:
We weren't discussing whats a better debugger.

One, this is not soviet russia where discussions cannot fork to the side ;) Two, I mentioned RD as an alternative way to try to do this, and you have thrown a tantrum.

Quote:
That has been explained so many times it becomes a bit silly

Again, not everyone follows the vice development so closely, same goes for the csdb forums. Thanks for the clarifications, changing the shortcuts is a challenge to the muscle memory ;). Honestly though, I do understand the GTK reasoning, for the keyboard shortcuts not so much. These are different machines with different keyboards (I mean PC, Amiga and Mac) and I am pretty sure there are maybe 2-3 people in the world that are switching between these systems, definitely not the majority of the users, right? How would that really influence the development efforts to keep the historical setup? (asking genuinely because you know I am not a programmer IRL).
2024-03-22 09:00
wacek

Registered: Nov 2007
Posts: 501
Quoting ChristopherJam
Wacek, configure all of your VICE instances the same way, then the churn will stop.

ALL YOUR VICE IS BELONG TO US! ;)
But I do not use differently configured instances, I use different versions for different things, and I know for a fact I'm not the only one ;)
2024-03-22 15:26
chatGPZ

Registered: Dec 2001
Posts: 11136
Quote:
I never said this LOL :)

You really want to reread the discussion.

Quote:
These are different machines with different keyboards (I mean PC, Amiga and Mac) and I am pretty sure there are maybe 2-3 people in the world that are switching between these systems, definitely not the majority of the users, right?

No idea what you are on there. PC and Mac keyboards are similar enough. Amiga is irrelevant as there has been no VICE port for Amiga for many years. Also the shortcuts *were the same* for all platforms, always. *except* for Windows.

Quote:
How would that really influence the development efforts to keep the historical setup?

As said above: "You can always use the provided legacy mapping file if you prefer the old windows shortcuts."
Other than that it just makes life a lot easier when all ports work exactly the same.
2024-03-22 15:55
ChristopherJam

Registered: Aug 2004
Posts: 1380
Quoting wacek
I use different versions for different things, and I know for a fact I'm not the only one ;)


Oh I'm aware of that - I'm just saying you can configure the newer ones to have the old keybindings (or vice(sic) versa), then all your vicen will have the same bindings as each other. Problem solved :D
2024-03-23 04:35
Martin Piper

Registered: Nov 2007
Posts: 644
In Vice: break 0 ffff if rl == $32

Will break if the raster line (RL) is equal to $32 and if the PC is between 0 and ffff.

It's not hard to see that using a smaller PC range is useful for finding specific code that executes at certain raster lines.
2024-03-23 05:18
Fungus

Registered: Sep 2002
Posts: 624
Seems easy enough to use to me, but I do wish you could have multiple conditions on a break point so you can check ranges.
2024-03-23 06:07
oziphantom

Registered: Oct 2014
Posts: 478
the conditions do support || and && so you can do
`break 1000 if a <= 20 || a >=128` for example
2024-03-23 12:49
chatGPZ

Registered: Dec 2001
Posts: 11136
Yes, reread the docs on releases :) Some of those things were added relatively recently.
2024-03-24 13:32
wacek

Registered: Nov 2007
Posts: 501
Quoting chatGPZ
You really want to reread the discussion.

You really want to provide a quote for me saying "no sane person is using vice monitor". You are paraphrasing what you understood via your subjective lens, not what I actually said.

Quote:
No idea what you are on there.

Again, though it was pretty clearly stated - there was (IMHO obviously) no need to "sync" keyboard shortcuts if virtually no one is switching between platforms. That was my point, not if the keyboards are different. For me that was a pure OCD move really.
I know you don't care about the end users too much ;) but to give you a very practical example, when you're doing mass submissions to csdb and need to produce screenshots quickly, the switch from alt+C to shift+alt+R (not to mention the workflow afterwards) is pretty infuriating and slows you down significantly.
OK, so the shortcuts were the same "except" for Windows, but which platform version is the biggest user group? You adapted majority to minority, or am I incorrect here?
Think about this: how much time passed from the early versions of WinVice till the first one with changed shortcuts, multiplied by number of users that are on windows. That's the probable impact of that change.

And don't get me wrong - you do what you need to do, it's just my thoughts on the subject.
2024-03-24 13:34
wacek

Registered: Nov 2007
Posts: 501
Quoting ChristopherJam
I'm just saying you can configure the newer ones

But keyboard shortcuts are not the only reason I use different versions of vice :) there are other more important reasons, that are not solved by instances with different configs.
2024-03-24 16:29
ChristopherJam

Registered: Aug 2004
Posts: 1380
Quote: Quoting ChristopherJam
I'm just saying you can configure the newer ones

But keyboard shortcuts are not the only reason I use different versions of vice :) there are other more important reasons, that are not solved by instances with different configs.


I get that - which is why I'm suggesting keep your different versions of vice, and configure the keyboard shortcuts of each one of them to the same thing (either oldschool windows vice, or the ones that everyone else has used since forever).

The only config I'm suggesting changing are the keyboard shortcuts.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Shake/Role
jmin
Ax!s/Onslaught - TND
CopAss/Leader
Higgie/Kraze/Onslaught
Thierry
Smasher/F4CG
Unlock/Padua/Albion
Guests online: 65
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Original Suppliers
1 Black Beard  (9.7)
2 Derbyshire Ram  (9.5)
3 hedning  (9.2)
4 Baracuda  (9.1)
5 Jazzcat  (8.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.201 sec.